[FFmpeg-cvslog] avfilter: use av_clip_uintp2_c where clip is variable

John Cox git at videolan.org
Thu May 31 17:33:00 EEST 2018


ffmpeg | branch: master | John Cox <jc at kynesim.co.uk> | Thu May 31 16:22:59 2018 +0200| [8d4fc2ea06a7c69efa35b032e3fb2ad853ea3daf] | committer: Paul B Mahol

avfilter: use av_clip_uintp2_c where clip is variable

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavfilter/vf_amplify.c      |  2 +-
 libavfilter/vf_colorbalance.c | 18 +++++++++---------
 libavfilter/vf_fftdnoiz.c     |  2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/libavfilter/vf_amplify.c b/libavfilter/vf_amplify.c
index d1e105ef17..f16267fdcd 100644
--- a/libavfilter/vf_amplify.c
+++ b/libavfilter/vf_amplify.c
@@ -186,7 +186,7 @@ static int amplify_frame(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs
                         } else {
                             amp = FFMIN(FFABS(diff * factor), hlimit);
                         }
-                        dst[x] = av_clip_uintp2(src + amp, depth);
+                        dst[x] = av_clip_uintp2_c(src + amp, depth);
                     } else {
                         dst[x] = src;
                     }
diff --git a/libavfilter/vf_colorbalance.c b/libavfilter/vf_colorbalance.c
index dd8189f548..fd003fdc21 100644
--- a/libavfilter/vf_colorbalance.c
+++ b/libavfilter/vf_colorbalance.c
@@ -297,17 +297,17 @@ static int config_output(AVFilterLink *outlink)
     for (i = 0; i < max; i++) {
         r = g = b = i;
 
-        r = av_clip_uintp2(r + s->cyan_red.shadows         * shadows[r],    depth);
-        r = av_clip_uintp2(r + s->cyan_red.midtones        * midtones[r],   depth);
-        r = av_clip_uintp2(r + s->cyan_red.highlights      * highlights[r], depth);
+        r = av_clip_uintp2_c(r + s->cyan_red.shadows         * shadows[r],    depth);
+        r = av_clip_uintp2_c(r + s->cyan_red.midtones        * midtones[r],   depth);
+        r = av_clip_uintp2_c(r + s->cyan_red.highlights      * highlights[r], depth);
 
-        g = av_clip_uintp2(g + s->magenta_green.shadows    * shadows[g],    depth);
-        g = av_clip_uintp2(g + s->magenta_green.midtones   * midtones[g],   depth);
-        g = av_clip_uintp2(g + s->magenta_green.highlights * highlights[g], depth);
+        g = av_clip_uintp2_c(g + s->magenta_green.shadows    * shadows[g],    depth);
+        g = av_clip_uintp2_c(g + s->magenta_green.midtones   * midtones[g],   depth);
+        g = av_clip_uintp2_c(g + s->magenta_green.highlights * highlights[g], depth);
 
-        b = av_clip_uintp2(b + s->yellow_blue.shadows      * shadows[b],    depth);
-        b = av_clip_uintp2(b + s->yellow_blue.midtones     * midtones[b],   depth);
-        b = av_clip_uintp2(b + s->yellow_blue.highlights   * highlights[b], depth);
+        b = av_clip_uintp2_c(b + s->yellow_blue.shadows      * shadows[b],    depth);
+        b = av_clip_uintp2_c(b + s->yellow_blue.midtones     * midtones[b],   depth);
+        b = av_clip_uintp2_c(b + s->yellow_blue.highlights   * highlights[b], depth);
 
         s->lut[R][i] = r;
         s->lut[G][i] = g;
diff --git a/libavfilter/vf_fftdnoiz.c b/libavfilter/vf_fftdnoiz.c
index 05a564e406..7ee7dbc19b 100644
--- a/libavfilter/vf_fftdnoiz.c
+++ b/libavfilter/vf_fftdnoiz.c
@@ -176,7 +176,7 @@ static void export_row16(FFTComplex *src, uint8_t *dstp, int rw, float scale, in
     int j;
 
     for (j = 0; j < rw; j++)
-        dst[j] = av_clip_uintp2(src[j].re * scale, depth);
+        dst[j] = av_clip_uintp2_c(src[j].re * scale, depth);
 }
 
 static int config_input(AVFilterLink *inlink)



More information about the ffmpeg-cvslog mailing list