search for: float_conv

Displaying 2 results from an estimated 2 matches for "float_conv".

2002 Aug 16
2
Setting up the trig tables.
As some of you know, I'm creating a hardware MDCT core. At the moment I'm working out the best way to create a lookup table for the trig values, as set up in mdct_init: /* trig lookups... */ for(i=0;i<n/4;i++){ T[i*2]=FLOAT_CONV(cos((M_PI/n)*(4*i))); T[i*2+1]=FLOAT_CONV(-sin((M_PI/n)*(4*i))); T[n2+i*2]=FLOAT_CONV(cos((M_PI/(2*n))*(2*i+1))); T[n2+i*2+1]=FLOAT_CONV(sin((M_PI/(2*n))*(2*i+1))); } for(i=0;i<n/8;i++){ T[n+i*2]=FLOAT_CONV(cos((M_PI/n)*(4*i+2))*.5); T[n+i*2+1]=FLOAT_CONV(-sin((M_PI/n)*(4...
2002 Aug 01
2
mdct.h - PI1_8, PI2_8 etc.
In vorbis/lib/mdct.h the following are defined: for integer: #define TRIGBITS 14 #define cPI3_8 6270 #define cPI2_8 11585 #define cPI1_8 15137 #define FLOAT_CONV(x) ((int)((x)*(1<<TRIGBITS)+.5)) for floats: #define cPI3_8 .38268343236508977175F #define cPI2_8 .70710678118654752441F #define cPI1_8 .92387953251128675613F #define FLOAT_CONV(x) = x Could someone explain where these values come from? What's the significance of TRIGBITS? It seems tha...