PDA

View Full Version : Info about chroma upsampling


Soulhunter
21st January 2006, 16:00
Pixelation in high-saturated red or blue

http://img461.imageshack.us/img461/7362/rgbvsyv122oa.png (http://imageshack.us)

The effect: It has nothing to do with the encoding, its the decoding. All MPEG codecs use the YV12 colorspace, and YV12 stores the chroma (color) at 1/4 the resolution of the luma (brightness). Why? Well, the human eye/brain is less sensitive to chroma than to luma, so its a nice way to save some space...

The problem: As the chroma is stored at 1/4 of its real resolution, it has to be resized back to its original resolution while playback. Probably you already know that there are a lot different resampling algorithms out there to resize a image, some good ones, and some bad ones. Unfortunately some render methods use nearest-neighbor resizing which looks pixelated!

How to do it right: Ok, to get the chance for correct chroma upsampling at all, you have to force the decoder to output YV12! XviD's decoder for example outputs YUY2 at default, so you have to set YV12 output in its decoder config, otherwise XviD would upsample the chroma from YV12 to YUY2 with the above mentioned nearest-neighbor resampling. Well, other decoders like ffdshow output YV12 at default afaik, so in this case there is no need to change the settings.

Ok, after making sure that the decoder outputs YV12, there are 3 ways to make sure that the chroma gets upsampled correctly, which to use depend on the capabilitys of your graphicscard...


1. Use "VMR9" as renderer

Pro: Good quality chroma upsampling
Con: Can produce a flickering with "VMR9 windowed" if anti-aliasing is activated
Con: Not all players allow you to set the renderer manually (one that does is MPC)
Con: Possible 0-255 -> 16-235 level conversion (http://img461.imageshack.us/img461/9500/gf6600gtsourcevsyv12vmr97zl.png)
Con: You need WinXP + DirectX9


2. Use "Overlay" as renderer + FFDShows HQ YV12 to RGB32 conversion

Pro: High quality chroma upsampling
Con: Seems Radeon cards have problems with high resolution RGB -> Overlay (http://forum.doom9.org/showpost.php?p=772467&postcount=66)
Con: Some graphicscards can only display YUV colorspaces correctly via Overlay
Con: Its slower than VMR9


3. Use Overlay + a graphicscard with inbuild HQ YV12 to RGB conversion

Pro: High quality chroma upsampling
Pro: Should be faster than VMR9
Con: Not all cards do it


EDIT1: Seems nvidias VMR9 level conversion was fixed (http://forum.doom9.org/showthread.php?p=795019#post795019)
EDIT2: Seems nvidia cards can upsample chroma correctly via overlay now (http://forum.doom9.org/showthread.php?p=813302#post813302)

__________________________________________________________________

Related threads:

- 02/04/2006 (http://forum.doom9.org/showthread.php?t=109476)

- 20/02/2005 (http://forum.doom9.org/showthread.php?t=90306)

- 20/01/2005 (http://forum.doom9.org/showthread.php?t=88673)


Bye

cjei
21st January 2006, 16:33
i don't think vmr9 have good quality chroma upsampling.

http://www.avsforum.com/avs-vb/showthread.php?t=595484&page=2

Soulhunter
21st January 2006, 17:14
i don't think vmr9 have good quality chroma upsampling.

Sure you have used "VMR9 windowed" and not "VMR9 renderless" and the decoder feeded it with non pre-converted YV12 ? Coz here it upsamples the chroma correctly... (http://img7.imageshack.us/img7/3314/chrupsampling4vf.jpg) :\


Tia n' Bye

cjei
22nd January 2006, 03:33
With MPC, decoder feeded vmr9 windowed with yv12 and vmr9 renderless with yuy2.
And actually I get a better result with renderless.

Strange.... am i the only one who get this?

jared1999
25th January 2006, 02:59
Using VMR9 Renderless I get the same result as Soulhunter; YV12 is the only output colorspace that doesn't cause aliasing. VMR9 Windowed had aliased output regardless of chosen colorspace (?).
By testing this I also found CPU usage to be much higher if there is color space conversion at the decoder (i.e. not YV12 as output).

(Tested with ATI Radeon 9800 Pro running 5.10 driver, and the Xvid 1.1.0 decoder)

Soulhunter
25th January 2006, 04:40
Using VMR9 Renderless I get the same result as Soulhunter; YV12 is the only output colorspace that doesn't cause aliasing. VMR9 Windowed had aliased output regardless of chosen colorspace (?).

Could you also do a test with YV12 -> Overlay please?

Coz my Radeon9200 does proper upsamling this way...


By testing this I also found CPU usage to be much higher if there is color space conversion at the decoder (i.e. not YV12 as output).
Yeah, the color-conversion eats some cpu cycles...

And the transfer of RGB data should be slower as well (more bits than YV12)


Tia n' Bye

jared1999
25th January 2006, 14:29
Could you also do a test with YV12 -> Overlay please?
Done. Results are the same as with VMR9 Renderless. YV12 is fine, while YUY2 and RGB24/32 have aliasing.

As a sidenote, adjusting the colorspace was the final adjustment I needed to get nice CPU usage from MPC with the Xvid decoder. Thanks for the info! :goodpost:
My MPC settings are now VMR9 Renderless with PS Bicubic 0.75 resizer, lock back buffer turned off (causes 100% cpu in fullscreen when on if using PS sizer), YV12 output, and both chroma and luma deblocking. Tests with a 960x528 1800 kbit/s clip with AC3 5.1 sound yields ~50-60% cpu usage on a 2.8 GHz P4. Before any tweaks the cpu usage was 90-100%.

Soulhunter
25th January 2006, 15:58
Results are the same as with VMR9 Renderless. YV12 is fine, while YUY2 and RGB24/32 have aliasing.
Ok, thanks for the confirmation... ^^


Bye

Oline 61
5th March 2006, 23:30
The new Forceware 84.12 BETA does a 0-255 -> 16-235 level conversation unlike older drivers. If you have an Nvidia card and video looks washed out (i.e. what should be black is a dark gray) using VMR9, then upgrade to forceware 84.12 BETA, and VMR9 will look great. Right now I have FFDShow send YV12 to VMR9 and it looks great, with a proper level conversion and high quality chroma scaling.

Soulhunter
5th March 2006, 23:38
The new Forceware 84.12 BETA does a 0-255 -> 16-235 level conversation...
Thats what I wrote... :\
Some graphicscards (like my GeForce 6600 GT) do a 0-255 -> 16-235 level conversion
But Id like to keep the input 0-255, speak; no level conversation/alternation!


Bye

breez
5th March 2006, 23:52
There seems to be a mistake, 84.12 does a 16-235 -> 0-255, which is correct for PC displays. Previous drivers left 16-235 untouched.

Oline 61
5th March 2006, 23:58
Basically:

What happened before:
input video was 16-235. It was displayer as 0-255 with no conversion, so the darkest black available was 16 as opposed to 0 which is what it should have been.

What happens with 84.12
input 16-235 is scaled to 0-255, so that all values that were 16 are now 0, and are displayer properly. I believe that inbetween values are interpolated similarly to resizing a video with a bilinear filter.

Soulhunter
6th March 2006, 00:20
16-235 -> 0-255... Ok, now it makes sense! Anyway, the proper way would be to add a option into the GFX settings to select between 16-235->0-255 (TV-scale -> PC-scale), 0-255->16-235 (PC-scale -> TV-scale... for output on TV) and 1:1 (which keeps the input as it is), heh!?


Thanks for the info, Bye

Soulhunter
6th March 2006, 00:23
Btw, where you got the v.84.12 beta?

The latest i can find is v.82.12... :\


Bye

foxyshadis
6th March 2006, 00:25
What would make the most sense would be to embed the information at the container or video stream level, and have the splitter/decoder pass it to the renderer, but colorometry is already so screwed up in the consumer digital video world that it would probably only add a whole host of new screwups. Personally I'd love to be able to use the extra breathing room in PC range.

Oline 61
6th March 2006, 00:26
http://nzone.com/object/nzone_downloads_rel70betadriver.html
Thats a very good idea to have a choice as to what you want to do. You should tell nVidia that!

Soulhunter
6th March 2006, 00:48
@ foxyshadis

Well, if they'd keep the levels untouched I'd be already happy... coz, if you really need to do a level conversion you can do it via postprocessing (ie. via FFDShow), huh?


@ Oline 61

Thanks for the link!

Hmm, think i gonna write a request mail to nvidia...

- Option to disable level conversions
- Otional HQ 0-255->16-235 / 16-235->0-255 conversions
- HQ chroma upsampling (bilinear intrpolation) via overlay mode
- Optional lanczos fullscreen resizing instead of bicubic intrpolation


Bye

Soulhunter
6th March 2006, 01:23
Mail send! Hope the right ppl reads it n' not some dude of a service-center...

Hi, I have some feature requests/suggestions for you driver developers!

Option to disable level conversations
The old drivers did a 0-255 -> 16-235 level conversion, the new driver does a 16-235 -> 0-255 level conversion, but the proper way would be to add a option into the GFX settings to select between 16-235->0-255 (TV-scale -> PC-scale... for playback on PC displays), 0-255->16-235 (PC-scale -> TV-scale... for output on TV) and 1:1 (which keeps the input as it is... for ppl who want to use custom level conversions via some directshow filters or so)

HQ 0-255->16-235 / 16-235->0-255 conversations
Instead of a usual "dumb" level conversions which created "gaps" some HQ conversation should be used! Here is a example how the levels should look when using a smooth conversion -> http://img32.imageshack.us/img32/3779/pc2tv9gz.jpg / http://img32.imageshack.us/img32/5512/tv2pc1db.jpg

HQ chroma upsampling for YV12 and other colorspaces with subsampled chroma
Instead of dumb pixel-doubling some interpolation (ie. bilinear) should be used to upsample the chroma, via VMR9 as renderer its already possible -> http://img370.imageshack.us/img370/8331/chrupsampling4vf9qv.png <- But adding support for this via Overlay-mode would be a nice addition (same goes for the level conversions)

Optional lanczos resampling for resizing
Current graphics cards seem to use some soft resizing method (bicubic interpolation?) but there are better interpolation methods like lanczos which blur the image much less... would be a nice addition!


Thanks n' Bye

Oline 61
6th March 2006, 01:56
Excellent. Hopefully someone who knows what the heck they're doing will read it and see the logic.

cjei
7th March 2006, 06:06
I recently reinstall my windows and have the test again..

With Radeon 9550 + Catalyst 6.2, VMR9 (renderless and windowed) is doing dumb pixel-doubling chroma upsampling for both yv12 and yuv2.

So, VMR9 does not always has Good quality chroma upsampling.

Soulhunter
7th March 2006, 16:11
I recently reinstall my windows and have the test again..

With Radeon 9550 + Catalyst 6.2, VMR9 (renderless and windowed) is doing dumb pixel-doubling chroma upsampling for both yv12 and yuv2.

So, VMR9 does not always has Good quality chroma upsampling.
Have you tried Overlay-mode? As I wrote in the first post; My Radeon does proper upsampling via direct YV12 -> Overlay feed! VMR9 is the preferable method for NVidia cards, not for Radeons...


Bye

foxyshadis
7th March 2006, 16:54
With Radeons (never used a recent gforce) you can use VMR7, which usually uses overlay anyway, to get proper luma range and chroma upsampling while giving you renderless mode benefits.

Peuj
7th March 2006, 17:09
Hi,

I'm a little lost... I have an NVidia card, I'm using MPC with VMR9 renderless (render in 3D and bilinear PS 2.0) and ffdshow (no dvix or xvid codec installed).

About the color space conversion, what should I set in the Output section of ffdshow for PC->TV ? just YV12 and uncheck the others ?
and if it's just on the PC ?

thanks

Soulhunter
7th March 2006, 17:11
@ foxyshadis

Hmm, with my Radeon9200 I get improper upsampling via VMR7-Renderless, VMR7-Windowed seems to do it right... But via VMR7-Windowed I have this "high res RGB input produces jaggy edges" problem again... :\


Bye

Soulhunter
7th March 2006, 17:20
@ Peuj

Well, on a TV you wont notice the wrong upsampled chroma anyway, so "any input -> VMR9" should do it. But for playback on a PC disable everything except RGB32 in FFDShow -> Enable the HQ YV12 to RGB conversion -> Set Overlay output in MPC... or, if you have the new NVidia beta drivers disable everything except YV12 in FFDShow and set VMR9 (windowed I think) as renderer!


Bye

Peuj
7th March 2006, 17:31
ok thanks !!

futurex
8th March 2006, 01:00
my radeon X600 playes vmr9 renderless with dscaler, ffdshow and YV12 perfectly, without the jaggies.

but this has only been so with MPC 6.4.8.8. before that, mpc didn't support vmr9 renderless YV12, had to use windowed. check the changelog :)

breez
8th March 2006, 17:40
It is actually possible to change between TV and PC levels through a registry setting with the 84.12 drivers. More info here http://www.avsforum.com/avs-vb/showthread.php?t=652139

Oline 61
9th March 2006, 00:02
Well it shouldn't be too hard for them to add that option to the GUI.

3ngel
9th March 2006, 02:16
Hi to all,

i'm very interested in this discussion so i did a little test. The configuration is:

ATI x800, Catalyst 6.2, MPC, VRM9 Renderless, Xvid Decoder

This image is with the colorspace on Xvid forced to YV12:
http://img137.imageshack.us/img137/1066/snapshot200603090206296kt.png

This image is with the colorspace on Xvid forced to RGB32:
http://img137.imageshack.us/img137/243/snapshot200603090206507ry.png

Hope this help :)

Oline 61
9th March 2006, 02:38
Looks like the conversion from TV to PC isn't happening on the YV12 screenshot. I think that FFDShow automatically does the conversion on RGB32 material when High Quality Conversion is checked.

Soulhunter
14th April 2006, 05:56
Just played around with the latest nvidia beta drivers...

Seems interpolated chroma-upsampling via overlay works now!


Bye

Oline 61
14th April 2006, 18:56
w00t w00t!!!
What was the version number Soulhunter?

Soulhunter
14th April 2006, 21:40
w00t w00t!!!
What was the version number Soulhunter?

Its was v.84.43 from 12/04/06 iirc... ^^


Bye

obieobieobie
17th April 2006, 04:50
Hi, does anyone know what VMR9 mode Zoomplayer 3.20 uses? It doesn't say if it's renderless or windowed. Is there any way for me to find out?

Also, will disabling all but YV12 in FFDSHOW output force YV12 or do I need to do something more? Edit: I see it was answered earlier in the thread. Sorry about that. :)

foxyshadis
17th April 2006, 06:24
3.2? That's older than I am, why don't you upgrade to 4.5? o.O (fwiw, the answer is windowless. The new one lets you select windowed, windowless, or renderless.)

obieobieobie
17th April 2006, 16:08
3.2? That's older than I am, why don't you upgrade to 4.5? o.O (fwiw, the answer is windowless. The new one lets you select windowed, windowless, or renderless.)
Thank you.

Why haven't I upgraded? Because I haven't felt the need to and because I don't like layout of the right-click menu in the versions post 3.20

Maybe that has been fixed/altered.. I should try it again sometime.

CeeJay.dk
3rd May 2006, 20:32
It's "conversion" not "conversation".
http://www.answers.com/conversion
http://www.answers.com/conversation

BTW does someone have a good clip I can use to test if my setup is correctly upsampling chroma ?

Also I notice that the chroma upsampling is slightly less sharp than the source (for obvious reasons ofcourse).
Wouldn't it be a good idea to do a subtle form of sharpening to chroma , not unlike what the technique described here :
http://www.outbackphoto.com/dp_essentials/dp_essentials_05/essay.html

In both cases we are dealing with a reduced chroma resolution , it's just stems from CCD debayering in one case and colorspace conversion in the other (and actually both if the videosource was shot with a digital videocamera)

Soulhunter
3rd May 2006, 21:06
Yeah, my english skills suck, but as nobody else noticed it means Im not alone... Anyway, to answer your questions: To test if the chroma upsampling is done properly something like the red/blue letters Ive posted are enough... PhotoShop -> BMP -> VDub -> Uncompressed YV12... takes just a minute! For the sharpening: Yes, slight chroma could be fine, but the problem is that you have to do it after the chromaupsampling! Well, using two ffdshow's in row could solve this... YV12 -> ffdshow -> HQ YV12 to RGB32 conversion -> Output -> 2nd ffdshow (set ffdshow to "decode" raw RGB32, then it should start 2 processes) -> sharpening -> output as RGB32 again... My suggestion for chroma sharpening would be aWarpSharp with mild settings as it reduced the blur from the upsampling without causing aliasing (hey, we just removed via the upsampling) like most other sharpeners!


Bye

foxyshadis
4th May 2006, 01:57
So you might as well just do the resize in ffdshow's resize dialog, then you can pick your end size and method and follow it right up with a sharpen, instead of futzing with chaining two ffdshows.

Also, aWarpSharp's effects are basically the same as XSharpen, right? I'm not too familiar with the different modes of the former.

Soulhunter
4th May 2006, 02:23
So you might as well just do the resize in ffdshow's resize dialog, then you can pick your end size and method and follow it right up with a sharpen, instead of futzing with chaining two ffdshows.
Uhm, but then you would apply the sharpening to YV12 (still subsampled chroma) and the interpolation afterwards (the upsampling) would blur the chroma again, no?


Also, aWarpSharp's effects are basically the same as XSharpen, right? I'm not too familiar with the different modes of the former.
Nah, xSharpen is a sharpener which produces no halos (in difference to most other sharpeners) but heavy aliasing (thats why mf wrote SSxSharpen), and aWarpSharp is a filter which "warps" the edges (it presses the stuff close to the edges towards/into the edges) like the original WarpSharp, just different/better. Well, there was also this "SSXSharpen in realtime" thing I posted some time ago which was a combination of aSharp and aWarpSharp that gave nearly the same results as mf's script, just 20x faster... >.>


Bye

foxyshadis
4th May 2006, 03:24
Well, you can use the avisynth filter to call converttorgb32() and pass the results on to the resize & sharpen filters. Avisynth uses bilinear sampling for the chroma, right?

Strange that ffdshow has no integrated colorspace conversion filter, only on output; it'd be nice to be able to change it in between (and have multiple copies). Ah well, maybe in the future someday.

Oh, and if you could PM me that ssxsharpen "realtime" method, if you still have it, I'd love to try it. It'd make vmtoon so much faster...

CeeJay.dk
4th May 2006, 09:56
The SSXsharpen in realtime is here :
http://forum.doom9.org/showthread.php?s=&threadid=87514

I was planning to try it out soon, as a post-processing sharpening solution.
I'm trying to create the perfect blend of decoder/post-process filters/renderer to make my playback as good as possible.

I used to be lanczos-resizing to x2 in ffdshow, sharpening a little in that step and then using asharp with subtle settings on top of that - it works very well.
Now i'm experimenting with the Haali renderer and it's 2pass bicubic resizer/sharpener and asharp on top of that.

I'm hoping realtime "SSXsharpen" or LimitedSharpen2 will turn out to provide better results than asharp and still be fast enough for realtime post-processing.

I'm also using ColorMatrix() from within ffdshow to correct the colors.

An idea .. perhaps post-processing of the chromaupsample is something best handled by the renderer ?
Maybe a custom MPC shader could do it ? .. or maybe Haali will either put this feature into his renderer or provide the means for others to run their custom shaders in his renderer ?

Soulhunter
7th June 2006, 11:30
Someone here knows how to contact the ATI devs? I have a bug report (high resolution RGB video gets downscaled when feeding it to overlaymixer, tested with multiple cards) but in difference to the nvidia site I cant find a e-mail address, just a fu*king support phone number... >.<


Tia n' Bye

obieobieobie
9th June 2006, 00:32
Someone here knows how to contact the ATI devs? I have a bug report (high resolution RGB video gets downscaled when feeding it to overlaymixer, tested with multiple cards) but in difference to the nvidia site I cant find a e-mail address, just a fu*king support phone number... >.<


Tia n' Bye
http://support.ati.com/ics/survey/survey.asp?deptID=894&surveyID=486&type=web

Soulhunter
9th June 2006, 12:11
Not as good as a e-mail address, but still better than a phone number... ^^


Thanks n' Bye

Shinji-kun
2nd September 2010, 16:23
I have an ATI Radeon 3200 HD video card. I have a problem with chroma upsampling apparently. I originally asked about a problem in this thread (http://forum.doom9.org/showthread.php?t=156485) but I haven't gotten much help there. Also the guide in the OP post is somewhat confusing. Can anyone give some instructions for how to fix the upsampling? Or maybe a faq?

Ghitulescu
2nd September 2010, 19:00
Chroma upsampling bug has nothing/less to do with the graphic card than with MPEG-2 algorithm.

In some 2 days you could have searched to see WTF is chroma upsampling bug everyone talks about.

leeperry
2nd September 2010, 19:09
Can anyone give some instructions for how to fix the upsampling?
you could try this test pattern I created a while ago for this very purpose: http://www.mediafire.com/?zirwxawggmy

most likely madVR will provide the best results anyway ;)

Steveo08
3rd September 2010, 10:29
what's with nvidia cards do i still need chroma upsampling with a pixel shader in mpc-hc on a gt220?

Shinji-kun
3rd September 2010, 17:14
I'll post a sample later. My video is still blurry and grainy. The color is dull and the quality is bad overall, even though I am encoding it to X264.

Does anyone know how to increase sharpness, reduce the blurring, clouding effect and increase the overall quality? Please mention the Avisynth plugins that would be used. Fixing the chroma upsampling has NOT helped these other problems.

roozhou
3rd September 2010, 19:26
what's with nvidia cards do i still need chroma upsampling with a pixel shader in mpc-hc on a gt220?
If you are viewing low resolution video under fullscreen, the YV12 chroma upsampling shader in mpc-hc will lead to two resizing routines. 1st is upscaling YV12 to RGB32 at original resolution, and 2nd is upscaling RGB32 to fullscreen. If you are not using shader, it will be upscaled only once. The more resizing you do, the worse image quality you get.

Shinji-kun
4th September 2010, 22:13
I am trying to encode another video from the same DVD set. There are many recurring issues in this video as well and even some worse ones.

From the attached images, you can see some type of chroma or combing artifacts. The general quality of the video was blurry and very grainy. Does anyone know how to fix these problems?

Steveo08
5th September 2010, 12:48
If you are viewing low resolution video under fullscreen, the YV12 chroma upsampling shader in mpc-hc will lead to two resizing routines. 1st is upscaling YV12 to RGB32 at original resolution, and 2nd is upscaling RGB32 to fullscreen. If you are not using shader, it will be upscaled only once. The more resizing you do, the worse image quality you get.



so it's better to watch a movie without the pixel shader for chroma upsampling?

roozhou
5th September 2010, 14:34
so it's better to watch a movie without the pixel shader for chroma upsampling?
Yes. The chroma upsampling shader is only needed when your video card driver is doing something wrong.

Steveo08
5th September 2010, 15:54
ok, thank you!

Shinji-kun
4th October 2010, 22:39
I have tried all the suggestions in this thread but MPC still shows pixelation for on the edges of red objects. This DOES NOT happen when I view the same MKV (X264) files in vdub or AvsP. I think the problem may be with ffdshow. How can I fix the upsampling?

Soulhunter
5th October 2010, 16:14
May I point out that my info-post is from 2006 and perhaps no more valid due to 1 billion changes in the drivers/decoders/players that took place in the last 4 years? :3

Shinji-kun
5th October 2010, 17:20
May I point out that my info-post is from 2006 and perhaps no more valid due to 1 billion changes in the drivers/decoders/players that took place in the last 4 years? :3

Well, whatever the case, I still have some type of aliasing that only appears on the chroma. I tried getting the most recent ffdshow and changing various setting but no luck. What do you suggest?

On a random note, is DVDfabDecrypter v5 freeware or trialware and if trialware does it still work when the trial period "expires"?