Commit 63b4d6fe authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/proresenc_anatoliy: Use fdct from DSPContext instead of direct call.

Based-on: a55546f4 by Diego Biurrun
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e263af30
...@@ -145,6 +145,7 @@ static const uint8_t QMAT_CHROMA[4][64] = { ...@@ -145,6 +145,7 @@ static const uint8_t QMAT_CHROMA[4][64] = {
typedef struct { typedef struct {
DSPContext dsp;
uint8_t* fill_y; uint8_t* fill_y;
uint8_t* fill_u; uint8_t* fill_u;
uint8_t* fill_v; uint8_t* fill_v;
...@@ -276,27 +277,29 @@ static void get(uint8_t *pixels, int stride, int16_t* block) ...@@ -276,27 +277,29 @@ static void get(uint8_t *pixels, int stride, int16_t* block)
} }
} }
static void fdct_get(uint8_t *pixels, int stride, int16_t* block) static void fdct_get(DSPContext *dsp, uint8_t *pixels, int stride, int16_t* block)
{ {
get(pixels, stride, block); get(pixels, stride, block);
ff_jpeg_fdct_islow_10(block); dsp->fdct(block);
} }
static int encode_slice_plane(AVCodecContext *avctx, int mb_count, static int encode_slice_plane(AVCodecContext *avctx, int mb_count,
uint8_t *src, int src_stride, uint8_t *buf, unsigned buf_size, uint8_t *src, int src_stride, uint8_t *buf, unsigned buf_size,
int *qmat, int chroma) int *qmat, int chroma)
{ {
ProresContext* ctx = avctx->priv_data;
DSPContext *dsp = &ctx->dsp;
DECLARE_ALIGNED(16, int16_t, blocks)[DEFAULT_SLICE_MB_WIDTH << 8], *block; DECLARE_ALIGNED(16, int16_t, blocks)[DEFAULT_SLICE_MB_WIDTH << 8], *block;
int i, blocks_per_slice; int i, blocks_per_slice;
PutBitContext pb; PutBitContext pb;
block = blocks; block = blocks;
for (i = 0; i < mb_count; i++) { for (i = 0; i < mb_count; i++) {
fdct_get(src, src_stride, block + (0 << 6)); fdct_get(dsp, src, src_stride, block + (0 << 6));
fdct_get(src + 8 * src_stride, src_stride, block + ((2 - chroma) << 6)); fdct_get(dsp, src + 8 * src_stride, src_stride, block + ((2 - chroma) << 6));
if (!chroma) { if (!chroma) {
fdct_get(src + 16, src_stride, block + (1 << 6)); fdct_get(dsp, src + 16, src_stride, block + (1 << 6));
fdct_get(src + 16 + 8 * src_stride, src_stride, block + (3 << 6)); fdct_get(dsp, src + 16 + 8 * src_stride, src_stride, block + (3 << 6));
} }
block += (256 >> chroma); block += (256 >> chroma);
...@@ -576,6 +579,8 @@ static av_cold int prores_encode_init(AVCodecContext *avctx) ...@@ -576,6 +579,8 @@ static av_cold int prores_encode_init(AVCodecContext *avctx)
return -1; return -1;
} }
ff_dsputil_init(&ctx->dsp, avctx);
avctx->codec_tag = AV_RL32((const uint8_t*)profiles[avctx->profile].name); avctx->codec_tag = AV_RL32((const uint8_t*)profiles[avctx->profile].name);
for (i = 1; i <= 16; i++) { for (i = 1; i <= 16; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment