avcodec/ra144enc: avoid calling emms when the SSE2 version is used
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 5 Mar 2014 13:17:55 +0000 (14:17 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 5 Mar 2014 13:20:03 +0000 (14:20 +0100)
emms is a rather slow operation

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ra144enc.c

index cafedda..7f7c9f3 100644 (file)
@@ -34,7 +34,7 @@
 #include "mathops.h"
 #include "put_bits.h"
 #include "ra144.h"
-
+#include "libavutil/x86/cpu.h"
 
 static av_cold int ra144_encode_close(AVCodecContext *avctx)
 {
@@ -376,7 +376,8 @@ static void ra144_encode_subblock(RA144Context *ractx,
 
         ff_copy_and_dup(ractx->buffer_a, ractx->adapt_cb, cba_idx + BLOCKSIZE / 2 - 1);
         m[0] = (ff_irms(&ractx->dsp, ractx->buffer_a) * rms) >> 12;
-        emms_c();
+        if (!EXTERNAL_SSE2(av_get_cpu_flags()))
+            emms_c();
     }
     fixed_cb_search(work + LPC_ORDER, coefs, data, cba_idx, &cb1_idx, &cb2_idx);
     for (i = 0; i < BLOCKSIZE; i++) {