diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-09-25 18:04:36 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-09-25 18:10:11 +0200 |
commit | 6b33e918996e8a4e40071cb0a273c23de22ce1fc (patch) | |
tree | 33fdfad1bdba4662b6f151c707bfc50185089719 /libavcodec/mpegvideo_enc.c | |
parent | 71d6eb2208b0ef15e4bd7cf899a8223cdb0460ad (diff) | |
download | ffmpeg-6b33e918996e8a4e40071cb0a273c23de22ce1fc.tar.gz |
mpegvideo: factorize ff_dct_encode_init()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index ab6115b6f0..4322d65e73 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -267,6 +267,21 @@ static void MPV_encode_defaults(MpegEncContext *s) s->fcode_tab = default_fcode_tab; } +av_cold int ff_dct_encode_init(MpegEncContext *s) { + if (ARCH_X86) + ff_dct_encode_init_x86(s); + + if (!s->dct_quantize) + s->dct_quantize = ff_dct_quantize_c; + if (!s->denoise_dct) + s->denoise_dct = denoise_dct_c; + s->fast_dct_quantize = s->dct_quantize; + if (s->avctx->trellis) + s->dct_quantize = dct_quantize_trellis_c; + + return 0; +} + /* init video encoder */ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) { @@ -832,16 +847,7 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) if (ff_MPV_common_init(s) < 0) return -1; - if (ARCH_X86) - ff_MPV_encode_init_x86(s); - - if (!s->dct_quantize) - s->dct_quantize = ff_dct_quantize_c; - if (!s->denoise_dct) - s->denoise_dct = denoise_dct_c; - s->fast_dct_quantize = s->dct_quantize; - if (avctx->trellis) - s->dct_quantize = dct_quantize_trellis_c; + ff_dct_encode_init(s); if ((CONFIG_H263P_ENCODER || CONFIG_RV20_ENCODER) && s->modified_quant) s->chroma_qscale_table = ff_h263_chroma_qscale_table; |