
Introduction
This applet can decode MPEG I video stream. You may think that
Java is not fast enough to decode MPEG streams in realtime. But
the results which this applet shows enable us to predict that it
will be possible in very near future. By huge amount of
optimizations, 240x170 MPEG stream can be played at the speed of
28 frames on my Pentium II 300 notebook computer. The first
version of this applet could only show 7.6 frames per a second on
the same computer.
I will first show you the performance of my applet on various
environments. And during testing performance of my applet, I
realize that JVMs which many company developed show different
performances and this applet can be used for evaluating them.
And then I introduce optimization techniques which I have used
for this applet. It will include some general rules and good
materials for Java performance.
Lastly you can see my Java MPEG Player applets - An enhanced
UI VOD, a simple UI VOD and a simple MPEG player versions. An
enhanced UI(User Interface) VOD is superset of all ths players.
It supports auto-adjusted screen, display a title and subtitle of
a movie and a rate control of MPEG streams.
Performance
-
Test MPEG file
|
กก |
 |
- File Length : 198 frames
- File Size : 483K
- File Duration : 6 sec
- Frame Rate : 30 fps
- Video Data Rate : 74KB/s
- Video size : 240 x 176
|
-
Performance results on various machines using IE4
|
- Pentium Pro 200 running Windows 95 : 21.37 fps
- Pentium II 300 running Windows 98 : 28.14 fps
- Pentium II 333 running Windows 95 : 32.07 fps
- Pentium II 350 running Windows 95 : 35.16 fps
- Pentium III 550 running Windows 98 (using IE5) : 50.98
fps
|
-
Performance results on Pentium II 300 at a local network
|
- Internet Explorer 4.01 : 28.14 fps
- Netscape Commnicator 4.51 : 28.63 fps
- IBM JDK 1.1.7 : 27.87 fps
|
-
Performance results on Pentium II 300 at a local machine
|
- Internet Explorer 4.01 : 29.47 fps
- Netscape Commnicator 4.51 : 28.43 fps
- IBM JDK 1.1.8 : 30.65 fps
|
Optimization
Techniques
- IDCT calculation
- 1D IDCT
- integer IDCT using integer multiplication and shift
- skipping IDCT calculations if it holds all zero terms.
- collapsing calculations
- avoid using array
- avoid useless assignments
- 2D IDCT
- divide row/col IDCT for avoiding useless assignment and calculation
- YCrCb to RGB conversion
- table-driven multiplication
- collapsing calculations
- avoid useless assignments
- Reconstruction
- loop unrolling technique
- Parsing
- VLC decoding with hierarchical table - using berkeley MPEG code
- Java optimization
- collapsing calculations
- avoid using array
- avoid useless assignments
- loop unrolling
- avoid multiplication
- avoid type casting
- using final and static functions
- Memory Usage
- bounded memory usage by reusing objects and arrays
- a good site for
Java Optimizations
Java MPEG
Players
-
|
|
กก |
|
|
- Display a movie title and subtitle
- Play, pause and resume the movie
- Auto-adjust screen to match the movie size
- Display average frames per seconds
- Select various movies
- Rate control (selectable in setting)
- Auto replay or not (selectable in setting)
- Play time or frame display (selectable in setting)
|
-
|
|
|
 |
- Display a movie title
- Play, pause and resume the movie
- Display average frames per seconds
- Select various movies
- Auto replay
- Rate control (selectable as parameter)
|
-
|
|
กก |

|
- Play, pause and resume the movie
- Display average frames per seconds
- Display controls or not (selectable as a parameter)
- Rate control (selectable as parameter)
|
Other Experimental
Players
Publication
-
Disclaimer: The following publications are
covered by copyright. Permission to make digital/hard copy of all or
part of the following papers, technical reports, and presentations for
personal or classroom use is granted without fee provided that copies
are not made or distributed for profit or commercial advantage. To copy
otherwise, to republish, to post on servers, or to redistribute to
lists requires prior specific permission.
- Dohyung Kim and Jihong Kim, "Design
and implementation of a Java-based MPEG-1 video decoder", Consumer
Electronics, IEEE Transactions on, Vol. 45, Issue 4, pp. 1176 - 1182,
Nov. 1999