blockdsp: remove high bitdepth parameter
authorChristophe Gisquet <christophe.gisquet@gmail.com>
Mon, 28 Sep 2015 11:59:23 +0000 (13:59 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 2 Oct 2015 02:38:40 +0000 (04:38 +0200)
It is only (mis-)used to set the dsp fucntions clear_block(s). But
these functions always work on 16bits-wide elements, which make
the parameter useless and actually harmful, as it causes all content
on more than 8-bits to not use accelerated functions.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/alpha/blockdsp_alpha.c
libavcodec/arm/blockdsp_arm.h
libavcodec/arm/blockdsp_init_arm.c
libavcodec/arm/blockdsp_init_neon.c
libavcodec/blockdsp.c
libavcodec/blockdsp.h
libavcodec/mips/blockdsp_init_mips.c
libavcodec/ppc/blockdsp.c
libavcodec/x86/blockdsp_init.c

index ded439d..d8b6f8a 100644 (file)
@@ -43,9 +43,7 @@ static void clear_blocks_axp(int16_t *blocks) {
     } while (n);
 }
 
-av_cold void ff_blockdsp_init_alpha(BlockDSPContext *c, unsigned high_bit_depth)
+av_cold void ff_blockdsp_init_alpha(BlockDSPContext *c)
 {
-    if (!high_bit_depth) {
         c->clear_blocks = clear_blocks_axp;
-    }
 }
index 2688d36..59ebeb8 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 3b86a71..2080d52 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 62b51fc..37819c6 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;
-    }
 }
index 42e177b..a5c527a 100644 (file)
 #include "blockdsp.h"
 #include "version.h"
 
-static void clear_block_8_c(int16_t *block)
+static void clear_block_c(int16_t *block)
 {
     memset(block, 0, sizeof(int16_t) * 64);
 }
 
-static void clear_blocks_8_c(int16_t *blocks)
+static void clear_blocks_c(int16_t *blocks)
 {
     memset(blocks, 0, sizeof(int16_t) * 6 * 64);
 }
@@ -57,22 +57,20 @@ 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;
+    c->clear_block  = clear_block_c;
+    c->clear_blocks = clear_blocks_c;
 
     c->fill_block_tab[0] = fill_block16_c;
     c->fill_block_tab[1] = fill_block8_c;
 
     if (ARCH_ALPHA)
-        ff_blockdsp_init_alpha(c, high_bit_depth);
+        ff_blockdsp_init_alpha(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)
-        ff_blockdsp_init_x86(c, high_bit_depth, avctx);
+        ff_blockdsp_init_x86(c, avctx);
     if (ARCH_MIPS)
-        ff_blockdsp_init_mips(c, high_bit_depth);
+        ff_blockdsp_init_mips(c);
 }
index 654ecdc..dddac72 100644 (file)
@@ -40,11 +40,11 @@ typedef struct BlockDSPContext {
 
 void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx);
 
-void ff_blockdsp_init_alpha(BlockDSPContext *c, unsigned high_bit_depth);
-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_x86(BlockDSPContext *c, unsigned high_bit_depth,
+void ff_blockdsp_init_alpha(BlockDSPContext *c);
+void ff_blockdsp_init_arm(BlockDSPContext *c);
+void ff_blockdsp_init_ppc(BlockDSPContext *c);
+void ff_blockdsp_init_x86(BlockDSPContext *c,
                           AVCodecContext *avctx);
-void ff_blockdsp_init_mips(BlockDSPContext *c, unsigned high_bit_depth);
+void ff_blockdsp_init_mips(BlockDSPContext *c);
 
 #endif /* AVCODEC_BLOCKDSP_H */
index 2278613..30ae95f 100644 (file)
@@ -22,8 +22,7 @@
 #include "blockdsp_mips.h"
 
 #if HAVE_MSA
-static av_cold void blockdsp_init_msa(BlockDSPContext *c,
-                                      unsigned high_bit_depth)
+static av_cold void blockdsp_init_msa(BlockDSPContext *c)
 {
     c->clear_block = ff_clear_block_msa;
     c->clear_blocks = ff_clear_blocks_msa;
@@ -34,8 +33,7 @@ static av_cold void blockdsp_init_msa(BlockDSPContext *c,
 #endif  // #if HAVE_MSA
 
 #if HAVE_MMI
-static av_cold void blockdsp_init_mmi(BlockDSPContext *c,
-        unsigned high_bit_depth)
+static av_cold void blockdsp_init_mmi(BlockDSPContext *c)
 {
     c->clear_block = ff_clear_block_mmi;
     c->clear_blocks = ff_clear_blocks_mmi;
@@ -45,12 +43,12 @@ static av_cold void blockdsp_init_mmi(BlockDSPContext *c,
 }
 #endif /* HAVE_MMI */
 
-void ff_blockdsp_init_mips(BlockDSPContext *c, unsigned high_bit_depth)
+void ff_blockdsp_init_mips(BlockDSPContext *c)
 {
 #if HAVE_MSA
-    blockdsp_init_msa(c, high_bit_depth);
+    blockdsp_init_msa(c);
 #endif  // #if HAVE_MSA
 #if HAVE_MMI
-    blockdsp_init_mmi(c, high_bit_depth);
+    blockdsp_init_mmi(c);
 #endif /* HAVE_MMI */
 }
index 0059b3b..65d2fef 100644 (file)
@@ -143,10 +143,9 @@ 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;
@@ -157,13 +156,11 @@ av_cold void ff_blockdsp_init_ppc(BlockDSPContext *c, unsigned high_bit_depth)
         default:
             break;
         }
-    }
 
 #if HAVE_ALTIVEC
     if (!PPC_ALTIVEC(av_get_cpu_flags()))
         return;
 
-    if (!high_bit_depth)
         c->clear_block = clear_block_altivec;
 #endif /* HAVE_ALTIVEC */
 }
index 825e29f..18322f3 100644 (file)
@@ -31,13 +31,12 @@ void ff_clear_block_sse(int16_t *block);
 void ff_clear_blocks_mmx(int16_t *blocks);
 void ff_clear_blocks_sse(int16_t *blocks);
 
-av_cold void ff_blockdsp_init_x86(BlockDSPContext *c, unsigned high_bit_depth,
+av_cold void ff_blockdsp_init_x86(BlockDSPContext *c,
                                   AVCodecContext *avctx)
 {
 #if HAVE_YASM
     int cpu_flags = av_get_cpu_flags();
 
-    if (!high_bit_depth) {
         if (EXTERNAL_MMX(cpu_flags)) {
             c->clear_block  = ff_clear_block_mmx;
             c->clear_blocks = ff_clear_blocks_mmx;
@@ -51,6 +50,5 @@ av_cold void ff_blockdsp_init_x86(BlockDSPContext *c, unsigned high_bit_depth,
             c->clear_block  = ff_clear_block_sse;
             c->clear_blocks = ff_clear_blocks_sse;
         }
-    }
 #endif /* HAVE_YASM */
 }