Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 9 Sep 2012 11:27:42 +0000 (13:27 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 9 Sep 2012 11:27:42 +0000 (13:27 +0200)
* qatar/master:
  swscale: Provide the right alignment for external mmx asm
  x86: Replace checks for CPU extensions and flags by convenience macros
  configure: msvc: fix/simplify setting of flags for hostcc
  x86: mlpdsp: mlp_filter_channel_x86 requires inline asm

Conflicts:
libavcodec/x86/fft_init.c
libavcodec/x86/h264_intrapred_init.c
libavcodec/x86/h264dsp_init.c
libavcodec/x86/mpegaudiodec.c
libavcodec/x86/proresdsp_init.c
libavutil/x86/float_dsp_init.c
libswscale/utils.c
libswscale/x86/swscale.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
19 files changed:
1  2 
configure
libavcodec/x86/ac3dsp_init.c
libavcodec/x86/dsputilenc_mmx.c
libavcodec/x86/fft_init.c
libavcodec/x86/fmtconvert_init.c
libavcodec/x86/h264_intrapred_init.c
libavcodec/x86/h264dsp_init.c
libavcodec/x86/mlpdsp.c
libavcodec/x86/mpegaudiodec.c
libavcodec/x86/mpegvideoenc.c
libavcodec/x86/pngdsp_init.c
libavcodec/x86/proresdsp_init.c
libavcodec/x86/rv40dsp_init.c
libavcodec/x86/vp3dsp_init.c
libavcodec/x86/vp56dsp_init.c
libavutil/x86/float_dsp_init.c
libswscale/utils.c
libswscale/x86/rgb2rgb.c
libswscale/x86/swscale.c

diff --cc configure
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -29,15 -30,12 +30,15 @@@ void ff_prores_idct_put_10_sse4(uint16_
  void ff_prores_idct_put_10_avx (uint16_t *dst, int linesize,
                                  DCTELEM *block, const int16_t *qmat);
  
 -void ff_proresdsp_x86_init(ProresDSPContext *dsp)
 +void ff_proresdsp_x86_init(ProresDSPContext *dsp, AVCodecContext *avctx)
  {
- #if ARCH_X86_64 && HAVE_YASM
+ #if ARCH_X86_64
      int flags = av_get_cpu_flags();
  
-     if (flags & AV_CPU_FLAG_SSE2) {
 +    if(avctx->flags & CODEC_FLAG_BITEXACT)
 +        return;
 +
+     if (EXTERNAL_SSE2(flags)) {
          dsp->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
          dsp->idct_put = ff_prores_idct_put_10_sse2;
      }
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -1020,12 -969,12 +1021,11 @@@ av_cold int sws_init_context(SwsContex
      c->dstBpc = 1 + av_pix_fmt_descriptors[dstFormat].comp[0].depth_minus1;
      if (c->dstBpc < 8)
          c->dstBpc = 8;
 +    if (isAnyRGB(srcFormat) || srcFormat == PIX_FMT_PAL8)
 +        c->srcBpc = 16;
      if (c->dstBpc == 16)
          dst_stride <<= 1;
-     if (HAVE_MMXEXT && HAVE_INLINE_ASM && cpu_flags & AV_CPU_FLAG_MMXEXT &&
-         c->srcBpc == 8 && c->dstBpc <= 14) {
 -    FF_ALLOC_OR_GOTO(c, c->formatConvBuffer,
 -                     (FFALIGN(srcW, 16) * 2 * FFALIGN(c->srcBpc, 8) >> 3) + 16,
 -                     fail);
 -    if (INLINE_MMXEXT(cpu_flags) && c->srcBpc == 8 && c->dstBpc <= 10) {
++    if (INLINE_MMXEXT(cpu_flags) && c->srcBpc == 8 && c->dstBpc <= 14) {
          c->canMMX2BeUsed = (dstW >= srcW && (dstW & 31) == 0 &&
                              (srcW & 15) == 0) ? 1 : 0;
          if (!c->canMMX2BeUsed && dstW >= srcW && (srcW & 15) == 0
              c->chrXInc += 20;
          }
          // we don't use the x86 asm scaler if MMX is available
-         else if (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX && c->dstBpc <= 14) {
 -        else if (INLINE_MMX(cpu_flags)) {
++        else if (INLINE_MMX(cpu_flags) && c->dstBpc <= 14) {
              c->lumXInc = ((int64_t)(srcW       - 2) << 16) / (dstW       - 2) - 20;
              c->chrXInc = ((int64_t)(c->chrSrcW - 2) << 16) / (c->chrDstW - 2) - 20;
          }
  #else
                 "",
  #endif
 -               sws_format_name(dstFormat));
 +               av_get_pix_fmt_name(dstFormat));
  
-         if (HAVE_MMXEXT && cpu_flags & AV_CPU_FLAG_MMXEXT)
+         if (INLINE_MMXEXT(cpu_flags))
              av_log(c, AV_LOG_INFO, "using MMX2\n");
-         else if (HAVE_AMD3DNOW && cpu_flags & AV_CPU_FLAG_3DNOW)
+         else if (INLINE_AMD3DNOW(cpu_flags))
              av_log(c, AV_LOG_INFO, "using 3DNOW\n");
-         else if (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX)
+         else if (INLINE_MMX(cpu_flags))
              av_log(c, AV_LOG_INFO, "using MMX\n");
          else if (HAVE_ALTIVEC && cpu_flags & AV_CPU_FLAG_ALTIVEC)
              av_log(c, AV_LOG_INFO, "using AltiVec\n");
Simple merge
  #include "libswscale/swscale.h"
  #include "libswscale/swscale_internal.h"
  #include "libavutil/attributes.h"
 +#include "libavutil/avassert.h"
  #include "libavutil/intreadwrite.h"
  #include "libavutil/x86/asm.h"
+ #include "libavutil/x86/cpu.h"
  #include "libavutil/cpu.h"
  #include "libavutil/pixdesc.h"
  
@@@ -385,26 -315,18 +386,25 @@@ av_cold void ff_sws_init_swScale_mmx(Sw
  #endif
  #endif /* HAVE_INLINE_ASM */
  
- #if HAVE_YASM
  #define ASSIGN_SCALE_FUNC2(hscalefn, filtersize, opt1, opt2) do { \
      if (c->srcBpc == 8) { \
 -        hscalefn = c->dstBpc <= 10 ? ff_hscale8to15_ ## filtersize ## _ ## opt2 : \
 +        hscalefn = c->dstBpc <= 14 ? ff_hscale8to15_ ## filtersize ## _ ## opt2 : \
                                       ff_hscale8to19_ ## filtersize ## _ ## opt1; \
      } else if (c->srcBpc == 9) { \
 -        hscalefn = c->dstBpc <= 10 ? ff_hscale9to15_ ## filtersize ## _ ## opt2 : \
 +        hscalefn = c->dstBpc <= 14 ? ff_hscale9to15_ ## filtersize ## _ ## opt2 : \
                                       ff_hscale9to19_ ## filtersize ## _ ## opt1; \
      } else if (c->srcBpc == 10) { \
 -        hscalefn = c->dstBpc <= 10 ? ff_hscale10to15_ ## filtersize ## _ ## opt2 : \
 +        hscalefn = c->dstBpc <= 14 ? ff_hscale10to15_ ## filtersize ## _ ## opt2 : \
                                       ff_hscale10to19_ ## filtersize ## _ ## opt1; \
 -    } else /* c->srcBpc == 16 */ { \
 -        hscalefn = c->dstBpc <= 10 ? ff_hscale16to15_ ## filtersize ## _ ## opt2 : \
 +    } else if (c->srcBpc == 12) { \
 +        hscalefn = c->dstBpc <= 14 ? ff_hscale12to15_ ## filtersize ## _ ## opt2 : \
 +                                     ff_hscale12to19_ ## filtersize ## _ ## opt1; \
 +    } else if (c->srcBpc == 14 || ((c->srcFormat==PIX_FMT_PAL8||isAnyRGB(c->srcFormat)) && av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1<15)) { \
 +        hscalefn = c->dstBpc <= 14 ? ff_hscale14to15_ ## filtersize ## _ ## opt2 : \
 +                                     ff_hscale14to19_ ## filtersize ## _ ## opt1; \
 +    } else { /* c->srcBpc == 16 */ \
 +        av_assert0(c->srcBpc == 16);\
 +        hscalefn = c->dstBpc <= 14 ? ff_hscale16to15_ ## filtersize ## _ ## opt2 : \
                                       ff_hscale16to19_ ## filtersize ## _ ## opt1; \
      } \
  } while (0)