Split off fixed point IJG IDCT into separate component

Message ID 1410510363-194735-1-git-send-email-diego@biurrun.de
State New
Headers show

Commit Message

Diego Biurrun Sept. 12, 2014, 8:26 a.m.
---

The previous version still contained a rebasing mistake and used
function names that were changed in a previous patch.

 configure                         |  4 ++++
 libavcodec/Makefile               |  3 ++-
 libavcodec/arm/Makefile           |  4 ++--
 libavcodec/arm/dct-test.c         |  2 ++
 libavcodec/arm/idctdsp_init_arm.c | 16 +++++++++-------
 libavcodec/dct-test.c             |  4 +++-
 libavcodec/idctdsp.c              |  2 ++
 7 files changed, 24 insertions(+), 11 deletions(-)

Patch

diff --git a/configure b/configure
index 81e1d3f..3a75014 100755
--- a/configure
+++ b/configure
@@ -131,6 +131,7 @@  Component options:
   --disable-rdft           disable RDFT code
   --disable-fft            disable FFT code
   --disable-faan           disable floating point AAN (I)DCT code
+  --disable-intidct        disable fixed point IJG IDCT code
 
 Hardware accelerators:
   --enable-dxva2           enable DXVA2 code
@@ -1223,6 +1224,7 @@  SUBSYSTEM_LIST="
     error_resilience
     faan
     fft
+    intidct
     lsp
     lzo
     mdct
@@ -1731,6 +1733,7 @@  dct_select="rdft"
 error_resilience_select="me_cmp"
 faandct_deps="faan fdctdsp"
 faanidct_deps="faan idctdsp"
+intidct_deps="idctdsp"
 intrax8_select="error_resilience"
 mdct_select="fft"
 rdft_select="fft"
@@ -2228,6 +2231,7 @@  enable asm
 enable debug
 enable doc
 enable faan faandct faanidct
+enable intidct
 enable optimizations
 enable safe_bitstream_reader
 enable static
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 5e86f19..e1e2dfa 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -52,7 +52,8 @@  OBJS-$(CONFIG_HPELDSP)                 += hpeldsp.o
 OBJS-$(CONFIG_HUFFMAN)                 += huffman.o
 OBJS-$(CONFIG_HUFFYUVDSP)              += huffyuvdsp.o
 OBJS-$(CONFIG_HUFFYUVENCDSP)           += huffyuvencdsp.o
-OBJS-$(CONFIG_IDCTDSP)                 += idctdsp.o simple_idct.o jrevidct.o
+OBJS-$(CONFIG_IDCTDSP)                 += idctdsp.o simple_idct.o
+OBJS-$(CONFIG_INTIDCT)                 += jrevidct.o
 OBJS-$(CONFIG_IIRFILTER)               += iirfilter.o
 OBJS-$(CONFIG_INTRAX8)                 += intrax8.o intrax8dsp.o
 OBJS-$(CONFIG_LIBXVID)                 += libxvid_rc.o
diff --git a/libavcodec/arm/Makefile b/libavcodec/arm/Makefile
index d8ca0d3..0918cd5 100644
--- a/libavcodec/arm/Makefile
+++ b/libavcodec/arm/Makefile
@@ -17,10 +17,10 @@  OBJS-$(CONFIG_HPELDSP)                 += arm/hpeldsp_init_arm.o        \
                                           arm/hpeldsp_arm.o
 OBJS-$(CONFIG_IDCTDSP)                 += arm/idctdsp_init_arm.o        \
                                           arm/idctdsp_arm.o             \
-                                          arm/jrevidct.o                \
-                                          arm/jrevidct_arm.o            \
                                           arm/simple_idct.o             \
                                           arm/simple_idct_arm.o
+OBJS-$(CONFIG_INTIDCT)                 += arm/jrevidct.o                \
+                                          arm/jrevidct_arm.o
 OBJS-$(CONFIG_ME_CMP)                  += arm/me_cmp_init_arm.o
 OBJS-$(CONFIG_MPEGAUDIODSP)            += arm/mpegaudiodsp_init_arm.o
 OBJS-$(CONFIG_MPEGVIDEO)               += arm/mpegvideo_arm.o
diff --git a/libavcodec/arm/dct-test.c b/libavcodec/arm/dct-test.c
index c33c1f9..aa0a958 100644
--- a/libavcodec/arm/dct-test.c
+++ b/libavcodec/arm/dct-test.c
@@ -26,7 +26,9 @@  static const struct algo fdct_tab_arch[] = {
 
 static const struct algo idct_tab_arch[] = {
     { "SIMPLE-ARM",     ff_simple_idct_arm,     FF_IDCT_PERM_NONE },
+#if CONFIG_INTIDCT
     { "INT-ARM",        ff_j_rev_idct_arm,      FF_IDCT_PERM_LIBMPEG2 },
+#endif /* CONFIG_INTIDCT */
 #if HAVE_ARMV5TE
     { "SIMPLE-ARMV5TE", ff_simple_idct_armv5te, FF_IDCT_PERM_NONE,      AV_CPU_FLAG_ARMV5TE },
 #endif
diff --git a/libavcodec/arm/idctdsp_init_arm.c b/libavcodec/arm/idctdsp_init_arm.c
index 35fbd3c..c8db068 100644
--- a/libavcodec/arm/idctdsp_init_arm.c
+++ b/libavcodec/arm/idctdsp_init_arm.c
@@ -38,17 +38,19 @@  av_cold void ff_idctdsp_init_arm(IDCTDSPContext *c, AVCodecContext *avctx,
     int cpu_flags = av_get_cpu_flags();
 
     if (!high_bit_depth) {
-        if (avctx->idct_algo == FF_IDCT_AUTO ||
-            avctx->idct_algo == FF_IDCT_ARM) {
-            c->idct_put  = ff_j_rev_idct_put_arm;
-            c->idct_add  = ff_j_rev_idct_add_arm;
-            c->idct      = ff_j_rev_idct_arm;
-            c->perm_type = FF_IDCT_PERM_LIBMPEG2;
-        } else if (avctx->idct_algo == FF_IDCT_SIMPLEARM) {
+        if (avctx->idct_algo == FF_IDCT_SIMPLEARM) {
             c->idct_put  = ff_simple_idct_put_arm;
             c->idct_add  = ff_simple_idct_add_arm;
             c->idct      = ff_simple_idct_arm;
             c->perm_type = FF_IDCT_PERM_NONE;
+#if CONFIG_INTIDCT
+        } else if (avctx->idct_algo == FF_IDCT_AUTO ||
+                   avctx->idct_algo == FF_IDCT_ARM) {
+            c->idct_put  = ff_j_rev_idct_put_arm;
+            c->idct_add  = ff_j_rev_idct_add_arm;
+            c->idct      = ff_j_rev_idct_arm;
+            c->perm_type = FF_IDCT_PERM_LIBMPEG2;
+#endif /* CONFIG_INTIDCT */
         }
     }
 
diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index 6f7c6f3..b91558a 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.c
@@ -67,8 +67,10 @@  static const struct algo fdct_tab[] = {
 
 static const struct algo idct_tab[] = {
     { "REF-DBL",     ff_ref_idct,          FF_IDCT_PERM_NONE },
-    { "INT",         ff_j_rev_idct,        FF_IDCT_PERM_LIBMPEG2 },
     { "SIMPLE-C",    ff_simple_idct_8,     FF_IDCT_PERM_NONE },
+#if CONFIG_INTIDCT
+    { "INT",         ff_j_rev_idct,        FF_IDCT_PERM_LIBMPEG2 },
+#endif /* CONFIG_INTIDCT */
 #if CONFIG_FAANIDCT
     { "FAANI",       ff_faanidct,          FF_IDCT_PERM_NONE },
 #endif /* CONFIG_FAANIDCT */
diff --git a/libavcodec/idctdsp.c b/libavcodec/idctdsp.c
index a798a6c..6026424 100644
--- a/libavcodec/idctdsp.c
+++ b/libavcodec/idctdsp.c
@@ -153,11 +153,13 @@  av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
         c->idct_add  = ff_simple_idct_add_10;
         c->idct      = ff_simple_idct_10;
         c->perm_type = FF_IDCT_PERM_NONE;
+#if CONFIG_INTIDCT
     } else if (avctx->idct_algo == FF_IDCT_INT) {
         c->idct_put  = ff_j_rev_idct_put;
         c->idct_add  = ff_j_rev_idct_add;
         c->idct      = ff_j_rev_idct;
         c->perm_type = FF_IDCT_PERM_LIBMPEG2;
+#endif /* CONFIG_INTIDCT */
 #if CONFIG_FAANIDCT
     } else if (avctx->idct_algo == FF_IDCT_FAAN) {
         c->idct_put  = ff_faanidct_put;