Possible to optimize ffmpeg for the Cell?

Investigation into how Linux on the PS3 might lead to homebrew development.

Moderators: cheriff, emoon

Post Reply
zyrixnet
Posts: 3
Joined: Wed Sep 26, 2007 5:03 am
Location: Winnipeg, Canada
Contact:

Possible to optimize ffmpeg for the Cell?

Post by zyrixnet »

Just an idea, is anybody really skilled here with coding the Cell's SPUs? If so, would be possible to optimize ffmpeg to encode videos very very quickly using them?

Eg. Each SPU can convert a specific part of the video format. As converting is basically a bunch of number crunching. If you cannot make it use the SPUs, at least optimize it for it runs faster than it currently does.

Also, where is Xvid support in the ppc64 version of ffmpeg? I am running Debian on my PS3, does Ubuntu support Xvid encoding?

Thanks, I just need Xvid mainly to encode my videos quickly for my GP2X(Linux handheld). On that note. The GP2X community is very well known for making software run perfectly on systems with little RAM, and no 3D accelerator. Perhaps, people can port some of the GP2X optimized software for the PS3. With a little modifications, the software should run perfectly.

Check out their software projects at http://archive.gp2x.de/
They have tons of quality homebrew Linux games native to the system done, which would be fun to optimize for the PS3.

For example, a GP2X hit project is MAME. They have MAME running with a dual core 200MHz ARM processor. I am sure a ported version of that MAME source code to the PS3 would run very nicely.

Has anyone made a Distributed SPU C compiler for the PS3 yet? For example, it would be a normal C compiler, but it would send various compiler tasks to the SPUs to number crunch. Ultimately speeding up the overall compile process.

We need a Linux distro on the PS3 which has programs that use the SPUs. I wonder if you could someone make pthreads work with the SPUs? This would speed up Linux pthread applications quite a lot, as the thread would be running an SPU. Is this at all possible?

I hope these suggestions provide some ideas and insight on what can be done with the PS3 and it's Cell Processor. I just want the Cell to actually live up to it's marketing a little more.

On that note, has anybody modified the source code for database servers to take advantage of the SPUs? For example MySQL or Oracle? If this could be done, it would easily show how powerful the Cell Processor is with serving a massive database.

Okay, I'm done this time. Hope to hear some good replies/comments on these ideas.

Kevin.
PSN ID: chronoboy<br>"PlayStation 3 -- The next generation server at your company, or your kid's next generation video game console. You Decide!"<br>PlayStation 3, what can it not do?
audi100quattro
Posts: 8
Joined: Sat Dec 01, 2007 3:32 am

Post by audi100quattro »

The gcc port for SPEs (c, c++) will be included in 4.3, but some distributions (OpenSUSE, Ubuntu) already have a separate package. Not sure how Ubuntu's version is 4.1.1, since the CELL was barely even out when GCC 4.1.1 came out. OpenSUSE shows the spu-gcc binary was built from svn code in April, so it's been out for a while. Considering it's that old, it's probably better to make a build from the gcc svn.

Anybody know why mesa/X haven't been compiled on the spe's yet? Though Mesa's successor is being ported: http://forums.ps2dev.org/viewtopic.php? ... torder=asc
d-range
Posts: 60
Joined: Fri Oct 26, 2007 8:22 pm

Post by d-range »

audi100quattro wrote:Anybody know why mesa/X haven't been compiled on the spe's yet? Though Mesa's successor is being ported: http://forums.ps2dev.org/viewtopic.php? ... torder=asc
Because it's a shitload of work and not too many people know how to do it properly.

Also, to you and to the OP: while the SPE's are extremely fast and flexible for some tasks, it's not a silver bullet to make everything go faster automatically. It is not a matter of just recompiling for the SPE's and presto, we have a superfast PS3 version. Most linux code is written with desktop architectures in mind (x86, ppc), to extract the parts that would run very well on SPE's often requires a lot of refactoring in the original code.

Compiler code is a prime example of an application that would not fit an SPE at all. Too much testing/branching/irregular memory access/etc. Same goes for DB code. Some parts of it might be suitable for SPE execution, but its not a matter of 'drop in, compile, run'. The pthread suggestions the OP was talking about are nonsense and show a lack of knowledge on the subject.

As for the ffmpeg optimizations: I've been looking into that myself for a while, and it's certainly possible to speed it up by a large factor. People are already working on it (ask unsolo or talk to other spe-medialib devs). My personal believe is that a new decoder architecture specifically written for Cell would be able to reach massive decoder performance (I estimate Full HD H264 should be possible using a single SPE), so that's what I'm playing around with right now. Mostly to get some Cell experience, but who knows if something useful pans out...
unsolo
Posts: 155
Joined: Mon Apr 16, 2007 2:39 am
Location: OSLO Norway

Post by unsolo »

work is beeing done in spu medialib to accellerate ffmpeg
Don't do it alone.
Post Reply