blockdsp: drop the high_bit_depth parameter
authorAnton Khirnov <anton@khirnov.net>
Mon, 8 Aug 2016 19:47:20 +0000 (21:47 +0200)
committerAnton Khirnov <anton@khirnov.net>
Thu, 22 Sep 2016 07:47:52 +0000 (09:47 +0200)
It has no effect, since the code is supposed to operate the same way for
any bit depth.

libavcodec/arm/blockdsp_arm.h
libavcodec/arm/blockdsp_init_arm.c
libavcodec/arm/blockdsp_init_neon.c
libavcodec/blockdsp.c
libavcodec/blockdsp.h
libavcodec/ppc/blockdsp.c
libavcodec/x86/blockdsp.c

index 6d9c2c3..d26630e 100644 (file)
@@ -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 */
index a0c0367..a5db201 100644 (file)
 #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);
 }
index 5081cf0..e285750 100644 (file)
 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;
 }
index e3d2ca1..a35df8c 100644 (file)
@@ -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 */
 }
index 32c671c..5b5639f 100644 (file)
@@ -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 */
index 679bc04..d2c1d0e 100644 (file)
@@ -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 */
 }
index f14bb1f..9bb5185 100644 (file)
@@ -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 */
 }