FFmpeg
hevc_sei.h
Go to the documentation of this file.
1 /*
2  * HEVC Supplementary Enhancement Information messages
3  *
4  * This file is part of FFmpeg.
5  *
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.
10  *
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.
15  *
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
19  */
20 
21 #ifndef AVCODEC_HEVC_SEI_H
22 #define AVCODEC_HEVC_SEI_H
23 
24 #include <stdint.h>
25 
26 #include "libavutil/buffer.h"
27 
28 #include "get_bits.h"
29 #include "hevc.h"
30 #include "sei.h"
31 
32 
33 typedef enum {
37 
38 typedef struct HEVCSEIPictureHash {
39  uint8_t md5[3][16];
40  uint8_t is_md5;
42 
43 typedef struct HEVCSEIFramePacking {
44  int present;
50 
51 typedef struct HEVCSEIDisplayOrientation {
52  int present;
54  int hflip, vflip;
56 
57 typedef struct HEVCSEIPictureTiming {
60 
61 typedef struct HEVCSEIA53Caption {
64 
65 typedef struct HEVCSEIUnregistered {
69 
70 typedef struct HEVCSEIMasteringDisplay {
71  int present;
72  uint16_t display_primaries[3][2];
73  uint16_t white_point[2];
74  uint32_t max_luminance;
75  uint32_t min_luminance;
77 
78 typedef struct HEVCSEIDynamicHDRPlus {
81 
82 typedef struct HEVCSEIDynamicHDRVivid {
85 
86 typedef struct HEVCSEIContentLight {
87  int present;
91 
93  int present;
96 
97 typedef struct HEVCSEITimeCode {
98  int present;
99  uint8_t num_clock_ts;
102  uint8_t counting_type[3];
104  uint8_t discontinuity_flag[3];
105  uint8_t cnt_dropped_flag[3];
106  uint16_t n_frames[3];
107  uint8_t seconds_value[3];
108  uint8_t minutes_value[3];
109  uint8_t hours_value[3];
110  uint8_t seconds_flag[3];
111  uint8_t minutes_flag[3];
112  uint8_t hours_flag[3];
113  uint8_t time_offset_length[3];
116 
118  int present;
119  int model_id;
131  uint8_t num_model_values[3];
134  int16_t comp_model_value[3][256][6];
137 
138 typedef struct HEVCSEI {
153 } HEVCSEI;
154 
155 struct HEVCParamSets;
156 
157 int ff_hevc_decode_nal_sei(GetBitContext *gb, void *logctx, HEVCSEI *s,
158  const struct HEVCParamSets *ps, enum HEVCNALUnitType type);
159 
160 /**
161  * Reset SEI values that are stored on the Context.
162  * e.g. Caption data that was extracted during NAL
163  * parsing.
164  *
165  * @param s HEVCContext.
166  */
168 
169 #endif /* AVCODEC_HEVC_SEI_H */
HEVCSEIFilmGrainCharacteristics::comp_model_present_flag
int comp_model_present_flag[3]
Definition: hevc_sei.h:129
HEVCSEI::active_seq_parameter_set_id
int active_seq_parameter_set_id
Definition: hevc_sei.h:149
HEVCSEIAlternativeTransfer
Definition: hevc_sei.h:92
HEVCSEI::picture_timing
HEVCSEIPictureTiming picture_timing
Definition: hevc_sei.h:142
HEVCSEIUnregistered
Definition: hevc_sei.h:65
HEVCSEIDisplayOrientation::vflip
int vflip
Definition: hevc_sei.h:54
HEVCSEITimeCode::cnt_dropped_flag
uint8_t cnt_dropped_flag[3]
Definition: hevc_sei.h:105
HEVCSEIPictureHash::is_md5
uint8_t is_md5
Definition: hevc_sei.h:40
HEVCSEITimeCode::time_offset_length
uint8_t time_offset_length[3]
Definition: hevc_sei.h:113
HEVCSEIFilmGrainCharacteristics::matrix_coeffs
int matrix_coeffs
Definition: hevc_sei.h:126
HEVCSEI::display_orientation
HEVCSEIDisplayOrientation display_orientation
Definition: hevc_sei.h:141
HEVCSEITimeCode::present
int present
Definition: hevc_sei.h:98
HEVCSEITimeCode::time_offset_value
int32_t time_offset_value[3]
Definition: hevc_sei.h:114
HEVCSEIFramePacking::current_frame_is_frame0_flag
int current_frame_is_frame0_flag
Definition: hevc_sei.h:48
HEVCSEIAlternativeTransfer::present
int present
Definition: hevc_sei.h:93
ff_hevc_reset_sei
void ff_hevc_reset_sei(HEVCSEI *s)
Reset SEI values that are stored on the Context.
Definition: hevc_sei.c:570
HEVCSEIMasteringDisplay::display_primaries
uint16_t display_primaries[3][2]
Definition: hevc_sei.h:72
HEVCSEITimeCode
Definition: hevc_sei.h:97
HEVCSEIA53Caption
Definition: hevc_sei.h:61
GetBitContext
Definition: get_bits.h:61
ff_hevc_decode_nal_sei
int ff_hevc_decode_nal_sei(GetBitContext *gb, void *logctx, HEVCSEI *s, const struct HEVCParamSets *ps, enum HEVCNALUnitType type)
HEVCSEIFilmGrainCharacteristics::present
int present
Definition: hevc_sei.h:118
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
HEVCSEIFilmGrainCharacteristics::bit_depth_chroma
int bit_depth_chroma
Definition: hevc_sei.h:122
HEVCSEIFilmGrainCharacteristics::log2_scale_factor
int log2_scale_factor
Definition: hevc_sei.h:128
HEVCSEIMasteringDisplay::min_luminance
uint32_t min_luminance
Definition: hevc_sei.h:75
HEVCSEITimeCode::minutes_value
uint8_t minutes_value[3]
Definition: hevc_sei.h:108
HEVCSEIDynamicHDRPlus::info
AVBufferRef * info
Definition: hevc_sei.h:79
HEVCSEIFilmGrainCharacteristics::full_range
int full_range
Definition: hevc_sei.h:123
HEVCSEI::dynamic_hdr_vivid
HEVCSEIDynamicHDRVivid dynamic_hdr_vivid
Definition: hevc_sei.h:147
s
#define s(width, name)
Definition: cbs_vp9.c:256
HEVCSEI::mastering_display
HEVCSEIMasteringDisplay mastering_display
Definition: hevc_sei.h:145
HEVCSEIFilmGrainCharacteristics::num_intensity_intervals
uint16_t num_intensity_intervals[3]
Definition: hevc_sei.h:130
HEVCSEI
Definition: hevc_sei.h:138
HEVCSEIMasteringDisplay
Definition: hevc_sei.h:70
HEVCSEIPictureHash
Definition: hevc_sei.h:38
HEVCSEIFilmGrainCharacteristics::model_id
int model_id
Definition: hevc_sei.h:119
get_bits.h
HEVCSEIUnregistered::buf_ref
AVBufferRef ** buf_ref
Definition: hevc_sei.h:66
HEVCSEIFramePacking
Definition: hevc_sei.h:43
HEVCSEI::unregistered
HEVCSEIUnregistered unregistered
Definition: hevc_sei.h:144
HEVC_SEI_PIC_STRUCT_FRAME_TRIPLING
@ HEVC_SEI_PIC_STRUCT_FRAME_TRIPLING
Definition: hevc_sei.h:35
HEVCSEIMasteringDisplay::white_point
uint16_t white_point[2]
Definition: hevc_sei.h:73
HEVCSEITimeCode::num_clock_ts
uint8_t num_clock_ts
Definition: hevc_sei.h:99
HEVCSEIMasteringDisplay::present
int present
Definition: hevc_sei.h:71
HEVCSEITimeCode::seconds_value
uint8_t seconds_value[3]
Definition: hevc_sei.h:107
HEVCSEIFilmGrainCharacteristics::separate_colour_description_present_flag
int separate_colour_description_present_flag
Definition: hevc_sei.h:120
sei.h
HEVCSEIFilmGrainCharacteristics::color_primaries
int color_primaries
Definition: hevc_sei.h:124
HEVCSEIDisplayOrientation
Definition: hevc_sei.h:51
HEVC_SEI_PicStructType
HEVC_SEI_PicStructType
Definition: hevc_sei.h:33
HEVCSEI::content_light
HEVCSEIContentLight content_light
Definition: hevc_sei.h:148
HEVCSEIFilmGrainCharacteristics::intensity_interval_lower_bound
uint8_t intensity_interval_lower_bound[3][256]
Definition: hevc_sei.h:132
HEVCSEIPictureHash::md5
uint8_t md5[3][16]
Definition: hevc_sei.h:39
HEVCSEI::film_grain_characteristics
HEVCSEIFilmGrainCharacteristics film_grain_characteristics
Definition: hevc_sei.h:152
HEVCSEIFilmGrainCharacteristics::blending_mode_id
int blending_mode_id
Definition: hevc_sei.h:127
HEVCSEIContentLight::present
int present
Definition: hevc_sei.h:87
HEVCSEIFilmGrainCharacteristics::intensity_interval_upper_bound
uint8_t intensity_interval_upper_bound[3][256]
Definition: hevc_sei.h:133
HEVCSEI::dynamic_hdr_plus
HEVCSEIDynamicHDRPlus dynamic_hdr_plus
Definition: hevc_sei.h:146
HEVCSEIDisplayOrientation::anticlockwise_rotation
int anticlockwise_rotation
Definition: hevc_sei.h:53
HEVCSEITimeCode::hours_flag
uint8_t hours_flag[3]
Definition: hevc_sei.h:112
HEVC_SEI_PIC_STRUCT_FRAME_DOUBLING
@ HEVC_SEI_PIC_STRUCT_FRAME_DOUBLING
Definition: hevc_sei.h:34
buffer.h
HEVCSEIFramePacking::quincunx_subsampling
int quincunx_subsampling
Definition: hevc_sei.h:47
HEVCSEITimeCode::seconds_flag
uint8_t seconds_flag[3]
Definition: hevc_sei.h:110
HEVCSEITimeCode::discontinuity_flag
uint8_t discontinuity_flag[3]
Definition: hevc_sei.h:104
HEVCSEIDisplayOrientation::hflip
int hflip
Definition: hevc_sei.h:54
HEVCSEIDynamicHDRPlus
Definition: hevc_sei.h:78
HEVCSEITimeCode::clock_timestamp_flag
uint8_t clock_timestamp_flag[3]
Definition: hevc_sei.h:100
HEVCSEITimeCode::counting_type
uint8_t counting_type[3]
Definition: hevc_sei.h:102
HEVCNALUnitType
HEVCNALUnitType
Table 7-1 – NAL unit type codes and NAL unit type classes in T-REC-H.265-201802.
Definition: hevc.h:28
HEVCSEIDynamicHDRVivid::info
AVBufferRef * info
Definition: hevc_sei.h:83
HEVCSEIA53Caption::buf_ref
AVBufferRef * buf_ref
Definition: hevc_sei.h:62
hevc.h
HEVCSEIPictureTiming::picture_struct
int picture_struct
Definition: hevc_sei.h:58
HEVCSEI::picture_hash
HEVCSEIPictureHash picture_hash
Definition: hevc_sei.h:139
HEVCSEIFramePacking::present
int present
Definition: hevc_sei.h:44
HEVCSEIMasteringDisplay::max_luminance
uint32_t max_luminance
Definition: hevc_sei.h:74
HEVCSEIFilmGrainCharacteristics::comp_model_value
int16_t comp_model_value[3][256][6]
Definition: hevc_sei.h:134
HEVCSEITimeCode::units_field_based_flag
uint8_t units_field_based_flag[3]
Definition: hevc_sei.h:101
HEVCSEI::frame_packing
HEVCSEIFramePacking frame_packing
Definition: hevc_sei.h:140
HEVCSEITimeCode::minutes_flag
uint8_t minutes_flag[3]
Definition: hevc_sei.h:111
HEVCSEIFilmGrainCharacteristics::transfer_characteristics
int transfer_characteristics
Definition: hevc_sei.h:125
HEVCSEIDynamicHDRVivid
Definition: hevc_sei.h:82
HEVCSEIContentLight::max_pic_average_light_level
uint16_t max_pic_average_light_level
Definition: hevc_sei.h:89
HEVCSEIFilmGrainCharacteristics::num_model_values
uint8_t num_model_values[3]
Definition: hevc_sei.h:131
HEVCSEI::timecode
HEVCSEITimeCode timecode
Definition: hevc_sei.h:151
HEVCSEIUnregistered::nb_buf_ref
int nb_buf_ref
Definition: hevc_sei.h:67
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:82
HEVCSEITimeCode::n_frames
uint16_t n_frames[3]
Definition: hevc_sei.h:106
HEVCSEITimeCode::full_timestamp_flag
uint8_t full_timestamp_flag[3]
Definition: hevc_sei.h:103
HEVCSEITimeCode::hours_value
uint8_t hours_value[3]
Definition: hevc_sei.h:109
HEVCSEI::a53_caption
HEVCSEIA53Caption a53_caption
Definition: hevc_sei.h:143
HEVCSEIContentLight
Definition: hevc_sei.h:86
int32_t
int32_t
Definition: audioconvert.c:56
HEVCSEIDisplayOrientation::present
int present
Definition: hevc_sei.h:52
HEVCSEIContentLight::max_content_light_level
uint16_t max_content_light_level
Definition: hevc_sei.h:88
HEVCSEIAlternativeTransfer::preferred_transfer_characteristics
int preferred_transfer_characteristics
Definition: hevc_sei.h:94
HEVCSEIFilmGrainCharacteristics::bit_depth_luma
int bit_depth_luma
Definition: hevc_sei.h:121
HEVCSEIFramePacking::arrangement_type
int arrangement_type
Definition: hevc_sei.h:45
HEVCSEIPictureTiming
Definition: hevc_sei.h:57
HEVCSEIFramePacking::content_interpretation_type
int content_interpretation_type
Definition: hevc_sei.h:46
HEVCSEIFilmGrainCharacteristics
Definition: hevc_sei.h:117
HEVCSEIFilmGrainCharacteristics::persistence_flag
int persistence_flag
Definition: hevc_sei.h:135
HEVCSEI::alternative_transfer
HEVCSEIAlternativeTransfer alternative_transfer
Definition: hevc_sei.h:150
HEVCParamSets
Definition: hevc_ps.h:327