diff --git a/libavfilter/af_stereotools.c b/libavfilter/af_stereotools.c index e19ada47d0..a22efb02ea 100644 --- a/libavfilter/af_stereotools.c +++ b/libavfilter/af_stereotools.c @@ -146,7 +146,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) double *buffer = s->buffer; AVFrame *out; double *dst; - int nbuf = inlink->sample_rate * (FFABS(delay) / 1000.); + int nbuf = inlink->sample_rate * (fabs(delay) / 1000.); int n; nbuf -= nbuf % 2; diff --git a/libavfilter/avf_avectorscope.c b/libavfilter/avf_avectorscope.c index 30985f3d49..38dd97ec1c 100644 --- a/libavfilter/avf_avectorscope.c +++ b/libavfilter/avf_avectorscope.c @@ -220,7 +220,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) cx = sx * sqrtf(1 - 0.5*sy*sy); cy = sy * sqrtf(1 - 0.5*sx*sx); x = hw + hw * FFSIGN(cx + cy) * (cx - cy) * .7; - y = s->h - s->h * FFABS(cx + cy) * .7; + y = s->h - s->h * fabsf(cx + cy) * .7; } draw_dot(s, x, y); @@ -244,7 +244,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) cx = sx * sqrtf(1 - 0.5 * sy * sy); cy = sy * sqrtf(1 - 0.5 * sx * sx); x = hw + hw * FFSIGN(cx + cy) * (cx - cy) * .7; - y = s->h - s->h * FFABS(cx + cy) * .7; + y = s->h - s->h * fabsf(cx + cy) * .7; } draw_dot(s, x, y); diff --git a/libavfilter/avf_showcqt.c b/libavfilter/avf_showcqt.c index ce42cd645a..2bd772ec0f 100644 --- a/libavfilter/avf_showcqt.c +++ b/libavfilter/avf_showcqt.c @@ -371,7 +371,7 @@ static int config_output(AVFilterLink *outlink) tlength = s->timeclamp; } - volume = FFABS(av_expr_eval(volume_expr, expr_vars_val, NULL)); + volume = fabs(av_expr_eval(volume_expr, expr_vars_val, NULL)); if (isnan(volume)) { av_log(ctx, AV_LOG_WARNING, "at freq %g: volume is nan, setting it to 0\n", freq); volume = VOLUME_MIN; diff --git a/libavfilter/avf_showfreqs.c b/libavfilter/avf_showfreqs.c index 0f2ae22c4a..a3665ef4bb 100644 --- a/libavfilter/avf_showfreqs.c +++ b/libavfilter/avf_showfreqs.c @@ -163,7 +163,7 @@ static void generate_window_func(float *lut, int N, int win_func, float *overlap break; case WFUNC_BARTLETT: for (n = 0; n < N; n++) - lut[n] = 1.-FFABS((n-(N-1)/2.)/((N-1)/2.)); + lut[n] = 1.-fabs((n-(N-1)/2.)/((N-1)/2.)); *overlap = 0.5; break; case WFUNC_HANNING: @@ -207,7 +207,7 @@ static void generate_window_func(float *lut, int N, int win_func, float *overlap break; case WFUNC_BHANN: for (n = 0; n < N; n++) - lut[n] = 0.62-0.48*FFABS(n/(double)(N-1)-.5)-0.38*cos(2*M_PI*n/(N-1)); + lut[n] = 0.62-0.48*fabs(n/(double)(N-1)-.5)-0.38*cos(2*M_PI*n/(N-1)); *overlap = 0.5; break; case WFUNC_SINE: diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c index b9ea11bb84..9e115fcf17 100644 --- a/libavfilter/f_ebur128.c +++ b/libavfilter/f_ebur128.c @@ -558,9 +558,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) ebur128->true_peaks_per_frame[ch] = 0.0; for (idx_insample = 0; idx_insample < ret; idx_insample++) { for (ch = 0; ch < nb_channels; ch++) { - ebur128->true_peaks[ch] = FFMAX(ebur128->true_peaks[ch], FFABS(*swr_samples)); + ebur128->true_peaks[ch] = FFMAX(ebur128->true_peaks[ch], fabs(*swr_samples)); ebur128->true_peaks_per_frame[ch] = FFMAX(ebur128->true_peaks_per_frame[ch], - FFABS(*swr_samples)); + fabs(*swr_samples)); swr_samples++; } } @@ -586,7 +586,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) double bin; if (ebur128->peak_mode & PEAK_MODE_SAMPLES_PEAKS) - ebur128->sample_peaks[ch] = FFMAX(ebur128->sample_peaks[ch], FFABS(*samples)); + ebur128->sample_peaks[ch] = FFMAX(ebur128->sample_peaks[ch], fabs(*samples)); ebur128->x[ch * 3] = *samples++; // set X[i] diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c index 7b5e51b7e6..f2c4b84f01 100644 --- a/libavfilter/vf_blend.c +++ b/libavfilter/vf_blend.c @@ -241,7 +241,7 @@ DEFINE_BLEND8(lighten, FFMAX(A, B)) DEFINE_BLEND8(divide, av_clip_uint8(((float)A / ((float)B) * 255))) DEFINE_BLEND8(dodge, DODGE(A, B)) DEFINE_BLEND8(burn, BURN(A, B)) -DEFINE_BLEND8(softlight, (A > 127) ? B + (255 - B) * (A - 127.5) / 127.5 * (0.5 - FFABS(B - 127.5) / 255): B - B * ((127.5 - A) / 127.5) * (0.5 - FFABS(B - 127.5)/255)) +DEFINE_BLEND8(softlight, (A > 127) ? B + (255 - B) * (A - 127.5) / 127.5 * (0.5 - fabs(B - 127.5) / 255): B - B * ((127.5 - A) / 127.5) * (0.5 - fabs(B - 127.5)/255)) DEFINE_BLEND8(exclusion, A + B - 2 * A * B / 255) DEFINE_BLEND8(pinlight, (B < 128) ? FFMIN(A, 2 * B) : FFMAX(A, 2 * (B - 128))) DEFINE_BLEND8(phoenix, FFMIN(A, B) - FFMAX(A, B) + 255) @@ -280,7 +280,7 @@ DEFINE_BLEND16(lighten, FFMAX(A, B)) DEFINE_BLEND16(divide, av_clip_uint16(((float)A / ((float)B) * 65535))) DEFINE_BLEND16(dodge, DODGE(A, B)) DEFINE_BLEND16(burn, BURN(A, B)) -DEFINE_BLEND16(softlight, (A > 32767) ? B + (65535 - B) * (A - 32767.5) / 32767.5 * (0.5 - FFABS(B - 32767.5) / 65535): B - B * ((32767.5 - A) / 32767.5) * (0.5 - FFABS(B - 32767.5)/65535)) +DEFINE_BLEND16(softlight, (A > 32767) ? B + (65535 - B) * (A - 32767.5) / 32767.5 * (0.5 - fabs(B - 32767.5) / 65535): B - B * ((32767.5 - A) / 32767.5) * (0.5 - fabs(B - 32767.5)/65535)) DEFINE_BLEND16(exclusion, A + B - 2 * A * B / 65535) DEFINE_BLEND16(pinlight, (B < 32768) ? FFMIN(A, 2 * B) : FFMAX(A, 2 * (B - 32768))) DEFINE_BLEND16(phoenix, FFMIN(A, B) - FFMAX(A, B) + 65535) diff --git a/libavfilter/vf_dctdnoiz.c b/libavfilter/vf_dctdnoiz.c index 37306bb582..6957f19aea 100644 --- a/libavfilter/vf_dctdnoiz.c +++ b/libavfilter/vf_dctdnoiz.c @@ -367,10 +367,10 @@ static av_always_inline void filter_freq_##bsize(const float *src, int src_lines float *b = &tmp_block2[i]; \ /* frequency filtering */ \ if (expr) { \ - var_values[VAR_C] = FFABS(*b); \ + var_values[VAR_C] = fabsf(*b); \ *b *= av_expr_eval(expr, var_values, NULL); \ } else { \ - if (FFABS(*b) < sigma_th) \ + if (fabsf(*b) < sigma_th) \ *b = 0; \ } \ } \ diff --git a/libavfilter/vf_framerate.c b/libavfilter/vf_framerate.c index e8fba285d8..237a4873b3 100644 --- a/libavfilter/vf_framerate.c +++ b/libavfilter/vf_framerate.c @@ -223,7 +223,7 @@ static int blend_frames16(AVFilterContext *ctx, float interpolate, } // decide if the shot-change detection allows us to blend two frames if (interpolate_scene_score < s->scene_score && copy_src2) { - uint16_t src2_factor = FFABS(interpolate) * (1 << (s->bitdepth - 8)); + uint16_t src2_factor = fabsf(interpolate) * (1 << (s->bitdepth - 8)); uint16_t src1_factor = s->max - src2_factor; const int half = s->max / 2; const int uv = (s->max + 1) * half; @@ -287,7 +287,7 @@ static int blend_frames8(AVFilterContext *ctx, float interpolate, } // decide if the shot-change detection allows us to blend two frames if (interpolate_scene_score < s->scene_score && copy_src2) { - uint16_t src2_factor = FFABS(interpolate); + uint16_t src2_factor = fabsf(interpolate); uint16_t src1_factor = 256 - src2_factor; int plane, line, pixel; diff --git a/libavfilter/vf_hqdn3d.c b/libavfilter/vf_hqdn3d.c index 6c76c5c176..5b367fff79 100644 --- a/libavfilter/vf_hqdn3d.c +++ b/libavfilter/vf_hqdn3d.c @@ -182,7 +182,7 @@ static int16_t *precalc_coefs(double dist25, int depth) for (i = -256<sample_aspect_ratio, codec->sample_aspect_ratio) - && FFABS(av_q2d(st->sample_aspect_ratio) - av_q2d(codec->sample_aspect_ratio)) > 0.004*av_q2d(st->sample_aspect_ratio) + && fabs(av_q2d(st->sample_aspect_ratio) - av_q2d(codec->sample_aspect_ratio)) > 0.004*av_q2d(st->sample_aspect_ratio) ) { if (st->sample_aspect_ratio.num != 0 && st->sample_aspect_ratio.den != 0 && diff --git a/libswresample/swresample-test.c b/libswresample/swresample-test.c index 47c54a109b..9caa750750 100644 --- a/libswresample/swresample-test.c +++ b/libswresample/swresample-test.c @@ -374,7 +374,7 @@ int main(int argc, char **argv){ sum_aa+= a*a; sum_bb+= b*b; sum_ab+= a*b; - maxdiff= FFMAX(maxdiff, FFABS(a-b)); + maxdiff= FFMAX(maxdiff, fabs(a-b)); } sse= sum_aa + sum_bb - 2*sum_ab; if(sse < 0 && sse > -0.00001) sse=0; //fix rounding error @@ -404,7 +404,7 @@ int main(int argc, char **argv){ sum_aa+= a*a; sum_bb+= b*b; sum_ab+= a*b; - maxdiff= FFMAX(maxdiff, FFABS(a-b)); + maxdiff= FFMAX(maxdiff, fabs(a-b)); } sse= sum_aa + sum_bb - 2*sum_ab; if(sse < 0 && sse > -0.00001) sse=0; //fix rounding error