next up previous contents
Next: Tailoring mpeg_play Up: MPEG Plug-in for Netscape Previous: Netscape Plug-in API

Choosing an MPEG Decoder

To save a lot of time, an already existing MPEG decoder is used as a basis for the plug-in. In deciding which decoder to use, the following properties were sought:

Two alternatives were found, both mentioned in the MPEG-FAQ [19].

mpeg_play-2.3-patched

This source code package originated at University of California, Berkeley. It was written by Lawrence A. Rowe, Ketan Patel, Brian Smith, Steve Smoot, and Eugene Hung. According to the README-file, it implements the MPEG standard described in the Committee Draft ISO/IEC CD 11172 dated December 6, 1991 which is sometimes referred to as ``Paris Format''. There is no support for real-time synchronization or audio.

The decoder will display the movie in an X window on an 8, 24 or 32 bit display. When counting variations over the same scheme, 18 dithering algorithms are implemented, including Floyd-Steinberg, ordered dither, and halftoning.

The source for this program contains 19910 lines in 33 files named *.[ch]. It is sparsely commented.

The program may be used, copied, modified and distributed freely, as long as a copyright notice is not removed.

mpeg2play-1.1b

This program was written by Stefan Eckart, based on mpeg2decode by MPEG Software Simulation Group. It is a player for MPEG-1 and MPEG-2 video-streams, with no support for audio.

The video sequence is displayed in an X window on an 8 bit display, using ordered dither.

Number of lines of code in *.[ch] (15 files) sums up to 7355 for this program. The comment-to-code ratio is about the same as for mpeg_play, that is; the code is sparsely commented.

The distribution policy of this program is not known, as the author did not answer a mail regarding this question.

Benchmarks

The programs are compiled using gcc, optimized using -O2. Testing is performed on a Silicon Graphics Indy, powered by a 100 MHz MIPS R4600 with 16 kb data- and instruction cache, and 32 Mb RAM. The movie-files were stored on a local disk, to avoid letting NFS slow things down. There were no other users on the computer.

Timing is done using GNU's time-program. The numbers given are sums of user and system time for the process in question, averaged from three runs with no major page faults.

The Testfiles

Info on the MPEG-files used for testing, are collected using mpegstat. Table 5.1 gives some characteristics for the files. Sizes are given in kilobytes (kb).

  table1501
Table 5.1:  MPEG-files used for testing.

enterprise.mpg
Raytraced movie of ``Starship Enterprise'' flying into sunset. Small movements, smoothly scrolling background.

bart-temple.mpg
A cut from ``The Simpsons''. Contains both static and rapidly changing backgrounds.

bjork.mpg
From Björk's music video ``Human Behavior''. Lots of rapidly changing scenes.

mpeg_play-2.3

The first test examines the speed of MPEG decoding only, skipping dithering and X11 display output. The following command was used:

The results are as follows from table 5.2.

  table1530
Table 5.2:  mpeg_play with no display and no dithering.

The following tests regard the speed of miscellaneous interesting dither options. First the ordered2 dither, which is the default dither for mpeg_play. ordered2 dithers to eight bitplanes. The following command was used:

Table 5.3 shows the performance of decoding and dithering using ordered2 dither. Compared to table 5.2, the dithering requires approximately 30% of the time spent.

  table1557
Table 5.3:  mpeg_play with no display and ordered2 dither.

Full color dither may be used on displays with more than eight bitplanes, and will thus give high quality results. For testing this dither, the following command was issued:

As table 5.4 shows, full color dither is slower than ordered2, taking approximately 40% of the total decoding time.

  table1583
Table 5.4:  mpeg_play with no display and full color dithering.

Finally, we look at the time used to display the movie. mpeg_play uses shared memory images when possible, giving high throughput. The following command was executed, using ordered2 dithergif:

Table 5.5 gives the results. Comparing this table to table 5.3, shows that the time used for displaying the movie is quite small, about 4% of the total time.

  table1608
Table 5.5:  mpeg_play with display and ordered2 dither.

mpeg2play-1.1b

As for mpeg_play, the first test was on decoding only, avoiding dithering and image output. The following command was used:

Table 5.6 shows the times used for pure MPEG frame decoding.

  table1634
Table 5.6:  mpeg2play with no display and no dithering.

The program mpeg2play has no options for doing dithering without displaying the results, so we have to test dithering and displaying at the same time. The dithering done in mpeg2play matches the ordered2 dither in mpeg_play. The following command was used:

Table 5.7 shows that dithering and displaying the images of the movie, takes 25-30% of the total execution time.

  table1661
Table 5.7:  mpeg2play with display and dithering.

Results

Table 5.8 is a short summary of features provided by the two packages.

  table1679
Table 5.8:  Summary of features for the two MPEG-players.

The code of mpeg_play is more than twice as big as that of mpeg2play, which might fit with the fact that mpeg_play provides more dithering options, and support for more bitplanes. The higher speed of mpeg_play, combined with the support for more than eight bitplanes, makes it the packet of choice for further work.


next up previous contents
Next: Tailoring mpeg_play Up: MPEG Plug-in for Netscape Previous: Netscape Plug-in API

Sverre H. Huseby
Sun Feb 2 15:54:02 MET 1997