Loading...
Searching...
No Matches
iamf.h
Go to the documentation of this file.
/*
* Immersive Audio Model and Formats helper functions and defines
*
* 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
*/
#ifndef AVUTIL_IAMF_H
#define AVUTIL_IAMF_H
/**
* @file
* Immersive Audio Model and Formats API header
* @see <a href="https://aomediacodec.github.io/iamf/">Immersive Audio Model and Formats</a>
*/
#include <stdint.h>
#include <stddef.h>
#include "attributes.h"
#include "avassert.h"
#include "channel_layout.h"
#include "dict.h"
#include "rational.h"
/**
* @defgroup lavu_iamf Immersive Audio Model and Formats
* @ingroup lavu_audio
*
* Immersive Audio Model and Formats related functions and defines
*
* @defgroup lavu_iamf_params Parameter Definition
* @ingroup lavu_iamf
* @{
* Parameters as defined in section 3.6.1 and 3.8 of IAMF.
* @}
*
* @defgroup lavu_iamf_audio Audio Element
* @ingroup lavu_iamf
* @{
* Audio Elements as defined in section 3.6 of IAMF.
* @}
*
* @defgroup lavu_iamf_mix Mix Presentation
* @ingroup lavu_iamf
* @{
* Mix Presentations as defined in section 3.7 of IAMF.
* @}
*
* @addtogroup lavu_iamf_params
* @{
*/
enum AVIAMFAnimationType {
AV_IAMF_ANIMATION_TYPE_STEP,
AV_IAMF_ANIMATION_TYPE_LINEAR,
AV_IAMF_ANIMATION_TYPE_BEZIER,
};
/**
* Mix Gain Parameter Data as defined in section 3.8.1 of IAMF.
*
* @note This struct's size is not a part of the public ABI.
*/
typedef struct AVIAMFMixGain {
const AVClass *av_class;
/**
* Duration for the given subblock, in units of
* 1 / @ref AVIAMFParamDefinition.parameter_rate "parameter_rate".
* It must not be 0.
*/
unsigned int subblock_duration;
/**
* The type of animation applied to the parameter values.
*/
enum AVIAMFAnimationType animation_type;
/**
* Parameter value that is applied at the start of the subblock.
* Applies to all defined Animation Types.
*
* Valid range of values is -128.0 to 128.0
*/
AVRational start_point_value;
/**
* Parameter value that is applied at the end of the subblock.
* Applies only to AV_IAMF_ANIMATION_TYPE_LINEAR and
* AV_IAMF_ANIMATION_TYPE_BEZIER Animation Types.
*
* Valid range of values is -128.0 to 128.0
*/
AVRational end_point_value;
/**
* Parameter value of the middle control point of a quadratic Bezier
* curve, i.e., its y-axis value.
* Applies only to AV_IAMF_ANIMATION_TYPE_BEZIER Animation Type.
*
* Valid range of values is -128.0 to 128.0
*/
AVRational control_point_value;
/**
* Parameter value of the time of the middle control point of a
* quadratic Bezier curve, i.e., its x-axis value.
* Applies only to AV_IAMF_ANIMATION_TYPE_BEZIER Animation Type.
*
* Valid range of values is 0.0 to 1.0
*/
AVRational control_point_relative_time;
} AVIAMFMixGain;
/**
* Demixing Info Parameter Data as defined in section 3.8.2 of IAMF.
*
* @note This struct's size is not a part of the public ABI.
*/
typedef struct AVIAMFDemixingInfo {
const AVClass *av_class;
/**
* Duration for the given subblock, in units of
* 1 / @ref AVIAMFParamDefinition.parameter_rate "parameter_rate".
* It must not be 0.
*/
unsigned int subblock_duration;
/**
* Pre-defined combination of demixing parameters.
*/
unsigned int dmixp_mode;
} AVIAMFDemixingInfo;
/**
* Recon Gain Info Parameter Data as defined in section 3.8.3 of IAMF.
*
* @note This struct's size is not a part of the public ABI.
*/
typedef struct AVIAMFReconGain {
const AVClass *av_class;
/**
* Duration for the given subblock, in units of
* 1 / @ref AVIAMFParamDefinition.parameter_rate "parameter_rate".
* It must not be 0.
*/
unsigned int subblock_duration;
/**
* Array of gain values to be applied to each channel for each layer
* defined in the Audio Element referencing the parent Parameter Definition.
* Values for layers where the AV_IAMF_LAYER_FLAG_RECON_GAIN flag is not set
* are undefined.
*
* Channel order is: FL, C, FR, SL, SR, TFL, TFR, BL, BR, TBL, TBR, LFE
*/
uint8_t recon_gain[6][12];
} AVIAMFReconGain;
enum AVIAMFParamDefinitionType {
/**
* Subblocks are of struct type AVIAMFMixGain
*/
AV_IAMF_PARAMETER_DEFINITION_MIX_GAIN,
/**
* Subblocks are of struct type AVIAMFDemixingInfo
*/
AV_IAMF_PARAMETER_DEFINITION_DEMIXING,
/**
* Subblocks are of struct type AVIAMFReconGain
*/
AV_IAMF_PARAMETER_DEFINITION_RECON_GAIN,
};
/**
* Parameters as defined in section 3.6.1 of IAMF.
*
* The struct is allocated by av_iamf_param_definition_alloc() along with an
* array of subblocks, its type depending on the value of type.
* This array is placed subblocks_offset bytes after the start of this struct.
*
* @note This struct's size is not a part of the public ABI.
*/
typedef struct AVIAMFParamDefinition {
const AVClass *av_class;
/**
* Offset in bytes from the start of this struct, at which the subblocks
* array is located.
*/
size_t subblocks_offset;
/**
* Size in bytes of each element in the subblocks array.
*/
size_t subblock_size;
/**
* Number of subblocks in the array.
*/
unsigned int nb_subblocks;
/**
* Parameters type. Determines the type of the subblock elements.
*/
enum AVIAMFParamDefinitionType type;
/**
* Identifier for the parameter substream.
*/
unsigned int parameter_id;
/**
* Sample rate for the parameter substream. It must not be 0.
*/
unsigned int parameter_rate;
/**
* The accumulated duration of all blocks in this parameter definition,
* in units of 1 / @ref parameter_rate.
*
* May be 0, in which case all duration values should be specified in
* another parameter definition referencing the same parameter_id.
*/
unsigned int duration;
/**
* The duration of every subblock in the case where all subblocks, with
* the optional exception of the last subblock, have equal durations.
*
* Must be 0 if subblocks have different durations.
*/
unsigned int constant_subblock_duration;
} AVIAMFParamDefinition;
const AVClass *av_iamf_param_definition_get_class(void);
/**
* Allocates memory for AVIAMFParamDefinition, plus an array of {@code nb_subblocks}
* amount of subblocks of the given type and initializes the variables. Can be
* freed with a normal av_free() call.
*
* @param size if non-NULL, the size in bytes of the resulting data array is written here.
*/
AVIAMFParamDefinition *av_iamf_param_definition_alloc(enum AVIAMFParamDefinitionType type,
unsigned int nb_subblocks, size_t *size);
/**
* Get the subblock at the specified {@code idx}. Must be between 0 and nb_subblocks - 1.
*
* The @ref AVIAMFParamDefinition.type "param definition type" defines
* the struct type of the returned pointer.
*/
static av_always_inline void*
av_iamf_param_definition_get_subblock(const AVIAMFParamDefinition *par, unsigned int idx)
{
av_assert0(idx < par->nb_subblocks);
return (void *)((uint8_t *)par + par->subblocks_offset + idx * par->subblock_size);
}
/**
* @}
* @addtogroup lavu_iamf_audio
* @{
*/
enum AVIAMFAmbisonicsMode {
AV_IAMF_AMBISONICS_MODE_MONO,
AV_IAMF_AMBISONICS_MODE_PROJECTION,
};
/**
* Recon gain information for the layer is present in AVIAMFReconGain
*/
#define AV_IAMF_LAYER_FLAG_RECON_GAIN (1 << 0)
/**
* A layer defining a Channel Layout in the Audio Element.
*
* When @ref AVIAMFAudioElement.audio_element_type "the parent's Audio Element type"
* is AV_IAMF_AUDIO_ELEMENT_TYPE_CHANNEL, this corresponds to an Scalable Channel
* Layout layer as defined in section 3.6.2 of IAMF.
* For AV_IAMF_AUDIO_ELEMENT_TYPE_SCENE, it is an Ambisonics channel
* layout as defined in section 3.6.3 of IAMF.
*
* @note The struct should be allocated with av_iamf_audio_element_add_layer()
* and its size is not a part of the public ABI.
*/
typedef struct AVIAMFLayer {
const AVClass *av_class;
AVChannelLayout ch_layout;
/**
* A bitmask which may contain a combination of AV_IAMF_LAYER_FLAG_* flags.
*/
unsigned int flags;
/**
* Output gain channel flags as defined in section 3.6.2 of IAMF.
*
* This field is defined only if @ref AVIAMFAudioElement.audio_element_type
* "the parent's Audio Element type" is AV_IAMF_AUDIO_ELEMENT_TYPE_CHANNEL,
* must be 0 otherwise.
*/
unsigned int output_gain_flags;
/**
* Output gain as defined in section 3.6.2 of IAMF.
*
* Must be 0 if @ref output_gain_flags is 0.
*/
AVRational output_gain;
/**
* Ambisonics mode as defined in section 3.6.3 of IAMF.
*
* This field is defined only if @ref AVIAMFAudioElement.audio_element_type
* "the parent's Audio Element type" is AV_IAMF_AUDIO_ELEMENT_TYPE_SCENE.
*
* If AV_IAMF_AMBISONICS_MODE_MONO, channel_mapping is defined implicitly
* (Ambisonic Order) or explicitly (Custom Order with ambi channels) in
* @ref ch_layout.
* If AV_IAMF_AMBISONICS_MODE_PROJECTION, @ref demixing_matrix must be set.
*/
enum AVIAMFAmbisonicsMode ambisonics_mode;
/**
* Demixing matrix as defined in section 3.6.3 of IAMF.
*
* May be set only if @ref ambisonics_mode == AV_IAMF_AMBISONICS_MODE_PROJECTION,
* must be NULL otherwise.
*/
AVRational *demixing_matrix;
/**
* The length of the Demixing matrix array. Must be ch_layout.nb_channels multiplied
* by the sum of the amount of streams in the group plus the amount of streams in
* the group that are stereo.
*/
unsigned int nb_demixing_matrix;
} AVIAMFLayer;
enum AVIAMFAudioElementType {
AV_IAMF_AUDIO_ELEMENT_TYPE_CHANNEL,
AV_IAMF_AUDIO_ELEMENT_TYPE_SCENE,
};
/**
* Information on how to combine one or more audio streams, as defined in
* section 3.6 of IAMF.
*
* @note The struct should be allocated with av_iamf_audio_element_alloc()
* and its size is not a part of the public ABI.
*/
typedef struct AVIAMFAudioElement {
const AVClass *av_class;
AVIAMFLayer **layers;
/**
* Number of layers, or channel groups, in the Audio Element.
* There may be 6 layers at most, and for @ref audio_element_type
* AV_IAMF_AUDIO_ELEMENT_TYPE_SCENE, there may be exactly 1.
*
* Set by av_iamf_audio_element_add_layer(), must not be
* modified by any other code.
*/
unsigned int nb_layers;
/**
* Demixing information used to reconstruct a scalable channel audio
* representation.
* The @ref AVIAMFParamDefinition.type "type" must be
* AV_IAMF_PARAMETER_DEFINITION_DEMIXING.
*/
AVIAMFParamDefinition *demixing_info;
/**
* Recon gain information used to reconstruct a scalable channel audio
* representation.
* The @ref AVIAMFParamDefinition.type "type" must be
* AV_IAMF_PARAMETER_DEFINITION_RECON_GAIN.
*/
AVIAMFParamDefinition *recon_gain_info;
/**
* Audio element type as defined in section 3.6 of IAMF.
*/
enum AVIAMFAudioElementType audio_element_type;
/**
* Default weight value as defined in section 3.6 of IAMF.
*/
unsigned int default_w;
} AVIAMFAudioElement;
const AVClass *av_iamf_audio_element_get_class(void);
/**
* Allocates a AVIAMFAudioElement, and initializes its fields with default values.
* No layers are allocated. Must be freed with av_iamf_audio_element_free().
*
* @see av_iamf_audio_element_add_layer()
*/
AVIAMFAudioElement *av_iamf_audio_element_alloc(void);
/**
* Allocate a layer and add it to a given AVIAMFAudioElement.
* It is freed by av_iamf_audio_element_free() alongside the rest of the parent
* AVIAMFAudioElement.
*
* @return a pointer to the allocated layer.
*/
AVIAMFLayer *av_iamf_audio_element_add_layer(AVIAMFAudioElement *audio_element);
/**
* Free an AVIAMFAudioElement and all its contents.
*
* @param audio_element pointer to pointer to an allocated AVIAMFAudioElement.
* upon return, *audio_element will be set to NULL.
*/
void av_iamf_audio_element_free(AVIAMFAudioElement **audio_element);
/**
* @}
* @addtogroup lavu_iamf_mix
* @{
*/
enum AVIAMFHeadphonesMode {
/**
* The referenced Audio Element shall be rendered to stereo loudspeakers.
*/
AV_IAMF_HEADPHONES_MODE_STEREO,
/**
* The referenced Audio Element shall be rendered with a binaural renderer.
*/
AV_IAMF_HEADPHONES_MODE_BINAURAL,
};
/**
* Submix element as defined in section 3.7 of IAMF.
*
* @note The struct should be allocated with av_iamf_submix_add_element()
* and its size is not a part of the public ABI.
*/
typedef struct AVIAMFSubmixElement {
const AVClass *av_class;
/**
* The id of the Audio Element this submix element references.
*/
unsigned int audio_element_id;
/**
* Information required required for applying any processing to the
* referenced and rendered Audio Element before being summed with other
* processed Audio Elements.
* The @ref AVIAMFParamDefinition.type "type" must be
* AV_IAMF_PARAMETER_DEFINITION_MIX_GAIN.
*/
AVIAMFParamDefinition *element_mix_config;
/**
* Default mix gain value to apply when there are no AVIAMFParamDefinition
* with @ref element_mix_config "element_mix_config's"
* @ref AVIAMFParamDefinition.parameter_id "parameter_id" available for a
* given audio frame.
*/
AVRational default_mix_gain;
/**
* A value that indicates whether the referenced channel-based Audio Element
* shall be rendered to stereo loudspeakers or spatialized with a binaural
* renderer when played back on headphones.
* If the Audio Element is not of @ref AVIAMFAudioElement.audio_element_type
* "type" AV_IAMF_AUDIO_ELEMENT_TYPE_CHANNEL, then this field is undefined.
*/
enum AVIAMFHeadphonesMode headphones_rendering_mode;
/**
* A dictionary of strings describing the submix in different languages.
* Must have the same amount of entries as
* @ref AVIAMFMixPresentation.annotations "the mix's annotations", stored
* in the same order, and with the same key strings.
*
* @ref AVDictionaryEntry.key "key" is a string conforming to BCP-47 that
* specifies the language for the string stored in
* @ref AVDictionaryEntry.value "value".
*/
AVDictionary *annotations;
} AVIAMFSubmixElement;
enum AVIAMFSubmixLayoutType {
/**
* The layout follows the loudspeaker sound system convention of ITU-2051-3.
* @ref AVIAMFSubmixLayout.sound_system must be set.
*/
AV_IAMF_SUBMIX_LAYOUT_TYPE_LOUDSPEAKERS = 2,
/**
* The layout is binaural.
*
* @note @ref AVIAMFSubmixLayout.sound_system may be set to
* AV_CHANNEL_LAYOUT_BINAURAL to simplify API usage, but it's not mandatory.
*/
AV_IAMF_SUBMIX_LAYOUT_TYPE_BINAURAL = 3,
};
/**
* Submix layout as defined in section 3.7.6 of IAMF.
*
* @note The struct should be allocated with av_iamf_submix_add_layout()
* and its size is not a part of the public ABI.
*/
typedef struct AVIAMFSubmixLayout {
const AVClass *av_class;
enum AVIAMFSubmixLayoutType layout_type;
/**
* Channel layout matching one of Sound Systems A to J of ITU-2051-3, plus
* 7.1.2ch, 3.1.2ch, and binaural.
* If layout_type is not AV_IAMF_SUBMIX_LAYOUT_TYPE_LOUDSPEAKERS or
* AV_IAMF_SUBMIX_LAYOUT_TYPE_BINAURAL, this field is undefined.
*/
AVChannelLayout sound_system;
/**
* The program integrated loudness information, as defined in
* ITU-1770-4.
*/
AVRational integrated_loudness;
/**
* The digital (sampled) peak value of the audio signal, as defined
* in ITU-1770-4.
*/
AVRational digital_peak;
/**
* The true peak of the audio signal, as defined in ITU-1770-4.
*/
AVRational true_peak;
/**
* The Dialogue loudness information, as defined in ITU-1770-4.
*/
AVRational dialogue_anchored_loudness;
/**
* The Album loudness information, as defined in ITU-1770-4.
*/
AVRational album_anchored_loudness;
} AVIAMFSubmixLayout;
/**
* Submix layout as defined in section 3.7 of IAMF.
*
* @note The struct should be allocated with av_iamf_mix_presentation_add_submix()
* and its size is not a part of the public ABI.
*/
typedef struct AVIAMFSubmix {
const AVClass *av_class;
/**
* Array of submix elements.
*
* Set by av_iamf_submix_add_element(), must not be modified by any
* other code.
*/
AVIAMFSubmixElement **elements;
/**
* Number of elements in the submix.
*
* Set by av_iamf_submix_add_element(), must not be modified by any
* other code.
*/
unsigned int nb_elements;
/**
* Array of submix layouts.
*
* Set by av_iamf_submix_add_layout(), must not be modified by any
* other code.
*/
AVIAMFSubmixLayout **layouts;
/**
* Number of layouts in the submix.
*
* Set by av_iamf_submix_add_layout(), must not be modified by any
* other code.
*/
unsigned int nb_layouts;
/**
* Information required for post-processing the mixed audio signal to
* generate the audio signal for playback.
* The @ref AVIAMFParamDefinition.type "type" must be
* AV_IAMF_PARAMETER_DEFINITION_MIX_GAIN.
*/
AVIAMFParamDefinition *output_mix_config;
/**
* Default mix gain value to apply when there are no AVIAMFParamDefinition
* with @ref output_mix_config "output_mix_config's"
* @ref AVIAMFParamDefinition.parameter_id "parameter_id" available for a
* given audio frame.
*/
AVRational default_mix_gain;
} AVIAMFSubmix;
/**
* Information on how to render and mix one or more AVIAMFAudioElement to generate
* the final audio output, as defined in section 3.7 of IAMF.
*
* @note The struct should be allocated with av_iamf_mix_presentation_alloc()
* and its size is not a part of the public ABI.
*/
typedef struct AVIAMFMixPresentation {
const AVClass *av_class;
/**
* Array of submixes.
*
* Set by av_iamf_mix_presentation_add_submix(), must not be modified
* by any other code.
*/
AVIAMFSubmix **submixes;
/**
* Number of submixes in the presentation.
*
* Set by av_iamf_mix_presentation_add_submix(), must not be modified
* by any other code.
*/
unsigned int nb_submixes;
/**
* A dictionary of strings describing the mix in different languages.
* Must have the same amount of entries as every
* @ref AVIAMFSubmixElement.annotations "Submix element annotations",
* stored in the same order, and with the same key strings.
*
* @ref AVDictionaryEntry.key "key" is a string conforming to BCP-47
* that specifies the language for the string stored in
* @ref AVDictionaryEntry.value "value".
*/
AVDictionary *annotations;
} AVIAMFMixPresentation;
const AVClass *av_iamf_mix_presentation_get_class(void);
/**
* Allocates a AVIAMFMixPresentation, and initializes its fields with default
* values. No submixes are allocated.
* Must be freed with av_iamf_mix_presentation_free().
*
* @see av_iamf_mix_presentation_add_submix()
*/
AVIAMFMixPresentation *av_iamf_mix_presentation_alloc(void);
/**
* Allocate a submix and add it to a given AVIAMFMixPresentation.
* It is freed by av_iamf_mix_presentation_free() alongside the rest of the
* parent AVIAMFMixPresentation.
*
* @return a pointer to the allocated submix.
*/
AVIAMFSubmix *av_iamf_mix_presentation_add_submix(AVIAMFMixPresentation *mix_presentation);
/**
* Allocate a submix element and add it to a given AVIAMFSubmix.
* It is freed by av_iamf_mix_presentation_free() alongside the rest of the
* parent AVIAMFSubmix.
*
* @return a pointer to the allocated submix.
*/
AVIAMFSubmixElement *av_iamf_submix_add_element(AVIAMFSubmix *submix);
/**
* Allocate a submix layout and add it to a given AVIAMFSubmix.
* It is freed by av_iamf_mix_presentation_free() alongside the rest of the
* parent AVIAMFSubmix.
*
* @return a pointer to the allocated submix.
*/
AVIAMFSubmixLayout *av_iamf_submix_add_layout(AVIAMFSubmix *submix);
/**
* Free an AVIAMFMixPresentation and all its contents.
*
* @param mix_presentation pointer to pointer to an allocated AVIAMFMixPresentation.
* upon return, *mix_presentation will be set to NULL.
*/
void av_iamf_mix_presentation_free(AVIAMFMixPresentation **mix_presentation);
/**
* @}
*/
#endif /* AVUTIL_IAMF_H */
attributes.h
Macro definitions for various function/variable attributes.
av_always_inline
#define av_always_inline
Definition attributes.h:64
avassert.h
simple assert() macros that are a bit more flexible than ISO C assert().
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition avassert.h:42
channel_layout.h
Public libavutil channel layout APIs header.
dict.h
Public dictionary API.
AVDictionary
struct AVDictionary AVDictionary
Definition dict.h:95
av_iamf_audio_element_add_layer
AVIAMFLayer * av_iamf_audio_element_add_layer(AVIAMFAudioElement *audio_element)
Allocate a layer and add it to a given AVIAMFAudioElement.
AVIAMFAmbisonicsMode
AVIAMFAmbisonicsMode
Definition iamf.h:272
av_iamf_audio_element_get_class
const AVClass * av_iamf_audio_element_get_class(void)
AVIAMFAudioElementType
AVIAMFAudioElementType
Definition iamf.h:347
av_iamf_audio_element_free
void av_iamf_audio_element_free(AVIAMFAudioElement **audio_element)
Free an AVIAMFAudioElement and all its contents.
av_iamf_audio_element_alloc
AVIAMFAudioElement * av_iamf_audio_element_alloc(void)
Allocates a AVIAMFAudioElement, and initializes its fields with default values.
AV_IAMF_AMBISONICS_MODE_MONO
@ AV_IAMF_AMBISONICS_MODE_MONO
Definition iamf.h:273
AV_IAMF_AMBISONICS_MODE_PROJECTION
@ AV_IAMF_AMBISONICS_MODE_PROJECTION
Definition iamf.h:274
AV_IAMF_AUDIO_ELEMENT_TYPE_SCENE
@ AV_IAMF_AUDIO_ELEMENT_TYPE_SCENE
Definition iamf.h:349
AV_IAMF_AUDIO_ELEMENT_TYPE_CHANNEL
@ AV_IAMF_AUDIO_ELEMENT_TYPE_CHANNEL
Definition iamf.h:348
AVIAMFHeadphonesMode
AVIAMFHeadphonesMode
Definition iamf.h:432
av_iamf_submix_add_layout
AVIAMFSubmixLayout * av_iamf_submix_add_layout(AVIAMFSubmix *submix)
Allocate a submix layout and add it to a given AVIAMFSubmix.
av_iamf_mix_presentation_free
void av_iamf_mix_presentation_free(AVIAMFMixPresentation **mix_presentation)
Free an AVIAMFMixPresentation and all its contents.
av_iamf_mix_presentation_alloc
AVIAMFMixPresentation * av_iamf_mix_presentation_alloc(void)
Allocates a AVIAMFMixPresentation, and initializes its fields with default values.
av_iamf_mix_presentation_add_submix
AVIAMFSubmix * av_iamf_mix_presentation_add_submix(AVIAMFMixPresentation *mix_presentation)
Allocate a submix and add it to a given AVIAMFMixPresentation.
av_iamf_submix_add_element
AVIAMFSubmixElement * av_iamf_submix_add_element(AVIAMFSubmix *submix)
Allocate a submix element and add it to a given AVIAMFSubmix.
AVIAMFSubmixLayoutType
AVIAMFSubmixLayoutType
Definition iamf.h:496
av_iamf_mix_presentation_get_class
const AVClass * av_iamf_mix_presentation_get_class(void)
AV_IAMF_HEADPHONES_MODE_STEREO
@ AV_IAMF_HEADPHONES_MODE_STEREO
The referenced Audio Element shall be rendered to stereo loudspeakers.
Definition iamf.h:436
AV_IAMF_HEADPHONES_MODE_BINAURAL
@ AV_IAMF_HEADPHONES_MODE_BINAURAL
The referenced Audio Element shall be rendered with a binaural renderer.
Definition iamf.h:440
AV_IAMF_SUBMIX_LAYOUT_TYPE_BINAURAL
@ AV_IAMF_SUBMIX_LAYOUT_TYPE_BINAURAL
The layout is binaural.
Definition iamf.h:508
AV_IAMF_SUBMIX_LAYOUT_TYPE_LOUDSPEAKERS
@ AV_IAMF_SUBMIX_LAYOUT_TYPE_LOUDSPEAKERS
The layout follows the loudspeaker sound system convention of ITU-2051-3.
Definition iamf.h:501
av_iamf_param_definition_get_subblock
static av_always_inline void * av_iamf_param_definition_get_subblock(const AVIAMFParamDefinition *par, unsigned int idx)
Get the subblock at the specified idx.
Definition iamf.h:260
AVIAMFParamDefinitionType
AVIAMFParamDefinitionType
Definition iamf.h:169
av_iamf_param_definition_get_class
const AVClass * av_iamf_param_definition_get_class(void)
av_iamf_param_definition_alloc
AVIAMFParamDefinition * av_iamf_param_definition_alloc(enum AVIAMFParamDefinitionType type, unsigned int nb_subblocks, size_t *size)
Allocates memory for AVIAMFParamDefinition, plus an array of nb_subblocks amount of subblocks of the ...
AVIAMFAnimationType
AVIAMFAnimationType
Definition iamf.h:66
AV_IAMF_PARAMETER_DEFINITION_RECON_GAIN
@ AV_IAMF_PARAMETER_DEFINITION_RECON_GAIN
Subblocks are of struct type AVIAMFReconGain.
Definition iamf.h:181
AV_IAMF_PARAMETER_DEFINITION_MIX_GAIN
@ AV_IAMF_PARAMETER_DEFINITION_MIX_GAIN
Subblocks are of struct type AVIAMFMixGain.
Definition iamf.h:173
AV_IAMF_PARAMETER_DEFINITION_DEMIXING
@ AV_IAMF_PARAMETER_DEFINITION_DEMIXING
Subblocks are of struct type AVIAMFDemixingInfo.
Definition iamf.h:177
AV_IAMF_ANIMATION_TYPE_BEZIER
@ AV_IAMF_ANIMATION_TYPE_BEZIER
Definition iamf.h:69
AV_IAMF_ANIMATION_TYPE_LINEAR
@ AV_IAMF_ANIMATION_TYPE_LINEAR
Definition iamf.h:68
AV_IAMF_ANIMATION_TYPE_STEP
@ AV_IAMF_ANIMATION_TYPE_STEP
Definition iamf.h:67
rational.h
Utilities for rational number calculation.
AVChannelLayout
An AVChannelLayout holds information about the channel layout of audio data.
Definition channel_layout.h:319
AVClass
Describe the class of an AVClass context structure.
Definition log.h:76
AVIAMFAudioElement
Information on how to combine one or more audio streams, as defined in section 3.6 of IAMF.
Definition iamf.h:359
AVIAMFAudioElement::audio_element_type
enum AVIAMFAudioElementType audio_element_type
Audio element type as defined in section 3.6 of IAMF.
Definition iamf.h:391
AVIAMFAudioElement::av_class
const AVClass * av_class
Definition iamf.h:360
AVIAMFAudioElement::recon_gain_info
AVIAMFParamDefinition * recon_gain_info
Recon gain information used to reconstruct a scalable channel audio representation.
Definition iamf.h:386
AVIAMFAudioElement::default_w
unsigned int default_w
Default weight value as defined in section 3.6 of IAMF.
Definition iamf.h:396
AVIAMFAudioElement::demixing_info
AVIAMFParamDefinition * demixing_info
Demixing information used to reconstruct a scalable channel audio representation.
Definition iamf.h:379
AVIAMFAudioElement::layers
AVIAMFLayer ** layers
Definition iamf.h:362
AVIAMFAudioElement::nb_layers
unsigned int nb_layers
Number of layers, or channel groups, in the Audio Element.
Definition iamf.h:371
AVIAMFDemixingInfo
Demixing Info Parameter Data as defined in section 3.8.2 of IAMF.
Definition iamf.h:128
AVIAMFDemixingInfo::dmixp_mode
unsigned int dmixp_mode
Pre-defined combination of demixing parameters.
Definition iamf.h:140
AVIAMFDemixingInfo::subblock_duration
unsigned int subblock_duration
Duration for the given subblock, in units of 1 / parameter_rate.
Definition iamf.h:136
AVIAMFDemixingInfo::av_class
const AVClass * av_class
Definition iamf.h:129
AVIAMFLayer
A layer defining a Channel Layout in the Audio Element.
Definition iamf.h:294
AVIAMFLayer::flags
unsigned int flags
A bitmask which may contain a combination of AV_IAMF_LAYER_FLAG_* flags.
Definition iamf.h:302
AVIAMFLayer::output_gain_flags
unsigned int output_gain_flags
Output gain channel flags as defined in section 3.6.2 of IAMF.
Definition iamf.h:310
AVIAMFLayer::ambisonics_mode
enum AVIAMFAmbisonicsMode ambisonics_mode
Ambisonics mode as defined in section 3.6.3 of IAMF.
Definition iamf.h:328
AVIAMFLayer::nb_demixing_matrix
unsigned int nb_demixing_matrix
The length of the Demixing matrix array.
Definition iamf.h:343
AVIAMFLayer::av_class
const AVClass * av_class
Definition iamf.h:295
AVIAMFLayer::demixing_matrix
AVRational * demixing_matrix
Demixing matrix as defined in section 3.6.3 of IAMF.
Definition iamf.h:336
AVIAMFLayer::ch_layout
AVChannelLayout ch_layout
Definition iamf.h:297
AVIAMFLayer::output_gain
AVRational output_gain
Output gain as defined in section 3.6.2 of IAMF.
Definition iamf.h:316
AVIAMFMixGain
Mix Gain Parameter Data as defined in section 3.8.1 of IAMF.
Definition iamf.h:77
AVIAMFMixGain::subblock_duration
unsigned int subblock_duration
Duration for the given subblock, in units of 1 / parameter_rate.
Definition iamf.h:85
AVIAMFMixGain::start_point_value
AVRational start_point_value
Parameter value that is applied at the start of the subblock.
Definition iamf.h:96
AVIAMFMixGain::control_point_value
AVRational control_point_value
Parameter value of the middle control point of a quadratic Bezier curve, i.e., its y-axis value.
Definition iamf.h:112
AVIAMFMixGain::end_point_value
AVRational end_point_value
Parameter value that is applied at the end of the subblock.
Definition iamf.h:104
AVIAMFMixGain::animation_type
enum AVIAMFAnimationType animation_type
The type of animation applied to the parameter values.
Definition iamf.h:89
AVIAMFMixGain::av_class
const AVClass * av_class
Definition iamf.h:78
AVIAMFMixGain::control_point_relative_time
AVRational control_point_relative_time
Parameter value of the time of the middle control point of a quadratic Bezier curve,...
Definition iamf.h:120
AVIAMFMixPresentation
Information on how to render and mix one or more AVIAMFAudioElement to generate the final audio outpu...
Definition iamf.h:616
AVIAMFMixPresentation::nb_submixes
unsigned int nb_submixes
Number of submixes in the presentation.
Definition iamf.h:632
AVIAMFMixPresentation::av_class
const AVClass * av_class
Definition iamf.h:617
AVIAMFMixPresentation::annotations
AVDictionary * annotations
A dictionary of strings describing the mix in different languages.
Definition iamf.h:644
AVIAMFMixPresentation::submixes
AVIAMFSubmix ** submixes
Array of submixes.
Definition iamf.h:625
AVIAMFParamDefinition
Parameters as defined in section 3.6.1 of IAMF.
Definition iamf.h:193
AVIAMFParamDefinition::parameter_rate
unsigned int parameter_rate
Sample rate for the parameter substream.
Definition iamf.h:222
AVIAMFParamDefinition::subblocks_offset
size_t subblocks_offset
Offset in bytes from the start of this struct, at which the subblocks array is located.
Definition iamf.h:200
AVIAMFParamDefinition::av_class
const AVClass * av_class
Definition iamf.h:194
AVIAMFParamDefinition::subblock_size
size_t subblock_size
Size in bytes of each element in the subblocks array.
Definition iamf.h:204
AVIAMFParamDefinition::duration
unsigned int duration
The accumulated duration of all blocks in this parameter definition, in units of 1 / parameter_rate.
Definition iamf.h:231
AVIAMFParamDefinition::constant_subblock_duration
unsigned int constant_subblock_duration
The duration of every subblock in the case where all subblocks, with the optional exception of the la...
Definition iamf.h:238
AVIAMFParamDefinition::parameter_id
unsigned int parameter_id
Identifier for the parameter substream.
Definition iamf.h:218
AVIAMFParamDefinition::type
enum AVIAMFParamDefinitionType type
Parameters type.
Definition iamf.h:213
AVIAMFParamDefinition::nb_subblocks
unsigned int nb_subblocks
Number of subblocks in the array.
Definition iamf.h:208
AVIAMFReconGain
Recon Gain Info Parameter Data as defined in section 3.8.3 of IAMF.
Definition iamf.h:148
AVIAMFReconGain::subblock_duration
unsigned int subblock_duration
Duration for the given subblock, in units of 1 / parameter_rate.
Definition iamf.h:156
AVIAMFReconGain::recon_gain
uint8_t recon_gain[6][12]
Array of gain values to be applied to each channel for each layer defined in the Audio Element refere...
Definition iamf.h:166
AVIAMFReconGain::av_class
const AVClass * av_class
Definition iamf.h:149
AVIAMFSubmixElement
Submix element as defined in section 3.7 of IAMF.
Definition iamf.h:449
AVIAMFSubmixElement::element_mix_config
AVIAMFParamDefinition * element_mix_config
Information required required for applying any processing to the referenced and rendered Audio Elemen...
Definition iamf.h:464
AVIAMFSubmixElement::av_class
const AVClass * av_class
Definition iamf.h:450
AVIAMFSubmixElement::audio_element_id
unsigned int audio_element_id
The id of the Audio Element this submix element references.
Definition iamf.h:455
AVIAMFSubmixElement::annotations
AVDictionary * annotations
A dictionary of strings describing the submix in different languages.
Definition iamf.h:493
AVIAMFSubmixElement::headphones_rendering_mode
enum AVIAMFHeadphonesMode headphones_rendering_mode
A value that indicates whether the referenced channel-based Audio Element shall be rendered to stereo...
Definition iamf.h:481
AVIAMFSubmixElement::default_mix_gain
AVRational default_mix_gain
Default mix gain value to apply when there are no AVIAMFParamDefinition with element_mix_config's par...
Definition iamf.h:472
AVIAMFSubmixLayout
Submix layout as defined in section 3.7.6 of IAMF.
Definition iamf.h:517
AVIAMFSubmixLayout::true_peak
AVRational true_peak
The true peak of the audio signal, as defined in ITU-1770-4.
Definition iamf.h:542
AVIAMFSubmixLayout::digital_peak
AVRational digital_peak
The digital (sampled) peak value of the audio signal, as defined in ITU-1770-4.
Definition iamf.h:538
AVIAMFSubmixLayout::layout_type
enum AVIAMFSubmixLayoutType layout_type
Definition iamf.h:520
AVIAMFSubmixLayout::dialogue_anchored_loudness
AVRational dialogue_anchored_loudness
The Dialogue loudness information, as defined in ITU-1770-4.
Definition iamf.h:546
AVIAMFSubmixLayout::album_anchored_loudness
AVRational album_anchored_loudness
The Album loudness information, as defined in ITU-1770-4.
Definition iamf.h:550
AVIAMFSubmixLayout::integrated_loudness
AVRational integrated_loudness
The program integrated loudness information, as defined in ITU-1770-4.
Definition iamf.h:533
AVIAMFSubmixLayout::sound_system
AVChannelLayout sound_system
Channel layout matching one of Sound Systems A to J of ITU-2051-3, plus 7.1.2ch, 3....
Definition iamf.h:528
AVIAMFSubmixLayout::av_class
const AVClass * av_class
Definition iamf.h:518
AVIAMFSubmix
Submix layout as defined in section 3.7 of IAMF.
Definition iamf.h:559
AVIAMFSubmix::default_mix_gain
AVRational default_mix_gain
Default mix gain value to apply when there are no AVIAMFParamDefinition with output_mix_config's para...
Definition iamf.h:606
AVIAMFSubmix::nb_elements
unsigned int nb_elements
Number of elements in the submix.
Definition iamf.h:575
AVIAMFSubmix::elements
AVIAMFSubmixElement ** elements
Array of submix elements.
Definition iamf.h:568
AVIAMFSubmix::layouts
AVIAMFSubmixLayout ** layouts
Array of submix layouts.
Definition iamf.h:583
AVIAMFSubmix::output_mix_config
AVIAMFParamDefinition * output_mix_config
Information required for post-processing the mixed audio signal to generate the audio signal for play...
Definition iamf.h:598
AVIAMFSubmix::av_class
const AVClass * av_class
Definition iamf.h:560
AVIAMFSubmix::nb_layouts
unsigned int nb_layouts
Number of layouts in the submix.
Definition iamf.h:590
AVRational
Rational number (pair of numerator and denominator).
Definition rational.h:58