[5/5] Split off fixed point AAN DCT into separate component

Message ID 1410269130-28173-5-git-send-email-diego@biurrun.de
State New
Headers show

Commit Message

Diego Biurrun Sept. 9, 2014, 1:25 p.m.
---
 configure                  | 4 ++++
 libavcodec/Makefile        | 3 ++-
 libavcodec/dct-test.c      | 4 +++-
 libavcodec/fdctdsp.c       | 2 ++
 libavcodec/mpegvideo_enc.c | 2 ++
 5 files changed, 13 insertions(+), 2 deletions(-)

Comments

Luca Barbato Sept. 11, 2014, 9:06 p.m. | #1
On 09/09/14 15:25, Diego Biurrun wrote:
> ---
>  configure                  | 4 ++++
>  libavcodec/Makefile        | 3 ++-
>  libavcodec/dct-test.c      | 4 +++-
>  libavcodec/fdctdsp.c       | 2 ++
>  libavcodec/mpegvideo_enc.c | 2 ++
>  5 files changed, 13 insertions(+), 2 deletions(-)
> 

Looks fine, but I hadn't compile tested locally (have oracle do that)

lu

Patch

diff --git a/configure b/configure
index 3a75014..3bb8ca8 100755
--- a/configure
+++ b/configure
@@ -132,6 +132,7 @@  Component options:
   --disable-fft            disable FFT code
   --disable-faan           disable floating point AAN (I)DCT code
   --disable-intidct        disable fixed point IJG IDCT code
+  --disable-fastintdct     disable fixed point AAN DCT code
 
 Hardware accelerators:
   --enable-dxva2           enable DXVA2 code
@@ -1223,6 +1224,7 @@  SUBSYSTEM_LIST="
     doc
     error_resilience
     faan
+    fastintdct
     fft
     intidct
     lsp
@@ -1733,6 +1735,7 @@  dct_select="rdft"
 error_resilience_select="me_cmp"
 faandct_deps="faan fdctdsp"
 faanidct_deps="faan idctdsp"
+fastintdct_deps="fdctdsp"
 intidct_deps="idctdsp"
 intrax8_select="error_resilience"
 mdct_select="fft"
@@ -2231,6 +2234,7 @@  enable asm
 enable debug
 enable doc
 enable faan faandct faanidct
+enable fastintdct
 enable intidct
 enable optimizations
 enable safe_bitstream_reader
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index e1e2dfa..9122029 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -38,7 +38,8 @@  OBJS-$(CONFIG_DCT)                     += dct.o dct32_fixed.o dct32_float.o
 OBJS-$(CONFIG_ERROR_RESILIENCE)        += error_resilience.o
 OBJS-$(CONFIG_FAANDCT)                 += faandct.o
 OBJS-$(CONFIG_FAANIDCT)                += faanidct.o
-OBJS-$(CONFIG_FDCTDSP)                 += fdctdsp.o jfdctfst.o jfdctint.o
+OBJS-$(CONFIG_FASTINTDCT)              += jfdctfst.o
+OBJS-$(CONFIG_FDCTDSP)                 += fdctdsp.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-OBJS-yes)
diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index b91558a..8f13df4 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.c
@@ -58,8 +58,10 @@  struct algo {
 
 static const struct algo fdct_tab[] = {
     { "REF-DBL",     ff_ref_fdct,          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_FASTINTDCT
+    { "IJG-AAN-INT", ff_fdct_ifast,        FF_IDCT_PERM_NONE },
+#endif /* CONFIG_FASTINTDCT */
 #if CONFIG_FAANDCT
     { "FAAN",        ff_faandct,           FF_IDCT_PERM_NONE },
 #endif /* CONFIG_FAANDCT */
diff --git a/libavcodec/fdctdsp.c b/libavcodec/fdctdsp.c
index f299eae..4269996 100644
--- a/libavcodec/fdctdsp.c
+++ b/libavcodec/fdctdsp.c
@@ -30,9 +30,11 @@  av_cold void ff_fdctdsp_init(FDCTDSPContext *c, AVCodecContext *avctx)
     if (avctx->bits_per_raw_sample == 10) {
         c->fdct    = ff_jpeg_fdct_islow_10;
         c->fdct248 = ff_fdct248_islow_10;
+#if CONFIG_FASTINTDCT
     } else if (avctx->dct_algo == FF_DCT_FASTINT) {
         c->fdct    = ff_fdct_ifast;
         c->fdct248 = ff_fdct_ifast248;
+#endif /* CONFIG_FASTINTDCT */
 #if CONFIG_FAANDCT
     } else if (avctx->dct_algo == FF_DCT_FAAN) {
         c->fdct    = ff_faandct;
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 17322e5..7c81863 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -104,6 +104,7 @@  void ff_convert_matrix(MpegEncContext *s, int (*qmat)[64],
                 qmat[qscale][i] = (int)((UINT64_C(1) << QMAT_SHIFT) /
                                         (qscale * quant_matrix[j]));
             }
+#if CONFIG_FASTINTDCT
         } else if (fdsp->fdct == ff_fdct_ifast) {
             for (i = 0; i < 64; i++) {
                 const int j = s->idsp.idct_permutation[i];
@@ -117,6 +118,7 @@  void ff_convert_matrix(MpegEncContext *s, int (*qmat)[64],
                                         (ff_aanscales[i] * qscale *
                                          quant_matrix[j]));
             }
+#endif /* CONFIG_FASTINTDCT */
         } else {
             for (i = 0; i < 64; i++) {
                 const int j = s->idsp.idct_permutation[i];