[Ffmpeg-devel] MPEG-2 Acceleration Under Mac OS X - Can We Move This Forward?

galenz at zinkconsulting.com galenz
Tue Aug 29 13:26:26 CEST 2006


On Aug 28, 2006, at 3:27 PM, Guillaume POIRIER wrote:

> Hi,
>
> galenz at zinkconsulting.com a ?crit :
>> Hello,
>> I've been a little bit involved with an interesting project called  
>> Accellent which is a libavcodec-based reverse-engineer of Mac OS  
>> X's MPEG-2 hardware acceleration API. Apple refused to release any  
>> data on this, so John decided to reverse engineer it. After a few  
>> iterations and a bit of work, we now have a nice open source  
>> application that works under Mac OS 10.4 and 10.3. Take a look at  
>> it here: http://www.defyne.org/dvb/accellent.html
>
> Would you happen to know if there's a similar MPEG-4 AVC decoding  
> API for Apple computers? MPEG-4 AVC is even more hungry than MPEG2,  
> so any kind of hardware acceleration would be great!
>
> [..]
>
> Guillaume

I know the allure of such a function - but I question the reality of  
it, at least at the moment. Keep in mind, MPEG-2 is quality king at  
higher bitrates, and CPU usage climbs with bitrate, so it can be  
pretty intensive under the right circumstances. Try watching a 60  
fps, 1920 x 1080 19 megabit stream - that's what they broadcast over  
the air in many countries - and let me know how your system fares.  
Now toss in the fact you may need to de-interlace this. MPEG-2  
acceleration is a very real need.

Don't forget, MPEG-2 is also part of the Blu-Ray/HD-DVD specification  
- and they allow up to 60 fps, 1920 x 1080 (progressive) at 40  
megabits / 28 megabits respectively. They're using MPEG-2 in most if  
not all current HD/BR discs because it seems to deliver the highest  
level of quality, given the available space. MPEG-2 is here to stay,  
or so it seems.

Interestingly, MPEG-2 can also be competitive at lower bitrates, just  
check out these pretty impressive samples which are purported to  
rival H.264:
http://www.digigami.com/megapeg/hdtv_samples.php

Take a look at John's earlier post, he details how his acceleration  
works. Accellent is so effective precisely because there's an API for  
MPEG-2. At best, attempting to use MPEG-2 functions for other codecs  
would somewhat make piecemeal of the the performance gain, and at  
worst it would be useless.

As for whether Apple has an API for MPEG-4/AVC acceleration, I'm not  
certain, but I'm a bit doubtful - at least for the moment. Only  
really new GPUs would support such a thing, meaning that even if it  
existed, the installed base would be tiny. Not that there wouldn't be  
benefit to using the GPU when available, but at the moment, more  
machines have sufficient CPUs than have sufficient GPUs, yet every  
machine that has a sufficient GPU has a sufficient CPU. So there's  
not a major impetus here quite yet.

Furthermore, AVC acceleration isn't very impressive at the moment.  
The best case scenario is with the ATI X1600 used in the MacBook Pro  
and iMac. It supports  up to 720p AVC acceleration. Using Windows  
drivers, it only reduces CPU usage by 39%. Not very impressive.  
Previous ATI GPUs (before the x1xxx series) don't support AVC  
acceleration at all. The numbers I have seen for NVidia's approach  
are even less impressive - we're talking 5% or less reduction in  
average CPU usage using Windows. The only bright spot is that a wider  
range of NVidia GPUs support this (including some used in previous  
Mac models), but I seriously doubt there's much point in even trying  
to support it considering the lackluster benefits. The MacBook and  
Mac Mini machines use the GMA 950, which while it supports full  
resolution MPEG-2 HD decoding, it doesn't touch AVC.

It seems the time for AVC acceleration hasn't yet arrived.

Conversely, millions upon millions of Apple machines exist that can't  
play HD MPEG-2 in any form, yet have the requisite GPU to do so.  
MPEG-2 accelleration can drop CPU usage by 75% or more - videos that  
don't come close to playing on my 1.33 GHz G4 in VLC consume less  
than 25% of my CPU in Accellent.

And pretty much every GPU, even the lowest end GMA 950, is capable of  
full MPEG-2 HD playback with acceleration. Because of this, frankly,  
I see MPEG-2 acceleration as being a lot more widely useful  
technology to pursue. The need, the API and hardware is here and now,  
just adapt Accellent, and pretty much every machine shipped in the  
past few years can benefit immensely. MPEG-4/AVC is something to keep  
your eyes on - maybe in Leopard, and as better GPUs come along - but  
for now, let's focus on MPEG-2.

Just my 2?.

-Galen



More information about the ffmpeg-devel mailing list