PDA

View Full Version : why are xvids pixelated in dark areas


gizzin
27th April 2008, 19:48
almost every dvd i've encoded seemed to be very blocky in dark areas even when i give enough of a bitrate. Can any1 explain why this is? I havent been able to find a good explanation maybe one of the authors could field this question

Dark Shikari
27th April 2008, 20:50
The reason for this is relatively simple, and its one of the classic problems of video encoding.

Luminance (brightness) values go from 0 to 255 (or 16 to 235, in TV range). Either way, in a very dark area, there are only a very few luminance values to choose from; the actual luminance values might be a mix of 0-3, for example. This means that just a tiny bit of rounding error is really noticeable, because the range of values is so small.

Its also because you tend to notice the difference between 2 and 3 more than the difference between 200 and 201, despite the fact that technically its the same amount of difference.

Some encoders solve this through "luminance masking"; lowering the quantizer in dark areas. x264 attempts to avoid this problem using its complexity masking adaptive quantization, a somewhat similar but (IMO) better method than luminance masking.

Mr VacBob
29th April 2008, 19:16
3 vs 2 is a much bigger difference than 201 vs 200. Pixel values are originally logarithmic, and the video gamma correction doesn't quite make them linear.

Xvid's lumimasking actually raises the quantizer in dark areas; that might be a good idea if you watch everything in a bright room on a TV, but probably not otherwise.