X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fvf_delogo.c;h=1b8e4082107c05c68444cec7784ce2ce9f8e1bfc;hb=924fcac52148ef3e37ea39b5901299930b9c1b28;hp=c7fb6e3f382aee40e82320959c098de992e3c7bf;hpb=a6dac0b41054510eb88210197246f9fc40c5781c;p=ffmpeg diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c index c7fb6e3f382..1b8e4082107 100644 --- a/libavfilter/vf_delogo.c +++ b/libavfilter/vf_delogo.c @@ -61,7 +61,7 @@ static void apply_delogo(uint8_t *dst, int dst_linesize, unsigned int band, int show, int direct) { int x, y; - uint64_t interp, weightl, weightr, weightt, weightb; + uint64_t interp, weightl, weightr, weightt, weightb, weight; uint8_t *xdst, *xsrc; uint8_t *topleft, *botleft, *topright; @@ -125,7 +125,8 @@ static void apply_delogo(uint8_t *dst, int dst_linesize, (botleft[x-logo_x1] + botleft[x-logo_x1-1] + botleft[x-logo_x1+1]) * weightb; - interp /= (weightl + weightr + weightt + weightb) * 3U; + weight = (weightl + weightr + weightt + weightb) * 3U; + interp = ROUNDED_DIV(interp, weight); if (y >= logo_y+band && y < logo_y+logo_h-band && x >= logo_x+band && x < logo_x+logo_w-band) {