51 const double sensitivity =
s->sensitivity;
66 for (
int ch = 0; ch <
out->ch_layout.nb_channels; ch++) {
68 double *
dst = (
double *)
out->extended_data[ch];
69 double *coeffs = (
double *)
s->coeffs->extended_data[ch];
70 double low1 = coeffs[0];
71 double low2 = coeffs[1];
72 double inz = coeffs[2];
74 for (
int n = 0; n <
out->nb_samples; n++) {
77 double bandz = low2z - low1z;
78 double wd = wc + sensitivity *
fabs(bandz);
79 double g =
fmin(1., wd * (5.9948827 + wd * (-11.969296 + wd * 15.959062)));
81 low1 = low1z +
g * (0.5 * (
src[n] + inz) - low1z);
82 low2 = low2z +
g * (0.5 * (low1 + low1z) - low2z);
84 dst[n] =
ctx->is_disabled ?
src[n] : low2;
104#define OFFSET(x) offsetof(AudioDynamicSmoothContext, x)
105#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
125 .p.name =
"adynamicsmooth",
127 .p.priv_class = &adynamicsmooth_class,
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static const AVFilterPad inputs[]
static int config_input(AVFilterLink *inlink)
static const AVOption adynamicsmooth_options[]
static int config_input(AVFilterLink *inlink)
const FFFilter ff_af_adynamicsmooth
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static av_cold void uninit(AVFilterContext *ctx)
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
Main libavfilter public API header.
static __device__ float fabs(float a)
double fmin(double, double)
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
internal math functions header
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
@ AV_SAMPLE_FMT_DBLP
double, planar
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
#define FILTER_SINGLE_SAMPLEFMT(sample_fmt_)
#define AVFILTER_DEFINE_CLASS(fname)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Describe the class of an AVClass context structure.
A link between two filters.
AVFilterContext * dst
dest filter
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
int nb_samples
number of audio samples (per channel) described by this frame
int sample_rate
Sample rate of the audio data.
uint8_t ** extended_data
pointers to the data planes/channels.
static AVFormatContext * ctx