FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/libavcodec/hevc_sei.h
Date: 2024-04-19 17:50:32
Exec Total Coverage
Lines: 3 3 100.0%
Functions: 1 1 100.0%
Branches: 0 0 -%

Line Branch Exec Source
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 {
35 HEVC_SEI_PIC_STRUCT_FRAME_DOUBLING = 7,
36 HEVC_SEI_PIC_STRUCT_FRAME_TRIPLING = 8
37 } HEVC_SEI_PicStructType;
38
39 typedef struct HEVCSEIPictureHash {
40 uint8_t md5[3][16];
41 uint8_t is_md5;
42 } HEVCSEIPictureHash;
43
44 typedef struct HEVCSEIFramePacking {
45 int present;
46 int arrangement_type;
47 int content_interpretation_type;
48 int quincunx_subsampling;
49 int current_frame_is_frame0_flag;
50 } HEVCSEIFramePacking;
51
52 typedef struct HEVCSEIPictureTiming {
53 int picture_struct;
54 } HEVCSEIPictureTiming;
55
56 typedef struct HEVCSEIAlternativeTransfer {
57 int present;
58 int preferred_transfer_characteristics;
59 } HEVCSEIAlternativeTransfer;
60
61 typedef struct HEVCSEITimeCode {
62 int present;
63 uint8_t num_clock_ts;
64 uint8_t clock_timestamp_flag[3];
65 uint8_t units_field_based_flag[3];
66 uint8_t counting_type[3];
67 uint8_t full_timestamp_flag[3];
68 uint8_t discontinuity_flag[3];
69 uint8_t cnt_dropped_flag[3];
70 uint16_t n_frames[3];
71 uint8_t seconds_value[3];
72 uint8_t minutes_value[3];
73 uint8_t hours_value[3];
74 uint8_t seconds_flag[3];
75 uint8_t minutes_flag[3];
76 uint8_t hours_flag[3];
77 uint8_t time_offset_length[3];
78 int32_t time_offset_value[3];
79 } HEVCSEITimeCode;
80
81 typedef struct HEVCSEI {
82 H2645SEI common;
83 HEVCSEIPictureHash picture_hash;
84 HEVCSEIPictureTiming picture_timing;
85 int active_seq_parameter_set_id;
86 HEVCSEITimeCode timecode;
87 } HEVCSEI;
88
89 struct HEVCParamSets;
90
91 int ff_hevc_decode_nal_sei(GetBitContext *gb, void *logctx, HEVCSEI *s,
92 const struct HEVCParamSets *ps, enum HEVCNALUnitType type);
93
94 static inline int ff_hevc_sei_ctx_replace(HEVCSEI *dst, const HEVCSEI *src)
95 {
96 return ff_h2645_sei_ctx_replace(&dst->common, &src->common);
97 }
98
99 /**
100 * Reset SEI values that are stored on the Context.
101 * e.g. Caption data that was extracted during NAL
102 * parsing.
103 *
104 * @param sei HEVCSEI.
105 */
106 12919 static inline void ff_hevc_reset_sei(HEVCSEI *sei)
107 {
108 12919 ff_h2645_sei_reset(&sei->common);
109 12919 }
110
111 #endif /* AVCODEC_HEVC_SEI_H */
112