Path: blob/master/dep/ffmpeg/include/libavutil/hdr_dynamic_vivid_metadata.h
7559 views
/*1* Copyright (c) 2021 Limin Wang <lance.lmwang at gmail.com>2*3* This file is part of FFmpeg.4*5* FFmpeg is free software; you can redistribute it and/or6* modify it under the terms of the GNU Lesser General Public7* License as published by the Free Software Foundation; either8* version 2.1 of the License, or (at your option) any later version.9*10* FFmpeg is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU13* Lesser General Public License for more details.14*15* You should have received a copy of the GNU Lesser General Public16* License along with FFmpeg; if not, write to the Free Software17* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA18*/1920#ifndef AVUTIL_HDR_DYNAMIC_VIVID_METADATA_H21#define AVUTIL_HDR_DYNAMIC_VIVID_METADATA_H2223#include "frame.h"24#include "rational.h"2526/**27* HDR Vivid three spline params.28*/29typedef struct AVHDRVivid3SplineParams {30/**31* The mode of three Spline. the value shall be in the range32* of 0 to 3, inclusive.33*/34int th_mode;3536/**37* three_Spline_TH_enable_MB is in the range of 0.0 to 1.0, inclusive38* and in multiples of 1.0/255.39*40*/41AVRational th_enable_mb;4243/**44* 3Spline_TH_enable of three Spline.45* The value shall be in the range of 0.0 to 1.0, inclusive.46* and in multiples of 1.0/4095.47*/48AVRational th_enable;4950/**51* 3Spline_TH_Delta1 of three Spline.52* The value shall be in the range of 0.0 to 0.25, inclusive,53* and in multiples of 0.25/1023.54*/55AVRational th_delta1;5657/**58* 3Spline_TH_Delta2 of three Spline.59* The value shall be in the range of 0.0 to 0.25, inclusive,60* and in multiples of 0.25/1023.61*/62AVRational th_delta2;6364/**65* 3Spline_enable_Strength of three Spline.66* The value shall be in the range of 0.0 to 1.0, inclusive,67* and in multiples of 1.0/255.68*/69AVRational enable_strength;70} AVHDRVivid3SplineParams;7172/**73* Color tone mapping parameters at a processing window in a dynamic metadata for74* CUVA 005.1:2021.75*/76typedef struct AVHDRVividColorToneMappingParams {77/**78* The nominal maximum display luminance of the targeted system display,79* in multiples of 1.0/4095 candelas per square metre. The value shall be in80* the range of 0.0 to 1.0, inclusive.81*/82AVRational targeted_system_display_maximum_luminance;8384/**85* This flag indicates that transfer the base parameter(for value of 1)86*/87int base_enable_flag;8889/**90* base_param_m_p in the base parameter,91* in multiples of 1.0/16383. The value shall be in92* the range of 0.0 to 1.0, inclusive.93*/94AVRational base_param_m_p;9596/**97* base_param_m_m in the base parameter,98* in multiples of 1.0/10. The value shall be in99* the range of 0.0 to 6.3, inclusive.100*/101AVRational base_param_m_m;102103/**104* base_param_m_a in the base parameter,105* in multiples of 1.0/1023. The value shall be in106* the range of 0.0 to 1.0 inclusive.107*/108AVRational base_param_m_a;109110/**111* base_param_m_b in the base parameter,112* in multiples of 1/1023. The value shall be in113* the range of 0.0 to 1.0, inclusive.114*/115AVRational base_param_m_b;116117/**118* base_param_m_n in the base parameter,119* in multiples of 1.0/10. The value shall be in120* the range of 0.0 to 6.3, inclusive.121*/122AVRational base_param_m_n;123124/**125* indicates k1_0 in the base parameter,126* base_param_k1 <= 1: k1_0 = base_param_k1127* base_param_k1 > 1: reserved128*/129int base_param_k1;130131/**132* indicates k2_0 in the base parameter,133* base_param_k2 <= 1: k2_0 = base_param_k2134* base_param_k2 > 1: reserved135*/136int base_param_k2;137138/**139* indicates k3_0 in the base parameter,140* base_param_k3 == 1: k3_0 = base_param_k3141* base_param_k3 == 2: k3_0 = maximum_maxrgb142* base_param_k3 > 2: reserved143*/144int base_param_k3;145146/**147* This flag indicates that delta mode of base parameter(for value of 1)148*/149int base_param_Delta_enable_mode;150151/**152* base_param_Delta in the base parameter,153* in multiples of 1.0/127. The value shall be in154* the range of 0.0 to 1.0, inclusive.155*/156AVRational base_param_Delta;157158/**159* indicates 3Spline_enable_flag in the base parameter,160* This flag indicates that transfer three Spline of base parameter(for value of 1)161*/162int three_Spline_enable_flag;163164/**165* The number of three Spline. The value shall be in the range166* of 1 to 2, inclusive.167*/168int three_Spline_num;169170AVHDRVivid3SplineParams three_spline[2];171} AVHDRVividColorToneMappingParams;172173174/**175* Color transform parameters at a processing window in a dynamic metadata for176* CUVA 005.1:2021.177*/178typedef struct AVHDRVividColorTransformParams {179/**180* Indicates the minimum brightness of the displayed content.181* The values should be in the range of 0.0 to 1.0,182* inclusive and in multiples of 1/4095.183*/184AVRational minimum_maxrgb;185186/**187* Indicates the average brightness of the displayed content.188* The values should be in the range of 0.0 to 1.0,189* inclusive and in multiples of 1/4095.190*/191AVRational average_maxrgb;192193/**194* Indicates the variance brightness of the displayed content.195* The values should be in the range of 0.0 to 1.0,196* inclusive and in multiples of 1/4095.197*/198AVRational variance_maxrgb;199200/**201* Indicates the maximum brightness of the displayed content.202* The values should be in the range of 0.0 to 1.0, inclusive203* and in multiples of 1/4095.204*/205AVRational maximum_maxrgb;206207/**208* This flag indicates that the metadata for the tone mapping function in209* the processing window is present (for value of 1).210*/211int tone_mapping_mode_flag;212213/**214* The number of tone mapping param. The value shall be in the range215* of 1 to 2, inclusive.216*/217int tone_mapping_param_num;218219/**220* The color tone mapping parameters.221*/222AVHDRVividColorToneMappingParams tm_params[2];223224/**225* This flag indicates that the metadata for the color saturation mapping in226* the processing window is present (for value of 1).227*/228int color_saturation_mapping_flag;229230/**231* The number of color saturation param. The value shall be in the range232* of 0 to 7, inclusive.233*/234int color_saturation_num;235236/**237* Indicates the color correction strength parameter.238* The values should be in the range of 0.0 to 2.0, inclusive239* and in multiples of 1/128.240*/241AVRational color_saturation_gain[8];242} AVHDRVividColorTransformParams;243244/**245* This struct represents dynamic metadata for color volume transform -246* CUVA 005.1:2021 standard247*248* To be used as payload of a AVFrameSideData or AVPacketSideData with the249* appropriate type.250*251* @note The struct should be allocated with252* av_dynamic_hdr_vivid_alloc() and its size is not a part of253* the public ABI.254*/255typedef struct AVDynamicHDRVivid {256/**257* The system start code. The value shall be set to 0x01.258*/259uint8_t system_start_code;260261/**262* The number of processing windows. The value shall be set to 0x01263* if the system_start_code is 0x01.264*/265uint8_t num_windows;266267/**268* The color transform parameters for every processing window.269*/270AVHDRVividColorTransformParams params[3];271} AVDynamicHDRVivid;272273/**274* Allocate an AVDynamicHDRVivid structure and set its fields to275* default values. The resulting struct can be freed using av_freep().276*277* @return An AVDynamicHDRVivid filled with default values or NULL278* on failure.279*/280AVDynamicHDRVivid *av_dynamic_hdr_vivid_alloc(size_t *size);281282/**283* Allocate a complete AVDynamicHDRVivid and add it to the frame.284* @param frame The frame which side data is added to.285*286* @return The AVDynamicHDRVivid structure to be filled by caller or NULL287* on failure.288*/289AVDynamicHDRVivid *av_dynamic_hdr_vivid_create_side_data(AVFrame *frame);290291#endif /* AVUTIL_HDR_DYNAMIC_VIVID_METADATA_H */292293294