From 5169e688956be3378adb3b16a93962fe0048f1c9 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Mon, 30 Dec 2013 12:09:03 +0100 Subject: dsputil: Propagate bit depth information to all (sub)init functions This avoids recalculating the value over and over again. --- libavcodec/bfin/dsputil_init.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'libavcodec/bfin') diff --git a/libavcodec/bfin/dsputil_init.c b/libavcodec/bfin/dsputil_init.c index 7a214a3..751d54a 100644 --- a/libavcodec/bfin/dsputil_init.c +++ b/libavcodec/bfin/dsputil_init.c @@ -147,18 +147,14 @@ static int bfin_pix_abs8_xy2(void *c, uint8_t *blk1, uint8_t *blk2, * 2.64s 2/20 same sman.mp4 decode only */ -av_cold void ff_dsputil_init_bfin(DSPContext *c, AVCodecContext *avctx) +av_cold void ff_dsputil_init_bfin(DSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth) { - const int high_bit_depth = avctx->bits_per_raw_sample > 8; - c->diff_pixels = ff_bfin_diff_pixels; c->put_pixels_clamped = ff_bfin_put_pixels_clamped; c->add_pixels_clamped = ff_bfin_add_pixels_clamped; - if (!high_bit_depth) - c->get_pixels = ff_bfin_get_pixels; - c->clear_blocks = bfin_clear_blocks; c->pix_sum = ff_bfin_pix_sum; @@ -182,7 +178,9 @@ av_cold void ff_dsputil_init_bfin(DSPContext *c, AVCodecContext *avctx) c->sse[1] = ff_bfin_sse8; c->sse[2] = ff_bfin_sse4; - if (avctx->bits_per_raw_sample <= 8) { + if (!high_bit_depth) { + c->get_pixels = ff_bfin_get_pixels; + if (avctx->dct_algo == FF_DCT_AUTO) c->fdct = ff_bfin_fdct; -- cgit v1.1