View Full Version : SSIM 0.24, an objective video quality metric
Unearthly
9th November 2007, 01:40
But how to trim the last frame of the original clip ?
I didn't find any solution in the Avisynth "Trim" explanations. :scared:
Assuming your clip is b:
b = Trim(0,b.frameCount-2)
frameCount is a clip property (http://avisynth.org/mediawiki/Clip_properties).
avdw
9th November 2007, 01:46
Assuming your clip is b:
b = Trim(0,b.frameCount-2)
frameCount is a clip property (http://avisynth.org/mediawiki/Clip_properties).
Thanks a lot Unearthly, I'm constantly learning :)
So, my .d2v file is a , my .avi file is b
a=MPEG2Source("C:\Original.d2v").crop(16,70,-8,-70).bicubicResize(512,224,0,0.5)
b=AVISource("C:\encoded.avi").trim(1,0)
....
return ssim(a,b,"results.csv","averageSSIM.txt",lumimask=true)
shouldn't it be : a = Trim(0,b.frameCount-2) then ?
Unearthly
9th November 2007, 03:17
Thanks a lot Unearthly, I'm constantly learning :)
So, my .d2v file is a , my .avi file is b
a=MPEG2Source("C:\Original.d2v").crop(16,70,-8,-70).bicubicResize(512,224,0,0.5)
b=AVISource("C:\encoded.avi").trim(1,0)
....
return ssim(a,b,"results.csv","averageSSIM.txt",lumimask=true)
shouldn't it be : a = Trim(0,b.frameCount-2) then ?
No. It would be:
a = Trim(0,a.frameCount-2)
I said 'Assuming your clip is b', meaning if it isn't b, substitute all instances of b for your clip's name, which in this case is 'a'.
avdw
9th November 2007, 03:38
Well, I have :
a = MPEG2Source("N:\My DVDs\Le Gendarme de Saint Tropez\VTS_02_1.d2v").crop(16,70,-8,-70).bicubicResize(512,224,0,0.5)
b = AVISource("N:\My DVDs\Le Gendarme de Saint Tropez\testertje.avi").trim(1,0)
a = Trim(0,a.frameCount-2)
return ssim(a,b,"results.csv","averageSSIM.txt",lumimask=true)
resulting in "Script Error : Invalid arguments to function "Trim" :(
Unearthly
9th November 2007, 03:45
Well, I have :
a = MPEG2Source("N:\My DVDs\Le Gendarme de Saint Tropez\VTS_02_1.d2v").crop(16,70,-8,-70).bicubicResize(512,224,0,0.5)
b = AVISource("N:\My DVDs\Le Gendarme de Saint Tropez\testertje.avi").trim(1,0)
a = Trim(0,a.frameCount-2)
return ssim(a,b,"results.csv","averageSSIM.txt",lumimask=true)
resulting in "Script Error : Invalid arguments to function "Trim" :(
Aha, that was a goof on my part (too used to using last).
a = a.Trim(0,a.frameCount-2)
zambelli
9th November 2007, 09:04
You can use this function to always make sure your source and encoded clips are the same length:
fc = (a.Framecount > b.Framecount) ? b.Framecount : a.Framecount
a = a.Trim(0,-fc)
b = b.Trim(0,-fc)
foxyshadis
9th November 2007, 09:57
Or you can just ignore it, since avisynth will pad an extra frame onto the end of the shorter clip anyway. It might not match up just right, but it's probably going to be a black frame anyway, right?
zambelli
9th November 2007, 10:14
Or you can just ignore it, since avisynth will pad an extra frame onto the end of the shorter clip anyway. It might not match up just right, but it's probably going to be a black frame anyway, right?
Actually, no - SSIM() throws an error if the compared clips aren't exactly the same length.
I've used SSIM A LOT in my days testing WMV9/VC-1 encoders. :)
Gannjunior
27th March 2008, 23:50
i'm doing som tests...for example:
- source 1920,1080
- x264 2pass (Qmedium=22) 1280,720 compression is better without any doubts of x264 QB=11 640,352 compression. (it is an obviousness).
Why do i obtain SSIM result almost completely close? (97.83 for 1280x and 97.90 for 640x...off course i would expected 640x lower...)...i'm (almost, beacuse the source is VC-1 and seeking it correctly is a big problem..) sure to compare exactly the same frames...
maybe the result is normal since both are good encoding and in particular SSIM of 640x is about encoding QB=11 (..."saturated") and SSIM is more affected, in this case, by the 'quality' of quantizers, without evaluates the resolution effect that are very better at a reasonable quantizers value than a "saturated" encode at very lower resolution....
ciao!
tritical
10th July 2011, 21:59
Does anyone have a link to a paper or other source where the idea for the luminance masking in SSIM.dll comes from? If I am reading the source right, it gives all blocks with mean luminance <= 40 0 weight, any blocks with mean luminance >= 50 1.0 weight, and linearly interpolates between 0 and 1 for mean luminance between 40 and 50. To me it seems a little extreme to give 0 weight to any block below 40, and to ramp so quickly to 1. Just wondering where the 40 and 50 values came from.
Revgen
11th July 2011, 04:06
^The people at MSU made their own SSIM app. They may be able to give you an idea.
http://compression.ru/video/quality_measure/video_measurement_tool_en.html
tritical
11th July 2011, 07:36
The MSU implementation does not seem to use any luminance weighting. The main SSIM paper doesn't mention it AFAICT, and the author's MATLAB implementation does not use it. I'm only asking because I'm writing a filter to compute MAD, MSE, SSIM, PSNR-HVS, and PSNR-HVS-M, and was comparing my SSIM implementation to SSIM.dll. The luminance masking just seems strange to me... not the concept necessarily, but how it is implemented (40/50 cut points, etc...). It would be interesting to know where it comes from.
samuraibrian
21st November 2011, 17:12
The MSU implementation does not seem to use any luminance weighting. The main SSIM paper doesn't mention it AFAICT, and the author's MATLAB implementation does not use it. I'm only asking because I'm writing a filter to compute MAD, MSE, SSIM, PSNR-HVS, and PSNR-HVS-M, and was comparing my SSIM implementation to SSIM.dll. The luminance masking just seems strange to me... not the concept necessarily, but how it is implemented (40/50 cut points, etc...). It would be interesting to know where it comes from.
Hi tritical - did you get around to writing your multi-metric filter?
Pix
2nd January 2012, 21:22
Could anyone explain why does the ssim average formula not match with the value in the .txt
I'm comparing only 2 frames.
Getting higher than 0.90 SSIM on both and somehow the average in .txt is 71
I understand this is a scaled value but what does it mean?
That the encode looks 71% as source?
Or, does it look more than 90% as source?
cjplay
7th February 2012, 23:54
All,
Quick heads-up that I tried to use this with Compare and Compare failed to produce results in the Logs. Thanks, Lefungus, for the dll, wherever you are.
-CJ
m3sh
16th April 2012, 07:18
Could anyone explain why does the ssim average formula not match with the value in the .txt
I'm comparing only 2 frames.
Getting higher than 0.90 SSIM on both and somehow the average in .txt is 71
I understand this is a scaled value but what does it mean?
That the encode looks 71% as source?
Or, does it look more than 90% as source?
Pix - The computed average in the .txt file is a scaled value given by the formula:
scaled = 100*(unscaled)^8
:D
This has the effect of exagerating the values in the index (and also, incidentally, would have to do away with any of the negative SSIM index unscaled values, since it's an even power). For example, a 0.925 is a 53.59 scaled, while a 0.935 is 58.41, 0.955 is a 69.19. Conversely, a 0.255 is 0.17 scaled. This scaling makes the higher end values a "useful number". You can disable this scaling by supplying the parameter "scaled=false" to the SSIM call, to get the true unscaled weighted average. This value should relatively agree with the values you'd get from --ssim in x264, or MSU's tool (ssim_fast specifically). So far in my experience they're usually within 0.01 of each other (unscaled). Comments from tritical on the luminance weighting are likely in play here in terms of explaining the discrepancies.
SSIM isn't a linear index, at least I don't think so, so definitely wouldn't view it as a percentage (though I also often have the strong impulse to view it as such).
This all does beg a question for me for the developer which is why the scaling formula it was decided to use a power of 8? Was this purely arbitrary? Why not 10? Or 6? Is there a compelling video reason to choose that power? Very curious...
Edit: Or why not an odd power to preserve negative SSIM indices for that matter?
unihumi
30th January 2013, 22:23
Is the new SSIM plugin (with On2tech's improvement suggestions) still up somewhere? The one that Wilbert put up.
Wilbert
31st January 2013, 22:03
Is the new SSIM plugin (with On2tech's improvement suggestions) still up somewhere? The one that Wilbert put up.
See SSIM 0.25.1.0 (http://www.wilbertdijkhof.com/SSIM0.25.1.0.rar) and ssim-0.24a (http://www.wilbertdijkhof.com/ssim-0.24a.zip).
I'm not sure what the difference between the two versions are, or if the fixes in 0.24a are included in 0.25.
Solon8
15th December 2015, 21:25
Hi,
I'm new to AVS scripting. I'm using this plugin right now, but it's slow!
Running the script with AVSMeter showed me my CPU is used at only 12%. Each time.
How can I make AviSynth use more CPU?
Thanks.
Also, the scaled option doesn't seem to work for me. If I write "scaled=false", it says wrong type. If I write "scaled=0", it works but the value doesn't change.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.