FFmpeg
Functions | Variables
hdr_dynamic_metadata.c File Reference
#include "avassert.h"
#include "hdr_dynamic_metadata.h"
#include "mem.h"
#include "libavcodec/defs.h"
#include "libavcodec/get_bits.h"
#include "libavcodec/put_bits.h"

Go to the source code of this file.

Functions

  Allocate an AVDynamicHDRPlus structure and set its fields to default values. More...
 
  Allocate a complete AVDynamicHDRPlus and add it to the frame. More...
 
int  av_dynamic_hdr_plus_from_t35 (AVDynamicHDRPlus *s, const uint8_t *data, size_t size)
  Parse the user data registered ITU-T T.35 to AVbuffer (AVDynamicHDRPlus). More...
 
int  av_dynamic_hdr_plus_to_t35 (const AVDynamicHDRPlus *s, uint8_t **data, size_t *size)
  Serialize dynamic HDR10+ metadata to a user data registered ITU-T T.35 buffer, excluding the first 48 bytes of the header, and beginning with the application mode. More...
 

Variables

static const int64_t  luminance_den = 1
  Copyright (c) 2018 Mohammad Izadi <moh.izadi at gmail.com> More...
 
static const int32_t  peak_luminance_den = 15
 
static const int64_t  rgb_den = 100000
 
static const int32_t  fraction_pixel_den = 1000
 
static const int32_t  knee_point_den = 4095
 
static const int32_t  bezier_anchor_den = 1023
 
static const int32_t  saturation_weight_den = 8
 

Function Documentation

av_dynamic_hdr_plus_alloc()

AVDynamicHDRPlus* av_dynamic_hdr_plus_alloc ( size_t *  size )

Allocate an AVDynamicHDRPlus structure and set its fields to default values.

The resulting struct can be freed using av_freep().

Returns
An AVDynamicHDRPlus filled with default values or NULL on failure.

Definition at line 36 of file hdr_dynamic_metadata.c.

av_dynamic_hdr_plus_create_side_data()

AVDynamicHDRPlus* av_dynamic_hdr_plus_create_side_data ( AVFrameframe )

Allocate a complete AVDynamicHDRPlus and add it to the frame.

Parameters
frame The frame which side data is added to.
Returns
The AVDynamicHDRPlus structure to be filled by caller or NULL on failure.

Definition at line 48 of file hdr_dynamic_metadata.c.

Referenced by decode_metadata_itu_t_t35(), export_itut_t35(), and parse_itut_t35_metadata().

av_dynamic_hdr_plus_from_t35()

int av_dynamic_hdr_plus_from_t35 ( AVDynamicHDRPluss,
const uint8_t *  data,
size_t  size 
)

Parse the user data registered ITU-T T.35 to AVbuffer (AVDynamicHDRPlus).

The T.35 buffer must begin with the application mode, skipping the country code, terminal provider codes, and application identifier.

Parameters
s A pointer containing the decoded AVDynamicHDRPlus structure.
data The byte array containing the raw ITU-T T.35 data.
size Size of the data array in bytes.
Returns
>= 0 on success. Otherwise, returns the appropriate AVERROR.

Definition at line 61 of file hdr_dynamic_metadata.c.

Referenced by decode_metadata_itu_t_t35(), export_itut_t35(), and parse_itut_t35_metadata().

av_dynamic_hdr_plus_to_t35()

int av_dynamic_hdr_plus_to_t35 ( const AVDynamicHDRPluss,
uint8_t **  data,
size_t *  size 
)

Serialize dynamic HDR10+ metadata to a user data registered ITU-T T.35 buffer, excluding the first 48 bytes of the header, and beginning with the application mode.

Parameters
s A pointer containing the decoded AVDynamicHDRPlus structure.
[in,out] data A pointer to pointer to a byte buffer to be filled with the serialized metadata. If *data is NULL, a buffer be will be allocated and a pointer to it stored in its place. The caller assumes ownership of the buffer. May be NULL, in which case the function will only store the required buffer size in *size.
[in,out] size A pointer to a size to be set to the returned buffer's size. If *data is not NULL, *size must contain the size of the input buffer. May be NULL only if *data is NULL.
Returns
>= 0 on success. Otherwise, returns the appropriate AVERROR.

Buffer size per CTA-861-H p.253-254: 48 header bits (excluded from the serialized payload) 8 bits for application_mode 2 bits for num_windows 153 bits for window geometry, for each window above 1 27 bits for targeted_system_display_maximum_luminance 1-2511 bits for targeted system display peak luminance information 82-442 bits per window for pixel distribution information 1-2511 bits for mastering display peak luminance information 1-179 bits per window for tonemapping information 1-7 bits per window for color saturation mapping information Total: 123-7249 bits, excluding trimmed header bits

Definition at line 239 of file hdr_dynamic_metadata.c.

Referenced by add_hdr_plus(), and mkv_write_block().

Variable Documentation

luminance_den

const int64_t luminance_den = 1
static

Copyright (c) 2018 Mohammad Izadi <moh.izadi at gmail.com>

This file is part of FFmpeg.

FFmpeg is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

FFmpeg is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with FFmpeg; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Definition at line 28 of file hdr_dynamic_metadata.c.

Referenced by av_dynamic_hdr_plus_from_t35(), and av_dynamic_hdr_plus_to_t35().

peak_luminance_den

const int32_t peak_luminance_den = 15
static

Definition at line 29 of file hdr_dynamic_metadata.c.

Referenced by av_dynamic_hdr_plus_from_t35(), and av_dynamic_hdr_plus_to_t35().

rgb_den

const int64_t rgb_den = 100000
static

Definition at line 30 of file hdr_dynamic_metadata.c.

Referenced by av_dynamic_hdr_plus_from_t35(), and av_dynamic_hdr_plus_to_t35().

fraction_pixel_den

const int32_t fraction_pixel_den = 1000
static

Definition at line 31 of file hdr_dynamic_metadata.c.

Referenced by av_dynamic_hdr_plus_from_t35(), and av_dynamic_hdr_plus_to_t35().

knee_point_den

const int32_t knee_point_den = 4095
static

Definition at line 32 of file hdr_dynamic_metadata.c.

Referenced by av_dynamic_hdr_plus_from_t35(), and av_dynamic_hdr_plus_to_t35().

bezier_anchor_den

const int32_t bezier_anchor_den = 1023
static

Definition at line 33 of file hdr_dynamic_metadata.c.

Referenced by av_dynamic_hdr_plus_from_t35(), and av_dynamic_hdr_plus_to_t35().

saturation_weight_den

const int32_t saturation_weight_den = 8
static

Definition at line 34 of file hdr_dynamic_metadata.c.

Referenced by av_dynamic_hdr_plus_from_t35(), and av_dynamic_hdr_plus_to_t35().


Generated on Fri Oct 17 2025 19:24:14 for FFmpeg by   doxygen 1.8.17

AltStyle によって変換されたページ (->オリジナル) /