[MPlayer-users] lavc vs. xvid (and improving lavc quality)
Jason Tackaberry
tack at sault.org
Sun Jun 6 22:26:43 CEST 2004
On Sun, 2004-06-06 at 21:21 +0200, Michael Niedermayer wrote:
> could also be caused by different encoding options, its impossible to say, as
> people who complain about quality rarely upload samples ...
Guilty as charged.
I did some tests with cvs from a few minutes ago (with xvid 1.0.0 final)
and got some interesting results. I uploaded a number of files
(paycheck-clip-*). paycheck-clip-dvd.avi is an -ovc copy, and each of
the other files are transcoded from that.
I play these back on my TV with -vf eq2=1.25. Rich will tell me to turn
gamma off, but I'll tell Rich that this output yields the same
brightness/contrast as my set-top DVD player, and everything looks
awkwardly dark without it. Turning off the gamma correction is
tantamount to closing my eyes, sticking my fingers in my ears, and going
"la la la, there is no problem."
Anyway, the frame worth looking at is around 40, where the stopwatch is
in frame. Look at the greyish background -- the blockiness is quite
visible there.
paycheck-clip-lavc-q2.avi:
mencoder paycheck-clip-dvd.avi -vf pullup,softskip,crop=720:352:0:66,hqdn3d=2:1:2 -ofps 23.976 -ovc lavc -lavcopts vcodec=mpeg4:vqscale=2:v4mv:mbd=2:trell:mv0:vmax_b_frames=0:autoaspect:psnr -o paycheck-clip-lavc-q2.avi
-> 1356 kbit: PSNR: Y:47.27, Cb:49.92, Cr:50.23, All:48.02
paycheck-clip-xvid-q2.avi:
mencoder paycheck-clip-dvd.avi -vf pullup,softskip,crop=720:352:0:66,hqdn3d=2:1:2 -ofps 23.976 -ovc xvid -xvidencopts fixed_quant=2:chroma_opt:vhq=3:autoaspect:max_bframes=0:psnr -o paycheck-clip-xvid-q2.avi
-> 3739 kbit: Average PSNR y : 48.82 dB, u : 50.93 dB, v : 51.55 dB
Now, the Paycheck version looks _vastly_ better, but look at the
bitrate! Clearly I'm missing something, or xvid's fixed_quant !=
lavc's vqscale. I can't even make lavc use that high bitrate if I try.
Even vqscale=1 is only 1919 kbit and doesn't look much better than
vqscale=2.
A two-pass is much more comparable:
paycheck-clip-lavc-2pass-2200.avi:
mencoder paycheck-clip-dvd.avi -vf pullup,softskip,crop=720:352:0:66,hqdn3d=2:1:2 -ofps 23.976 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=2200:v4mv:mbd=2:trell:mv0:vmax_b_frames=0:autoaspect:psnr:vpass=1|2 -o paycheck-clip-lavc-2pass-2200.avi
-> 1366 kbit: PSNR: Y:47.28, Cb:49.93, Cr:50.24, All:48.03
paycheck-clip-xvid-2pass-2200.avi:
mencoder paycheck-clip-dvd.avi -vf pullup,softskip,crop=720:352:0:66,hqdn3d=2:1:2 -ofps 23.976 -ovc xvid -xvidencopts fixed_quant=2:chroma_opt:vhq=3:autoaspect:max_bframes=0:psnr -o paycheck-clip-xvid-q2.avi
-> 1322 kbit: Average PSNR y : 47.25 dB, u : 50.02 dB, v : 50.27 dB
Here things are a lot more comparable in bitrate and visual quality.
xvid might look a _bit_ better, but it's really hard to tell, and it's
certainly nothing worth screaming about.
Increasing the fixed_quant value in xvid (2.5, 3, 3.5) lowers the
bitrate and still remains less blocky than lavc.
I won't even attempt to speculate as to what these results really mean,
but clearly it's possible to improve quality by throwing more bits at
it. I don't understand why 2-pass for xvid uses much less bitrate than
I tell it to when fixed_quant=2 uses 3700 kbit and is visibly better
(and the min quant for 2-pass with xvid is also 2). I suppose it, and
lavc, is deciding to throw away detail because I'm not supposed to be
seeing it. Except that I do.
Anyway, for better or worse, there it is. :)
Cheers,
Jason.
More information about the MPlayer-users
mailing list