Skip to content

Commit 071c499

Browse files
committed
avfilter/unsharp: Call function directly rather than via function pointer
Signed-off-by: Zhao Zhili <[email protected]>
1 parent 691e0a1 commit 071c499

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

libavfilter/vf_unsharp.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ typedef struct UnsharpContext {
7474
int bitdepth;
7575
int bps;
7676
int nb_threads;
77-
int (* apply_unsharp)(AVFilterContext *ctx, AVFrame *in, AVFrame *out);
7877
int (* unsharp_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
7978
} UnsharpContext;
8079

@@ -173,7 +172,7 @@ static int name##_##nbits(AVFilterContext *ctx, void *arg, int jobnr, int nb_job
173172
DEF_UNSHARP_SLICE_FUNC(unsharp_slice, 16)
174173
DEF_UNSHARP_SLICE_FUNC(unsharp_slice, 8)
175174

176-
static int apply_unsharp_c(AVFilterContext *ctx, AVFrame *in, AVFrame *out)
175+
static int apply_unsharp(AVFilterContext *ctx, AVFrame *in, AVFrame *out)
177176
{
178177
AVFilterLink *inlink = ctx->inputs[0];
179178
UnsharpContext *s = ctx->priv;
@@ -240,7 +239,6 @@ static av_cold int init(AVFilterContext *ctx)
240239
SET_FILTER_PARAM(chroma, c);
241240
SET_FILTER_PARAM(alpha, a);
242241

243-
s->apply_unsharp = apply_unsharp_c;
244242
return 0;
245243
}
246244

@@ -337,7 +335,6 @@ static av_cold void uninit(AVFilterContext *ctx)
337335

338336
static int filter_frame(AVFilterLink *link, AVFrame *in)
339337
{
340-
UnsharpContext *s = link->dst->priv;
341338
AVFilterLink *outlink = link->dst->outputs[0];
342339
AVFrame *out;
343340
int ret = 0;
@@ -349,7 +346,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
349346
}
350347
av_frame_copy_props(out, in);
351348

352-
ret = s->apply_unsharp(link->dst, in, out);
349+
ret = apply_unsharp(link->dst, in, out);
353350

354351
av_frame_free(&in);
355352

0 commit comments

Comments
 (0)