OpenFFmpeg
hdr_dynamic_metadata.h
1 /*
2  * Copyright (c) 2018 Mohammad Izadi <moh.izadi 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_METADATA_H
22 #define AVUTIL_HDR_DYNAMIC_METADATA_H
23 
24 #include "frame.h"
25 #include "rational.h"
26 
30 enum AVHDRPlusOverlapProcessOption {
31  AV_HDR_PLUS_OVERLAP_PROCESS_WEIGHTED_AVERAGING = 0,
32  AV_HDR_PLUS_OVERLAP_PROCESS_LAYERING = 1,
33 };
34 
39 typedef struct AVHDRPlusPercentile {
45  uint8_t percentage;
46 
54 
68 
77 
86 
95 
103 
111 
118  uint8_t rotation_angle;
119 
126 
135 
142 
149  enum AVHDRPlusOverlapProcessOption overlap_process_option;
150 
157  AVRational maxscl[3];
158 
165 
171 
176  AVHDRPlusPercentile distribution_maxrgb[15];
177 
184 
190 
197 
204 
210 
216  AVRational bezier_curve_anchors[15];
217 
223 
231 
243 typedef struct AVDynamicHDRPlus {
248 
254 
259  uint8_t num_windows;
260 
265 
272 
278 
284 
291 
297  AVRational targeted_system_display_actual_peak_luminance[25][25];
298 
304 
310 
316 
322  AVRational mastering_display_actual_peak_luminance[25][25];
324 
332 AVDynamicHDRPlus *av_dynamic_hdr_plus_alloc(size_t *size);
333 
341 AVDynamicHDRPlus *av_dynamic_hdr_plus_create_side_data(AVFrame *frame);
342 
343 #endif /* AVUTIL_HDR_DYNAMIC_METADATA_H */
uint8_t itu_t_t35_country_code
Country code by Rec.
Definition: hdr_dynamic_metadata.h:247
uint8_t color_saturation_mapping_flag
This flag shall be equal to 0 in bitstreams conforming to this version of this Specification.
Definition: hdr_dynamic_metadata.h:222
This structure describes decoded (raw) audio or video data.
Definition: frame.h:268
uint8_t tone_mapping_flag
This flag indicates that the metadata for the tone mapping function in the processing window is prese...
Definition: hdr_dynamic_metadata.h:189
This struct represents dynamic metadata for color volume transform - application 4 of SMPTE 2094-40:2...
Definition: hdr_dynamic_metadata.h:243
AVRational window_lower_right_corner_y
The relative y coordinate of the bottom right pixel of the processing window.
Definition: hdr_dynamic_metadata.h:94
uint8_t num_bezier_curve_anchors
The number of the intermediate anchor parameters of the tone mapping function in the processing windo...
Definition: hdr_dynamic_metadata.h:209
uint16_t semiminor_axis_external_ellipse
The semi-minor axis value of the external ellipse of the elliptical pixel selector in amount of pixel...
Definition: hdr_dynamic_metadata.h:141
AVRational window_upper_left_corner_x
The relative x coordinate of the top left pixel of the processing window.
Definition: hdr_dynamic_metadata.h:67
AVRational targeted_system_display_maximum_luminance
The nominal maximum display luminance of the targeted system display, in units of 0...
Definition: hdr_dynamic_metadata.h:271
AVRational knee_point_x
The x coordinate of the separation point between the linear part and the curved part of the tone mapp...
Definition: hdr_dynamic_metadata.h:196
uint8_t mastering_display_actual_peak_luminance_flag
This flag shall be equal to 0 in bitstreams conforming to this version of this Specification.
Definition: hdr_dynamic_metadata.h:303
AVRational knee_point_y
The y coordinate of the separation point between the linear part and the curved part of the tone mapp...
Definition: hdr_dynamic_metadata.h:203
uint8_t num_cols_targeted_system_display_actual_peak_luminance
The number of columns in the targeted_system_display_actual_peak_luminance array. ...
Definition: hdr_dynamic_metadata.h:290
uint8_t application_version
Application version in the application defining document in ST-2094 suite.
Definition: hdr_dynamic_metadata.h:253
Represents the percentile at a specific percentage in a distribution.
Definition: hdr_dynamic_metadata.h:39
AVRational fraction_bright_pixels
The fraction of selected pixels in the image that contains the brightest pixel in the scene...
Definition: hdr_dynamic_metadata.h:183
uint8_t percentage
The percentage value corresponding to a specific percentile linearized RGB value in the processing wi...
Definition: hdr_dynamic_metadata.h:45
uint8_t num_rows_mastering_display_actual_peak_luminance
The number of rows in the mastering_display_actual_peak_luminance array.
Definition: hdr_dynamic_metadata.h:309
uint16_t semimajor_axis_external_ellipse
The semi-major axis value of the external ellipse of the elliptical pixel selector in amount of pixel...
Definition: hdr_dynamic_metadata.h:134
reference-counted frame API
AVRational window_lower_right_corner_x
The relative x coordinate of the bottom right pixel of the processing window.
Definition: hdr_dynamic_metadata.h:85
AVRational window_upper_left_corner_y
The relative y coordinate of the top left pixel of the processing window.
Definition: hdr_dynamic_metadata.h:76
AVRational color_saturation_weight
The color saturation gain in the processing window in the scene.
Definition: hdr_dynamic_metadata.h:229
uint8_t num_distribution_maxrgb_percentiles
The number of linearized maxRGB values at given percentiles in the processing window in the scene...
Definition: hdr_dynamic_metadata.h:170
uint16_t center_of_ellipse_x
The x coordinate of the center position of the concentric internal and external ellipses of the ellip...
Definition: hdr_dynamic_metadata.h:102
Rational number (pair of numerator and denominator).
Definition: rational.h:58
uint16_t center_of_ellipse_y
The y coordinate of the center position of the concentric internal and external ellipses of the ellip...
Definition: hdr_dynamic_metadata.h:110
uint8_t num_windows
The number of processing windows.
Definition: hdr_dynamic_metadata.h:259
AVRational average_maxrgb
The average of linearized maxRGB values in the processing window in the scene.
Definition: hdr_dynamic_metadata.h:164
uint8_t num_rows_targeted_system_display_actual_peak_luminance
The number of rows in the targeted system_display_actual_peak_luminance array.
Definition: hdr_dynamic_metadata.h:283
Utilties for rational number calculation.
AVRational percentile
The linearized maxRGB value at a specific percentile in the processing window in the scene...
Definition: hdr_dynamic_metadata.h:52
uint8_t targeted_system_display_actual_peak_luminance_flag
This flag shall be equal to 0 in bit streams conforming to this version of this Specification.
Definition: hdr_dynamic_metadata.h:277
Color transform parameters at a processing window in a dynamic metadata for SMPTE 2094-40...
Definition: hdr_dynamic_metadata.h:59
uint8_t num_cols_mastering_display_actual_peak_luminance
The number of columns in the mastering_display_actual_peak_luminance array.
Definition: hdr_dynamic_metadata.h:315
uint8_t rotation_angle
The clockwise rotation angle in degree of arc with respect to the positive direction of the x-axis of...
Definition: hdr_dynamic_metadata.h:118
uint16_t semimajor_axis_internal_ellipse
The semi-major axis value of the internal ellipse of the elliptical pixel selector in amount of pixel...
Definition: hdr_dynamic_metadata.h:125