From 02220b88fc38ef9dd4f2d519f5d3e4151258b60c Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Sun, 6 Feb 2022 14:49:23 +0100 Subject: avcodec/thread: Don't use ThreadFrame when unnecessary The majority of frame-threaded decoders (mainly the intra-only) need exactly one part of ThreadFrame: The AVFrame. They don't need the owners nor the progress, yet they had to use it because ff_thread_(get|release)_buffer() requires it. This commit changes this and makes these functions work with ordinary AVFrames; the decoders that need the extra fields for progress use ff_thread_(get|release)_ext_buffer() which work exactly as ff_thread_(get|release)_buffer() used to do. This also avoids some unnecessary allocations of progress AVBuffers, namely for H.264 and HEVC film grain frames: These frames are not used for synchronization and therefore don't need a ThreadFrame. Also move the ThreadFrame structure as well as ff_thread_ref_frame() to threadframe.h, the header for frame-threaded decoders with inter-frame dependencies. Reviewed-by: Anton Khirnov Signed-off-by: Andreas Rheinhardt --- libavcodec/h264dec.h | 1 - 1 file changed, 1 deletion(-) (limited to 'libavcodec/h264dec.h') diff --git a/libavcodec/h264dec.h b/libavcodec/h264dec.h index 8168c8e97b..f18adda2d1 100644 --- a/libavcodec/h264dec.h +++ b/libavcodec/h264dec.h @@ -109,7 +109,6 @@ typedef struct H264Picture { ThreadFrame tf; AVFrame *f_grain; - ThreadFrame tf_grain; AVBufferRef *qscale_table_buf; int8_t *qscale_table; -- cgit v1.2.3