[FFmpeg-cvslog] ac3enc: slightly faster quantize_mantissas_blk_ch()

Mans Rullgard git at videolan.org
Sat Oct 22 11:21:06 CEST 2011


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Sun Mar 27 15:47:10 2011 +0100| [9d4bbf6d4f3a0b78c4ec7a1f366adf5c3cc8ea1a] | committer: Mans Rullgard

ac3enc: slightly faster quantize_mantissas_blk_ch()

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

 libavcodec/ac3enc.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 809a3f5..668cebe 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -1074,14 +1074,11 @@ static void quantize_mantissas_blk_ch(AC3Mant *s, int32_t *fixed_coef,
     int i;
 
     for (i = start_freq; i < end_freq; i++) {
-        int v;
         int c = fixed_coef[i];
         int e = exp[i];
-        int b = bap[i];
-        switch (b) {
-        case 0:
-            v = 0;
-            break;
+        int v = bap[i];
+        if (v)
+        switch (v) {
         case 1:
             v = sym_quant(c, e, 3);
             switch (s->mant1_cnt) {
@@ -1150,7 +1147,7 @@ static void quantize_mantissas_blk_ch(AC3Mant *s, int32_t *fixed_coef,
             v = asym_quant(c, e, 16);
             break;
         default:
-            v = asym_quant(c, e, b - 1);
+            v = asym_quant(c, e, v - 1);
             break;
         }
         qmant[i] = v;



More information about the ffmpeg-cvslog mailing list