Can anybody answer me which size of gmdct* massive in encoder function mapping0_forward(vorbis_block *vb) in file mapping0.c
here in the mapping0_forward function allocation memory for gmdct: gmdct=_vorbis_block_alloc(vb,n/2*sizeof(**gmdct));
here code of allocatig function:
void *_vorbis_block_alloc(vorbis_block *vb,long bytes){
bytes=(bytes+(WORD_ALIGN-1)) & ~(WORD_ALIGN-1);
if(bytes+vb->localtop>vb->localalloc){
/* can't just _ogg_realloc... there are outstanding pointers */
if(vb->localstore){
struct alloc_chain *link=_ogg_malloc(sizeof(*link));
vb->totaluse+=vb->localtop;
link->next=vb->reap;
link->ptr=vb->localstore;
vb->reap=link;
}
/* highly conservative */
vb->localalloc=bytes;
vb->localstore=_ogg_malloc(vb->localalloc);
vb->localtop=0;
}
{
void *ret=(void *)(((char *)vb->localstore)+vb->localtop);
vb->localtop+=bytes;
return ret;
}
}
After making mdct mdct_forward(b->transform[vb->W][0],pcm,gmdct[i]);
I try to print all of the result coefficients to file for analyse in cycle:
for(l=0; l<vb->localalloc; l++)
for small windows with vb->localalloc=512 it works corectly, but for big window (4096) it breaks out with exception in the 1286 iteration