[FFmpeg-cvslog] avfilter/vf_eq: add support for alpha channel

the.real.laplace@gmail.com git at videolan.org
Thu Oct 21 16:23:52 EEST 2021


ffmpeg | branch: master | the.real.laplace at gmail.com <the.real.laplace at gmail.com> | Mon Oct 18 14:29:48 2021 +0300| [c13a2f701db21d3ea2763ca85cb5fd21e032fd13] | committer: Michael Niedermayer

avfilter/vf_eq: add support for alpha channel

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c13a2f701db21d3ea2763ca85cb5fd21e032fd13
---

 libavfilter/vf_eq.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/libavfilter/vf_eq.c b/libavfilter/vf_eq.c
index 4a0d85e8e5..80ab21efb3 100644
--- a/libavfilter/vf_eq.c
+++ b/libavfilter/vf_eq.c
@@ -236,9 +236,9 @@ static const enum AVPixelFormat pixel_fmts_eq[] = {
     AV_PIX_FMT_GRAY8,
     AV_PIX_FMT_YUV410P,
     AV_PIX_FMT_YUV411P,
-    AV_PIX_FMT_YUV420P,
-    AV_PIX_FMT_YUV422P,
-    AV_PIX_FMT_YUV444P,
+    AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P,
+    AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA422P,
+    AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P,
     AV_PIX_FMT_NONE
 };
 
@@ -281,12 +281,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
             h = AV_CEIL_RSHIFT(h, desc->log2_chroma_h);
         }
 
-        if (eq->param[i].adjust)
-            eq->param[i].adjust(&eq->param[i], out->data[i], out->linesize[i],
-                                 in->data[i], in->linesize[i], w, h);
-        else
+        if (i == 3 || !eq->param[i].adjust)
             av_image_copy_plane(out->data[i], out->linesize[i],
                                 in->data[i], in->linesize[i], w, h);
+
+        else
+            eq->param[i].adjust(&eq->param[i], out->data[i], out->linesize[i],
+                                 in->data[i], in->linesize[i], w, h);
     }
 
     av_frame_free(&in);



More information about the ffmpeg-cvslog mailing list