Browse code

avfilter/avf_showcqt: Replace all fmin* and fmax* by FFMIN/FFMAX

Should fix build on x86_32-msvc2012

The alternative of emulating fmin/fmax* turns out to be non trivial

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

Michael Niedermayer authored on 2015/10/31 08:16:06
Showing 1 changed files
... ...
@@ -313,8 +313,8 @@ static int init_cqt(ShowCQTContext *s)
313 313
 
314 314
         flen = 8.0 * s->fft_len / (tlength * rate);
315 315
         center = s->freq[k] * s->fft_len / rate;
316
-        start = fmax(0, ceil(center - 0.5 * flen));
317
-        end = fmin(s->fft_len, floor(center + 0.5 * flen));
316
+        start = FFMAX(0, ceil(center - 0.5 * flen));
317
+        end = FFMIN(s->fft_len, floor(center + 0.5 * flen));
318 318
 
319 319
         s->coeffs[m].start = start & ~(s->cqt_align - 1);
320 320
         s->coeffs[m].len = (end | (s->cqt_align - 1)) + 1 - s->coeffs[m].start;
... ...
@@ -665,9 +665,9 @@ static void rgb_from_cqt(ColorFloat *c, const FFTComplex *v, float g, int len)
665 665
 {
666 666
     int x;
667 667
     for (x = 0; x < len; x++) {
668
-        c[x].rgb.r = 255.0f * calculate_gamma(fminf(1.0f, v[x].re), g);
669
-        c[x].rgb.g = 255.0f * calculate_gamma(fminf(1.0f, 0.5f * (v[x].re + v[x].im)), g);
670
-        c[x].rgb.b = 255.0f * calculate_gamma(fminf(1.0f, v[x].im), g);
668
+        c[x].rgb.r = 255.0f * calculate_gamma(FFMIN(1.0f, v[x].re), g);
669
+        c[x].rgb.g = 255.0f * calculate_gamma(FFMIN(1.0f, 0.5f * (v[x].re + v[x].im)), g);
670
+        c[x].rgb.b = 255.0f * calculate_gamma(FFMIN(1.0f, v[x].im), g);
671 671
     }
672 672
 }
673 673
 
... ...
@@ -676,9 +676,9 @@ static void yuv_from_cqt(ColorFloat *c, const FFTComplex *v, float gamma, int le
676 676
     int x;
677 677
     for (x = 0; x < len; x++) {
678 678
         float r, g, b;
679
-        r = calculate_gamma(fminf(1.0f, v[x].re), gamma);
680
-        g = calculate_gamma(fminf(1.0f, 0.5f * (v[x].re + v[x].im)), gamma);
681
-        b = calculate_gamma(fminf(1.0f, v[x].im), gamma);
679
+        r = calculate_gamma(FFMIN(1.0f, v[x].re), gamma);
680
+        g = calculate_gamma(FFMIN(1.0f, 0.5f * (v[x].re + v[x].im)), gamma);
681
+        b = calculate_gamma(FFMIN(1.0f, v[x].im), gamma);
682 682
         c[x].yuv.y = 16.0f + 65.481f * r + 128.553f * g + 24.966f * b;
683 683
         c[x].yuv.u = 128.0f - 37.797f * r - 74.203f * g + 112.0f * b;
684 684
         c[x].yuv.v = 128.0f + 112.0f * r - 93.786f * g - 18.214 * b;