mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-23 22:25:41 +00:00
197 lines
13 KiB
C
197 lines
13 KiB
C
/**
|
|
** Supermodel
|
|
** A Sega Model 3 Arcade Emulator.
|
|
** Copyright 2011 Bart Trzynadlowski, Nik Henson
|
|
**
|
|
** This file is part of Supermodel.
|
|
**
|
|
** Supermodel is free software: you can redistribute it and/or modify it under
|
|
** the terms of the GNU General Public License as published by the Free
|
|
** Software Foundation, either version 3 of the License, or (at your option)
|
|
** any later version.
|
|
**
|
|
** Supermodel is distributed in the hope that it will be useful, but WITHOUT
|
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
** more details.
|
|
**
|
|
** You should have received a copy of the GNU General Public License along
|
|
** with Supermodel. If not, see <http://www.gnu.org/licenses/>.
|
|
**/
|
|
|
|
/*
|
|
* transform.h
|
|
*
|
|
* Amp library internal header file.
|
|
*/
|
|
|
|
|
|
/* this file is a part of amp software, (C) tomislav uzelac 1996,1997
|
|
*/
|
|
|
|
/* transform.h tables galore
|
|
*
|
|
* Created by: tomislav uzelac May 1996
|
|
* Last modified by: tomislav uzelac Mar 1 97
|
|
*/
|
|
extern void imdct_init();
|
|
extern void imdct(int win_type,int sb,int ch);
|
|
extern void poly(int ch,int i);
|
|
extern void premultiply();
|
|
|
|
extern short sample_buffer[18][32][2];
|
|
extern float res[32][18];
|
|
extern float s[2][32][18];
|
|
|
|
#ifdef TRANSFORM
|
|
|
|
void imdct_init();
|
|
void imdct(int win_type,int sb,int ch);
|
|
void poly(int ch,int i);
|
|
void premultiply();
|
|
|
|
short sample_buffer[18][32][2];
|
|
float s[2][32][18];
|
|
float res[32][18];
|
|
float win[4][36];
|
|
|
|
static const float t_sin[4][36]={{
|
|
-0.032160f, 0.103553f, -0.182543f, 0.266729f, -0.353554f, 0.440377f,
|
|
-0.524563f, 0.603553f, -0.674947f, 0.736575f, -0.786566f, 0.823400f,
|
|
-0.845957f, 0.853554f, -0.845957f, 0.823399f, -0.786566f, 0.736575f,
|
|
-0.674947f, 0.603553f, -0.524564f, 0.440378f, -0.353553f, 0.266729f,
|
|
-0.182544f, 0.103553f, -0.032160f, -0.029469f, 0.079459f, -0.116293f,
|
|
0.138851f, -0.146446f, 0.138851f, -0.116293f, 0.079459f, -0.029469f
|
|
},{
|
|
-0.032160f, 0.103553f, -0.182543f, 0.266729f, -0.353554f, 0.440377f,
|
|
-0.524563f, 0.603553f, -0.674947f, 0.736575f, -0.786566f, 0.823400f,
|
|
-0.845957f, 0.853554f, -0.845957f, 0.823399f, -0.786566f, 0.736575f,
|
|
-0.675590f, 0.608761f, -0.537300f, 0.461749f, -0.382683f, 0.300706f,
|
|
-0.214588f, 0.120590f, -0.034606f, -0.026554f, 0.049950f, -0.028251f,
|
|
0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f
|
|
},{
|
|
-0.103553f, 0.353554f, -0.603553f, 0.786566f, -0.853554f, 0.786566f,
|
|
-0.603553f, 0.353553f, -0.103553f, -0.079459f, 0.146446f, -0.079459f,
|
|
0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
|
|
0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
|
|
0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
|
|
0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f
|
|
},{
|
|
0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f,
|
|
-0.127432f, 0.379410f, -0.608182f, 0.792598f, -0.915976f, 0.967944f,
|
|
-0.953717f, 0.923880f, -0.887011f, 0.843391f, -0.793353f, 0.737277f,
|
|
-0.674947f, 0.603553f, -0.524564f, 0.440378f, -0.353553f, 0.266729f,
|
|
-0.182544f, 0.103553f, -0.032160f, -0.029469f, 0.079459f, -0.116293f,
|
|
0.138851f, -0.146446f, 0.138851f, -0.116293f, 0.079459f, -0.029469f
|
|
}};
|
|
|
|
static const float t_2cos[4][18]={
|
|
{ -0.174311f, -0.517638f, -0.845237f, -1.147153f, -1.414214f, -1.638304f, -1.812616f, -1.931852f, -1.992389f,
|
|
0.174311f, 0.517638f, 0.845237f, 1.147153f, 1.414214f, 1.638304f, 1.812616f, 1.931852f, 1.992389f},
|
|
{ -0.174311f, -0.517638f, -0.845237f, -1.147153f, -1.414214f, -1.638304f, -1.812616f, -1.931852f, -1.992389f,
|
|
0.174311f, 0.517638f, 0.845237f, 1.147153f, 1.414214f, 1.638304f, 1.812616f, 1.931852f, 1.992389f},
|
|
{ -0.517638f, -1.41421f, -1.93185f, 0.517638f, 1.41421f, 1.93185f,0,0,0,0,0,0,0,0,0,0,0,0},
|
|
{ -0.174311f, -0.517638f, -0.845237f, -1.147153f, -1.414214f, -1.638304f, -1.812616f, -1.931852f, -1.992389f,
|
|
0.174311f, 0.517638f, 0.845237f, 1.147153f, 1.414214f, 1.638304f, 1.812616f, 1.931852f, 1.992389f}
|
|
};
|
|
|
|
static const float b1 = 1.997590912f; static const float b2 = 1.990369453f; static const float b3 = 1.978353019f;
|
|
static const float b4 = 1.961570560f; static const float b5 = 1.940062506f; static const float b6 = 1.913880671f;
|
|
static const float b7 = 1.883088130f; static const float b8 = 1.847759065f; static const float b9 = 1.807978586f;
|
|
static const float b10= 1.763842529f; static const float b11= 1.715457220f; static const float b12= 1.662939225f;
|
|
static const float b13= 1.606415063f; static const float b14= 1.546020907f; static const float b15= 1.481902251f;
|
|
static const float b16= 1.414213562f; static const float b17= 1.343117910f; static const float b18= 1.268786568f;
|
|
static const float b19= 1.191398609f; static const float b20= 1.111140466f; static const float b21= 1.028205488f;
|
|
static const float b22= 0.942793474f; static const float b23= 0.855110187f; static const float b24= 0.765366865f;
|
|
static const float b25= 0.673779707f; static const float b26= 0.580569355f; static const float b27= 0.485960360f;
|
|
static const float b28= 0.390180644f; static const float b29= 0.293460949f; static const float b30= 0.196034281f;
|
|
static const float b31= 0.098135349f;
|
|
|
|
static float t_dewindow[17][32] = {{
|
|
0.000000000f,-0.000442505f, 0.003250122f,-0.007003784f, 0.031082153f,-0.078628540f, 0.100311279f,-0.572036743f,
|
|
1.144989014f, 0.572036743f, 0.100311279f, 0.078628540f, 0.031082153f, 0.007003784f, 0.003250122f, 0.000442505f,
|
|
0.000000000f,-0.000442505f, 0.003250122f,-0.007003784f, 0.031082153f,-0.078628540f, 0.100311279f,-0.572036743f,
|
|
1.144989014f, 0.572036743f, 0.100311279f, 0.078628540f, 0.031082153f, 0.007003784f, 0.003250122f, 0.000442505f,
|
|
},{
|
|
-0.000015259f,-0.000473022f, 0.003326416f,-0.007919312f, 0.030517578f,-0.084182739f, 0.090927124f,-0.600219727f,
|
|
1.144287109f, 0.543823242f, 0.108856201f, 0.073059082f, 0.031478882f, 0.006118774f, 0.003173828f, 0.000396729f,
|
|
-0.000015259f,-0.000473022f, 0.003326416f,-0.007919312f, 0.030517578f,-0.084182739f, 0.090927124f,-0.600219727f,
|
|
1.144287109f, 0.543823242f, 0.108856201f, 0.073059082f, 0.031478882f, 0.006118774f, 0.003173828f, 0.000396729f,
|
|
},{
|
|
-0.000015259f,-0.000534058f, 0.003387451f,-0.008865356f, 0.029785156f,-0.089706421f, 0.080688477f,-0.628295898f,
|
|
1.142211914f, 0.515609741f, 0.116577148f, 0.067520142f, 0.031738281f, 0.005294800f, 0.003082275f, 0.000366211f,
|
|
-0.000015259f,-0.000534058f, 0.003387451f,-0.008865356f, 0.029785156f,-0.089706421f, 0.080688477f,-0.628295898f,
|
|
1.142211914f, 0.515609741f, 0.116577148f, 0.067520142f, 0.031738281f, 0.005294800f, 0.003082275f, 0.000366211f,
|
|
},{
|
|
-0.000015259f,-0.000579834f, 0.003433228f,-0.009841919f, 0.028884888f,-0.095169067f, 0.069595337f,-0.656219482f,
|
|
1.138763428f, 0.487472534f, 0.123474121f, 0.061996460f, 0.031845093f, 0.004486084f, 0.002990723f, 0.000320435f,
|
|
-0.000015259f,-0.000579834f, 0.003433228f,-0.009841919f, 0.028884888f,-0.095169067f, 0.069595337f,-0.656219482f,
|
|
1.138763428f, 0.487472534f, 0.123474121f, 0.061996460f, 0.031845093f, 0.004486084f, 0.002990723f, 0.000320435f,
|
|
},{
|
|
-0.000015259f,-0.000625610f, 0.003463745f,-0.010848999f, 0.027801514f,-0.100540161f, 0.057617187f,-0.683914185f,
|
|
1.133926392f, 0.459472656f, 0.129577637f, 0.056533813f, 0.031814575f, 0.003723145f, 0.002899170f, 0.000289917f,
|
|
-0.000015259f,-0.000625610f, 0.003463745f,-0.010848999f, 0.027801514f,-0.100540161f, 0.057617187f,-0.683914185f,
|
|
1.133926392f, 0.459472656f, 0.129577637f, 0.056533813f, 0.031814575f, 0.003723145f, 0.002899170f, 0.000289917f,
|
|
},{
|
|
-0.000015259f,-0.000686646f, 0.003479004f,-0.011886597f, 0.026535034f,-0.105819702f, 0.044784546f,-0.711318970f,
|
|
1.127746582f, 0.431655884f, 0.134887695f, 0.051132202f, 0.031661987f, 0.003005981f, 0.002792358f, 0.000259399f,
|
|
-0.000015259f,-0.000686646f, 0.003479004f,-0.011886597f, 0.026535034f,-0.105819702f, 0.044784546f,-0.711318970f,
|
|
1.127746582f, 0.431655884f, 0.134887695f, 0.051132202f, 0.031661987f, 0.003005981f, 0.002792358f, 0.000259399f,
|
|
},{
|
|
-0.000015259f,-0.000747681f, 0.003479004f,-0.012939453f, 0.025085449f,-0.110946655f, 0.031082153f,-0.738372803f,
|
|
1.120223999f, 0.404083252f, 0.139450073f, 0.045837402f, 0.031387329f, 0.002334595f, 0.002685547f, 0.000244141f,
|
|
-0.000015259f,-0.000747681f, 0.003479004f,-0.012939453f, 0.025085449f,-0.110946655f, 0.031082153f,-0.738372803f,
|
|
1.120223999f, 0.404083252f, 0.139450073f, 0.045837402f, 0.031387329f, 0.002334595f, 0.002685547f, 0.000244141f,
|
|
},{
|
|
-0.000030518f,-0.000808716f, 0.003463745f,-0.014022827f, 0.023422241f,-0.115921021f, 0.016510010f,-0.765029907f,
|
|
1.111373901f, 0.376800537f, 0.143264771f, 0.040634155f, 0.031005859f, 0.001693726f, 0.002578735f, 0.000213623f,
|
|
-0.000030518f,-0.000808716f, 0.003463745f,-0.014022827f, 0.023422241f,-0.115921021f, 0.016510010f,-0.765029907f,
|
|
1.111373901f, 0.376800537f, 0.143264771f, 0.040634155f, 0.031005859f, 0.001693726f, 0.002578735f, 0.000213623f,
|
|
},{
|
|
-0.000030518f,-0.000885010f, 0.003417969f,-0.015121460f, 0.021575928f,-0.120697021f, 0.001068115f,-0.791213989f,
|
|
1.101211548f, 0.349868774f, 0.146362305f, 0.035552979f, 0.030532837f, 0.001098633f, 0.002456665f, 0.000198364f,
|
|
-0.000030518f,-0.000885010f, 0.003417969f,-0.015121460f, 0.021575928f,-0.120697021f, 0.001068115f,-0.791213989f,
|
|
1.101211548f, 0.349868774f, 0.146362305f, 0.035552979f, 0.030532837f, 0.001098633f, 0.002456665f, 0.000198364f,
|
|
},{
|
|
-0.000030518f,-0.000961304f, 0.003372192f,-0.016235352f, 0.019531250f,-0.125259399f,-0.015228271f,-0.816864014f,
|
|
1.089782715f, 0.323318481f, 0.148773193f, 0.030609131f, 0.029937744f, 0.000549316f, 0.002349854f, 0.000167847f,
|
|
-0.000030518f,-0.000961304f, 0.003372192f,-0.016235352f, 0.019531250f,-0.125259399f,-0.015228271f,-0.816864014f,
|
|
1.089782715f, 0.323318481f, 0.148773193f, 0.030609131f, 0.029937744f, 0.000549316f, 0.002349854f, 0.000167847f,
|
|
},{
|
|
-0.000030518f,-0.001037598f, 0.003280640f,-0.017349243f, 0.017257690f,-0.129562378f,-0.032379150f,-0.841949463f,
|
|
1.077117920f, 0.297210693f, 0.150497437f, 0.025817871f, 0.029281616f, 0.000030518f, 0.002243042f, 0.000152588f,
|
|
-0.000030518f,-0.001037598f, 0.003280640f,-0.017349243f, 0.017257690f,-0.129562378f,-0.032379150f,-0.841949463f,
|
|
1.077117920f, 0.297210693f, 0.150497437f, 0.025817871f, 0.029281616f, 0.000030518f, 0.002243042f, 0.000152588f,
|
|
},{
|
|
-0.000045776f,-0.001113892f, 0.003173828f,-0.018463135f, 0.014801025f,-0.133590698f,-0.050354004f,-0.866363525f,
|
|
1.063217163f, 0.271591187f, 0.151596069f, 0.021179199f, 0.028533936f,-0.000442505f, 0.002120972f, 0.000137329f,
|
|
-0.000045776f,-0.001113892f, 0.003173828f,-0.018463135f, 0.014801025f,-0.133590698f,-0.050354004f,-0.866363525f,
|
|
1.063217163f, 0.271591187f, 0.151596069f, 0.021179199f, 0.028533936f,-0.000442505f, 0.002120972f, 0.000137329f,
|
|
},{
|
|
-0.000045776f,-0.001205444f, 0.003051758f,-0.019577026f, 0.012115479f,-0.137298584f,-0.069168091f,-0.890090942f,
|
|
1.048156738f, 0.246505737f, 0.152069092f, 0.016708374f, 0.027725220f,-0.000869751f, 0.002014160f, 0.000122070f,
|
|
-0.000045776f,-0.001205444f, 0.003051758f,-0.019577026f, 0.012115479f,-0.137298584f,-0.069168091f,-0.890090942f,
|
|
1.048156738f, 0.246505737f, 0.152069092f, 0.016708374f, 0.027725220f,-0.000869751f, 0.002014160f, 0.000122070f,
|
|
},{
|
|
-0.000061035f,-0.001296997f, 0.002883911f,-0.020690918f, 0.009231567f,-0.140670776f,-0.088775635f,-0.913055420f,
|
|
1.031936646f, 0.221984863f, 0.151962280f, 0.012420654f, 0.026840210f,-0.001266479f, 0.001907349f, 0.000106812f,
|
|
-0.000061035f,-0.001296997f, 0.002883911f,-0.020690918f, 0.009231567f,-0.140670776f,-0.088775635f,-0.913055420f,
|
|
1.031936646f, 0.221984863f, 0.151962280f, 0.012420654f, 0.026840210f,-0.001266479f, 0.001907349f, 0.000106812f,
|
|
},{
|
|
-0.000061035f,-0.001388550f, 0.002700806f,-0.021789551f, 0.006134033f,-0.143676758f,-0.109161377f,-0.935195923f,
|
|
1.014617920f, 0.198059082f, 0.151306152f, 0.008316040f, 0.025909424f,-0.001617432f, 0.001785278f, 0.000106812f,
|
|
-0.000061035f,-0.001388550f, 0.002700806f,-0.021789551f, 0.006134033f,-0.143676758f,-0.109161377f,-0.935195923f,
|
|
1.014617920f, 0.198059082f, 0.151306152f, 0.008316040f, 0.025909424f,-0.001617432f, 0.001785278f, 0.000106812f,
|
|
},{
|
|
-0.000076294f,-0.001480103f, 0.002487183f,-0.022857666f, 0.002822876f,-0.146255493f,-0.130310059f,-0.956481934f,
|
|
0.996246338f, 0.174789429f, 0.150115967f, 0.004394531f, 0.024932861f,-0.001937866f, 0.001693726f, 0.000091553f,
|
|
-0.000076294f,-0.001480103f, 0.002487183f,-0.022857666f, 0.002822876f,-0.146255493f,-0.130310059f,-0.956481934f,
|
|
0.996246338f, 0.174789429f, 0.150115967f, 0.004394531f, 0.024932861f,-0.001937866f, 0.001693726f, 0.000091553f,
|
|
},{
|
|
-0.000076294f,-0.001586914f, 0.002227783f,-0.023910522f,-0.000686646f,-0.148422241f,-0.152206421f,-0.976852417f,
|
|
0.976852417f, 0.152206421f, 0.148422241f, 0.000686646f, 0.023910522f,-0.002227783f, 0.001586914f, 0.000076294f,
|
|
-0.000076294f,-0.001586914f, 0.002227783f,-0.023910522f,-0.000686646f,-0.148422241f,-0.152206421f,-0.976852417f,
|
|
0.976852417f, 0.152206421f, 0.148422241f, 0.000686646f, 0.023910522f,-0.002227783f, 0.001586914f, 0.000076294f,
|
|
} };
|
|
#endif /* TRANSFORM */
|