aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2023-06-15 17:00:42 +0200
committerNiklas Haas <git@haasn.dev>2023-06-20 17:09:58 +0200
commit618b72d4b407b916c47aa621ad90f21b7fa6adc2 (patch)
tree88afe6749c5f0a3982d60970b8d5e1bb7f9d203b /libavfilter
parent015c3b659ee38505f704bebe8a8fad612b9c5f48 (diff)
downloadffmpeg-618b72d4b407b916c47aa621ad90f21b7fa6adc2.tar.gz
lavfi/vf_libplacebo: skip cache selectively per-input
It may be the case that we want to skip the single frame cache for some inputs but not others.
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_libplacebo.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c
index 627223256c..f7b9bdba74 100644
--- a/libavfilter/vf_libplacebo.c
+++ b/libavfilter/vf_libplacebo.c
@@ -182,7 +182,6 @@ typedef struct LibplaceboContext {
float antiringing;
int sigmoid;
int skip_aa;
- int skip_cache;
float polar_cutoff;
int disable_linear;
int disable_builtin;
@@ -471,7 +470,6 @@ static int update_settings(AVFilterContext *ctx)
.num_hooks = s->num_hooks,
.skip_anti_aliasing = s->skip_aa,
- .skip_caching_single_frame = s->skip_cache,
.polar_cutoff = s->polar_cutoff,
.disable_linear_scaling = s->disable_linear,
.disable_builtin_scalers = s->disable_builtin,
@@ -883,8 +881,10 @@ static int output_frame(AVFilterContext *ctx, int64_t pts)
s->params.blend_params = NULL;
for (int i = 0; i < s->nb_inputs; i++) {
LibplaceboInput *in = &s->inputs[i];
+ int high_fps = av_cmp_q(in->link->frame_rate, outlink->frame_rate) > 0;
if (in->qstatus != PL_QUEUE_OK)
continue;
+ s->params.skip_caching_single_frame = high_fps;
update_crops(ctx, in, &target, out->pts * av_q2d(outlink->time_base));
pl_render_image_mix(in->renderer, &in->mix, &target, &s->params);
s->params.skip_target_clearing = true;
@@ -1198,9 +1198,6 @@ static int libplacebo_config_output(AVFilterLink *outlink)
if (s->fps.num) {
outlink->frame_rate = s->fps;
outlink->time_base = av_inv_q(s->fps);
- s->skip_cache = av_cmp_q(inlink->frame_rate, s->fps) > 0;
- } else {
- s->skip_cache = true;
}
/* Static variables */