PDA

View Full Version : Yv12, Mpeg2dec3 & Ssim


neily
15th April 2004, 12:20
Hi,

Whilst trying to do some encoding analyses I came across a problem whereby if I convert an original HUFFYUV compressed file from YUY2 to YV12 and try to do a subtract from an original>MPEG2>d2v "Subtract" reports that the files are of incompatible formats, yet "Info" reports both as YV12, same dimensions etc. i.e.

vid00=AVISource("T:\test.avi").ConvertToYV12
vid01=mpeg2source("S:\test.d2v")
return Subtract(vid00,vid01)

If I convert the mpeg2source to RGB24 then to YV12, there is no problem.

vid00=AVISource("T:\test.avi").ConvertToYV12
vid01=mpeg2source("S:\test.d2v").ConvertToRGB24.ConvertToYV12
return Subtract(vid00,vid01)

Interestingly, using SSIM threw no errors, though the SSIM value was higher when adding the RGB24 and YV12 conversions.

Also trying the following also produced an incompatible format error:

vid00=mpeg2source("S:\test.d2v")
vid01=mpeg2source("S:\test.d2v").ConvertToRGB24.ConvertToYV12
return Subtract(vid00,vid01)

as does

vid00=mpeg2source("S:\test.d2v").ConvertToYV12
vid01=mpeg2source("S:\test.d2v").ConvertToRGB24.ConvertToYV12
return Subtract(vid00,vid01)

Is the YV12 colour space produced by MPEG2DEC3 not the same as that internal to AVISynth? Does AVISynth not go through a colourspace conversion if it thinks that a clip is already in the target format?

I am using AVISynth 2.54, and have tried MPEG2DEC3.dll v1.0.7.0 and MPEG2DEC3dg.dll v1.0.1.0.

actionman133
15th April 2004, 12:44
ive been having the same problem. i THINK it might be the fact that subtract just doesnt like YV12 yet. i was once upon a time trying to compare lossiness from YV12 to YUY2 (if any) and got errors... but i gave up on it.

sh0dan
15th April 2004, 14:39
The subtract vs. YV12 issue is fixed in the upcomning CVS binary.

neily
15th April 2004, 18:02
Thanks for the replies, but what is the issue? Why does "Subtract" work after a ConvertToRGB24.ConvertToYV12 ?

sh0dan
15th April 2004, 18:52
Because MPEG2DEC3 actually delivers I420, which doesn't have the same pixel_type as YV12, but works the same for filters accessing frames.

neily
16th April 2004, 13:11
Thanks for the explanation sh0dan.