Log in

View Full Version : Question about color conversion


STaRGaZeR
2nd May 2008, 19:05
Hi there! This is my first post here, hope it's in the right section :)

I use BSplayer to play all my files, I find it the most complete player and the one that gives the best quality along with MPC thanks to the lots of configurable options. For me, the best results with my ATI HD3870 are using Overlay renderer in conjunction with YV12 colorspace. This means that YV12 and Overlay are a must for me.

I want to know if the following can be done. CoreAVC has an option that forces (0-255) levels when using YV12. That's exactly what I want. Obviously this only works for H.264 streams. Now the question: is it possible to do the same thing with all formats out there through FFDShow for example? I've been playing a little with it and it seems that to use (0-255) I have to select RGB32, but as I've said YV12 is somewhat mandatory. The desired formats would be MPEG2, XviD, DivX, WMV (and VC-1)...

Is this possible? Thanks in advance!

wozio
3rd May 2008, 08:26
Use VMR9 in MPC, ati uses 0-255 scale for HD and 16-235 scale for SD (vertical size less than 720 pixels) but the latter can be changed by registry tweak (search avsforum.com for UseBT601CSC).

STaRGaZeR
3rd May 2008, 13:06
As I said, I like the quality provided by Overlay and YV12 over VMR9, EVR, etc. for a number of reasons.

Is there a way to use YV12 with 0-255 with FFDShow or is restricted to RGB32? What about Xvid or DivX using 0-255?

Thanks anyway :)

LoRd_MuldeR
3rd May 2008, 14:12
Is there a way to use YV12 with 0-255 with FFDShow or is restricted to RGB32?

Goto the "Output" page in the ffdshow's "Video Decoder Configuration" dialog.
Then uncheck all output colorspaces, except for YV12 and you should get what you want...

STaRGaZeR
3rd May 2008, 17:33
Goto the "Output" page in the ffdshow's "Video Decoder Configuration" dialog.
Then uncheck all output colorspaces, except for YV12 and you should get what you want...

Yes, that guarantees YV12 output, I already have that. And then, can some option force always 0-255 like CoreAVC does?

Anyway does anybody know what scale ATI uses for Overlay?

EDIT:

This is what I want, but with all codecs:

http://img397.imageshack.us/img397/20/coretj0.png

This configuration always outputs YV12 + 0-255 levels, regardless of the content (HD, SD or whatever)

LoRd_MuldeR
3rd May 2008, 19:56
Well, in ffdshow you can select "Full range (0-255)" on the "RGB convserion" page (located in the "Video Decoder Configuration" dialog).

That won't work with all "Codecs", but at least it will take effect when ffdshow is used as decoder.
Other decoders (Codecs) might have or might not have a similar option...

If some Codec doesn't support YV12 output, you can insert ffdshow as "post-processor" and let it do the RBG -> YV12 conversion.

STaRGaZeR
4th May 2008, 02:47
As you said, that page is for RGB conversion. All those settings doesn't work for YV12 or YUV2, only for RGB:

The advanced color space options page gives you control over the YCbCr <-> RGB conversion. The top half allows the selection between the ITU-R BT.601 and ITU-R BT.709 standards, while the lower half is used for black and white cut-off, which controls the contrast.
These settings are used only when ffdshow is doing YCbCr <-> RGB conversion. In other words, if you are playing MPEG video and the output color space is YV12 or YUY2, these settings will be ignored.

But I've found a workaround that should work with every source if ffdshow is in the decoding chain. One of the filters of ffdshow is "Picture properties", there it's possible to change contrast, brightness, etc. By calibrating those values it should be possible to obtain PC levels if I'm not mistaken. Now the last question :p What are the needed values to calibrate TV levels to PC levels in the scale present in "Picture properties"?

wozio
4th May 2008, 09:07
As I said, I like the quality provided by Overlay and YV12 over VMR9, EVR, etc. for a number of reasons.

What are those reasons?

Regards
Piotr

LoRd_MuldeR
4th May 2008, 19:04
As you said, that page is for RGB conversion. All those settings doesn't work for YV12 or YUV2, only for RGB
Nope, those settings are used when RBG is converted to YV12 :p

So if you source video is in the RGB format and you force YV12 output, then ffdshow will do the RGB -> YV12 conversion for you.
And that's exactly when the "RGB conversion" settings apply!

If the source is RGB and the output is RGB, then no conversion is done and the "RGB conversion" settings have no function.
The same applies when the input is YV12 and the output YV12, because no conversion is done and no settings are needed.

ANGEL_SU
5th May 2008, 08:16
To adjust color thro codec is not a good idea.

I also get a much daker image on Overly mode, but i adjust this by setting my graphic driver. My driver allow to keep difference between "Desktop" & "OverLay" mode. So, i open a ColorBar photo both on a general application(on Desktop mode) and a media player(on Overlay mode). After just adding +8 to the brightness for Overly, it is hard for me to distinguish the diffrecence.

wozio
5th May 2008, 17:31
The same can be done for playing via VMR9 not only overlay.

STaRGaZeR
5th May 2008, 17:47
Nope, those settings are used when RBG is converted to YV12 :p

So if you source video is in the RGB format and you force YV12 output, then ffdshow will do the RGB -> YV12 conversion for you.
And that's exactly when the "RGB conversion" settings apply!

If the source is RGB and the output is RGB, then no conversion is done and the "RGB conversion" settings have no function.
The same applies when the input is YV12 and the output YV12, because no conversion is done and no settings are needed.

That's what I wanted to say, but almost all video/movies are encoded in YV12 unfortunately :p

What are those reasons?

Regards
Piotr

The most important one is because ATI cards (X1xxx, HD2XXX and HD3xxx) have a "feature" that some people hate, some people love, and it only works in Overlay mode using YV12. I'll try to explain it with an example.

You have a clip with a static circunference on it. With EVR, VMR9, etc. its border is shown more or less perfect, even, the line is composed by pixels but you can't see them. Like if you draw a circunference in a paper. An antialiased line. But with overlay, the entire line looks pixelated like if it doesn't have AA. That, if you look at the monitor too close, is horrible, but at certain distance it makes the image to look much more sharp and clean, more vivid. Now imagine a frame with a face on it, the lines are micropixelated and the face looks way more defined. The less resolution the video has, the bigger the pixelation is. With a HD movie you can't see the pixelation, but you fell the image sharper, much sharper. My guess is that this has something to do with the way the ATI driver handles resizing in Overlay using YV12. When watching cartoons this feature is specially noticeable. Now I just can't live without it :p

Other reason is that sometimes tearing appears if RGB is used.

To adjust color thro codec is not a good idea.

I also get a much daker image on Overly mode, but i adjust this by setting my graphic driver. My driver allow to keep difference between "Desktop" & "OverLay" mode. So, i open a ColorBar photo both on a general application(on Desktop mode) and a media player(on Overlay mode). After just adding +8 to the brightness for Overly, it is hard for me to distinguish the diffrecence.

Yeah that's right, but I don't like the resulting quality if you change brightness and contrast in the control center. I prefer codec adjust. The darker image you're getting maybe is caused because Overlay is using 0-255 levels instead of the standard 16-235.

BTW using ffdshow's "Picture properties", uping contrast and lowering brightness I have managed to get something that looks almost identical to 0-255 levels, anyone knows the exact values?

:thanks:

wozio
6th May 2008, 07:01
But with overlay, the entire line looks pixelated like if it doesn't have AA. That, if you look at the monitor too close, is horrible, but at certain distance it makes the image to look much more sharp and clean, more vivid.

This means that resizing in overlay is broken ;-) You can use MPCs resizing nearest neighbour if you like that kind of look. Resizing in renderer can be skipped and use MPCs bicubic resizing where you can adjust sharpness more or less.

Other reason is that sometimes tearing appears if RGB is used.

Yes this is big problem for VMR9 in windowed mode, only option here is to use fullscreen exclusive. BTW using RGB output from ffdshow can be slow since it is using much more data than yuv. Maybe this is the reason of your tearing. Fastest mode in VMR9 is yuv mixing mode with yuv input.

Yeah that's right, but I don't like the resulting quality if you change brightness and contrast in the control center. I prefer codec adjust. The darker image you're getting maybe is caused because Overlay is using 0-255 levels instead of the standard 16-235.

Quality should be exactly the same. Do you calibrate using some brightness ramp to get proper brightness.contrast levels when doing such things. Maybe darker picture in overlay mode is more pleasing to eyes in your setup because of more saturated colors but maybe it is not correct picture.

BTW using ffdshow's "Picture properties", uping contrast and lowering brightness I have managed to get something that looks almost identical to 0-255 levels, anyone knows the exact values?

b -16 c 1.16

STaRGaZeR
7th May 2008, 00:17
error

wozio
7th May 2008, 07:06
All the other renderers look more or less like EVR.
Try VMR9 renderless, 3D surfaces, then you can choose resizing via pixel shaders in MPC, not in the renderer. Then choose nearest neighbour and you will have such effect on VMR9. The same applies to EVR custom allocator.
That's strange, I also have tearing in normal fullscreen using RGB. In Direct3D fullscreen tearing is gone.
Normal behaviour, when rendering frames is not synchronized with refreshing screen, you will have tearing (part of the screen with one frame, other with next frame). I have the same thing and for me fullscreen exclusive is the only option to avoid it.

STaRGaZeR
7th May 2008, 21:12
Try VMR9 renderless, 3D surfaces, then you can choose resizing via pixel shaders in MPC, not in the renderer. Then choose nearest neighbour and you will have such effect on VMR9. The same applies to EVR custom allocator.

I already tried that, but it looks crappy as hell. It's the same effect, but waaaay too exagerated. If hardsubs are present on the image, with that pixelation you can't even read them.

http://img148.imageshack.us/img148/5396/overlaypd7.th.jpg (http://img148.imageshack.us/my.php?image=overlaypd7.jpg) http://img384.imageshack.us/img384/4531/vmr9nearestsu0.th.jpg (http://img384.imageshack.us/my.php?image=vmr9nearestsu0.jpg)

Overlay on the left, VMR9 renderless nearest neighbour on the right. In real world the difference is awesome, in that photo you can see how crappy it is.

LoRd_MuldeR
8th May 2008, 18:58
You can't expect any useful output with "nearest neighbour" mode :rolleyes:

Try "Biliniear" or even better "Bicubic" mode instead...

STaRGaZeR
9th May 2008, 00:04
Overlay all the way man... :D