Quote:
Originally Posted by bxyhxyh
Then this is the result ...is it a bug or something?
|
It does look like a bug. The problem seems to be in ConvertTo8bit; its output is aprox. 1 step darker after each pass, probably a rounding issue. Using
dither seems to fix it:
Code:
Function YV12toRGB32(clip c)
{
c.convertTo16bit()
converttorgb64(matrix="Rec709")
convertto8bit(dither=0)
}
Function RGB32toYV24(clip c)
{
c.ConvertTo16bit()
ConvertToYUV444(matrix="Rec709")
convertto8bit(dither=0)
}
however this does add a dither pattern, invisible in normal footage but apparent in Colorbars etc. Adding a fixed offset also seems to work:
Code:
Function YV12toRGB32(clip c)
{
c.convertTo16bit()
converttorgb64(matrix="Rec709")
RGBAdjust(rb=127, gb=127, bb=127)
convertto8bit()
}
Function RGB32toYV24(clip c)
{
c.ConvertTo16bit()
RGBAdjust(rb=127, gb=127, bb=127)
ConvertToYUV444(matrix="Rec709")
convertto8bit()
}
Offset set to 127 because 0.5 (8bit) ≈ 127 (16bit).