From 88a58b90fe2d1c71da037fce254e4839c12d63dc Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sun, 6 Mar 2022 12:26:15 +0100 Subject: [PATCH] avfilter/avf_ahistogram: use av_clip_uint8() instead --- libavfilter/avf_ahistogram.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavfilter/avf_ahistogram.c b/libavfilter/avf_ahistogram.c index 03093a162f..f8724cc1b0 100644 --- a/libavfilter/avf_ahistogram.c +++ b/libavfilter/avf_ahistogram.c @@ -359,7 +359,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) if (s->h - H > 0) { h = aa * 255; - s->out->data[0][s->ypos * s->out->linesize[0] + n] = av_clip(h, 0, 255); + s->out->data[0][s->ypos * s->out->linesize[0] + n] = av_clip_uint8(h); s->out->data[1][s->ypos * s->out->linesize[1] + n] = 127; s->out->data[2][s->ypos * s->out->linesize[2] + n] = 127; s->out->data[3][s->ypos * s->out->linesize[3] + n] = 255; @@ -373,9 +373,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) if (s->out->data[0][y * s->out->linesize[0] + n] != old) break; old = s->out->data[0][y * s->out->linesize[0] + n]; - s->out->data[0][y * s->out->linesize[0] + n] = av_clip(yf, 0, 255); - s->out->data[1][y * s->out->linesize[1] + n] = av_clip(128.f+uf, 0, 255); - s->out->data[2][y * s->out->linesize[2] + n] = av_clip(128.f+vf, 0, 255); + s->out->data[0][y * s->out->linesize[0] + n] = av_clip_uint8(yf); + s->out->data[1][y * s->out->linesize[1] + n] = av_clip_uint8(128.f+uf); + s->out->data[2][y * s->out->linesize[2] + n] = av_clip_uint8(128.f+vf); s->out->data[3][y * s->out->linesize[3] + n] = 255; }