Removed unnecessary calls to log2Amp()
authorJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Mon, 19 Apr 2010 02:47:58 +0000 (22:47 -0400)
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Mon, 19 Apr 2010 02:47:58 +0000 (22:47 -0400)
libcelt/quant_bands.c

index 1b92310..391d58c 100644 (file)
@@ -172,7 +172,6 @@ void quant_fine_energy(const CELTMode *m, int start, celt_ener *eBands, celt_wor
 #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,13 +203,13 @@ void quant_energy_finalise(const CELTMode *m, int start, celt_ener *eBands, celt
             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);
       }
    }
    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,13 +302,13 @@ void unquant_energy_finalise(const CELTMode *m, int start, celt_ener *eBands, ce
             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);
       }
    }
    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);
    }