aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/frame_thread_encoder.c
diff options
context:
space:
mode:
authorChristophe Gisquet <christophe.gisquet@gmail.com>2014-06-13 00:21:44 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-19 13:47:18 +0200
commit1467780772d6f6fd72e882b5b2677ae9acbc1297 (patch)
treef64da167bc912befa830360cb6a058e4ac64cd62 /libavcodec/frame_thread_encoder.c
parent6380f2e3670a8cfc29b9b02da0f2be0c537315f8 (diff)
downloadffmpeg-1467780772d6f6fd72e882b5b2677ae9acbc1297.tar.gz
huffyuvenc: add a non-deterministic option
Not actually used in huffyuvenc, but rather in setting the frame threading. Example for some files: context=0: 851974 27226 1137281 context=1,ND=0: 471819 22604 972351 context=1,ND=1: 472875 22673 972582 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/frame_thread_encoder.c')
-rw-r--r--libavcodec/frame_thread_encoder.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c
index 9e176985ee..6eae8b5733 100644
--- a/libavcodec/frame_thread_encoder.c
+++ b/libavcodec/frame_thread_encoder.c
@@ -142,8 +142,16 @@ int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options){
if (avctx->codec_id == AV_CODEC_ID_HUFFYUV ||
avctx->codec_id == AV_CODEC_ID_FFVHUFF) {
+ int warn = 0;
+ if (avctx->flags & CODEC_FLAG_PASS1)
+ warn = 1;
+ else if(avctx->context_model > 0) {
+ AVDictionaryEntry *t = av_dict_get(options, "non_deterministic",
+ NULL, AV_DICT_MATCH_CASE);
+ warn = !t || !t->value || !atoi(t->value) ? 1 : 0;
+ }
// huffyuv does not support these with multiple frame threads currently
- if (avctx->context_model > 0 || (avctx->flags & CODEC_FLAG_PASS1)) {
+ if (warn) {
av_log(avctx, AV_LOG_WARNING,
"Forcing thread count to 1 for huffyuv encoding with first pass or context 1\n");
avctx->thread_count = 1;