Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: which size of gmdct massive in coder function mapping0_forward(vorbis_ (Read 2808 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

which size of gmdct massive in coder function mapping0_forward(vorbis_

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:
Code: [Select]
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
Code: [Select]
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:
Code: [Select]
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