Log in

View Full Version : [ImageReader][PNG] TV/PC Luma levels...


Seb.26
19th February 2007, 14:05
Hi world :)

I've draw a calibration pattern, and save it as PNG.

My first picture is 3 dark bars :
> RGB(0;0;0) ( background )
> RGB(5;5;5) ( 1st bar )
> RGB(10;10;10) ( 2nd bar )

To allow playback in MPC, I've convert this to .avs clip by using ImageReader() and Loop(), and then encode this clip in xVid.

But when playback with FFDShow (in MPC), the level filter display that my RGB(0;0;0) is converted to luma(15) ... like if ImageReader() have converted PC level (0..255) to TV levels (15.235) ... :confused:

Does anybody have an idea ?

Thanks ! :)

Wilbert
19th February 2007, 21:18
When encoding a RGB [0,255] clip with XviD/DivX or many other encoders, the color format is converted to YUV [16,235].

When importing the RGB pic in AviSynth, the levels are still [0,255]. You can check that by using the script:

ImageSource(...) # crop to one of the three bars if necessary
RGBAdjust(analyze=true)

Seb.26
20th February 2007, 10:15
When encoding a RGB [0,255] clip with XviD/DivX or many other encoders, the color format is converted to YUV [16,235].

When importing the RGB pic in AviSynth, the levels are still [0,255]. You can check that by using the script:

ImageSource(...) # crop to one of the three bars if necessary
RGBAdjust(analyze=true)

Ok thanks !

So the remapping [0..255]->[16.235] is done during encoding, when converting RGB->YV12 ?!

And if I add "ConvertToYV12()" at the end of the script to convert the frame format to YV12() ... does this also will remap [0..255]->[16..235] ?!
... if "yes", is it possible after that to force remapping [16..235]->[0..255] in YV12 format ?!

Didée
20th February 2007, 11:07
And if I add "ConvertToYV12()" at the end of the script to convert the frame format to YV12() ... does this also will remap [0..255]->[16..235] ?!
Yes.

... if "yes", is it possible after that to force remapping [16..235]->[0..255] in YV12 format ?!
Yes.

Are you aware that the answer is lying on your hard disk? ;)
Check
[%programs_dir%]\AviSynth 2.5\Docs\english\corefilters\convert.htm

matrix = rec.601/rec.709 scales to Y/UV [16,235/240]
matrix = PC.601/709 keeps YUV at [0,255]

Seb.26
20th February 2007, 16:26
Are you aware that the answer is lying on your hard disk?
Check
[%programs_dir%]\AviSynth 2.5\Docs\english\corefilters\convert.htm

matrix = rec.601/rec.709 scales to Y/UV [16,235/240]
matrix = PC.601/709 keeps YUV at [0,255]
<< Shame on me ... >>

Thanks Didée ! ;)