1 /*
2 * Copyright (c) 2020 Vacing Fang <vacingfang@tencent.com>
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 /**
22 * @file
23 * DOVI configuration
24 */
25
26
27 #ifndef AVUTIL_DOVI_META_H
28 #define AVUTIL_DOVI_META_H
29
30 #include <stdint.h>
31 #include <stddef.h>
33
34 /*
35 * DOVI configuration
36 * ref: dolby-vision-bitstreams-within-the-iso-base-media-file-format-v2.1.2
37 dolby-vision-bitstreams-in-mpeg-2-transport-stream-multiplex-v1.2
38 * @code
39 * uint8_t dv_version_major, the major version number that the stream complies with
40 * uint8_t dv_version_minor, the minor version number that the stream complies with
41 * uint8_t dv_profile, the Dolby Vision profile
42 * uint8_t dv_level, the Dolby Vision level
43 * uint8_t rpu_present_flag
44 * uint8_t el_present_flag
45 * uint8_t bl_present_flag
46 * uint8_t dv_bl_signal_compatibility_id
47 * @endcode
48 *
49 * @note The struct must be allocated with av_dovi_alloc() and
50 * its size is not a part of the public ABI.
51 */
62
63 /**
64 * Allocate a AVDOVIDecoderConfigurationRecord structure and initialize its
65 * fields to default values.
66 *
67 * @return the newly allocated struct or NULL on failure
68 */
70
71 /**
72 * Dolby Vision RPU data header.
73 *
74 * @note sizeof(AVDOVIRpuDataHeader) is not part of the public ABI.
75 */
93
97 };
98
99 /**
100 * Coefficients of a piece-wise function. The pieces of the function span the
101 * value ranges between two adjacent pivot values.
102 */
103 #define AV_DOVI_MAX_PIECES 8
108 /* AV_DOVI_MAPPING_POLYNOMIAL */
111 /* AV_DOVI_MAPPING_MMR */
116
120 };
121
122 /**
123 * Coefficients of the non-linear inverse quantization. For the interpretation
124 * of these, see ETSI GS CCM 001.
125 */
129 /* AV_DOVI_NLQ_LINEAR_DZ */
133
134 /**
135 * Dolby Vision RPU data mapping parameters.
136 *
137 * @note sizeof(AVDOVIDataMapping) is not part of the public ABI.
138 */
144
145 /* Non-linear inverse quantization */
151
152 /**
153 * Dolby Vision RPU colorspace metadata parameters.
154 *
155 * @note sizeof(AVDOVIColorMetadata) is not part of the public ABI.
156 */
160
161 /**
162 * Coefficients of the custom Dolby Vision IPT-PQ matrices. These are to be
163 * used instead of the matrices indicated by the frame's colorspace tags.
164 * The output of rgb_to_lms_matrix is to be fed into a BT.2020 LMS->RGB
165 * matrix based on a Hunt-Pointer-Estevez transform, but without any
166 * crosstalk. (See the definition of the ICtCp colorspace for more
167 * information.)
168 */
172
173 /**
174 * Extra signal metadata (see Dolby patents for more info).
175 */
188
189 /**
190 * Combined struct representing a combination of header, mapping and color
191 * metadata, for attaching to frames as side data.
192 *
193 * @note The struct must be allocated with av_dovi_metadata_alloc() and
194 * its size is not a part of the public ABI.
195 */
196
198 /**
199 * Offset in bytes from the beginning of this structure at which the
200 * respective structs start.
201 */
206
209 {
211 }
212
215 {
217 }
218
221 {
223 }
224
225 /**
226 * Allocate an AVDOVIMetadata structure and initialize its
227 * fields to default values.
228 *
229 * @param size If this parameter is non-NULL, the size in bytes of the
230 * allocated struct will be written here on success
231 *
232 * @return the newly allocated struct or NULL on failure
233 */
235
236 #endif /* AVUTIL_DOVI_META_H */