aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Gisquet <christophe.gisquet@gmail.com>2015-09-28 13:59:23 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-10-02 04:38:40 +0200
commit562ba4a827ceb9ed5b7d056484a9c2312a5458c5 (patch)
tree756de8e3459acfdf786f1f5343b5346757c8c491
parentacdd6725065b4b71723a2c40c0fca9d69b8780cf (diff)
downloadffmpeg-562ba4a827ceb9ed5b7d056484a9c2312a5458c5.tar.gz
blockdsp: remove high bitdepth parameter
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>
-rw-r--r--libavcodec/alpha/blockdsp_alpha.c4
-rw-r--r--libavcodec/arm/blockdsp_arm.h2
-rw-r--r--libavcodec/arm/blockdsp_init_arm.c4
-rw-r--r--libavcodec/arm/blockdsp_init_neon.c4
-rw-r--r--libavcodec/blockdsp.c20
-rw-r--r--libavcodec/blockdsp.h10
-rw-r--r--libavcodec/mips/blockdsp_init_mips.c12
-rw-r--r--libavcodec/ppc/blockdsp.c5
-rw-r--r--libavcodec/x86/blockdsp_init.c4
9 files changed, 26 insertions, 39 deletions
diff --git a/libavcodec/alpha/blockdsp_alpha.c b/libavcodec/alpha/blockdsp_alpha.c
index ded439d842..d8b6f8a145 100644
--- a/libavcodec/alpha/blockdsp_alpha.c
+++ b/libavcodec/alpha/blockdsp_alpha.c
@@ -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;
- }
}
diff --git a/libavcodec/arm/blockdsp_arm.h b/libavcodec/arm/blockdsp_arm.h
index 2688d36254..59ebeb8466 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 3b86a71096..2080d5253f 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 62b51fc788..37819c6f0e 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;
- }
}
diff --git a/libavcodec/blockdsp.c b/libavcodec/blockdsp.c
index 42e177bae6..a5c527a4da 100644
--- a/libavcodec/blockdsp.c
+++ b/libavcodec/blockdsp.c
@@ -25,12 +25,12 @@
#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);
}
diff --git a/libavcodec/blockdsp.h b/libavcodec/blockdsp.h
index 654ecdc3d8..dddac72cf8 100644
--- a/libavcodec/blockdsp.h
+++ b/libavcodec/blockdsp.h
@@ -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 */
diff --git a/libavcodec/mips/blockdsp_init_mips.c b/libavcodec/mips/blockdsp_init_mips.c
index 2278613009..30ae95fa10 100644
--- a/libavcodec/mips/blockdsp_init_mips.c
+++ b/libavcodec/mips/blockdsp_init_mips.c
@@ -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 */
}
diff --git a/libavcodec/ppc/blockdsp.c b/libavcodec/ppc/blockdsp.c
index 0059b3b448..65d2feffec 100644
--- a/libavcodec/ppc/blockdsp.c
+++ b/libavcodec/ppc/blockdsp.c
@@ -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 */
}
diff --git a/libavcodec/x86/blockdsp_init.c b/libavcodec/x86/blockdsp_init.c
index 825e29f9d2..18322f39fd 100644
--- a/libavcodec/x86/blockdsp_init.c
+++ b/libavcodec/x86/blockdsp_init.c
@@ -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 */
}