[MPlayer-users] qscale, 2-pass, and PSNR

Jason Tackaberry tack at sault.org
Thu Jun 3 23:39:49 CEST 2004


This morning I did some experimentation with a 10000 frame clip from my
Paycheck DVD.  My goal was to examine the differences between qscale and
2-pass.

First I encoded the clip with vqscale=3:

  mencoder dvd://1 -oac copy -vf pullup,softskip,crop=720:350:0:68,hqdn3d=2:1:2 -ofps 23.976 -ovc lavc -lavcopts vcodec=mpeg4:vqscale=3:v4mv:mbd=2:trell:mv0:autoaspect:psnr -o q3.avi -ss 6:40 -frames 10000
  -> PSNR: Y:45.05, Cb:48.13, Cr:48.04, All:45.85

The result was 980kbits and a PSNR of 45.85.

Then I did a two-pass, using a vbitrate of 980:

  mencoder dvd://1 -oac copy -vf pullup,softskip,crop=720:350:0:68,hqdn3d=2:1:2 -ofps 23.976 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=980:v4mv:mbd=2:trell:mv0:autoaspect:psnr:vpass=1/2 -o 2pass-980.avi -ss 6:40 -frames 10000
  -> PSNR: Y:44.95, Cb:48.12, Cr:48.09, All:45.77

I expected the 2-pass result to have a higher PSNR, because it has an
opportunity to use a lower quantizer.  However, 2pass-980.avi had a PSNR
of 45.77 (978 kbit).  Now, granted, this isn't that much lower than the
qscale=3 version, but I was surprised to see it was lower at all.

I peeled 6 frames from each clip in order to do a visual inspection.
Doing an A/B toggle between identical frames (crude, but simple and
fast) from qscale=3 and the 2-pass AVI confirmed my intuition: the
2-pass AVI was superior; it had visibly less blocking artifacts, and
slightly more detail.

I hacked a quick script to mine some crude statistics from the PSNR log,
and aside from the fact that the two-pass version has more extreme
min/max PSNRs, I wasn't able to see anything that would explain the
visible differences in the image.  But then, I'm also not a
statistician.

At this point I can only assume that libavcodec will use a higher
quantizer that gives a lower PSNR, but tries to do that only when it's
not very visible to the eye.  This makes perfect sense to me, but it
does seem to make doing PSNR comparisons somewhat meaningless -- at
least when the PSNRs are relatively close.

Are there any other quantitative measurements that can be done to
compare objectively?

Cheers,
Jason.




More information about the MPlayer-users mailing list