FFmpeg
hdr_dynamic_vivid_metadata.h
Go to the documentation of this file.
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 
24 #include "frame.h"
25 #include "rational.h"
26 
27 /**
28  * Color tone mapping parameters at a processing window in a dynamic metadata for
29  * CUVA 005.1:2021.
30  */
32  /**
33  * The nominal maximum display luminance of the targeted system display,
34  * in multiples of 1.0/4095 candelas per square metre. The value shall be in
35  * the range of 0.0 to 1.0, inclusive.
36  */
38 
39  /**
40  * This flag indicates that transfer the base paramter(for value of 1)
41  */
43 
44  /**
45  * base_param_m_p in the base parameter,
46  * in multiples of 1.0/16383. The value shall be in
47  * the range of 0.0 to 1.0, inclusive.
48  */
50 
51  /**
52  * base_param_m_m in the base parameter,
53  * in multiples of 1.0/10. The value shall be in
54  * the range of 0.0 to 6.3, inclusive.
55  */
57 
58  /**
59  * base_param_m_a in the base parameter,
60  * in multiples of 1.0/1023. The value shall be in
61  * the range of 0.0 to 1.0 inclusive.
62  */
64 
65  /**
66  * base_param_m_b in the base parameter,
67  * in multiples of 1/1023. The value shall be in
68  * the range of 0.0 to 1.0, inclusive.
69  */
71 
72  /**
73  * base_param_m_n in the base parameter,
74  * in multiples of 1.0/10. The value shall be in
75  * the range of 0.0 to 6.3, inclusive.
76  */
78 
79  /**
80  * indicates k1_0 in the base parameter,
81  * base_param_k1 <= 1: k1_0 = base_param_k1
82  * base_param_k1 > 1: reserved
83  */
85 
86  /**
87  * indicates k2_0 in the base parameter,
88  * base_param_k2 <= 1: k2_0 = base_param_k2
89  * base_param_k2 > 1: reserved
90  */
92 
93  /**
94  * indicates k3_0 in the base parameter,
95  * base_param_k3 == 1: k3_0 = base_param_k3
96  * base_param_k3 == 2: k3_0 = maximum_maxrgb
97  * base_param_k3 > 2: reserved
98  */
100 
101  /**
102  * This flag indicates that delta mode of base paramter(for value of 1)
103  */
105 
106  /**
107  * base_param_Delta in the base parameter,
108  * in multiples of 1.0/127. The value shall be in
109  * the range of 0.0 to 1.0, inclusive.
110  */
112 
113  /**
114  * indicates 3Spline_enable_flag in the base parameter,
115  * This flag indicates that transfer three Spline of base paramter(for value of 1)
116  */
118 
119  /**
120  * The number of three Spline. The value shall be in the range
121  * of 1 to 2, inclusive.
122  */
124 
125  /**
126  * The mode of three Spline. the value shall be in the range
127  * of 0 to 3, inclusive.
128  */
130 
131  /**
132  * three_Spline_TH_enable_MB is in the range of 0.0 to 1.0, inclusive
133  * and in multiples of 1.0/255.
134  *
135  */
137 
138  /**
139  * 3Spline_TH_enable of three Spline.
140  * The value shall be in the range of 0.0 to 1.0, inclusive.
141  * and in multiples of 1.0/4095.
142  */
144 
145  /**
146  * 3Spline_TH_Delta1 of three Spline.
147  * The value shall be in the range of 0.0 to 0.25, inclusive,
148  * and in multiples of 0.25/1023.
149  */
151 
152  /**
153  * 3Spline_TH_Delta2 of three Spline.
154  * The value shall be in the range of 0.0 to 0.25, inclusive,
155  * and in multiples of 0.25/1023.
156  */
158 
159  /**
160  * 3Spline_enable_Strength of three Spline.
161  * The value shall be in the range of 0.0 to 1.0, inclusive,
162  * and in multiples of 1.0/255.
163  */
166 
167 
168 /**
169  * Color transform parameters at a processing window in a dynamic metadata for
170  * CUVA 005.1:2021.
171  */
173  /**
174  * Indicates the minimum brightness of the displayed content.
175  * The values should be in the range of 0.0 to 1.0,
176  * inclusive and in multiples of 1/4095.
177  */
179 
180  /**
181  * Indicates the average 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 variance 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 maximum brightness of the displayed content.
196  * The values should be in the range of 0.0 to 1.0, inclusive
197  * and in multiples of 1/4095.
198  */
200 
201  /**
202  * This flag indicates that the metadata for the tone mapping function in
203  * the processing window is present (for value of 1).
204  */
206 
207  /**
208  * The number of tone mapping param. The value shall be in the range
209  * of 1 to 2, inclusive.
210  */
212 
213  /**
214  * The color tone mapping parameters.
215  */
217 
218  /**
219  * This flag indicates that the metadata for the color saturation mapping in
220  * the processing window is present (for value of 1).
221  */
223 
224  /**
225  * The number of color saturation param. The value shall be in the range
226  * of 0 to 7, inclusive.
227  */
229 
230  /**
231  * Indicates the color correction strength parameter.
232  * The values should be in the range of 0.0 to 2.0, inclusive
233  * and in multiples of 1/128.
234  */
237 
238 /**
239  * This struct represents dynamic metadata for color volume transform -
240  * CUVA 005.1:2021 standard
241  *
242  * To be used as payload of a AVFrameSideData or AVPacketSideData with the
243  * appropriate type.
244  *
245  * @note The struct should be allocated with
246  * av_dynamic_hdr_vivid_alloc() and its size is not a part of
247  * the public ABI.
248  */
249 typedef struct AVDynamicHDRVivid {
250  /**
251  * The system start code. The value shall be set to 0x01.
252  */
254 
255  /**
256  * The number of processing windows. The value shall be set to 0x01
257  * if the system_start_code is 0x01.
258  */
259  uint8_t num_windows;
260 
261  /**
262  * The color transform parameters for every processing window.
263  */
266 
267 /**
268  * Allocate an AVDynamicHDRVivid structure and set its fields to
269  * default values. The resulting struct can be freed using av_freep().
270  *
271  * @return An AVDynamicHDRVivid filled with default values or NULL
272  * on failure.
273  */
275 
276 /**
277  * Allocate a complete AVDynamicHDRVivid and add it to the frame.
278  * @param frame The frame which side data is added to.
279  *
280  * @return The AVDynamicHDRVivid structure to be filled by caller or NULL
281  * on failure.
282  */
284 
285 #endif /* AVUTIL_HDR_DYNAMIC_VIVID_METADATA_H */
AVHDRVividColorTransformParams::maximum_maxrgb
AVRational maximum_maxrgb
Indicates the maximum brightness of the displayed content.
Definition: hdr_dynamic_vivid_metadata.h:199
AVHDRVividColorToneMappingParams::base_param_k2
int base_param_k2
indicates k2_0 in the base parameter, base_param_k2 <= 1: k2_0 = base_param_k2 base_param_k2 > 1: res...
Definition: hdr_dynamic_vivid_metadata.h:91
AVHDRVividColorToneMappingParams::base_param_Delta
AVRational base_param_Delta
base_param_Delta in the base parameter, in multiples of 1.0/127.
Definition: hdr_dynamic_vivid_metadata.h:111
AVHDRVividColorToneMappingParams::base_enable_flag
int base_enable_flag
This flag indicates that transfer the base paramter(for value of 1)
Definition: hdr_dynamic_vivid_metadata.h:42
AVHDRVividColorToneMappingParams::three_Spline_num
int three_Spline_num
The number of three Spline.
Definition: hdr_dynamic_vivid_metadata.h:123
rational.h
AVHDRVividColorTransformParams::tone_mapping_param_num
int tone_mapping_param_num
The number of tone mapping param.
Definition: hdr_dynamic_vivid_metadata.h:211
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:325
AVHDRVividColorTransformParams::variance_maxrgb
AVRational variance_maxrgb
Indicates the variance brightness of the displayed content.
Definition: hdr_dynamic_vivid_metadata.h:192
AVHDRVividColorTransformParams::color_saturation_num
int color_saturation_num
The number of color saturation param.
Definition: hdr_dynamic_vivid_metadata.h:228
AVHDRVividColorToneMappingParams::three_Spline_enable_flag
int three_Spline_enable_flag
indicates 3Spline_enable_flag in the base parameter, This flag indicates that transfer three Spline o...
Definition: hdr_dynamic_vivid_metadata.h:117
AVHDRVividColorTransformParams::tm_params
AVHDRVividColorToneMappingParams tm_params[2]
The color tone mapping parameters.
Definition: hdr_dynamic_vivid_metadata.h:216
AVDynamicHDRVivid::num_windows
uint8_t num_windows
The number of processing windows.
Definition: hdr_dynamic_vivid_metadata.h:259
av_dynamic_hdr_vivid_alloc
AVDynamicHDRVivid * av_dynamic_hdr_vivid_alloc(size_t *size)
Allocate an AVDynamicHDRVivid structure and set its fields to default values.
Definition: hdr_dynamic_vivid_metadata.c:24
AVHDRVividColorTransformParams::color_saturation_gain
AVRational color_saturation_gain[8]
Indicates the color correction strength parameter.
Definition: hdr_dynamic_vivid_metadata.h:235
AVHDRVividColorToneMappingParams::three_Spline_TH_enable_MB
AVRational three_Spline_TH_enable_MB
three_Spline_TH_enable_MB is in the range of 0.0 to 1.0, inclusive and in multiples of 1....
Definition: hdr_dynamic_vivid_metadata.h:136
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
AVDynamicHDRVivid
This struct represents dynamic metadata for color volume transform - CUVA 005.1:2021 standard.
Definition: hdr_dynamic_vivid_metadata.h:249
AVHDRVividColorTransformParams::color_saturation_mapping_flag
int color_saturation_mapping_flag
This flag indicates that the metadata for the color saturation mapping in the processing window is pr...
Definition: hdr_dynamic_vivid_metadata.h:222
AVHDRVividColorTransformParams::tone_mapping_mode_flag
int tone_mapping_mode_flag
This flag indicates that the metadata for the tone mapping function in the processing window is prese...
Definition: hdr_dynamic_vivid_metadata.h:205
av_dynamic_hdr_vivid_create_side_data
AVDynamicHDRVivid * av_dynamic_hdr_vivid_create_side_data(AVFrame *frame)
Allocate a complete AVDynamicHDRVivid and add it to the frame.
Definition: hdr_dynamic_vivid_metadata.c:36
AVHDRVividColorToneMappingParams::three_Spline_TH_enable
AVRational three_Spline_TH_enable
3Spline_TH_enable of three Spline.
Definition: hdr_dynamic_vivid_metadata.h:143
AVHDRVividColorToneMappingParams::three_Spline_enable_Strength
AVRational three_Spline_enable_Strength
3Spline_enable_Strength of three Spline.
Definition: hdr_dynamic_vivid_metadata.h:164
size
int size
Definition: twinvq_data.h:10344
AVHDRVividColorTransformParams::average_maxrgb
AVRational average_maxrgb
Indicates the average brightness of the displayed content.
Definition: hdr_dynamic_vivid_metadata.h:185
frame.h
AVHDRVividColorToneMappingParams::base_param_k1
int base_param_k1
indicates k1_0 in the base parameter, base_param_k1 <= 1: k1_0 = base_param_k1 base_param_k1 > 1: res...
Definition: hdr_dynamic_vivid_metadata.h:84
AVHDRVividColorToneMappingParams::targeted_system_display_maximum_luminance
AVRational targeted_system_display_maximum_luminance
The nominal maximum display luminance of the targeted system display, in multiples of 1....
Definition: hdr_dynamic_vivid_metadata.h:37
AVHDRVividColorTransformParams
Color transform parameters at a processing window in a dynamic metadata for CUVA 005....
Definition: hdr_dynamic_vivid_metadata.h:172
AVHDRVividColorToneMappingParams::base_param_Delta_enable_mode
int base_param_Delta_enable_mode
This flag indicates that delta mode of base paramter(for value of 1)
Definition: hdr_dynamic_vivid_metadata.h:104
AVHDRVividColorToneMappingParams::three_Spline_TH_mode
int three_Spline_TH_mode
The mode of three Spline.
Definition: hdr_dynamic_vivid_metadata.h:129
frame
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:264
AVHDRVividColorTransformParams::minimum_maxrgb
AVRational minimum_maxrgb
Indicates the minimum brightness of the displayed content.
Definition: hdr_dynamic_vivid_metadata.h:178
AVHDRVividColorToneMappingParams::base_param_m_n
AVRational base_param_m_n
base_param_m_n in the base parameter, in multiples of 1.0/10.
Definition: hdr_dynamic_vivid_metadata.h:77
AVHDRVividColorToneMappingParams::base_param_m_a
AVRational base_param_m_a
base_param_m_a in the base parameter, in multiples of 1.0/1023.
Definition: hdr_dynamic_vivid_metadata.h:63
AVHDRVividColorToneMappingParams::three_Spline_TH_Delta1
AVRational three_Spline_TH_Delta1
3Spline_TH_Delta1 of three Spline.
Definition: hdr_dynamic_vivid_metadata.h:150
AVHDRVividColorToneMappingParams
Color tone mapping parameters at a processing window in a dynamic metadata for CUVA 005....
Definition: hdr_dynamic_vivid_metadata.h:31
AVDynamicHDRVivid::params
AVHDRVividColorTransformParams params[3]
The color transform parameters for every processing window.
Definition: hdr_dynamic_vivid_metadata.h:264
AVDynamicHDRVivid::system_start_code
uint8_t system_start_code
The system start code.
Definition: hdr_dynamic_vivid_metadata.h:253
AVHDRVividColorToneMappingParams::base_param_k3
int base_param_k3
indicates k3_0 in the base parameter, base_param_k3 == 1: k3_0 = base_param_k3 base_param_k3 == 2: k3...
Definition: hdr_dynamic_vivid_metadata.h:99
AVHDRVividColorToneMappingParams::three_Spline_TH_Delta2
AVRational three_Spline_TH_Delta2
3Spline_TH_Delta2 of three Spline.
Definition: hdr_dynamic_vivid_metadata.h:157
AVHDRVividColorToneMappingParams::base_param_m_p
AVRational base_param_m_p
base_param_m_p in the base parameter, in multiples of 1.0/16383.
Definition: hdr_dynamic_vivid_metadata.h:49
AVHDRVividColorToneMappingParams::base_param_m_b
AVRational base_param_m_b
base_param_m_b in the base parameter, in multiples of 1/1023.
Definition: hdr_dynamic_vivid_metadata.h:70
AVHDRVividColorToneMappingParams::base_param_m_m
AVRational base_param_m_m
base_param_m_m in the base parameter, in multiples of 1.0/10.
Definition: hdr_dynamic_vivid_metadata.h:56