[tremor] MDCT_lookup tables reduced by one third.
timmy brolin
timmy at home.se
Wed Sep 11 02:32:07 PDT 2002
> Monty: I see that you did pretty much the same thing as I did when I removed the global 'step', however, I did two things differently:
> 1: There is no need for "mdct_butterflies" to have a step argument, since step can be easily calculated from init.log2n
> step=1<<(13-init.log2n);
> However, since the functions are marked to be inline, the compiler will
> certainly already have the value of the step variable cached in a register
> so it won't need to recompute it again. This makes up for better code
> generation.
True, true.
> 2: In "mdct_butterfly_generic" step should really be a register, it is
> used all over the place.
> Well inspecting the generated assembly it does remain into a register
> anyway.
> By the way... What are the other four trignometric functions in
> mdct_lookup.h? It's hard to figure them out by just looking att the
> numbers and curves. (sine/cosine was pretty obvious thou..) Some parts of
> the tremor code are far from well commented/documented... :-/
> You should have the libvorbis (the floating point reference code) around.
> Things are more obvious there and you'll easily see where Tremor code comes
> from.
>From mdct.c: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*i+2))*.5);
}
Nicolas
Ok, so I have to constantly crossreference the tremor code with the normal vorbis code and comments?
Sorry, didn't think of that.
Timmy
--- >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 'tremor-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 Tremor
mailing list