shithub: opus

Download patch

ref: d539ad5f935f3d554e6c2ff2c1d83db16d14e4d2
parent: fda0e10f0108e9fbb004bc5ca7edc7da559c7e65
author: Jean-Marc Valin <[email protected]>
date: Mon Feb 9 18:54:52 EST 2009

Fixed an overflow in the bit allocation table for large frame stereo
(need to make that a bit better)

--- a/libcelt/modes.c
+++ b/libcelt/modes.c
@@ -228,7 +228,7 @@
          celt_int32_t alloc;
          edge = mode->eBands[eband+1]*res;
          alloc = band_allocation[i*BARK_BANDS+j];
-         alloc = alloc*C*mode->mdctSize;
+         alloc = alloc*C*mode->mdctSize/4;
          if (edge < bark_freq[j+1])
          {
             int num, den;
@@ -246,7 +246,7 @@
    for (i=0;i<mode->nbAllocVectors;i++)
    {
       for (j=0;j<mode->nbEBands;j++)
-         allocVectors[i*mode->nbEBands+j] = (allocVectors[i*mode->nbEBands+j]+128)/256;
+         allocVectors[i*mode->nbEBands+j] = (allocVectors[i*mode->nbEBands+j]+32)/64;
    }
    /*for (i=0;i<mode->nbAllocVectors;i++)
    {