Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jul 1997 17:09:00 -0700 (PDT)
From:      lamaster@george.arc.nasa.gov
To:        freebsd-multimedia@FreeBSD.ORG
Message-ID:  <199707260009.RAA15761@george.arc.nasa.gov>

next in thread | raw e-mail | index | archive | help

Tony, Kimball, writes:
>>  > Quoth Petri Helenius on Fri, 25 July:
>>  > : Are you speaking of encoder or decoder? The encoders are not cheap nor
>>  > : likely to be in the immediate future
>>  > 
>>  > Is the mpeg2 format documented online?  I understand that conventional
>>  > wisdom requires hardware assist, but that just represents an
>>  > algorithmic challenge....
>>  > 
>> I didn't attend the demonstration myself but there are multiple
>> sources claiming that MPEG-2 decode can be done at the ballpark
>> power of 233-266 Pentium_II (using MMX extensions)

I didn't see a followup which answered the specifics here, 
so, I hope the following may help muddy the water.


*Realtime* MPEG-2 *encoding* remains an expensive proposition, 
with *quality* MPEG-2 realtime hardware encoders costing > $50K U.S.  
or more.  MPEG-2 is not symmetrical at all in terms of the amount of
work it takes to encode versus decode.  Encoding is much more
expensive, and the higher quality you want [ie the better the
image for a given bandwidth] the more expensive it gets.  
Broadcast-quality encoders are available from only a few vendors.
Of course, it may be possible to do a simple lower-quality H/W encoder 
that doesn't do B-frames, etc., for - a few $K U.S. perhaps, but, 
I haven't seen it yet.

Realtime MPEG-2 decoding, OTOH, should be just about within reach 
now on the latest processors from several vendors.  MPEG-2 decoding 
has been demonstrated realtime on a modified PPro-200 (some boards
like this were floating around about a year ago, with the details
secret - but, I saw a non-secret *demo* of the capability), or, 
presumably, on a Pentium II - 266 using MMX, which should be
roughly equivalent to the demo'd PPro 200.  Not to mention
300 MHz Ultra 2's, 200 MHz SGI R10k-based systems, etc.,
using old-fashioned (efficient) programming.  

MPEG-1 decoding, for example, takes roughly a Pentium-166,
a 75 MHz, SuperSPARC, or an R4600-133 MHz, with the minimum 
requirements then being SPECint92 of > ~110 perhaps, and memory 
bandwidth > ~60 MB/sec. on these systems.  In fact, presumably
it can be done with even less CPU power if using certain MPEG-1
assist-capable boards (e.g. supposedly the ATI Mach64 boards
can somehow assist MPEG-1 decode with the correct API/library/drivers.)

Getting back to MPEG-II decode, it should be is roughly 4X 
the MPEG-1 requirment, plus more for audio, so, very roughly, 
on the newer systems, SPECint95 > ~9, and B/W > ~240 MB/sec.  
This would be a 300 MHz Sun Ultra-3, an SGI Octane, etc., or, 
a 266 MHz Intel Pentium II, perhaps.  That is, the integer 
performance is there, especially with MMX as a boost, although 
it may come up a little short on memory bandwidth.  In any case,
these processors are in the ballpark for doing MPEG-2 decode
in software.  However, it does take careful optimization of
performance-critical loops.  "Multimedia" instructions, such 
as MMX on Intel, but also available on HP, Sun, and eventually
on SGI, will help with certain of these performance-critical 
functions (e.g. conversion from the MPEG-2 color space to RGB).  
See the IEEE Micro article last year on Multimedia instruction sets.

Just to get a vague idea of what a FreeBSD/XFree86/PentiumPro200
system can do, for example, I have tested the H.261 software codec 
at various combinations of ~1 Mbps, at various H.261 quality levels, 
at frame rates of 10 fps, 20 fps, 24 fps, etc., and the PPro200 
(ASUS Natoma, FreeBSD 3.0-current, XFree86 3.3, vic2.8, 352x288 image,
doubled in size on the display side) uses about 20-33% of a PPro-200 
CPU, total, for everything, including network overhead.  Screen 
updates at 640x480 are handled OK, but, use much more of the CPU 
than they could/should (e.g. XF86_S3 using 8% of the CPU at 4 fps,
16% at 8 fps, for full-screen updates - extrapolating to 30 fps, 
it could use 60% of the CPU.).  The H.261 codec is computationally
friendly, so the system can handle it, but MPEG-2 decode will want
most of the CPU, so it would be nice if the X server were better 
optimized for painting video images in a window.

To summarize, software MPEG-2 decoding should be just within 
reach now on the fastest commodity microprocessor systems.
In order to make it happen, highly optimized MPEG-2 software 
decoders, and (X Window System) servers are required, 
but most of the other software components already exist.
[Things missing: e.g. I'm not sure if the MPEG-2 RTP encapsulation 
definition is complete&final.]


-Hugh LaMaster


  Hugh LaMaster, M/S 258-5,     ASCII Email:  hlamaster@mail.arc.nasa.gov
  NASA Ames Research Center     Or:           lamaster@nas.nasa.gov
  Moffett Field, CA 94035-1000  No Junkmail:  USC 18 section 2701
  Phone:  415/604-1056          Disclaimer:   Unofficial, personal *opinion*.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707260009.RAA15761>