diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-09-04 17:29:28 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-09-04 20:40:55 +0200 |
commit | d2308b9237dfce5e05c83bd311835bb74b9d4735 (patch) | |
tree | ad8d95abd76a086986e7e9f2e3a86e1b14064479 /libavcodec/bink.c | |
parent | ceeba2ac2b6f03ffbb13c64c6fbef21eb52be405 (diff) | |
download | ffmpeg-d2308b9237dfce5e05c83bd311835bb74b9d4735.tar.gz |
avcodec/bink: Only keep what is used from HpelDSPContext
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/bink.c')
-rw-r--r-- | libavcodec/bink.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libavcodec/bink.c b/libavcodec/bink.c index 9fdfa37395..ec164d0165 100644 --- a/libavcodec/bink.c +++ b/libavcodec/bink.c @@ -114,7 +114,7 @@ typedef struct Bundle { typedef struct BinkContext { AVCodecContext *avctx; BlockDSPContext bdsp; - HpelDSPContext hdsp; + op_pixels_func put_pixels_tab; BinkDSPContext binkdsp; AVFrame *last; int version; ///< internal Bink file version @@ -927,7 +927,7 @@ static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb, if (ref < ref_start || ref + 8*stride > ref_end) { av_log(c->avctx, AV_LOG_WARNING, "Reference block is out of bounds\n"); } else if (ref + 8*stride < dst || ref >= dst + 8*stride) { - c->hdsp.put_pixels_tab[1][0](dst, ref, stride, 8); + c->put_pixels_tab(dst, ref, stride, 8); } else { put_pixels8x8_overlapped(dst, ref, stride); } @@ -943,7 +943,7 @@ static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb, if (ref < ref_start || ref + 8 * stride > ref_end) { av_log(c->avctx, AV_LOG_WARNING, "Reference block is out of bounds\n"); } else if (ref + 8*stride < dst || ref >= dst + 8*stride) { - c->hdsp.put_pixels_tab[1][0](dst, ref, stride, 8); + c->put_pixels_tab(dst, ref, stride, 8); } else { put_pixels8x8_overlapped(dst, ref, stride); } @@ -975,7 +975,7 @@ static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb, if (ref < ref_start || ref + 8 * stride > ref_end) { av_log(c->avctx, AV_LOG_WARNING, "Reference block is out of bounds\n"); } else if (ref + 8*stride < dst || ref >= dst + 8*stride) { - c->hdsp.put_pixels_tab[1][0](dst, ref, stride, 8); + c->put_pixels_tab(dst, ref, stride, 8); } else { put_pixels8x8_overlapped(dst, ref, stride); } @@ -1010,7 +1010,7 @@ static int bink_put_pixels(BinkContext *c, xoff, yoff); return AVERROR_INVALIDDATA; } - c->hdsp.put_pixels_tab[1][0](dst, ref, stride, 8); + c->put_pixels_tab(dst, ref, stride, 8); return 0; } @@ -1093,7 +1093,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb, } switch (blk) { case SKIP_BLOCK: - c->hdsp.put_pixels_tab[1][0](dst, prev, stride, 8); + c->put_pixels_tab(dst, prev, stride, 8); break; case SCALED_BLOCK: blk = get_value(c, BINK_SRC_SUB_BLOCK_TYPES); @@ -1345,6 +1345,7 @@ static av_cold int decode_init(AVCodecContext *avctx) BinkContext * const c = avctx->priv_data; static VLC_TYPE table[16 * 128][2]; static int binkb_initialised = 0; + HpelDSPContext hdsp; int i, ret; int flags; @@ -1379,7 +1380,8 @@ static av_cold int decode_init(AVCodecContext *avctx) avctx->color_range = c->version == 'k' ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG; ff_blockdsp_init(&c->bdsp, avctx); - ff_hpeldsp_init(&c->hdsp, avctx->flags); + ff_hpeldsp_init(&hdsp, avctx->flags); + c->put_pixels_tab = hdsp.put_pixels_tab[1][0]; ff_binkdsp_init(&c->binkdsp); if ((ret = init_bundles(c)) < 0) |