X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fframe_thread_encoder.c;h=04c9a0eb0c2ff1b60af0a54df0d48c85af1be3af;hb=2e6636aa87303d37b112e79f093ca39500f92364;hp=14f2ea241b86f16996158ffbf282d19d17b1465b;hpb=2ee89553aafee6b8f8df0e7f602ac331ceeded3e;p=ffmpeg diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c index 14f2ea241b8..04c9a0eb0c2 100644 --- a/libavcodec/frame_thread_encoder.c +++ b/libavcodec/frame_thread_encoder.c @@ -23,18 +23,11 @@ #include "libavutil/fifo.h" #include "libavutil/avassert.h" #include "libavutil/imgutils.h" +#include "libavutil/thread.h" #include "avcodec.h" #include "internal.h" #include "thread.h" -#if HAVE_PTHREADS -#include -#elif HAVE_W32THREADS -#include "compat/w32pthreads.h" -#elif HAVE_OS2THREADS -#include "compat/os2threads.h" -#endif - #define MAX_THREADS 64 #define BUFFER_SIZE (2*MAX_THREADS) @@ -143,9 +136,15 @@ 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; + int context_model = 0; + AVDictionaryEntry *con = av_dict_get(options, "context", NULL, AV_DICT_MATCH_CASE); + + if (con && con->value) + context_model = atoi(con->value); + if (avctx->flags & AV_CODEC_FLAG_PASS1) warn = 1; - else if(avctx->context_model > 0) { + else if(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;