Manao
10th October 2003, 18:52
I used SSIM ( look here for details (http://forum.doom9.org/showthread.php?s=&threadid=61128) ) in order to measure the effect of postprocessing on an encode. The movie (Ness) lasts 1h45, and is PAL. It is not very noisy, and the mastering is good.
Let's begin with the settings I used to encode the movie :
Avisynth script :
MPEG2Source("I:\Ripp\ness.d2v",cpu2="oooooo")
crop(12,72,-12,-72)
TemporalSoften(3,3,3,6,2)
Convolution3D(0,3,4,3,4,2.6,0)
LanczosResize(704,304)
XviD's settings : HVS-Good matrix, VHQ 4, B-Frame 2,150,75,10, Chroma motion and Chroma optimizer. There was no credit range, since the credits were on a moving background. I made a two pass encoding, aiming a size of 567600 Ko ( ~ 700 Kb/sec )
Then, I used the following script to compare the SSIM value between the result, or the result postprocessed, and the original clip ( without any filtering, except resizing ) :
Source2 = MPEG2Source("I:\Ripp\ness.d2v",cpu2="oooooo").crop(12,72,-12,-72)
Source = Source2.LanczosResize(704,304).trim(0,161712).SelectRangeEvery(1000,10)
ProcessedClip = AVISource("I:\Ripp\ness.avi").Trim(1,0).BlindPP(cpu2="xxxxoo").SelectRangeEvery(1000,10)
UnProcessedClip = AVISource("I:\Ripp\ness.avi").Trim(1,0).SelectRangeEvery(1000,10)
FstMeasure = ssim(Source,ProcessedClip,"Encode1results.csv","averageSSIM1.txt",lumimask=true)
SndMeasure = ssim(Source,UnProcessedClip,"Encode2results.csv","averageSSIM2.txt",lumimask=true))
return StackVertical(FstMeasure, SndMeasure)
I obtained the following results :
Number of frames where the SSIM value for the postprocessed clip was higher / equal / lower than the the SSIM for other : 1109 / 13 / 498
Mean SSIM for the postprocessed clip : 72.21 ( 76.93 with lumimask = false )
Mean SSIM for the non-postprocessed clip : 71.91 ( 76.64 with lumimask = false )
( I made a test with cpu2 = "xxxxxx", I got 71.53. I also made a test with BilinearResize instead of LanczosResize, and with lumimask off, and I obtained respectively 81.37 and 80.91 )
Moreover, the maximum difference between the two SSIM value was 2.8 in favor of the postprocessed clip, and 1.26 in his defavor. Finally, the mean difference in favor of the postprocessed clip was 0.515, whereas it was 0.235 for the other one.
I visually inspected the portion of the clip where SSIM value where calculated. A higher value for the postprocessed clip is often correlated with the picture having an almost uniform background. At those bitrates, XviD tends to make it "move", but strangely, the deblocking corrects very well this issue. When the SSIM was lower for the postprocessed clip, the difference was hard to spot. In one case ( dark image, with small black and orange strips ), I was able able to see some differences, but not while playing back the clip.
So it confirms that postprocessing does more good than harm at low bitrates ( low for MPEG-4 compliant codecs ). I hope it'll will also help to see how SSIM works, and if we'll be able to use it as a reliable measure of distortion, close to human vision. The next test I'll do will be with the same movie, encoded at a lower resolution.
PS : for the moderators, I'm not sure where this post should go, feel free to move it on XviD's forum if you think it's fitting better there.
Let's begin with the settings I used to encode the movie :
Avisynth script :
MPEG2Source("I:\Ripp\ness.d2v",cpu2="oooooo")
crop(12,72,-12,-72)
TemporalSoften(3,3,3,6,2)
Convolution3D(0,3,4,3,4,2.6,0)
LanczosResize(704,304)
XviD's settings : HVS-Good matrix, VHQ 4, B-Frame 2,150,75,10, Chroma motion and Chroma optimizer. There was no credit range, since the credits were on a moving background. I made a two pass encoding, aiming a size of 567600 Ko ( ~ 700 Kb/sec )
Then, I used the following script to compare the SSIM value between the result, or the result postprocessed, and the original clip ( without any filtering, except resizing ) :
Source2 = MPEG2Source("I:\Ripp\ness.d2v",cpu2="oooooo").crop(12,72,-12,-72)
Source = Source2.LanczosResize(704,304).trim(0,161712).SelectRangeEvery(1000,10)
ProcessedClip = AVISource("I:\Ripp\ness.avi").Trim(1,0).BlindPP(cpu2="xxxxoo").SelectRangeEvery(1000,10)
UnProcessedClip = AVISource("I:\Ripp\ness.avi").Trim(1,0).SelectRangeEvery(1000,10)
FstMeasure = ssim(Source,ProcessedClip,"Encode1results.csv","averageSSIM1.txt",lumimask=true)
SndMeasure = ssim(Source,UnProcessedClip,"Encode2results.csv","averageSSIM2.txt",lumimask=true))
return StackVertical(FstMeasure, SndMeasure)
I obtained the following results :
Number of frames where the SSIM value for the postprocessed clip was higher / equal / lower than the the SSIM for other : 1109 / 13 / 498
Mean SSIM for the postprocessed clip : 72.21 ( 76.93 with lumimask = false )
Mean SSIM for the non-postprocessed clip : 71.91 ( 76.64 with lumimask = false )
( I made a test with cpu2 = "xxxxxx", I got 71.53. I also made a test with BilinearResize instead of LanczosResize, and with lumimask off, and I obtained respectively 81.37 and 80.91 )
Moreover, the maximum difference between the two SSIM value was 2.8 in favor of the postprocessed clip, and 1.26 in his defavor. Finally, the mean difference in favor of the postprocessed clip was 0.515, whereas it was 0.235 for the other one.
I visually inspected the portion of the clip where SSIM value where calculated. A higher value for the postprocessed clip is often correlated with the picture having an almost uniform background. At those bitrates, XviD tends to make it "move", but strangely, the deblocking corrects very well this issue. When the SSIM was lower for the postprocessed clip, the difference was hard to spot. In one case ( dark image, with small black and orange strips ), I was able able to see some differences, but not while playing back the clip.
So it confirms that postprocessing does more good than harm at low bitrates ( low for MPEG-4 compliant codecs ). I hope it'll will also help to see how SSIM works, and if we'll be able to use it as a reliable measure of distortion, close to human vision. The next test I'll do will be with the same movie, encoded at a lower resolution.
PS : for the moderators, I'm not sure where this post should go, feel free to move it on XviD's forum if you think it's fitting better there.