FFmpeg
af_drmeter.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 Paul B Mahol
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #include <float.h>
22 
23 #include "libavutil/ffmath.h"
24 #include "libavutil/opt.h"
25 #include "audio.h"
26 #include "avfilter.h"
27 #include "internal.h"
28 
29 typedef struct ChannelStats {
30  uint64_t nb_samples;
31  uint64_t blknum;
32  float peak;
33  float sum;
34  uint32_t peaks[10001];
35  uint32_t rms[10001];
36 } ChannelStats;
37 
38 typedef struct DRMeterContext {
39  const AVClass *class;
42  uint64_t tc_samples;
43  double time_constant;
45 
46 #define OFFSET(x) offsetof(DRMeterContext, x)
47 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
48 
49 static const AVOption drmeter_options[] = {
50  { "length", "set the window length", OFFSET(time_constant), AV_OPT_TYPE_DOUBLE, {.dbl=3}, .01, 10, FLAGS },
51  { NULL }
52 };
53 
54 AVFILTER_DEFINE_CLASS(drmeter);
55 
57 {
60  static const enum AVSampleFormat sample_fmts[] = {
63  };
64  int ret;
65 
67  if (!layouts)
68  return AVERROR(ENOMEM);
70  if (ret < 0)
71  return ret;
72 
74  if (!formats)
75  return AVERROR(ENOMEM);
77  if (ret < 0)
78  return ret;
79 
81  if (!formats)
82  return AVERROR(ENOMEM);
84 }
85 
86 static int config_output(AVFilterLink *outlink)
87 {
88  DRMeterContext *s = outlink->src->priv;
89 
90  s->chstats = av_calloc(sizeof(*s->chstats), outlink->channels);
91  if (!s->chstats)
92  return AVERROR(ENOMEM);
93  s->nb_channels = outlink->channels;
94  s->tc_samples = s->time_constant * outlink->sample_rate + .5;
95 
96  return 0;
97 }
98 
99 static void finish_block(ChannelStats *p)
100 {
101  int peak_bin, rms_bin;
102  float peak, rms;
103 
104  rms = sqrt(2 * p->sum / p->nb_samples);
105  peak = p->peak;
106  rms_bin = av_clip(rms * 10000, 0, 10000);
107  peak_bin = av_clip(peak * 10000, 0, 10000);
108  p->rms[rms_bin]++;
109  p->peaks[peak_bin]++;
110 
111  p->peak = 0;
112  p->sum = 0;
113  p->nb_samples = 0;
114  p->blknum++;
115 }
116 
118 {
119  if (p->nb_samples >= s->tc_samples) {
120  finish_block(p);
121  }
122 
123  p->peak = FFMAX(FFABS(sample), p->peak);
124  p->sum += sample * sample;
125  p->nb_samples++;
126 }
127 
129 {
130  DRMeterContext *s = inlink->dst->priv;
131  const int channels = s->nb_channels;
132  int i, c;
133 
134  switch (inlink->format) {
135  case AV_SAMPLE_FMT_FLTP:
136  for (c = 0; c < channels; c++) {
137  ChannelStats *p = &s->chstats[c];
138  const float *src = (const float *)buf->extended_data[c];
139 
140  for (i = 0; i < buf->nb_samples; i++, src++)
141  update_stat(s, p, *src);
142  }
143  break;
144  case AV_SAMPLE_FMT_FLT: {
145  const float *src = (const float *)buf->extended_data[0];
146 
147  for (i = 0; i < buf->nb_samples; i++) {
148  for (c = 0; c < channels; c++, src++)
149  update_stat(s, &s->chstats[c], *src);
150  }}
151  break;
152  }
153 
154  return ff_filter_frame(inlink->dst->outputs[0], buf);
155 }
156 
157 #define SQR(a) ((a)*(a))
158 
160 {
161  DRMeterContext *s = ctx->priv;
162  float dr = 0;
163  int ch;
164 
165  for (ch = 0; ch < s->nb_channels; ch++) {
166  ChannelStats *p = &s->chstats[ch];
167  float chdr, secondpeak, rmssum = 0;
168  int i, j, first = 0;
169 
170  if (!p->nb_samples) {
171  av_log(ctx, AV_LOG_INFO, "No data, dynamic range not meassurable\n");
172  return;
173  }
174 
175  finish_block(p);
176 
177  for (i = 0; i <= 10000; i++) {
178  if (p->peaks[10000 - i]) {
179  if (first)
180  break;
181  first = 1;
182  }
183  }
184 
185  secondpeak = (10000 - i) / 10000.;
186 
187  for (i = 10000, j = 0; i >= 0 && j < 0.2 * p->blknum; i--) {
188  if (p->rms[i]) {
189  rmssum += SQR(i / 10000.) * p->rms[i];
190  j += p->rms[i];
191  }
192  }
193 
194  chdr = 20 * log10(secondpeak / sqrt(rmssum / (0.2 * p->blknum)));
195  dr += chdr;
196  av_log(ctx, AV_LOG_INFO, "Channel %d: DR: %.1f\n", ch + 1, chdr);
197  }
198 
199  av_log(ctx, AV_LOG_INFO, "Overall DR: %.1f\n", dr / s->nb_channels);
200 }
201 
203 {
204  DRMeterContext *s = ctx->priv;
205 
206  if (s->nb_channels)
207  print_stats(ctx);
208  av_freep(&s->chstats);
209 }
210 
211 static const AVFilterPad drmeter_inputs[] = {
212  {
213  .name = "default",
214  .type = AVMEDIA_TYPE_AUDIO,
215  .filter_frame = filter_frame,
216  },
217  { NULL }
218 };
219 
220 static const AVFilterPad drmeter_outputs[] = {
221  {
222  .name = "default",
223  .type = AVMEDIA_TYPE_AUDIO,
224  .config_props = config_output,
225  },
226  { NULL }
227 };
228 
230  .name = "drmeter",
231  .description = NULL_IF_CONFIG_SMALL("Measure audio dynamic range."),
232  .query_formats = query_formats,
233  .priv_size = sizeof(DRMeterContext),
234  .priv_class = &drmeter_class,
235  .uninit = uninit,
238 };
formats
formats
Definition: signature.h:48
AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:69
AVFilterChannelLayouts
A list of supported channel layouts.
Definition: formats.h:85
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_drmeter.c:202
AVERROR
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
opt.h
ff_make_format_list
AVFilterFormats * ff_make_format_list(const int *fmts)
Create a list of supported formats.
Definition: formats.c:283
finish_block
static void finish_block(ChannelStats *p)
Definition: af_drmeter.c:99
ff_set_common_channel_layouts
int ff_set_common_channel_layouts(AVFilterContext *ctx, AVFilterChannelLayouts *layouts)
A helper for query_formats() which sets all links to the same list of channel layouts/sample rates.
Definition: formats.c:549
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1080
sample_fmts
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:686
layouts
enum MovChannelLayoutTag * layouts
Definition: mov_chan.c:434
DRMeterContext::tc_samples
uint64_t tc_samples
Definition: af_drmeter.c:42
ch
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/(INT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S64, *(const int64_t *) pi *(1.0/(INT64_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 *(INT64_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 *(INT64_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 ch
Definition: audioconvert.c:56
inlink
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
Definition: filter_design.txt:212
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
Definition: af_drmeter.c:128
ff_all_channel_counts
AVFilterChannelLayouts * ff_all_channel_counts(void)
Construct an AVFilterChannelLayouts coding for any channel layout, with known or unknown disposition.
Definition: formats.c:410
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:295
AVOption
AVOption.
Definition: opt.h:246
float.h
channels
channels
Definition: aptx.c:30
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:148
DRMeterContext::time_constant
double time_constant
Definition: af_drmeter.c:43
ChannelStats::rms
uint32_t rms[10001]
Definition: af_drmeter.c:35
AVFilterFormats
A list of supported formats for one end of a filter link.
Definition: formats.h:64
DRMeterContext::chstats
ChannelStats * chstats
Definition: af_drmeter.c:40
AVFILTER_DEFINE_CLASS
AVFILTER_DEFINE_CLASS(drmeter)
AVFilterContext::priv
void * priv
private data for use by the filter
Definition: avfilter.h:353
src
#define src
Definition: vp8dsp.c:254
AVFilterPad
A filter pad used for either input or output.
Definition: internal.h:54
update_stat
static void update_stat(DRMeterContext *s, ChannelStats *p, float sample)
Definition: af_drmeter.c:117
first
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But first
Definition: rate_distortion.txt:12
buf
void * buf
Definition: avisynth_c.h:766
av_cold
#define av_cold
Definition: attributes.h:84
ff_set_common_formats
int ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
Definition: formats.c:568
print_stats
static void print_stats(AVFilterContext *ctx)
Definition: af_drmeter.c:159
s
#define s(width, name)
Definition: cbs_vp9.c:257
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:225
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
ChannelStats::peaks
uint32_t peaks[10001]
Definition: af_drmeter.c:34
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
ctx
AVFormatContext * ctx
Definition: movenc.c:48
SQR
#define SQR(a)
Definition: af_drmeter.c:157
FFABS
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition: common.h:72
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:67
NULL
#define NULL
Definition: coverity.c:32
inputs
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
Definition: filter_design.txt:243
config_output
static int config_output(AVFilterLink *outlink)
Definition: af_drmeter.c:86
DRMeterContext
Definition: af_drmeter.c:38
c
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
for
for(j=16;j >0;--j)
Definition: h264pred_template.c:469
drmeter_options
static const AVOption drmeter_options[]
Definition: af_drmeter.c:49
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
FFMAX
#define FFMAX(a, b)
Definition: common.h:94
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:59
sample
#define sample
Definition: flacdsp_template.c:44
ChannelStats::nb_samples
uint64_t nb_samples
Definition: af_astats.c:74
FLAGS
#define FLAGS
Definition: af_drmeter.c:47
OFFSET
#define OFFSET(x)
Definition: af_drmeter.c:46
AV_LOG_INFO
#define AV_LOG_INFO
Standard information.
Definition: log.h:187
internal.h
DRMeterContext::nb_channels
int nb_channels
Definition: af_drmeter.c:41
ChannelStats
Definition: af_astats.c:58
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:259
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
AVFilterPad::name
const char * name
Pad name.
Definition: internal.h:60
AVFilter
Filter definition.
Definition: avfilter.h:144
ret
ret
Definition: filter_design.txt:187
ff_all_samplerates
AVFilterFormats * ff_all_samplerates(void)
Definition: formats.c:395
av_calloc
void * av_calloc(size_t nmemb, size_t size)
Non-inlined equivalent of av_mallocz_array().
Definition: mem.c:244
avfilter.h
ffmath.h
AVFilterContext
An instance of a filter.
Definition: avfilter.h:338
audio.h
ff_af_drmeter
AVFilter ff_af_drmeter
Definition: af_drmeter.c:229
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_drmeter.c:56
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:35
ChannelStats::peak
float peak
Definition: af_drmeter.c:32
ChannelStats::blknum
uint64_t blknum
Definition: af_drmeter.c:31
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:28
ff_set_common_samplerates
int ff_set_common_samplerates(AVFilterContext *ctx, AVFilterFormats *samplerates)
Definition: formats.c:556
drmeter_outputs
static const AVFilterPad drmeter_outputs[]
Definition: af_drmeter.c:220
ChannelStats::sum
float sum
Definition: af_drmeter.c:33
AV_SAMPLE_FMT_FLT
@ AV_SAMPLE_FMT_FLT
float
Definition: samplefmt.h:63
drmeter_inputs
static const AVFilterPad drmeter_inputs[]
Definition: af_drmeter.c:211