a52dec: Allow liba52 to use djbfft based IMDCT transform
authorMart Raudsepp <leio@gentoo.org>
Sun, 23 Aug 2009 11:34:32 +0000 (13:34 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Sun, 23 Aug 2009 11:34:32 +0000 (13:34 +0200)
liba52 in a52dec-0.7.4 does not have any MMX, MMXEXT or 3DNOW based
IMDCT transform acceleration. It does however have a software based
acceleration using the djbfft library (D.J. Bernstein's library for
fourier transforms - Extremely fast library for floating-point
convolution). So allow liba52 to use it through the MM_ACCEL_DJBFFT
flag.
The liba52 copy in MPlayer sources does have SSE, 3dnowext, 3dnow
and AltiVec implementations, but those are checked for first, and
djbfft is chosen only if none of those is available - good in the
case of some distributions including a port of the MPlayer changes
in their system a52dec library.

The down and upmix code in liba52 doesn't seem to be disturbed by
this additional MM_ACCEL flag and will still use MMX, SSE or 3DNOW
versions if passed from oil_cpu_get_flags (SSE currently is not).

Fixes bug #592787.

ext/a52dec/gsta52dec.c

index 8087a78..4c4127a 100644 (file)
@@ -192,7 +192,9 @@ gst_a52dec_class_init (GstA52DecClass * klass)
 
   oil_init ();
 
-  klass->a52_cpuflags = 0;
+  /* If no CPU instruction based acceleration is available, end up using the
+   * generic software djbfft based one when available in the used liba52 */
+  klass->a52_cpuflags = MM_ACCEL_DJBFFT;
   cpuflags = oil_cpu_get_flags ();
   if (cpuflags & OIL_IMPL_FLAG_MMX)
     klass->a52_cpuflags |= MM_ACCEL_X86_MMX;