diff mbox series

[FFmpeg-devel] avfilter/vf_fftfilt: Use av_clip_uintp2

Message ID 20211014062959.71334-1-martin@martin.st
State New
Headers show
Series [FFmpeg-devel] avfilter/vf_fftfilt: Use av_clip_uintp2
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Martin Storsjö Oct. 14, 2021, 6:29 a.m. UTC
The refactoring in 844890b1bc86316a38bc9e1dbf8ba0dd254307e3 caused
fate-source to point out that this could be av_clip_uintp2.

Signed-off-by: Martin Storsjö <martin@martin.st>
---
 libavfilter/vf_fftfilt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul B Mahol Oct. 14, 2021, 10:50 a.m. UTC | #1
or av_clip_uint8(),

whatever you prefer.
diff mbox series

Patch

diff --git a/libavfilter/vf_fftfilt.c b/libavfilter/vf_fftfilt.c
index d5e49c345d..a59ef075ca 100644
--- a/libavfilter/vf_fftfilt.c
+++ b/libavfilter/vf_fftfilt.c
@@ -191,7 +191,7 @@  static int irdft_horizontal8(AVFilterContext *ctx, void *arg, int jobnr, int nb_
             uint8_t *dst = out->data[plane] + i * out->linesize[plane];
 
             for (int j = 0; j < w; j++)
-                dst[j] = av_clip(lrintf(src[j] * scale), 0, 255);
+                dst[j] = av_clip_uintp2(lrintf(src[j] * scale), 8);
         }
     }