Fix for very short frame size (M=1)
This commit is contained in:
parent
073d0bc925
commit
811f21ab76
2 changed files with 8 additions and 9 deletions
|
@ -781,7 +781,13 @@ void get_required_bits(celt_int16 *_bits,int _n,int _maxk,int _frac){
|
||||||
int k;
|
int k;
|
||||||
/*_maxk==0 => there's nothing to do.*/
|
/*_maxk==0 => there's nothing to do.*/
|
||||||
celt_assert(_maxk>0);
|
celt_assert(_maxk>0);
|
||||||
if(fits_in32(_n,_maxk-1)){
|
if (_n==1)
|
||||||
|
{
|
||||||
|
_bits[0] = 0;
|
||||||
|
for (k=1;k<_maxk;k++)
|
||||||
|
_bits[k] = 1<<_frac;
|
||||||
|
}
|
||||||
|
else if(fits_in32(_n,_maxk-1)){
|
||||||
_bits[0]=0;
|
_bits[0]=0;
|
||||||
if(_maxk>1){
|
if(_maxk>1){
|
||||||
VARDECL(celt_uint32,u);
|
VARDECL(celt_uint32,u);
|
||||||
|
|
|
@ -373,11 +373,7 @@ CELTMode *celt_mode_create(celt_int32 Fs, int frame_size, int *error)
|
||||||
mode->window = window;
|
mode->window = window;
|
||||||
|
|
||||||
for (i=0;(1<<i)<=mode->nbShortMdcts;i++)
|
for (i=0;(1<<i)<=mode->nbShortMdcts;i++)
|
||||||
{
|
mode->bits[i] = (const celt_int16 **)compute_alloc_cache(mode, 1, 1<<i);
|
||||||
/* FIXME: Do something for i==0 */
|
|
||||||
if (i!=0)
|
|
||||||
mode->bits[i] = (const celt_int16 **)compute_alloc_cache(mode, 1, 1<<i);
|
|
||||||
}
|
|
||||||
if (mode->bits==NULL)
|
if (mode->bits==NULL)
|
||||||
goto failure;
|
goto failure;
|
||||||
|
|
||||||
|
@ -442,9 +438,6 @@ void celt_mode_destroy(CELTMode *mode)
|
||||||
#ifndef STATIC_MODES
|
#ifndef STATIC_MODES
|
||||||
for (m=0;(1<<m)<=mode->nbShortMdcts;m++)
|
for (m=0;(1<<m)<=mode->nbShortMdcts;m++)
|
||||||
{
|
{
|
||||||
/* FIXME: Do something for i==0 */
|
|
||||||
if (m==0)
|
|
||||||
continue;
|
|
||||||
if (mode->bits[m]!=NULL)
|
if (mode->bits[m]!=NULL)
|
||||||
{
|
{
|
||||||
for (i=0;i<mode->nbEBands;i++)
|
for (i=0;i<mode->nbEBands;i++)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue