Re: [FFmpeg-devel] [PATCH] blockdsp: remove high bit depth parameter

2015-10-03 Thread Michael Niedermayer
On Fri, Oct 02, 2015 at 08:58:10AM +0200, Christophe Gisquet wrote:
> 2015-09-28 18:51 GMT+02:00 Christophe Gisquet :
> [SNIP]
> 
> Could someone also apply the cosmetic patch for reindentation?

applied

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No snowflake in an avalanche ever feels responsible. -- Voltaire


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] blockdsp: remove high bit depth parameter

2015-10-02 Thread Christophe Gisquet
2015-09-28 18:51 GMT+02:00 Christophe Gisquet :
[SNIP]

Could someone also apply the cosmetic patch for reindentation?

Thanks,
Christophe
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] blockdsp: remove high bit depth parameter

2015-10-01 Thread Christophe Gisquet
2015-09-28 18:51 GMT+02:00 Christophe Gisquet :
> I admit I haven't run this over all of fate, so it would be nice to
> validate nothing actually uses it for pixels (I have see nothing of
> the sort).

Passes fate-video fate-vcodec on Win64.

-- 
Christophe
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] blockdsp: remove high bit depth parameter

2015-10-01 Thread Christophe Gisquet
2015-10-01 14:40 GMT+02:00 Ronald S. Bultje :
> bash-3.2$ grep ff_pixblockdsp_init ../libavcodec/*
> ../libavcodec/asvenc.c:ff_pixblockdsp_init(>pdsp, avctx);
> ../libavcodec/avdct.c:ff_pixblockdsp_init(, avctx);
> ../libavcodec/dnxhdenc.c:ff_pixblockdsp_init(>m.pdsp, avctx);
> ../libavcodec/dvenc.c:ff_pixblockdsp_init(, avctx);
> ../libavcodec/mpegvideo_enc.c:ff_pixblockdsp_init(>pdsp, avctx);
>
> bash-3.2$ grep AV_PIX_FMT ../libavcodec/dvenc.c ../libavcodec/dnxhdenc.c
> ../libavcodec/mpegvideo_enc.c ../libavcodec/asvenc.c
> ../libavcodec/dnxhdenc.c:case AV_PIX_FMT_YUV422P10:
> ../libavcodec/dnxhdenc.c:AV_PIX_FMT_YUV422P10,
>
> bash-3.2$ grep clear_block ../libavcodec/dnxhdenc.c
> ctx->bdsp.clear_block(ctx->blocks[4]);
> ctx->bdsp.clear_block(ctx->blocks[5]);
> ctx->bdsp.clear_block(ctx->blocks[6]);
> ctx->bdsp.clear_block(ctx->blocks[7]);
>
> So this may break 10bit dnxhd encoding.

Well, that's part of the routine of what I've been testing since a
while, and it doesn't seem so. But that's not a very convincing
argument.

But I'm not sure what you are finding with your greps. That dnxhdenc
is actually using clear_block depending on the highbitdepth parameter?
In dnxhdenc, ctx->blocks are still 16bits dct coeffs blocks, as in all
of those codecs. There's 12 bit content and support incoming, but even
there, coeffs are 15bits (DC is).

Also, from the patch, you can notice that in the old code that:
- clear_block is by default set to clear_block_8_c (and clears 128
bytes of data); equivalent for clear_blocks
- some archs actually don't care about the parameter and always set
clear_block* (MIPS MSA/MMI)

Furthermore:
$ grep -rn 'clear_block *=' ../libavcodec/
../libavcodec/arm/blockdsp_init_neon.c:34:c->clear_block  =
ff_clear_block_neon;
../libavcodec/blockdsp.c:62:c->clear_block  = clear_block_8_c;
../libavcodec/mips/blockdsp_init_mips.c:28:c->clear_block =
ff_clear_block_msa;
../libavcodec/mips/blockdsp_init_mips.c:40:c->clear_block =
ff_clear_block_mmi;
../libavcodec/ppc/blockdsp.c:167:c->clear_block = clear_block_altivec;
../libavcodec/x86/blockdsp_init.c:42:c->clear_block  =
ff_clear_block_mmx;
../libavcodec/x86/blockdsp_init.c:51:c->clear_block  =
ff_clear_block_sse;

I've checked that all these implementations always apply to 64*2
bytes, and there's no clear_block implementation that sets another
amount. Clearly, if code expects clear_block to do that, there'd be
failures.

I don't know when that parameter has become unused, but it really is,
as otherwise there is the array fill_block_tab indexed by pixel
bytewidth for other dsp functions. I don't think anybody uses it for
>16 bits samples.

Erring away from just this, it is even more so incorrect that
clear_block* are located in a "pixelblock" context, while they are
only ever applied to dct blocks.

It belongs more to the idct context, which also use another
highbitdepth parameter solely based on raw bits per sample, which
should be the actual value used:
$ grep -rn bits_per_raw_sample ../libavcodec/ | grep -i idct
../libavcodec/idctdsp.c:243:const unsigned high_bit_depth =
avctx->bits_per_raw_sample > 8;
../libavcodec/idctdsp.c:261:if (avctx->bits_per_raw_sample ==
10 || avctx->bits_per_raw_sample == 9) {
../libavcodec/idctdsp.c:266:} else if
(avctx->bits_per_raw_sample == 12) {
../libavcodec/mips/idctdsp_init_mips.c:29:
(avctx->bits_per_raw_sample != 10) &&
../libavcodec/mips/idctdsp_init_mips.c:30:
(avctx->bits_per_raw_sample != 12) &&
../libavcodec/mips/idctdsp_init_mips.c:49:
(avctx->bits_per_raw_sample != 10) &&
../libavcodec/mips/idctdsp_init_mips.c:50:
(avctx->bits_per_raw_sample != 12) &&
../libavcodec/xvididct.c:335:const unsigned high_bit_depth =
avctx->bits_per_raw_sample > 8;

At the very worst, if something requires more than 16 bits dct coeffs,
then another bitdepth parameter is needed, but that's a different
issue

-- 
Christophe
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] blockdsp: remove high bit depth parameter

2015-10-01 Thread Ronald S. Bultje
Hi,

On Thu, Oct 1, 2015 at 8:28 AM, Christophe Gisquet <
christophe.gisq...@gmail.com> wrote:

> 2015-09-28 18:51 GMT+02:00 Christophe Gisquet <
> christophe.gisq...@gmail.com>:
> > I admit I haven't run this over all of fate, so it would be nice to
> > validate nothing actually uses it for pixels (I have see nothing of
> > the sort).
>
> Passes fate-video fate-vcodec on Win64.


Hm, let's see:

bash-3.2$ grep ff_pixblockdsp_init ../libavcodec/*
../libavcodec/asvenc.c:ff_pixblockdsp_init(>pdsp, avctx);
../libavcodec/avdct.c:ff_pixblockdsp_init(, avctx);
../libavcodec/dnxhdenc.c:ff_pixblockdsp_init(>m.pdsp, avctx);
../libavcodec/dvenc.c:ff_pixblockdsp_init(, avctx);
../libavcodec/mpegvideo_enc.c:ff_pixblockdsp_init(>pdsp, avctx);

bash-3.2$ grep AV_PIX_FMT ../libavcodec/dvenc.c ../libavcodec/dnxhdenc.c
../libavcodec/mpegvideo_enc.c ../libavcodec/asvenc.c
../libavcodec/dnxhdenc.c:case AV_PIX_FMT_YUV422P10:
../libavcodec/dnxhdenc.c:AV_PIX_FMT_YUV422P10,

bash-3.2$ grep clear_block ../libavcodec/dnxhdenc.c
ctx->bdsp.clear_block(ctx->blocks[4]);
ctx->bdsp.clear_block(ctx->blocks[5]);
ctx->bdsp.clear_block(ctx->blocks[6]);
ctx->bdsp.clear_block(ctx->blocks[7]);

So this may break 10bit dnxhd encoding.

Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] blockdsp: remove high bit depth parameter

2015-10-01 Thread Ronald S. Bultje
Hi,

On Thu, Oct 1, 2015 at 9:26 AM, Christophe Gisquet <
christophe.gisq...@gmail.com> wrote:

> 2015-10-01 14:40 GMT+02:00 Ronald S. Bultje :
> > bash-3.2$ grep ff_pixblockdsp_init ../libavcodec/*
> > ../libavcodec/asvenc.c:ff_pixblockdsp_init(>pdsp, avctx);
> > ../libavcodec/avdct.c:ff_pixblockdsp_init(, avctx);
> > ../libavcodec/dnxhdenc.c:ff_pixblockdsp_init(>m.pdsp, avctx);
> > ../libavcodec/dvenc.c:ff_pixblockdsp_init(, avctx);
> > ../libavcodec/mpegvideo_enc.c:ff_pixblockdsp_init(>pdsp, avctx);
> >
> > bash-3.2$ grep AV_PIX_FMT ../libavcodec/dvenc.c ../libavcodec/dnxhdenc.c
> > ../libavcodec/mpegvideo_enc.c ../libavcodec/asvenc.c
> > ../libavcodec/dnxhdenc.c:case AV_PIX_FMT_YUV422P10:
> > ../libavcodec/dnxhdenc.c:AV_PIX_FMT_YUV422P10,
> >
> > bash-3.2$ grep clear_block ../libavcodec/dnxhdenc.c
> > ctx->bdsp.clear_block(ctx->blocks[4]);
> > ctx->bdsp.clear_block(ctx->blocks[5]);
> > ctx->bdsp.clear_block(ctx->blocks[6]);
> > ctx->bdsp.clear_block(ctx->blocks[7]);
> >
> > So this may break 10bit dnxhd encoding.
>
> Well, that's part of the routine of what I've been testing since a
> while, and it doesn't seem so. But that's not a very convincing
> argument.
>
> But I'm not sure what you are finding with your greps. That dnxhdenc
> is actually using clear_block depending on the highbitdepth parameter?
> In dnxhdenc, ctx->blocks are still 16bits dct coeffs blocks, as in all
> of those codecs. There's 12 bit content and support incoming, but even
> there, coeffs are 15bits (DC is).


OK, that's basically what I was wondering about. If the dct coef types are
bitdepth independent (as seems to be the case), your patch should be OK.

Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] blockdsp: remove high bit depth parameter

2015-10-01 Thread Christophe Gisquet
Hi,

2015-10-01 21:35 GMT+02:00 Michael Niedermayer :
> ffmpeg/libavcodec/arm/blockdsp_arm.h:24:6: note: previous declaration of 
> ‘ff_blockdsp_init_neon’ was here

Missed that header... I can only find those using grep...

Here's an updated patch.

-- 
Christophe
From 8da8a89ecf33e0c550fa61d6423a64650f6fc770 Mon Sep 17 00:00:00 2001
From: Christophe Gisquet 
Date: Mon, 28 Sep 2015 13:59:23 +0200
Subject: [PATCH 01/17] 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.
---
 libavcodec/alpha/blockdsp_alpha.c|  4 +---
 libavcodec/arm/blockdsp_arm.h|  2 +-
 libavcodec/arm/blockdsp_init_arm.c   |  4 ++--
 libavcodec/arm/blockdsp_init_neon.c  |  4 +---
 libavcodec/blockdsp.c| 20 +---
 libavcodec/blockdsp.h| 10 +-
 libavcodec/mips/blockdsp_init_mips.c | 12 +---
 libavcodec/ppc/blockdsp.c|  5 +
 libavcodec/x86/blockdsp_init.c   |  4 +---
 9 files changed, 26 insertions(+), 39 deletions(-)

diff --git a/libavcodec/alpha/blockdsp_alpha.c b/libavcodec/alpha/blockdsp_alpha.c
index ded439d..d8b6f8a 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 2688d36..59ebeb8 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 3b86a71..2080d52 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 62b51fc..37819c6 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 42e177b..a5c527a 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 654ecdc..dddac72 100644
--- 

Re: [FFmpeg-devel] [PATCH] blockdsp: remove high bit depth parameter

2015-10-01 Thread Michael Niedermayer
On Thu, Oct 01, 2015 at 09:54:49PM +0200, Christophe Gisquet wrote:
> Hi,
> 
> 2015-10-01 21:35 GMT+02:00 Michael Niedermayer :
> > ffmpeg/libavcodec/arm/blockdsp_arm.h:24:6: note: previous declaration of 
> > ‘ff_blockdsp_init_neon’ was here
> 
> Missed that header... I can only find those using grep...
> 
> Here's an updated patch.
> 
> -- 
> Christophe

>  alpha/blockdsp_alpha.c|4 +---
>  arm/blockdsp_arm.h|2 +-
>  arm/blockdsp_init_arm.c   |4 ++--
>  arm/blockdsp_init_neon.c  |4 +---
>  blockdsp.c|   20 +---
>  blockdsp.h|   10 +-
>  mips/blockdsp_init_mips.c |   12 +---
>  ppc/blockdsp.c|5 +
>  x86/blockdsp_init.c   |4 +---
>  9 files changed, 26 insertions(+), 39 deletions(-)
> 1b51424b24ecc4f5ba2de7b37d0e9c5f27f64c82  
> 0001-blockdsp-remove-high-bitdepth-parameter.patch
> From 8da8a89ecf33e0c550fa61d6423a64650f6fc770 Mon Sep 17 00:00:00 2001
> From: Christophe Gisquet 
> Date: Mon, 28 Sep 2015 13:59:23 +0200
> Subject: [PATCH 01/17] blockdsp: remove high bitdepth parameter

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 1
"Used only once"- "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] blockdsp: remove high bit depth parameter

2015-09-28 Thread Christophe Gisquet
This parameter is intended for pixel data, while the functions are
actually only called for dct blocks.

I admit I haven't run this over all of fate, so it would be nice to
validate nothing actually uses it for pixels (I have see nothing of
the sort).

-- 
Christophe
From d89cdcaf4f71bcb910e57184c2024029f09b3903 Mon Sep 17 00:00:00 2001
From: Christophe Gisquet 
Date: Mon, 28 Sep 2015 13:59:23 +0200
Subject: [PATCH 2/7] 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.
---
 libavcodec/alpha/blockdsp_alpha.c|  4 +---
 libavcodec/arm/blockdsp_init_arm.c   |  4 ++--
 libavcodec/arm/blockdsp_init_neon.c  |  4 +---
 libavcodec/blockdsp.c| 20 +---
 libavcodec/blockdsp.h| 10 +-
 libavcodec/mips/blockdsp_init_mips.c | 12 +---
 libavcodec/ppc/blockdsp.c|  5 +
 libavcodec/x86/blockdsp_init.c   |  4 +---
 8 files changed, 25 insertions(+), 38 deletions(-)

diff --git a/libavcodec/alpha/blockdsp_alpha.c b/libavcodec/alpha/blockdsp_alpha.c
index ded439d..d8b6f8a 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_init_arm.c b/libavcodec/arm/blockdsp_init_arm.c
index 3b86a71..2080d52 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 62b51fc..37819c6 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 42e177b..a5c527a 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 654ecdc..dddac72 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,