diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-08-04 11:59:16 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2023-10-07 22:35:05 +0200 |
commit | 3e9b8d14e5d0df72765a1c9ca683c9d0f1d51e1a (patch) | |
tree | fd1b7cbc5358212171beb26f98e21cc0bf02216e /libavcodec/cbs_h266.h | |
parent | 56dd585146288070c98a9429ae85dc3551940a4b (diff) | |
download | ffmpeg-3e9b8d14e5d0df72765a1c9ca683c9d0f1d51e1a.tar.gz |
avcodec/cbs: Use RefStruct-API for unit content
This avoids allocations and error checks etc. as well
as duplicate pointer lists in the CodedBitstreamFooContexts.
It also avoids casting const away for use as opaque,
as the RefStruct API supports const opaques.
The fact that some of the units are not refcounted
(i.e. they are sometimes part of an encoding context
like VAAPIEncodeH264Context) meant that CodedBitstreamUnit
still contains two pointers, one to the content
and another ownership pointer, replacing the AVBufferRef* pointer.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/cbs_h266.h')
-rw-r--r-- | libavcodec/cbs_h266.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/libavcodec/cbs_h266.h b/libavcodec/cbs_h266.h index 3a6f6d96b5..d2ba99f522 100644 --- a/libavcodec/cbs_h266.h +++ b/libavcodec/cbs_h266.h @@ -867,14 +867,11 @@ typedef struct CodedBitstreamH266Context { // All currently available parameter sets. These are updated when // any parameter set NAL unit is read/written with this context. - AVBufferRef *vps_ref[VVC_MAX_VPS_COUNT]; - AVBufferRef *sps_ref[VVC_MAX_SPS_COUNT]; - AVBufferRef *pps_ref[VVC_MAX_PPS_COUNT]; - AVBufferRef *ph_ref; - H266RawVPS *vps[VVC_MAX_VPS_COUNT]; - H266RawSPS *sps[VVC_MAX_SPS_COUNT]; - H266RawPPS *pps[VVC_MAX_PPS_COUNT]; + H266RawVPS *vps[VVC_MAX_VPS_COUNT]; ///< RefStruct references + H266RawSPS *sps[VVC_MAX_SPS_COUNT]; ///< RefStruct references + H266RawPPS *pps[VVC_MAX_PPS_COUNT]; ///< RefStruct references H266RawPictureHeader *ph; + void *ph_ref; ///< RefStruct reference backing ph above } CodedBitstreamH266Context; #endif /* AVCODEC_CBS_H266_H */ |