]> git.sesse.net Git - ffmpeg/commitdiff
avfilter: use av_clip_uintp2_c where clip is variable
authorJohn Cox <jc@kynesim.co.uk>
Thu, 31 May 2018 14:22:59 +0000 (16:22 +0200)
committerPaul B Mahol <onemda@gmail.com>
Thu, 31 May 2018 14:22:59 +0000 (16:22 +0200)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavfilter/vf_amplify.c
libavfilter/vf_colorbalance.c
libavfilter/vf_fftdnoiz.c

index d1e105ef1709f3741c0d095741a53fac08697372..f16267fdcdc1a10c59150076d2ac328ee71800e6 100644 (file)
@@ -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;
                     }
index dd8189f5483ba6ae73202247b087ff985b4098dc..fd003fdc21a5d362e164ee5b7f44b3fb2c6348c8 100644 (file)
@@ -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;
index 05a564e406145c60230c348cf758ebc2e0104347..7ee7dbc19b6a36a4d3c4591aec84edfed4b53d0c 100644 (file)
@@ -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)