diff options
author | Haihao Xiang <haihao.xiang@intel.com> | 2018-05-10 13:47:44 +0800 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2018-05-10 20:36:45 +0100 |
commit | 56ed01169269451b7bb327c6bb250eec36ee3de2 (patch) | |
tree | 87ad7bf0b4a707af59a932e738995e3119989b75 /libavcodec/cbs_h265.h | |
parent | bed670a1de29b58fcb3fe046562d8bd125b1457f (diff) | |
download | ffmpeg-56ed01169269451b7bb327c6bb250eec36ee3de2.tar.gz |
cbs_h265: read/write HEVC PREFIX SEI
Similar to H264, cbs_h265_{read, write}_nal_unit() can handle HEVC
prefix SEI NAL units. Currently mastering display colour volume SEI
message is added only, we may add more SEI message if needed later
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Diffstat (limited to 'libavcodec/cbs_h265.h')
-rw-r--r-- | libavcodec/cbs_h265.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/libavcodec/cbs_h265.h b/libavcodec/cbs_h265.h index 6d02979a17..983357e383 100644 --- a/libavcodec/cbs_h265.h +++ b/libavcodec/cbs_h265.h @@ -25,6 +25,14 @@ #include "cbs_h2645.h" #include "hevc.h" +enum { + // This limit is arbitrary - it is sufficient for one message of each + // type plus some repeats, and will therefore easily cover all sane + // streams. However, it is possible to make technically-valid streams + // for which it will fail (for example, by including a large number of + // user-data-unregistered messages). + H265_MAX_SEI_PAYLOADS = 64, +}; typedef struct H265RawNALUnitHeader { uint8_t forbidden_zero_bit; @@ -516,6 +524,34 @@ typedef struct H265RawSlice { AVBufferRef *data_ref; } H265RawSlice; +typedef struct H265RawSEIMasteringDisplayColourVolume { + uint16_t display_primaries_x[3]; + uint16_t display_primaries_y[3]; + uint16_t white_point_x; + uint16_t white_point_y; + uint32_t max_display_mastering_luminance; + uint32_t min_display_mastering_luminance; +} H265RawSEIMasteringDisplayColourVolume; + +typedef struct H265RawSEIPayload { + uint32_t payload_type; + uint32_t payload_size; + union { + H265RawSEIMasteringDisplayColourVolume mastering_display; + struct { + uint8_t *data; + size_t data_length; + AVBufferRef *data_ref; + } other; + } payload; +} H265RawSEIPayload; + +typedef struct H265RawSEI { + H265RawNALUnitHeader nal_unit_header; + + H265RawSEIPayload payload[H265_MAX_SEI_PAYLOADS]; + uint8_t payload_count; +} H265RawSEI; typedef struct CodedBitstreamH265Context { // Reader/writer context in common with the H.264 implementation. |