********************************************************************
function: PCM data vector blocking, windowing and dis/reassembly
- last mod: $Id: block.c,v 1.53 2001/12/20 01:00:26 segher Exp $
+ last mod: $Id: block.c,v 1.54 2001/12/21 14:52:35 segher Exp $
Handle windowing, overlap-add, etc of the PCM vectors. This is made
more amusing by Vorbis' current two allowed block sizes.
/* overlap/add PCM */
- switch(v->W){
+ switch((int)v->W){
case 0:
beginSl=0;
endSl=ci->blocksizes[0]/2;
********************************************************************
function: basic codebook pack/unpack/code/decode operations
- last mod: $Id: codebook.c,v 1.34 2001/12/20 01:00:26 segher Exp $
+ last mod: $Id: codebook.c,v 1.35 2001/12/21 14:52:35 segher Exp $
********************************************************************/
if(s->entries==-1)goto _eofout;
/* codeword ordering.... length ordered or unordered? */
- switch(oggpack_read(opb,1)){
+ switch((int)oggpack_read(opb,1)){
case 0:
/* unordered */
s->lengthlist=_ogg_malloc(sizeof(*s->lengthlist)*s->entries);
}
do{
- switch(oggpack_read1(b)){
+ switch((int)oggpack_read1(b)){
case 0:
ptr=t->ptr0[ptr];
break;
if(entry==-1)return(-1);
t = book->valuelist+entry*book->dim;
j=0;
- switch(book->dim){
+ switch((int)book->dim){
case 8:
a[i++]+=t[j++];
case 7:
********************************************************************
function: floor backend 0 implementation
- last mod: $Id: floor0.c,v 1.48 2001/12/20 01:00:26 segher Exp $
+ last mod: $Id: floor0.c,v 1.49 2001/12/21 14:52:35 segher Exp $
********************************************************************/
for(j=0;j<look->n;j++)
codedflr[j]=1.f;
vorbis_lsp_to_curve(codedflr,look->linearmap,look->n,look->ln,
- lspwork,look->m,amp,info->ampdB);
+ lspwork,look->m,amp,(float)info->ampdB);
_analysis_output("barklsp",seq-1,codedflr,look->n,1,1);
_analysis_output("lsp3",seq-1,codedflr,look->n,0,1);
/* take the coefficients back to a spectral envelope curve */
vorbis_lsp_to_curve(out,look->linearmap,look->n,look->ln,
- lsp,look->m,amp,info->ampdB);
+ lsp,look->m,amp,(float)info->ampdB);
return(1);
}
memset(out,0,sizeof(*out)*look->n);
function: normalized modified discrete cosine transform
power of two length transform only [64 <= n ]
- last mod: $Id: mdct.c,v 1.27 2001/12/20 01:00:29 segher Exp $
+ last mod: $Id: mdct.c,v 1.28 2001/12/21 14:52:35 segher Exp $
Original algorithm adapted long ago from _The use of multirate filter
banks for coding of high quality digital audio_, by T. Sporer,
int i;
int n2=n>>1;
- int log2n=lookup->log2n=rint(log(n)/log(2));
+ int log2n=lookup->log2n=rint(log((float)n)/log(2.f));
lookup->n=n;
lookup->trig=T;
lookup->bitrev=bitrev;
********************************************************************
function: psychoacoustics not including preecho
- last mod: $Id: psy.c,v 1.61 2001/12/19 18:06:17 segher Exp $
+ last mod: $Id: psy.c,v 1.62 2001/12/21 14:52:35 segher Exp $
********************************************************************/
int i,j=0;
for(i=0;i<MAX_BARK-1;i++){
- int endpos=rint(fromBARK(i+1)*2*n/crate);
+ int endpos=rint(fromBARK((float)(i+1))*2*n/crate);
float base=ref[i];
if(j<endpos){
float delta=(ref[i+1]-base)/(endpos-j);
p->eighth_octave_lines=gi->eighth_octave_lines;
- p->shiftoc=rint(log(gi->eighth_octave_lines*8)/log(2))-1;
+ p->shiftoc=rint(log(gi->eighth_octave_lines*8.f)/log(2.f))-1;
p->firstoc=toOC(.25f*rate/n)*(1<<(p->shiftoc+1))-gi->eighth_octave_lines;
maxoc=toOC((n*.5f-.25f)*rate/n)*(1<<(p->shiftoc+1))+.5f;
/* set up the lookups for a given blocksize and sample rate */
if(vi->ath)
- set_curve(vi->ath, p->ath,n,rate);
+ set_curve(vi->ath, p->ath,n,(float)rate);
for(i=0;i<n;i++){
float bark=toBARK(rate/(2*n)*i);
********************************************************************
function: residue backend 0, 1 and 2 implementation
- last mod: $Id: res0.c,v 1.42 2001/12/20 01:00:29 segher Exp $
+ last mod: $Id: res0.c,v 1.43 2001/12/21 14:52:36 segher Exp $
********************************************************************/
}
}
- look->partvals=rint(pow(look->parts,dim));
+ look->partvals=rint(pow((float)look->parts,(pow)dim));
look->stages=maxstage;
look->decodemap=_ogg_malloc(look->partvals*sizeof(*look->decodemap));
for(j=0;j<look->partvals;j++){
********************************************************************
function: basic shared codebook operations
- last mod: $Id: sharedbook.c,v 1.21 2001/12/20 01:00:30 segher Exp $
+ last mod: $Id: sharedbook.c,v 1.22 2001/12/21 14:52:36 segher Exp $
********************************************************************/
sign=0x80000000;
val= -val;
}
- exp= floor(log(val)/log(2));
+ exp= floor(log(val)/log(2.f));
mant=rint(ldexp(val,(VQ_FMAN-1)-exp));
exp=(exp+VQ_FEXP_BIAS)<<VQ_FMAN;
that's portable and totally safe against roundoff, but I haven't
thought of it. Therefore, we opt on the side of caution */
long _book_maptype1_quantvals(const static_codebook *b){
- long vals=floor(pow(b->entries,1.f/b->dim));
+ long vals=floor(pow((float)b->entries,1.f/b->dim));
/* the above *should* be reliable, but we'll not assume that FP is
ever reliable when bitstream sync is at stake; verify via integer
********************************************************************
function: simple programmatic interface for encoder mode setup
- last mod: $Id: vorbisenc.c,v 1.29 2001/12/21 08:44:07 xiphmont Exp $
+ last mod: $Id: vorbisenc.c,v 1.30 2001/12/21 14:52:36 segher Exp $
********************************************************************/
long min_bitrate){
double approx_vbr=approx_bitrate_to_vbr(channels,(channels==2),
- nominal_bitrate,rate);
+ (float)nominal_bitrate,rate);
int ret=0;
if(approx_vbr<0)return(OV_EIMPL);