2 * HEVC Supplementary Enhancement Information messages
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef AVCODEC_HEVC_SEI_H
22 #define AVCODEC_HEVC_SEI_H
31 HEVC_SEI_PIC_STRUCT_FRAME_DOUBLING = 7,
32 HEVC_SEI_PIC_STRUCT_FRAME_TRIPLING = 8
33 } HEVC_SEI_PicStructType;
35 typedef struct HEVCSEIPictureHash {
40 typedef struct HEVCSEIFramePacking {
43 int content_interpretation_type;
44 int quincunx_subsampling;
45 int current_frame_is_frame0_flag;
46 } HEVCSEIFramePacking;
48 typedef struct HEVCSEIDisplayOrientation {
50 int anticlockwise_rotation;
52 } HEVCSEIDisplayOrientation;
54 typedef struct HEVCSEIPictureTiming {
56 } HEVCSEIPictureTiming;
58 typedef struct HEVCSEIA53Caption {
62 typedef struct HEVCSEIUnregistered {
63 AVBufferRef **buf_ref;
65 } HEVCSEIUnregistered;
67 typedef struct HEVCSEIMasteringDisplay {
69 uint16_t display_primaries[3][2];
70 uint16_t white_point[2];
71 uint32_t max_luminance;
72 uint32_t min_luminance;
73 } HEVCSEIMasteringDisplay;
75 typedef struct HEVCSEIDynamicHDRPlus {
77 } HEVCSEIDynamicHDRPlus;
79 typedef struct HEVCSEIContentLight {
81 uint16_t max_content_light_level;
82 uint16_t max_pic_average_light_level;
83 } HEVCSEIContentLight;
85 typedef struct HEVCSEIAlternativeTransfer {
87 int preferred_transfer_characteristics;
88 } HEVCSEIAlternativeTransfer;
90 typedef struct HEVCSEITimeCode {
93 uint8_t clock_timestamp_flag[3];
94 uint8_t units_field_based_flag[3];
95 uint8_t counting_type[3];
96 uint8_t full_timestamp_flag[3];
97 uint8_t discontinuity_flag[3];
98 uint8_t cnt_dropped_flag[3];
100 uint8_t seconds_value[3];
101 uint8_t minutes_value[3];
102 uint8_t hours_value[3];
103 uint8_t seconds_flag[3];
104 uint8_t minutes_flag[3];
105 uint8_t hours_flag[3];
106 uint8_t time_offset_length[3];
107 int32_t time_offset_value[3];
110 typedef struct HEVCSEI {
111 HEVCSEIPictureHash picture_hash;
112 HEVCSEIFramePacking frame_packing;
113 HEVCSEIDisplayOrientation display_orientation;
114 HEVCSEIPictureTiming picture_timing;
115 HEVCSEIA53Caption a53_caption;
116 HEVCSEIUnregistered unregistered;
117 HEVCSEIMasteringDisplay mastering_display;
118 HEVCSEIDynamicHDRPlus dynamic_hdr_plus;
119 HEVCSEIContentLight content_light;
120 int active_seq_parameter_set_id;
121 HEVCSEIAlternativeTransfer alternative_transfer;
122 HEVCSEITimeCode timecode;
125 struct HEVCParamSets;
127 int ff_hevc_decode_nal_sei(GetBitContext *gb, void *logctx, HEVCSEI *s,
128 const struct HEVCParamSets *ps, int type);
131 * Reset SEI values that are stored on the Context.
132 * e.g. Caption data that was extracted during NAL
135 * @param s HEVCContext.
137 void ff_hevc_reset_sei(HEVCSEI *s);
139 #endif /* AVCODEC_HEVC_SEI_H */