35#define OFFSET(x) offsetof(DCShiftContext, x)
36#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
50 s->limiterthreshold = INT32_MAX * (1.0 - (
fabs(
s->dcshift) -
s->limitergain));
62 double dcshift =
s->dcshift;
75 if (
s->limitergain > 0) {
85 if (d >
s->limiterthreshold && dcshift > 0) {
86 d = (d -
s->limiterthreshold) *
s->limitergain /
87 (INT32_MAX -
s->limiterthreshold) +
88 s->limiterthreshold + dcshift;
89 }
else if (d < -s->limiterthreshold && dcshift < 0) {
90 d = (d +
s->limiterthreshold) *
s->limitergain /
91 (INT32_MAX -
s->limiterthreshold) -
92 s->limiterthreshold + dcshift;
94 d = dcshift * INT32_MAX + d;
106 double d = dcshift * (INT32_MAX + 1.) +
src[j];
128 .p.priv_class = &dcshift_class,
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static const AVFilterPad dcshift_inputs[]
static const AVOption dcshift_options[]
const FFFilter ff_af_dcshift
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
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.
#define i(width, name, range_min, range_max)
static __device__ float fabs(float a)
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
int(* init)(AVBSFContext *ctx)
@ 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_S32P
signed 32 bits, planar
#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.
int nb_channels
Number of channels in this layout.
Describe the class of an AVClass context structure.
A link between two filters.
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.
static AVFormatContext * ctx