diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-05-11 21:47:53 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-06-08 12:52:50 +0200 |
commit | 3f6e7153361b09e12cd6e97ce5a9175048653296 (patch) | |
tree | eb09c0956add68bb04877c86442247eaab38645b /libavcodec/frame_thread_encoder.h | |
parent | 56e9e0273a79fb4ff4276503e69981f8e383f22b (diff) | |
download | ffmpeg-3f6e7153361b09e12cd6e97ce5a9175048653296.tar.gz |
avcodec/frame_thread_encoder: Avoid dictionaries
avcodec_open2() allows to provide options via an AVDictionary;
but it is also allowed to set options by simply setting the value
of the AVCodecContext or via the AVOptions API if the codec has
a private class. Any options provided via an AVDictionary have already
been applied before ff_frame_thread_init(), so in order to copy
all the options from the main AVCodecContext and its private context,
it is enough to av_opt_copy() these options.
The current code does this, but it does more: It also copies the
user-provided AVDictionary and uses it for the initialization of
each of the worker-AVCodecContexts. This is completely unnecessary,
because said options have already been copied from the main context.
Furthermore, these options were also examined to decide if frame
threading should be used for huffman encoding in case this would incur
nondeterminism. This is wrong, because options not set via
an AVDictionary are ignored. Instead inspect the values stored in the
contexts directly. (In order to maintain the current behaviour, the
default value of the "non_deterministic" option has been changed to false,
because the absence of an entry with said key in the AVDictionary
had the consequence of disallowing nondeterminism.)
Finally, the AVDictionary has been removed from the signature of
ff_frame_thread_encoder_init().
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/frame_thread_encoder.h')
-rw-r--r-- | libavcodec/frame_thread_encoder.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/frame_thread_encoder.h b/libavcodec/frame_thread_encoder.h index c400d6b32c..2cdc40a830 100644 --- a/libavcodec/frame_thread_encoder.h +++ b/libavcodec/frame_thread_encoder.h @@ -23,7 +23,7 @@ #include "avcodec.h" -int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options); +int ff_frame_thread_encoder_init(AVCodecContext *avctx); void ff_frame_thread_encoder_free(AVCodecContext *avctx); int ff_thread_video_encode_frame(AVCodecContext *avctx, AVPacket *pkt, AVFrame *frame, int *got_packet_ptr); |