summaryrefslogtreecommitdiff
path: root/libavcodec/dnxhddec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-19 04:41:48 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-19 04:54:38 +0200
commit2b05db4f8102148d013755ac2a7e47f6d79ff7ca (patch)
tree8135823ee5f9db622126672b644e06c243ae3c01 /libavcodec/dnxhddec.c
parentab12373956e92b865bced9b05b12971f062cfd3e (diff)
parente74433a8e6fc00c8dbde293c97a3e45384c2c1d9 (diff)
Merge commit 'e74433a8e6fc00c8dbde293c97a3e45384c2c1d9'
* commit 'e74433a8e6fc00c8dbde293c97a3e45384c2c1d9': dsputil: Split clear_block*/fill_block* off into a separate context Conflicts: configure libavcodec/asvdec.c libavcodec/dnxhddec.c libavcodec/dnxhdenc.c libavcodec/dsputil.h libavcodec/eamad.c libavcodec/intrax8.c libavcodec/mjpegdec.c libavcodec/ppc/dsputil_ppc.c libavcodec/vc1dec.c libavcodec/x86/dsputil_init.c libavcodec/x86/dsputil_mmx.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dnxhddec.c')
-rw-r--r--libavcodec/dnxhddec.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index e33593c114..94adbd79d3 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -25,6 +25,7 @@
#include "libavutil/imgutils.h"
#include "libavutil/timer.h"
#include "avcodec.h"
+#include "blockdsp.h"
#include "get_bits.h"
#include "dnxhddata.h"
#include "dsputil.h"
@@ -34,6 +35,7 @@
typedef struct DNXHDContext {
AVCodecContext *avctx;
GetBitContext gb;
+ BlockDSPContext bdsp;
int64_t cid; ///< compression id
unsigned int width, height;
unsigned int mb_width, mb_height;
@@ -142,6 +144,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
ctx->avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
ctx->avctx->bits_per_raw_sample = 10;
if (ctx->bit_depth != 10) {
+ ff_blockdsp_init(&ctx->bdsp, ctx->avctx);
ff_dsputil_init(&ctx->dsp, ctx->avctx);
ctx->bit_depth = 10;
ctx->decode_dct_block = dnxhd_decode_dct_block_10_444;
@@ -151,6 +154,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
ctx->avctx->bits_per_raw_sample = 10;
if (ctx->bit_depth != 10) {
+ ff_blockdsp_init(&ctx->bdsp, ctx->avctx);
ff_dsputil_init(&ctx->dsp, ctx->avctx);
ctx->bit_depth = 10;
ctx->decode_dct_block = dnxhd_decode_dct_block_10;
@@ -159,6 +163,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P;
ctx->avctx->bits_per_raw_sample = 8;
if (ctx->bit_depth != 8) {
+ ff_blockdsp_init(&ctx->bdsp, ctx->avctx);
ff_dsputil_init(&ctx->dsp, ctx->avctx);
ctx->bit_depth = 8;
ctx->decode_dct_block = dnxhd_decode_dct_block_8;
@@ -338,12 +343,12 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
}
for (i = 0; i < 8; i++) {
- ctx->dsp.clear_block(ctx->blocks[i]);
+ ctx->bdsp.clear_block(ctx->blocks[i]);
ctx->decode_dct_block(ctx, ctx->blocks[i], i, qscale);
}
if (ctx->is_444) {
for (; i < 12; i++) {
- ctx->dsp.clear_block(ctx->blocks[i]);
+ ctx->bdsp.clear_block(ctx->blocks[i]);
ctx->decode_dct_block(ctx, ctx->blocks[i], i, qscale);
}
}