Go to the documentation of this file.
48 #define OFFSET(x) offsetof(DRMeterContext, x)
49 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
73 int peak_bin, rms_bin;
126 #define SQR(a) ((a)*(a))
133 for (
int ch = 0; ch <
s->nb_channels; ch++) {
135 float chdr, secondpeak, rmssum = 0.f;
147 for (
int i =
BINS;
i >= 0;
i--) {
166 chdr = 20.f *
log10f(secondpeak /
sqrtf(rmssum / (
float)last));
203 .priv_class = &drmeter_class,
@ AV_SAMPLE_FMT_FLTP
float, planar
static av_cold void uninit(AVFilterContext *ctx)
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
static void finish_block(ChannelStats *p)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
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
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
This structure describes decoded (raw) audio or video data.
const char * name
Filter name.
int nb_channels
Number of channels in this layout.
A link between two filters.
AVFILTER_DEFINE_CLASS(drmeter)
void * priv
private data for use by the filter
static __device__ float fabsf(float a)
A filter pad used for either input or output.
static void update_stat(DRMeterContext *s, ChannelStats *p, float sample)
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But first
static void print_stats(AVFilterContext *ctx)
#define FILTER_INPUTS(array)
Describe the class of an AVClass context structure.
static __device__ float sqrtf(float a)
static int config_output(AVFilterLink *outlink)
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
static const AVOption drmeter_options[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
float fmaxf(float, float)
const AVFilter ff_af_drmeter
AVFilterContext * src
source filter
#define AV_LOG_INFO
Standard information.
int sample_rate
samples per second
int nb_samples
number of audio samples (per channel) described by this frame
#define i(width, name, range_min, range_max)
uint8_t ** extended_data
pointers to the data planes/channels.
const char * name
Pad name.
void * av_calloc(size_t nmemb, size_t size)
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
AVChannelLayout ch_layout
channel layout of current buffer (see libavutil/channel_layout.h)
#define FILTER_OUTPUTS(array)
#define flags(name, subs,...)
static const AVFilterPad drmeter_outputs[]
static const AVFilterPad drmeter_inputs[]
#define FILTER_SAMPLEFMTS(...)