[FFmpeg-cvslog] aacenc: avoid double in quantize_bands.

Reimar Döffinger git at videolan.org
Mon Mar 28 17:58:51 CEST 2016


ffmpeg | branch: release/3.0 | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Tue Mar  1 22:53:18 2016 +0100| [1cbe4ff2acdd1f166ac7ac912c1b00da9fbf0dd1] | committer: Rostislav Pehlivanov

aacenc: avoid double in quantize_bands.

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 <Reimar.Doeffinger at gmx.de>
(cherry picked from commit 0a04c2885f02f7db6b410b6d43d120e5eb48dc18)

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

 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 c2a2c2e..b9bd6bf 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];
         }



More information about the ffmpeg-cvslog mailing list