Commit 562ba4a8 authored by Christophe Gisquet's avatar Christophe Gisquet Committed by Michael Niedermayer

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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent acdd6725
...@@ -43,9 +43,7 @@ static void clear_blocks_axp(int16_t *blocks) { ...@@ -43,9 +43,7 @@ static void clear_blocks_axp(int16_t *blocks) {
} while (n); } 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; c->clear_blocks = clear_blocks_axp;
}
} }
...@@ -21,6 +21,6 @@ ...@@ -21,6 +21,6 @@
#include "libavcodec/blockdsp.h" #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 */ #endif /* AVCODEC_ARM_BLOCKDSP_ARM_H */
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
#include "libavcodec/blockdsp.h" #include "libavcodec/blockdsp.h"
#include "blockdsp_arm.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(); int cpu_flags = av_get_cpu_flags();
if (have_neon(cpu_flags)) if (have_neon(cpu_flags))
ff_blockdsp_init_neon(c, high_bit_depth); ff_blockdsp_init_neon(c);
} }
...@@ -28,10 +28,8 @@ ...@@ -28,10 +28,8 @@
void ff_clear_block_neon(int16_t *block); void ff_clear_block_neon(int16_t *block);
void ff_clear_blocks_neon(int16_t *blocks); 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_block = ff_clear_block_neon;
c->clear_blocks = ff_clear_blocks_neon; c->clear_blocks = ff_clear_blocks_neon;
}
} }
...@@ -25,12 +25,12 @@ ...@@ -25,12 +25,12 @@
#include "blockdsp.h" #include "blockdsp.h"
#include "version.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); 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); 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) ...@@ -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) 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_c;
c->clear_blocks = clear_blocks_c;
c->clear_block = clear_block_8_c;
c->clear_blocks = clear_blocks_8_c;
c->fill_block_tab[0] = fill_block16_c; c->fill_block_tab[0] = fill_block16_c;
c->fill_block_tab[1] = fill_block8_c; c->fill_block_tab[1] = fill_block8_c;
if (ARCH_ALPHA) if (ARCH_ALPHA)
ff_blockdsp_init_alpha(c, high_bit_depth); ff_blockdsp_init_alpha(c);
if (ARCH_ARM) if (ARCH_ARM)
ff_blockdsp_init_arm(c, high_bit_depth); ff_blockdsp_init_arm(c);
if (ARCH_PPC) if (ARCH_PPC)
ff_blockdsp_init_ppc(c, high_bit_depth); ff_blockdsp_init_ppc(c);
if (ARCH_X86) if (ARCH_X86)
ff_blockdsp_init_x86(c, high_bit_depth, avctx); ff_blockdsp_init_x86(c, avctx);
if (ARCH_MIPS) if (ARCH_MIPS)
ff_blockdsp_init_mips(c, high_bit_depth); ff_blockdsp_init_mips(c);
} }
...@@ -40,11 +40,11 @@ typedef struct BlockDSPContext { ...@@ -40,11 +40,11 @@ typedef struct BlockDSPContext {
void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx); void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx);
void ff_blockdsp_init_alpha(BlockDSPContext *c, unsigned high_bit_depth); void ff_blockdsp_init_alpha(BlockDSPContext *c);
void ff_blockdsp_init_arm(BlockDSPContext *c, unsigned high_bit_depth); void ff_blockdsp_init_arm(BlockDSPContext *c);
void ff_blockdsp_init_ppc(BlockDSPContext *c, unsigned high_bit_depth); void ff_blockdsp_init_ppc(BlockDSPContext *c);
void ff_blockdsp_init_x86(BlockDSPContext *c, unsigned high_bit_depth, void ff_blockdsp_init_x86(BlockDSPContext *c,
AVCodecContext *avctx); AVCodecContext *avctx);
void ff_blockdsp_init_mips(BlockDSPContext *c, unsigned high_bit_depth); void ff_blockdsp_init_mips(BlockDSPContext *c);
#endif /* AVCODEC_BLOCKDSP_H */ #endif /* AVCODEC_BLOCKDSP_H */
...@@ -22,8 +22,7 @@ ...@@ -22,8 +22,7 @@
#include "blockdsp_mips.h" #include "blockdsp_mips.h"
#if HAVE_MSA #if HAVE_MSA
static av_cold void blockdsp_init_msa(BlockDSPContext *c, static av_cold void blockdsp_init_msa(BlockDSPContext *c)
unsigned high_bit_depth)
{ {
c->clear_block = ff_clear_block_msa; c->clear_block = ff_clear_block_msa;
c->clear_blocks = ff_clear_blocks_msa; c->clear_blocks = ff_clear_blocks_msa;
...@@ -34,8 +33,7 @@ static av_cold void blockdsp_init_msa(BlockDSPContext *c, ...@@ -34,8 +33,7 @@ static av_cold void blockdsp_init_msa(BlockDSPContext *c,
#endif // #if HAVE_MSA #endif // #if HAVE_MSA
#if HAVE_MMI #if HAVE_MMI
static av_cold void blockdsp_init_mmi(BlockDSPContext *c, static av_cold void blockdsp_init_mmi(BlockDSPContext *c)
unsigned high_bit_depth)
{ {
c->clear_block = ff_clear_block_mmi; c->clear_block = ff_clear_block_mmi;
c->clear_blocks = ff_clear_blocks_mmi; c->clear_blocks = ff_clear_blocks_mmi;
...@@ -45,12 +43,12 @@ static av_cold void blockdsp_init_mmi(BlockDSPContext *c, ...@@ -45,12 +43,12 @@ static av_cold void blockdsp_init_mmi(BlockDSPContext *c,
} }
#endif /* HAVE_MMI */ #endif /* HAVE_MMI */
void ff_blockdsp_init_mips(BlockDSPContext *c, unsigned high_bit_depth) void ff_blockdsp_init_mips(BlockDSPContext *c)
{ {
#if HAVE_MSA #if HAVE_MSA
blockdsp_init_msa(c, high_bit_depth); blockdsp_init_msa(c);
#endif // #if HAVE_MSA #endif // #if HAVE_MSA
#if HAVE_MMI #if HAVE_MMI
blockdsp_init_mmi(c, high_bit_depth); blockdsp_init_mmi(c);
#endif /* HAVE_MMI */ #endif /* HAVE_MMI */
} }
...@@ -143,10 +143,9 @@ static void clear_block_altivec(int16_t *block) ...@@ -143,10 +143,9 @@ static void clear_block_altivec(int16_t *block)
} }
#endif /* HAVE_ALTIVEC */ #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 // common optimizations whether AltiVec is available or not
if (!high_bit_depth) {
switch (check_dcbzl_effect()) { switch (check_dcbzl_effect()) {
case 32: case 32:
c->clear_blocks = clear_blocks_dcbz32_ppc; c->clear_blocks = clear_blocks_dcbz32_ppc;
...@@ -157,13 +156,11 @@ av_cold void ff_blockdsp_init_ppc(BlockDSPContext *c, unsigned high_bit_depth) ...@@ -157,13 +156,11 @@ av_cold void ff_blockdsp_init_ppc(BlockDSPContext *c, unsigned high_bit_depth)
default: default:
break; break;
} }
}
#if HAVE_ALTIVEC #if HAVE_ALTIVEC
if (!PPC_ALTIVEC(av_get_cpu_flags())) if (!PPC_ALTIVEC(av_get_cpu_flags()))
return; return;
if (!high_bit_depth)
c->clear_block = clear_block_altivec; c->clear_block = clear_block_altivec;
#endif /* HAVE_ALTIVEC */ #endif /* HAVE_ALTIVEC */
} }
...@@ -31,13 +31,12 @@ void ff_clear_block_sse(int16_t *block); ...@@ -31,13 +31,12 @@ void ff_clear_block_sse(int16_t *block);
void ff_clear_blocks_mmx(int16_t *blocks); void ff_clear_blocks_mmx(int16_t *blocks);
void ff_clear_blocks_sse(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) AVCodecContext *avctx)
{ {
#if HAVE_YASM #if HAVE_YASM
int cpu_flags = av_get_cpu_flags(); int cpu_flags = av_get_cpu_flags();
if (!high_bit_depth) {
if (EXTERNAL_MMX(cpu_flags)) { if (EXTERNAL_MMX(cpu_flags)) {
c->clear_block = ff_clear_block_mmx; c->clear_block = ff_clear_block_mmx;
c->clear_blocks = ff_clear_blocks_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, ...@@ -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_block = ff_clear_block_sse;
c->clear_blocks = ff_clear_blocks_sse; c->clear_blocks = ff_clear_blocks_sse;
} }
}
#endif /* HAVE_YASM */ #endif /* HAVE_YASM */
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment