diff mbox

[FFmpeg-devel,v3] avfilter/vf_delogo: make the interp value compute method simple

Message ID 20191008034533.28675-1-lq@chinaffmpeg.org
State Accepted
Commit a76a516e761ae950d2f5ccd4469ea8d3416718f2
Headers show

Commit Message

Liu Steven Oct. 8, 2019, 3:45 a.m. UTC
because the interp >= 0UL comparison of an unsigned value is always true
fix CID: 1454642

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
---
 libavfilter/vf_delogo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul B Mahol Oct. 8, 2019, 7:44 a.m. UTC | #1
probably ok

On 10/8/19, Steven Liu <lq@chinaffmpeg.org> wrote:
> because the interp >= 0UL comparison of an unsigned value is always true
> fix CID: 1454642
>
> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
> ---
>  libavfilter/vf_delogo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c
> index 376c5e850f..a268b3e9b3 100644
> --- a/libavfilter/vf_delogo.c
> +++ b/libavfilter/vf_delogo.c
> @@ -168,7 +168,7 @@ static void apply_delogo(uint8_t *dst, int dst_linesize,
>                   botleft[x-logo_x1-1]  +
>                   botleft[x-logo_x1+1]) * weightb;
>              weight = (weightl + weightr + weightt + weightb) * 3U;
> -            interp = ROUNDED_DIV(interp, weight);
> +            interp = (interp + (weight >> 1)) / weight;
>
>              if (y >= logo_y+band && y < logo_y+logo_h-band &&
>                  x >= logo_x+band && x < logo_x+logo_w-band) {
> --
> 2.15.1
>
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Liu Steven Oct. 8, 2019, 8:24 a.m. UTC | #2
> 在 2019年10月8日,15:44,Paul B Mahol <onemda@gmail.com> 写道:
> 
> probably ok
Thanks Paul.
> 
> On 10/8/19, Steven Liu <lq@chinaffmpeg.org> wrote:
>> because the interp >= 0UL comparison of an unsigned value is always true
>> fix CID: 1454642
>> 
>> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
>> ---
>> libavfilter/vf_delogo.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c
>> index 376c5e850f..a268b3e9b3 100644
>> --- a/libavfilter/vf_delogo.c
>> +++ b/libavfilter/vf_delogo.c
>> @@ -168,7 +168,7 @@ static void apply_delogo(uint8_t *dst, int dst_linesize,
>>                  botleft[x-logo_x1-1]  +
>>                  botleft[x-logo_x1+1]) * weightb;
>>             weight = (weightl + weightr + weightt + weightb) * 3U;
>> -            interp = ROUNDED_DIV(interp, weight);
>> +            interp = (interp + (weight >> 1)) / weight;
>> 
>>             if (y >= logo_y+band && y < logo_y+logo_h-band &&
>>                 x >= logo_x+band && x < logo_x+logo_w-band) {
>> --
>> 2.15.1
>> 
>> 
>> 
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>> 
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

Hi Michael,

	After this patch, make fate can success passed. 
Thanks
Steven
Liu Steven Oct. 10, 2019, 2:28 a.m. UTC | #3
> 在 2019年10月8日,15:44,Paul B Mahol <onemda@gmail.com> 写道:
> 
> probably ok
pushed
> 
> On 10/8/19, Steven Liu <lq@chinaffmpeg.org> wrote:
>> because the interp >= 0UL comparison of an unsigned value is always true
>> fix CID: 1454642
>> 
>> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
>> ---
>> libavfilter/vf_delogo.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c
>> index 376c5e850f..a268b3e9b3 100644
>> --- a/libavfilter/vf_delogo.c
>> +++ b/libavfilter/vf_delogo.c
>> @@ -168,7 +168,7 @@ static void apply_delogo(uint8_t *dst, int dst_linesize,
>>                  botleft[x-logo_x1-1]  +
>>                  botleft[x-logo_x1+1]) * weightb;
>>             weight = (weightl + weightr + weightt + weightb) * 3U;
>> -            interp = ROUNDED_DIV(interp, weight);
>> +            interp = (interp + (weight >> 1)) / weight;
>> 
>>             if (y >= logo_y+band && y < logo_y+logo_h-band &&
>>                 x >= logo_x+band && x < logo_x+logo_w-band) {
>> --
>> 2.15.1
>> 
>> 
>> 
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>> 
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

Thanks
Steven
diff mbox

Patch

diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c
index 376c5e850f..a268b3e9b3 100644
--- a/libavfilter/vf_delogo.c
+++ b/libavfilter/vf_delogo.c
@@ -168,7 +168,7 @@  static void apply_delogo(uint8_t *dst, int dst_linesize,
                  botleft[x-logo_x1-1]  +
                  botleft[x-logo_x1+1]) * weightb;
             weight = (weightl + weightr + weightt + weightb) * 3U;
-            interp = ROUNDED_DIV(interp, weight);
+            interp = (interp + (weight >> 1)) / weight;
 
             if (y >= logo_y+band && y < logo_y+logo_h-band &&
                 x >= logo_x+band && x < logo_x+logo_w-band) {