Log in

View Full Version : Black levels don't seem correct, but why?


RedDwarf1
13th September 2008, 00:54
I have been converting a DVD track to XVid and have an issue that is concerning me.

I have been using AVISynth and using the fft3dGPU filter which is fairly GPU heavy and takes some time to run so I used MeGUI to produce a pre-rendering job rendering the video into a FFVH/HuffYUV lossless file which I then intended to use to do the encoding to XVid. That would enable me to do testing much quicker and avoid having to re-run the AVISynth script and GPU filter. That means the actual encoding to XVid can be done quite quickly.

But when I actually came to encode the video to XVid the blacks were not black, they had RGB values of 16,16,16 and a few pixels slightly larger RGB values. Now this rang bells to me regarding the YUV to RGB conversion and TV scale being 16-235.

I have played the pre-rendering job file with MPC and that shows true black levels RGB(0,0,0) but comparing that with the XVid and the same section has RGB(16,16,16) levels.

I have checked ffdshow which was being used to decode the FFVH/HuffYUV codec pre-render job when encoding to XVid. That is outputting 0-255 range video and I have stopped ffdshow from decoding FFVH/HuffYUV codec and tried another decoder which was on my other windows install. It definitely was not ffdshow as I checked by using graphedit to render the file.

Also a d2v file was created from the DVD files using DGIndex and PC Scale YUV to RGB was selected in that. Then that was opened using DGDecode.

I checked the video by opening up the pre-render job and XVid with Media Player Classic/KM Player/VideoLan and capturing the window and pasting into IrfanView and then testing the pixel RGB values.

So how should the XVid be? Should a DVD XVid encode have black as RGB 0,0,0 or RGB 16,16,16? Why does the video in the pre-render job have true black levels but the final XVid does not?

Cannot anyone provide an answer?

manono
13th September 2008, 01:56
Should a DVD XVid encode have black as RGB 0,0,0 or RGB 16,16,16?
DVDs and XviDs are YV12 and black is 16. If you're doing colorspace conversions somewhere in the chain, you have to be very careful how you do them.

RedDwarf1
13th September 2008, 03:02
DVDs and XviDs are YV12 and black is 16. If you're doing colorspace conversions somewhere in the chain, you have to be very careful how you do them.

There is no colour space conversion done, everything is kept as yv12. I cannot say I have noticed black being 16 before in Xvids. It seemed strange how the FFVH/HuffYUV pre-render file was true black and the Xvid was not. It was very noticeable in comparison as well.

Thanks for clearing that up. But I am not very happy with the not true black RGB(0,0,0) result.

Dark Shikari
13th September 2008, 03:48
There is no colour space conversion done, everything is kept as yv12. I cannot say I have noticed black being 16 before in Xvids. It seemed strange how the FFVH/HuffYUV pre-render file was true black and the Xvid was not. It was very noticeable in comparison as well.

Thanks for clearing that up. But I am not very happy with the not true black result.When playing back the video, the renderer will convert TV scale to PC scale luma, so 16,16,16 is true black.

Blue_MiSfit
13th September 2008, 19:29
Make sure your renderer is set up correctly. Most video card drivers get this screwed up nowadays - so my advice is to use Halli renderer, and configure it for TV range luma.

~MiSfit

dukey
15th September 2008, 11:44
When playing back the video, the renderer will convert TV scale to PC scale luma, so 16,16,16 is true black.

yeah you would expect that ? But that's not what happens.
Well with the overlay mixer, this happens. However the overlay mixer is not really compatible with Vista. VRM7 and 9 treat 0 as black. Why ? I guess MS fucked up.

You can 'correct' this by getting the decoder to do the colour conversion itself. Force the output from the decoder to RGB24 then it will do the correct conversion.

Dark Shikari
15th September 2008, 11:55
yeah you would expect that ? But that's not what happens.
Well with the overlay mixer, this happens. However the overlay mixer is not really compatible with Vista. VRM7 and 9 treat 0 as black. Why ? I guess MS fucked up.

You can 'correct' this by getting the decoder to do the colour conversion itself. Force the output from the decoder to RGB24 then it will do the correct conversion.Or you can just not use broken renderers like VMR7/9. Haali's and Overlay work just fine.