aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/bink.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2013-03-10 09:12:01 -0700
committerMartin Storsjö <martin@martin.st>2013-04-19 23:17:56 +0300
commit0f0a11d5768e50f5bb517c023a7618e00e21840a (patch)
tree69fdccb6cffd85d9a55fcdad257ff09ee63dc4f5 /libavcodec/bink.c
parent8f992dc8c7c50cddaf297eefa3955ce01857e5f2 (diff)
downloadffmpeg-0f0a11d5768e50f5bb517c023a7618e00e21840a.tar.gz
bink: Use hpeldsp instead of dsputil for half-pel functions
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/bink.c')
-rw-r--r--libavcodec/bink.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index 22e13c33dd..33feb42a44 100644
--- a/libavcodec/bink.c
+++ b/libavcodec/bink.c
@@ -26,6 +26,7 @@
#include "dsputil.h"
#include "binkdata.h"
#include "binkdsp.h"
+#include "hpeldsp.h"
#include "internal.h"
#include "mathops.h"
@@ -112,6 +113,7 @@ typedef struct Bundle {
typedef struct BinkContext {
AVCodecContext *avctx;
DSPContext dsp;
+ HpelDSPContext hdsp;
BinkDSPContext bdsp;
AVFrame *last;
int version; ///< internal Bink file version
@@ -870,7 +872,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->dsp.put_pixels_tab[1][0](dst, ref, stride, 8);
+ c->hdsp.put_pixels_tab[1][0](dst, ref, stride, 8);
} else {
put_pixels8x8_overlapped(dst, ref, stride);
}
@@ -886,7 +888,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->dsp.put_pixels_tab[1][0](dst, ref, stride, 8);
+ c->hdsp.put_pixels_tab[1][0](dst, ref, stride, 8);
} else {
put_pixels8x8_overlapped(dst, ref, stride);
}
@@ -916,7 +918,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->dsp.put_pixels_tab[1][0](dst, ref, stride, 8);
+ c->hdsp.put_pixels_tab[1][0](dst, ref, stride, 8);
} else {
put_pixels8x8_overlapped(dst, ref, stride);
}
@@ -1005,7 +1007,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
}
switch (blk) {
case SKIP_BLOCK:
- c->dsp.put_pixels_tab[1][0](dst, prev, stride, 8);
+ c->hdsp.put_pixels_tab[1][0](dst, prev, stride, 8);
break;
case SCALED_BLOCK:
blk = get_value(c, BINK_SRC_SUB_BLOCK_TYPES);
@@ -1076,7 +1078,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
bx*8 + xoff, by*8 + yoff);
return AVERROR_INVALIDDATA;
}
- c->dsp.put_pixels_tab[1][0](dst, ref, stride, 8);
+ c->hdsp.put_pixels_tab[1][0](dst, ref, stride, 8);
break;
case RUN_BLOCK:
scan = bink_patterns[get_bits(gb, 4)];
@@ -1110,7 +1112,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
bx*8 + xoff, by*8 + yoff);
return AVERROR_INVALIDDATA;
}
- c->dsp.put_pixels_tab[1][0](dst, ref, stride, 8);
+ c->hdsp.put_pixels_tab[1][0](dst, ref, stride, 8);
c->dsp.clear_block(block);
v = get_bits(gb, 7);
read_residue(gb, block, v);
@@ -1130,7 +1132,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
xoff = get_value(c, BINK_SRC_X_OFF);
yoff = get_value(c, BINK_SRC_Y_OFF);
ref = prev + xoff + yoff * stride;
- c->dsp.put_pixels_tab[1][0](dst, ref, stride, 8);
+ c->hdsp.put_pixels_tab[1][0](dst, ref, stride, 8);
memset(dctblock, 0, sizeof(*dctblock) * 64);
dctblock[0] = get_value(c, BINK_SRC_INTER_DC);
read_dct_coeffs(gb, dctblock, bink_scan, bink_inter_quant, -1);
@@ -1305,6 +1307,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
avctx->pix_fmt = c->has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P;
ff_dsputil_init(&c->dsp, avctx);
+ ff_hpeldsp_init(&c->hdsp, avctx->flags);
ff_binkdsp_init(&c->bdsp);
init_bundles(c);