43#define OFFSET(x) offsetof(VibratoContext, x)
44#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
58 const int wave_table_size =
s->wave_table_size;
59 const double *wave_table =
s->wave_table;
62 const int buf_size =
s->buf_size;
63 const double depth =
s->depth;
64 int wave_table_index =
s->wave_table_index;
65 int buf_index =
s->buf_index;
82 int samp1_index, samp2_index;
84 decimal = modf(depth * wave_table[wave_table_index], &
integer);
87 if (wave_table_index >= wave_table_size)
88 wave_table_index -= wave_table_size;
90 samp1_index = buf_index +
integer;
91 if (samp1_index >= buf_size)
92 samp1_index -= buf_size;
93 samp2_index = samp1_index + 1;
94 if (samp2_index >= buf_size)
95 samp2_index -= buf_size;
98 double *buf, this_samp;
101 dst = (
double *)
out->extended_data[
c];
105 dst[n] = buf[samp1_index] + (decimal * (buf[samp2_index] - buf[samp1_index]));
106 buf[buf_index] = this_samp;
109 if (buf_index >= buf_size)
110 buf_index -= buf_size;
113 s->wave_table_index = wave_table_index;
114 s->buf_index = buf_index;
127 for (
c = 0;
c <
s->channels;
c++)
143 for (
c = 0;
c <
s->channels;
c++) {
155 s->wave_table_index = 0;
172 .p.priv_class = &vibrato_class,
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static int config_input(AVFilterLink *inlink)
const FFFilter ff_af_vibrato
static int config_input(AVFilterLink *inlink)
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static const AVOption vibrato_options[]
static av_cold void uninit(AVFilterContext *ctx)
static const AVFilterPad avfilter_af_vibrato_inputs[]
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.
Main libavfilter public API header.
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
void ff_generate_wave_table(enum WaveType wave_type, enum AVSampleFormat sample_fmt, void *table, int table_size, double min, double max, double phase)
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
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
@ AV_SAMPLE_FMT_DBL
double
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.
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
int nb_channels
Number of channels in this layout.
Describe the class of an AVClass context structure.
A link between two filters.
int sample_rate
samples per second
AVChannelLayout ch_layout
channel layout of current buffer (see libavutil/channel_layout.h)
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 ** extended_data
pointers to the data planes/channels.
#define av_malloc_array(a, b)
static AVFormatContext * ctx