Go to the documentation of this file.
84 #define OFFSET(x) offsetof(CurvesContext, x)
85 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
115 static const struct {
122 "0.129/1 0.466/0.498 0.725/0",
123 "0.109/1 0.301/0.498 0.517/0",
124 "0.098/1 0.235/0.498 0.423/0",
127 "0/0 0.25/0.156 0.501/0.501 0.686/0.745 1/1",
128 "0/0 0.25/0.188 0.38/0.501 0.745/0.815 1/0.815",
129 "0/0 0.231/0.094 0.709/0.874 1/1",
139 "0/0.11 0.42/0.51 1/0.95",
141 "0/0.22 0.49/0.44 1/0.8",
162 const int scale = lut_size - 1;
169 point->
x =
av_strtod(p, &p);
if (p && *p) p++;
170 point->
y =
av_strtod(p, &p);
if (p && *p) p++;
171 if (point->
x < 0 || point->
x > 1 || point->
y < 0 || point->
y > 1) {
173 "x and y must be in the [0;1] range.\n", point->
x, point->
y);
179 if ((
int)(last->
x * scale) >= (
int)(point->
x * scale)) {
181 "and (%f;%f) are too close from each other or not "
182 "strictly increasing on the x-axis\n",
183 last->
x, last->
y, point->
x, point->
y);
191 if (*points && !(*points)->
next) {
193 "this is unlikely to behave as you expect. You probably want"
194 "at least 2 points.",
195 (*points)->x, (*points)->y);
217 #define CLIP(v) (nbits == 8 ? av_clip_uint8(v) : av_clip_uintp2_c(v, nbits))
220 const struct keypoint *points,
int nbits)
223 const struct keypoint *point = points;
225 const int lut_size = 1<<nbits;
226 const int scale = lut_size - 1;
233 for (
i = 0;
i < lut_size;
i++)
239 for (
i = 0;
i < lut_size;
i++)
248 if (!matrix || !
h || !
r) {
255 for (point = points; point; point = point->
next) {
257 h[
i] = point->
x - xprev;
264 for (
i = 1;
i < n - 1;
i++) {
265 const double yp = point->
y;
266 const double yc = point->
next->
y;
268 r[
i] = 6 * ((yn-yc)/
h[
i] - (yc-yp)/
h[
i-1]);
277 matrix[0][
MD] = matrix[n - 1][
MD] = 1;
278 for (
i = 1;
i < n - 1;
i++) {
279 matrix[
i][
BD] =
h[
i-1];
280 matrix[
i][
MD] = 2 * (
h[
i-1] +
h[
i]);
281 matrix[
i][
AD] =
h[
i];
285 for (
i = 1;
i < n;
i++) {
286 const double den = matrix[
i][
MD] - matrix[
i][
BD] * matrix[
i-1][
AD];
287 const double k = den ? 1./den : 1.;
289 r[
i] = (
r[
i] - matrix[
i][
BD] *
r[
i - 1]) * k;
291 for (
i = n - 2;
i >= 0;
i--)
297 for (
i = 0;
i < (
int)(point->
x * scale);
i++)
303 while (point->
next) {
304 const double yc = point->
y;
305 const double yn = point->
next->
y;
308 const double b = (yn-yc)/
h[
i] -
h[
i]*
r[
i]/2. -
h[
i]*(
r[
i+1]-
r[
i])/6.;
309 const double c =
r[
i] / 2.;
310 const double d = (
r[
i+1] -
r[
i]) / (6.*
h[
i]);
313 const int x_start = point->
x * scale;
314 const int x_end = point->
next->
x * scale;
316 av_assert0(x_start >= 0 && x_start < lut_size &&
317 x_end >= 0 && x_end < lut_size);
319 for (
x = x_start;
x <= x_end;
x++) {
320 const double xx = (
x - x_start) * 1./scale;
321 const double yy =
a +
b*xx +
c*xx*xx + d*xx*xx*xx;
331 for (
i = (
int)(point->
x * scale);
i < lut_size;
i++)
341 #define DECLARE_INTERPOLATE_FUNC(nbits) \
342 static int interpolate##nbits(void *log_ctx, uint16_t *y, \
343 const struct keypoint *points) \
345 return interpolate(log_ctx, y, points, nbits); \
362 static const int comp_ids[] = {3, 0, 1, 2};
370 #define READ16(dst) do { \
372 ret = AVERROR_INVALIDDATA; \
375 dst = AV_RB16(buf); \
386 for (n = 0; n < nb_points; n++) {
393 char **
pts = &
curves->comp_points_str[comp_ids[
i]];
397 i, comp_ids[
i], nb_points, *
pts);
417 const double scale = 1. / (lut_size - 1);
418 static const char *
const colors[] = {
"red",
"green",
"blue",
"#404040", };
438 av_bprintf(&buf,
"%s'-' using 1:2 with lines lc '%s' title ''",
439 i ?
", " :
"plot ", colors[
i]);
441 av_bprintf(&buf,
", '-' using 1:2 with points pointtype 3 lc '%s' title ''",
450 for (
x = 0;
x < lut_size;
x++)
455 if (comp_points[
i]) {
456 const struct keypoint *point = comp_points[
i];
466 fwrite(buf.str, 1, buf.len,
f);
477 const char *allp =
curves->comp_points_str_all;
495 curves->parsed_psfile = 1;
499 #define SET_COMP_IF_NOT_SET(n, name) do { \
500 if (!pts[n] && curves_presets[curves->preset].name) { \
501 pts[n] = av_strdup(curves_presets[curves->preset].name); \
503 return AVERROR(ENOMEM); \
553 const int slice_start = (
in->height * jobnr ) / nb_jobs;
554 const int slice_end = (
in->height * (jobnr+1)) / nb_jobs;
558 uint16_t *dstp = ( uint16_t *)(
out->data[0] +
y *
out->linesize[0]);
559 const uint16_t *srcp = (
const uint16_t *)(
in ->
data[0] +
y *
in->linesize[0]);
566 dstp[
x +
a] = srcp[
x +
a];
570 uint8_t *dst =
out->data[0] + slice_start *
out->linesize[0];
581 dst +=
out->linesize[0];
582 src +=
in ->linesize[0];
601 const int slice_start = (
in->height * jobnr ) / nb_jobs;
602 const int slice_end = (
in->height * (jobnr+1)) / nb_jobs;
606 uint16_t *dstrp = ( uint16_t *)(
out->data[
r] +
y *
out->linesize[
r]);
607 uint16_t *dstgp = ( uint16_t *)(
out->data[
g] +
y *
out->linesize[
g]);
608 uint16_t *dstbp = ( uint16_t *)(
out->data[
b] +
y *
out->linesize[
b]);
609 uint16_t *dstap = ( uint16_t *)(
out->data[
a] +
y *
out->linesize[
a]);
610 const uint16_t *srcrp = (
const uint16_t *)(
in ->
data[
r] +
y *
in->linesize[
r]);
611 const uint16_t *srcgp = (
const uint16_t *)(
in ->
data[
g] +
y *
in->linesize[
g]);
612 const uint16_t *srcbp = (
const uint16_t *)(
in ->
data[
b] +
y *
in->linesize[
b]);
613 const uint16_t *srcap = (
const uint16_t *)(
in ->
data[
a] +
y *
in->linesize[
a]);
615 for (
x = 0;
x <
in->width;
x++) {
628 const uint8_t *srcr =
in->data[
r] + slice_start *
in->linesize[
r];
629 const uint8_t *srcg =
in->data[
g] + slice_start *
in->linesize[
g];
630 const uint8_t *srcb =
in->data[
b] + slice_start *
in->linesize[
b];
631 const uint8_t *srca =
in->data[
a] + slice_start *
in->linesize[
a];
634 for (
x = 0;
x <
in->width;
x++) {
641 dstr +=
out->linesize[
r];
642 dstg +=
out->linesize[
g];
643 dstb +=
out->linesize[
b];
644 dsta +=
out->linesize[
a];
645 srcr +=
in ->linesize[
r];
646 srcg +=
in ->linesize[
g];
647 srcb +=
in ->linesize[
b];
648 srca +=
in ->linesize[
a];
679 case 8:
ret = interpolate8 (
ctx,
curves->graph[
i], comp_points[
i]);
break;
680 case 9:
ret = interpolate9 (
ctx,
curves->graph[
i], comp_points[
i]);
break;
681 case 10:
ret = interpolate10(
ctx,
curves->graph[
i], comp_points[
i]);
break;
682 case 12:
ret = interpolate12(
ctx,
curves->graph[
i], comp_points[
i]);
break;
683 case 14:
ret = interpolate14(
ctx,
curves->graph[
i], comp_points[
i]);
break;
684 case 16:
ret = interpolate16(
ctx,
curves->graph[
i], comp_points[
i]);
break;
692 for (j = 0; j <
curves->lut_size; j++)
698 const struct keypoint *point = comp_points[
i];
754 char *res,
int res_len,
int flags)
759 if (!strcmp(cmd,
"plot")) {
761 }
else if (!strcmp(cmd,
"all") || !strcmp(cmd,
"preset") || !strcmp(cmd,
"psfile")) {
762 if (!strcmp(cmd,
"psfile"))
763 curves->parsed_psfile = 0;
769 }
else if (!strcmp(cmd,
"red") || !strcmp(cmd,
"r")) {
771 }
else if (!strcmp(cmd,
"green") || !strcmp(cmd,
"g")) {
773 }
else if (!strcmp(cmd,
"blue") || !strcmp(cmd,
"b")) {
775 }
else if (!strcmp(cmd,
"master") || !strcmp(cmd,
"m")) {
825 .priv_class = &curves_class,
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
#define AV_PIX_FMT_GBRAP16
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_BPRINT_SIZE_UNLIMITED
static void direct(const float *in, const FFTComplex *ir, int len, float *out)
uint16_t * graph[NB_COMP+1]
AVPixelFormat
Pixel format.
static av_cold int init(AVCodecContext *avctx)
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
static int dump_curves(const char *fname, uint16_t *graph[NB_COMP+1], struct keypoint *comp_points[NB_COMP+1], int lut_size)
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
static const Curve curves[]
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
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.
This structure describes decoded (raw) audio or video data.
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But a word about which is also called distortion Distortion can be quantified by almost any quality measurement one chooses the sum of squared differences is used but more complex methods that consider psychovisual effects can be used as well It makes no difference in this discussion First step
#define DECLARE_INTERPOLATE_FUNC(nbits)
static const AVFilterPad curves_inputs[]
void * av_mallocz_array(size_t nmemb, size_t size)
#define AV_LOG_VERBOSE
Detailed information.
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
const char * name
Filter name.
static int get_nb_points(const struct keypoint *d)
AVFormatInternal * internal
An opaque field for libavformat internal usage.
A link between two filters.
int(* filter_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
#define AV_PIX_FMT_GBRP14
int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, int log_offset, void *log_ctx)
Read the file with name filename, and put its content in a newly allocated buffer or map it with mmap...
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
#define AV_PIX_FMT_GBRP10
#define AV_BPRINT_SIZE_AUTOMATIC
A filter pad used for either input or output.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_ARRAY_ELEMS(a)
FILE * av_fopen_utf8(const char *path, const char *mode)
Open a file using a UTF-8 filename.
#define AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_GBRAP12
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
static const AVFilterPad curves_outputs[]
static int slice_end(AVCodecContext *avctx, AVFrame *pict)
Handle slice ends.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static const AVFilterPad outputs[]
static enum AVPixelFormat pix_fmts[]
#define CLIP(v)
Natural cubic spline interpolation Finding curves using Cubic Splines notes by Steven Rauch and John ...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
AVFILTER_DEFINE_CLASS(curves)
void av_file_unmap(uint8_t *bufptr, size_t size)
Unmap or free the buffer bufptr created by av_file_map().
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
static int query_formats(AVFilterContext *ctx)
int av_log_get_level(void)
Get the current log level.
#define AV_PIX_FMT_GBRP16
#define AV_PIX_FMT_RGBA64
Describe the class of an AVClass context structure.
static int interpolate(void *log_ctx, uint16_t *y, const struct keypoint *points, int nbits)
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int av_get_padded_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel for the pixel format described by pixdesc, including any padding ...
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
static av_cold void curves_uninit(AVFilterContext *ctx)
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
static int filter_slice_planar(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
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.
static const AVOption curves_options[]
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
@ AV_PIX_FMT_RGB0
packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
static int filter_slice_packed(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
char * comp_points_str[NB_COMP+1]
@ PRESET_INCREASE_CONTRAST
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) #define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac) { } void ff_audio_convert_free(AudioConvert **ac) { if(! *ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);} AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map) { AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method !=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt) > 2) { ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc) { av_free(ac);return NULL;} return ac;} in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar) { ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar ? ac->channels :1;} else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);return ac;} int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in) { int use_generic=1;int len=in->nb_samples;int p;if(ac->dc) { av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> in
#define AV_PIX_FMT_BGRA64
int w
agreed upon image width
#define AV_PIX_FMT_GBRP12
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Used for passing data between threads.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
const char * name
Pad name.
@ AV_PIX_FMT_0BGR
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
double av_strtod(const char *numstr, char **tail)
Parse the string in numstr and return its value as a double.
static const struct @218 curves_presets[]
char * comp_points_str_all
void av_bprintf(AVBPrint *buf, const char *fmt,...)
void av_bprint_clear(AVBPrint *buf)
Reset the string to "" but keep internal allocated data.
void * av_calloc(size_t nmemb, size_t size)
Non-inlined equivalent of av_mallocz_array().
int h
agreed upon image height
static struct keypoint * make_point(double x, double y, struct keypoint *next)
#define AV_PIX_FMT_FLAG_PLANAR
At least one pixel component is not in the first data plane.
static int config_input(AVFilterLink *inlink)
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
char * av_strdup(const char *s)
Duplicate a string.
#define SET_COMP_IF_NOT_SET(n, name)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
static av_cold int curves_init(AVFilterContext *ctx)
static int parse_psfile(AVFilterContext *ctx, const char *fname)
static int parse_points_str(AVFilterContext *ctx, struct keypoint **points, const char *s, int lut_size)
int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt)
#define flags(name, subs,...)
@ AV_PIX_FMT_0RGB
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
static av_cold int uninit(AVCodecContext *avctx)
static int filter_frame(AVFilterLink *inlink, AVFrame *in)