From 0db5c0da94afb8e13a8badb0a78809714c3b3ff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Jos=C3=A9=20Garc=C3=ADa=20Garc=C3=ADa?= Date: Sun, 30 Aug 2015 01:05:37 +0200 Subject: [PATCH] arm-vita-eabi-gcc complains about int / ogg_int32_t --- core/tremor/sharedbook.c | 67 ++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/core/tremor/sharedbook.c b/core/tremor/sharedbook.c index 8e07492..3fd379d 100644 --- a/core/tremor/sharedbook.c +++ b/core/tremor/sharedbook.c @@ -34,7 +34,7 @@ int _ilog(unsigned int v){ } /* 32 bit float (not IEEE; nonnormalized mantissa + - biased exponent) : neeeeeee eeemmmmm mmmmmmmm mmmmmmmm + biased exponent) : neeeeeee eeemmmmm mmmmmmmm mmmmmmmm Why not IEEE? It's just not that important here. */ #define VQ_FEXP 10 @@ -77,12 +77,12 @@ ogg_uint32_t *_make_words(long *l,long n,long sparsecount){ long length=l[i]; if(length>0){ ogg_uint32_t entry=marker[length]; - + /* when we claim a node for an entry, we also claim the nodes below it (pruning off the imagined tree that may have dangled from it) as well as blocking the use of any nodes directly above for leaves */ - + /* update ourself */ if(length<32 && (entry>>length)){ /* error condition; the lengths must specify an overpopulated tree */ @@ -90,12 +90,12 @@ ogg_uint32_t *_make_words(long *l,long n,long sparsecount){ return(NULL); } r[count++]=entry; - + /* Look to see if the next shorter marker points to the node above. if so, update it and repeat. */ { for(j=length;j>0;j--){ - + if(marker[j]&1){ /* have to jump branches */ if(j==1) @@ -108,7 +108,7 @@ ogg_uint32_t *_make_words(long *l,long n,long sparsecount){ marker[j]++; } } - + /* prune the tree; the implicit invariant says all the longer markers were dangling from our just-taken node. Dangle them from our *new* node. */ @@ -121,7 +121,7 @@ ogg_uint32_t *_make_words(long *l,long n,long sparsecount){ }else if(sparsecount==0)count++; } - + /* bitreverse the words because our bitwise packer/unpacker is LSb endian */ for(i=0,count=0;idim;k++){ int index= (j/indexdiv)%quantvals; - int point=0; + ogg_int32_t point=0; int val=VFLOAT_MULTI(delta,delpoint, abs(b->quantlist[index]),&point); val=VFLOAT_ADD(mindel,minpoint,val,point,&point); val=VFLOAT_ADD(last,lastpoint,val,point,&point); - + if(b->q_sequencep){ - last=val; + last=val; lastpoint=point; } - + if(sparsemap){ r[sparsemap[count]*b->dim+k]=val; rp[sparsemap[count]*b->dim+k]=point; @@ -244,15 +244,15 @@ ogg_int32_t *_book_unquantize(const static_codebook *b,int n,int *sparsemap, int lastpoint=0; for(k=0;kdim;k++){ - int point=0; + ogg_int32_t point=0; int val=VFLOAT_MULTI(delta,delpoint, abs(b->quantlist[j*b->dim+k]),&point); val=VFLOAT_ADD(mindel,minpoint,val,point,&point); val=VFLOAT_ADD(last,lastpoint,val,point,&point); - + if(b->q_sequencep){ - last=val; + last=val; lastpoint=point; } @@ -274,7 +274,7 @@ ogg_int32_t *_book_unquantize(const static_codebook *b,int n,int *sparsemap, for(j=0;jdim;j++) if(rp[j]<*maxpoint) r[j]>>=*maxpoint-rp[j]; - + _ogg_free(rp); return(r); } @@ -324,7 +324,7 @@ int vorbis_book_init_decode(codebook *c,const static_codebook *s){ int i,j,n=0,tabn; int *sortindex; memset(c,0,sizeof(*c)); - + /* count actually used entries */ for(i=0;ientries;i++) if(s->lengthlist[i]>0) @@ -335,20 +335,20 @@ int vorbis_book_init_decode(codebook *c,const static_codebook *s){ c->dim=s->dim; if(n>0){ - /* two different remappings go on here. - + /* two different remappings go on here. + First, we collapse the likely sparse codebook down only to actually represented values/words. This collapsing needs to be indexed as map-valueless books are used to encode original entry positions as integers. - + Second, we reorder all vectors, including the entry index above, by sorted bitreversed codeword to allow treeless decode. */ - + /* perform sort */ ogg_uint32_t *codes=_make_words(s->lengthlist,s->entries,c->used_entries); ogg_uint32_t **codep=(ogg_uint32_t **)alloca(sizeof(*codep)*n); - + if(codes==NULL)goto err_out; for(i=0;icodelist[sortindex[i]]=codes[i]; _ogg_free(codes); - - - + + + c->valuelist=_book_unquantize(s,n,sortindex,&c->binarypoint); c->dec_index=(int *)_ogg_malloc(n*sizeof(*c->dec_index)); - + for(n=0,i=0;ientries;i++) if(s->lengthlist[i]>0) c->dec_index[sortindex[n++]]=i; - + c->dec_codelengths=(char *)_ogg_malloc(n*sizeof(*c->dec_codelengths)); for(n=0,i=0;ientries;i++) if(s->lengthlist[i]>0) c->dec_codelengths[sortindex[n++]]=s->lengthlist[i]; - + c->dec_firsttablen=_ilog(c->used_entries)-4; /* this is magic */ if(c->dec_firsttablen<5)c->dec_firsttablen=5; if(c->dec_firsttablen>8)c->dec_firsttablen=8; - + tabn=1<dec_firsttablen; c->dec_firsttable=(ogg_uint32_t *)_ogg_calloc(tabn,sizeof(*c->dec_firsttable)); c->dec_maxlength=0; - + for(i=0;idec_maxlengthdec_codelengths[i]) c->dec_maxlength=c->dec_codelengths[i]; @@ -401,26 +401,26 @@ int vorbis_book_init_decode(codebook *c,const static_codebook *s){ c->dec_firsttable[orig|(j<dec_codelengths[i])]=i+1; } } - + /* now fill in 'unused' entries in the firsttable with hi/lo search hints for the non-direct-hits */ { ogg_uint32_t mask=0xfffffffeUL<<(31-c->dec_firsttablen); long lo=0,hi=0; - + for(i=0;idec_firsttablen); if(c->dec_firsttable[bitreverse(word)]==0){ while((lo+1)codelist[lo+1]<=word)lo++; while( hi=(c->codelist[hi]&mask))hi++; - + /* we only actually have 15 bits per hint to play with here. In order to overflow gracefully (nothing breaks, efficiency just drops), encode as the difference from the extremes. */ { unsigned long loval=lo; unsigned long hival=n-hi; - + if(loval>0x7fff)loval=0x7fff; if(hival>0x7fff)hival=0x7fff; c->dec_firsttable[bitreverse(word)]= @@ -436,4 +436,3 @@ int vorbis_book_init_decode(codebook *c,const static_codebook *s){ vorbis_book_clear(c); return(-1); } -