MPEG-4 Codec shoot-out 2002 - 3rd installment
Table of content:
1: Introduction
2: Test setup
3: Test 1: The Matrix
4: Test 2: Saving Private Ryan
5: Conclusion
6: Future outlook
After a lot of encoding and re-encoding we'll start into a new codec comparison. What has happened since last time? DivX5 finally reached a stable status and there haven't been any more updates for quite a while (so I fear next time I will have to deal with DivX6;), XviD development has been ongoing on a steady basis and while B-frames and QPel motion estimation are not ready for the public yet they will be shortly. Nevertheless, the new alt curve compression, Koepi's improvement in 2pass curve treatment, a mode for interlaced and black&white content certainly make the codec more attractive than ever from a feature standpoint. On2 has released VP5 but unfortunately I have not been able to obtain a demo copy yet. Real Networks have released version 9 of their video compression technology and it has created quite a buzz in my forums so it was time to have a look at it.
Now let me present our contestants:
DivX3 in the form of SBC (Smart Bitrate Control) as done in Nandub
DivX5.02
RealNetworks RealVideo9 (I will call this codec RV9 in the future)
XviD (Koepi's binaries dated 7/27)
All codecs were tested in a 2 pass setup. I chose not to include test results of previously tested codecs except for SBC as they couldn't quite match the quality of SBC.
All testing was done on the following hardware:
AMD Athlon XP 1800+
Abit AT7
2x256MB PC2100 Samsung CL2.5 DDR RAM
Hercules Prophet MXII400 (NVidia Geforce2 MX400)
Philips 170B Display
To encode I used the following software:
DVD2AVI 1.76
mpeg2dec.dll
Avisynth 1.06 for frameserving
VirtualDub 1.4.10 to encode DivX5 and XviD
Nandub 1.0 RC2 lumafix ecffix for SBC
RealProducer 9
To simplify things I used GordianKnot for the DivX5 encoding and AutoRV9 for the RealVideo encoding.
Movies I encoded:
Matrix - Region1, NTSC, length: 2h16
Saving Private Ryan - Region1, NTSC, length: 2h49. I will call this movie SPR from here on
Encoding parameters:
I used a 128kbit/s ABR audio track created in lame 3.91 (using --alt-profile 128 as parameter) for both movies, then tried to put Matrix onto 1 700MB CD and SPR onto 2 700MB CDs. The size of the audio track was 124307KB and 157572KB respectively. This resulted in an effective video bitrate of 581kbit/s for Matrix and 1016kbit/s for SPR (her kbit = 1000bit, DivX3 uses kbit = 1024bits so you have to divide that bitrate by 1.024 to get the effective DivX3 bitrate, all other codecs use k = 1000). Please note that multiplexing a VBR MP3 with an AVI gives more overhead than a regular CBR MP3 file. I used GKnot to calculate the bitrate as it's known to be accurate in such situations.
As you may know, not every rate control mechanism is perfect so here are the final movie sizes I got:
DivX5: 716'940KB, SPR: 1'435'112KB
SBC: Matrix: 716'742KB, SPR: 1'435'028KB
XviD: 713'394KB, SPR: 1'431'314KB
RV9: Matrix: 724'749KB, SPR: 1'447'729KB
Note that 700MB equals 716'800KB and 1400MB 1'433'600KB. XviD hasn't managed to reproduce the excellent results from the very first test it participated in but you can be sure that an XviD rip will fit on your CDs. DivX5 has finally managed to catch up with SBC whereas RV9 got oversized. In fact I've done another test about 2 months ago where RV9 was undersized (but manually calculating the bitrate) so I'm assuming that the bitrate calculations used in AutoRV9 are not perfectly accurate yet and we may see some improvements in that department in the future.
Codec settings:
For SBC I used the GKnot defaults. For DivX5 I also used the defaults plus GMC and B-frames and normal psy enhancements. In XviD I used modulated quantizers for both movies, motion search precision 6, and the alternative curve compression with default parameters in both cases. Furthermore I limited the I-frame quantizers to 2-4 and P-frame from 2-12 for SPR (in Matrix they were both set to 2-31). For RV9 I used the AutoRV9 defaults but I set the bitrate to 132kbit/s and the maximum bitrate to 6mbit/s.
Encoding speed:
Here I take Matrix as an example. The resolution of SPR was bigger, hence the performance also dropped.
SBC: 24.52fps
DivX5: 26.57fps
XviD: 28.99fps
RV9: 20.43fps
Other important stuff:
Here's the Avisynth script I used to encode both movies so that you can perfectly reproduce my results. I used force film in DVD2AVI in both movies. Note that I used neutral bicubic resizing in both cases. I don't like the blurryness of the bilinear resize filter and the neutral setting is a good compromise between crispness and better compressibility but it doesn't blur.
Matrix script:
LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec.dll")
mpeg2source("D:\matrix\matrix.d2v")
crop(0,60,718,356)
BicubicResize(640,272,0,0.5)
SPR scrip:
LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec.dll")
mpeg2source("D:\spr\spr.d2v")
crop(0,5,717,467)
BicubicResize(640,352,0,0.5)
Note that the RV9 shots will look slightly different since my manual cropping settings somehow weren't fully taken into account :(
Playback:
For SBC and DivX5 I used the DivX5 filter at strength 4. I have been using the DivX5 filter to play back DivX3 movies a lot in the past and whenever I thought that something was odd I switched back only to find out that the problem was the source, not the filter. I have also done the same during the comparison but I'm confident to say that the results would not be any different had I used the DivX3 filter for SBC playback (except for being more of a hassle to compare and make screenshots). For XviD I used Nic's filter at strength 4. Finally I used the RealOne Player defaults for RV9.
Initially I was going to use ffdshow but unfortunately the filter does not seem to like my computer very much and would make players freeze from time to time. I also got the impression that its XviD decoding looked worse than using Nic's filter so I ended up using the filter setup described above.
For the first time I've also not used Windows Media Player 6.4 (initially the ffdshow problems which were a lot worse when using WMP had me switch) but The Core Media Player alpha 27. TCMP will be the successor of the successful PowerDivX NextGen player and should be released later this year. Please do not ask where to get the player, once it's available for the public you'll find it in my software archive but for now testing is being conducted privately. TCMP's playlist feature also helped to switch between the files a lot quicker. To play RV9 I used the RealOne player. Later on I discovered Gabest's Media Player classic which has the very handy jump to timecode function that helped me escape insanity when I was trying to get RV9 screenshots done. Since my monitor is a flat screen and interpolates if you reduce the resolution (standard resolution is 1280x1024 for this 17" display) I watched all the clips zoomed to 1280x1024. This accentuates problems the codec has, but also problems the filter might have with stretching, but most people I know do not bother to lower the resolution when watching movies so I guess it's only fair to watch the clips as everybody else does. Some people think that TFT screens are not suited for movies or games and while CRT screens do have a slight edge, I can play 3d shooter and movies without the slightest bit of problems and the contrast and detail level on my screen is really high so I don't run into danger of missing important details.
Now proceed to the first test.
This document was last updated on 08/05/02