[xiph-cvs] cvs commit: vorbis/vq bookutil.c build.c huffbuild.c latticebuild.c latticehint.c latticepare.c latticetune.c lspdata.c metrics.c residuedata.c residuesplit.c run.c vqgen.c vqsplit.c
Monty
xiphmont at xiph.org
Fri Nov 3 22:43:59 PST 2000
xiphmont 00/11/03 22:43:59
Modified: debian Tag: branch_beta3 README.examples
include/vorbis Tag: branch_beta3 codec.h
lib Tag: branch_beta3 block.c codebook.c envelope.c
floor0.c iir.c info.c mapping0.c mdct.c misc.c
misc.h os.h psy.c psytune.c res0.c sharedbook.c
smallft.c vorbisenc.c vorbisfile.c window.c
mac/compat Tag: branch_beta3 strdup.c
vq Tag: branch_beta3 bookutil.c build.c huffbuild.c
latticebuild.c latticehint.c latticepare.c
latticetune.c lspdata.c metrics.c residuedata.c
residuesplit.c run.c vqgen.c vqsplit.c
Log:
trade out malloc, calloc, realloc for redefinable hooks _ogg_malloc,
_ogg_calloc, _ogg_realloc.
Revision Changes Path
No revision
No revision
1.3.6.1 +1 -1 vorbis/debian/README.examples
Index: README.examples
===================================================================
RCS file: /usr/local/cvsroot/vorbis/debian/README.examples,v
retrieving revision 1.3
retrieving revision 1.3.6.1
diff -u -r1.3 -r1.3.6.1
--- README.examples 2000/08/19 09:39:13 1.3
+++ README.examples 2000/11/04 06:43:48 1.3.6.1
@@ -6,6 +6,6 @@
tree, so it will *not* work without being edited first.
The misc.h included in chaining_example and seeking_test just allows the
-use of a debugging malloc. (defined in misc.c) It is safe to comment out.
+use of a debugging _ogg_malloc. (defined in misc.c) It is safe to comment out.
-- Michael Beattie <mjb at debian.org>, Mon, 26 Jun 2000 18:59:56 +1200
No revision
No revision
1.32.2.5 +2 -2 vorbis/include/vorbis/codec.h
Index: codec.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/codec.h,v
retrieving revision 1.32.2.4
retrieving revision 1.32.2.5
diff -u -r1.32.2.4 -r1.32.2.5
--- codec.h 2000/11/04 06:21:40 1.32.2.4
+++ codec.h 2000/11/04 06:43:48 1.32.2.5
@@ -12,7 +12,7 @@
********************************************************************
function: libvorbis codec headers
- last mod: $Id: codec.h,v 1.32.2.4 2000/11/04 06:21:40 xiphmont Exp $
+ last mod: $Id: codec.h,v 1.32.2.5 2000/11/04 06:43:48 xiphmont Exp $
********************************************************************/
@@ -102,7 +102,7 @@
ogg_int64_t sequence;
vorbis_dsp_state *vd; /* For read-only access of configuration */
- /* local storage to avoid remallocing; it's up to the mapping to
+ /* local storage to avoid re_ogg_mallocing; it's up to the mapping to
structure it */
void *localstore;
long localtop;
No revision
No revision
1.39.2.5 +24 -24 vorbis/lib/block.c
Index: block.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/block.c,v
retrieving revision 1.39.2.4
retrieving revision 1.39.2.5
diff -u -r1.39.2.4 -r1.39.2.5
--- block.c 2000/11/04 06:21:42 1.39.2.4
+++ block.c 2000/11/04 06:43:49 1.39.2.5
@@ -12,7 +12,7 @@
********************************************************************
function: PCM data vector blocking, windowing and dis/reassembly
- last mod: $Id: block.c,v 1.39.2.4 2000/11/04 06:21:42 xiphmont Exp $
+ last mod: $Id: block.c,v 1.39.2.5 2000/11/04 06:43:49 xiphmont Exp $
Handle windowing, overlap-add, etc of the PCM vectors. This is made
more amusing by Vorbis' current two allowed block sizes.
@@ -105,9 +105,9 @@
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 realloc... there are outstanding pointers */
+ /* can't just _ogg_realloc... there are outstanding pointers */
if(vb->localstore){
- struct alloc_chain *link=malloc(sizeof(struct alloc_chain));
+ struct alloc_chain *link=_ogg_malloc(sizeof(struct alloc_chain));
vb->totaluse+=vb->localtop;
link->next=vb->reap;
link->ptr=vb->localstore;
@@ -115,7 +115,7 @@
}
/* highly conservative */
vb->localalloc=bytes;
- vb->localstore=malloc(vb->localalloc);
+ vb->localstore=_ogg_malloc(vb->localalloc);
vb->localtop=0;
}
{
@@ -138,7 +138,7 @@
}
/* consolidate storage */
if(vb->totaluse){
- vb->localstore=realloc(vb->localstore,vb->totaluse+vb->localalloc);
+ vb->localstore=_ogg_realloc(vb->localstore,vb->totaluse+vb->localalloc);
vb->localalloc+=vb->totaluse;
vb->totaluse=0;
}
@@ -169,29 +169,29 @@
backend_lookup_state *b=NULL;
memset(v,0,sizeof(vorbis_dsp_state));
- b=v->backend_state=calloc(1,sizeof(backend_lookup_state));
+ b=v->backend_state=_ogg_calloc(1,sizeof(backend_lookup_state));
v->vi=vi;
b->modebits=ilog2(ci->modes);
- b->transform[0]=calloc(VI_TRANSFORMB,sizeof(vorbis_look_transform *));
- b->transform[1]=calloc(VI_TRANSFORMB,sizeof(vorbis_look_transform *));
+ b->transform[0]=_ogg_calloc(VI_TRANSFORMB,sizeof(vorbis_look_transform *));
+ b->transform[1]=_ogg_calloc(VI_TRANSFORMB,sizeof(vorbis_look_transform *));
/* MDCT is tranform 0 */
- b->transform[0][0]=calloc(1,sizeof(mdct_lookup));
- b->transform[1][0]=calloc(1,sizeof(mdct_lookup));
+ b->transform[0][0]=_ogg_calloc(1,sizeof(mdct_lookup));
+ b->transform[1][0]=_ogg_calloc(1,sizeof(mdct_lookup));
mdct_init(b->transform[0][0],ci->blocksizes[0]);
mdct_init(b->transform[1][0],ci->blocksizes[1]);
- b->window[0][0][0]=calloc(VI_WINDOWB,sizeof(float *));
+ b->window[0][0][0]=_ogg_calloc(VI_WINDOWB,sizeof(float *));
b->window[0][0][1]=b->window[0][0][0];
b->window[0][1][0]=b->window[0][0][0];
b->window[0][1][1]=b->window[0][0][0];
- b->window[1][0][0]=calloc(VI_WINDOWB,sizeof(float *));
- b->window[1][0][1]=calloc(VI_WINDOWB,sizeof(float *));
- b->window[1][1][0]=calloc(VI_WINDOWB,sizeof(float *));
- b->window[1][1][1]=calloc(VI_WINDOWB,sizeof(float *));
+ b->window[1][0][0]=_ogg_calloc(VI_WINDOWB,sizeof(float *));
+ b->window[1][0][1]=_ogg_calloc(VI_WINDOWB,sizeof(float *));
+ b->window[1][1][0]=_ogg_calloc(VI_WINDOWB,sizeof(float *));
+ b->window[1][1][1]=_ogg_calloc(VI_WINDOWB,sizeof(float *));
for(i=0;i<VI_WINDOWB;i++){
b->window[0][0][0][i]=
@@ -208,13 +208,13 @@
if(encp){ /* encode/decode differ here */
/* finish the codebooks */
- b->fullbooks=calloc(ci->books,sizeof(codebook));
+ b->fullbooks=_ogg_calloc(ci->books,sizeof(codebook));
for(i=0;i<ci->books;i++)
vorbis_book_init_encode(b->fullbooks+i,ci->book_param[i]);
v->analysisp=1;
}else{
/* finish the codebooks */
- b->fullbooks=calloc(ci->books,sizeof(codebook));
+ b->fullbooks=_ogg_calloc(ci->books,sizeof(codebook));
for(i=0;i<ci->books;i++)
vorbis_book_init_decode(b->fullbooks+i,ci->book_param[i]);
}
@@ -225,12 +225,12 @@
v->pcm_storage=8192; /* we'll assume later that we have
a minimum of twice the blocksize of
accumulated samples in analysis */
- v->pcm=malloc(vi->channels*sizeof(float *));
- v->pcmret=malloc(vi->channels*sizeof(float *));
+ v->pcm=_ogg_malloc(vi->channels*sizeof(float *));
+ v->pcmret=_ogg_malloc(vi->channels*sizeof(float *));
{
int i;
for(i=0;i<vi->channels;i++)
- v->pcm[i]=calloc(v->pcm_storage,sizeof(float));
+ v->pcm[i]=_ogg_calloc(v->pcm_storage,sizeof(float));
}
/* all 1 (large block) or 0 (small block) */
@@ -244,7 +244,7 @@
v->pcm_current=v->centerW;
/* initialize all the mapping/backend lookups */
- b->mode=calloc(ci->modes,sizeof(vorbis_look_mapping *));
+ b->mode=_ogg_calloc(ci->modes,sizeof(vorbis_look_mapping *));
for(i=0;i<ci->modes;i++){
int mapnum=ci->mode_param[i]->mapping;
int maptype=ci->map_type[mapnum];
@@ -263,7 +263,7 @@
b=v->backend_state;
/* Initialize the envelope state storage */
- b->ve=calloc(1,sizeof(envelope_lookup));
+ b->ve=_ogg_calloc(1,sizeof(envelope_lookup));
_ve_envelope_init(b->ve,vi);
return(0);
@@ -359,7 +359,7 @@
v->pcm_storage=v->pcm_current+vals*2;
for(i=0;i<vi->channels;i++){
- v->pcm[i]=realloc(v->pcm[i],v->pcm_storage*sizeof(float));
+ v->pcm[i]=_ogg_realloc(v->pcm[i],v->pcm_storage*sizeof(float));
}
}
@@ -663,7 +663,7 @@
v->pcm_storage=endW+ci->blocksizes[1];
for(i=0;i<vi->channels;i++)
- v->pcm[i]=realloc(v->pcm[i],v->pcm_storage*sizeof(float));
+ v->pcm[i]=_ogg_realloc(v->pcm[i],v->pcm_storage*sizeof(float));
}
/* overlap/add PCM */
1.18.2.4 +4 -4 vorbis/lib/codebook.c
Index: codebook.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/codebook.c,v
retrieving revision 1.18.2.3
retrieving revision 1.18.2.4
diff -u -r1.18.2.3 -r1.18.2.4
--- codebook.c 2000/11/04 06:21:42 1.18.2.3
+++ codebook.c 2000/11/04 06:43:49 1.18.2.4
@@ -12,7 +12,7 @@
********************************************************************
function: basic codebook pack/unpack/code/decode operations
- last mod: $Id: codebook.c,v 1.18.2.3 2000/11/04 06:21:42 xiphmont Exp $
+ last mod: $Id: codebook.c,v 1.18.2.4 2000/11/04 06:43:49 xiphmont Exp $
********************************************************************/
@@ -162,7 +162,7 @@
switch(oggpack_read(opb,1)){
case 0:
/* unordered */
- s->lengthlist=malloc(sizeof(long)*s->entries);
+ s->lengthlist=_ogg_malloc(sizeof(long)*s->entries);
/* allocated but unused entries? */
if(oggpack_read(opb,1)){
@@ -190,7 +190,7 @@
/* ordered */
{
long length=oggpack_read(opb,5)+1;
- s->lengthlist=malloc(sizeof(long)*s->entries);
+ s->lengthlist=_ogg_malloc(sizeof(long)*s->entries);
for(i=0;i<s->entries;){
long num=oggpack_read(opb,_ilog(s->entries-i));
@@ -232,7 +232,7 @@
}
/* quantized values */
- s->quantlist=malloc(sizeof(float)*quantvals);
+ s->quantlist=_ogg_malloc(sizeof(float)*quantvals);
for(i=0;i<quantvals;i++)
s->quantlist[i]=oggpack_read(opb,s->q_quant);
1.23.2.3 +6 -6 vorbis/lib/envelope.c
Index: envelope.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/envelope.c,v
retrieving revision 1.23.2.2
retrieving revision 1.23.2.3
diff -u -r1.23.2.2 -r1.23.2.3
--- envelope.c 2000/11/04 06:21:43 1.23.2.2
+++ envelope.c 2000/11/04 06:43:49 1.23.2.3
@@ -12,7 +12,7 @@
********************************************************************
function: PCM data envelope analysis and manipulation
- last mod: $Id: envelope.c,v 1.23.2.2 2000/11/04 06:21:43 xiphmont Exp $
+ last mod: $Id: envelope.c,v 1.23.2.3 2000/11/04 06:43:49 xiphmont Exp $
Preecho calculation.
@@ -79,18 +79,18 @@
int i;
e->winlength=window;
e->minenergy=fromdB(ci->preecho_minenergy);
- e->iir=calloc(ch,sizeof(IIR_state));
- e->filtered=calloc(ch,sizeof(float *));
+ e->iir=_ogg_calloc(ch,sizeof(IIR_state));
+ e->filtered=_ogg_calloc(ch,sizeof(float *));
e->ch=ch;
e->storage=128;
for(i=0;i<ch;i++){
IIR_init(e->iir+i,cheb_highpass_stages,cheb_highpass_gain,
cheb_highpass_A,cheb_highpass_B);
- e->filtered[i]=calloc(e->storage,sizeof(float));
+ e->filtered[i]=_ogg_calloc(e->storage,sizeof(float));
}
drft_init(&e->drft,window);
- e->window=malloc(e->winlength*sizeof(float));
+ e->window=_ogg_malloc(e->winlength*sizeof(float));
/* We just use a straight sin(x) window for this */
for(i=0;i<e->winlength;i++)
e->window[i]=sin((i+.5)/e->winlength*M_PI);
@@ -166,7 +166,7 @@
if(v->pcm_storage>ve->storage){
ve->storage=v->pcm_storage;
for(i=0;i<ve->ch;i++)
- ve->filtered[i]=realloc(ve->filtered[i],ve->storage*sizeof(float));
+ ve->filtered[i]=_ogg_realloc(ve->filtered[i],ve->storage*sizeof(float));
}
/* catch up the highpass to match the pcm */
1.25.2.3 +6 -6 vorbis/lib/floor0.c
Index: floor0.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/floor0.c,v
retrieving revision 1.25.2.2
retrieving revision 1.25.2.3
diff -u -r1.25.2.2 -r1.25.2.3
--- floor0.c 2000/11/04 06:21:44 1.25.2.2
+++ floor0.c 2000/11/04 06:43:49 1.25.2.3
@@ -12,7 +12,7 @@
********************************************************************
function: floor backend 0 implementation
- last mod: $Id: floor0.c,v 1.25.2.2 2000/11/04 06:21:44 xiphmont Exp $
+ last mod: $Id: floor0.c,v 1.25.2.3 2000/11/04 06:43:49 xiphmont Exp $
********************************************************************/
@@ -72,7 +72,7 @@
static vorbis_info_floor *floor0_copy_info (vorbis_info_floor *i){
vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
- vorbis_info_floor0 *ret=malloc(sizeof(vorbis_info_floor0));
+ vorbis_info_floor0 *ret=_ogg_malloc(sizeof(vorbis_info_floor0));
memcpy(ret,info,sizeof(vorbis_info_floor0));
return(ret);
}
@@ -112,7 +112,7 @@
codec_setup_info *ci=vi->codec_setup;
int j;
- vorbis_info_floor0 *info=malloc(sizeof(vorbis_info_floor0));
+ vorbis_info_floor0 *info=_ogg_malloc(sizeof(vorbis_info_floor0));
info->order=oggpack_read(opb,8);
info->rate=oggpack_read(opb,16);
info->barkmap=oggpack_read(opb,16);
@@ -151,7 +151,7 @@
vorbis_info *vi=vd->vi;
codec_setup_info *ci=vi->codec_setup;
vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
- vorbis_look_floor0 *look=calloc(1,sizeof(vorbis_look_floor0));
+ vorbis_look_floor0 *look=_ogg_calloc(1,sizeof(vorbis_look_floor0));
look->m=info->order;
look->n=ci->blocksizes[mi->blockflag]/2;
look->ln=info->barkmap;
@@ -171,7 +171,7 @@
the encoder may do what it wishes in filling them. They're
necessary in some mapping combinations to keep the scale spacing
accurate */
- look->linearmap=malloc((look->n+1)*sizeof(int));
+ look->linearmap=_ogg_malloc((look->n+1)*sizeof(int));
for(j=0;j<look->n;j++){
int val=floor( toBARK((info->rate/2.)/look->n*j)
*scale); /* bark numbers represent band edges */
@@ -180,7 +180,7 @@
}
look->linearmap[j]=-1;
- look->lsp_look=malloc(look->ln*sizeof(float));
+ look->lsp_look=_ogg_malloc(look->ln*sizeof(float));
for(j=0;j<look->ln;j++)
look->lsp_look[j]=2*cos(M_PI/look->ln*j);
1.2.2.2 +7 -6 vorbis/lib/iir.c
Index: iir.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/iir.c,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -r1.2.2.1 -r1.2.2.2
--- iir.c 2000/11/04 06:21:44 1.2.2.1
+++ iir.c 2000/11/04 06:43:50 1.2.2.2
@@ -12,13 +12,14 @@
********************************************************************
function: Direct Form I, II IIR filters, plus some specializations
- last mod: $Id: iir.c,v 1.2.2.1 2000/11/04 06:21:44 xiphmont Exp $
+ last mod: $Id: iir.c,v 1.2.2.2 2000/11/04 06:43:50 xiphmont Exp $
********************************************************************/
/* LPC is actually a degenerate case of form I/II filters, but we need
both */
+#include <ogg/ogg.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
@@ -28,10 +29,10 @@
memset(s,0,sizeof(IIR_state));
s->stages=stages;
s->gain=gain;
- s->coeff_A=malloc(stages*sizeof(float));
- s->coeff_B=malloc((stages+1)*sizeof(float));
- s->z_A=calloc(stages*2,sizeof(float));
- s->z_B=calloc(stages*2,sizeof(float));
+ s->coeff_A=_ogg_malloc(stages*sizeof(float));
+ s->coeff_B=_ogg_malloc((stages+1)*sizeof(float));
+ s->z_A=_ogg_calloc(stages*2,sizeof(float));
+ s->z_B=_ogg_calloc(stages*2,sizeof(float));
memcpy(s->coeff_A,A,stages*sizeof(float));
memcpy(s->coeff_B,B,(stages+1)*sizeof(float));
@@ -267,7 +268,7 @@
/* run the pregenerated Chebyshev filter, then our own distillation
through the generic and specialized code */
- float *work=malloc(128*sizeof(float));
+ float *work=_ogg_malloc(128*sizeof(float));
IIR_state iir;
int i;
1.31.2.5 +23 -23 vorbis/lib/info.c
Index: info.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/info.c,v
retrieving revision 1.31.2.4
retrieving revision 1.31.2.5
diff -u -r1.31.2.4 -r1.31.2.5
--- info.c 2000/11/04 06:21:44 1.31.2.4
+++ info.c 2000/11/04 06:43:50 1.31.2.5
@@ -12,7 +12,7 @@
********************************************************************
function: maintain the info structure, info <-> header packets
- last mod: $Id: info.c,v 1.31.2.4 2000/11/04 06:21:44 xiphmont Exp $
+ last mod: $Id: info.c,v 1.31.2.5 2000/11/04 06:43:50 xiphmont Exp $
********************************************************************/
@@ -60,9 +60,9 @@
}
void vorbis_comment_add(vorbis_comment *vc,char *comment){
- vc->user_comments=realloc(vc->user_comments,
+ vc->user_comments=_ogg_realloc(vc->user_comments,
(vc->comments+2)*sizeof(char *));
- vc->comment_lengths=realloc(vc->comment_lengths,
+ vc->comment_lengths=_ogg_realloc(vc->comment_lengths,
(vc->comments+2)*sizeof(int));
vc->user_comments[vc->comments]=strdup(comment);
vc->comment_lengths[vc->comments]=strlen(comment);
@@ -141,7 +141,7 @@
/* used by synthesis, which has a full, alloced vi */
void vorbis_info_init(vorbis_info *vi){
memset(vi,0,sizeof(vorbis_info));
- vi->codec_setup=calloc(1,sizeof(codec_setup_info));
+ vi->codec_setup=_ogg_calloc(1,sizeof(codec_setup_info));
}
void vorbis_info_clear(vorbis_info *vi){
@@ -217,18 +217,18 @@
int i;
int vendorlen=oggpack_read(opb,32);
if(vendorlen<0)goto err_out;
- vc->vendor=calloc(vendorlen+1,1);
+ vc->vendor=_ogg_calloc(vendorlen+1,1);
_v_readstring(opb,vc->vendor,vendorlen);
vc->comments=oggpack_read(opb,32);
if(vc->comments<0)goto err_out;
- vc->user_comments=calloc(vc->comments+1,sizeof(char **));
- vc->comment_lengths=calloc(vc->comments+1, sizeof(int));
+ vc->user_comments=_ogg_calloc(vc->comments+1,sizeof(char **));
+ vc->comment_lengths=_ogg_calloc(vc->comments+1, sizeof(int));
for(i=0;i<vc->comments;i++){
int len=oggpack_read(opb,32);
if(len<0)goto err_out;
vc->comment_lengths[i]=len;
- vc->user_comments[i]=calloc(len+1,1);
+ vc->user_comments[i]=_ogg_calloc(len+1,1);
_v_readstring(opb,vc->user_comments[i],len);
}
if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
@@ -248,16 +248,16 @@
/* codebooks */
ci->books=oggpack_read(opb,8)+1;
- /*ci->book_param=calloc(ci->books,sizeof(static_codebook *));*/
+ /*ci->book_param=_ogg_calloc(ci->books,sizeof(static_codebook *));*/
for(i=0;i<ci->books;i++){
- ci->book_param[i]=calloc(1,sizeof(static_codebook));
+ ci->book_param[i]=_ogg_calloc(1,sizeof(static_codebook));
if(vorbis_staticbook_unpack(opb,ci->book_param[i]))goto err_out;
}
/* time backend settings */
ci->times=oggpack_read(opb,6)+1;
- /*ci->time_type=malloc(ci->times*sizeof(int));*/
- /*ci->time_param=calloc(ci->times,sizeof(void *));*/
+ /*ci->time_type=_ogg_malloc(ci->times*sizeof(int));*/
+ /*ci->time_param=_ogg_calloc(ci->times,sizeof(void *));*/
for(i=0;i<ci->times;i++){
ci->time_type[i]=oggpack_read(opb,16);
if(ci->time_type[i]<0 || ci->time_type[i]>=VI_TIMEB)goto err_out;
@@ -267,8 +267,8 @@
/* floor backend settings */
ci->floors=oggpack_read(opb,6)+1;
- /*ci->floor_type=malloc(ci->floors*sizeof(int));*/
- /*ci->floor_param=calloc(ci->floors,sizeof(void *));*/
+ /*ci->floor_type=_ogg_malloc(ci->floors*sizeof(int));*/
+ /*ci->floor_param=_ogg_calloc(ci->floors,sizeof(void *));*/
for(i=0;i<ci->floors;i++){
ci->floor_type[i]=oggpack_read(opb,16);
if(ci->floor_type[i]<0 || ci->floor_type[i]>=VI_FLOORB)goto err_out;
@@ -278,8 +278,8 @@
/* residue backend settings */
ci->residues=oggpack_read(opb,6)+1;
- /*ci->residue_type=malloc(ci->residues*sizeof(int));*/
- /*ci->residue_param=calloc(ci->residues,sizeof(void *));*/
+ /*ci->residue_type=_ogg_malloc(ci->residues*sizeof(int));*/
+ /*ci->residue_param=_ogg_calloc(ci->residues,sizeof(void *));*/
for(i=0;i<ci->residues;i++){
ci->residue_type[i]=oggpack_read(opb,16);
if(ci->residue_type[i]<0 || ci->residue_type[i]>=VI_RESB)goto err_out;
@@ -289,8 +289,8 @@
/* map backend settings */
ci->maps=oggpack_read(opb,6)+1;
- /*ci->map_type=malloc(ci->maps*sizeof(int));*/
- /*ci->map_param=calloc(ci->maps,sizeof(void *));*/
+ /*ci->map_type=_ogg_malloc(ci->maps*sizeof(int));*/
+ /*ci->map_param=_ogg_calloc(ci->maps,sizeof(void *));*/
for(i=0;i<ci->maps;i++){
ci->map_type[i]=oggpack_read(opb,16);
if(ci->map_type[i]<0 || ci->map_type[i]>=VI_MAPB)goto err_out;
@@ -300,9 +300,9 @@
/* mode settings */
ci->modes=oggpack_read(opb,6)+1;
- /*vi->mode_param=calloc(vi->modes,sizeof(void *));*/
+ /*vi->mode_param=_ogg_calloc(vi->modes,sizeof(void *));*/
for(i=0;i<ci->modes;i++){
- ci->mode_param[i]=calloc(1,sizeof(vorbis_info_mode));
+ ci->mode_param[i]=_ogg_calloc(1,sizeof(vorbis_info_mode));
ci->mode_param[i]->blockflag=oggpack_read(opb,1);
ci->mode_param[i]->windowtype=oggpack_read(opb,16);
ci->mode_param[i]->transformtype=oggpack_read(opb,16);
@@ -516,7 +516,7 @@
/* build the packet */
if(b->header)free(b->header);
- b->header=malloc(oggpack_bytes(&opb));
+ b->header=_ogg_malloc(oggpack_bytes(&opb));
memcpy(b->header,opb.buffer,oggpack_bytes(&opb));
op->packet=b->header;
op->bytes=oggpack_bytes(&opb);
@@ -530,7 +530,7 @@
if(_vorbis_pack_comment(&opb,vc))goto err_out;
if(b->header1)free(b->header1);
- b->header1=malloc(oggpack_bytes(&opb));
+ b->header1=_ogg_malloc(oggpack_bytes(&opb));
memcpy(b->header1,opb.buffer,oggpack_bytes(&opb));
op_comm->packet=b->header1;
op_comm->bytes=oggpack_bytes(&opb);
@@ -544,7 +544,7 @@
if(_vorbis_pack_books(&opb,vi))goto err_out;
if(b->header2)free(b->header2);
- b->header2=malloc(oggpack_bytes(&opb));
+ b->header2=_ogg_malloc(oggpack_bytes(&opb));
memcpy(b->header2,opb.buffer,oggpack_bytes(&opb));
op_code->packet=b->header2;
op_code->bytes=oggpack_bytes(&opb);
1.16.2.3 +13 -13 vorbis/lib/mapping0.c
Index: mapping0.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/mapping0.c,v
retrieving revision 1.16.2.2
retrieving revision 1.16.2.3
diff -u -r1.16.2.2 -r1.16.2.3
--- mapping0.c 2000/11/04 06:21:44 1.16.2.2
+++ mapping0.c 2000/11/04 06:43:50 1.16.2.3
@@ -12,7 +12,7 @@
********************************************************************
function: channel mapping 0 implementation
- last mod: $Id: mapping0.c,v 1.16.2.2 2000/11/04 06:21:44 xiphmont Exp $
+ last mod: $Id: mapping0.c,v 1.16.2.3 2000/11/04 06:43:50 xiphmont Exp $
********************************************************************/
@@ -58,7 +58,7 @@
static vorbis_info_mapping *mapping0_copy_info(vorbis_info_mapping *vm){
vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)vm;
- vorbis_info_mapping0 *ret=malloc(sizeof(vorbis_info_mapping0));
+ vorbis_info_mapping0 *ret=_ogg_malloc(sizeof(vorbis_info_mapping0));
memcpy(ret,info,sizeof(vorbis_info_mapping0));
return(ret);
}
@@ -105,19 +105,19 @@
int i;
vorbis_info *vi=vd->vi;
codec_setup_info *ci=vi->codec_setup;
- vorbis_look_mapping0 *look=calloc(1,sizeof(vorbis_look_mapping0));
+ vorbis_look_mapping0 *look=_ogg_calloc(1,sizeof(vorbis_look_mapping0));
vorbis_info_mapping0 *info=look->map=(vorbis_info_mapping0 *)m;
look->mode=vm;
- look->time_look=calloc(info->submaps,sizeof(vorbis_look_time *));
- look->floor_look=calloc(info->submaps,sizeof(vorbis_look_floor *));
+ look->time_look=_ogg_calloc(info->submaps,sizeof(vorbis_look_time *));
+ look->floor_look=_ogg_calloc(info->submaps,sizeof(vorbis_look_floor *));
- look->residue_look=calloc(info->submaps,sizeof(vorbis_look_residue *));
- if(ci->psys)look->psy_look=calloc(info->submaps,sizeof(vorbis_look_psy));
+ look->residue_look=_ogg_calloc(info->submaps,sizeof(vorbis_look_residue *));
+ if(ci->psys)look->psy_look=_ogg_calloc(info->submaps,sizeof(vorbis_look_psy));
- look->time_func=calloc(info->submaps,sizeof(vorbis_func_time *));
- look->floor_func=calloc(info->submaps,sizeof(vorbis_func_floor *));
- look->residue_func=calloc(info->submaps,sizeof(vorbis_func_residue *));
+ look->time_func=_ogg_calloc(info->submaps,sizeof(vorbis_func_time *));
+ look->floor_func=_ogg_calloc(info->submaps,sizeof(vorbis_func_floor *));
+ look->residue_func=_ogg_calloc(info->submaps,sizeof(vorbis_func_residue *));
for(i=0;i<info->submaps;i++){
int timenum=info->timesubmap[i];
@@ -143,9 +143,9 @@
look->ch=vi->channels;
if(ci->psys){
- look->decay=calloc(vi->channels,sizeof(float *));
+ look->decay=_ogg_calloc(vi->channels,sizeof(float *));
for(i=0;i<vi->channels;i++)
- look->decay[i]=calloc(ci->blocksizes[vm->blockflag]/2,sizeof(float));
+ look->decay[i]=_ogg_calloc(ci->blocksizes[vm->blockflag]/2,sizeof(float));
}
return(look);
@@ -171,7 +171,7 @@
/* also responsible for range checking */
static vorbis_info_mapping *mapping0_unpack(vorbis_info *vi,oggpack_buffer *opb){
int i;
- vorbis_info_mapping0 *info=calloc(1,sizeof(vorbis_info_mapping0));
+ vorbis_info_mapping0 *info=_ogg_calloc(1,sizeof(vorbis_info_mapping0));
codec_setup_info *ci=vi->codec_setup;
memset(info,0,sizeof(vorbis_info_mapping0));
1.17.2.5 +3 -3 vorbis/lib/mdct.c
Index: mdct.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/mdct.c,v
retrieving revision 1.17.2.4
retrieving revision 1.17.2.5
diff -u -r1.17.2.4 -r1.17.2.5
--- mdct.c 2000/11/04 06:21:45 1.17.2.4
+++ mdct.c 2000/11/04 06:43:50 1.17.2.5
@@ -13,7 +13,7 @@
function: normalized modified discrete cosine transform
power of two length transform only [16 <= n ]
- last mod: $Id: mdct.c,v 1.17.2.4 2000/11/04 06:21:45 xiphmont Exp $
+ last mod: $Id: mdct.c,v 1.17.2.5 2000/11/04 06:43:50 xiphmont Exp $
Algorithm adapted from _The use of multirate filter banks for coding
of high quality digital audio_, by T. Sporer, K. Brandenburg and
@@ -45,8 +45,8 @@
some window function algebra. */
void mdct_init(mdct_lookup *lookup,int n){
- int *bitrev=malloc(sizeof(int)*(n/4));
- float *trig=malloc(sizeof(float)*(n+n/4));
+ int *bitrev=_ogg_malloc(sizeof(int)*(n/4));
+ float *trig=_ogg_malloc(sizeof(float)*(n+n/4));
float *AE=trig;
float *AO=trig+1;
float *BE=AE+n/2;
1.1.14.2 +7 -7 vorbis/lib/misc.c
Index: misc.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/misc.c,v
retrieving revision 1.1.14.1
retrieving revision 1.1.14.2
diff -u -r1.1.14.1 -r1.1.14.2
--- misc.c 2000/11/04 06:21:45 1.1.14.1
+++ misc.c 2000/11/04 06:43:50 1.1.14.2
@@ -42,11 +42,11 @@
if(pinsert>=palloced){
palloced+=64;
if(pointers){
- pointers=(void **)realloc(pointers,sizeof(void **)*palloced);
- insertlist=(long *)realloc(insertlist,sizeof(long *)*palloced);
+ pointers=(void **)_ogg_realloc(pointers,sizeof(void **)*palloced);
+ insertlist=(long *)_ogg_realloc(insertlist,sizeof(long *)*palloced);
}else{
- pointers=(void **)malloc(sizeof(void **)*palloced);
- insertlist=(long *)malloc(sizeof(long *)*palloced);
+ pointers=(void **)_ogg_malloc(sizeof(void **)*palloced);
+ insertlist=(long *)_ogg_malloc(sizeof(long *)*palloced);
}
}
@@ -84,14 +84,14 @@
pthread_mutex_unlock(&memlock);
}
-extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line){
+extern void *_VDBG__ogg_malloc(void *ptr,long bytes,char *file,long line){
bytes+=HEAD_ALIGN;
if(ptr){
ptr-=HEAD_ALIGN;
_ripremove(ptr);
- ptr=realloc(ptr,bytes);
+ ptr=_ogg_realloc(ptr,bytes);
}else{
- ptr=malloc(bytes);
+ ptr=_ogg_malloc(bytes);
memset(ptr,0,bytes);
}
return _insert(ptr,file,line);
1.5.2.2 +8 -8 vorbis/lib/misc.h
Index: misc.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/misc.h,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -u -r1.5.2.1 -r1.5.2.2
--- misc.h 2000/11/04 06:21:45 1.5.2.1
+++ misc.h 2000/11/04 06:43:50 1.5.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: miscellaneous prototypes
- last mod: $Id: misc.h,v 1.5.2.1 2000/11/04 06:21:45 xiphmont Exp $
+ last mod: $Id: misc.h,v 1.5.2.2 2000/11/04 06:43:50 xiphmont Exp $
********************************************************************/
@@ -25,18 +25,18 @@
extern void _analysis_output(char *base,int i,float *v,int n,int bark,int dB);
#ifdef DEBUG_LEAKS
-extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line);
+extern void *_VDBG__ogg_malloc(void *ptr,long bytes,char *file,long line);
extern void _VDBG_free(void *ptr,char *file,long line);
#ifndef MISC_C
-#undef malloc
-#undef calloc
-#undef realloc
+#undef _ogg_malloc
+#undef _ogg_calloc
+#undef _ogg_realloc
#undef free
-#define malloc(x) _VDBG_malloc(NULL,(x),__FILE__,__LINE__)
-#define calloc(x,y) _VDBG_malloc(NULL,(x)*(y),__FILE__,__LINE__)
-#define realloc(x,y) _VDBG_malloc((x),(y),__FILE__,__LINE__)
+#define _ogg_malloc(x) _VDBG__ogg_malloc(NULL,(x),__FILE__,__LINE__)
+#define _ogg_calloc(x,y) _VDBG__ogg_malloc(NULL,(x)*(y),__FILE__,__LINE__)
+#define _ogg_realloc(x,y) _VDBG__ogg_malloc((x),(y),__FILE__,__LINE__)
#define free(x) _VDBG_free((x),__FILE__,__LINE__)
#endif
#endif
1.10.2.4 +2 -2 vorbis/lib/os.h
Index: os.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/os.h,v
retrieving revision 1.10.2.3
retrieving revision 1.10.2.4
diff -u -r1.10.2.3 -r1.10.2.4
--- os.h 2000/11/04 06:21:45 1.10.2.3
+++ os.h 2000/11/04 06:43:50 1.10.2.4
@@ -14,7 +14,7 @@
********************************************************************
function: #ifdef jail to whip a few platforms into the UNIX ideal.
- last mod: $Id: os.h,v 1.10.2.3 2000/11/04 06:21:45 xiphmont Exp $
+ last mod: $Id: os.h,v 1.10.2.4 2000/11/04 06:43:50 xiphmont Exp $
********************************************************************/
@@ -30,7 +30,7 @@
#ifndef __GNUC__
#ifdef _WIN32
-# include <malloc.h>
+# include <_ogg_malloc.h>
# define rint(x) (floor((x)+0.5))
#endif
#endif
1.29.2.3 +12 -12 vorbis/lib/psy.c
Index: psy.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/psy.c,v
retrieving revision 1.29.2.2
retrieving revision 1.29.2.3
diff -u -r1.29.2.2 -r1.29.2.3
--- psy.c 2000/11/04 06:21:45 1.29.2.2
+++ psy.c 2000/11/04 06:43:50 1.29.2.3
@@ -12,7 +12,7 @@
********************************************************************
function: psychoacoustics not including preecho
- last mod: $Id: psy.c,v 1.29.2.2 2000/11/04 06:21:45 xiphmont Exp $
+ last mod: $Id: psy.c,v 1.29.2.3 2000/11/04 06:43:50 xiphmont Exp $
********************************************************************/
@@ -42,7 +42,7 @@
}
vorbis_info_psy *_vi_psy_copy(vorbis_info_psy *i){
- vorbis_info_psy *ret=malloc(sizeof(vorbis_info_psy));
+ vorbis_info_psy *ret=_ogg_malloc(sizeof(vorbis_info_psy));
memcpy(ret,i,sizeof(vorbis_info_psy));
return(ret);
}
@@ -178,9 +178,9 @@
void _vp_psy_init(vorbis_look_psy *p,vorbis_info_psy *vi,int n,long rate){
long i,j;
memset(p,0,sizeof(vorbis_look_psy));
- p->ath=malloc(n*sizeof(float));
- p->octave=malloc(n*sizeof(int));
- p->bark=malloc(n*sizeof(float));
+ p->ath=_ogg_malloc(n*sizeof(float));
+ p->octave=_ogg_malloc(n*sizeof(int));
+ p->bark=_ogg_malloc(n*sizeof(float));
p->vi=vi;
p->n=n;
@@ -199,18 +199,18 @@
p->octave[i]=oc;
}
- p->tonecurves=malloc(P_BANDS*sizeof(float **));
- p->noiseatt=malloc(P_BANDS*sizeof(float **));
- p->peakatt=malloc(P_BANDS*sizeof(float *));
+ p->tonecurves=_ogg_malloc(P_BANDS*sizeof(float **));
+ p->noiseatt=_ogg_malloc(P_BANDS*sizeof(float **));
+ p->peakatt=_ogg_malloc(P_BANDS*sizeof(float *));
for(i=0;i<P_BANDS;i++){
- p->tonecurves[i]=malloc(P_LEVELS*sizeof(float *));
- p->noiseatt[i]=malloc(P_LEVELS*sizeof(float));
- p->peakatt[i]=malloc(P_LEVELS*sizeof(float));
+ p->tonecurves[i]=_ogg_malloc(P_LEVELS*sizeof(float *));
+ p->noiseatt[i]=_ogg_malloc(P_LEVELS*sizeof(float));
+ p->peakatt[i]=_ogg_malloc(P_LEVELS*sizeof(float));
}
for(i=0;i<P_BANDS;i++)
for(j=0;j<P_LEVELS;j++){
- p->tonecurves[i][j]=malloc(EHMER_MAX*sizeof(float));
+ p->tonecurves[i][j]=_ogg_malloc(EHMER_MAX*sizeof(float));
}
/* OK, yeah, this was a silly way to do it */
1.7.2.2 +11 -11 vorbis/lib/psytune.c
Index: psytune.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/psytune.c,v
retrieving revision 1.7.2.1
retrieving revision 1.7.2.2
diff -u -r1.7.2.1 -r1.7.2.2
--- psytune.c 2000/11/04 06:21:45 1.7.2.1
+++ psytune.c 2000/11/04 06:43:50 1.7.2.2
@@ -13,7 +13,7 @@
function: simple utility that runs audio through the psychoacoustics
without encoding
- last mod: $Id: psytune.c,v 1.7.2.1 2000/11/04 06:21:45 xiphmont Exp $
+ last mod: $Id: psytune.c,v 1.7.2.2 2000/11/04 06:43:50 xiphmont Exp $
********************************************************************/
@@ -163,7 +163,7 @@
scale=look->ln/toBARK(22050.);
- look->linearmap=malloc(look->n*sizeof(int));
+ look->linearmap=_ogg_malloc(look->n*sizeof(int));
for(j=0;j<look->n;j++){
int val=floor( toBARK(22050./n*j) *scale);
if(val>look->ln)val=look->ln;
@@ -230,15 +230,15 @@
argv++;
}
- pcm[0]=malloc(framesize*sizeof(float));
- pcm[1]=malloc(framesize*sizeof(float));
- out[0]=calloc(framesize/2,sizeof(float));
- out[1]=calloc(framesize/2,sizeof(float));
- decay[0]=calloc(framesize/2,sizeof(float));
- decay[1]=calloc(framesize/2,sizeof(float));
- floor=malloc(framesize*sizeof(float));
- lpc=malloc(order*sizeof(float));
- buffer=malloc(framesize*4);
+ pcm[0]=_ogg_malloc(framesize*sizeof(float));
+ pcm[1]=_ogg_malloc(framesize*sizeof(float));
+ out[0]=_ogg_calloc(framesize/2,sizeof(float));
+ out[1]=_ogg_calloc(framesize/2,sizeof(float));
+ decay[0]=_ogg_calloc(framesize/2,sizeof(float));
+ decay[1]=_ogg_calloc(framesize/2,sizeof(float));
+ floor=_ogg_malloc(framesize*sizeof(float));
+ lpc=_ogg_malloc(order*sizeof(float));
+ buffer=_ogg_malloc(framesize*4);
buffer2=buffer+framesize*2;
window=_vorbis_window(0,framesize,framesize/2,framesize/2);
mdct_init(&m_look,framesize);
1.18.2.3 +8 -8 vorbis/lib/res0.c
Index: res0.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/res0.c,v
retrieving revision 1.18.2.2
retrieving revision 1.18.2.3
diff -u -r1.18.2.2 -r1.18.2.3
--- res0.c 2000/11/04 06:21:45 1.18.2.2
+++ res0.c 2000/11/04 06:43:50 1.18.2.3
@@ -12,7 +12,7 @@
********************************************************************
function: residue backend 0 implementation
- last mod: $Id: res0.c,v 1.18.2.2 2000/11/04 06:21:45 xiphmont Exp $
+ last mod: $Id: res0.c,v 1.18.2.3 2000/11/04 06:43:50 xiphmont Exp $
********************************************************************/
@@ -47,7 +47,7 @@
vorbis_info_residue *res0_copy_info(vorbis_info_residue *vr){
vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
- vorbis_info_residue0 *ret=malloc(sizeof(vorbis_info_residue0));
+ vorbis_info_residue0 *ret=_ogg_malloc(sizeof(vorbis_info_residue0));
memcpy(ret,info,sizeof(vorbis_info_residue0));
return(ret);
}
@@ -96,7 +96,7 @@
/* vorbis_info is for range checking */
vorbis_info_residue *res0_unpack(vorbis_info *vi,oggpack_buffer *opb){
int j,acc=0;
- vorbis_info_residue0 *info=calloc(1,sizeof(vorbis_info_residue0));
+ vorbis_info_residue0 *info=_ogg_calloc(1,sizeof(vorbis_info_residue0));
codec_setup_info *ci=vi->codec_setup;
info->begin=oggpack_read(opb,24);
@@ -127,7 +127,7 @@
vorbis_look_residue *res0_look (vorbis_dsp_state *vd,vorbis_info_mode *vm,
vorbis_info_residue *vr){
vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
- vorbis_look_residue0 *look=calloc(1,sizeof(vorbis_look_residue0));
+ vorbis_look_residue0 *look=_ogg_calloc(1,sizeof(vorbis_look_residue0));
backend_lookup_state *be=vd->backend_state;
int j,k,acc=0;
@@ -139,23 +139,23 @@
look->phrasebook=be->fullbooks+info->groupbook;
dim=look->phrasebook->dim;
- look->partbooks=calloc(look->parts,sizeof(codebook **));
+ look->partbooks=_ogg_calloc(look->parts,sizeof(codebook **));
for(j=0;j<look->parts;j++){
int stages=info->secondstages[j];
if(stages){
- look->partbooks[j]=malloc(stages*sizeof(codebook *));
+ look->partbooks[j]=_ogg_malloc(stages*sizeof(codebook *));
for(k=0;k<stages;k++)
look->partbooks[j][k]=be->fullbooks+info->booklist[acc++];
}
}
look->partvals=rint(pow(look->parts,dim));
- look->decodemap=malloc(look->partvals*sizeof(int *));
+ look->decodemap=_ogg_malloc(look->partvals*sizeof(int *));
for(j=0;j<look->partvals;j++){
long val=j;
long mult=look->partvals/look->parts;
- look->decodemap[j]=malloc(dim*sizeof(int));
+ look->decodemap[j]=_ogg_malloc(dim*sizeof(int));
for(k=0;k<dim;k++){
long deco=val/mult;
val-=deco*mult;
1.9.2.3 +8 -8 vorbis/lib/sharedbook.c
Index: sharedbook.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/sharedbook.c,v
retrieving revision 1.9.2.2
retrieving revision 1.9.2.3
diff -u -r1.9.2.2 -r1.9.2.3
--- sharedbook.c 2000/11/04 06:21:45 1.9.2.2
+++ sharedbook.c 2000/11/04 06:43:50 1.9.2.3
@@ -12,7 +12,7 @@
********************************************************************
function: basic shared codebook operations
- last mod: $Id: sharedbook.c,v 1.9.2.2 2000/11/04 06:21:45 xiphmont Exp $
+ last mod: $Id: sharedbook.c,v 1.9.2.3 2000/11/04 06:43:50 xiphmont Exp $
********************************************************************/
@@ -73,7 +73,7 @@
long *_make_words(long *l,long n){
long i,j;
long marker[33];
- long *r=malloc(n*sizeof(long));
+ long *r=_ogg_malloc(n*sizeof(long));
memset(marker,0,sizeof(marker));
for(i=0;i<n;i++){
@@ -142,9 +142,9 @@
decode_aux *_make_decode_tree(codebook *c){
const static_codebook *s=c->c;
long top=0,i,j,n;
- decode_aux *t=malloc(sizeof(decode_aux));
- long *ptr0=t->ptr0=calloc(c->entries*2,sizeof(long));
- long *ptr1=t->ptr1=calloc(c->entries*2,sizeof(long));
+ decode_aux *t=_ogg_malloc(sizeof(decode_aux));
+ long *ptr0=t->ptr0=_ogg_calloc(c->entries*2,sizeof(long));
+ long *ptr1=t->ptr1=_ogg_calloc(c->entries*2,sizeof(long));
long *codelist=_make_words(s->lengthlist,s->entries);
if(codelist==NULL)return(NULL);
@@ -176,8 +176,8 @@
t->tabn = _ilog(c->entries)-4; /* this is magic */
if(t->tabn<5)t->tabn=5;
n = 1<<t->tabn;
- t->tab = malloc(n*sizeof(long));
- t->tabl = malloc(n*sizeof(int));
+ t->tab = _ogg_malloc(n*sizeof(long));
+ t->tabl = _ogg_malloc(n*sizeof(int));
for (i = 0; i < n; i++) {
long p = 0;
for (j = 0; j < t->tabn && (p > 0 || j == 0); j++) {
@@ -236,7 +236,7 @@
int quantvals;
float mindel=_float32_unpack(b->q_min);
float delta=_float32_unpack(b->q_delta);
- float *r=calloc(b->entries*b->dim,sizeof(float));
+ float *r=_ogg_calloc(b->entries*b->dim,sizeof(float));
/* maptype 1 and 2 both use a quantized value vector, but
different sizes */
1.9.2.2 +3 -3 vorbis/lib/smallft.c
Index: smallft.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/smallft.c,v
retrieving revision 1.9.2.1
retrieving revision 1.9.2.2
diff -u -r1.9.2.1 -r1.9.2.2
--- smallft.c 2000/11/04 06:21:46 1.9.2.1
+++ smallft.c 2000/11/04 06:43:51 1.9.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: *unnormalized* fft transform
- last mod: $Id: smallft.c,v 1.9.2.1 2000/11/04 06:21:46 xiphmont Exp $
+ last mod: $Id: smallft.c,v 1.9.2.2 2000/11/04 06:43:51 xiphmont Exp $
********************************************************************/
@@ -1241,8 +1241,8 @@
void drft_init(drft_lookup *l,int n){
l->n=n;
- l->trigcache=calloc(3*n,sizeof(float));
- l->splitcache=calloc(32,sizeof(int));
+ l->trigcache=_ogg_calloc(3*n,sizeof(float));
+ l->splitcache=_ogg_calloc(32,sizeof(int));
fdrffti(n, l->trigcache, l->splitcache);
}
1.1.2.3 +3 -3 vorbis/lib/Attic/vorbisenc.c
Index: vorbisenc.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/Attic/vorbisenc.c,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- vorbisenc.c 2000/11/04 06:21:46 1.1.2.2
+++ vorbisenc.c 2000/11/04 06:43:51 1.1.2.3
@@ -12,7 +12,7 @@
********************************************************************
function: simple programmatic interface for encoder mode setup
- last mod: $Id: vorbisenc.c,v 1.1.2.2 2000/11/04 06:21:46 xiphmont Exp $
+ last mod: $Id: vorbisenc.c,v 1.1.2.3 2000/11/04 06:43:51 xiphmont Exp $
********************************************************************/
@@ -70,7 +70,7 @@
/* mode settings */
for(i=0;i<ci->modes;i++){
- ci->mode_param[i]=calloc(1,sizeof(vorbis_info_mode));
+ ci->mode_param[i]=_ogg_calloc(1,sizeof(vorbis_info_mode));
ci->mode_param[i]->blockflag=cs->mode_param[i]->blockflag;
ci->mode_param[i]->windowtype=cs->mode_param[i]->windowtype;
ci->mode_param[i]->transformtype=cs->mode_param[i]->transformtype;
@@ -140,7 +140,7 @@
((vorbis_info_floor0 *)(ci->floor_param[i]))->rate=rate;
/* adjust for channels; all our mappings use submap zero now */
- /* yeah, OK, calloc did this for us. But it's a reminder/placeholder */
+ /* yeah, OK, _ogg_calloc did this for us. But it's a reminder/placeholder */
for(i=0;i<ci->maps;i++)
for(j=0;j<channels;j++)
((vorbis_info_mapping0 *)ci->map_param[i])->chmuxlist[j]=0;
1.30.2.5 +9 -9 vorbis/lib/vorbisfile.c
Index: vorbisfile.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/vorbisfile.c,v
retrieving revision 1.30.2.4
retrieving revision 1.30.2.5
diff -u -r1.30.2.4 -r1.30.2.5
--- vorbisfile.c 2000/11/04 06:21:46 1.30.2.4
+++ vorbisfile.c 2000/11/04 06:43:51 1.30.2.5
@@ -12,7 +12,7 @@
********************************************************************
function: stdio-based convenience library for opening/seeking/decoding
- last mod: $Id: vorbisfile.c,v 1.30.2.4 2000/11/04 06:21:46 xiphmont Exp $
+ last mod: $Id: vorbisfile.c,v 1.30.2.5 2000/11/04 06:43:51 xiphmont Exp $
********************************************************************/
@@ -194,7 +194,7 @@
if(searched>=end || ret<0){
vf->links=m+1;
- vf->offsets=malloc((m+2)*sizeof(ogg_int64_t));
+ vf->offsets=_ogg_malloc((m+2)*sizeof(ogg_int64_t));
vf->offsets[m+1]=searched;
}else{
ret=_bisect_forward_serialno(vf,next,vf->offset,
@@ -275,11 +275,11 @@
ogg_page og;
int i,ret;
- vf->vi=calloc(vf->links,sizeof(vorbis_info));
- vf->vc=calloc(vf->links,sizeof(vorbis_info));
- vf->dataoffsets=malloc(vf->links*sizeof(ogg_int64_t));
- vf->pcmlengths=malloc(vf->links*sizeof(ogg_int64_t));
- vf->serialnos=malloc(vf->links*sizeof(long));
+ vf->vi=_ogg_calloc(vf->links,sizeof(vorbis_info));
+ vf->vc=_ogg_calloc(vf->links,sizeof(vorbis_info));
+ vf->dataoffsets=_ogg_malloc(vf->links*sizeof(ogg_int64_t));
+ vf->pcmlengths=_ogg_malloc(vf->links*sizeof(ogg_int64_t));
+ vf->serialnos=_ogg_malloc(vf->links*sizeof(long));
for(i=0;i<vf->links;i++){
if(first_i && first_c && i==0){
@@ -393,8 +393,8 @@
int ret;
/* we cannot seek. Set up a 'single' (current) logical bitstream entry */
vf->links=1;
- vf->vi=calloc(vf->links,sizeof(vorbis_info));
- vf->vc=calloc(vf->links,sizeof(vorbis_info));
+ vf->vi=_ogg_calloc(vf->links,sizeof(vorbis_info));
+ vf->vc=_ogg_calloc(vf->links,sizeof(vorbis_info));
/* Try to fetch the headers, maintaining all the storage */
if((ret=_fetch_headers(vf,vf->vi,vf->vc,&vf->current_serialno,NULL))<0)
1.8.2.2 +2 -2 vorbis/lib/window.c
Index: window.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/window.c,v
retrieving revision 1.8.2.1
retrieving revision 1.8.2.2
diff -u -r1.8.2.1 -r1.8.2.2
--- window.c 2000/11/04 06:21:46 1.8.2.1
+++ window.c 2000/11/04 06:43:51 1.8.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: window functions
- last mod: $Id: window.c,v 1.8.2.1 2000/11/04 06:21:46 xiphmont Exp $
+ last mod: $Id: window.c,v 1.8.2.2 2000/11/04 06:43:51 xiphmont Exp $
********************************************************************/
@@ -22,7 +22,7 @@
#include "misc.h"
float *_vorbis_window(int type, int window,int left,int right){
- float *ret=calloc(window,sizeof(float));
+ float *ret=_ogg_calloc(window,sizeof(float));
switch(type){
case 0:
No revision
No revision
1.1.6.1 +1 -1 vorbis/mac/compat/strdup.c
Index: strdup.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/mac/compat/strdup.c,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -r1.1 -r1.1.6.1
--- strdup.c 2000/08/14 22:33:50 1.1
+++ strdup.c 2000/11/04 06:43:54 1.1.6.1
@@ -1 +1 @@
-#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
char *strdup(const char *inStr)
{
char *outStr = NULL;
if (inStr == NULL) {
return NULL;
}
outStr = malloc(strlen(inStr) + 1);
if (outStr != NULL) {
strcpy(outStr, inStr);
}
return outStr;
}
\ No newline at end of file
+#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
char *strdup(const char *inStr)
{
char *outStr = NULL;
if (inStr == NULL) {
return NULL;
}
outStr = _ogg_malloc(strlen(inStr) + 1);
if (outStr != NULL) {
strcpy(outStr, inStr);
}
return outStr;
}
\ No newline at end of file
No revision
No revision
1.17.2.5 +22 -22 vorbis/vq/bookutil.c
Index: bookutil.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/bookutil.c,v
retrieving revision 1.17.2.4
retrieving revision 1.17.2.5
diff -u -r1.17.2.4 -r1.17.2.5
--- bookutil.c 2000/11/04 06:22:09 1.17.2.4
+++ bookutil.c 2000/11/04 06:43:55 1.17.2.5
@@ -12,7 +12,7 @@
********************************************************************
function: utility functions for loading .vqh and .vqd files
- last mod: $Id: bookutil.c,v 1.17.2.4 2000/11/04 06:22:09 xiphmont Exp $
+ last mod: $Id: bookutil.c,v 1.17.2.5 2000/11/04 06:43:55 xiphmont Exp $
********************************************************************/
@@ -40,10 +40,10 @@
if(sofar+1>=lbufsize){
if(!lbufsize){
lbufsize=1024;
- linebuffer=malloc(lbufsize);
+ linebuffer=_ogg_malloc(lbufsize);
}else{
lbufsize*=2;
- linebuffer=realloc(linebuffer,lbufsize);
+ linebuffer=_ogg_realloc(linebuffer,lbufsize);
}
}
{
@@ -178,8 +178,8 @@
header-ness will break this routine */
codebook *codebook_load(char *filename){
- codebook *b=calloc(1,sizeof(codebook));
- static_codebook *c=(static_codebook *)(b->c=calloc(1,sizeof(static_codebook)));
+ codebook *b=_ogg_calloc(1,sizeof(codebook));
+ static_codebook *c=(static_codebook *)(b->c=_ogg_calloc(1,sizeof(static_codebook)));
encode_aux_nearestmatch *a=NULL;
encode_aux_threshmatch *t=NULL;
encode_aux_pigeonhole *p=NULL;
@@ -215,7 +215,7 @@
/* find the auxiliary encode struct[s] (if any) */
if(find_seek_to(in,"static encode_aux_nearestmatch _vq_aux")){
/* how big? */
- c->nearest_tree=a=calloc(1,sizeof(encode_aux_nearestmatch));
+ c->nearest_tree=a=_ogg_calloc(1,sizeof(encode_aux_nearestmatch));
line=get_line(in);
line=get_line(in);
line=get_line(in);
@@ -229,7 +229,7 @@
/* load ptr0 */
find_seek_to(in,"static long _vq_ptr0");
reset_next_value();
- a->ptr0=malloc(sizeof(long)*a->aux);
+ a->ptr0=_ogg_malloc(sizeof(long)*a->aux);
for(i=0;i<a->aux;i++)
if(get_next_ivalue(in,a->ptr0+i)){
fprintf(stderr,"out of data while reading codebook %s\n",filename);
@@ -239,7 +239,7 @@
/* load ptr1 */
find_seek_to(in,"static long _vq_ptr1");
reset_next_value();
- a->ptr1=malloc(sizeof(long)*a->aux);
+ a->ptr1=_ogg_malloc(sizeof(long)*a->aux);
for(i=0;i<a->aux;i++)
if(get_next_ivalue(in,a->ptr1+i)){
fprintf(stderr,"out of data while reading codebook %s\n",filename);
@@ -250,7 +250,7 @@
/* load p */
find_seek_to(in,"static long _vq_p_");
reset_next_value();
- a->p=malloc(sizeof(long)*a->aux);
+ a->p=_ogg_malloc(sizeof(long)*a->aux);
for(i=0;i<a->aux;i++)
if(get_next_ivalue(in,a->p+i)){
fprintf(stderr,"out of data while reading codebook %s\n",filename);
@@ -260,7 +260,7 @@
/* load q */
find_seek_to(in,"static long _vq_q_");
reset_next_value();
- a->q=malloc(sizeof(long)*a->aux);
+ a->q=_ogg_malloc(sizeof(long)*a->aux);
for(i=0;i<a->aux;i++)
if(get_next_ivalue(in,a->q+i)){
fprintf(stderr,"out of data while reading codebook %s\n",filename);
@@ -270,7 +270,7 @@
if(find_seek_to(in,"static encode_aux_threshmatch _vq_aux")){
/* how big? */
- c->thresh_tree=t=calloc(1,sizeof(encode_aux_threshmatch));
+ c->thresh_tree=t=_ogg_calloc(1,sizeof(encode_aux_threshmatch));
line=get_line(in);
line=get_line(in);
line=get_line(in);
@@ -286,7 +286,7 @@
/* load quantthresh */
find_seek_to(in,"static float _vq_quantthresh_");
reset_next_value();
- t->quantthresh=malloc(sizeof(float)*t->threshvals);
+ t->quantthresh=_ogg_malloc(sizeof(float)*t->threshvals);
for(i=0;i<t->threshvals-1;i++)
if(get_next_value(in,t->quantthresh+i)){
fprintf(stderr,"out of data 1 while reading codebook %s\n",filename);
@@ -295,7 +295,7 @@
/* load quantmap */
find_seek_to(in,"static long _vq_quantmap_");
reset_next_value();
- t->quantmap=malloc(sizeof(long)*t->threshvals);
+ t->quantmap=_ogg_malloc(sizeof(long)*t->threshvals);
for(i=0;i<t->threshvals;i++)
if(get_next_ivalue(in,t->quantmap+i)){
fprintf(stderr,"out of data 2 while reading codebook %s\n",filename);
@@ -306,7 +306,7 @@
if(find_seek_to(in,"static encode_aux_pigeonhole _vq_aux")){
int pigeons=1,i;
/* how big? */
- c->pigeon_tree=p=calloc(1,sizeof(encode_aux_pigeonhole));
+ c->pigeon_tree=p=_ogg_calloc(1,sizeof(encode_aux_pigeonhole));
line=get_line(in);
if(sscanf(line,"%f, %f, %d, %d",&(p->min),&(p->del),
&(p->mapentries),&(p->quantvals))!=4){
@@ -322,7 +322,7 @@
/* load pigeonmap */
find_seek_to(in,"static long _vq_pigeonmap_");
reset_next_value();
- p->pigeonmap=malloc(sizeof(long)*p->mapentries);
+ p->pigeonmap=_ogg_malloc(sizeof(long)*p->mapentries);
for(i=0;i<p->mapentries;i++)
if(get_next_ivalue(in,p->pigeonmap+i)){
fprintf(stderr,"out of data (pigeonmap) while reading codebook %s\n",filename);
@@ -331,7 +331,7 @@
/* load fitlist */
find_seek_to(in,"static long _vq_fitlist_");
reset_next_value();
- p->fitlist=malloc(sizeof(long)*p->fittotal);
+ p->fitlist=_ogg_malloc(sizeof(long)*p->fittotal);
for(i=0;i<p->fittotal;i++)
if(get_next_ivalue(in,p->fitlist+i)){
fprintf(stderr,"out of data (fitlist) while reading codebook %s\n",filename);
@@ -341,7 +341,7 @@
find_seek_to(in,"static long _vq_fitmap_");
reset_next_value();
for(i=0;i<c->dim;i++)pigeons*=p->quantvals;
- p->fitmap=malloc(sizeof(long)*pigeons);
+ p->fitmap=_ogg_malloc(sizeof(long)*pigeons);
for(i=0;i<pigeons;i++)
if(get_next_ivalue(in,p->fitmap+i)){
fprintf(stderr,"out of data (fitmap) while reading codebook %s\n",filename);
@@ -351,7 +351,7 @@
/* load fitlength */
find_seek_to(in,"static long _vq_fitlength_");
reset_next_value();
- p->fitlength=malloc(sizeof(long)*pigeons);
+ p->fitlength=_ogg_malloc(sizeof(long)*pigeons);
for(i=0;i<pigeons;i++)
if(get_next_ivalue(in,p->fitlength+i)){
fprintf(stderr,"out of data (fitlength) while reading codebook %s\n",filename);
@@ -374,7 +374,7 @@
/* load the quantized entries */
find_seek_to(in,"static long _vq_quantlist_");
reset_next_value();
- c->quantlist=malloc(sizeof(long)*quant_to_read);
+ c->quantlist=_ogg_malloc(sizeof(long)*quant_to_read);
for(i=0;i<quant_to_read;i++)
if(get_next_ivalue(in,c->quantlist+i)){
fprintf(stderr,"out of data while reading codebook %s\n",filename);
@@ -384,7 +384,7 @@
/* load the lengthlist */
find_seek_to(in,"static long _vq_lengthlist");
reset_next_value();
- c->lengthlist=malloc(sizeof(long)*c->entries);
+ c->lengthlist=_ogg_malloc(sizeof(long)*c->entries);
for(i=0;i<c->entries;i++)
if(get_next_ivalue(in,c->lengthlist+i)){
fprintf(stderr,"out of data while reading codebook %s\n",filename);
@@ -433,7 +433,7 @@
void build_tree_from_lengths(int vals, long *hist, long *lengths){
int i,j;
- long *membership=malloc(vals*sizeof(long));
+ long *membership=_ogg_malloc(vals*sizeof(long));
long *histsave=alloca(vals*sizeof(long));
memcpy(histsave,hist,vals*sizeof(long));
@@ -506,7 +506,7 @@
the lengths after the build */
int upper=0,i;
- long *lengthlist=calloc(vals,sizeof(long));
+ long *lengthlist=_ogg_calloc(vals,sizeof(long));
long *newhist=alloca(vals*sizeof(long));
for(i=0;i<vals;i++)
1.15.2.3 +4 -4 vorbis/vq/build.c
Index: build.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/build.c,v
retrieving revision 1.15.2.2
retrieving revision 1.15.2.3
diff -u -r1.15.2.2 -r1.15.2.3
--- build.c 2000/11/04 06:22:10 1.15.2.2
+++ build.c 2000/11/04 06:43:55 1.15.2.3
@@ -12,7 +12,7 @@
********************************************************************
function: utility main for building codebooks from training sets
- last mod: $Id: build.c,v 1.15.2.2 2000/11/04 06:22:10 xiphmont Exp $
+ last mod: $Id: build.c,v 1.15.2.3 2000/11/04 06:43:55 xiphmont Exp $
********************************************************************/
@@ -41,10 +41,10 @@
if(sofar>=lbufsize){
if(!lbufsize){
lbufsize=1024;
- linebuffer=malloc(lbufsize);
+ linebuffer=_ogg_malloc(lbufsize);
}else{
lbufsize*=2;
- linebuffer=realloc(linebuffer,lbufsize);
+ linebuffer=_ogg_realloc(linebuffer,lbufsize);
}
}
{
@@ -147,7 +147,7 @@
/* save quant data; we don't want to requantize later as our method
is currently imperfect wrt repeated application */
i=0;
- quantlist=malloc(sizeof(long)*v.elements*v.entries);
+ quantlist=_ogg_malloc(sizeof(long)*v.elements*v.entries);
for(j=0;j<entries;j++){
float a;
for(k=0;k<dim;k++){
1.5.2.5 +3 -3 vorbis/vq/huffbuild.c
Index: huffbuild.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/huffbuild.c,v
retrieving revision 1.5.2.4
retrieving revision 1.5.2.5
diff -u -r1.5.2.4 -r1.5.2.5
--- huffbuild.c 2000/11/04 06:22:10 1.5.2.4
+++ huffbuild.c 2000/11/04 06:43:55 1.5.2.5
@@ -12,7 +12,7 @@
********************************************************************
function: hufftree builder
- last mod: $Id: huffbuild.c,v 1.5.2.4 2000/11/04 06:22:10 xiphmont Exp $
+ last mod: $Id: huffbuild.c,v 1.5.2.5 2000/11/04 06:43:55 xiphmont Exp $
********************************************************************/
@@ -112,8 +112,8 @@
{
long vals=pow(maxval,subn);
- long *hist=malloc(vals*sizeof(long));
- long *lengths=malloc(vals*sizeof(long));
+ long *hist=_ogg_malloc(vals*sizeof(long));
+ long *lengths=_ogg_malloc(vals*sizeof(long));
for(j=0;j<vals;j++)hist[j]=guard;
1.6.2.2 +6 -6 vorbis/vq/latticebuild.c
Index: latticebuild.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/latticebuild.c,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -u -r1.6.2.1 -r1.6.2.2
--- latticebuild.c 2000/11/04 06:22:10 1.6.2.1
+++ latticebuild.c 2000/11/04 06:43:55 1.6.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: utility main for building codebooks from lattice descriptions
- last mod: $Id: latticebuild.c,v 1.6.2.1 2000/11/04 06:22:10 xiphmont Exp $
+ last mod: $Id: latticebuild.c,v 1.6.2.2 2000/11/04 06:43:55 xiphmont Exp $
********************************************************************/
@@ -77,7 +77,7 @@
{
char *ptr;
- char *filename=calloc(strlen(argv[1])+4,1);
+ char *filename=_ogg_calloc(strlen(argv[1])+4,1);
strcpy(filename,argv[1]);
in=fopen(filename,"r");
@@ -107,13 +107,13 @@
entries=pow(quantvals,dim);
c.dim=dim;
c.entries=entries;
- c.lengthlist=malloc(entries*sizeof(long));
+ c.lengthlist=_ogg_malloc(entries*sizeof(long));
c.maptype=1;
c.q_sequencep=sequencep;
- c.quantlist=calloc(quantvals,sizeof(long));
+ c.quantlist=_ogg_calloc(quantvals,sizeof(long));
- quantlist=malloc(sizeof(long)*c.dim*c.entries);
- hits=malloc(c.entries*sizeof(long));
+ quantlist=_ogg_malloc(sizeof(long)*c.dim*c.entries);
+ hits=_ogg_malloc(c.entries*sizeof(long));
for(j=0;j<entries;j++)hits[j]=1;
for(j=0;j<entries;j++)c.lengthlist[j]=1;
1.3.2.2 +16 -16 vorbis/vq/latticehint.c
Index: latticehint.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/latticehint.c,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -r1.3.2.1 -r1.3.2.2
--- latticehint.c 2000/11/04 06:22:10 1.3.2.1
+++ latticehint.c 2000/11/04 06:43:55 1.3.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: utility main for building thresh/pigeonhole encode hints
- last mod: $Id: latticehint.c,v 1.3.2.1 2000/11/04 06:22:10 xiphmont Exp $
+ last mod: $Id: latticehint.c,v 1.3.2.2 2000/11/04 06:43:55 xiphmont Exp $
********************************************************************/
@@ -58,10 +58,10 @@
if(ptr){
while(i--)
if(*ptr++==add)return(0);
- tempstack[entry]=realloc(tempstack[entry],
+ tempstack[entry]=_ogg_realloc(tempstack[entry],
(tempcount[entry]+1)*sizeof(long));
}else{
- tempstack[entry]=malloc(sizeof(long));
+ tempstack[entry]=_ogg_malloc(sizeof(long));
}
tempstack[entry][tempcount[entry]++]=add;
@@ -166,14 +166,14 @@
/* yes. Discard any preexisting threshhold hint */
long quantvals=_book_maptype1_quantvals(c);
long **quantsort=alloca(quantvals*sizeof(long *));
- encode_aux_threshmatch *t=calloc(1,sizeof(encode_aux_threshmatch));
+ encode_aux_threshmatch *t=_ogg_calloc(1,sizeof(encode_aux_threshmatch));
c->thresh_tree=t;
fprintf(stderr,"Adding threshold hint to %s...\n",name);
/* simplest possible threshold hint only */
- t->quantthresh=calloc(quantvals-1,sizeof(float));
- t->quantmap=calloc(quantvals,sizeof(int));
+ t->quantthresh=_ogg_calloc(quantvals-1,sizeof(float));
+ t->quantmap=_ogg_calloc(quantvals,sizeof(int));
t->threshvals=quantvals;
t->quantvals=quantvals;
@@ -212,7 +212,7 @@
long quantvals=_book_maptype1_quantvals(c);
int changep=1,factor;
- encode_aux_pigeonhole *p=calloc(1,sizeof(encode_aux_pigeonhole));
+ encode_aux_pigeonhole *p=_ogg_calloc(1,sizeof(encode_aux_pigeonhole));
c->pigeon_tree=p;
fprintf(stderr,"Adding pigeonhole hint to %s...\n",name);
@@ -237,7 +237,7 @@
for(i=0;i<quantvals;i++)if(max<c->quantlist[i])max=c->quantlist[i];
p->mapentries=max;
}
- p->pigeonmap=malloc(p->mapentries*sizeof(long));
+ p->pigeonmap=_ogg_malloc(p->mapentries*sizeof(long));
p->quantvals=(quantvals+factor-1)/factor;
/* pigeonhole roughly on the boundaries of the quantvals; the
@@ -274,11 +274,11 @@
subpigeons=1;
for(i=0;i<dim;i++)subpigeons*=p->mapentries;
for(i=0;i<dim;i++)pigeons*=p->quantvals;
- temptrack=calloc(dim,sizeof(long));
- tempmin=calloc(dim,sizeof(float));
- tempmax=calloc(dim,sizeof(float));
- tempstack=calloc(pigeons,sizeof(long *));
- tempcount=calloc(pigeons,sizeof(long));
+ temptrack=_ogg_calloc(dim,sizeof(long));
+ tempmin=_ogg_calloc(dim,sizeof(float));
+ tempmax=_ogg_calloc(dim,sizeof(float));
+ tempstack=_ogg_calloc(pigeons,sizeof(long *));
+ tempcount=_ogg_calloc(pigeons,sizeof(long));
while(1){
float errorpost=-1;
@@ -338,7 +338,7 @@
/* pare the list of shortlists; merge contained and similar lists
together */
- p->fitmap=malloc(pigeons*sizeof(long));
+ p->fitmap=_ogg_malloc(pigeons*sizeof(long));
for(i=0;i<pigeons;i++)p->fitmap[i]=-1;
while(changep){
char buffer[80];
@@ -388,8 +388,8 @@
p->fittotal=totalstack;
- p->fitlist=malloc((totalstack+1)*sizeof(long));
- p->fitlength=malloc(pigeons*sizeof(long));
+ p->fitlist=_ogg_malloc((totalstack+1)*sizeof(long));
+ p->fitlength=_ogg_malloc(pigeons*sizeof(long));
{
long usage=0;
for(i=0;i<pigeons;i++){
1.5.2.2 +21 -21 vorbis/vq/latticepare.c
Index: latticepare.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/latticepare.c,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -u -r1.5.2.1 -r1.5.2.2
--- latticepare.c 2000/11/04 06:22:10 1.5.2.1
+++ latticepare.c 2000/11/04 06:43:55 1.5.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: utility for paring low hit count cells from lattice codebook
- last mod: $Id: latticepare.c,v 1.5.2.1 2000/11/04 06:22:10 xiphmont Exp $
+ last mod: $Id: latticepare.c,v 1.5.2.2 2000/11/04 06:43:55 xiphmont Exp $
********************************************************************/
@@ -248,7 +248,7 @@
if((lines&0xff)==0)spinnit("counting samples...",lines*cols);
line=setup_line(in);
}
- pointlist=malloc((cols*lines+entries*dim)*sizeof(float));
+ pointlist=_ogg_malloc((cols*lines+entries*dim)*sizeof(float));
rewind(in);
line=setup_line(in);
@@ -312,15 +312,15 @@
long indexedpoints=0;
long *entryindex;
long *reventry;
- long *membership=malloc(points*sizeof(long));
- long *firsthead=malloc(entries*sizeof(long));
- long *secondary=malloc(points*sizeof(long));
- long *secondhead=malloc(entries*sizeof(long));
-
- long *cellcount=calloc(entries,sizeof(long));
- long *cellcount2=calloc(entries,sizeof(long));
- float *cellerror=calloc(entries,sizeof(float));
- float *cellerrormax=calloc(entries,sizeof(float));
+ long *membership=_ogg_malloc(points*sizeof(long));
+ long *firsthead=_ogg_malloc(entries*sizeof(long));
+ long *secondary=_ogg_malloc(points*sizeof(long));
+ long *secondhead=_ogg_malloc(entries*sizeof(long));
+
+ long *cellcount=_ogg_calloc(entries,sizeof(long));
+ long *cellcount2=_ogg_calloc(entries,sizeof(long));
+ float *cellerror=_ogg_calloc(entries,sizeof(float));
+ float *cellerrormax=_ogg_calloc(entries,sizeof(float));
long cellsleft=entries;
for(i=0;i<points;i++)membership[i]=-1;
for(i=0;i<entries;i++)firsthead[i]=-1;
@@ -355,7 +355,7 @@
/* which cells are most heavily populated? Protect as many from
dispersal as the user has requested */
{
- long **countindex=calloc(entries,sizeof(long *));
+ long **countindex=_ogg_calloc(entries,sizeof(long *));
for(i=0;i<entries;i++)countindex[i]=cellcount+i;
qsort(countindex,entries,sizeof(long *),longsort);
for(i=0;i<protect;i++){
@@ -491,7 +491,7 @@
free(cellerrormax);
free(secondary);
- pointindex=malloc(points*sizeof(long));
+ pointindex=_ogg_malloc(points*sizeof(long));
/* make a point index of fall-through points */
for(i=0;i<points;i++){
int best=_best(b,pointlist+i*dim,1);
@@ -501,7 +501,7 @@
}
/* make an entry index */
- entryindex=malloc(entries*sizeof(long));
+ entryindex=_ogg_malloc(entries*sizeof(long));
target=0;
for(i=0;i<entries;i++){
if(b->c->lengthlist[i]>0)
@@ -509,17 +509,17 @@
}
/* make working space for a reverse entry index */
- reventry=malloc(entries*sizeof(long));
+ reventry=_ogg_malloc(entries*sizeof(long));
/* do the split */
nt=b->c->nearest_tree=
- calloc(1,sizeof(encode_aux_nearestmatch));
+ _ogg_calloc(1,sizeof(encode_aux_nearestmatch));
nt->alloc=4096;
- nt->ptr0=malloc(sizeof(long)*nt->alloc);
- nt->ptr1=malloc(sizeof(long)*nt->alloc);
- nt->p=malloc(sizeof(long)*nt->alloc);
- nt->q=malloc(sizeof(long)*nt->alloc);
+ nt->ptr0=_ogg_malloc(sizeof(long)*nt->alloc);
+ nt->ptr1=_ogg_malloc(sizeof(long)*nt->alloc);
+ nt->p=_ogg_malloc(sizeof(long)*nt->alloc);
+ nt->q=_ogg_malloc(sizeof(long)*nt->alloc);
nt->aux=0;
fprintf(stderr,"Leaves added: %d \n",
@@ -558,7 +558,7 @@
the lengths after the build */
{
int upper=0;
- long *lengthlist=calloc(entries,sizeof(long));
+ long *lengthlist=_ogg_calloc(entries,sizeof(long));
for(i=0;i<entries;i++){
if(b->c->lengthlist[i]>0)
entryindex[upper++]=entryindex[i];
1.3.2.2 +3 -3 vorbis/vq/latticetune.c
Index: latticetune.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/latticetune.c,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -r1.3.2.1 -r1.3.2.2
--- latticetune.c 2000/11/04 06:22:10 1.3.2.1
+++ latticetune.c 2000/11/04 06:43:55 1.3.2.2
@@ -13,7 +13,7 @@
function: utility main for setting entropy encoding parameters
for lattice codebooks
- last mod: $Id: latticetune.c,v 1.3.2.1 2000/11/04 06:22:10 xiphmont Exp $
+ last mod: $Id: latticetune.c,v 1.3.2.2 2000/11/04 06:43:55 xiphmont Exp $
********************************************************************/
@@ -80,8 +80,8 @@
entries=b->entries;
dim=b->dim;
- hits=malloc(entries*sizeof(long));
- lengths=calloc(entries,sizeof(long));
+ hits=_ogg_malloc(entries*sizeof(long));
+ lengths=_ogg_calloc(entries,sizeof(long));
for(j=0;j<entries;j++)hits[j]=guard;
in=fopen(argv[2],"r");
1.13.2.3 +2 -2 vorbis/vq/lspdata.c
Index: lspdata.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/lspdata.c,v
retrieving revision 1.13.2.2
retrieving revision 1.13.2.3
diff -u -r1.13.2.2 -r1.13.2.3
--- lspdata.c 2000/11/04 06:22:10 1.13.2.2
+++ lspdata.c 2000/11/04 06:43:55 1.13.2.3
@@ -12,7 +12,7 @@
********************************************************************
function: metrics and quantization code for LSP VQ codebooks
- last mod: $Id: lspdata.c,v 1.13.2.2 2000/11/04 06:22:10 xiphmont Exp $
+ last mod: $Id: lspdata.c,v 1.13.2.3 2000/11/04 06:43:55 xiphmont Exp $
********************************************************************/
@@ -153,6 +153,6 @@
}
}
- weight=malloc(sizeof(float)*v->elements);
+ weight=_ogg_malloc(sizeof(float)*v->elements);
}
1.9.2.2 +11 -11 vorbis/vq/metrics.c
Index: metrics.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/metrics.c,v
retrieving revision 1.9.2.1
retrieving revision 1.9.2.2
diff -u -r1.9.2.1 -r1.9.2.2
--- metrics.c 2000/11/04 06:22:10 1.9.2.1
+++ metrics.c 2000/11/04 06:43:55 1.9.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: function calls to collect codebook metrics
- last mod: $Id: metrics.c,v 1.9.2.1 2000/11/04 06:22:10 xiphmont Exp $
+ last mod: $Id: metrics.c,v 1.9.2.2 2000/11/04 06:43:55 xiphmont Exp $
********************************************************************/
@@ -63,11 +63,11 @@
while(bs[books])books++;
if(books){
- histogram=calloc(books,sizeof(float *));
- histogram_error=calloc(books,sizeof(float *));
- histogram_errorsq=calloc(books,sizeof(float *));
- histogram_hi=calloc(books,sizeof(float *));
- histogram_lo=calloc(books,sizeof(float *));
+ histogram=_ogg_calloc(books,sizeof(float *));
+ histogram_error=_ogg_calloc(books,sizeof(float *));
+ histogram_errorsq=_ogg_calloc(books,sizeof(float *));
+ histogram_hi=_ogg_calloc(books,sizeof(float *));
+ histogram_lo=_ogg_calloc(books,sizeof(float *));
}else{
fprintf(stderr,"Specify at least one codebook\n");
exit(1);
@@ -75,11 +75,11 @@
for(i=0;i<books;i++){
codebook *b=bs[i];
- histogram[i]=calloc(b->entries,sizeof(float));
- histogram_error[i]=calloc(b->entries*b->dim,sizeof(float));
- histogram_errorsq[i]=calloc(b->entries*b->dim,sizeof(float));
- histogram_hi[i]=calloc(b->entries*b->dim,sizeof(float));
- histogram_lo[i]=calloc(b->entries*b->dim,sizeof(float));
+ histogram[i]=_ogg_calloc(b->entries,sizeof(float));
+ histogram_error[i]=_ogg_calloc(b->entries*b->dim,sizeof(float));
+ histogram_errorsq[i]=_ogg_calloc(b->entries*b->dim,sizeof(float));
+ histogram_hi[i]=_ogg_calloc(b->entries*b->dim,sizeof(float));
+ histogram_lo[i]=_ogg_calloc(b->entries*b->dim,sizeof(float));
}
}
1.4.2.2 +2 -2 vorbis/vq/residuedata.c
Index: residuedata.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/residuedata.c,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -u -r1.4.2.1 -r1.4.2.2
--- residuedata.c 2000/11/04 06:22:10 1.4.2.1
+++ residuedata.c 2000/11/04 06:43:55 1.4.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: metrics and quantization code for residue VQ codebooks
- last mod: $Id: residuedata.c,v 1.4.2.1 2000/11/04 06:22:10 xiphmont Exp $
+ last mod: $Id: residuedata.c,v 1.4.2.2 2000/11/04 06:43:55 xiphmont Exp $
********************************************************************/
@@ -154,7 +154,7 @@
}
}
vqext_quantize(v,&q);
- quant_save=malloc(sizeof(float)*v->elements*v->entries);
+ quant_save=_ogg_malloc(sizeof(float)*v->elements*v->entries);
memcpy(quant_save,_now(v,0),sizeof(float)*v->elements*v->entries);
vqgen_unquantize(v,&q);
1.5.2.2 +5 -5 vorbis/vq/residuesplit.c
Index: residuesplit.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/residuesplit.c,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -u -r1.5.2.1 -r1.5.2.2
--- residuesplit.c 2000/11/04 06:22:10 1.5.2.1
+++ residuesplit.c 2000/11/04 06:43:56 1.5.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: residue backend 0 partitioner/classifier
- last mod: $Id: residuesplit.c,v 1.5.2.1 2000/11/04 06:22:10 xiphmont Exp $
+ last mod: $Id: residuesplit.c,v 1.5.2.2 2000/11/04 06:43:56 xiphmont Exp $
********************************************************************/
@@ -162,9 +162,9 @@
/* how many parts?... */
parts=argc-3;
- ebound=malloc(sizeof(float)*parts);
- mbound=malloc(sizeof(float)*parts);
- subgrp=malloc(sizeof(int)*parts);
+ ebound=_ogg_malloc(sizeof(float)*parts);
+ mbound=_ogg_malloc(sizeof(float)*parts);
+ subgrp=_ogg_malloc(sizeof(int)*parts);
for(i=0;i<parts-1;i++){
char *pos=strchr(argv[4+i],',');
@@ -217,7 +217,7 @@
}
}
- vec=malloc(sizeof(float)*n);
+ vec=_ogg_malloc(sizeof(float)*n);
/* get the input line by line and process it */
while(!feof(res)){
if(getline(res,vec,begin,n))
1.11.2.2 +5 -5 vorbis/vq/run.c
Index: run.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/run.c,v
retrieving revision 1.11.2.1
retrieving revision 1.11.2.2
diff -u -r1.11.2.1 -r1.11.2.2
--- run.c 2000/11/04 06:22:10 1.11.2.1
+++ run.c 2000/11/04 06:43:56 1.11.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: utility main for loading and operating on codebooks
- last mod: $Id: run.c,v 1.11.2.1 2000/11/04 06:22:10 xiphmont Exp $
+ last mod: $Id: run.c,v 1.11.2.2 2000/11/04 06:43:56 xiphmont Exp $
********************************************************************/
@@ -44,8 +44,8 @@
int main(int argc,char *argv[]){
char *basename;
- codebook **b=calloc(1,sizeof(codebook *));
- int *addmul=calloc(1,sizeof(int));
+ codebook **b=_ogg_calloc(1,sizeof(codebook *));
+ int *addmul=_ogg_calloc(1,sizeof(int));
int books=0;
int input=0;
int interleave=0;
@@ -115,9 +115,9 @@
dot=strrchr(basename,'.');
if(dot)*dot='\0';
- b=realloc(b,sizeof(codebook *)*(books+2));
+ b=_ogg_realloc(b,sizeof(codebook *)*(books+2));
b[books]=codebook_load(name);
- addmul=realloc(addmul,sizeof(int)*(books+1));
+ addmul=_ogg_realloc(addmul,sizeof(int)*(books+1));
addmul[books++]=multp;
b[books]=NULL;
}
1.34.2.2 +11 -11 vorbis/vq/vqgen.c
Index: vqgen.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/vqgen.c,v
retrieving revision 1.34.2.1
retrieving revision 1.34.2.2
diff -u -r1.34.2.1 -r1.34.2.2
--- vqgen.c 2000/11/04 06:22:11 1.34.2.1
+++ vqgen.c 2000/11/04 06:43:56 1.34.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: train a VQ codebook
- last mod: $Id: vqgen.c,v 1.34.2.1 2000/11/04 06:22:11 xiphmont Exp $
+ last mod: $Id: vqgen.c,v 1.34.2.2 2000/11/04 06:43:56 xiphmont Exp $
********************************************************************/
@@ -250,13 +250,13 @@
v->aux=aux;
v->mindist=mindist;
v->allocated=32768;
- v->pointlist=malloc(v->allocated*(v->elements+v->aux)*sizeof(float));
+ v->pointlist=_ogg_malloc(v->allocated*(v->elements+v->aux)*sizeof(float));
v->entries=entries;
- v->entrylist=malloc(v->entries*v->elements*sizeof(float));
- v->assigned=malloc(v->entries*sizeof(long));
- v->bias=calloc(v->entries,sizeof(float));
- v->max=calloc(v->entries,sizeof(float));
+ v->entrylist=_ogg_malloc(v->entries*v->elements*sizeof(float));
+ v->assigned=_ogg_malloc(v->entries*sizeof(long));
+ v->bias=_ogg_calloc(v->entries,sizeof(float));
+ v->max=_ogg_calloc(v->entries,sizeof(float));
if(metric)
v->metric_func=metric;
else
@@ -279,7 +279,7 @@
if(v->points>=v->allocated){
v->allocated*=2;
- v->pointlist=realloc(v->pointlist,v->allocated*(v->elements+v->aux)*
+ v->pointlist=_ogg_realloc(v->pointlist,v->allocated*(v->elements+v->aux)*
sizeof(float));
}
@@ -371,10 +371,10 @@
fdesired=(float)v->points/v->entries;
desired=fdesired;
desired2=desired*2;
- new=malloc(sizeof(float)*v->entries*v->elements);
- new2=malloc(sizeof(float)*v->entries*v->elements);
- nearcount=malloc(v->entries*sizeof(long));
- nearbias=malloc(v->entries*desired2*sizeof(float));
+ new=_ogg_malloc(sizeof(float)*v->entries*v->elements);
+ new2=_ogg_malloc(sizeof(float)*v->entries*v->elements);
+ nearcount=_ogg_malloc(v->entries*sizeof(long));
+ nearbias=_ogg_malloc(v->entries*desired2*sizeof(float));
/* fill in nearest points for entry biasing */
/*memset(v->bias,0,sizeof(float)*v->entries);*/
1.20.2.2 +26 -26 vorbis/vq/vqsplit.c
Index: vqsplit.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/vqsplit.c,v
retrieving revision 1.20.2.1
retrieving revision 1.20.2.2
diff -u -r1.20.2.1 -r1.20.2.2
--- vqsplit.c 2000/11/04 06:22:11 1.20.2.1
+++ vqsplit.c 2000/11/04 06:43:56 1.20.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: build a VQ codebook and the encoding decision 'tree'
- last mod: $Id: vqsplit.c,v 1.20.2.1 2000/11/04 06:22:11 xiphmont Exp $
+ last mod: $Id: vqsplit.c,v 1.20.2.2 2000/11/04 06:43:56 xiphmont Exp $
********************************************************************/
@@ -98,8 +98,8 @@
long *temppointsB=NULL;
if(splitp){
- temppointsA=malloc(points*sizeof(long));
- temppointsB=malloc(points*sizeof(long));
+ temppointsA=_ogg_malloc(points*sizeof(long));
+ temppointsB=_ogg_malloc(points*sizeof(long));
}
memset(entryA,0,sizeof(long)*entries);
@@ -174,8 +174,8 @@
int dim=b->dim;
float *entrylist=b->valuelist;
long ret;
- long *entryA=calloc(entries,sizeof(long));
- long *entryB=calloc(entries,sizeof(long));
+ long *entryA=_ogg_calloc(entries,sizeof(long));
+ long *entryB=_ogg_calloc(entries,sizeof(long));
long entriesA=0;
long entriesB=0;
long entriesC=0;
@@ -320,10 +320,10 @@
long thisaux=t->aux++;
if(t->aux>=t->alloc){
t->alloc*=2;
- t->ptr0=realloc(t->ptr0,sizeof(long)*t->alloc);
- t->ptr1=realloc(t->ptr1,sizeof(long)*t->alloc);
- t->p=realloc(t->p,sizeof(long)*t->alloc);
- t->q=realloc(t->q,sizeof(long)*t->alloc);
+ t->ptr0=_ogg_realloc(t->ptr0,sizeof(long)*t->alloc);
+ t->ptr1=_ogg_realloc(t->ptr1,sizeof(long)*t->alloc);
+ t->p=_ogg_realloc(t->p,sizeof(long)*t->alloc);
+ t->q=_ogg_realloc(t->q,sizeof(long)*t->alloc);
}
t->p[thisaux]=besti;
@@ -378,7 +378,7 @@
memset(b,0,sizeof(codebook));
memset(c,0,sizeof(static_codebook));
b->c=c;
- t=c->nearest_tree=calloc(1,sizeof(encode_aux_nearestmatch));
+ t=c->nearest_tree=_ogg_calloc(1,sizeof(encode_aux_nearestmatch));
c->maptype=2;
/* make sure there are no duplicate entries and that every
@@ -400,7 +400,7 @@
}
{
- v->assigned=calloc(v->entries,sizeof(long));
+ v->assigned=_ogg_calloc(v->entries,sizeof(long));
for(i=0;i<v->points;i++){
float *ppt=_point(v,i);
float firstmetric=_Ndist(v->elements,_now(v,0),ppt);
@@ -436,24 +436,24 @@
fprintf(stderr,"Building a book with %ld unique entries...\n",v->entries);
{
- long *entryindex=malloc(v->entries*sizeof(long *));
- long *pointindex=malloc(v->points*sizeof(long));
- long *membership=malloc(v->points*sizeof(long));
- long *reventry=malloc(v->entries*sizeof(long));
+ long *entryindex=_ogg_malloc(v->entries*sizeof(long *));
+ long *pointindex=_ogg_malloc(v->points*sizeof(long));
+ long *membership=_ogg_malloc(v->points*sizeof(long));
+ long *reventry=_ogg_malloc(v->entries*sizeof(long));
long pointssofar=0;
for(i=0;i<v->entries;i++)entryindex[i]=i;
for(i=0;i<v->points;i++)pointindex[i]=i;
t->alloc=4096;
- t->ptr0=malloc(sizeof(long)*t->alloc);
- t->ptr1=malloc(sizeof(long)*t->alloc);
- t->p=malloc(sizeof(long)*t->alloc);
- t->q=malloc(sizeof(long)*t->alloc);
+ t->ptr0=_ogg_malloc(sizeof(long)*t->alloc);
+ t->ptr1=_ogg_malloc(sizeof(long)*t->alloc);
+ t->p=_ogg_malloc(sizeof(long)*t->alloc);
+ t->q=_ogg_malloc(sizeof(long)*t->alloc);
t->aux=0;
c->dim=v->elements;
c->entries=v->entries;
- c->lengthlist=calloc(c->entries,sizeof(long));
+ c->lengthlist=_ogg_calloc(c->entries,sizeof(long));
b->valuelist=v->entrylist; /* temporary; replaced later */
b->dim=c->dim;
b->entries=c->entries;
@@ -546,7 +546,7 @@
/* run all training points through the decision tree to get a final
probability count */
{
- long *probability=malloc(c->entries*sizeof(long));
+ long *probability=_ogg_malloc(c->entries*sizeof(long));
for(i=0;i<c->entries;i++)probability[i]=1; /* trivial guard */
b->dim=c->dim;
@@ -573,8 +573,8 @@
assignment and packing to do it now) */
{
long *wordlen=c->lengthlist;
- long *index=malloc(c->entries*sizeof(long));
- long *revindex=malloc(c->entries*sizeof(long));
+ long *index=_ogg_malloc(c->entries*sizeof(long));
+ long *revindex=_ogg_malloc(c->entries*sizeof(long));
int k;
for(i=0;i<c->entries;i++)index[i]=i;
isortvals=c->lengthlist;
@@ -594,9 +594,9 @@
free(revindex);
/* map lengthlist and vallist with index */
- c->lengthlist=calloc(c->entries,sizeof(long));
- b->valuelist=malloc(sizeof(float)*c->entries*c->dim);
- c->quantlist=malloc(sizeof(long)*c->entries*c->dim);
+ c->lengthlist=_ogg_calloc(c->entries,sizeof(long));
+ b->valuelist=_ogg_malloc(sizeof(float)*c->entries*c->dim);
+ c->quantlist=_ogg_malloc(sizeof(long)*c->entries*c->dim);
for(i=0;i<c->entries;i++){
long e=index[i];
for(k=0;k<c->dim;k++){
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list