From time to time I need to rip a DVD, due to my fascination with compression I'm interested in knowing about how they work and which codec is the best. I began looking for a visual comparison between XviD and X264 and couldn't find anything so I thought it would be fun to create my own comparison. In the encoding community a PNSR represents the mathematical measurement for how much loss occurs during encoding, and there are plenty of ways to automate this analysis but I am more interested in how things look visually once decoded.

Normally if I had some encoding to do I would simply open up AutoGK but I've had issues with XviD at low bit rates which made me interested in comparing it to newer alternatives. XviD is an MPEG4 ASP compliant encoder, which many consider to be the best ASP codec. There is another profile in the MPEG4 spec however called AVC which HD-DVD and Apple's QuickTime use. For testing MPEG4 AVC I decided to use the wildly popular X264 which is distributed as a command line tool that takes AVISynth input and outputs MP4 files. AVC has advanced compression algorithms that go beyond what ASP offers, and XviD generally suffers from the constraints of the commonly used AVI container for things like encoding B-frames.

For this test we will be comparing the output from AutoGK with X264 using the same AVISync script to keep the sources consistent. For X264 I will be using a 2 pass encoding with the same target bit rate for 1400 MB, and reasonable settings for encoding speed and quality. QuickTime does not support AVC features such as b-pyramids or 8x8dct so these were dropped, and I've kept B-frames to a modest amount.

X264 options:

--partitions all --direct auto --progress --threads 1 --subme 7 --b-rdo --mixed-refs --bime --weightb --bframes 3 --ref 5 --me umh --trellis 2 --no-psnr

The Results

Tomb Raider

This film has an aspect ratio of 2.35 so there is a decent amount cropped out of the original. The bit-rate for this encode was about 1800kbs. I chose this particular scene because the motion of the water makes it difficult to encode when combined with the film grain. Both codecs do a great job, but in frame 9873 with XviD you can see macro blocks on Lara's face.


This film is 16:9 native which stretches the birate. At first glance the XviD encode actually has more detail, but when you enlarge you can see significant macro blocking in some areas.

Final Thoughts

It won't shock anyone that AVC in an MP4 container is better than ASP in AVI. The images above at least provide a rough reference point for how much better the quality you can expect between the different mpeg4 profiles encoding the same content. This article doesn't explore all the sophisticated options and profiles of the AVC codec so it's intended for education only. It's also worth mentioning that AVC encoding is slower by nearly a factor of 10x compared to ASP, obviously you are not getting 2x the quality for that either.
Comments 4

Echo 1182971005000 #1

DVD Shrink (albeit semi-outlawed) has been excellent for me for making backups under fair-use. You can snip out components you don't want/need like credits, extra audio tracks, etc... myriad options to fine tune your conversions!

Jabo 1183278556000 #2

Yea I agree, I've seen good results with that as well from friends and I can definitely see the reason to use it, you want all the menus etc. I probably should of talked more about rips than backups in this review, but ya I think you get the idea!

aleste81 1183452980000 #3

dude, it is not the same frame in Billy Madison !!!

Jabo 1183481926000 #4

Ya I know, I keep meaning to come back to this blog post and actually remove that example and replace it with Gone in 60 seconds -- hopefully will get to that soon! Wondered when someone else would notice lol. Anyway thanks for the polite note