Cog/ThirdParty/mpg123/include/libmpg123/init_costabs.h
Christopher Snowhill 32a595222d [OpenMPT / vgmstream] Made libraries pre-built
Made the OpenMPT / legacy OpenMPT and mpg123 libraries pre-built.
Changed the OpenMPT and vgmstream plugins to import the libraries as
they are now. Made mpg123 embedded and imported by the main binary,
since it's now shared by two plugins.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-24 17:09:02 -07:00

24 lines
663 B
C

/*
The function to compute the cos tables at runtime or for pregeneration.
copyright ?-2021 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Michael Hipp (in tabinit.c).
The type clreal is either double or float, COS() is cos() or cosf() for runtime.
*/
void init_costabs(void)
{
clreal *cpnts[] = { cos64,cos32,cos16,cos8,cos4 };
int i,k,kr,divv;
clreal *costab;
for(i=0;i<5;i++)
{
kr=0x10>>i; divv=0x40>>i;
costab = cpnts[i];
for(k=0;k<kr;k++)
costab[k] = 1.0 / (2.0 * COS(M_PI * ((clreal) k * 2.0 + 1.0) / (clreal) divv));
}
}