Message ID | 20190606070959.9608-1-lance.lmwang@gmail.com |
---|---|
State | Accepted |
Headers | show |
On Thu, Jun 6, 2019 at 3:10 PM <lance.lmwang@gmail.com> wrote: > From: Limin Wang <lance.lmwang@gmail.com> > > Signed-off-by: Limin Wang <lance.lmwang@gmail.com> > --- > libavfilter/vf_overlay.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/libavfilter/vf_overlay.c b/libavfilter/vf_overlay.c > index 0a8f089c0d..b468cedf2e 100644 > --- a/libavfilter/vf_overlay.c > +++ b/libavfilter/vf_overlay.c > @@ -500,7 +500,7 @@ static av_always_inline void > blend_plane(AVFilterContext *ctx, > for (; k < kmax; k++) { > int alpha_v, alpha_h, alpha; > > - // average alpha for color components, improve quality > + /* average alpha for color components, improve quality */ > if (hsub && vsub && j+1 < src_hp && k+1 < src_wp) { > alpha = (a[0] + a[src->linesize[3]] + > a[1] + a[src->linesize[3]+1]) >> 2; > @@ -512,10 +512,10 @@ static av_always_inline void > blend_plane(AVFilterContext *ctx, > alpha = (alpha_v + alpha_h) >> 1; > } else > alpha = a[0]; > - // if the main channel has an alpha channel, alpha has to be > calculated > - // to create an un-premultiplied (straight) alpha value > + /* if the main channel has an alpha channel, alpha has to be > calculated */ > + /* to create an un-premultiplied (straight) alpha value */ > if (main_has_alpha && alpha != 0 && alpha != 255) { > - // average alpha for color components, improve quality > + /* average alpha for color components, improve quality */ > uint8_t alpha_d; > if (hsub && vsub && j+1 < src_hp && k+1 < src_wp) { > alpha_d = (da[0] + da[dst->linesize[3]] + > @@ -556,7 +556,7 @@ static inline void alpha_composite(const AVFrame *src, > const AVFrame *dst, > int x, int y, > int jobnr, int nb_jobs) > { > - uint8_t alpha; ///< the amount of overlay to blend on to main > + uint8_t alpha; /* the amount of overlay to blend on to main > */ > uint8_t *s, *sa, *d, *da; > int i, imax, j, jmax; > int slice_start, slice_end; > @@ -587,7 +587,7 @@ static inline void alpha_composite(const AVFrame *src, > const AVFrame *dst, > *d = *s; > break; > default: > - // apply alpha compositing: main_alpha += (1-main_alpha) > * overlay_alpha > + /* apply alpha compositing: main_alpha += (1-main_alpha) > * overlay_alpha */ > *d += FAST_DIV255((255 - *d) * *s); > } > d += 1; > -- > ping, who can help to review and test the patches. > 2.21.0 > >
diff --git a/libavfilter/vf_overlay.c b/libavfilter/vf_overlay.c index 0a8f089c0d..b468cedf2e 100644 --- a/libavfilter/vf_overlay.c +++ b/libavfilter/vf_overlay.c @@ -500,7 +500,7 @@ static av_always_inline void blend_plane(AVFilterContext *ctx, for (; k < kmax; k++) { int alpha_v, alpha_h, alpha; - // average alpha for color components, improve quality + /* average alpha for color components, improve quality */ if (hsub && vsub && j+1 < src_hp && k+1 < src_wp) { alpha = (a[0] + a[src->linesize[3]] + a[1] + a[src->linesize[3]+1]) >> 2; @@ -512,10 +512,10 @@ static av_always_inline void blend_plane(AVFilterContext *ctx, alpha = (alpha_v + alpha_h) >> 1; } else alpha = a[0]; - // if the main channel has an alpha channel, alpha has to be calculated - // to create an un-premultiplied (straight) alpha value + /* if the main channel has an alpha channel, alpha has to be calculated */ + /* to create an un-premultiplied (straight) alpha value */ if (main_has_alpha && alpha != 0 && alpha != 255) { - // average alpha for color components, improve quality + /* average alpha for color components, improve quality */ uint8_t alpha_d; if (hsub && vsub && j+1 < src_hp && k+1 < src_wp) { alpha_d = (da[0] + da[dst->linesize[3]] + @@ -556,7 +556,7 @@ static inline void alpha_composite(const AVFrame *src, const AVFrame *dst, int x, int y, int jobnr, int nb_jobs) { - uint8_t alpha; ///< the amount of overlay to blend on to main + uint8_t alpha; /* the amount of overlay to blend on to main */ uint8_t *s, *sa, *d, *da; int i, imax, j, jmax; int slice_start, slice_end; @@ -587,7 +587,7 @@ static inline void alpha_composite(const AVFrame *src, const AVFrame *dst, *d = *s; break; default: - // apply alpha compositing: main_alpha += (1-main_alpha) * overlay_alpha + /* apply alpha compositing: main_alpha += (1-main_alpha) * overlay_alpha */ *d += FAST_DIV255((255 - *d) * *s); } d += 1;