FFmpeg: libavcodec/dynamic_hdr10_plus.c Source File
Go to the documentation of this file. 1 /*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
21
29
32 {
35
38
42
45
48
49 if (
s->num_windows < 1 ||
s->num_windows > 3) {
51 }
52
55
56 for (
int w = 1;
w <
s->num_windows;
w++) {
57 // The corners are set to absolute coordinates here. They should be
58 // converted to the relative coordinates (in [0, 1]) in the decoder.
68
76 }
77
80
81 s->targeted_system_display_maximum_luminance =
83 s->targeted_system_display_actual_peak_luminance_flag =
get_bits1(gb);
84
85 if (
s->targeted_system_display_actual_peak_luminance_flag) {
86 int rows, cols;
91 if (((rows < 2) || (rows > 25)) || ((cols < 2) || (cols > 25))) {
93 }
94 s->num_rows_targeted_system_display_actual_peak_luminance = rows;
95 s->num_cols_targeted_system_display_actual_peak_luminance = cols;
96
99
100 for (
int i = 0;
i < rows;
i++) {
101 for (int j = 0; j < cols; j++) {
102 s->targeted_system_display_actual_peak_luminance[
i][j] =
104 }
105 }
106 }
107 for (
int w = 0;
w <
s->num_windows;
w++) {
111
112 for (
int i = 0;
i < 3;
i++) {
115 }
119
123
128 }
129
132
134 }
137 s->mastering_display_actual_peak_luminance_flag =
get_bits1(gb);
138 if (
s->mastering_display_actual_peak_luminance_flag) {
139 int rows, cols;
144 if (((rows < 2) || (rows > 25)) || ((cols < 2) || (cols > 25))) {
146 }
147 s->num_rows_mastering_display_actual_peak_luminance = rows;
148 s->num_cols_mastering_display_actual_peak_luminance = cols;
149
152
153 for (
int i = 0;
i < rows;
i++) {
154 for (int j = 0; j < cols; j++) {
155 s->mastering_display_actual_peak_luminance[
i][j] =
157 }
158 }
159 }
160
161 for (
int w = 0;
w <
s->num_windows;
w++) {
165
170
176
179
183 }
184 }
185
194 }
195 }
196
197 return 0;
198 }
static int get_bits_left(GetBitContext *gb)
Filter the word "frame" indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
AVRational percentile
The linearized maxRGB value at a specific percentile in the processing window in the scene.
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
static const int64_t rgb_den
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static const int32_t fraction_pixel_den
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
uint8_t percentage
The percentage value corresponding to a specific percentile linearized RGB value in the processing wi...
Rational number (pair of numerator and denominator).
static unsigned int get_bits1(GetBitContext *s)
static const int32_t knee_point_den
static const int32_t peak_luminance_den
static const int64_t luminance_den
#define i(width, name, range_min, range_max)
This struct represents dynamic metadata for color volume transform - application 4 of SMPTE 2094-40:2...
int ff_parse_itu_t_t35_to_dynamic_hdr10_plus(AVDynamicHDRPlus *s, const uint8_t *data, int size)
Parse the user data registered ITU-T T.35 to AVbuffer (AVDynamicHDRPlus).
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static const int32_t saturation_weight_den
static const int32_t bezier_anchor_den
Generated on Tue Feb 28 2023 21:33:14 for FFmpeg by
doxygen
1.8.17