Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 23 Apr 2013 09:01:46 +0000 (11:01 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 23 Apr 2013 09:01:46 +0000 (11:01 +0200)
* qatar/master:
  x86: Move some conditional code around to avoid unused variable warnings

Conflicts:
libavcodec/x86/dsputil_mmx.c
libavfilter/x86/vf_yadif_init.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/x86/dsputil_mmx.c
libavcodec/x86/dsputilenc_mmx.c
libavcodec/x86/mpegvideoenc.c
libavfilter/x86/vf_gradfun.c
libavfilter/x86/vf_yadif_init.c

@@@ -1450,8 -1325,17 +1449,7 @@@ static av_cold void dsputil_init_mmx(DS
  static av_cold void dsputil_init_mmxext(DSPContext *c, AVCodecContext *avctx,
                                          int mm_flags)
  {
 -#if HAVE_INLINE_ASM
 -    const int high_bit_depth = avctx->bits_per_raw_sample > 8;
--
- #if HAVE_YASM
 -    if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX) {
 -        c->idct_put = ff_idct_xvid_mmxext_put;
 -        c->idct_add = ff_idct_xvid_mmxext_add;
 -        c->idct     = ff_idct_xvid_mmxext;
 -    }
 -#endif /* HAVE_INLINE_ASM */
 -
+ #if HAVE_MMXEXT_EXTERNAL
      SET_QPEL_FUNCS(avg_qpel,        0, 16, mmxext, );
      SET_QPEL_FUNCS(avg_qpel,        1,  8, mmxext, );
  
Simple merge
@@@ -81,9 -81,8 +81,8 @@@ extern uint16_t ff_inv_zigzag_direct16[
  #include "mpegvideoenc_template.c"
  #endif /* HAVE_SSSE3_INLINE */
  
 -av_cold void ff_MPV_encode_init_x86(MpegEncContext *s)
 +av_cold void ff_dct_encode_init_x86(MpegEncContext *s)
  {
-     int mm_flags = av_get_cpu_flags();
      const int dct_algo = s->avctx->dct_algo;
  
      if (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX) {
Simple merge
@@@ -36,65 -37,24 +36,65 @@@ void ff_yadif_filter_line_ssse3(void *d
                                  void *next, int w, int prefs,
                                  int mrefs, int parity, int mode);
  
 +void ff_yadif_filter_line_16bit_mmxext(void *dst, void *prev, void *cur,
 +                                       void *next, int w, int prefs,
 +                                       int mrefs, int parity, int mode);
 +void ff_yadif_filter_line_16bit_sse2(void *dst, void *prev, void *cur,
 +                                     void *next, int w, int prefs,
 +                                     int mrefs, int parity, int mode);
 +void ff_yadif_filter_line_16bit_ssse3(void *dst, void *prev, void *cur,
 +                                      void *next, int w, int prefs,
 +                                      int mrefs, int parity, int mode);
 +void ff_yadif_filter_line_16bit_sse4(void *dst, void *prev, void *cur,
 +                                     void *next, int w, int prefs,
 +                                     int mrefs, int parity, int mode);
 +
 +void ff_yadif_filter_line_10bit_mmxext(void *dst, void *prev, void *cur,
 +                                       void *next, int w, int prefs,
 +                                       int mrefs, int parity, int mode);
 +void ff_yadif_filter_line_10bit_sse2(void *dst, void *prev, void *cur,
 +                                     void *next, int w, int prefs,
 +                                     int mrefs, int parity, int mode);
 +void ff_yadif_filter_line_10bit_ssse3(void *dst, void *prev, void *cur,
 +                                      void *next, int w, int prefs,
 +                                      int mrefs, int parity, int mode);
 +
  av_cold void ff_yadif_init_x86(YADIFContext *yadif)
  {
+ #if HAVE_YASM
      int cpu_flags = av_get_cpu_flags();
 +    int bit_depth = (!yadif->csp) ? 8
 +                                  : yadif->csp->comp[0].depth_minus1 + 1;
  
- #if HAVE_YASM
 +    if (bit_depth >= 15) {
  #if ARCH_X86_32
 -    if (EXTERNAL_MMXEXT(cpu_flags)) {
 -        yadif->filter_line = ff_yadif_filter_line_mmxext;
 -        yadif->req_align   = 8;
 -    }
 +        if (EXTERNAL_MMXEXT(cpu_flags))
 +            yadif->filter_line = ff_yadif_filter_line_16bit_mmxext;
  #endif /* ARCH_X86_32 */
 -    if (EXTERNAL_SSE2(cpu_flags)) {
 -        yadif->filter_line = ff_yadif_filter_line_sse2;
 -        yadif->req_align   = 16;
 -    }
 -    if (EXTERNAL_SSSE3(cpu_flags)) {
 -        yadif->filter_line = ff_yadif_filter_line_ssse3;
 -        yadif->req_align   = 16;
 +        if (EXTERNAL_SSE2(cpu_flags))
 +            yadif->filter_line = ff_yadif_filter_line_16bit_sse2;
 +        if (EXTERNAL_SSSE3(cpu_flags))
 +            yadif->filter_line = ff_yadif_filter_line_16bit_ssse3;
 +        if (EXTERNAL_SSE4(cpu_flags))
 +            yadif->filter_line = ff_yadif_filter_line_16bit_sse4;
 +    } else if ( bit_depth >= 9 && bit_depth <= 14) {
 +#if ARCH_X86_32
 +        if (EXTERNAL_MMXEXT(cpu_flags))
 +            yadif->filter_line = ff_yadif_filter_line_10bit_mmxext;
 +#endif /* ARCH_X86_32 */
 +        if (EXTERNAL_SSE2(cpu_flags))
 +            yadif->filter_line = ff_yadif_filter_line_10bit_sse2;
 +        if (EXTERNAL_SSSE3(cpu_flags))
 +            yadif->filter_line = ff_yadif_filter_line_10bit_ssse3;
 +    } else {
 +#if ARCH_X86_32
 +        if (EXTERNAL_MMXEXT(cpu_flags))
 +            yadif->filter_line = ff_yadif_filter_line_mmxext;
 +#endif /* ARCH_X86_32 */
 +        if (EXTERNAL_SSE2(cpu_flags))
 +            yadif->filter_line = ff_yadif_filter_line_sse2;
 +        if (EXTERNAL_SSSE3(cpu_flags))
 +            yadif->filter_line = ff_yadif_filter_line_ssse3;
      }
  #endif /* HAVE_YASM */
  }