[FFmpeg-cvslog] avfilter/avf_ahistogram: use av_clip_uint8() instead

Paul B Mahol git at videolan.org
Sun Mar 6 13:26:34 EET 2022


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Mar  6 12:26:15 2022 +0100| [88a58b90fe2d1c71da037fce254e4839c12d63dc] | committer: Paul B Mahol

avfilter/avf_ahistogram: use av_clip_uint8() instead

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=88a58b90fe2d1c71da037fce254e4839c12d63dc
---

 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;
                 }
 



More information about the ffmpeg-cvslog mailing list