Go to the documentation of this file.
27 #define T35_PAYLOAD_MAX_SIZE 907
44 *
size =
sizeof(*hdr_plus);
89 if (
s->num_windows < 1 ||
s->num_windows > 3) {
96 for (
int w = 1;
w <
s->num_windows;
w++) {
121 s->targeted_system_display_maximum_luminance =
123 s->targeted_system_display_actual_peak_luminance_flag =
get_bits1(gb);
125 if (
s->targeted_system_display_actual_peak_luminance_flag) {
131 if (((rows < 2) || (rows > 25)) || ((cols < 2) || (cols > 25))) {
134 s->num_rows_targeted_system_display_actual_peak_luminance = rows;
135 s->num_cols_targeted_system_display_actual_peak_luminance = cols;
140 for (
int i = 0;
i < rows;
i++) {
141 for (
int j = 0; j < cols; j++) {
142 s->targeted_system_display_actual_peak_luminance[
i][j] =
147 for (
int w = 0;
w <
s->num_windows;
w++) {
152 for (
int i = 0;
i < 3;
i++) {
177 s->mastering_display_actual_peak_luminance_flag =
get_bits1(gb);
178 if (
s->mastering_display_actual_peak_luminance_flag) {
184 if (((rows < 2) || (rows > 25)) || ((cols < 2) || (cols > 25))) {
187 s->num_rows_mastering_display_actual_peak_luminance = rows;
188 s->num_cols_mastering_display_actual_peak_luminance = cols;
193 for (
int i = 0;
i < rows;
i++) {
194 for (
int j = 0; j < cols; j++) {
195 s->mastering_display_actual_peak_luminance[
i][j] =
201 for (
int w = 0;
w <
s->num_windows;
w++) {
243 size_t size_bits, size_bytes;
267 for (
int w = 1;
w <
s->num_windows;
w++)
273 if (
s->targeted_system_display_actual_peak_luminance_flag)
275 s->num_rows_targeted_system_display_actual_peak_luminance *
276 s->num_cols_targeted_system_display_actual_peak_luminance * 4;
278 for (
int w = 0;
w <
s->num_windows;
w++)
279 size_bits += 72 +
s->params[
w].num_distribution_maxrgb_percentiles * 24 + 10;
282 if (
s->mastering_display_actual_peak_luminance_flag)
284 s->num_rows_mastering_display_actual_peak_luminance *
285 s->num_cols_mastering_display_actual_peak_luminance * 4;
287 for (
int w = 0;
w <
s->num_windows;
w++) {
289 if (
s->params[
w].tone_mapping_flag)
290 size_bits += 28 +
s->params[
w].num_bezier_curve_anchors * 10;
293 if (
s->params[
w].color_saturation_mapping_flag)
297 size_bytes = (size_bits + 7) / 8;
311 for (
int w = 1;
w <
s->num_windows;
w++) {
312 put_bits(pb, 16,
s->params[
w].window_upper_left_corner_x.num /
s->params[
w].window_upper_left_corner_x.den);
313 put_bits(pb, 16,
s->params[
w].window_upper_left_corner_y.num /
s->params[
w].window_upper_left_corner_y.den);
314 put_bits(pb, 16,
s->params[
w].window_lower_right_corner_x.num /
s->params[
w].window_lower_right_corner_x.den);
315 put_bits(pb, 16,
s->params[
w].window_lower_right_corner_y.num /
s->params[
w].window_lower_right_corner_y.den);
316 put_bits(pb, 16,
s->params[
w].center_of_ellipse_x);
317 put_bits(pb, 16,
s->params[
w].center_of_ellipse_y);
319 put_bits(pb, 16,
s->params[
w].semimajor_axis_internal_ellipse);
320 put_bits(pb, 16,
s->params[
w].semimajor_axis_external_ellipse);
321 put_bits(pb, 16,
s->params[
w].semiminor_axis_external_ellipse);
322 put_bits(pb, 1,
s->params[
w].overlap_process_option);
326 s->targeted_system_display_maximum_luminance.den);
327 put_bits(pb, 1,
s->targeted_system_display_actual_peak_luminance_flag);
328 if (
s->targeted_system_display_actual_peak_luminance_flag) {
329 put_bits(pb, 5,
s->num_rows_targeted_system_display_actual_peak_luminance);
330 put_bits(pb, 5,
s->num_cols_targeted_system_display_actual_peak_luminance);
331 for (
int i = 0;
i <
s->num_rows_targeted_system_display_actual_peak_luminance;
i++) {
332 for (
int j = 0; j <
s->num_cols_targeted_system_display_actual_peak_luminance; j++)
334 s->targeted_system_display_actual_peak_luminance[
i][j].den);
338 for (
int w = 0;
w <
s->num_windows;
w++) {
339 for (
int i = 0;
i < 3;
i++)
341 put_bits(pb, 17,
s->params[
w].average_maxrgb.num *
rgb_den /
s->params[
w].average_maxrgb.den);
342 put_bits(pb, 4,
s->params[
w].num_distribution_maxrgb_percentiles);
343 for (
int i = 0;
i <
s->params[
w].num_distribution_maxrgb_percentiles;
i++) {
344 put_bits(pb, 7,
s->params[
w].distribution_maxrgb[
i].percentage);
346 s->params[
w].distribution_maxrgb[
i].percentile.den);
349 s->params[
w].fraction_bright_pixels.den);
352 put_bits(pb, 1,
s->mastering_display_actual_peak_luminance_flag);
353 if (
s->mastering_display_actual_peak_luminance_flag) {
354 put_bits(pb, 5,
s->num_rows_mastering_display_actual_peak_luminance);
355 put_bits(pb, 5,
s->num_cols_mastering_display_actual_peak_luminance);
356 for (
int i = 0;
i <
s->num_rows_mastering_display_actual_peak_luminance;
i++) {
357 for (
int j = 0; j <
s->num_cols_mastering_display_actual_peak_luminance; j++)
359 s->mastering_display_actual_peak_luminance[
i][j].den);
363 for (
int w = 0;
w <
s->num_windows;
w++) {
364 put_bits(pb, 1,
s->params[
w].tone_mapping_flag);
365 if (
s->params[
w].tone_mapping_flag) {
368 put_bits(pb, 4,
s->params[
w].num_bezier_curve_anchors);
369 for (
int i = 0;
i <
s->params[
w].num_bezier_curve_anchors;
i++)
371 s->params[
w].bezier_curve_anchors[
i].den);
372 put_bits(pb, 1,
s->params[
w].color_saturation_mapping_flag);
373 if (
s->params[
w].color_saturation_mapping_flag)
375 s->params[
w].color_saturation_weight.den);
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
AVFrameSideData * av_frame_new_side_data(AVFrame *frame, enum AVFrameSideDataType type, size_t size)
Add a new side data to a frame.
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 void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
This structure describes decoded (raw) audio or video data.
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
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)
#define i(width, name, range_min, range_max)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
This struct represents dynamic metadata for color volume transform - application 4 of SMPTE 2094-40:2...
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
#define AV_INPUT_BUFFER_PADDING_SIZE
@ AV_FRAME_DATA_DYNAMIC_HDR_PLUS
HDR dynamic metadata associated with a video frame.
Structure to hold side data for an AVFrame.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.