1// Copyright (c) 2023, Alliance for Open Media. All rights reserved 2// 3// This source code is subject to the terms of the BSD 3-Clause Clear License 4// and the Alliance for Open Media Patent License 1.0. If the BSD 3-Clause Clear 5// License was not distributed with this source code in the LICENSE file, you 6// can obtain it at www.aomedia.org/license/software-license/bsd-3-c-c. If the 7// Alliance for Open Media Patent License 1.0 was not distributed with this 8// source code in the PATENTS file, you can obtain it at 9// www.aomedia.org/license/patent. 10 11syntax = "proto2"; 12 13package iamf_tools_cli_proto; 14 15enum AnimationType { 16 ANIMATE_INVALID = 0; 17 ANIMATE_STEP = 1; 18 ANIMATE_LINEAR = 2; 19 ANIMATE_BEZIER = 3; 20} 21 22// Values are represented to align with the IAMF spec. 23// 24// See https://aomediacodec.github.io/iamf/v1.1.0.html#syntax-mix-gain-param for 25// further details. 26// 27// See detailed examples on Q7.8 format below in `AnimationLinearInt16`. 28message AnimationStepInt16 { 29 optional int32 start_point_value = 1; // Q7.8. 30} 31 32// Values are represented to align with the IAMF spec. 33// 34// See https://aomediacodec.github.io/iamf/v1.1.0.html#syntax-mix-gain-param for 35// further details. 36// 37// See detailed examples on Q7.8 format below in `AnimationLinearInt16`. 38message AnimationLinearInt16 { 39 optional int32 start_point_value = 1; // Q7.8. 40 optional int32 end_point_value = 2; // Q7.8. 41} 42 43// Values are represented to align with the IAMF spec. 44// 45// See https://aomediacodec.github.io/iamf/v1.1.0.html#syntax-mix-gain-param for 46// further details. 47// 48// To convert from dB to Q7.8, multiply by 256. Example: 49// - For -3 dB, set the proto value to 256 * -3 = -768. 50// - For +6 dB, set the proto value to 256 * 6 = 1536. 51// 52// To convert from a float in the range [0.0, 1.0] to Q0.8. Multiply by 256 and 53// clamp to the range [0, 255]. Examples: 54// - For a control point relative time of 0.5, set the proto value to 55// clam(0.5 * 256, 0, 255) = 128. 56// - For a control point relative time of 1.0, set the proto value to 57// clamp(1.0 * 256, 0, 255) = 255. 58message AnimationBezierInt16 { 59 optional int32 start_point_value = 1; // Q7.8. 60 optional int32 end_point_value = 2; // Q7.8. 61 optional int32 control_point_value = 3; // Q7.8. 62 optional uint32 control_point_relative_time = 4; // Q0.8. 63} 64 65message AnimatedParameterDataInt16 { 66 oneof parameter_data { 67 AnimationStepInt16 step = 1; 68 AnimationLinearInt16 linear = 2; 69 AnimationBezierInt16 bezier = 3; 70 } 71} 72 73message MixGainParameterData { 74 optional AnimationType animation_type = 1; 75 optional AnimatedParameterDataInt16 param_data = 2; 76} 77 78enum DMixPMode { 79 DMIXP_MODE_INVALID = 0; 80 // (alpha, beta, gamma, delta, w_idx_offset) 81 DMIXP_MODE_1 = 1; // ( 1, 1, 0.707, 0.707, -1) 82 DMIXP_MODE_2 = 2; // (0.707, 0.707, 0.707, 0.707, -1) 83 DMIXP_MODE_3 = 3; // ( 1, 0.866, 0.866, 0.866, -1) 84 DMIXP_MODE_RESERVED_A = 4; 85 DMIXP_MODE_1_N = 5; // ( 1, 1, 0.707, 0.707, 1) 86 DMIXP_MODE_2_N = 6; // (0.707, 0.707, 0.707, 0.707, 1) 87 DMIXP_MODE_3_N = 7; // ( 1, 0.866, 0.866, 0.866, 1) 88 DMIXP_MODE_RESERVED_B = 8; 89} 90 91message DemixingInfoParameterData { 92 optional DMixPMode dmixp_mode = 1; 93 optional uint32 reserved = 2; 94} 95 96message ReconGains { 97 reserved 1; 98 99 // Mapping from a bit position to a recon gain value. 100 // If recon_gain[j] is defined, then the j-th bit of recon_gain_flags[i] 101 // (for the i-th layer) will be set. 102 map<uint32, uint32> recon_gain = 2; 103} 104 105message ReconGainInfoParameterData { 106 reserved 1; 107 108 // Length = `num_layers`. 109 repeated ReconGains recon_gains_for_layer = 2; 110} 111