[3/5] arm: idctdsp: Split off IJG and simple IDCT idct_{add|put} functions

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

Commit Message

Diego Biurrun Sept. 9, 2014, 1:25 p.m.
They don't belong in the general ARM IDCT init code and are kept
separate in the C init code as well.
---
 libavcodec/arm/Makefile                  |  2 ++
 libavcodec/arm/idct.h                    |  4 ++++
 libavcodec/arm/idctdsp_init_arm.c        | 34 ++++----------------------------
 libavcodec/arm/{idct.h => jrevidct.c}    | 29 +++++++++++----------------
 libavcodec/arm/{idct.h => simple_idct.c} | 29 +++++++++++----------------
 5 files changed, 34 insertions(+), 64 deletions(-)
 copy libavcodec/arm/{idct.h => jrevidct.c} (51%)
 copy libavcodec/arm/{idct.h => simple_idct.c} (51%)

Comments

Luca Barbato Sept. 11, 2014, 9:04 p.m. | #1
On 09/09/14 15:25, Diego Biurrun wrote:
> They don't belong in the general ARM IDCT init code and are kept
> separate in the C init code as well.
> ---
>  libavcodec/arm/Makefile                  |  2 ++
>  libavcodec/arm/idct.h                    |  4 ++++
>  libavcodec/arm/idctdsp_init_arm.c        | 34 ++++----------------------------
>  libavcodec/arm/{idct.h => jrevidct.c}    | 29 +++++++++++----------------
>  libavcodec/arm/{idct.h => simple_idct.c} | 29 +++++++++++----------------
>  5 files changed, 34 insertions(+), 64 deletions(-)
>  copy libavcodec/arm/{idct.h => jrevidct.c} (51%)
>  copy libavcodec/arm/{idct.h => simple_idct.c} (51%)
> 

Probably ok.

Patch

diff --git a/libavcodec/arm/Makefile b/libavcodec/arm/Makefile
index 3b0c982..d8ca0d3 100644
--- a/libavcodec/arm/Makefile
+++ b/libavcodec/arm/Makefile
@@ -17,7 +17,9 @@  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_ME_CMP)                  += arm/me_cmp_init_arm.o
 OBJS-$(CONFIG_MPEGAUDIODSP)            += arm/mpegaudiodsp_init_arm.o
diff --git a/libavcodec/arm/idct.h b/libavcodec/arm/idct.h
index dbb4a23..2868f3c 100644
--- a/libavcodec/arm/idct.h
+++ b/libavcodec/arm/idct.h
@@ -22,8 +22,12 @@ 
 #include <stdint.h>
 
 void ff_j_rev_idct_arm(int16_t *data);
+void ff_j_rev_idct_put_arm(uint8_t *dest, int line_size, int16_t *block);
+void ff_j_rev_idct_add_arm(uint8_t *dest, int line_size, int16_t *block);
 
 void ff_simple_idct_arm(int16_t *data);
+void ff_simple_idct_put_arm(uint8_t *dest, int line_size, int16_t *block);
+void ff_simple_idct_add_arm(uint8_t *dest, int line_size, int16_t *block);
 
 void ff_simple_idct_armv5te(int16_t *data);
 void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, int16_t *data);
diff --git a/libavcodec/arm/idctdsp_init_arm.c b/libavcodec/arm/idctdsp_init_arm.c
index 5d492e4..35fbd3c 100644
--- a/libavcodec/arm/idctdsp_init_arm.c
+++ b/libavcodec/arm/idctdsp_init_arm.c
@@ -32,32 +32,6 @@ 
 void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest,
                                int line_size);
 
-/* XXX: those functions should be suppressed ASAP when all IDCTs are
- * converted */
-static void j_rev_idct_arm_put(uint8_t *dest, int line_size, int16_t *block)
-{
-    ff_j_rev_idct_arm(block);
-    ff_put_pixels_clamped(block, dest, line_size);
-}
-
-static void j_rev_idct_arm_add(uint8_t *dest, int line_size, int16_t *block)
-{
-    ff_j_rev_idct_arm(block);
-    ff_add_pixels_clamped(block, dest, line_size);
-}
-
-static void simple_idct_arm_put(uint8_t *dest, int line_size, int16_t *block)
-{
-    ff_simple_idct_arm(block);
-    ff_put_pixels_clamped(block, dest, line_size);
-}
-
-static void simple_idct_arm_add(uint8_t *dest, int line_size, int16_t *block)
-{
-    ff_simple_idct_arm(block);
-    ff_add_pixels_clamped(block, dest, line_size);
-}
-
 av_cold void ff_idctdsp_init_arm(IDCTDSPContext *c, AVCodecContext *avctx,
                                  unsigned high_bit_depth)
 {
@@ -66,13 +40,13 @@  av_cold void ff_idctdsp_init_arm(IDCTDSPContext *c, AVCodecContext *avctx,
     if (!high_bit_depth) {
         if (avctx->idct_algo == FF_IDCT_AUTO ||
             avctx->idct_algo == FF_IDCT_ARM) {
-            c->idct_put  = j_rev_idct_arm_put;
-            c->idct_add  = j_rev_idct_arm_add;
+            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) {
-            c->idct_put  = simple_idct_arm_put;
-            c->idct_add  = simple_idct_arm_add;
+            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;
         }
diff --git a/libavcodec/arm/idct.h b/libavcodec/arm/jrevidct.c
similarity index 51%
copy from libavcodec/arm/idct.h
copy to libavcodec/arm/jrevidct.c
index dbb4a23..532cc4b 100644
--- a/libavcodec/arm/idct.h
+++ b/libavcodec/arm/jrevidct.c
@@ -16,25 +16,20 @@ 
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifndef AVCODEC_ARM_IDCT_H
-#define AVCODEC_ARM_IDCT_H
-
 #include <stdint.h>
 
-void ff_j_rev_idct_arm(int16_t *data);
-
-void ff_simple_idct_arm(int16_t *data);
-
-void ff_simple_idct_armv5te(int16_t *data);
-void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, int16_t *data);
-void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, int16_t *data);
+#include "libavcodec/idctdsp.h"
 
-void ff_simple_idct_armv6(int16_t *data);
-void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data);
-void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data);
+#include "idct.h"
 
-void ff_simple_idct_neon(int16_t *data);
-void ff_simple_idct_put_neon(uint8_t *dest, int line_size, int16_t *data);
-void ff_simple_idct_add_neon(uint8_t *dest, int line_size, int16_t *data);
+void ff_j_rev_idct_put_arm(uint8_t *dest, int line_size, int16_t *block)
+{
+    ff_j_rev_idct_arm(block);
+    ff_put_pixels_clamped(block, dest, line_size);
+}
 
-#endif /* AVCODEC_ARM_IDCT_H */
+void ff_j_rev_idct_add_arm(uint8_t *dest, int line_size, int16_t *block)
+{
+    ff_j_rev_idct_arm(block);
+    ff_add_pixels_clamped(block, dest, line_size);
+}
diff --git a/libavcodec/arm/idct.h b/libavcodec/arm/simple_idct.c
similarity index 51%
copy from libavcodec/arm/idct.h
copy to libavcodec/arm/simple_idct.c
index dbb4a23..aa611eb 100644
--- a/libavcodec/arm/idct.h
+++ b/libavcodec/arm/simple_idct.c
@@ -16,25 +16,20 @@ 
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifndef AVCODEC_ARM_IDCT_H
-#define AVCODEC_ARM_IDCT_H
-
 #include <stdint.h>
 
-void ff_j_rev_idct_arm(int16_t *data);
-
-void ff_simple_idct_arm(int16_t *data);
-
-void ff_simple_idct_armv5te(int16_t *data);
-void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, int16_t *data);
-void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, int16_t *data);
+#include "libavcodec/idctdsp.h"
 
-void ff_simple_idct_armv6(int16_t *data);
-void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data);
-void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data);
+#include "idct.h"
 
-void ff_simple_idct_neon(int16_t *data);
-void ff_simple_idct_put_neon(uint8_t *dest, int line_size, int16_t *data);
-void ff_simple_idct_add_neon(uint8_t *dest, int line_size, int16_t *data);
+void ff_simple_idct_put_arm(uint8_t *dest, int line_size, int16_t *block)
+{
+    ff_simple_idct_arm(block);
+    ff_put_pixels_clamped(block, dest, line_size);
+}
 
-#endif /* AVCODEC_ARM_IDCT_H */
+void ff_simple_idct_add_arm(uint8_t *dest, int line_size, int16_t *block)
+{
+    ff_simple_idct_arm(block);
+    ff_add_pixels_clamped(block, dest, line_size);
+}