FFmpeg
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 "libavcodec/get_bits.h"
29 #include "libavcodec/h2645_sei.h"
30 #include "libavcodec/sei.h"
31 
32 #include "hevc.h"
33 
34 
35 typedef enum {
39 
40 typedef struct HEVCSEIPictureHash {
41  uint8_t md5[3][16];
42  uint8_t is_md5;
44 
45 typedef struct HEVCSEIFramePacking {
46  int present;
52 
53 typedef struct HEVCSEIPictureTiming {
56 
58  int present;
61 
62 typedef struct HEVCSEITimeCode {
63  int present;
64  uint8_t num_clock_ts;
67  uint8_t counting_type[3];
68  uint8_t full_timestamp_flag[3];
69  uint8_t discontinuity_flag[3];
70  uint8_t cnt_dropped_flag[3];
71  uint16_t n_frames[3];
72  uint8_t seconds_value[3];
73  uint8_t minutes_value[3];
74  uint8_t hours_value[3];
75  uint8_t seconds_flag[3];
76  uint8_t minutes_flag[3];
77  uint8_t hours_flag[3];
78  uint8_t time_offset_length[3];
81 
82 typedef struct HEVCSEITDRDI {
87  uint16_t left_view_id[32];
88  uint16_t right_view_id[32];
94  int16_t num_sample_shift[32];
96 } HEVCSEITDRDI;
97 
98 typedef struct HEVCSEI {
105 } HEVCSEI;
106 
107 struct HEVCParamSets;
108 
109 int ff_hevc_decode_nal_sei(GetBitContext *gb, void *logctx, HEVCSEI *s,
110  const struct HEVCParamSets *ps, enum HEVCNALUnitType type);
111 
112 /**
113  * Reset SEI values that are stored on the Context.
114  * e.g. Caption data that was extracted during NAL
115  * parsing.
116  *
117  * @param sei HEVCSEI.
118  */
119 static inline void ff_hevc_reset_sei(HEVCSEI *sei)
120 {
121  ff_h2645_sei_reset(&sei->common);
122 }
123 
124 #endif /* AVCODEC_HEVC_SEI_H */
HEVCSEITDRDI::exponent_ref_viewing_distance
uint8_t exponent_ref_viewing_distance[32]
Definition: sei.h:91
HEVCSEI::active_seq_parameter_set_id
int active_seq_parameter_set_id
Definition: sei.h:102
HEVCSEIAlternativeTransfer
Definition: sei.h:57
HEVCSEI::picture_timing
HEVCSEIPictureTiming picture_timing
Definition: sei.h:101
HEVCSEITimeCode::cnt_dropped_flag
uint8_t cnt_dropped_flag[3]
Definition: sei.h:70
HEVCSEIPictureHash::is_md5
uint8_t is_md5
Definition: sei.h:42
HEVCSEITimeCode::time_offset_length
uint8_t time_offset_length[3]
Definition: sei.h:78
HEVCSEITimeCode::present
int present
Definition: sei.h:63
HEVCSEITimeCode::time_offset_value
int32_t time_offset_value[3]
Definition: sei.h:79
HEVC_SEI_PicStructType
HEVC_SEI_PicStructType
Definition: sei.h:35
HEVCSEIFramePacking::current_frame_is_frame0_flag
int current_frame_is_frame0_flag
Definition: sei.h:50
HEVCSEIAlternativeTransfer::present
int present
Definition: sei.h:58
HEVCSEITimeCode
Definition: sei.h:62
HEVC_SEI_PIC_STRUCT_FRAME_TRIPLING
@ HEVC_SEI_PIC_STRUCT_FRAME_TRIPLING
Definition: sei.h:37
GetBitContext
Definition: get_bits.h:108
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
HEVCSEITimeCode::minutes_value
uint8_t minutes_value[3]
Definition: sei.h:73
s
#define s(width, name)
Definition: cbs_vp9.c:198
HEVCNALUnitType
HEVCNALUnitType
Table 7-1 – NAL unit type codes and NAL unit type classes in T-REC-H.265-201802.
Definition: hevc.h:28
HEVCSEI::common
H2645SEI common
Definition: sei.h:99
HEVCSEI
Definition: sei.h:98
HEVCSEITDRDI::prec_ref_viewing_dist
uint8_t prec_ref_viewing_dist
Definition: sei.h:85
HEVCSEIPictureHash
Definition: sei.h:40
hevc.h
get_bits.h
HEVCSEITDRDI::additional_shift_present_flag
uint8_t additional_shift_present_flag[32]
Definition: sei.h:93
HEVCSEIFramePacking
Definition: sei.h:45
HEVCSEITimeCode::num_clock_ts
uint8_t num_clock_ts
Definition: sei.h:64
HEVCSEITimeCode::seconds_value
uint8_t seconds_value[3]
Definition: sei.h:72
sei.h
ff_hevc_reset_sei
static void ff_hevc_reset_sei(HEVCSEI *sei)
Reset SEI values that are stored on the Context.
Definition: sei.h:119
H2645SEI
Definition: h2645_sei.h:128
HEVCSEIPictureHash::md5
uint8_t md5[3][16]
Definition: sei.h:41
sei
static int FUNC() sei(CodedBitstreamContext *ctx, RWContext *rw, H264RawSEI *current)
Definition: cbs_h264_syntax_template.c:858
HEVCSEITDRDI::num_sample_shift
int16_t num_sample_shift[32]
Definition: sei.h:94
HEVCSEITDRDI
Definition: sei.h:82
h2645_sei.h
HEVCSEITDRDI::right_view_id
uint16_t right_view_id[32]
Definition: sei.h:88
HEVCSEITDRDI::left_view_id
uint16_t left_view_id[32]
Definition: sei.h:87
HEVCSEITimeCode::hours_flag
uint8_t hours_flag[3]
Definition: sei.h:77
HEVCSEITDRDI::three_dimensional_reference_displays_extension_flag
uint8_t three_dimensional_reference_displays_extension_flag
Definition: sei.h:95
buffer.h
ff_h2645_sei_reset
void ff_h2645_sei_reset(H2645SEI *s)
Definition: h2645_sei.c:921
HEVCSEIFramePacking::quincunx_subsampling
int quincunx_subsampling
Definition: sei.h:49
HEVCSEITimeCode::seconds_flag
uint8_t seconds_flag[3]
Definition: sei.h:75
HEVCSEITimeCode::discontinuity_flag
uint8_t discontinuity_flag[3]
Definition: sei.h:69
ff_hevc_decode_nal_sei
int ff_hevc_decode_nal_sei(GetBitContext *gb, void *logctx, HEVCSEI *s, const struct HEVCParamSets *ps, enum HEVCNALUnitType type)
HEVCSEITDRDI::num_ref_displays
uint8_t num_ref_displays
Definition: sei.h:86
HEVCSEITimeCode::clock_timestamp_flag
uint8_t clock_timestamp_flag[3]
Definition: sei.h:65
HEVCSEITimeCode::counting_type
uint8_t counting_type[3]
Definition: sei.h:67
HEVCSEI::tdrdi
HEVCSEITDRDI tdrdi
Definition: sei.h:104
HEVCSEIPictureTiming::picture_struct
int picture_struct
Definition: sei.h:54
HEVCSEITDRDI::exponent_ref_display_width
uint8_t exponent_ref_display_width[32]
Definition: sei.h:89
HEVCSEI::picture_hash
HEVCSEIPictureHash picture_hash
Definition: sei.h:100
HEVC_SEI_PIC_STRUCT_FRAME_DOUBLING
@ HEVC_SEI_PIC_STRUCT_FRAME_DOUBLING
Definition: sei.h:36
HEVCSEIFramePacking::present
int present
Definition: sei.h:46
HEVCSEITDRDI::mantissa_ref_viewing_distance
uint8_t mantissa_ref_viewing_distance[32]
Definition: sei.h:92
HEVCSEITDRDI::mantissa_ref_display_width
uint8_t mantissa_ref_display_width[32]
Definition: sei.h:90
HEVCSEITimeCode::units_field_based_flag
uint8_t units_field_based_flag[3]
Definition: sei.h:66
HEVCSEITimeCode::minutes_flag
uint8_t minutes_flag[3]
Definition: sei.h:76
HEVCSEI::timecode
HEVCSEITimeCode timecode
Definition: sei.h:103
HEVCSEITimeCode::n_frames
uint16_t n_frames[3]
Definition: sei.h:71
HEVCSEITimeCode::full_timestamp_flag
uint8_t full_timestamp_flag[3]
Definition: sei.h:68
HEVCSEITimeCode::hours_value
uint8_t hours_value[3]
Definition: sei.h:74
HEVCSEITDRDI::ref_viewing_distance_flag
uint8_t ref_viewing_distance_flag
Definition: sei.h:84
int32_t
int32_t
Definition: audioconvert.c:56
HEVCSEIAlternativeTransfer::preferred_transfer_characteristics
int preferred_transfer_characteristics
Definition: sei.h:59
HEVCSEIFramePacking::arrangement_type
int arrangement_type
Definition: sei.h:47
HEVCSEIPictureTiming
Definition: sei.h:53
HEVCSEIFramePacking::content_interpretation_type
int content_interpretation_type
Definition: sei.h:48
HEVCParamSets
Definition: ps.h:508
HEVCSEITDRDI::prec_ref_display_width
uint8_t prec_ref_display_width
Definition: sei.h:83