Go to the documentation of this file.
86 if (sd->
size <
sizeof(*di)) {
102 "surround %f (%f ltrt) - lfe %f",
111 if (gain == INT32_MIN)
133 if (sd->
size <
sizeof(*rg)) {
150 if (sd->
size <
sizeof(*ast)) {
173 switch (param->
type) {
192 "parameter_rate=%d, "
194 "constant_subblock_duration=%d,",
206 switch (param->
type) {
210 "subblock_duration=%d, "
211 "animation_type=%d, "
212 "start_point_value=%d/%d, "
213 "end_point_value=%d/%d, "
214 "control_point_value=%d/%d, "
215 "control_point_relative_time=%d/%d",
216 mix->subblock_duration,
218 mix->start_point_value.num,
mix->start_point_value.den,
219 mix->end_point_value.num,
mix->end_point_value.den,
220 mix->control_point_value.num,
mix->control_point_value.den,
221 mix->control_point_relative_time.num,
mix->control_point_relative_time.den
228 "subblock_duration=%d, "
259 char chlayout_str[128];
260 uint32_t checksum = 0;
264 int data_size = buf->
nb_samples * block_align;
271 s->plane_checksums = tmp_ptr;
278 s->plane_checksums[0];
284 "n:%"PRId64
" pts:%s pts_time:%s "
285 "fmt:%s channels:%d chlayout:%s rate:%d nb_samples:%d "
286 "checksum:%08"PRIX32
" ",
330 .
p.
name =
"ashowinfo",
@ AV_FRAME_DATA_IAMF_MIX_GAIN_PARAM
IAMF Mix Gain Parameter Data associated with the audio frame.
#define AV_LOG_WARNING
Something somehow does not look correct.
static int mix(int c0, int c1)
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
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static void dump_unknown(AVFilterContext *ctx, AVFrameSideData *sd)
@ AV_FRAME_DATA_IAMF_RECON_GAIN_INFO_PARAM
IAMF Recon Gain Info Parameter Data associated with the audio frame.
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
enum AVIAMFParamDefinitionType type
Parameters type.
int32_t album_gain
Same as track_gain, but for the whole album.
@ AV_AUDIO_SERVICE_TYPE_VOICE_OVER
Parameters as defined in section 3.6.1 of IAMF.
const char * name
Filter name.
int nb_channels
Number of channels in this layout.
A link between two filters.
double surround_mix_level_ltrt
Absolute scale factor representing the nominal level of the surround channels during an Lt/Rt compati...
Link properties exposed to filter code, but not external callers.
@ AV_FRAME_DATA_MATRIXENCODING
The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h.
AVChannelLayout ch_layout
Channel layout of the audio data.
This structure describes optional metadata relevant to a downmix procedure.
uint8_t pi<< 24) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_U8,(uint64_t)((*(const uint8_t *) pi - 0x80U))<< 56) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16,(*(const int16_t *) pi >>8)+0x80) CONV_FUNC(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_S16, *(const int16_t *) pi *(1<< 16)) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_S16,(uint64_t)(*(const int16_t *) pi)<< 48) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32,(*(const int32_t *) pi >>24)+0x80) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_S32,(uint64_t)(*(const int32_t *) pi)<< 32) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S64,(*(const int64_t *) pi >>56)+0x80) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S64, *(const int64_t *) pi *(1.0f/(UINT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S64, *(const int64_t *) pi *(1.0/(UINT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_FLT, llrintf(*(const float *) pi *(UINT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_DBL, llrint(*(const double *) pi *(UINT64_C(1)<< 63))) #define FMT_PAIR_FUNC(out, in) static conv_func_type *const fmt_pair_to_conv_functions[AV_SAMPLE_FMT_NB *AV_SAMPLE_FMT_NB]={ FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(A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NC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S64), };static void cpy1(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, len);} static void cpy2(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, 2 *len);} static void cpy4(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, 4 *len);} static void cpy8(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, 8 *len);} AudioConvert *swri_audio_convert_alloc(enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, const int *ch_map, int flags) { AudioConvert *ctx;conv_func_type *f=fmt_pair_to_conv_functions[av_get_packed_sample_fmt(out_fmt)+AV_SAMPLE_FMT_NB *av_get_packed_sample_fmt(in_fmt)];if(!f) return NULL;ctx=av_mallocz(sizeof(*ctx));if(!ctx) return NULL;if(channels==1){ in_fmt=av_get_planar_sample_fmt(in_fmt);out_fmt=av_get_planar_sample_fmt(out_fmt);} ctx->channels=channels;ctx->conv_f=f;ctx->ch_map=ch_map;if(in_fmt==AV_SAMPLE_FMT_U8||in_fmt==AV_SAMPLE_FMT_U8P) memset(ctx->silence, 0x80, sizeof(ctx->silence));if(out_fmt==in_fmt &&!ch_map) { switch(av_get_bytes_per_sample(in_fmt)){ case 1:ctx->simd_f=cpy1;break;case 2:ctx->simd_f=cpy2;break;case 4:ctx->simd_f=cpy4;break;case 8:ctx->simd_f=cpy8;break;} } return ctx;} void swri_audio_convert_free(AudioConvert **ctx) { av_freep(ctx);} int swri_audio_convert(AudioConvert *ctx, AudioData *out, AudioData *in, int len) { int ch;int off=0;const int os=(out->planar ? 1 :out->ch_count) *out->bps;unsigned misaligned=0;av_assert0(ctx->channels==out->ch_count);if(ctx->in_simd_align_mask) { int planes=in->planar ? in->ch_count :1;unsigned m=0;for(ch=0;ch< planes;ch++) m|=(intptr_t) in->ch[ch];misaligned|=m &ctx->in_simd_align_mask;} if(ctx->out_simd_align_mask) { int planes=out->planar ? out->ch_count :1;unsigned m=0;for(ch=0;ch< planes;ch++) m|=(intptr_t) out->ch[ch];misaligned|=m &ctx->out_simd_align_mask;} if(ctx->simd_f &&!ctx->ch_map &&!misaligned){ off=len &~15;av_assert1(off >=0);av_assert1(off<=len);av_assert2(ctx->channels==SWR_CH_MAX||!in->ch[ctx->channels]);if(off >0){ if(out->planar==in->planar){ int planes=out->planar ? out->ch_count :1;for(ch=0;ch< planes;ch++){ ctx->simd_f(out->ch+ch,(const uint8_t **) in->ch+ch, off *(out-> planar
Recon Gain Info Parameter Data as defined in section 3.8.3 of IAMF.
A filter pad used for either input or output.
@ AV_IAMF_PARAMETER_DEFINITION_RECON_GAIN
Subblocks are of struct type AVIAMFReconGain.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ AV_MATRIX_ENCODING_DOLBY
const FFFilter ff_af_ashowinfo
int av_channel_layout_describe(const AVChannelLayout *channel_layout, char *buf, size_t buf_size)
Get a human-readable string describing the channel layout properties.
uint32_t * plane_checksums
Scratch space for individual plane checksums for planar audio.
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
@ AV_FRAME_DATA_IAMF_DEMIXING_INFO_PARAM
IAMF Demixing Info Parameter Data associated with the audio frame.
#define FILTER_OUTPUTS(array)
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
static void dump_downmix(AVFilterContext *ctx, AVFrameSideData *sd)
static FilterLink * ff_filter_link(AVFilterLink *link)
static av_always_inline void * av_iamf_param_definition_get_subblock(const AVIAMFParamDefinition *par, unsigned int idx)
Get the subblock at the specified.
@ AV_FRAME_DATA_AUDIO_SERVICE_TYPE
This side data must be associated with an audio frame and corresponds to enum AVAudioServiceType defi...
int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
Check if the sample format is planar.
static AVFormatContext * ctx
@ AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED
@ AV_MATRIX_ENCODING_DPLIIX
const char * av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
Return the name of sample_fmt, or NULL if sample_fmt is not recognized.
uint32_t track_peak
Peak track amplitude, with 100000 representing full scale (but values may overflow).
@ AV_MATRIX_ENCODING_DOLBYHEADPHONE
Demixing Info Parameter Data as defined in section 3.8.2 of IAMF.
static av_cold void uninit(AVFilterContext *ctx)
static void dump_matrixenc(AVFilterContext *ctx, AVFrameSideData *sd)
double surround_mix_level
Absolute scale factor representing the nominal level of the surround channels during a regular downmi...
unsigned int duration
The accumulated duration of all blocks in this parameter definition, in units of 1 / parameter_rate.
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
@ AV_AUDIO_SERVICE_TYPE_EMERGENCY
static void print_gain(AVFilterContext *ctx, const char *str, int32_t gain)
AVAdler av_adler32_update(AVAdler adler, const uint8_t *buf, size_t len)
Calculate the Adler32 checksum of a buffer.
unsigned int subblock_duration
Duration for the given subblock, in units of 1 / parameter_rate.
#define av_ts2timestr(ts, tb)
Convenience macro, the return value should be used only directly in function arguments but never stan...
unsigned int subblock_duration
Duration for the given subblock, in units of 1 / parameter_rate.
@ AV_FRAME_DATA_REPLAYGAIN
ReplayGain information in the form of the AVReplayGain struct.
static void dump_iamf_parameter_definition(AVFilterContext *ctx, const AVFrameSideData *sd)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define i(width, name, range_min, range_max)
int sample_rate
Sample rate of the audio data.
@ AV_MATRIX_ENCODING_NONE
static void dump_audio_service_type(AVFilterContext *ctx, AVFrameSideData *sd)
static void print_peak(AVFilterContext *ctx, const char *str, uint32_t peak)
double center_mix_level_ltrt
Absolute scale factor representing the nominal level of the center channel during an Lt/Rt compatible...
int32_t track_gain
Track replay gain in microbels (divide by 100000 to get the value in dB).
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
unsigned int constant_subblock_duration
The duration of every subblock in the case where all subblocks, with the optional exception of the la...
Mix Gain Parameter Data as defined in section 3.8.1 of IAMF.
double lfe_mix_level
Absolute scale factor representing the level at which the LFE data is mixed into L/R channels during ...
#define AV_LOG_INFO
Standard information.
int nb_samples
number of audio samples (per channel) described by this frame
double center_mix_level
Absolute scale factor representing the nominal level of the center channel during a regular downmix.
unsigned int parameter_id
Identifier for the parameter substream.
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt)
Return number of bytes per sample.
uint8_t ** extended_data
pointers to the data planes/channels.
static const struct @596 planes[]
enum AVDownmixType preferred_downmix_type
Type of downmix preferred by the mastering engineer.
@ AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED
@ AV_DOWNMIX_TYPE_LORO
Lo/Ro 2-channel downmix (Stereo).
AVFrameSideData ** side_data
const char * name
Pad name.
unsigned int nb_subblocks
Number of subblocks in the array.
static const AVFilterPad inputs[]
@ AV_AUDIO_SERVICE_TYPE_KARAOKE
#define FILTER_INPUTS(array)
@ AV_MATRIX_ENCODING_DOLBYEX
@ AV_AUDIO_SERVICE_TYPE_COMMENTARY
@ AV_DOWNMIX_TYPE_DPLII
Lt/Rt 2-channel downmix, Dolby Pro Logic II compatible.
uint32_t album_peak
Same as track_peak, but for the whole album,.
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
enum AVFrameSideDataType type
@ AV_IAMF_PARAMETER_DEFINITION_MIX_GAIN
Subblocks are of struct type AVIAMFMixGain.
ReplayGain information (see http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1....
AVFilter p
The public AVFilter.
unsigned int dmixp_mode
Pre-defined combination of demixing parameters.
Structure to hold side data for an AVFrame.
@ AV_AUDIO_SERVICE_TYPE_EFFECTS
@ AV_MATRIX_ENCODING_DPLIIZ
unsigned int parameter_rate
Sample rate for the parameter substream.
#define av_ts2str(ts)
Convenience macro, the return value should be used only directly in function arguments but never stan...
@ AV_AUDIO_SERVICE_TYPE_DIALOGUE
static void dump_replaygain(AVFilterContext *ctx, AVFrameSideData *sd)
@ AV_DOWNMIX_TYPE_LTRT
Lt/Rt 2-channel downmix, Dolby Surround compatible.
@ AV_FRAME_DATA_DOWNMIX_INFO
Metadata relevant to a downmix procedure.
@ AV_AUDIO_SERVICE_TYPE_MAIN
@ AV_MATRIX_ENCODING_DPLII
@ AV_IAMF_PARAMETER_DEFINITION_DEMIXING
Subblocks are of struct type AVIAMFDemixingInfo.