[FFmpeg-devel] [PATCH 1/2] avcodec/vvc: Remove NOP condition check in alf_filter_luma

Nuo Mi nuomi2021 at gmail.com
Tue Jul 16 15:31:18 EEST 2024


On Tue, Jul 16, 2024 at 10:50 AM Zhao Zhili <quinkblack at foxmail.com> wrote:

> From: Zhao Zhili <zhilizhao at tencent.com>
>
> If (y + i == vb_above) or (y + i == vb_below), the if body has no
> operation.
>
👍, How did you find this? From a compiler warning or by reading the code?


> ---
>  libavcodec/vvc/filter_template.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/vvc/filter_template.c
> b/libavcodec/vvc/filter_template.c
> index 9b3a0e46f7..32777452b7 100644
> --- a/libavcodec/vvc/filter_template.c
> +++ b/libavcodec/vvc/filter_template.c
> @@ -77,7 +77,7 @@ static void FUNC(alf_filter_luma)(uint8_t *_dst,
> ptrdiff_t dst_stride, const uin
>                  const int is_near_vb_below = (y + i >= vb_pos) && (y + i
> <= vb_pos);
>                  const int is_near_vb = is_near_vb_above ||
> is_near_vb_below;
>
> -                if ((y + i < vb_pos) && ((y + i) >= vb_above)) {
> +                if ((y + i < vb_pos) && ((y + i) > vb_above)) {
>                      p1 = (y + i == vb_pos - 1) ? p0 : p1;
>                      p3 = (y + i >= vb_pos - 2) ? p1 : p3;
>                      p5 = (y + i >= vb_pos - 3) ? p3 : p5;
> @@ -85,7 +85,7 @@ static void FUNC(alf_filter_luma)(uint8_t *_dst,
> ptrdiff_t dst_stride, const uin
>                      p2 = (y + i == vb_pos - 1) ? p0 : p2;
>                      p4 = (y + i >= vb_pos - 2) ? p2 : p4;
>                      p6 = (y + i >= vb_pos - 3) ? p4 : p6;
> -                } else if ((y + i >= vb_pos) && ((y + i) <= vb_below)) {
> +                } else if ((y + i >= vb_pos) && ((y + i) < vb_below)) {
>                      p2 = (y + i == vb_pos    ) ? p0 : p2;
>                      p4 = (y + i <= vb_pos + 1) ? p2 : p4;
>                      p6 = (y + i <= vb_pos + 2) ? p4 : p6;
> --
> 2.42.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-devel mailing list