Merge commit 'dcb7c868ec7af7d3a138b3254ef2e08f074d8ec5'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 27 Aug 2014 19:09:30 +0000 (21:09 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 27 Aug 2014 19:09:30 +0000 (21:09 +0200)
* commit 'dcb7c868ec7af7d3a138b3254ef2e08f074d8ec5':
  cosmetics: Make naming scheme of Xvid IDCT consistent with other IDCTs

Conflicts:
libavcodec/mpeg4videodec.c
libavcodec/x86/Makefile
libavcodec/x86/dct-test.c
libavcodec/x86/xvididct_sse2.c
libavcodec/xvididct.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/idctdsp.c
libavcodec/mpeg4videodec.c
libavcodec/x86/Makefile
libavcodec/x86/dct-test.c
libavcodec/x86/xvididct.h
libavcodec/x86/xvididct_init.c
libavcodec/x86/xvididct_mmx.c
libavcodec/x86/xvididct_sse2.c
libavcodec/xvididct.c
libavcodec/xvididct.h

@@@ -250,61 -157,32 +250,61 @@@ av_cold void ff_idctdsp_init(IDCTDSPCon
  {
      const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8;
  
 -    if (avctx->bits_per_raw_sample == 10) {
 -        c->idct_put  = ff_simple_idct_put_10;
 -        c->idct_add  = ff_simple_idct_add_10;
 -        c->idct      = ff_simple_idct_10;
 +    if (avctx->lowres==1) {
 +        c->idct_put  = ff_jref_idct4_put;
 +        c->idct_add  = ff_jref_idct4_add;
 +        c->idct      = ff_j_rev_dct4;
          c->perm_type = FF_IDCT_PERM_NONE;
 -    } else if (avctx->idct_algo == FF_IDCT_INT) {
 -        c->idct_put  = jref_idct_put;
 -        c->idct_add  = jref_idct_add;
 -        c->idct      = ff_j_rev_dct;
 -        c->perm_type = FF_IDCT_PERM_LIBMPEG2;
 -    } else if (avctx->idct_algo == FF_IDCT_FAAN) {
 -        c->idct_put  = ff_faanidct_put;
 -        c->idct_add  = ff_faanidct_add;
 -        c->idct      = ff_faanidct;
 +    } else if (avctx->lowres==2) {
 +        c->idct_put  = ff_jref_idct2_put;
 +        c->idct_add  = ff_jref_idct2_add;
 +        c->idct      = ff_j_rev_dct2;
          c->perm_type = FF_IDCT_PERM_NONE;
 -    } else { // accurate/default
 -        c->idct_put  = ff_simple_idct_put_8;
 -        c->idct_add  = ff_simple_idct_add_8;
 -        c->idct      = ff_simple_idct_8;
 +    } else if (avctx->lowres==3) {
 +        c->idct_put  = ff_jref_idct1_put;
 +        c->idct_add  = ff_jref_idct1_add;
 +        c->idct      = ff_j_rev_dct1;
          c->perm_type = FF_IDCT_PERM_NONE;
 +    } else {
 +        if (avctx->bits_per_raw_sample == 10) {
 +            c->idct_put              = ff_simple_idct_put_10;
 +            c->idct_add              = ff_simple_idct_add_10;
 +            c->idct                  = ff_simple_idct_10;
 +            c->perm_type             = FF_IDCT_PERM_NONE;
 +        } else if (avctx->bits_per_raw_sample == 12) {
 +            c->idct_put              = ff_simple_idct_put_12;
 +            c->idct_add              = ff_simple_idct_add_12;
 +            c->idct                  = ff_simple_idct_12;
 +            c->perm_type             = FF_IDCT_PERM_NONE;
 +        } else {
 +            if (avctx->idct_algo == FF_IDCT_INT) {
 +                c->idct_put  = jref_idct_put;
 +                c->idct_add  = jref_idct_add;
 +                c->idct      = ff_j_rev_dct;
 +                c->perm_type = FF_IDCT_PERM_LIBMPEG2;
 +            } else if (avctx->idct_algo == FF_IDCT_FAAN) {
 +                c->idct_put  = ff_faanidct_put;
 +                c->idct_add  = ff_faanidct_add;
 +                c->idct      = ff_faanidct;
 +                c->perm_type = FF_IDCT_PERM_NONE;
 +            } else { // accurate/default
 +                c->idct_put  = ff_simple_idct_put_8;
 +                c->idct_add  = ff_simple_idct_add_8;
 +                c->idct      = ff_simple_idct_8;
 +                c->perm_type = FF_IDCT_PERM_NONE;
 +            }
 +        }
      }
  
 -    c->put_pixels_clamped        = put_pixels_clamped_c;
 +    c->put_pixels_clamped        = ff_put_pixels_clamped;
      c->put_signed_pixels_clamped = put_signed_pixels_clamped_c;
 -    c->add_pixels_clamped        = add_pixels_clamped_c;
 +    c->add_pixels_clamped        = ff_add_pixels_clamped;
 +
 +    if (CONFIG_MPEG4_DECODER && avctx->idct_algo == FF_IDCT_XVID)
-         ff_xvididct_init(c, avctx);
++        ff_xvid_idct_init(c, avctx);
  
 +    if (ARCH_ALPHA)
 +        ff_idctdsp_init_alpha(c, avctx, high_bit_depth);
      if (ARCH_ARM)
          ff_idctdsp_init_arm(c, avctx, high_bit_depth);
      if (ARCH_PPC)
@@@ -2694,11 -2546,13 +2694,11 @@@ static int mpeg4_update_thread_context(
      if (ret < 0)
          return ret;
  
 +    memcpy(((uint8_t*)s) + sizeof(MpegEncContext), ((uint8_t*)s1) + sizeof(MpegEncContext), sizeof(Mpeg4DecContext) - sizeof(MpegEncContext));
 +
      if (CONFIG_MPEG4_DECODER && !init && s1->xvid_build >= 0)
-         ff_xvididct_init(&s->m.idsp, dst);
+         ff_xvid_idct_init(&s->m.idsp, dst);
  
 -    s->shape               = s1->shape;
 -    s->time_increment_bits = s1->time_increment_bits;
 -    s->xvid_build          = s1->xvid_build;
 -
      return 0;
  }
  
@@@ -68,12 -63,11 +68,12 @@@ MMX-OBJS-$(CONFIG_DIRAC_DECODER)       
  MMX-OBJS-$(CONFIG_FDCTDSP)             += x86/fdct.o
  MMX-OBJS-$(CONFIG_IDCTDSP)             += x86/idctdsp_mmx.o             \
                                            x86/simple_idct.o
 -MMX-OBJS-$(CONFIG_QPELDSP)             += x86/fpel_mmx.o
  
  # decoders/encoders
- MMX-OBJS-$(CONFIG_MPEG4_DECODER)       += x86/idct_mmx_xvid.o           \
-                                           x86/idct_sse2_xvid.o
+ MMX-OBJS-$(CONFIG_MPEG4_DECODER)       += x86/xvididct_mmx.o            \
+                                           x86/xvididct_sse2.o
 +MMX-OBJS-$(CONFIG_SNOW_DECODER)        += x86/snowdsp.o
 +MMX-OBJS-$(CONFIG_SNOW_ENCODER)        += x86/snowdsp.o
  MMX-OBJS-$(CONFIG_VC1_DECODER)         += x86/vc1dsp_mmx.o
  
  
  #include "config.h"
  
  #include "fdct.h"
- #include "idct_xvid.h"
+ #include "xvididct.h"
  #include "simple_idct.h"
  
 +#if ARCH_X86_64 && HAVE_MMX && HAVE_YASM
 +void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,
 +                                int16_t *block, int16_t *qmat);
 +
 +static void ff_prores_idct_put_10_sse2_wrap(int16_t *dst){
 +    DECLARE_ALIGNED(16, static int16_t, qmat)[64];
 +    DECLARE_ALIGNED(16, static int16_t, tmp)[64];
 +    int i;
 +
 +    for(i=0; i<64; i++){
 +        qmat[i]=4;
 +        tmp[i]= dst[i];
 +    }
 +    ff_prores_idct_put_10_sse2(dst, 16, tmp, qmat);
 +
 +    for(i=0; i<64; i++) {
 +         dst[i] -= 512;
 +    }
 +}
 +#endif
 +
  static const struct algo fdct_tab_arch[] = {
  #if HAVE_MMX_INLINE
      { "MMX",    ff_fdct_mmx,    FF_IDCT_PERM_NONE, AV_CPU_FLAG_MMX },
@@@ -62,16 -41,13 +62,16 @@@ static const struct algo idct_tab_arch[
  #endif
  #if CONFIG_MPEG4_DECODER
  #if HAVE_MMX_INLINE
-     { "XVID-MMX",    ff_idct_xvid_mmx,    FF_IDCT_PERM_NONE,   AV_CPU_FLAG_MMX,    1 },
+     { "XVID-MMX",    ff_xvid_idct_mmx,    FF_IDCT_PERM_NONE,   AV_CPU_FLAG_MMX,    1 },
  #endif
  #if HAVE_MMXEXT_INLINE
-     { "XVID-MMXEXT", ff_idct_xvid_mmxext, FF_IDCT_PERM_NONE,   AV_CPU_FLAG_MMXEXT, 1 },
+     { "XVID-MMXEXT", ff_xvid_idct_mmxext, FF_IDCT_PERM_NONE,   AV_CPU_FLAG_MMXEXT, 1 },
  #endif
  #if HAVE_SSE2_INLINE
-     { "XVID-SSE2",   ff_idct_xvid_sse2,   FF_IDCT_PERM_SSE2,   AV_CPU_FLAG_SSE2,   1 },
+     { "XVID-SSE2",   ff_xvid_idct_sse2,   FF_IDCT_PERM_SSE2,   AV_CPU_FLAG_SSE2,   1 },
 +#if ARCH_X86_64 && HAVE_YASM
 +    { "PR-SSE2",     ff_prores_idct_put_10_sse2_wrap, FF_IDCT_PERM_TRANSPOSE, AV_CPU_FLAG_SSE2, 1 },
 +#endif
  #endif
  #endif /* CONFIG_MPEG4_DECODER */
      { 0 }
Simple merge
Simple merge
Simple merge
   * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
 -#include "libavutil/internal.h"
  #include "libavutil/mem.h"
  #include "libavutil/x86/asm.h"
- #include "idct_xvid.h"
  #include "idctdsp.h"
+ #include "xvididct.h"
  
  #if HAVE_SSE2_INLINE
  
@@@ -340,7 -342,7 +341,7 @@@ DECLARE_ASM_CONST(16, int32_t, walkenId
      "movdqa   %%xmm6, 4*16("dct")     \n\t" \
      "movdqa   "SREG2", 7*16("dct")    \n\t"
  
- av_extern_inline void ff_idct_xvid_sse2(short *block)
 -inline void ff_xvid_idct_sse2(short *block)
++av_extern_inline void ff_xvid_idct_sse2(short *block)
  {
      __asm__ volatile(
      "movq     "MANGLE(m127)", %%mm0                              \n\t"
  #include "idctdsp.h"
  #include "xvididct.h"
  
- av_cold void ff_xvididct_init(IDCTDSPContext *c, AVCodecContext *avctx)
 +static void idct_xvid_put(uint8_t *dest, int line_size, int16_t *block)
 +{
 +    ff_idct_xvid(block);
 +    ff_put_pixels_clamped(block, dest, line_size);
 +}
 +
 +static void idct_xvid_add(uint8_t *dest, int line_size, int16_t *block)
 +{
 +    ff_idct_xvid(block);
 +    ff_add_pixels_clamped(block, dest, line_size);
 +}
 +
+ av_cold void ff_xvid_idct_init(IDCTDSPContext *c, AVCodecContext *avctx)
  {
      const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8;
  
            avctx->idct_algo == FF_IDCT_XVID))
          return;
  
 +    if (avctx->idct_algo == FF_IDCT_XVID) {
 +        c->idct_put  = idct_xvid_put;
 +        c->idct_add  = idct_xvid_add;
 +        c->idct      = ff_idct_xvid;
 +        c->perm_type = FF_IDCT_PERM_NONE;
 +    }
 +
      if (ARCH_X86)
-         ff_xvididct_init_x86(c);
+         ff_xvid_idct_init_x86(c);
  
      ff_init_scantable_permutation(c->idct_permutation, c->perm_type);
  }
  #include "avcodec.h"
  #include "idctdsp.h"
  
- void ff_xvididct_init(IDCTDSPContext *c, AVCodecContext *avctx);
+ void ff_xvid_idct_init(IDCTDSPContext *c, AVCodecContext *avctx);
  
- void ff_xvididct_init_x86(IDCTDSPContext *c);
+ void ff_xvid_idct_init_x86(IDCTDSPContext *c);
  
 +void ff_idct_xvid(int16_t *const In);
 +
  #endif /* AVCODEC_XVIDIDCT_H */