From: Michael Niedermayer Date: Fri, 27 Jun 2014 17:13:34 +0000 (+0200) Subject: Merge commit 'e63b818dbe6060b606ae10eb184859f8b97d2353' X-Git-Tag: n2.4-dev~336 X-Git-Url: http://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff_plain/3ac51145304f9996152a80f5a191ced7b857a252 Merge commit 'e63b818dbe6060b606ae10eb184859f8b97d2353' * commit 'e63b818dbe6060b606ae10eb184859f8b97d2353': dv: Properly split decoder and encoder initialization Conflicts: libavcodec/dv.c Merged-by: Michael Niedermayer --- 3ac51145304f9996152a80f5a191ced7b857a252 diff --cc libavcodec/dvdec.c index d7aaa5f,9a559db..bf8b5b5 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@@ -59,6 -58,25 +59,32 @@@ 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; + ++ memset(&dsp,0, sizeof(dsp)); + 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])); ++ if (avctx->lowres){ ++ for (i = 0; i < 64; i++){ ++ int j = ff_dv_zigzag248_direct[i]; ++ s->dv_zigzag[1][i] = dsp.idct_permutation[(j & 7) + (j & 8) * 4 + (j & 48) / 2]; ++ } ++ }else ++ 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) { @@@ -385,8 -400,7 +411,8 @@@ 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, + .max_lowres = 3, }; diff --cc libavcodec/dvenc.c index 4a11038,5b013ad..d1e7707 --- a/libavcodec/dvenc.c +++ b/libavcodec/dvenc.c @@@ -62,6 -60,15 +64,16 @@@ static av_cold int dvvideo_encode_init( dv_vlc_map_tableinit(); ++ memset(&dsp,0, sizeof(dsp)); + ff_dsputil_init(&dsp, avctx); + ff_set_cmp(&dsp, dsp.ildct_cmp, avctx->ildct_cmp); + + s->get_pixels = dsp.get_pixels; + s->ildct_cmp = dsp.ildct_cmp[5]; + + s->fdct[0] = dsp.fdct; + s->fdct[1] = dsp.fdct248; + return ff_dvvideo_init(avctx); }