44 #include "../vorbis/codec.h"
58 int log2n=lookup->
log2n=rint(log((
float)n)/log(2.
f));
79 int mask=(1<<(log2n-1))-1,
i,
j;
84 if((msb>>j)&
i)acc|=1<<j;
85 bitrev[i*2]=((~acc)&mask)-1;
180 x[8] =
MULT_NORM( r0 * cPI3_8 - r1 * cPI1_8 );
181 x[9] =
MULT_NORM( r1 * cPI3_8 + r0 * cPI1_8 );
194 x[4] =
MULT_NORM( r1 * cPI1_8 + r0 * cPI3_8 );
195 x[5] =
MULT_NORM( r1 * cPI3_8 - r0 * cPI1_8 );
208 x[0] =
MULT_NORM( r1 * cPI3_8 + r0 * cPI1_8 );
209 x[1] =
MULT_NORM( r1 * cPI1_8 - r0 * cPI3_8 );
232 x2[6] =
MULT_NORM(r1 * T[1] + r0 * T[0]);
233 x2[7] =
MULT_NORM(r1 * T[0] - r0 * T[1]);
239 x2[4] =
MULT_NORM(r1 * T[5] + r0 * T[4]);
240 x2[5] =
MULT_NORM(r1 * T[4] - r0 * T[5]);
246 x2[2] =
MULT_NORM(r1 * T[9] + r0 * T[8]);
247 x2[3] =
MULT_NORM(r1 * T[8] - r0 * T[9]);
253 x2[0] =
MULT_NORM(r1 * T[13] + r0 * T[12]);
254 x2[1] =
MULT_NORM(r1 * T[12] - r0 * T[13]);
280 x2[6] =
MULT_NORM(r1 * T[1] + r0 * T[0]);
281 x2[7] =
MULT_NORM(r1 * T[0] - r0 * T[1]);
289 x2[4] =
MULT_NORM(r1 * T[1] + r0 * T[0]);
290 x2[5] =
MULT_NORM(r1 * T[0] - r0 * T[1]);
298 x2[2] =
MULT_NORM(r1 * T[1] + r0 * T[0]);
299 x2[3] =
MULT_NORM(r1 * T[0] - r0 * T[1]);
307 x2[0] =
MULT_NORM(r1 * T[1] + r0 * T[0]);
308 x2[1] =
MULT_NORM(r1 * T[0] - r0 * T[1]);
322 int stages=init->
log2n-5;
329 for(i=1;--stages>0;i++){
330 for(j=0;j<(1<<
i);j++)
343 memset(l,0,
sizeof(*l));
366 r0 =
HALVE(x0[1] + x1[1]);
367 r1 =
HALVE(x0[0] - x1[0]);
382 r0 =
HALVE(x0[1] + x1[1]);
383 r1 =
HALVE(x0[0] - x1[0]);
410 oX[0] =
MULT_NORM(-iX[2] * T[3] - iX[0] * T[2]);
411 oX[1] =
MULT_NORM (iX[0] * T[3] - iX[2] * T[2]);
412 oX[2] =
MULT_NORM(-iX[6] * T[1] - iX[4] * T[0]);
413 oX[3] =
MULT_NORM (iX[4] * T[1] - iX[6] * T[0]);
424 oX[0] =
MULT_NORM (iX[4] * T[3] + iX[6] * T[2]);
425 oX[1] =
MULT_NORM (iX[4] * T[2] - iX[6] * T[3]);
426 oX[2] =
MULT_NORM (iX[0] * T[1] + iX[2] * T[0]);
427 oX[3] =
MULT_NORM (iX[0] * T[0] - iX[2] * T[1]);
446 oX1[3] =
MULT_NORM (iX[0] * T[1] - iX[1] * T[0]);
447 oX2[0] = -
MULT_NORM (iX[0] * T[0] + iX[1] * T[1]);
449 oX1[2] =
MULT_NORM (iX[2] * T[3] - iX[3] * T[2]);
450 oX2[1] = -
MULT_NORM (iX[2] * T[2] + iX[3] * T[3]);
452 oX1[1] =
MULT_NORM (iX[4] * T[5] - iX[5] * T[4]);
453 oX2[2] = -
MULT_NORM (iX[4] * T[4] + iX[5] * T[5]);
455 oX1[0] =
MULT_NORM (iX[6] * T[7] - iX[7] * T[6]);
456 oX2[3] = -
MULT_NORM (iX[6] * T[6] + iX[7] * T[7]);
471 oX2[0] = -(oX1[3] = iX[3]);
472 oX2[1] = -(oX1[2] = iX[2]);
473 oX2[2] = -(oX1[1] = iX[1]);
474 oX2[3] = -(oX1[0] = iX[0]);
GLsizei const GLfloat * points
void mdct_init(mdct_lookup *lookup, int n)
void mdct_forward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out)
STIN void mdct_butterflies(mdct_lookup *init, DATA_TYPE *x, int points)
void mdct_backward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out)
STIN void mdct_butterfly_16(DATA_TYPE *x)
GLubyte GLubyte GLubyte GLubyte w
STIN void mdct_butterfly_32(DATA_TYPE *x)
STIN void mdct_butterfly_first(DATA_TYPE *T, DATA_TYPE *x, int points)
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint GLdouble GLdouble w2
STIN void mdct_bitreverse(mdct_lookup *init, DATA_TYPE *x)
void mdct_clear(mdct_lookup *l)
STIN void mdct_butterfly_generic(DATA_TYPE *T, DATA_TYPE *x, int points, int trigint)
STIN void mdct_butterfly_8(DATA_TYPE *x)
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint GLdouble w1