Go to the documentation of this file.
58 } AudioDialogueEnhanceContext;
60 #define OFFSET(x) offsetof(AudioDialogueEnhanceContext, x)
61 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
108 AudioDialogueEnhanceContext *
s =
ctx->priv;
111 s->fft_size =
inlink->sample_rate > 100000 ? 8192 :
inlink->sample_rate > 50000 ? 4096 : 2048;
112 s->overlap =
s->fft_size / 4;
120 if (!
s->in_frame || !
s->windowed_out || !
s->windowed_prev ||
121 !
s->out_dist_frame || !
s->windowed_frame || !
s->center_frame)
126 s->de_stereo = de_stereo_float;
127 ret = de_tx_init_float(
ctx);
130 s->de_stereo = de_stereo_double;
131 ret = de_tx_init_double(
ctx);
142 AudioDialogueEnhanceContext *
s =
ctx->priv;
168 AudioDialogueEnhanceContext *
s =
ctx->priv;
196 AudioDialogueEnhanceContext *
s =
ctx->priv;
221 .
name =
"dialoguenhance",
223 .priv_size =
sizeof(AudioDialogueEnhanceContext),
224 .priv_class = &dialoguenhance_class,
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
@ AV_SAMPLE_FMT_FLTP
float, planar
A list of supported channel layouts.
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
#define AV_CHANNEL_LAYOUT_STEREO
static const AVFilterPad inputs[]
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
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define FILTER_INPUTS(array)
This structure describes decoded (raw) audio or video data.
int(* de_stereo)(AVFilterContext *ctx, AVFrame *out)
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
const char * name
Filter name.
A link between two filters.
#define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink)
Forward the status on an output link to an input link.
static av_cold void uninit(AVFilterContext *ctx)
const AVFilter ff_af_dialoguenhance
#define AV_CHANNEL_LAYOUT_SURROUND
A filter pad used for either input or output.
void(* av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride)
Function pointer to a function to perform the transform.
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
void ff_inlink_request_frame(AVFilterLink *link)
Mark that a frame is wanted on the link.
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
#define FILTER_OUTPUTS(array)
Describe the class of an AVClass context structure.
int ff_inlink_consume_samples(AVFilterLink *link, unsigned min, unsigned max, AVFrame **rframe)
Take samples from the link's FIFO and update the link's stats.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus, int64_t *rpts)
Test and acknowledge the change of status on the link.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
An AVChannelLayout holds information about the channel layout of audio data.
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.
av_cold void av_tx_uninit(AVTXContext **ctx)
Frees a context and sets *ctx to NULL, does nothing when *ctx == NULL.
int nb_samples
number of audio samples (per channel) described by this frame
AVSampleFormat
Audio sample formats.
#define FILTER_QUERY_FUNC2(func)
static const AVOption dialoguenhance_options[]
const char * name
Pad name.
int ff_inlink_queued_samples(AVFilterLink *link)
static int config_input(AVFilterLink *inlink)
@ AV_SAMPLE_FMT_DBLP
double, planar
static int activate(AVFilterContext *ctx)
static const uint16_t channel_layouts[7]
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
the definition of that something depends on the semantic of the filter The callback must examine the status of the filter s links and proceed accordingly The status of output links is stored in the status_in and status_out fields and tested by the ff_outlink_frame_wanted() function. If this function returns true
AVFILTER_DEFINE_CLASS(dialoguenhance)
void ff_filter_set_ready(AVFilterContext *filter, unsigned priority)
Mark a filter ready and schedule it for activation.