59#define OFFSET(x) offsetof(AudioPulsatorContext, x)
60#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
108 val = (phs - 0.75) * 4 - 1;
115 val = phs < 0.5 ? -1 : +1;
134 const double *
src = (
const double *)in->
data[0];
136 const double level_out =
s->level_out;
137 const double level_in =
s->level_in;
138 const double amount =
s->amount;
153 dst = (
double *)
out->data[0];
155 for (n = 0; n < nb_samples; n++) {
158 double inL =
src[0] * level_in;
159 double inR =
src[1] * level_in;
166 outL = procL + inL * (1 - amount);
167 outR = procR + inR * (1 - amount);
198 { .nb_channels = 0 },
221 case UNIT_BPM: freq =
s->bpm / 60;
break;
222 case UNIT_MS: freq = 1 / (
s->ms / 1000.);
break;
223 case UNIT_HZ: freq =
s->hertz;
break;
229 s->lfoL.mode =
s->mode;
230 s->lfoR.mode =
s->mode;
231 s->lfoL.offset =
s->offset_l;
232 s->lfoR.offset =
s->offset_r;
235 s->lfoL.amount =
s->amount;
236 s->lfoR.amount =
s->amount;
237 s->lfoL.pwidth =
s->pwidth;
238 s->lfoR.pwidth =
s->pwidth;
253 .p.name =
"apulsator",
255 .p.priv_class = &apulsator_class,
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static double val(void *priv, double ch)
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static const AVFilterPad inputs[]
static int config_input(AVFilterLink *inlink)
static double lfo_get_value(SimpleLFO *lfo)
const FFFilter ff_af_apulsator
static int config_input(AVFilterLink *inlink)
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static void lfo_advance(SimpleLFO *lfo, unsigned count)
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static const AVOption apulsator_options[]
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.
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Main libavfilter public API header.
Public libavutil channel layout APIs header.
static __device__ float fabs(float a)
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
#define AV_CHANNEL_LAYOUT_STEREO
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.
AVSampleFormat
Audio sample formats.
@ AV_SAMPLE_FMT_DBL
double
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
#define AVFILTER_DEFINE_CLASS(fname)
#define FILTER_QUERY_FUNC2(func)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
enum MovChannelLayoutTag * layouts
An AVChannelLayout holds information about the channel layout of audio data.
Describe the class of an AVClass context structure.
A link between two filters.
int sample_rate
samples per second
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
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static AVFormatContext * ctx