Log in

View Full Version : Great news - SSIM 0.2, an objective video quality metric


DDogg
10th September 2003, 15:58
Lefungus, has done us all a great service and created a method of comparing original source and an encoded clip so as to provide an objective metric for comparison.

http://forum.doom9.org/showthread.php?s=&threadid=61128

This seemes to be the easiest way for those that are using this with a Facar script.

This example would compare the first 10,000 frames of the resized original to those of the encoded clip and return the
results in results.txt and the csv file (read in Excel) as results.csv. The trim statement may be needed because SSIM will not run if the framecount is not exactly the same between both clips.

SSIMTest.avs
clip1=avisource("AviSynth_Script_fileSSIM.avs").trim(0,10000)
clip2=mpeg2source("Encoded_Video_CCE_NTSC.d2v").trim(0,10000)
return ssim(clip1,clip2,"C:\rings\results.csv","C:\rings\results.txt",lumimask=true)
The "Encoded_Video_CCE_NTSC.d2v" is created with dvd2avi 1.76 by loading your MPV and making a project file (.d2v). Remember you may have to use the trim statement to make sure framecount agrees between the two clips.

The AviSynth_Script_fileSSIM.avs is a virgin FACAR with no filters so as to return video from the original VOBs that has only been resized as SSIM has to compare like resolutions. The resizing method should be the same as used in the actual encode you are comparing to. However, if you used QMF (resize =5) you would have to turn that off as it would change the original video and invalidate the test.

AviSynth_Script_fileSSIM.avsloadplugin("C:\Program Files\AviSynth 2.5\plugins\MPEG2Dec3dg.dll")
mpeg2source("C:\chicago\DVD2AV~2.D2V")
DetectedTop=6 DetectedHeight=462
ResizeTo=0 ResizeMethod=2
GammaCorrection=1.0 Hue=0 Saturation=1.0 Brightness=0 Contrast=1.0
OverscanH=0.04 OverscanV=0.04 BlockOptimization=0
global Bicubic_b_Value=0 global Bicubic_c_Value=0.6
DebugMode=0
DestinationWidth=480
DestinationHeight=360
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\SimpleResize.dll")
#Import("C:\Program Files\AviSynth 2.5\plugins\QMF\qmf15b1.avs")
#Import("C:\Program Files\AviSynth 2.5\plugins\QMF\QMF_functions.avs")
# Import("C:\Program Files\AviSynth 2.5\plugins\autocrop\PreResize.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\autocrop\FACAR.avs")
# Import("C:\Program Files\AviSynth 2.5\plugins\autocrop\PostResize.avs")

DDogg
10th September 2003, 22:59
In version 0.22, the global score is scaled from 0 to 100 instead of 0 to 1. it's just a simple conversion: newValue = 100 * pow( oldValue, 8) With this, different values between two clips may be more visible.

Edit: Cleaned up both posts to reflect new version and syntax of SSIM and replacement of SemiAutoCropAndResized with FACAR script from r6d2.