Go to the documentation of this file.
62 double w0 = 2 *
M_PI * (1. -
s->range) * 2100 /
inlink->sample_rate;
65 alpha = sin(w0) / 2 * sqrt((
A + 1 /
A) * (1 /
s->slope - 1) + 2);
67 s->a0 = (
A + 1) + (
A - 1) * cos(w0) + 2 * sqrt(
A) *
alpha;
68 s->a1 = -2 * ((
A - 1) + (
A + 1) * cos(w0));
69 s->a2 = (
A + 1) + (
A - 1) * cos(w0) - 2 * sqrt(
A) *
alpha;
70 s->b0 =
A * ((
A + 1) - (
A - 1) * cos(w0) + 2 * sqrt(
A) *
alpha);
71 s->b1 = 2 *
A * ((
A - 1) - (
A + 1) * cos(w0));
72 s->b2 =
A * ((
A + 1) - (
A - 1) * cos(w0) - 2 * sqrt(
A) *
alpha);
88 const double *
src = (
const double *)in->
data[0];
89 const double level_in =
s->level_in;
90 const double level_out =
s->level_out;
91 const double b0 =
s->b0;
92 const double b1 =
s->b1;
93 const double b2 =
s->b2;
94 const double a1 = -
s->a1;
95 const double a2 = -
s->a2;
110 dst = (
double *)
out->data[0];
112 for (n = 0; n <
out->nb_samples; n++,
src += 2, dst += 2) {
113 double mid = (
src[0] +
src[1]) * level_in * .5;
114 double side = (
src[0] -
src[1]) * level_in * .5;
115 double oside = side *
b0 +
s->w1;
117 s->w1 =
b1 * side +
s->w2 +
a1 * oside;
118 s->w2 =
b2 * side +
a2 * oside;
120 if (
ctx->is_disabled) {
124 dst[0] = (mid + oside) * level_out;
125 dst[1] = (mid - oside) * level_out;
135 char *res,
int res_len,
int flags)
146 #define OFFSET(x) offsetof(CrossfeedContext, x)
147 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
180 .priv_class = &crossfeed_class,
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
A list of supported channel layouts.
static av_always_inline double ff_exp10(double x)
Compute 10^x for floating point values.
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 int filter_frame(AVFilterLink *inlink, AVFrame *in)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
static const AVFilterPad inputs[]
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
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
static int config_input(AVFilterLink *inlink)
#define FILTER_QUERY_FUNC(func)
static const AVOption crossfeed_options[]
const char * name
Filter name.
A link between two filters.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static double b1(void *priv, double x, double y)
AVFILTER_DEFINE_CLASS(crossfeed)
#define AV_CH_LAYOUT_STEREO
A filter pad used for either input or output.
const AVFilter ff_af_crossfeed
#define FILTER_INPUTS(array)
Describe the class of an AVClass context structure.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
static const AVFilterPad outputs[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
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.
static double b2(void *priv, double x, double y)
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 layout
static int query_formats(AVFilterContext *ctx)
int nb_samples
number of audio samples (per channel) described by this frame
const char * name
Pad name.
static const int16_t alpha[]
#define FILTER_OUTPUTS(array)
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
#define flags(name, subs,...)
static double b0(void *priv, double x, double y)
@ AV_SAMPLE_FMT_DBL
double