diff options
author | Diego Biurrun <diego@biurrun.de> | 2014-01-29 18:04:55 +0100 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2014-03-22 06:17:29 -0700 |
commit | 1df0b061621b10edde87e3ab7ea83aed381c574f (patch) | |
tree | 384f82fbd80482a233f832219a9399d5d8ecc29e /libavcodec/nuv.c | |
parent | 46caba4a65237c006ab54b0c16ecc00d21dedda1 (diff) | |
download | ffmpeg-1df0b061621b10edde87e3ab7ea83aed381c574f.tar.gz |
nuv: Reuse the DSPContext from RTJpegContext
There is no point in populating NuvContext with another DSPContext.
Also split static and dynamic initialization bits to avoid running the
static initialization parts over and over.
Diffstat (limited to 'libavcodec/nuv.c')
-rw-r--r-- | libavcodec/nuv.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index 2af6529685..1bd848d519 100644 --- a/libavcodec/nuv.c +++ b/libavcodec/nuv.c @@ -40,7 +40,6 @@ typedef struct { unsigned char *decomp_buf; uint32_t lq[64], cq[64]; RTJpegContext rtj; - DSPContext dsp; } NuvContext; static const uint8_t fallback_lquant[] = { @@ -136,12 +135,10 @@ static int codec_reinit(AVCodecContext *avctx, int width, int height, return AVERROR(ENOMEM); } else c->decomp_buf = ptr; - ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, - c->lq, c->cq); + ff_rtjpeg_decode_init(&c->rtj, c->width, c->height, c->lq, c->cq); av_frame_unref(c->pic); } else if (quality != c->quality) - ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, - c->lq, c->cq); + ff_rtjpeg_decode_init(&c->rtj, c->width, c->height, c->lq, c->cq); return 0; } @@ -179,8 +176,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, ret = get_quant(avctx, c, buf, buf_size); if (ret < 0) return ret; - ff_rtjpeg_decode_init(&c->rtj, &c->dsp, c->width, c->height, c->lq, - c->cq); + ff_rtjpeg_decode_init(&c->rtj, c->width, c->height, c->lq, c->cq); return orig_size; } @@ -308,7 +304,7 @@ static av_cold int decode_init(AVCodecContext *avctx) if (avctx->extradata_size) get_quant(avctx, c, avctx->extradata, avctx->extradata_size); - ff_dsputil_init(&c->dsp, avctx); + ff_rtjpeg_init(&c->rtj, avctx); if ((ret = codec_reinit(avctx, avctx->width, avctx->height, -1)) < 0) return ret; |