[FFmpeg-cvslog] avfilter/vf_selectivecolor: no need to use doubles

Paul B Mahol git at videolan.org
Fri Oct 22 14:57:45 EEST 2021


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Oct 22 13:47:16 2021 +0200| [eda2a50c8e9381a357f936a190659bb039e0c038] | committer: Paul B Mahol

avfilter/vf_selectivecolor: no need to use doubles

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

 libavfilter/vf_selectivecolor.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_selectivecolor.c b/libavfilter/vf_selectivecolor.c
index 9ace3ce4a6..ea4b5dfee2 100644
--- a/libavfilter/vf_selectivecolor.c
+++ b/libavfilter/vf_selectivecolor.c
@@ -223,7 +223,7 @@ static int parse_psfile(AVFilterContext *ctx, const char *fname)
         int k;
         for (k = 0; k < FF_ARRAY_ELEMS(s->cmyk_adjust[0]); k++) {
             READ16(val);
-            s->cmyk_adjust[i][k] = val / 100.;
+            s->cmyk_adjust[i][k] = val / 100.f;
         }
         ret = register_range(s, i);
         if (ret < 0)
@@ -299,11 +299,11 @@ static const enum AVPixelFormat pix_fmts[] = {
 static inline int comp_adjust(int scale, float value, float adjust, float k, int correction_method)
 {
     const float min = -value;
-    const float max = 1. - value;
-    float res = (-1. - adjust) * k - adjust;
+    const float max = 1.f - value;
+    float res = (-1.f - adjust) * k - adjust;
     if (correction_method == CORRECTION_METHOD_RELATIVE)
         res *= max;
-    return lrint(av_clipf(res, min, max) * scale);
+    return lrintf(av_clipf(res, min, max) * scale);
 }
 
 #define DECLARE_SELECTIVE_COLOR_FUNC(nbits)                                                             \



More information about the ffmpeg-cvslog mailing list