Merge commit '6369ba3c9cc74becfaad2a8882dff3dd3e7ae3c0'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 30 Aug 2013 10:08:28 +0000 (12:08 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 30 Aug 2013 10:08:28 +0000 (12:08 +0200)
* commit '6369ba3c9cc74becfaad2a8882dff3dd3e7ae3c0':
  x86: avcodec: Use convenience macros to check for CPU flags

Conflicts:
libavcodec/x86/dsputil_init.c
libavcodec/x86/hpeldsp_init.c
libavcodec/x86/motion_est.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/x86/cavsdsp.c
libavcodec/x86/dnxhdenc.c
libavcodec/x86/dsputil_init.c
libavcodec/x86/dsputilenc_mmx.c
libavcodec/x86/hpeldsp_init.c
libavcodec/x86/lpc.c
libavcodec/x86/motion_est.c
libavcodec/x86/mpegvideo.c
libavcodec/x86/videodsp_init.c
libavcodec/x86/vorbisdsp_init.c
libavcodec/x86/vp8dsp_init.c

Simple merge
Simple merge
@@@ -681,51 -696,22 +682,51 @@@ av_cold void ff_dsputil_init_x86(DSPCon
          c->add_hfyu_median_prediction = ff_add_hfyu_median_prediction_cmov;
  #endif
  
-     if (cpu_flags & AV_CPU_FLAG_MMX) {
 -    if (X86_MMX(cpu_flags))
++    if (X86_MMX(cpu_flags)) {
 +#if HAVE_INLINE_ASM
 +        const int idct_algo = avctx->idct_algo;
 +
 +        if (avctx->lowres == 0 && avctx->bits_per_raw_sample <= 8) {
 +            if (idct_algo == FF_IDCT_AUTO || idct_algo == FF_IDCT_SIMPLEMMX) {
 +                c->idct_put              = ff_simple_idct_put_mmx;
 +                c->idct_add              = ff_simple_idct_add_mmx;
 +                c->idct                  = ff_simple_idct_mmx;
 +                c->idct_permutation_type = FF_SIMPLE_IDCT_PERM;
 +            } else if (idct_algo == FF_IDCT_XVIDMMX) {
 +                if (cpu_flags & AV_CPU_FLAG_SSE2) {
 +                    c->idct_put              = ff_idct_xvid_sse2_put;
 +                    c->idct_add              = ff_idct_xvid_sse2_add;
 +                    c->idct                  = ff_idct_xvid_sse2;
 +                    c->idct_permutation_type = FF_SSE2_IDCT_PERM;
 +                } else if (cpu_flags & AV_CPU_FLAG_MMXEXT) {
 +                    c->idct_put              = ff_idct_xvid_mmxext_put;
 +                    c->idct_add              = ff_idct_xvid_mmxext_add;
 +                    c->idct                  = ff_idct_xvid_mmxext;
 +                } else {
 +                    c->idct_put              = ff_idct_xvid_mmx_put;
 +                    c->idct_add              = ff_idct_xvid_mmx_add;
 +                    c->idct                  = ff_idct_xvid_mmx;
 +                }
 +            }
 +        }
 +#endif /* HAVE_INLINE_ASM */
 +
          dsputil_init_mmx(c, avctx, cpu_flags);
 +    }
  
-     if (cpu_flags & AV_CPU_FLAG_MMXEXT)
+     if (X86_MMXEXT(cpu_flags))
          dsputil_init_mmxext(c, avctx, cpu_flags);
  
-     if (cpu_flags & AV_CPU_FLAG_SSE)
+     if (X86_SSE(cpu_flags))
          dsputil_init_sse(c, avctx, cpu_flags);
  
-     if (cpu_flags & AV_CPU_FLAG_SSE2)
+     if (X86_SSE2(cpu_flags))
          dsputil_init_sse2(c, avctx, cpu_flags);
  
-     if (cpu_flags & AV_CPU_FLAG_SSSE3)
+     if (EXTERNAL_SSSE3(cpu_flags))
          dsputil_init_ssse3(c, avctx, cpu_flags);
  
-     if (cpu_flags & AV_CPU_FLAG_SSE4)
+     if (EXTERNAL_SSE4(cpu_flags))
          dsputil_init_sse4(c, avctx, cpu_flags);
  
      if (CONFIG_ENCODERS)
Simple merge
Simple merge
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
- #include "libavutil/x86/asm.h"
  #include "libavutil/attributes.h"
  #include "libavutil/cpu.h"
 -#include "libavutil/internal.h"
  #include "libavutil/mem.h"
+ #include "libavutil/x86/asm.h"
+ #include "libavutil/x86/cpu.h"
  #include "libavcodec/lpc.h"
  
  DECLARE_ASM_CONST(16, double, pd_1)[2] = { 1.0, 1.0 };
   */
  
  #include "libavutil/attributes.h"
 -#include "libavutil/internal.h"
 +#include "libavutil/avassert.h"
  #include "libavutil/mem.h"
  #include "libavutil/x86/asm.h"
+ #include "libavutil/x86/cpu.h"
  #include "dsputil_x86.h"
  
  #if HAVE_INLINE_ASM
@@@ -466,7 -467,7 +467,7 @@@ av_cold void ff_dsputil_init_pix_mmx(DS
              c->pix_abs[1][3] = sad8_xy2_mmxext;
          }
      }
-     if ((cpu_flags & AV_CPU_FLAG_SSE2) && !(cpu_flags & AV_CPU_FLAG_3DNOW) && avctx->codec_id != AV_CODEC_ID_SNOW) {
 -    if (INLINE_SSE2(cpu_flags) && !(cpu_flags & AV_CPU_FLAG_3DNOW)) {
++    if (INLINE_SSE2(cpu_flags) && !(cpu_flags & AV_CPU_FLAG_3DNOW) && avctx->codec_id != AV_CODEC_ID_SNOW) {
          c->sad[0]= sad16_sse2;
      }
  #endif /* HAVE_INLINE_ASM */
@@@ -556,10 -557,10 +557,10 @@@ static void  denoise_dct_sse2(MpegEncCo
  
  av_cold void ff_MPV_common_init_x86(MpegEncContext *s)
  {
 -#if HAVE_INLINE_ASM
 +#if HAVE_MMX_INLINE
      int cpu_flags = av_get_cpu_flags();
  
-     if (cpu_flags & AV_CPU_FLAG_MMX) {
+     if (INLINE_MMX(cpu_flags)) {
          s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_mmx;
          s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_mmx;
          s->dct_unquantize_mpeg1_intra = dct_unquantize_mpeg1_intra_mmx;
Simple merge
Simple merge
Simple merge