Go to the documentation of this file.
41 if (left < 11 || codec_config->audio_roll_distance >= 0)
64 int object_type_id,
codec_id, stream_type;
75 if (object_type_id != 0x40)
79 if (((stream_type >> 2) != 5) || ((stream_type >> 1) & 1))
148 static const enum AVCodecID sample_fmt[2][3] = {
153 int sample_size = (
avio_r8(pb) / 8 - 2);
173 unsigned codec_config_id, nb_samples,
codec_id;
174 int16_t audio_roll_distance;
208 for (
int i = 0;
i <
c->nb_codec_configs;
i++)
209 if (
c->codec_configs[
i]->codec_config_id == codec_config_id) {
219 c->codec_configs =
tmp;
221 codec_config =
av_mallocz(
sizeof(*codec_config));
228 codec_config->
codec_id = avcodec_id;
257 c->codec_configs[
c->nb_codec_configs++] = codec_config;
330 memcpy(codecpar->
extradata, buf,
sizeof(buf));
342 int nb_layers, k = 0;
347 if (nb_layers > 6 || nb_layers == 0)
351 if (!audio_element->
layers)
355 for (
int i = 0;
i < nb_layers;
i++) {
357 int loudspeaker_layout, output_gain_is_present_flag;
358 int substream_count, coupled_substream_count;
365 loudspeaker_layout =
byte >> 4;
366 output_gain_is_present_flag = (
byte >> 3) & 1;
368 layer->
flags |= AV_IAMF_LAYER_FLAG_RECON_GAIN;
370 coupled_substream_count =
avio_r8(pb);
377 if (output_gain_is_present_flag) {
382 if (loudspeaker_layout < 10)
386 .nb_channels = substream_count +
387 coupled_substream_count };
389 for (
int j = 0; j < substream_count; j++) {
410 unsigned ambisonics_mode;
411 int output_channel_count, substream_count, order;
415 if (ambisonics_mode > 1)
418 output_channel_count =
avio_r8(pb);
423 order =
floor(sqrt(output_channel_count - 1));
425 if ((order + 1) * (order + 1) != output_channel_count)
429 if (!audio_element->
layers)
440 if (ambisonics_mode == 0) {
441 for (
int i = 0;
i < substream_count;
i++) {
457 for (
int i = 0;
i < output_channel_count;
i++)
460 int coupled_substream_count =
avio_r8(pb);
461 int nb_demixing_matrix = substream_count + coupled_substream_count;
462 int demixing_matrix_size = nb_demixing_matrix * output_channel_count;
471 for (
int i = 0;
i < demixing_matrix_size;
i++)
474 for (
int i = 0;
i < substream_count;
i++) {
497 unsigned int parameter_id, parameter_rate,
mode;
498 unsigned int duration = 0, constant_subblock_duration = 0, nb_subblocks = 0;
503 for (
int i = 0;
i <
c->nb_param_definitions;
i++)
504 if (
c->param_definitions[
i]->param->parameter_id == parameter_id) {
517 if (constant_subblock_duration == 0)
520 nb_subblocks =
duration / constant_subblock_duration;
527 for (
int i = 0;
i < nb_subblocks;
i++) {
529 unsigned int subblock_duration = constant_subblock_duration;
531 if (constant_subblock_duration == 0)
537 mix->subblock_duration = subblock_duration;
574 sizeof(*
c->param_definitions));
579 c->param_definitions =
tmp;
595 *out_param_definition = param;
608 unsigned audio_element_id, nb_substreams, codec_config_id, num_parameters;
609 int audio_element_type,
ret;
624 for (
int i = 0;
i <
c->nb_audio_elements;
i++)
625 if (
c->audio_elements[
i]->audio_element_id == audio_element_id) {
631 audio_element_type =
avio_r8(pbc) >> 5;
633 av_log(
s,
AV_LOG_DEBUG,
"Unknown audio_element_type referenced in an audio element. Ignoring\n");
642 av_log(
s,
AV_LOG_ERROR,
"Non existant codec config id %d referenced in an audio element\n", codec_config_id);
658 c->audio_elements =
tmp;
660 audio_element =
av_mallocz(
sizeof(*audio_element));
661 if (!audio_element) {
719 if (num_parameters && audio_element_type != 0) {
721 " for Scene representations\n", num_parameters);
726 for (
int i = 0;
i < num_parameters;
i++) {
756 c->audio_elements[
c->nb_audio_elements++] = audio_element;
794 unsigned nb_submixes, mix_presentation_id;
810 for (
int i = 0;
i <
c->nb_mix_presentations;
i++)
811 if (
c->mix_presentations[
i]->mix_presentation_id == mix_presentation_id) {
822 c->mix_presentations =
tmp;
824 mix_presentation =
av_mallocz(
sizeof(*mix_presentation));
825 if (!mix_presentation) {
854 char *annotation =
NULL;
865 for (
int i = 0;
i < nb_submixes;
i++) {
867 unsigned nb_elements, nb_layouts;
876 for (
int j = 0; j < nb_elements; j++) {
879 unsigned int rendering_config_extension_size;
882 if (!submix_element) {
889 for (
int k = 0; k <
c->nb_audio_elements; k++)
890 if (
c->audio_elements[k]->audio_element_id == submix_element->
audio_element_id) {
891 audio_element =
c->audio_elements[k];
895 if (!audio_element) {
896 av_log(
s,
AV_LOG_ERROR,
"Invalid Audio Element with id %u referenced by Mix Parameters %u\n",
902 for (
int k = 0; k < mix_presentation->
count_label; k++) {
903 char *annotation =
NULL;
916 avio_skip(pbc, rendering_config_extension_size);
932 for (
int j = 0; j < nb_layouts; j++) {
938 if (!submix_layout) {
953 sound_system = (
byte >> 2) & 0xF;
969 unsigned int num_anchored_loudness =
avio_r8(pbc);
971 for (
int k = 0; k < num_anchored_loudness; k++) {
972 unsigned int anchor_element =
avio_r8(pbc);
983 if (info_type & 0xFC) {
990 c->mix_presentations[
c->nb_mix_presentations++] = mix_presentation;
1006 unsigned *skip_samples,
unsigned *discard_padding)
1009 int ret, extension_flag, trimming, start;
1010 unsigned skip = 0, discard = 0;
1023 if (*obu_size > INT_MAX)
1034 *skip_samples =
skip;
1035 if (discard_padding)
1036 *discard_padding = discard;
1038 if (extension_flag) {
1039 unsigned int extension_bytes;
1040 extension_bytes =
get_leb(&gb);
1041 if (extension_bytes > INT_MAX / 8)
1049 size = *obu_size + start;
1054 *start_pos =
size - *obu_size;
1060 int max_size,
void *log_ctx)
1078 if (len < 0 || obu_size > max_size) {
1111 max_size -= obu_size + start_pos;
static int update_extradata(AVCodecParameters *codecpar)
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
@ AV_IAMF_SUBMIX_LAYOUT_TYPE_LOUDSPEAKERS
The layout follows the loudspeaker sound system convention of ITU-2051-3.
#define AV_LOG_WARNING
Something somehow does not look correct.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
#define MP4DecConfigDescrTag
void ffio_init_context(FFIOContext *s, unsigned char *buffer, int buffer_size, int write_flag, void *opaque, int(*read_packet)(void *opaque, uint8_t *buf, int buf_size), int(*write_packet)(void *opaque, const uint8_t *buf, int buf_size), int64_t(*seek)(void *opaque, int64_t offset, int whence))
static int mix(int c0, int c1)
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
static void av_unused put_bits32(PutBitContext *s, uint32_t value)
Write exactly 32 bits into a bitstream.
enum AVMediaType codec_type
General type of the encoded data.
#define AV_CHANNEL_LAYOUT_STEREO
static int put_bytes_output(const PutBitContext *s)
const AVCodecTag ff_mp4_obj_type[]
This struct describes the properties of an encoded stream.
unsigned int default_w
Default weight value as defined in section 3.6 of IAMF.
unsigned int nb_substreams
AVIAMFParamDefinition * av_iamf_param_definition_alloc(enum AVIAMFParamDefinitionType type, unsigned int nb_subblocks, size_t *out_size)
Allocates memory for AVIAMFParamDefinition, plus an array of.
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.
static int get_bits_count(const GetBitContext *s)
AVChannelCustom * map
This member must be used when the channel order is AV_CHANNEL_ORDER_CUSTOM.
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
static void put_bits64(PutBitContext *s, int n, uint64_t value)
Write up to 64 bits into a bitstream.
int seek_preroll
Audio only.
int error
contains the error code or 0 if no error happened
enum AVIAMFSubmixLayoutType layout_type
Parameters as defined in section 3.6.1 of IAMF.
AVRational default_mix_gain
Default mix gain value to apply when there are no AVIAMFParamDefinition with element_mix_config's par...
enum AVChannelOrder order
Channel order used in this layout.
static int ambisonics_config(void *s, AVIOContext *pb, IAMFAudioElement *audio_element, const IAMFCodecConfig *codec_config)
int nb_channels
Number of channels in this layout.
static int flac_decoder_config(IAMFCodecConfig *codec_config, AVIOContext *pb, int len)
const AVIAMFMixPresentation * cmix
AVRational digital_peak
The digital (sampled) peak value of the audio signal, as defined in ITU-1770-4.
static void skip_bits(GetBitContext *s, int n)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
AVRational integrated_loudness
The program integrated loudness information, as defined in ITU-1770-4.
AVIAMFSubmix * av_iamf_mix_presentation_add_submix(AVIAMFMixPresentation *mix_presentation)
Allocate a submix and add it to a given AVIAMFMixPresentation.
#define MP4DecSpecificDescrTag
@ AOT_ESCAPE
Y Escape Value.
Submix layout as defined in section 3.7.6 of IAMF.
static int put_bits_left(PutBitContext *s)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
AVIAMFAudioElement * av_iamf_audio_element_alloc(void)
Allocates a AVIAMFAudioElement, and initializes its fields with default values.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
enum AVIAMFAudioElementType audio_element_type
Audio element type as defined in section 3.6 of IAMF.
static int opus_decoder_config(IAMFCodecConfig *codec_config, AVIOContext *pb, int len)
Recon Gain Info Parameter Data as defined in section 3.8.3 of IAMF.
static int param_parse(void *s, IAMFContext *c, AVIOContext *pb, unsigned int type, const IAMFAudioElement *audio_element, AVIAMFParamDefinition **out_param_definition)
static int codec_config_obu(void *s, IAMFContext *c, AVIOContext *pb, int len)
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
AVIAMFAudioElement * element
element backs celement iff the AVIAMFAudioElement is owned by this structure.
@ AV_IAMF_PARAMETER_DEFINITION_RECON_GAIN
Subblocks are of struct type AVIAMFReconGain.
AVDictionary * annotations
A dictionary of strings describing the submix in different languages.
unsigned int avio_rb32(AVIOContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_ARRAY_ELEMS(a)
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
int frame_size
Audio only.
AVIAMFSubmixLayout * av_iamf_submix_add_layout(AVIAMFSubmix *submix)
Allocate a submix layout and add it to a given AVIAMFSubmix.
int avpriv_mpeg4audio_get_config2(MPEG4AudioConfig *c, const uint8_t *buf, int size, int sync_extension, void *logctx)
Parse MPEG-4 systems extradata from a raw buffer to retrieve audio configuration.
unsigned int audio_substream_id
unsigned int substream_count
AVRational dialogue_anchored_loudness
The Dialogue loudness information, as defined in ITU-1770-4.
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
static __device__ float floor(float a)
static av_always_inline void * av_iamf_param_definition_get_subblock(const AVIAMFParamDefinition *par, unsigned int idx)
Get the subblock at the specified.
union AVChannelLayout::@428 u
Details about which channels are present in this layout.
@ AV_CHANNEL_ORDER_UNSPEC
Only the channel count is specified, without any further information about the channel order.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
enum AVIAMFHeadphonesMode headphones_rendering_mode
A value that indicates whether the referenced channel-based Audio Element shall be rendered to stereo...
unsigned int ffio_read_leb(AVIOContext *s)
Read a unsigned integer coded as a variable number of up to eight little-endian bytes,...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
AVChannelLayout ch_layout
int ff_iamfdec_read_descriptors(IAMFContext *c, AVIOContext *pb, int max_size, void *log_ctx)
unsigned int audio_element_id
Demixing Info Parameter Data as defined in section 3.8.2 of IAMF.
@ AV_CHANNEL_ORDER_AMBISONIC
The audio is represented as the decomposition of the sound field into spherical harmonics.
static unsigned get_leb(GetBitContext *s)
Read a unsigned integer coded as a variable number of up to eight little-endian bytes,...
Rational number (pair of numerator and denominator).
unsigned int duration
The accumulated duration of all blocks in this parameter definition, in units of 1 / parameter_rate.
static unsigned int get_bits1(GetBitContext *s)
static int audio_element_obu(void *s, IAMFContext *c, AVIOContext *pb, int len)
A layer defining a Channel Layout in the Audio Element.
#define FLAC_STREAMINFO_SIZE
#define AV_DICT_DONT_OVERWRITE
Don't overwrite existing entries.
AVChannelLayout ch_layout
Audio only.
const AVIAMFAudioElement * celement
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
int ff_mp4_read_descr(void *logctx, AVIOContext *pb, int *tag)
int sample_rate
Audio only.
int ff_iamf_parse_obu_header(const uint8_t *buf, int buf_size, unsigned *obu_size, int *start_pos, enum IAMF_OBU_Type *type, unsigned *skip_samples, unsigned *discard_padding)
unsigned int output_gain_flags
Output gain channel flags as defined in section 3.6.2 of IAMF.
AVCodecID
Identify the syntax and semantics of the bitstream.
unsigned int audio_element_id
The id of the Audio Element this submix element references.
int extradata_size
Size of the extradata content in bytes.
Submix layout as defined in section 3.7 of IAMF.
unsigned int subblock_duration
Duration for the given subblock, in units of 1 / parameter_rate.
unsigned int subblock_duration
Duration for the given subblock, in units of 1 / parameter_rate.
An AVChannelLayout holds information about the channel layout of audio data.
int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen)
Read a string from pb into buf.
static AVRational av_make_q(int num, int den)
Create an AVRational.
unsigned int coupled_substream_count
#define MKBETAG(a, b, c, d)
AVIAMFMixPresentation * av_iamf_mix_presentation_alloc(void)
Allocates a AVIAMFMixPresentation, and initializes its fields with default values.
static const uint8_t header[24]
int avio_r8(AVIOContext *s)
IAMFSubStream * substreams
unsigned int constant_subblock_duration
The duration of every subblock in the case where all subblocks, with the optional exception of the la...
AVIAMFSubmixElement * av_iamf_submix_add_element(AVIAMFSubmix *submix)
Allocate a submix element and add it to a given AVIAMFSubmix.
Information on how to combine one or more audio streams, as defined in section 3.6 of IAMF.
static int ipcm_decoder_config(IAMFCodecConfig *codec_config, AVIOContext *pb, int len)
int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size)
Ensures that the requested seekback buffer size will be available.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
Mix Gain Parameter Data as defined in section 3.8.1 of IAMF.
AVCodecParameters * avcodec_parameters_alloc(void)
Allocate a new AVCodecParameters and set its fields to default values (unknown/invalid/0).
static uint64_t get_bits64(GetBitContext *s, int n)
Read 0-64 bits.
#define i(width, name, range_min, range_max)
unsigned int parameter_id
Identifier for the paremeter substream.
AVRational * demixing_matrix
Demixing matrix as defined in section 3.6.3 of IAMF.
#define av_malloc_array(a, b)
Information on how to render and mix one or more AVIAMFAudioElement to generate the final audio outpu...
static int aac_decoder_config(IAMFCodecConfig *codec_config, AVIOContext *pb, int len, void *logctx)
static int param_definition(const IAMFContext *iamf, const IAMFParamDefinition *param_def, AVIOContext *dyn_bc, void *log_ctx)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
void * av_calloc(size_t nmemb, size_t size)
unsigned int nb_subblocks
Number of subblocks in the array.
@ AV_IAMF_AUDIO_ELEMENT_TYPE_SCENE
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
unsigned int avio_rb16(AVIOContext *s)
#define AV_INPUT_BUFFER_PADDING_SIZE
Tag MUST be and< 10hcoeff half pel interpolation filter coefficients, hcoeff[0] are the 2 middle coefficients[1] are the next outer ones and so on, resulting in a filter like:...eff[2], hcoeff[1], hcoeff[0], hcoeff[0], hcoeff[1], hcoeff[2] ... the sign of the coefficients is not explicitly stored but alternates after each coeff and coeff[0] is positive, so ...,+,-,+,-,+,+,-,+,-,+,... hcoeff[0] is not explicitly stored but found by subtracting the sum of all stored coefficients with signs from 32 hcoeff[0]=32 - hcoeff[1] - hcoeff[2] - ... a good choice for hcoeff and htaps is htaps=6 hcoeff={40,-10, 2} an alternative which requires more computations at both encoder and decoder side and may or may not be better is htaps=8 hcoeff={42,-14, 6,-2}ref_frames minimum of the number of available reference frames and max_ref_frames for example the first frame after a key frame always has ref_frames=1spatial_decomposition_type wavelet type 0 is a 9/7 symmetric compact integer wavelet 1 is a 5/3 symmetric compact integer wavelet others are reserved stored as delta from last, last is reset to 0 if always_reset||keyframeqlog quality(logarithmic quantizer scale) stored as delta from last, last is reset to 0 if always_reset||keyframemv_scale stored as delta from last, last is reset to 0 if always_reset||keyframe FIXME check that everything works fine if this changes between framesqbias dequantization bias stored as delta from last, last is reset to 0 if always_reset||keyframeblock_max_depth maximum depth of the block tree stored as delta from last, last is reset to 0 if always_reset||keyframequant_table quantization tableHighlevel bitstream structure:==============================--------------------------------------------|Header|--------------------------------------------|------------------------------------|||Block0||||split?||||yes no||||......... intra?||||:Block01 :yes no||||:Block02 :....... ..........||||:Block03 ::y DC ::ref index:||||:Block04 ::cb DC ::motion x :||||......... :cr DC ::motion y :||||....... ..........|||------------------------------------||------------------------------------|||Block1|||...|--------------------------------------------|------------ ------------ ------------|||Y subbands||Cb subbands||Cr subbands||||--- ---||--- ---||--- ---|||||LL0||HL0||||LL0||HL0||||LL0||HL0|||||--- ---||--- ---||--- ---||||--- ---||--- ---||--- ---|||||LH0||HH0||||LH0||HH0||||LH0||HH0|||||--- ---||--- ---||--- ---||||--- ---||--- ---||--- ---|||||HL1||LH1||||HL1||LH1||||HL1||LH1|||||--- ---||--- ---||--- ---||||--- ---||--- ---||--- ---|||||HH1||HL2||||HH1||HL2||||HH1||HL2|||||...||...||...|||------------ ------------ ------------|--------------------------------------------Decoding process:=================------------|||Subbands|------------||||------------|Intra DC||||LL0 subband prediction ------------|\ Dequantization ------------------- \||Reference frames|\ IDWT|------- -------|Motion \|||Frame 0||Frame 1||Compensation . OBMC v -------|------- -------|--------------. \------> Frame n output Frame Frame<----------------------------------/|...|------------------- Range Coder:============Binary Range Coder:------------------- The implemented range coder is an adapted version based upon "Range encoding: an algorithm for removing redundancy from a digitised message." by G. N. N. Martin. The symbols encoded by the Snow range coder are bits(0|1). The associated probabilities are not fix but change depending on the symbol mix seen so far. bit seen|new state ---------+----------------------------------------------- 0|256 - state_transition_table[256 - old_state];1|state_transition_table[old_state];state_transition_table={ 0, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 190, 191, 192, 194, 194, 195, 196, 197, 198, 199, 200, 201, 202, 202, 204, 205, 206, 207, 208, 209, 209, 210, 211, 212, 213, 215, 215, 216, 217, 218, 219, 220, 220, 222, 223, 224, 225, 226, 227, 227, 229, 229, 230, 231, 232, 234, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 248, 0, 0, 0, 0, 0, 0, 0};FIXME Range Coding of integers:------------------------- FIXME Neighboring Blocks:===================left and top are set to the respective blocks unless they are outside of the image in which case they are set to the Null block top-left is set to the top left block unless it is outside of the image in which case it is set to the left block if this block has no larger parent block or it is at the left side of its parent block and the top right block is not outside of the image then the top right block is used for top-right else the top-left block is used Null block y, cb, cr are 128 level, ref, mx and my are 0 Motion Vector Prediction:=========================1. the motion vectors of all the neighboring blocks are scaled to compensate for the difference of reference frames scaled_mv=(mv *(256 *(current_reference+1)/(mv.reference+1))+128)> the median of the scaled left
static int label_string(AVIOContext *pb, char **label)
@ AV_CHANNEL_ORDER_CUSTOM
The channel order does not correspond to any other predefined order and is stored as an explicit map.
AVRational default_mix_gain
Default mix gain value to apply when there are no AVIAMFParamDefinition with output_mix_config's para...
AVRational album_anchored_loudness
The Album loudness information, as defined in ITU-1770-4.
AVRational true_peak
The true peak of the audio signal, as defined in ITU-1770-4.
AVChannelLayout sound_system
Channel layout matching one of Sound Systems A to J of ITU-2051-3, plus 7.1.2ch, 3....
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
static av_const int sign_extend(int val, unsigned bits)
int eof_reached
true if was unable to read due to error or eof
@ AV_IAMF_PARAMETER_DEFINITION_MIX_GAIN
Subblocks are of struct type AVIAMFMixGain.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
static int mix_presentation_obu(void *s, IAMFContext *c, AVIOContext *pb, int len)
AVIAMFLayer * av_iamf_audio_element_add_layer(AVIAMFAudioElement *audio_element)
Allocate a layer and add it to a given AVIAMFAudioElement.
int av_channel_layout_copy(AVChannelLayout *dst, const AVChannelLayout *src)
Make a copy of a channel layout.
char * av_strdup(const char *s)
Duplicate a string.
AVIAMFParamDefinition * demixing_info
Demixing information used to reconstruct a scalable channel audio representation.
unsigned int dmixp_mode
Pre-defined combination of demixing parameters.
AVIAMFParamDefinition * output_mix_config
Information required for post-processing the mixed audio signal to generate the audio signal for play...
enum AVIAMFAmbisonicsMode ambisonics_mode
Ambisonics mode as defined in section 3.6.3 of IAMF.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
#define AV_CHANNEL_LAYOUT_BINAURAL
#define AV_CHANNEL_LAYOUT_MONO
@ AV_IAMF_SUBMIX_LAYOUT_TYPE_BINAURAL
The layout is binaural.
unsigned int flags
A bitmask which may contain a combination of AV_IAMF_LAYER_FLAG_* flags.
AVRational output_gain
Output gain as defined in section 3.6.2 of IAMF.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
AVIAMFParamDefinition * element_mix_config
Information required required for applying any processing to the referenced and rendered Audio Elemen...
@ AV_CHAN_AMBISONIC_BASE
Range of channels between AV_CHAN_AMBISONIC_BASE and AV_CHAN_AMBISONIC_END represent Ambisonic compon...
unsigned int parameter_rate
Sample rate for the paremeter substream.
Submix element as defined in section 3.7 of IAMF.
@ AV_IAMF_AUDIO_ELEMENT_TYPE_CHANNEL
unsigned int codec_config_id
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
AVIAMFParamDefinition * recon_gain_info
Recon gain information used to reconstruct a scalable channel audio representation.
AVIAMFMixPresentation * mix
mix backs cmix iff the AVIAMFMixPresentation is owned by this structure.
static int scalable_channel_layout_config(void *s, AVIOContext *pb, IAMFAudioElement *audio_element, const IAMFCodecConfig *codec_config)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_RB24
AVCodecParameters * codecpar
unsigned int mix_presentation_id
static void BS_FUNC() skip(BSCTX *bc, unsigned int n)
Skip n bits in the buffer.
@ AV_IAMF_PARAMETER_DEFINITION_DEMIXING
Subblocks are of struct type AVIAMFDemixingInfo.