[3/3] Only compile the apply_window_mp3 if 6 registers are available

Message ID 1310917392-64974-3-git-send-email-martin@martin.st
State Superseded
Headers show

Commit Message

Martin Storsjö July 17, 2011, 3:43 p.m.
The inline assembly uses 5 input registers and one input/output register.
This inline assembly doesn't work with the x86 Android NDK compiler,
where 6 registers aren't availble.
---
 libavcodec/x86/mpegaudiodec_mmx.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Patch

diff --git a/libavcodec/x86/mpegaudiodec_mmx.c b/libavcodec/x86/mpegaudiodec_mmx.c
index b644615..d439046 100644
--- a/libavcodec/x86/mpegaudiodec_mmx.c
+++ b/libavcodec/x86/mpegaudiodec_mmx.c
@@ -39,6 +39,7 @@ 
     op(sum, (w)[7 * 64], (p)[7 * 64]);    \
 }
 
+#if HAVE_6REGS
 static void apply_window(const float *buf, const float *win1,
                          const float *win2, float *sum1, float *sum2, int len)
 {
@@ -146,12 +147,15 @@  static void apply_window_mp3(float *in, float *win, int *unused, float *out,
     SUM8(MLSS, sum, win + 16 + 32, in + 32);
     *out = sum;
 }
+#endif
 
 void ff_mpadsp_init_mmx(MPADSPContext *s)
 {
     int mm_flags = av_get_cpu_flags();
 
+#if HAVE_6REGS
     if (mm_flags & AV_CPU_FLAG_SSE2) {
         s->apply_window_float = apply_window_mp3;
     }
+#endif
 }