Go to the documentation of this file.
35 #define OFFSET(x) offsetof(CrystalizerContext, x)
36 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
55 #define filters(fmt, type, inverse, clp, inverset, clip, one, clip_fn, packed) \
56 static int filter_## inverse ##_## fmt ##_## clp(AVFilterContext *ctx, \
57 void *arg, int jobnr,\
60 ThreadData *td = arg; \
63 const void **s = td->s; \
64 const int nb_samples = td->nb_samples; \
65 const int channels = td->channels; \
66 const type mult = td->mult; \
67 const type scale = one / (-mult + one); \
68 const int start = (channels * jobnr) / nb_jobs; \
69 const int end = (channels * (jobnr+1)) / nb_jobs; \
73 for (int c = start; c < end; c++) { \
74 const type *src = s[0]; \
77 for (int n = 0; n < nb_samples; n++) { \
78 type current = src[c]; \
81 dst[c] = (current - prv[c] * mult) * scale; \
84 dst[c] = current + (current - prv[c]) * mult; \
88 dst[c] = clip_fn(dst[c], -one, one); \
96 for (int c = start; c < end; c++) { \
97 const type *src = s[c]; \
101 for (int n = 0; n < nb_samples; n++) { \
102 type current = src[n]; \
105 dst[n] = (current - prv[0] * mult) * scale; \
108 dst[n] = current + (current - prv[0]) * mult; \
112 dst[n] = clip_fn(dst[n], -one, one); \
148 s->filter[0][0] = filter_inverse_flt_noclip;
149 s->filter[1][0] = filter_noinverse_flt_noclip;
150 s->filter[0][1] = filter_inverse_flt_clip;
151 s->filter[1][1] = filter_noinverse_flt_clip;
154 s->filter[0][0] = filter_inverse_fltp_noclip;
155 s->filter[1][0] = filter_noinverse_fltp_noclip;
156 s->filter[0][1] = filter_inverse_fltp_clip;
157 s->filter[1][1] = filter_noinverse_fltp_clip;
160 s->filter[0][0] = filter_inverse_dbl_noclip;
161 s->filter[1][0] = filter_noinverse_dbl_noclip;
162 s->filter[0][1] = filter_inverse_dbl_clip;
163 s->filter[1][1] = filter_noinverse_dbl_clip;
166 s->filter[0][0] = filter_inverse_dblp_noclip;
167 s->filter[1][0] = filter_noinverse_dblp_noclip;
168 s->filter[0][1] = filter_inverse_dblp_clip;
169 s->filter[1][1] = filter_noinverse_dblp_clip;
205 td.
d = (
void **)
out->extended_data;
207 td.
p = (
void **)
s->prev->extended_data;
210 td.
mult =
ctx->is_disabled ? 0.f :
s->mult;
237 .
name =
"crystalizer",
240 .priv_class = &crystalizer_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
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
int(* filter[2][2])(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static int config_input(AVFilterLink *inlink)
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.
static av_cold void uninit(AVFilterContext *ctx)
const char * name
Filter name.
int nb_channels
Number of channels in this layout.
A link between two filters.
AVFILTER_DEFINE_CLASS(crystalizer)
AVChannelLayout ch_layout
Channel layout of the audio data.
A filter pad used for either input or output.
static int16_t mult(Float11 *f1, Float11 *f2)
#define FILTER_SAMPLEFMTS(...)
#define filters(fmt, type, inverse, clp, inverset, clip, one, clip_fn, packed)
#define FILTER_OUTPUTS(array)
Describe the class of an AVClass context structure.
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.
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
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_OPT_TYPE_FLOAT
Underlying C type is float.
int nb_samples
number of audio samples (per channel) described by this frame
static const AVFilterPad inputs[]
static const AVOption crystalizer_options[]
uint8_t ** extended_data
pointers to the data planes/channels.
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Used for passing data between threads.
const char * name
Pad name.
int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
@ AV_SAMPLE_FMT_DBLP
double, planar
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
const AVFilter ff_af_crystalizer
@ AV_SAMPLE_FMT_DBL
double