LigH
19th March 2005, 13:12
Dear developers,
for comparing different MPEG encoders and different settings (on interlaced material), I use the following script:
LoadPlugin("dgdecode.dll")
LoadPlugin("SSIM.dll")
orig = AviSource("clip.avs",false,"YUY2")
copy = MPEG2Source("clip.d2v",iPP=true).ConvertToYUY2(interlaced=true)
ssim = SSIM(orig.ConvertToYV12(interlaced=true),copy.ConvertToYV12(interlaced=true),"clip.csv","clip.txt",lumimask=true)
comp = Compare(orig,copy,"","clip.log")
diff = Subtract(orig,copy)
comp.Overlay(ssim).Overlay(diff)
This quite complex script allows to output both Compare log and SSIM result with one script (because due to using Overlay, AviSynth cannot short-cut out finally nonvisible clip manipulation branches).
With previous AviSynth versions (up to 2.56b1 2005-01-06), the script starts to create and write the files while being opened in VirtualDubMod, continues to write while "playing" the video, and finishes the files when closing the script as video source (Ctrl+W). And finally, Compare adds some summary like this:
Comparing channel(s) YUV
Mean Max Max
Absolute Mean Pos. Neg.
Frame Dev. Dev. Dev. Dev. PSNR (dB)
-----------------------------------------------------
0 3.0846 -0.0679 37 -29 35.8278
1 2.9880 -0.1292 40 -29 36.1078
...
2198 3.4815 -0.4217 62 -64 33.7323
2199 3.2116 -0.1496 45 -46 34.6600
Total frames processed: 2200
Minimum Average Maximum
Mean Absolute Deviation: 1.0070 2.6552 5.8230
Mean Deviation: -0.5087 -0.1945 +0.0120
PSNR: 29.5126 36.2167 44.7704
Overall PSNR: 35.2352
But since AviSynth 2.56b2 2005-02-21, there are two differences:
1) The Compare log is not finished until I quit VirtualDubMod completely.
2) Compare does not write a summary anymore:
...
2198 3.4815 -0.4217 62 -64 33.7323
2199 3.2116 -0.1496 45 -46 34.6600
BTW: I know that the color space conversions are not optimal, but Compare required RGB or YUY2 / SSIM requires YV12; I'll try to optimize the conversions later...
for comparing different MPEG encoders and different settings (on interlaced material), I use the following script:
LoadPlugin("dgdecode.dll")
LoadPlugin("SSIM.dll")
orig = AviSource("clip.avs",false,"YUY2")
copy = MPEG2Source("clip.d2v",iPP=true).ConvertToYUY2(interlaced=true)
ssim = SSIM(orig.ConvertToYV12(interlaced=true),copy.ConvertToYV12(interlaced=true),"clip.csv","clip.txt",lumimask=true)
comp = Compare(orig,copy,"","clip.log")
diff = Subtract(orig,copy)
comp.Overlay(ssim).Overlay(diff)
This quite complex script allows to output both Compare log and SSIM result with one script (because due to using Overlay, AviSynth cannot short-cut out finally nonvisible clip manipulation branches).
With previous AviSynth versions (up to 2.56b1 2005-01-06), the script starts to create and write the files while being opened in VirtualDubMod, continues to write while "playing" the video, and finishes the files when closing the script as video source (Ctrl+W). And finally, Compare adds some summary like this:
Comparing channel(s) YUV
Mean Max Max
Absolute Mean Pos. Neg.
Frame Dev. Dev. Dev. Dev. PSNR (dB)
-----------------------------------------------------
0 3.0846 -0.0679 37 -29 35.8278
1 2.9880 -0.1292 40 -29 36.1078
...
2198 3.4815 -0.4217 62 -64 33.7323
2199 3.2116 -0.1496 45 -46 34.6600
Total frames processed: 2200
Minimum Average Maximum
Mean Absolute Deviation: 1.0070 2.6552 5.8230
Mean Deviation: -0.5087 -0.1945 +0.0120
PSNR: 29.5126 36.2167 44.7704
Overall PSNR: 35.2352
But since AviSynth 2.56b2 2005-02-21, there are two differences:
1) The Compare log is not finished until I quit VirtualDubMod completely.
2) Compare does not write a summary anymore:
...
2198 3.4815 -0.4217 62 -64 33.7323
2199 3.2116 -0.1496 45 -46 34.6600
BTW: I know that the color space conversions are not optimal, but Compare required RGB or YUY2 / SSIM requires YV12; I'll try to optimize the conversions later...