From 1cbe4ff2acdd1f166ac7ac912c1b00da9fbf0dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Tue, 1 Mar 2016 22:53:18 +0100 Subject: [PATCH] aacenc: avoid double in quantize_bands. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I cannot see any point whatsoever to use double here instead of float, the results are likely identical in all cases.. Using float allows for much more efficient use of SIMD. Signed-off-by: Reimar Döffinger (cherry picked from commit 0a04c2885f02f7db6b410b6d43d120e5eb48dc18) --- libavcodec/aacenc_utils.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/aacenc_utils.h b/libavcodec/aacenc_utils.h index c2a2c2ec68..b9bd6bf449 100644 --- a/libavcodec/aacenc_utils.h +++ b/libavcodec/aacenc_utils.h @@ -66,10 +66,9 @@ static inline void quantize_bands(int *out, const float *in, const float *scaled const float rounding) { int i; - double qc; for (i = 0; i < size; i++) { - qc = scaled[i] * Q34; - out[i] = (int)FFMIN(qc + rounding, (double)maxval); + float qc = scaled[i] * Q34; + out[i] = (int)FFMIN(qc + rounding, (float)maxval); if (is_signed && in[i] < 0.0f) { out[i] = -out[i]; }