[FFmpeg-cvslog] blockdsp: drop the high_bit_depth parameter

Anton Khirnov git at videolan.org
Mon Mar 20 20:01:49 EET 2017


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Aug  8 21:47:20 2016 +0200| [eea9857bfd6925d0c34382c00b971ee6df12ad44] | committer: Anton Khirnov

blockdsp: drop the high_bit_depth parameter

It has no effect, since the code is supposed to operate the same way for
any bit depth.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=eea9857bfd6925d0c34382c00b971ee6df12ad44
---

 libavcodec/arm/blockdsp_arm.h       |  2 +-
 libavcodec/arm/blockdsp_init_arm.c  |  4 ++--
 libavcodec/arm/blockdsp_init_neon.c |  8 +++-----
 libavcodec/blockdsp.c               | 10 ++++------
 libavcodec/blockdsp.h               |  8 ++++----
 libavcodec/ppc/blockdsp.c           | 25 +++++++++++--------------
 libavcodec/x86/blockdsp.c           | 20 +++++++++-----------
 7 files changed, 34 insertions(+), 43 deletions(-)

diff --git a/libavcodec/arm/blockdsp_arm.h b/libavcodec/arm/blockdsp_arm.h
index 6d9c2c3..d26630e 100644
--- a/libavcodec/arm/blockdsp_arm.h
+++ b/libavcodec/arm/blockdsp_arm.h
@@ -21,6 +21,6 @@
 
 #include "libavcodec/blockdsp.h"
 
-void ff_blockdsp_init_neon(BlockDSPContext *c, unsigned high_bit_depth);
+void ff_blockdsp_init_neon(BlockDSPContext *c);
 
 #endif /* AVCODEC_ARM_BLOCKDSP_ARM_H */
diff --git a/libavcodec/arm/blockdsp_init_arm.c b/libavcodec/arm/blockdsp_init_arm.c
index a0c0367..a5db201 100644
--- a/libavcodec/arm/blockdsp_init_arm.c
+++ b/libavcodec/arm/blockdsp_init_arm.c
@@ -24,10 +24,10 @@
 #include "libavcodec/blockdsp.h"
 #include "blockdsp_arm.h"
 
-av_cold void ff_blockdsp_init_arm(BlockDSPContext *c, unsigned high_bit_depth)
+av_cold void ff_blockdsp_init_arm(BlockDSPContext *c)
 {
     int cpu_flags = av_get_cpu_flags();
 
     if (have_neon(cpu_flags))
-        ff_blockdsp_init_neon(c, high_bit_depth);
+        ff_blockdsp_init_neon(c);
 }
diff --git a/libavcodec/arm/blockdsp_init_neon.c b/libavcodec/arm/blockdsp_init_neon.c
index 5081cf0..e285750 100644
--- a/libavcodec/arm/blockdsp_init_neon.c
+++ b/libavcodec/arm/blockdsp_init_neon.c
@@ -28,10 +28,8 @@
 void ff_clear_block_neon(int16_t *block);
 void ff_clear_blocks_neon(int16_t *blocks);
 
-av_cold void ff_blockdsp_init_neon(BlockDSPContext *c, unsigned high_bit_depth)
+av_cold void ff_blockdsp_init_neon(BlockDSPContext *c)
 {
-    if (!high_bit_depth) {
-        c->clear_block  = ff_clear_block_neon;
-        c->clear_blocks = ff_clear_blocks_neon;
-    }
+    c->clear_block  = ff_clear_block_neon;
+    c->clear_blocks = ff_clear_blocks_neon;
 }
diff --git a/libavcodec/blockdsp.c b/libavcodec/blockdsp.c
index e3d2ca1..a35df8c 100644
--- a/libavcodec/blockdsp.c
+++ b/libavcodec/blockdsp.c
@@ -57,8 +57,6 @@ static void fill_block8_c(uint8_t *block, uint8_t value, int line_size, int h)
 
 av_cold void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx)
 {
-    const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8;
-
     c->clear_block  = clear_block_8_c;
     c->clear_blocks = clear_blocks_8_c;
 
@@ -66,13 +64,13 @@ av_cold void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx)
     c->fill_block_tab[1] = fill_block8_c;
 
     if (ARCH_ARM)
-        ff_blockdsp_init_arm(c, high_bit_depth);
+        ff_blockdsp_init_arm(c);
     if (ARCH_PPC)
-        ff_blockdsp_init_ppc(c, high_bit_depth);
+        ff_blockdsp_init_ppc(c);
     if (ARCH_X86)
 #if FF_API_XVMC
-        ff_blockdsp_init_x86(c, high_bit_depth, avctx);
+        ff_blockdsp_init_x86(c, avctx);
 #else
-        ff_blockdsp_init_x86(c, high_bit_depth);
+        ff_blockdsp_init_x86(c);
 #endif /* FF_API_XVMC */
 }
diff --git a/libavcodec/blockdsp.h b/libavcodec/blockdsp.h
index 32c671c..5b5639f 100644
--- a/libavcodec/blockdsp.h
+++ b/libavcodec/blockdsp.h
@@ -40,13 +40,13 @@ typedef struct BlockDSPContext {
 
 void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx);
 
-void ff_blockdsp_init_arm(BlockDSPContext *c, unsigned high_bit_depth);
-void ff_blockdsp_init_ppc(BlockDSPContext *c, unsigned high_bit_depth);
+void ff_blockdsp_init_arm(BlockDSPContext *c);
+void ff_blockdsp_init_ppc(BlockDSPContext *c);
 #if FF_API_XVMC
-void ff_blockdsp_init_x86(BlockDSPContext *c, unsigned high_bit_depth,
+void ff_blockdsp_init_x86(BlockDSPContext *c,
                           AVCodecContext *avctx);
 #else
-void ff_blockdsp_init_x86(BlockDSPContext *c, unsigned high_bit_depth);
+void ff_blockdsp_init_x86(BlockDSPContext *c);
 #endif /* FF_API_XVMC */
 
 #endif /* AVCODEC_BLOCKDSP_H */
diff --git a/libavcodec/ppc/blockdsp.c b/libavcodec/ppc/blockdsp.c
index 679bc04..d2c1d0e 100644
--- a/libavcodec/ppc/blockdsp.c
+++ b/libavcodec/ppc/blockdsp.c
@@ -143,27 +143,24 @@ static void clear_block_altivec(int16_t *block)
 }
 #endif /* HAVE_ALTIVEC */
 
-av_cold void ff_blockdsp_init_ppc(BlockDSPContext *c, unsigned high_bit_depth)
+av_cold void ff_blockdsp_init_ppc(BlockDSPContext *c)
 {
     // common optimizations whether AltiVec is available or not
-    if (!high_bit_depth) {
-        switch (check_dcbzl_effect()) {
-        case 32:
-            c->clear_blocks = clear_blocks_dcbz32_ppc;
-            break;
-        case 128:
-            c->clear_blocks = clear_blocks_dcbz128_ppc;
-            break;
-        default:
-            break;
-        }
+    switch (check_dcbzl_effect()) {
+    case 32:
+        c->clear_blocks = clear_blocks_dcbz32_ppc;
+        break;
+    case 128:
+        c->clear_blocks = clear_blocks_dcbz128_ppc;
+        break;
+    default:
+        break;
     }
 
 #if HAVE_ALTIVEC
     if (!PPC_ALTIVEC(av_get_cpu_flags()))
         return;
 
-    if (!high_bit_depth)
-        c->clear_block = clear_block_altivec;
+    c->clear_block = clear_block_altivec;
 #endif /* HAVE_ALTIVEC */
 }
diff --git a/libavcodec/x86/blockdsp.c b/libavcodec/x86/blockdsp.c
index f14bb1f..9bb5185 100644
--- a/libavcodec/x86/blockdsp.c
+++ b/libavcodec/x86/blockdsp.c
@@ -88,20 +88,19 @@ static void clear_blocks_sse(int16_t *blocks)
 #endif /* HAVE_INLINE_ASM */
 
 #if FF_API_XVMC
-av_cold void ff_blockdsp_init_x86(BlockDSPContext *c, unsigned high_bit_depth,
+av_cold void ff_blockdsp_init_x86(BlockDSPContext *c,
                                   AVCodecContext *avctx)
 #else
-av_cold void ff_blockdsp_init_x86(BlockDSPContext *c, unsigned high_bit_depth)
+av_cold void ff_blockdsp_init_x86(BlockDSPContext *c)
 #endif /* FF_API_XVMC */
 {
 #if HAVE_INLINE_ASM
     int cpu_flags = av_get_cpu_flags();
 
-    if (!high_bit_depth) {
-        if (INLINE_MMX(cpu_flags)) {
-            c->clear_block  = clear_block_mmx;
-            c->clear_blocks = clear_blocks_mmx;
-        }
+    if (INLINE_MMX(cpu_flags)) {
+        c->clear_block  = clear_block_mmx;
+        c->clear_blocks = clear_blocks_mmx;
+    }
 
 #if FF_API_XVMC
 FF_DISABLE_DEPRECATION_WARNINGS
@@ -111,10 +110,9 @@ FF_DISABLE_DEPRECATION_WARNINGS
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif /* FF_API_XVMC */
 
-        if (INLINE_SSE(cpu_flags)) {
-            c->clear_block  = clear_block_sse;
-            c->clear_blocks = clear_blocks_sse;
-        }
+    if (INLINE_SSE(cpu_flags)) {
+        c->clear_block  = clear_block_sse;
+        c->clear_blocks = clear_blocks_sse;
     }
 #endif /* HAVE_INLINE_ASM */
 }



More information about the ffmpeg-cvslog mailing list