[MPlayer-users] lavc vs. xvid (and improving lavc quality)

Jason Tackaberry tack at sault.org
Sat May 29 20:49:16 CEST 2004


I am primarily interested in high bitrate encoding.  I have ripped most
of my DVD collection with lavc vqscale=3.  I find this quality isn't
quite up to my level of expectation, but due to limitations in mplayer
needed to keep files under 2G.

Luckily, with the recent addition of ODML to mplayer (thanks heartily to
those involved in bringing this feature to mplayer/mencoder), I'm no
longer shackled by 2G limitations.

My biggest beef with lavc is the blockiness in muddy areas and areas of
solid colors.  This is an oft observed phenomenon with lavc.  Consider,
for example, a grey wall in the background that is slightly out of
focus.  Even at vqscale=2, the blockiness is noticeable and annoying.
At that quality/bitrate, where areas of high detail are preserved
excellently, a background of "dancing blocks" is terribly jarring.

I had originally thought this to simply be a limitation of mpeg4 and
lived with it.  I did try a number of lavc options suggested on this
list and others, including H263 quantizers, but nothing really improved
the situation suitably.

After reading an article on doom9 that stacked up a number of codecs, I
decided to compile xvid into mplayer and give that a try.  I was
immediately able to see a difference: xvid's artifacting is much more
pleasant to my eye.

Unfortunately, xvid is also nearly an order of magnitude slower than
lavc.  I wonder if I've messed something up.  Encoding at 3fps is
terribly frustrating when lavc gives me 25fps. :)  But I'm willing to
live with that, as you only encode once, but you watch a lot more.

Wanting to make sure that wishful thinking wasn't interfering with my
opinion, I crafted a blind comparison between the two.  I picked 5 20-40
second scenes from my Paycheck DVD and ripped them with each codec.  I
picked quite high quantizer values, but tried to balance them so that
the average bitrate of all 5 clips were roughly the same for both
codecs.  Ultimately I picked vqscale=1.7 for lavc, and fixed_quant=2.5
for xvid.  (The average bitrate across the 5 clips was about 3100kbit.)

I wrote a script to them rename each file randomly, and viewed them with
output redirected to /dev/null, so I couldn't know which file was
encoded with which codec.

I picked xvid 5 out of 5 times, although 2 of the clips were close
calls.

Every time, lavc lost because of the blockiness.  Even though the PSNR
nearly the same between both codecs (in fact, the luma PSNR was higher
for lavc in every case), my eyes disliked the artifacts that lavc
yields.  I suppose at such high bitrates, PSNR is always going to be
good enough, and so becomes irrelevant.

I used these options for lavc:
   -lavcopts vcodec=mpeg4:vqscale=1.8:v4mv:mbd=2:trell:mv0:autoaspect:psnr
and for xvid:
   -xvidencopts fixed_quant=2.5:chroma_opt:vhq=3:autoaspect:psnr

I've tried a number of options with lavc, as suggested on occasion on
this list, such as various permutations of:

   qpel:precmp=3:cmp=3:subcmp=3:vmax_b_frames=1:vlelim=-2:vcelim=7:lumi_mask=0.05:vqcomp=0.7:mbcmp=2 

While these options may help in some cases (maybe low bitrate cases?), I
find they don't improve lavc's blocky artifacts.  At the kind of
bitrates you get with vqscale=1.7, it's possible that most of these
options are pointless.

I'm wondering if there's some magic lavc option I haven't discovered.
The get_rid_of_blocky_artifacts=1 option.  Perhaps there's a custom
matrix I could plug into lavc to improve this.  Hopefully some of the
experts on this list can offer some advice.  I'd love to see lavc win
5/5 on the next round -- especially because it's just so much faster. :)

Cheers,
Jason.




More information about the MPlayer-users mailing list