FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
af_astats.c File Reference
#include <float.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 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)
 

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_stat (AudioStatsContext *s, ChannelStats *p, double d, double nd, int64_t i)
 
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_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 OFFSET (   x)    offsetof(AudioStatsContext, x)

Definition at line 59 of file af_astats.c.

Definition at line 60 of file af_astats.c.

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

Definition at line 231 of file af_astats.c.

Referenced by print_stats(), and set_metadata().

Function Documentation

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

Definition at line 71 of file af_astats.c.

static void reset_stats ( AudioStatsContext s)
static

Definition at line 105 of file af_astats.c.

Referenced by config_output(), and filter_frame().

static int config_output ( AVFilterLink outlink)
static

Definition at line 134 of file af_astats.c.

static void bit_depth ( AudioStatsContext s,
uint64_t  mask,
uint64_t  imask,
AVRational depth 
)
static
static void update_stat ( AudioStatsContext s,
ChannelStats p,
double  d,
double  nd,
int64_t  i 
)
inlinestatic

Definition at line 168 of file af_astats.c.

Referenced by filter_frame().

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

Definition at line 217 of file af_astats.c.

Referenced by set_metadata().

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

Definition at line 233 of file af_astats.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame buf 
)
static

Definition at line 316 of file af_astats.c.

static void print_stats ( AVFilterContext ctx)
static

Definition at line 425 of file af_astats.c.

Referenced by uninit().

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 511 of file af_astats.c.

Variable Documentation

const AVOption astats_options[]
static
Initial value:
= {
{ "length", "set the window length", OFFSET(time_constant), AV_OPT_TYPE_DOUBLE, {.dbl=.05}, .01, 10, FLAGS },
{ "metadata", "inject metadata in the filtergraph", OFFSET(metadata), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ "reset", "recalculate stats after this many frames", OFFSET(reset_count), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: af_astats.c:59
#define FLAGS
Definition: af_astats.c:60

Definition at line 62 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:316

Definition at line 520 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:134

Definition at line 529 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:71
static const AVFilterPad astats_inputs[]
Definition: af_astats.c:520
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_astats.c:511
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:179
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:389
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:379
static const AVFilterPad astats_outputs[]
Definition: af_astats.c:529

Definition at line 538 of file af_astats.c.