mirror of
https://github.com/xiph/opus.git
synced 2025-06-03 00:57:43 +00:00
Enforces bands of even size even for custom modes
This commit is contained in:
parent
235c64b94d
commit
4420390799
1 changed files with 4 additions and 2 deletions
|
@ -171,14 +171,16 @@ static celt_int16 *compute_ebands(celt_int32 Fs, int frame_size, int res, int *n
|
|||
for (i=0;i<high;i++)
|
||||
{
|
||||
int target = bark_freq[lin+i];
|
||||
eBands[i+low] = (target+(offset+res)/2)/res;
|
||||
/* Round to an even value */
|
||||
eBands[i+low] = (target+offset/2+res)/(2*res)*2;
|
||||
offset = eBands[i+low]*res - target;
|
||||
}
|
||||
/* Enforce the minimum spacing at the boundary */
|
||||
for (i=0;i<*nbEBands;i++)
|
||||
if (eBands[i] < i)
|
||||
eBands[i] = i;
|
||||
eBands[*nbEBands] = (bark_freq[nBark]+res/2)/res;
|
||||
/* Round to an even value */
|
||||
eBands[*nbEBands] = (bark_freq[nBark]+res)/(2*res)*2;
|
||||
if (eBands[*nbEBands] > frame_size)
|
||||
eBands[*nbEBands] = frame_size;
|
||||
for (i=1;i<*nbEBands-1;i++)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue