49 #define OFFSET(x) offsetof(AudioStatsContext, x)
50 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
118 }
else if (d == p->
min) {
121 }
else if (p->
last == p->
min) {
130 }
else if (d == p->
max) {
133 }
else if (p->
last == p->
max) {
158 for (c = 0; c < channels; c++) {
170 for (c = 0; c < channels; c++, src++)
179 #define LINEAR_TO_DB(x) (log10(x) * 20)
184 uint64_t min_count = 0, max_count = 0, nb_samples = 0;
185 double min_runs = 0, max_runs = 0,
186 min = DBL_MAX, max = DBL_MIN,
190 min_sigma_x2 = DBL_MAX,
191 max_sigma_x2 = DBL_MIN;
211 if (fabs(p->
sigma_x) > fabs(max_sigma_x))
235 if (min_sigma_x2 != 1)
274 .priv_class = &astats_class,
This structure describes decoded (raw) audio or video data.
static int query_formats(AVFilterContext *ctx)
static const AVFilterPad outputs[]
static void update_stat(AudioStatsContext *s, ChannelStats *p, double d)
Main libavfilter public API header.
static enum AVSampleFormat formats[]
const char * name
Pad name.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static const AVFilterPad astats_inputs[]
A filter pad used for either input or output.
A link between two filters.
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
static av_cold void uninit(AVFilterContext *ctx)
int sample_rate
samples per second
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
AVFILTER_DEFINE_CLASS(astats)
static void print_stats(AVFilterContext *ctx)
static int config_output(AVFilterLink *outlink)
AVFilterContext * src
source filter
int format
agreed upon media format
A list of supported channel layouts.
static const AVOption astats_options[]
#define AV_LOG_INFO
Standard information.
AVSampleFormat
Audio sample formats.
Describe the class of an AVClass context structure.
static const AVFilterPad inputs[]
const char * name
Filter name.
AVFilterLink ** outputs
array of pointers to output links
enum MovChannelLayoutTag * layouts
void * av_calloc(size_t nmemb, size_t size)
Allocate a block of nmemb * size bytes with alignment suitable for all memory accesses (including vec...
int channels
Number of channels.
AVFilterContext * dst
dest filter
static const AVFilterPad astats_outputs[]
static enum AVSampleFormat sample_fmts[]
uint8_t ** extended_data
pointers to the data planes/channels.
int nb_samples
number of audio samples (per channel) described by this frame