summaryrefslogtreecommitdiffstats
path: root/libavcodec/bfin
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2013-12-30 12:09:03 +0100
committerDiego Biurrun <diego@biurrun.de>2014-03-20 05:03:23 -0700
commit5169e688956be3378adb3b16a93962fe0048f1c9 (patch)
tree5c76aaaa9cbc38575f3eb02269dd6704725882de /libavcodec/bfin
parentcf7a2167570e6ccb9dfbd62e9d8ba8f4f065b17e (diff)
downloadffmpeg-streaming-5169e688956be3378adb3b16a93962fe0048f1c9.zip
ffmpeg-streaming-5169e688956be3378adb3b16a93962fe0048f1c9.tar.gz
dsputil: Propagate bit depth information to all (sub)init functions
This avoids recalculating the value over and over again.
Diffstat (limited to 'libavcodec/bfin')
-rw-r--r--libavcodec/bfin/dsputil_init.c12
1 files changed, 5 insertions, 7 deletions
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;
OpenPOWER on IntegriCloud