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 "h2645_sei.h"
31 #include "sei.h"
32 
33 
34 typedef enum {
38 
39 typedef struct HEVCSEIPictureHash {
40  uint8_t md5[3][16];
41  uint8_t is_md5;
43 
44 typedef struct HEVCSEIFramePacking {
45  int present;
51 
52 typedef struct HEVCSEIPictureTiming {
55 
56 typedef struct HEVCSEIMasteringDisplay {
57  int present;
58  uint16_t display_primaries[3][2];
59  uint16_t white_point[2];
60  uint32_t max_luminance;
61  uint32_t min_luminance;
63 
64 typedef struct HEVCSEIContentLight {
65  int present;
69 
71  int present;
74 
75 typedef struct HEVCSEITimeCode {
76  int present;
77  uint8_t num_clock_ts;
80  uint8_t counting_type[3];
81  uint8_t full_timestamp_flag[3];
82  uint8_t discontinuity_flag[3];
83  uint8_t cnt_dropped_flag[3];
84  uint16_t n_frames[3];
85  uint8_t seconds_value[3];
86  uint8_t minutes_value[3];
87  uint8_t hours_value[3];
88  uint8_t seconds_flag[3];
89  uint8_t minutes_flag[3];
90  uint8_t hours_flag[3];
91  uint8_t time_offset_length[3];
94 
95 typedef struct HEVCSEI {
103 } HEVCSEI;
104 
105 struct HEVCParamSets;
106 
107 int ff_hevc_decode_nal_sei(GetBitContext *gb, void *logctx, HEVCSEI *s,
108  const struct HEVCParamSets *ps, enum HEVCNALUnitType type);
109 
110 static inline int ff_hevc_sei_ctx_replace(HEVCSEI *dst, const HEVCSEI *src)
111 {
112  return ff_h2645_sei_ctx_replace(&dst->common, &src->common);
113 }
114 
115 /**
116  * Reset SEI values that are stored on the Context.
117  * e.g. Caption data that was extracted during NAL
118  * parsing.
119  *
120  * @param sei HEVCSEI.
121  */
122 static inline void ff_hevc_reset_sei(HEVCSEI *sei)
123 {
124  ff_h2645_sei_reset(&sei->common);
125 }
126 
127 #endif /* AVCODEC_HEVC_SEI_H */
HEVCSEI::active_seq_parameter_set_id
int active_seq_parameter_set_id
Definition: hevc_sei.h:101
HEVCSEIAlternativeTransfer
Definition: hevc_sei.h:70
HEVCSEI::picture_timing
HEVCSEIPictureTiming picture_timing
Definition: hevc_sei.h:98
HEVCSEITimeCode::cnt_dropped_flag
uint8_t cnt_dropped_flag[3]
Definition: hevc_sei.h:83
HEVCSEIPictureHash::is_md5
uint8_t is_md5
Definition: hevc_sei.h:41
HEVCSEITimeCode::time_offset_length
uint8_t time_offset_length[3]
Definition: hevc_sei.h:91
HEVCSEITimeCode::present
int present
Definition: hevc_sei.h:76
HEVCSEITimeCode::time_offset_value
int32_t time_offset_value[3]
Definition: hevc_sei.h:92
HEVCSEIFramePacking::current_frame_is_frame0_flag
int current_frame_is_frame0_flag
Definition: hevc_sei.h:49
HEVCSEIAlternativeTransfer::present
int present
Definition: hevc_sei.h:71
HEVCSEIMasteringDisplay::display_primaries
uint16_t display_primaries[3][2]
Definition: hevc_sei.h:58
HEVCSEITimeCode
Definition: hevc_sei.h:75
GetBitContext
Definition: get_bits.h:107
ff_hevc_decode_nal_sei
int ff_hevc_decode_nal_sei(GetBitContext *gb, void *logctx, HEVCSEI *s, const struct HEVCParamSets *ps, enum HEVCNALUnitType type)
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
HEVCSEIMasteringDisplay::min_luminance
uint32_t min_luminance
Definition: hevc_sei.h:61
HEVCSEITimeCode::minutes_value
uint8_t minutes_value[3]
Definition: hevc_sei.h:86
s
#define s(width, name)
Definition: cbs_vp9.c:256
HEVCSEI::mastering_display
HEVCSEIMasteringDisplay mastering_display
Definition: hevc_sei.h:99
HEVCSEI::common
H2645SEI common
Definition: hevc_sei.h:96
HEVCSEI
Definition: hevc_sei.h:95
HEVCSEIMasteringDisplay
Definition: hevc_sei.h:56
HEVCSEIPictureHash
Definition: hevc_sei.h:39
get_bits.h
HEVCSEIFramePacking
Definition: hevc_sei.h:44
HEVC_SEI_PIC_STRUCT_FRAME_TRIPLING
@ HEVC_SEI_PIC_STRUCT_FRAME_TRIPLING
Definition: hevc_sei.h:36
HEVCSEIMasteringDisplay::white_point
uint16_t white_point[2]
Definition: hevc_sei.h:59
HEVCSEITimeCode::num_clock_ts
uint8_t num_clock_ts
Definition: hevc_sei.h:77
HEVCSEIMasteringDisplay::present
int present
Definition: hevc_sei.h:57
HEVCSEITimeCode::seconds_value
uint8_t seconds_value[3]
Definition: hevc_sei.h:85
sei.h
HEVC_SEI_PicStructType
HEVC_SEI_PicStructType
Definition: hevc_sei.h:34
H2645SEI
Definition: h2645_sei.h:108
HEVCSEI::content_light
HEVCSEIContentLight content_light
Definition: hevc_sei.h:100
HEVCSEIPictureHash::md5
uint8_t md5[3][16]
Definition: hevc_sei.h:40
sei
static int FUNC() sei(CodedBitstreamContext *ctx, RWContext *rw, H264RawSEI *current)
Definition: cbs_h264_syntax_template.c:825
HEVCSEIContentLight::present
int present
Definition: hevc_sei.h:65
h2645_sei.h
HEVCSEITimeCode::hours_flag
uint8_t hours_flag[3]
Definition: hevc_sei.h:90
HEVC_SEI_PIC_STRUCT_FRAME_DOUBLING
@ HEVC_SEI_PIC_STRUCT_FRAME_DOUBLING
Definition: hevc_sei.h:35
buffer.h
ff_h2645_sei_reset
void ff_h2645_sei_reset(H2645SEI *s)
Definition: h2645_sei.c:658
ff_hevc_sei_ctx_replace
static int ff_hevc_sei_ctx_replace(HEVCSEI *dst, const HEVCSEI *src)
Definition: hevc_sei.h:110
HEVCSEIFramePacking::quincunx_subsampling
int quincunx_subsampling
Definition: hevc_sei.h:48
HEVCSEITimeCode::seconds_flag
uint8_t seconds_flag[3]
Definition: hevc_sei.h:88
HEVCSEITimeCode::discontinuity_flag
uint8_t discontinuity_flag[3]
Definition: hevc_sei.h:82
HEVCSEITimeCode::clock_timestamp_flag
uint8_t clock_timestamp_flag[3]
Definition: hevc_sei.h:78
HEVCSEITimeCode::counting_type
uint8_t counting_type[3]
Definition: hevc_sei.h:80
HEVCNALUnitType
HEVCNALUnitType
Table 7-1 – NAL unit type codes and NAL unit type classes in T-REC-H.265-201802.
Definition: hevc.h:28
hevc.h
HEVCSEIPictureTiming::picture_struct
int picture_struct
Definition: hevc_sei.h:53
HEVCSEI::picture_hash
HEVCSEIPictureHash picture_hash
Definition: hevc_sei.h:97
HEVCSEIFramePacking::present
int present
Definition: hevc_sei.h:45
HEVCSEIMasteringDisplay::max_luminance
uint32_t max_luminance
Definition: hevc_sei.h:60
HEVCSEITimeCode::units_field_based_flag
uint8_t units_field_based_flag[3]
Definition: hevc_sei.h:79
HEVCSEITimeCode::minutes_flag
uint8_t minutes_flag[3]
Definition: hevc_sei.h:89
HEVCSEIContentLight::max_pic_average_light_level
uint16_t max_pic_average_light_level
Definition: hevc_sei.h:67
HEVCSEI::timecode
HEVCSEITimeCode timecode
Definition: hevc_sei.h:102
HEVCSEITimeCode::n_frames
uint16_t n_frames[3]
Definition: hevc_sei.h:84
HEVCSEITimeCode::full_timestamp_flag
uint8_t full_timestamp_flag[3]
Definition: hevc_sei.h:81
ff_h2645_sei_ctx_replace
int ff_h2645_sei_ctx_replace(H2645SEI *dst, const H2645SEI *src)
Definition: h2645_sei.c:420
HEVCSEITimeCode::hours_value
uint8_t hours_value[3]
Definition: hevc_sei.h:87
ff_hevc_reset_sei
static void ff_hevc_reset_sei(HEVCSEI *sei)
Reset SEI values that are stored on the Context.
Definition: hevc_sei.h:122
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
HEVCSEIContentLight
Definition: hevc_sei.h:64
int32_t
int32_t
Definition: audioconvert.c:56
HEVCSEIContentLight::max_content_light_level
uint16_t max_content_light_level
Definition: hevc_sei.h:66
HEVCSEIAlternativeTransfer::preferred_transfer_characteristics
int preferred_transfer_characteristics
Definition: hevc_sei.h:72
HEVCSEIFramePacking::arrangement_type
int arrangement_type
Definition: hevc_sei.h:46
HEVCSEIPictureTiming
Definition: hevc_sei.h:52
HEVCSEIFramePacking::content_interpretation_type
int content_interpretation_type
Definition: hevc_sei.h:47
HEVCParamSets
Definition: hevc_ps.h:314