Merge commit '1274ea8dbaec44355bde07f6bb31fec0c4e6fd2d'
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 7 Sep 2014 22:54:55 +0000 (00:54 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 7 Sep 2014 22:54:55 +0000 (00:54 +0200)
* commit '1274ea8dbaec44355bde07f6bb31fec0c4e6fd2d':
  Split off floating point AAN (I)DCT into separate components

Conflicts:
configure
libavcodec/Makefile
libavcodec/dct-test.c
libavcodec/idctdsp.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
configure
libavcodec/Makefile
libavcodec/dct-test.c
libavcodec/fdctdsp.c
libavcodec/idctdsp.c
libavcodec/mpegvideo_enc.c

diff --cc configure
+++ b/configure
@@@ -145,13 -130,13 +145,14 @@@ Component options
    --disable-mdct           disable MDCT code
    --disable-rdft           disable RDFT code
    --disable-fft            disable FFT code
+   --disable-faan           disable floating point AAN (I)DCT code
 +  --disable-pixelutils     disable pixel utils in libavutil
  
  Hardware accelerators:
 -  --enable-dxva2           enable DXVA2 code
 -  --enable-vaapi           enable VAAPI code
 -  --enable-vda             enable VDA code
 -  --enable-vdpau           enable VDPAU code
 +  --disable-dxva2          disable DXVA2 code [autodetect]
 +  --disable-vaapi          disable VAAPI code [autodetect]
 +  --disable-vda            disable VDA code [autodetect]
 +  --disable-vdpau          disable VDPAU code [autodetect]
  
  Individual component options:
    --disable-everything     disable all components listed below
@@@ -1447,9 -1219,9 +1448,10 @@@ PROGRAM_LIST=
  
  SUBSYSTEM_LIST="
      dct
 -    doc
 +    dwt
      error_resilience
+     faan
 +    fast_unaligned
      fft
      lsp
      lzo
@@@ -1822,9 -1549,9 +1824,11 @@@ CONFIG_EXTRA=
      bswapdsp
      cabac
      dvprofile
 +    exif
+     faandct
+     faanidct
      fdctdsp
 +    frame_thread_encoder
      gcrypt
      golomb
      gplv3
@@@ -2024,7 -1729,8 +2028,9 @@@ threads_if_any="$THREADS_LIST
  # subsystems
  dct_select="rdft"
  error_resilience_select="me_cmp"
+ faandct_deps="faan fdctdsp"
+ faanidct_deps="faan idctdsp"
 +frame_thread_encoder_deps="encoders threads"
  intrax8_select="error_resilience"
  mdct_select="fft"
  rdft_select="fft"
@@@ -2693,8 -2227,8 +2699,9 @@@ enable strippin
  enable asm
  enable debug
  enable doc
+ enable faan faandct faanidct
  enable optimizations
 +enable runtime_cpudetect
  enable safe_bitstream_reader
  enable static
  enable swscale_alpha
@@@ -40,15 -34,13 +40,16 @@@ OBJS-$(CONFIG_AUDIODSP)                
  OBJS-$(CONFIG_BLOCKDSP)                += blockdsp.o
  OBJS-$(CONFIG_BSWAPDSP)                += bswapdsp.o
  OBJS-$(CONFIG_CABAC)                   += cabac.o
 +OBJS-$(CONFIG_CRYSTALHD)               += crystalhd.o
  OBJS-$(CONFIG_DCT)                     += dct.o dct32_fixed.o dct32_float.o
  OBJS-$(CONFIG_ERROR_RESILIENCE)        += error_resilience.o
- OBJS-$(CONFIG_FDCTDSP)                 += fdctdsp.o faandct.o           \
-                                           jfdctfst.o jfdctint.o
 +OBJS-$(CONFIG_EXIF)                    += exif.o tiff_common.o
+ OBJS-$(CONFIG_FAANDCT)                 += faandct.o
+ OBJS-$(CONFIG_FAANIDCT)                += faanidct.o
+ OBJS-$(CONFIG_FDCTDSP)                 += fdctdsp.o jfdctfst.o jfdctint.o
  FFT-OBJS-$(CONFIG_HARDCODED_TABLES)    += cos_tables.o cos_fixed_tables.o
  OBJS-$(CONFIG_FFT)                     += avfft.o fft_fixed.o fft_float.o \
 +                                          fft_fixed_32.o fft_init_table.o \
                                            $(FFT-OBJS-yes)
  OBJS-$(CONFIG_GOLOMB)                  += golomb.o
  OBJS-$(CONFIG_H263DSP)                 += h263dsp.o
@@@ -58,30 -58,20 +58,34 @@@ struct algo 
  
  static const struct algo fdct_tab[] = {
      { "REF-DBL",     ff_ref_fdct,          FF_IDCT_PERM_NONE },
-     { "FAAN",        ff_faandct,           FF_IDCT_PERM_NONE },
      { "IJG-AAN-INT", ff_fdct_ifast,        FF_IDCT_PERM_NONE },
      { "IJG-LLM-INT", ff_jpeg_fdct_islow_8, FF_IDCT_PERM_NONE },
+ #if CONFIG_FAANDCT
+     { "FAAN",        ff_faandct,           FF_IDCT_PERM_NONE },
+ #endif /* CONFIG_FAANDCT */
  };
  
 +static void ff_prores_idct_wrap(int16_t *dst){
 +    DECLARE_ALIGNED(16, static int16_t, qmat)[64];
 +    int i;
 +
 +    for(i=0; i<64; i++){
 +        qmat[i]=4;
 +    }
 +    ff_prores_idct(dst, qmat);
 +    for(i=0; i<64; i++) {
 +         dst[i] -= 512;
 +    }
 +}
 +
  static const struct algo idct_tab[] = {
-     { "FAANI",       ff_faanidct,          FF_IDCT_PERM_NONE },
      { "REF-DBL",     ff_ref_idct,          FF_IDCT_PERM_NONE },
      { "INT",         ff_j_rev_dct,         FF_IDCT_PERM_LIBMPEG2 },
      { "SIMPLE-C",    ff_simple_idct_8,     FF_IDCT_PERM_NONE },
 +    { "PR-C",        ff_prores_idct_wrap,  FF_IDCT_PERM_NONE, 0, 1 },
+ #if CONFIG_FAANIDCT
+     { "FAANI",       ff_faanidct,          FF_IDCT_PERM_NONE },
+ #endif /* CONFIG_FAANIDCT */
  #if CONFIG_MPEG4_DECODER
      { "XVID",        ff_xvid_idct,         FF_IDCT_PERM_NONE, 0, 1 },
  #endif /* CONFIG_MPEG4_DECODER */
Simple merge
@@@ -242,50 -148,28 +242,52 @@@ 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  = ff_jref_idct_put;
 -        c->idct_add  = ff_jref_idct_add;
 -        c->idct      = ff_j_rev_dct;
 -        c->perm_type = FF_IDCT_PERM_LIBMPEG2;
 -#if CONFIG_FAANIDCT
 -    } 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;
 -#endif /* CONFIG_FAANIDCT */
 -    } 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  = ff_jref_idct_put;
 +                c->idct_add  = ff_jref_idct_add;
 +                c->idct      = ff_j_rev_dct;
 +                c->perm_type = FF_IDCT_PERM_LIBMPEG2;
++#if CONFIG_FAANIDCT
 +            } 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;
++#endif /* CONFIG_FAANIDCT */
 +            } 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;
Simple merge