Tuning the allocation trim_offset for shorter frames
authorJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Wed, 24 Nov 2010 22:43:38 +0000 (17:43 -0500)
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Wed, 24 Nov 2010 22:43:38 +0000 (17:43 -0500)
libcelt/rate.c

index 0ad6da8..7de597a 100644 (file)
@@ -285,7 +285,7 @@ int compute_allocation(const CELTMode *m, int start, int end, int *offsets, int
       thresh[j] = 2*(C*(m->eBands[j+1]-m->eBands[j])<<LM<<BITRES)>>3;
    /* Tilt of the allocation curve */
    for (j=start;j<end;j++)
-      trim_offset[j] = C*(m->eBands[j+1]-m->eBands[j])*(2*alloc_trim-4-LM)*(m->nbEBands-j-1)
+      trim_offset[j] = C*(m->eBands[j+1]-m->eBands[j])*(2*alloc_trim-1-2*LM)*(m->nbEBands-j-1)
             <<(LM+BITRES)>>6;
 
    lo = 0;