[FFmpeg-devel] [PATCH v2 8/8] avfilter/vf_lut*: strip color volume metadata
Niklas Haas
ffmpeg at haasn.xyz
Wed Dec 4 16:51:09 EET 2024
From: Niklas Haas <git at haasn.dev>
These filters, in general, will apply some arbitrary color volume
transformation. Strip corresponding metadata to be conservative/safe.
---
libavfilter/vf_lut.c | 2 ++
libavfilter/vf_lut2.c | 1 +
libavfilter/vf_lut3d.c | 2 ++
3 files changed, 5 insertions(+)
diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c
index af7172dc01..3e09f31560 100644
--- a/libavfilter/vf_lut.c
+++ b/libavfilter/vf_lut.c
@@ -539,6 +539,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
av_frame_copy_props(out, in);
}
+ av_frame_remove_side_data_by_props(out, AV_SIDE_DATA_PROP_COLOR_DEPENDENT);
+
if (s->is_rgb && s->is_16bit && !s->is_planar) {
/* packed, 16-bit */
PACKED_THREAD_DATA
diff --git a/libavfilter/vf_lut2.c b/libavfilter/vf_lut2.c
index 88b45f45e5..c1e624218b 100644
--- a/libavfilter/vf_lut2.c
+++ b/libavfilter/vf_lut2.c
@@ -619,6 +619,7 @@ static int tlut2_filter_frame(AVFilterLink *inlink, AVFrame *frame)
}
av_frame_copy_props(out, frame);
+ av_frame_remove_side_data_by_props(out, AV_SIDE_DATA_PROP_COLOR_DEPENDENT);
td.out = out;
td.srcx = frame;
diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c
index 46955b99a5..0ac160c29c 100644
--- a/libavfilter/vf_lut3d.c
+++ b/libavfilter/vf_lut3d.c
@@ -1178,6 +1178,8 @@ static AVFrame *apply_lut(AVFilterLink *inlink, AVFrame *in)
av_frame_copy_props(out, in);
}
+ av_frame_remove_side_data_by_props(out, AV_SIDE_DATA_PROP_COLOR_DEPENDENT);
+
td.in = in;
td.out = out;
ff_filter_execute(ctx, lut3d->interp, &td, NULL,
--
2.47.0
More information about the ffmpeg-devel
mailing list