diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-08-04 05:18:58 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-10-07 22:34:20 +0200 |
commit | 787351a68e9f3cbe46c3dcf6d0d9b001bcd139b3 (patch) | |
tree | bce539cf25bdf3a277be5c2a1dd7c9b438608e64 /libavcodec/h264_ps.h | |
parent | 78c9ed26b6e83ea29b55420c2c88dc1860810042 (diff) | |
download | ffmpeg-787351a68e9f3cbe46c3dcf6d0d9b001bcd139b3.tar.gz |
avcodec/h264_ps: Use RefStruct API for SPS/PPS
Avoids allocations and error checks for these allocations;
e.g. syncing buffers across threads can't fail any more
and needn't be checked. It also avoids having to keep
H264ParamSets.pps and H264ParamSets.pps_ref and PPS.sps
and PPS.sps_ref in sync and gets rid of casts and indirections.
(The removal of these checks and the syncing code even more
than offset the additional code for RefStruct.)
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/h264_ps.h')
-rw-r--r-- | libavcodec/h264_ps.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/libavcodec/h264_ps.h b/libavcodec/h264_ps.h index e675619635..80af4832fe 100644 --- a/libavcodec/h264_ps.h +++ b/libavcodec/h264_ps.h @@ -26,7 +26,6 @@ #include <stdint.h> -#include "libavutil/buffer.h" #include "libavutil/pixfmt.h" #include "libavutil/rational.h" @@ -139,18 +138,16 @@ typedef struct PPS { uint32_t(*dequant4_coeff[6])[16]; uint32_t(*dequant8_coeff[6])[64]; - AVBufferRef *sps_ref; - const SPS *sps; + const SPS *sps; ///< RefStruct reference } PPS; typedef struct H264ParamSets { - AVBufferRef *sps_list[MAX_SPS_COUNT]; - AVBufferRef *pps_list[MAX_PPS_COUNT]; + const SPS *sps_list[MAX_SPS_COUNT]; ///< RefStruct references + const PPS *pps_list[MAX_PPS_COUNT]; ///< RefStruct references - AVBufferRef *pps_ref; /* currently active parameters sets */ - const PPS *pps; - const SPS *sps; + const PPS *pps; ///< RefStruct reference + const SPS *sps; ///< ordinary pointer, no RefStruct reference int overread_warning_printed[2]; } H264ParamSets; |