[FFmpeg-cvslog] avfilter/vf_xfade: do not use alpha for average rgb color

Paul B Mahol git at videolan.org
Thu Aug 27 15:46:34 EEST 2020


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Aug 27 14:42:44 2020 +0200| [1419bf0551be3e40025e15343a97dc05764870a1] | committer: Paul B Mahol

avfilter/vf_xfade: do not use alpha for average rgb color

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

 libavfilter/vf_xfade.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_xfade.c b/libavfilter/vf_xfade.c
index 05fa32a4db..adfcd759a8 100644
--- a/libavfilter/vf_xfade.c
+++ b/libavfilter/vf_xfade.c
@@ -1377,15 +1377,16 @@ static void fadegrays##name##_transition(AVFilterContext *ctx,
                                                      y * a->linesize[p]);            \
                     const type *xf1 = (const type *)(b->data[p] +                    \
                                                      y * b->linesize[p]);            \
-                    bg[0][0] += xf0[x];                                              \
-                    bg[1][0] += xf1[x];                                              \
                     if (p == 3) {                                                    \
                         bg[0][3] = xf0[x];                                           \
                         bg[1][3] = xf1[x];                                           \
+                    } else  {                                                        \
+                        bg[0][0] += xf0[x];                                          \
+                        bg[1][0] += xf1[x];                                          \
                     }                                                                \
                 }                                                                    \
-                bg[0][0] = bg[0][0] / s->nb_planes;                                  \
-                bg[1][0] = bg[1][0] / s->nb_planes;                                  \
+                bg[0][0] = bg[0][0] / 3;                                             \
+                bg[1][0] = bg[1][0] / 3;                                             \
                 bg[0][1] = bg[0][2] = bg[0][0];                                      \
                 bg[1][1] = bg[1][2] = bg[1][0];                                      \
             } else {                                                                 \



More information about the ffmpeg-cvslog mailing list