49#define OFFSET(x) offsetof(Bs2bContext, x)
50#define A AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
53 {
"profile",
"Apply a pre-defined crossfeed level",
55 {
"default",
"default profile", 0,
AV_OPT_TYPE_CONST, { .i64 = BS2B_DEFAULT_CLEVEL }, 0, 0,
A, .unit =
"profile" },
56 {
"cmoy",
"Chu Moy circuit", 0,
AV_OPT_TYPE_CONST, { .i64 = BS2B_CMOY_CLEVEL }, 0, 0,
A, .unit =
"profile" },
57 {
"jmeier",
"Jan Meier circuit", 0,
AV_OPT_TYPE_CONST, { .i64 = BS2B_JMEIER_CLEVEL }, 0, 0,
A, .unit =
"profile" },
58 {
"fcut",
"Set cut frequency (in Hz)",
60 {
"feed",
"Set feed level (in Hz)",
71 if (!(bs2b->
bs2bp = bs2b_open()))
77 bs2b_set_level_fcut(bs2b->
bs2bp, bs2b->
fcut);
80 bs2b_set_level_feed(bs2b->
bs2bp, bs2b->
feed);
90 bs2b_close(bs2b->
bs2bp);
150 if (
frame != out_frame)
184 if ((srate < BS2B_MINSRATE) || (srate > BS2B_MAXSRATE))
187 bs2b_set_srate(bs2b->
bs2bp, srate);
211 .p.priv_class = &bs2b_class,
static enum AVSampleFormat sample_fmts[]
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static void feed(AVFilterContext *ctx, int ch, const float *in_samples, float *out_samples, float *in_frame, float *out_dist_frame, float *windowed_frame, float *drc_frame, float *spectrum_buf, float *energy, float *target_gain, float *envelope, float *factors)
static const AVFilterPad bs2b_inputs[]
void(* filter_func)(t_bs2bdp bs2bdp, uint8_t *sample, int n)
const FFFilter ff_af_bs2b
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
static const AVFilterPad bs2b_outputs[]
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static av_cold void uninit(AVFilterContext *ctx)
static int config_output(AVFilterLink *outlink)
static const AVOption bs2b_options[]
static AVFormatContext * ctx
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.
Public libavutil channel layout APIs header.
common internal and external API header
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
int(* init)(AVBSFContext *ctx)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_INT
Underlying C type is int.
#define AV_CHANNEL_LAYOUT_STEREO
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
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.
int av_frame_copy(AVFrame *dst, const AVFrame *src)
Copy the frame data from src to dst.
AVSampleFormat
Audio sample formats.
@ AV_SAMPLE_FMT_S32
signed 32 bits
@ AV_SAMPLE_FMT_U8
unsigned 8 bits
@ AV_SAMPLE_FMT_DBL
double
@ AV_SAMPLE_FMT_S16
signed 16 bits
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int config_output(AVBitStreamFilterLink *outlink)
#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.
void * priv
private data for use by the filter
AVFilterLink ** outputs
array of pointers to output links
A link between two filters.
AVFilterContext * src
source filter
int sample_rate
samples per second
AVFilterContext * dst
dest filter
int format
agreed upon media format
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.