FFmpeg
Data Structures | Macros | Functions | Variables
af_astats.c File Reference
#include <float.h>
#include <math.h>
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  ChannelStats
 
struct  AudioStatsContext
 

Macros

#define HISTOGRAM_SIZE   8192
 
#define HISTOGRAM_MAX   (HISTOGRAM_SIZE-1)
 
#define MEASURE_ALL   UINT_MAX
 
#define MEASURE_NONE   0
 
#define MEASURE_DC_OFFSET   (1 << 0)
 
#define MEASURE_MIN_LEVEL   (1 << 1)
 
#define MEASURE_MAX_LEVEL   (1 << 2)
 
#define MEASURE_MIN_DIFFERENCE   (1 << 3)
 
#define MEASURE_MAX_DIFFERENCE   (1 << 4)
 
#define MEASURE_MEAN_DIFFERENCE   (1 << 5)
 
#define MEASURE_RMS_DIFFERENCE   (1 << 6)
 
#define MEASURE_PEAK_LEVEL   (1 << 7)
 
#define MEASURE_RMS_LEVEL   (1 << 8)
 
#define MEASURE_RMS_PEAK   (1 << 9)
 
#define MEASURE_RMS_TROUGH   (1 << 10)
 
#define MEASURE_CREST_FACTOR   (1 << 11)
 
#define MEASURE_FLAT_FACTOR   (1 << 12)
 
#define MEASURE_PEAK_COUNT   (1 << 13)
 
#define MEASURE_BIT_DEPTH   (1 << 14)
 
#define MEASURE_DYNAMIC_RANGE   (1 << 15)
 
#define MEASURE_ZERO_CROSSINGS   (1 << 16)
 
#define MEASURE_ZERO_CROSSINGS_RATE   (1 << 17)
 
#define MEASURE_NUMBER_OF_SAMPLES   (1 << 18)
 
#define MEASURE_NUMBER_OF_NANS   (1 << 19)
 
#define MEASURE_NUMBER_OF_INFS   (1 << 20)
 
#define MEASURE_NUMBER_OF_DENORMALS   (1 << 21)
 
#define MEASURE_NOISE_FLOOR   (1 << 22)
 
#define MEASURE_NOISE_FLOOR_COUNT   (1 << 23)
 
#define MEASURE_MINMAXPEAK   (MEASURE_MIN_LEVEL | MEASURE_MAX_LEVEL | MEASURE_PEAK_LEVEL)
 
#define OFFSET(x)   offsetof(AudioStatsContext, x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define LINEAR_TO_DB(x)   (log10(x) * 20)
 
#define UPDATE_STATS_P(type, update_func, update_float, channel_func)
 
#define UPDATE_STATS_I(type, update_func, update_float, channel_func)
 
#define UPDATE_STATS(planar, type, sample, normalizer_suffix, int_sample)
 

Functions

 AVFILTER_DEFINE_CLASS (astats)
 
static int query_formats (AVFilterContext *ctx)
 
static void reset_stats (AudioStatsContext *s)
 
static int config_output (AVFilterLink *outlink)
 
static void bit_depth (AudioStatsContext *s, uint64_t mask, uint64_t imask, AVRational *depth)
 
static void update_minmax (AudioStatsContext *s, ChannelStats *p, double d)
 
static void update_stat (AudioStatsContext *s, ChannelStats *p, double d, double nd, int64_t i)
 
static void update_float_stat (AudioStatsContext *s, ChannelStats *p, float d)
 
static void update_double_stat (AudioStatsContext *s, ChannelStats *p, double d)
 
static void set_meta (AVDictionary **metadata, int chan, const char *key, const char *fmt, double val)
 
static void set_metadata (AudioStatsContext *s, AVDictionary **metadata)
 
static int filter_channel (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *buf)
 
static void print_stats (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption astats_options []
 
static const AVFilterPad astats_inputs []
 
static const AVFilterPad astats_outputs []
 
AVFilter ff_af_astats
 

Macro Definition Documentation

#define HISTOGRAM_SIZE   8192

Definition at line 30 of file af_astats.c.

#define HISTOGRAM_MAX   (HISTOGRAM_SIZE-1)

Definition at line 31 of file af_astats.c.

Referenced by update_stat().

#define MEASURE_ALL   UINT_MAX

Definition at line 33 of file af_astats.c.

#define MEASURE_NONE   0

Definition at line 34 of file af_astats.c.

#define MEASURE_DC_OFFSET   (1 << 0)

Definition at line 36 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_MIN_LEVEL   (1 << 1)

Definition at line 37 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_MAX_LEVEL   (1 << 2)

Definition at line 38 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_MIN_DIFFERENCE   (1 << 3)

Definition at line 39 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_MAX_DIFFERENCE   (1 << 4)

Definition at line 40 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_MEAN_DIFFERENCE   (1 << 5)

Definition at line 41 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_RMS_DIFFERENCE   (1 << 6)

Definition at line 42 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_PEAK_LEVEL   (1 << 7)

Definition at line 43 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_RMS_LEVEL   (1 << 8)

Definition at line 44 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_RMS_PEAK   (1 << 9)

Definition at line 45 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_RMS_TROUGH   (1 << 10)

Definition at line 46 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_CREST_FACTOR   (1 << 11)

Definition at line 47 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_FLAT_FACTOR   (1 << 12)

Definition at line 48 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_PEAK_COUNT   (1 << 13)

Definition at line 49 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_BIT_DEPTH   (1 << 14)

Definition at line 50 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_DYNAMIC_RANGE   (1 << 15)

Definition at line 51 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_ZERO_CROSSINGS   (1 << 16)

Definition at line 52 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_ZERO_CROSSINGS_RATE   (1 << 17)

Definition at line 53 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_NUMBER_OF_SAMPLES   (1 << 18)

Definition at line 54 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_NUMBER_OF_NANS   (1 << 19)

Definition at line 55 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_NUMBER_OF_INFS   (1 << 20)

Definition at line 56 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_NUMBER_OF_DENORMALS   (1 << 21)

Definition at line 57 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_NOISE_FLOOR   (1 << 22)

Definition at line 58 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_NOISE_FLOOR_COUNT   (1 << 23)

Definition at line 59 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define MEASURE_MINMAXPEAK   (MEASURE_MIN_LEVEL | MEASURE_MAX_LEVEL | MEASURE_PEAK_LEVEL)

Definition at line 61 of file af_astats.c.

#define OFFSET (   x)    offsetof(AudioStatsContext, x)

Definition at line 108 of file af_astats.c.

Definition at line 109 of file af_astats.c.

#define LINEAR_TO_DB (   x)    (log10(x) * 20)

Definition at line 407 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

#define UPDATE_STATS_P (   type,
  update_func,
  update_float,
  channel_func 
)
Value:
for (int c = start; c < end; c++) { \
ChannelStats *p = &s->chstats[c]; \
const type *src = (const type *)data[c]; \
const type * const srcend = src + samples; \
for (; src < srcend; src++) { \
update_func; \
update_float; \
} \
channel_func; \
}
ptrdiff_t const GLvoid * data
Definition: opengl_enc.c:100
GLint GLenum type
Definition: opengl_enc.c:104
static av_cold int end(AVCodecContext *avctx)
Definition: avrndec.c:90
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
Definition: undefined.txt:32
#define src
Definition: vp8dsp.c:254
#define s(width, name)
Definition: cbs_vp9.c:257
Filter the word “frame” indicates either a video frame or a group of audio samples
for(j=16;j >0;--j)

Definition at line 556 of file af_astats.c.

#define UPDATE_STATS_I (   type,
  update_func,
  update_float,
  channel_func 
)
Value:
for (int c = start; c < end; c++) { \
ChannelStats *p = &s->chstats[c]; \
const type *src = (const type *)data[0]; \
const type * const srcend = src + samples * channels; \
for (src += c; src < srcend; src += channels) { \
update_func; \
update_float; \
} \
channel_func; \
}
ptrdiff_t const GLvoid * data
Definition: opengl_enc.c:100
GLint GLenum type
Definition: opengl_enc.c:104
static av_cold int end(AVCodecContext *avctx)
Definition: avrndec.c:90
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
Definition: undefined.txt:32
channels
Definition: aptx.h:33
#define src
Definition: vp8dsp.c:254
#define s(width, name)
Definition: cbs_vp9.c:257
Filter the word “frame” indicates either a video frame or a group of audio samples
for(j=16;j >0;--j)

Definition at line 568 of file af_astats.c.

#define UPDATE_STATS (   planar,
  type,
  sample,
  normalizer_suffix,
  int_sample 
)
Value:
if ((s->measure_overall | s->measure_perchannel) & ~MEASURE_MINMAXPEAK) { \
UPDATE_STATS_##planar(type, update_stat(s, p, sample, sample normalizer_suffix, int_sample), s->is_float ? update_float_stat(s, p, sample) : s->is_double ? update_double_stat(s, p, sample) : (void)NULL, ); \
} else { \
UPDATE_STATS_##planar(type, update_minmax(s, p, sample), , p->nmin = p->min normalizer_suffix; p->nmax = p->max normalizer_suffix;); \
}
#define NULL
Definition: coverity.c:32
GLint GLenum type
Definition: opengl_enc.c:104
static void update_minmax(AudioStatsContext *s, ChannelStats *p, double d)
Definition: af_astats.c:270
#define sample
static void update_stat(AudioStatsContext *s, ChannelStats *p, double d, double nd, int64_t i)
Definition: af_astats.c:278
static void update_float_stat(AudioStatsContext *s, ChannelStats *p, float d)
Definition: af_astats.c:375
#define s(width, name)
Definition: cbs_vp9.c:257
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_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(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(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;}}if(HAVE_X86ASM &&1) swri_audio_convert_init_x86(ctx, out_fmt, in_fmt, channels);if(ARCH_ARM) swri_audio_convert_init_arm(ctx, out_fmt, in_fmt, channels);if(ARCH_AARCH64) swri_audio_convert_init_aarch64(ctx, out_fmt, in_fmt, channels);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 const uint8_t **in ch off *out planar
Definition: audioconvert.c:56
#define MEASURE_MINMAXPEAK
Definition: af_astats.c:61
static void update_double_stat(AudioStatsContext *s, ChannelStats *p, double d)
Definition: af_astats.c:384

Definition at line 580 of file af_astats.c.

Referenced by filter_channel().

Function Documentation

AVFILTER_DEFINE_CLASS ( astats  )
static int query_formats ( AVFilterContext ctx)
static

Definition at line 148 of file af_astats.c.

static void reset_stats ( AudioStatsContext s)
static

Definition at line 182 of file af_astats.c.

Referenced by config_output(), and filter_frame().

static int config_output ( AVFilterLink outlink)
static

Definition at line 221 of file af_astats.c.

static void bit_depth ( AudioStatsContext s,
uint64_t  mask,
uint64_t  imask,
AVRational depth 
)
static
static void update_minmax ( AudioStatsContext s,
ChannelStats p,
double  d 
)
inlinestatic

Definition at line 270 of file af_astats.c.

static void update_stat ( AudioStatsContext s,
ChannelStats p,
double  d,
double  nd,
int64_t  i 
)
inlinestatic

Definition at line 278 of file af_astats.c.

static void update_float_stat ( AudioStatsContext s,
ChannelStats p,
float  d 
)
inlinestatic

Definition at line 375 of file af_astats.c.

static void update_double_stat ( AudioStatsContext s,
ChannelStats p,
double  d 
)
inlinestatic

Definition at line 384 of file af_astats.c.

static void set_meta ( AVDictionary **  metadata,
int  chan,
const char *  key,
const char *  fmt,
double  val 
)
static

Definition at line 393 of file af_astats.c.

Referenced by set_metadata().

static void set_metadata ( AudioStatsContext s,
AVDictionary **  metadata 
)
static

Definition at line 409 of file af_astats.c.

Referenced by filter_frame().

static int filter_channel ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 587 of file af_astats.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame buf 
)
static

Definition at line 634 of file af_astats.c.

static void print_stats ( AVFilterContext ctx)
static

Definition at line 656 of file af_astats.c.

Referenced by uninit().

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 806 of file af_astats.c.

Variable Documentation

const AVOption astats_options[]
static

Definition at line 111 of file af_astats.c.

const AVFilterPad astats_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
Definition: af_astats.c:634

Definition at line 822 of file af_astats.c.

const AVFilterPad astats_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_output(AVFilterLink *outlink)
Definition: af_astats.c:221

Definition at line 831 of file af_astats.c.

AVFilter ff_af_astats
Initial value:
= {
.name = "astats",
.description = NULL_IF_CONFIG_SMALL("Show time domain statistics about audio frames."),
.query_formats = query_formats,
.priv_size = sizeof(AudioStatsContext),
.priv_class = &astats_class,
}
static int query_formats(AVFilterContext *ctx)
Definition: af_astats.c:148
static const AVFilterPad astats_inputs[]
Definition: af_astats.c:822
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_astats.c:806
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:153
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
#define flags(name, subs,...)
Definition: cbs_av1.c:560
static const AVFilterPad astats_outputs[]
Definition: af_astats.c:831

Definition at line 840 of file af_astats.c.