diff options
author | Anton Khirnov <anton@khirnov.net> | 2015-11-18 12:37:16 +0300 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-11-20 11:22:59 +0300 |
commit | f6c94457b44f41d900cd0991857f54e1f0ccedd6 (patch) | |
tree | be4a092b915b3639fe12ad51f75c677f6af5d9f4 /libavcodec | |
parent | d80f0a4ad634b3949b91b85f21fd608c0cddeef7 (diff) |
mpegvideo_enc: enable rtp_mode when multiple slices are used
Currently, multiple slices with just one thread produce corrupted
output.
Additionally, enable slice structured mode for h263(+)
Bug-Id: 912
CC: libav-stabl@libav.org
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index d572b859a0..b9157412de 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -519,9 +519,6 @@ FF_ENABLE_DEPRECATION_WARNINGS return -1; } - if (s->avctx->thread_count > 1) - s->rtp_mode = 1; - if (!avctx->time_base.den || !avctx->time_base.num) { av_log(avctx, AV_LOG_ERROR, "framerate not set\n"); return -1; @@ -764,6 +761,13 @@ FF_ENABLE_DEPRECATION_WARNINGS if ((CONFIG_H263P_ENCODER || CONFIG_RV20_ENCODER) && s->modified_quant) s->chroma_qscale_table = ff_h263_chroma_qscale_table; + if (s->slice_context_count > 1) { + s->rtp_mode = 1; + + if (avctx->codec_id == AV_CODEC_ID_H263 || avctx->codec_id == AV_CODEC_ID_H263P) + s->h263_slice_structured = 1; + } + s->quant_precision = 5; ff_set_cmp(&s->mecc, s->mecc.ildct_cmp, s->avctx->ildct_cmp); |