shithub: opus

Download patch

ref: b450ed48aefb143509125de567d66cabda1f5111
parent: b8ba70c99be6e597bbfee3e18b949193f52ef075
author: Jean-Marc Valin <[email protected]>
date: Sun Apr 18 18:47:58 EDT 2010

Removed unnecessary calls to log2Amp()

--- a/libcelt/quant_bands.c
+++ b/libcelt/quant_bands.c
@@ -172,7 +172,6 @@
 #endif
          oldEBands[i+c*m->nbEBands] += offset;
          error[i+c*m->nbEBands] -= offset;
-         eBands[i+c*m->nbEBands] = log2Amp(oldEBands[i+c*m->nbEBands]);
          /*printf ("%f ", error[i] - offset);*/
       } while (++c < C);
    }
@@ -204,6 +203,7 @@
             offset = (q2-.5f)*(1<<(14-fine_quant[i]-1))*(1.f/16384);
 #endif
             oldEBands[i+c*m->nbEBands] += offset;
+            eBands[i+c*m->nbEBands] = log2Amp(oldEBands[i+c*m->nbEBands]);
             bits_left--;
          } while (++c < C);
       }
@@ -210,7 +210,6 @@
    }
    for (i=start;i<C*m->nbEBands;i++)
    {
-      eBands[i] = log2Amp(oldEBands[i]);
       if (oldEBands[i] < -QCONST16(7.f,DB_SHIFT))
          oldEBands[i] = -QCONST16(7.f,DB_SHIFT);
    }
@@ -303,6 +302,7 @@
             offset = (q2-.5f)*(1<<(14-fine_quant[i]-1))*(1.f/16384);
 #endif
             oldEBands[i+c*m->nbEBands] += offset;
+            eBands[i+c*m->nbEBands] = log2Amp(oldEBands[i+c*m->nbEBands]);
             bits_left--;
          } while (++c < C);
       }
@@ -309,7 +309,6 @@
    }
    for (i=start;i<C*m->nbEBands;i++)
    {
-      eBands[i] = log2Amp(oldEBands[i]);
       if (oldEBands[i] < -QCONST16(7.f,DB_SHIFT))
          oldEBands[i] = -QCONST16(7.f,DB_SHIFT);
    }