aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dvdec.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2014-02-07 11:04:24 +0100
committerDiego Biurrun <diego@biurrun.de>2014-06-27 05:03:06 -0700
commite63b818dbe6060b606ae10eb184859f8b97d2353 (patch)
tree9a475b13c025a808121584e5c124efb93205cbf5 /libavcodec/dvdec.c
parentd2869aea0494d3a20d53d5034cd41dbb488eb133 (diff)
downloadffmpeg-e63b818dbe6060b606ae10eb184859f8b97d2353.tar.gz
dv: Properly split decoder and encoder initialization
Diffstat (limited to 'libavcodec/dvdec.c')
-rw-r--r--libavcodec/dvdec.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
index 89f5821b00..9a559dbd45 100644
--- a/libavcodec/dvdec.c
+++ b/libavcodec/dvdec.c
@@ -58,6 +58,25 @@ typedef struct BlockInfo {
static const int dv_iweight_bits = 14;
+static av_cold int dvvideo_decode_init(AVCodecContext *avctx)
+{
+ DVVideoContext *s = avctx->priv_data;
+ DSPContext dsp;
+ int i;
+
+ ff_dsputil_init(&dsp, avctx);
+
+ for (i = 0; i < 64; i++)
+ s->dv_zigzag[0][i] = dsp.idct_permutation[ff_zigzag_direct[i]];
+
+ memcpy(s->dv_zigzag[1], ff_dv_zigzag248_direct, sizeof(s->dv_zigzag[1]));
+
+ s->idct_put[0] = dsp.idct_put;
+ s->idct_put[1] = ff_simple_idct248_put;
+
+ return ff_dvvideo_init(avctx);
+}
+
/* decode AC coefficients */
static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, int16_t *block)
{
@@ -381,7 +400,7 @@ AVCodec ff_dvvideo_decoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_DVVIDEO,
.priv_data_size = sizeof(DVVideoContext),
- .init = ff_dvvideo_init,
+ .init = dvvideo_decode_init,
.decode = dvvideo_decode_frame,
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_SLICE_THREADS,
};