aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_yadif_cuda.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2024-01-25 23:08:52 +0100
committerMarton Balint <cus@passwd.hu>2024-02-04 20:04:18 +0100
commit268062fa15e1c05310f9c3977e0b95ac07eca274 (patch)
tree17aaed78d569ee7981ee1c086d3700029ef99581 /libavfilter/vf_yadif_cuda.c
parent8fccd6d510fe802c7d2dbe291676b0780cd4cf7f (diff)
downloadffmpeg-268062fa15e1c05310f9c3977e0b95ac07eca274.tar.gz
avfilter/yadif_common: factorize some part of the config_output and the uninit functions
This unifies slightly diverged code and ensures that cc_fifo is always initialized. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavfilter/vf_yadif_cuda.c')
-rw-r--r--libavfilter/vf_yadif_cuda.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/libavfilter/vf_yadif_cuda.c b/libavfilter/vf_yadif_cuda.c
index d777757e65..17389f092f 100644
--- a/libavfilter/vf_yadif_cuda.c
+++ b/libavfilter/vf_yadif_cuda.c
@@ -200,10 +200,7 @@ static av_cold void deint_cuda_uninit(AVFilterContext *ctx)
CHECK_CU(cu->cuCtxPopCurrent(&dummy));
}
- av_frame_free(&y->prev);
- av_frame_free(&y->cur);
- av_frame_free(&y->next);
- ff_ccfifo_uninit(&y->cc_fifo);
+ ff_yadif_uninit(ctx);
av_buffer_unref(&s->device_ref);
s->hwctx = NULL;
@@ -281,27 +278,9 @@ static int config_output(AVFilterLink *link)
goto exit;
}
- link->time_base = av_mul_q(ctx->inputs[0]->time_base, (AVRational){1, 2});
- link->w = ctx->inputs[0]->w;
- link->h = ctx->inputs[0]->h;
-
- if(y->mode & 1)
- link->frame_rate = av_mul_q(ctx->inputs[0]->frame_rate,
- (AVRational){2, 1});
- else
- link->frame_rate = ctx->inputs[0]->frame_rate;
-
- ret = ff_ccfifo_init(&y->cc_fifo, link->frame_rate, ctx);
- if (ret < 0) {
- av_log(ctx, AV_LOG_ERROR, "Failure to setup CC FIFO queue\n");
- goto exit;
- }
-
- if (link->w < 3 || link->h < 3) {
- av_log(ctx, AV_LOG_ERROR, "Video of less than 3 columns or lines is not supported\n");
- ret = AVERROR(EINVAL);
+ ret = ff_yadif_config_output_common(link);
+ if (ret < 0)
goto exit;
- }
y->csp = av_pix_fmt_desc_get(output_frames->sw_format);
y->filter = filter;