[patch] optimization for libtheora

Bug #12338 reported by Andy Wingo
4
Affects Status Importance Assigned to Milestone
libtheora (Ubuntu)
Fix Released
Medium
Jeff Waugh

Bug Description

libtheora is almost useless for encoding without these optimizations. For
example, on my p4 2.4ghz machine, I can't encode and stream in realtime with
flumotion.

A patch for libtheora alpha3 is attached. It came from thomas's fedora package:

http://thomas.apestaart.org/download/pkg/fedora-3-i386-gstreamer/libtheora-1.0alpha3-6.fdr.1.3/libtheora-1.0alpha3-6.fdr.1.3.src.rpm

Revision history for this message
Andy Wingo (andywingo) wrote :

Created an attachment (id=1205)
optimizations for libtheora

Thomas vander Stichele claims this patch does runtime cpu detection, so it can
be merged unconditionally. I haven't checked it myself though.

Revision history for this message
Jeff Waugh (jdub) wrote :

thanks heaps andy, runtime detection was the crucial problem with the previous
patch - i'll get this tested on our archs and into the archive if it works.

Revision history for this message
j^ (j) wrote :

whats the stat with adding mmx support for libtheora?
not that theora-mmx is also released along with alpha5

http://downloads.xiph.org/releases/theora/libtheora-mmx-1.0alpha5.tar.bz2

Revision history for this message
Jeff Waugh (jdub) wrote :

Does it do run time mmx detection?

Revision history for this message
Andy Wingo (andywingo) wrote :

I think xiph was looking at using liboil for the optimizations. At least that
way I have some hope of encoding on my laptop, which is ppc. Now that liboil
0.3.3 has been released with support for the theora routines, I would punt on
this patch and wait for the theora liboil patch to be included in an upstream
release.

Revision history for this message
Michael Smith (msmith-xiph) wrote :

(In reply to comment #4)
> Does it do run time mmx detection?

Theora-mmx? Yes.

From a quick look at the code, it does NOT, however, appear to do compile-time
mmx-detection. This means building it for non-x86 presumably will fall over (but
it's probably easy to fix); I guess that makes it inappropriate for ubuntu to
adopt wholesale - unless you do arch-specific packages?.

There are really three directions xiph is looking at for having a fast theora
that can be widely adopted:

 1) theora-mmx, as it stands currently, presumably with things like 'detecting
what you can compile' added. As well as the actual assembly code, theora-mmx
adds the infrastructure for doing cpu-specific optimisations for multiple
architectures (i.e. it doesn't just hack in the mmx code), so this _could_ be a
basis for doing this optimisation for more architectures.

 2) theora-liboil. This basically uses the same actual assembly code as
theora-mmx, but moves the optimisations to inside liboil. Some people have
expressed a preference for using this as a platform for doing optimisations for
more architectures.

 3) Longer term, derf's theora-exp implementation will, hopefully, take over.
It's higher quality code, implements the full theora spec, is faster, and has a
much nicer API. It's not ready now, though.

At this point in time, for Ubuntu, option 1 (with a few basic fixes, probably),
or option 2 would be sensible.

Revision history for this message
Jeff Waugh (jdub) wrote :

Unfortunately, even option 1 is too late for breezy. But with dapper, we have an
abundance of choice. :-) Does theora-exp use liboil?

Changed in libtheora:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.