1 /*
2 * Copyright (c) 2021 Limin Wang <lance.lmwang at gmail.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 #ifndef AVUTIL_HDR_DYNAMIC_VIVID_METADATA_H
22 #define AVUTIL_HDR_DYNAMIC_VIVID_METADATA_H
23
26
27 /**
28 * HDR Vivid three spline params.
29 */
31 /**
32 * The mode of three Spline. the value shall be in the range
33 * of 0 to 3, inclusive.
34 */
36
37 /**
38 * three_Spline_TH_enable_MB is in the range of 0.0 to 1.0, inclusive
39 * and in multiples of 1.0/255.
40 *
41 */
43
44 /**
45 * 3Spline_TH_enable of three Spline.
46 * The value shall be in the range of 0.0 to 1.0, inclusive.
47 * and in multiples of 1.0/4095.
48 */
50
51 /**
52 * 3Spline_TH_Delta1 of three Spline.
53 * The value shall be in the range of 0.0 to 0.25, inclusive,
54 * and in multiples of 0.25/1023.
55 */
57
58 /**
59 * 3Spline_TH_Delta2 of three Spline.
60 * The value shall be in the range of 0.0 to 0.25, inclusive,
61 * and in multiples of 0.25/1023.
62 */
64
65 /**
66 * 3Spline_enable_Strength of three Spline.
67 * The value shall be in the range of 0.0 to 1.0, inclusive,
68 * and in multiples of 1.0/255.
69 */
72
73 /**
74 * Color tone mapping parameters at a processing window in a dynamic metadata for
75 * CUVA 005.1:2021.
76 */
78 /**
79 * The nominal maximum display luminance of the targeted system display,
80 * in multiples of 1.0/4095 candelas per square metre. The value shall be in
81 * the range of 0.0 to 1.0, inclusive.
82 */
84
85 /**
86 * This flag indicates that transfer the base parameter(for value of 1)
87 */
89
90 /**
91 * base_param_m_p in the base parameter,
92 * in multiples of 1.0/16383. The value shall be in
93 * the range of 0.0 to 1.0, inclusive.
94 */
96
97 /**
98 * base_param_m_m in the base parameter,
99 * in multiples of 1.0/10. The value shall be in
100 * the range of 0.0 to 6.3, inclusive.
101 */
103
104 /**
105 * base_param_m_a in the base parameter,
106 * in multiples of 1.0/1023. The value shall be in
107 * the range of 0.0 to 1.0 inclusive.
108 */
110
111 /**
112 * base_param_m_b in the base parameter,
113 * in multiples of 1/1023. The value shall be in
114 * the range of 0.0 to 1.0, inclusive.
115 */
117
118 /**
119 * base_param_m_n in the base parameter,
120 * in multiples of 1.0/10. The value shall be in
121 * the range of 0.0 to 6.3, inclusive.
122 */
124
125 /**
126 * indicates k1_0 in the base parameter,
127 * base_param_k1 <= 1: k1_0 = base_param_k1
128 * base_param_k1 > 1: reserved
129 */
131
132 /**
133 * indicates k2_0 in the base parameter,
134 * base_param_k2 <= 1: k2_0 = base_param_k2
135 * base_param_k2 > 1: reserved
136 */
138
139 /**
140 * indicates k3_0 in the base parameter,
141 * base_param_k3 == 1: k3_0 = base_param_k3
142 * base_param_k3 == 2: k3_0 = maximum_maxrgb
143 * base_param_k3 > 2: reserved
144 */
146
147 /**
148 * This flag indicates that delta mode of base parameter(for value of 1)
149 */
151
152 /**
153 * base_param_Delta in the base parameter,
154 * in multiples of 1.0/127. The value shall be in
155 * the range of 0.0 to 1.0, inclusive.
156 */
158
159 /**
160 * indicates 3Spline_enable_flag in the base parameter,
161 * This flag indicates that transfer three Spline of base parameter(for value of 1)
162 */
164
165 /**
166 * The number of three Spline. The value shall be in the range
167 * of 1 to 2, inclusive.
168 */
170
173
174
175 /**
176 * Color transform parameters at a processing window in a dynamic metadata for
177 * CUVA 005.1:2021.
178 */
180 /**
181 * Indicates the minimum brightness of the displayed content.
182 * The values should be in the range of 0.0 to 1.0,
183 * inclusive and in multiples of 1/4095.
184 */
186
187 /**
188 * Indicates the average brightness of the displayed content.
189 * The values should be in the range of 0.0 to 1.0,
190 * inclusive and in multiples of 1/4095.
191 */
193
194 /**
195 * Indicates the variance brightness of the displayed content.
196 * The values should be in the range of 0.0 to 1.0,
197 * inclusive and in multiples of 1/4095.
198 */
200
201 /**
202 * Indicates the maximum brightness of the displayed content.
203 * The values should be in the range of 0.0 to 1.0, inclusive
204 * and in multiples of 1/4095.
205 */
207
208 /**
209 * This flag indicates that the metadata for the tone mapping function in
210 * the processing window is present (for value of 1).
211 */
213
214 /**
215 * The number of tone mapping param. The value shall be in the range
216 * of 1 to 2, inclusive.
217 */
219
220 /**
221 * The color tone mapping parameters.
222 */
224
225 /**
226 * This flag indicates that the metadata for the color saturation mapping in
227 * the processing window is present (for value of 1).
228 */
230
231 /**
232 * The number of color saturation param. The value shall be in the range
233 * of 0 to 7, inclusive.
234 */
236
237 /**
238 * Indicates the color correction strength parameter.
239 * The values should be in the range of 0.0 to 2.0, inclusive
240 * and in multiples of 1/128.
241 */
244
245 /**
246 * This struct represents dynamic metadata for color volume transform -
247 * CUVA 005.1:2021 standard
248 *
249 * To be used as payload of a AVFrameSideData or AVPacketSideData with the
250 * appropriate type.
251 *
252 * @note The struct should be allocated with
253 * av_dynamic_hdr_vivid_alloc() and its size is not a part of
254 * the public ABI.
255 */
257 /**
258 * The system start code. The value shall be set to 0x01.
259 */
261
262 /**
263 * The number of processing windows. The value shall be set to 0x01
264 * if the system_start_code is 0x01.
265 */
267
268 /**
269 * The color transform parameters for every processing window.
270 */
273
274 /**
275 * Allocate an AVDynamicHDRVivid structure and set its fields to
276 * default values. The resulting struct can be freed using av_freep().
277 *
278 * @return An AVDynamicHDRVivid filled with default values or NULL
279 * on failure.
280 */
282
283 /**
284 * Allocate a complete AVDynamicHDRVivid and add it to the frame.
285 * @param frame The frame which side data is added to.
286 *
287 * @return The AVDynamicHDRVivid structure to be filled by caller or NULL
288 * on failure.
289 */
291
292 #endif /* AVUTIL_HDR_DYNAMIC_VIVID_METADATA_H */