-
Notifications
You must be signed in to change notification settings - Fork 17
/
SckSoundTables.h
27 lines (21 loc) · 11.7 KB
/
SckSoundTables.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef ALIGN4
#define ALIGN4 __attribute__ ((aligned (4))) ///< align to 4 bytes
#endif
const uint16_t hannWindow[512] = {
0,1,4,11,19,30,44,60,79,100,123,149,178,208,242,277,316,356,399,445,492,543,595,650,708,767,830,894,961,1030,1102,1175,1251,1330,1410,1493,1579,1666,1756,1847,1941,2038,2136,2237,2339,2444,2551,2660,2771,2884,2999,3117,3236,3357,3480,3605,3732,3861,3992,4125,4259,4396,4534,4674,4816,4959,5105,5252,5400,5551,5703,5856,6011,6168,6326,6486,6647,6810,6974,7140,7307,7475,7645,7816,7989,8162,8337,8513,8690,8869,9048,9229,9411,9594,9778,9962,10148,10335,10523,10711,10901,11091,11282,11474,11666,11860,12054,12248,12443,12639,12836,13033,13230,13428,13626,13825,14024,14224,14424,14624,14824,15025,15226,15427,15628,15829,16030,16232,16433,16635,16836,17038,17239,17440,17641,17842,18042,18242,18442,18642,18841,19040,19239,19437,19635,19832,20029,20225,20420,20615,20810,21003,21196,21388,21580,21770,21960,22149,22337,22525,22711,22896,23080,23264,23446,23627,23807,23986,24164,24341,24517,24691,24864,25035,25206,25375,25543,25709,25874,26037,26199,26360,26519,26677,26832,26987,27140,27291,27440,27588,27734,27879,28021,28162,28301,28439,28574,28708,28839,28969,29097,29223,29348,29470,29590,29708,29824,29939,30051,30161,30269,30375,30478,30580,30679,30777,30872,30965,31056,31144,31230,31314,31396,31476,31553,31628,31700,31771,31839,31904,31968,32029,32087,32144,32197,32249,32298,32344,32389,32430,32470,32507,32541,32573,32603,32630,32655,32677,32697,32714,32729,32741,32751,32759,32764,32766,32766,32764,32759,32751,32741,32729,32714,32697,32677,32655,32630,32603,32573,32541,32507,32470,32430,32389,32344,32298,32249,32197,32144,32087,32029,31968,31904,31839,31771,31700,31628,31553,31476,31396,31314,31230,31144,31056,30965,30872,30777,30679,30580,30478,30375,30269,30161,30051,29939,29824,29708,29590,29470,29348,29223,29097,28969,28839,28708,28574,28439,28301,28162,28021,27879,27734,27588,27440,27291,27140,26987,26832,26677,26519,26360,26199,26037,25874,25709,25543,25375,25206,25035,24864,24691,24517,24341,24164,23986,23807,23627,23446,23264,23080,22896,22711,22525,22337,22149,21960,21770,21580,21388,21196,21003,20810,20615,20420,20225,20029,19832,19635,19437,19239,19040,18841,18642,18442,18242,18042,17842,17641,17440,17239,17038,16836,16635,16433,16232,16030,15829,15628,15427,15226,15025,14824,14624,14424,14224,14024,13825,13626,13428,13230,13033,12836,12639,12443,12248,12054,11860,11666,11474,11282,11091,10901,10711,10523,10335,10148,9962,9778,9594,9411,9229,9048,8869,8690,8513,8337,8162,7989,7816,7645,7475,7307,7140,6974,6810,6647,6486,6326,6168,6011,5856,5703,5551,5400,5252,5105,4959,4816,4674,4534,4396,4259,4125,3992,3861,3732,3605,3480,3357,3236,3117,2999,2884,2771,2660,2551,2444,2339,2237,2136,2038,1941,1847,1756,1666,1579,1493,1410,1330,1251,1175,1102,1030,961,894,830,767,708,650,595,543,492,445,399,356,316,277,242,208,178,149,123,100,79,60,44,30,19,11,4,1,0
};
const uint16_t armBitRevTable8[128] = {
0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0,0x8,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8,0x4,0x84,0x44,0xC4,0x24,0xA4,0x64,0xE4,0x14,0x94,0x54,0xD4,0x34,0xB4,0x74,0xF4,0xC,0x8C,0x4C,0xCC,0x2C,0xAC,0x6C,0xEC,0x1C,0x9C,0x5C,0xDC,0x3C,0xBC,0x7C,0xFC,0x2,0x82,0x42,0xC2,0x22,0xA2,0x62,0xE2,0x12,0x92,0x52,0xD2,0x32,0xB2,0x72,0xF2,0xA,0x8A,0x4A,0xCA,0x2A,0xAA,0x6A,0xEA,0x1A,0x9A,0x5A,0xDA,0x3A,0xBA,0x7A,0xFA,0x6,0x86,0x46,0xC6,0x26,0xA6,0x66,0xE6,0x16,0x96,0x56,0xD6,0x36,0xB6,0x76,0xF6,0xE,0x8E,0x4E,0xCE,0x2E,0xAE,0x6E,0xEE,0x1E,0x9E,0x5E,0xDE,0x3E,0xBE,0x7E,0xFE,0x1
};
const int16_t ALIGN4 twiddleCoefQ15_512[512] = {
32767,0,32766,402,32758,804,32746,1206,32729,1608,32706,2009,32679,2411,32647,2811,32610,3212,32568,3612,32522,4011,32470,4410,32413,4808,32352,5205,32286,5602,32214,5998,32138,6393,32058,6787,31972,7180,31881,7571,31786,7962,31686,8351,31581,8740,31471,9127,31357,9512,31238,9896,31114,10279,30986,10660,30853,11039,30715,11417,30572,11793,30425,12167,30274,12540,30118,12910,29957,13279,29792,13646,29622,14010,29448,14373,29269,14733,29086,15091,28899,15447,28707,15800,28511,16151,28311,16500,28106,16846,27897,17190,27684,17531,27467,17869,27246,18205,27020,18538,26791,18868,26557,19195,26320,19520,26078,19841,25833,20160,25583,20475,25330,20788,25073,21097,24812,21403,24548,21706,24279,22006,24008,22302,23732,22595,23453,22884,23170,23170,22884,23453,22595,23732,22302,24008,22006,24279,21706,24548,21403,24812,21097,25073,20788,25330,20475,25583,20160,25833,19841,26078,19520,26320,19195,26557,18868,26791,18538,27020,18205,27246,17869,27467,17531,27684,17190,27897,16846,28106,16500,28311,16151,28511,15800,28707,15447,28899,15091,29086,14733,29269,14373,29448,14010,29622,13646,29792,13279,29957,12910,30118,12540,30274,12167,30425,11793,30572,11417,30715,11039,30853,10660,30986,10279,31114,9896,31238,9512,31357,9127,31471,8740,31581,8351,31686,7962,31786,7571,31881,7180,31972,6787,32058,6393,32138,5998,32214,5602,32286,5205,32352,4808,32413,4410,32470,4011,32522,3612,32568,3212,32610,2811,32647,2411,32679,2009,32706,1608,32729,1206,32746,804,32758,402,32766,0,32767,-402,32766,-804,32758,-1206,32746,-1608,32729,-2009,32706,-2411,32679,-2811,32647,-3212,32610,-3612,32568,-4011,32522,-4410,32470,-4808,32413,-5205,32352,-5602,32286,-5998,32214,-6393,32138,-6787,32058,-7180,31972,-7571,31881,-7962,31786,-8351,31686,-8740,31581,-9127,31471,-9512,31357,-9896,31238,-10279,31114,-10660,30986,-11039,30853,-11417,30715,-11793,30572,-12167,30425,-12540,30274,-12910,30118,-13279,29957,-13646,29792,-14010,29622,-14373,29448,-14733,29269,-15091,29086,-15447,28899,-15800,28707,-16151,28511,-16500,28311,-16846,28106,-17190,27897,-17531,27684,-17869,27467,-18205,27246,-18538,27020,-18868,26791,-19195,26557,-19520,26320,-19841,26078,-20160,25833,-20475,25583,-20788,25330,-21097,25073,-21403,24812,-21706,24548,-22006,24279,-22302,24008,-22595,23732,-22884,23453,-23170,23170,-23453,22884,-23732,22595,-24008,22302,-24279,22006,-24548,21706,-24812,21403,-25073,21097,-25330,20788,-25583,20475,-25833,20160,-26078,19841,-26320,19520,-26557,19195,-26791,18868,-27020,18538,-27246,18205,-27467,17869,-27684,17531,-27897,17190,-28106,16846,-28311,16500,-28511,16151,-28707,15800,-28899,15447,-29086,15091,-29269,14733,-29448,14373,-29622,14010,-29792,13646,-29957,13279,-30118,12910,-30274,12540,-30425,12167,-30572,11793,-30715,11417,-30853,11039,-30986,10660,-31114,10279,-31238,9896,-31357,9512,-31471,9127,-31581,8740,-31686,8351,-31786,7962,-31881,7571,-31972,7180,-32058,6787,-32138,6393,-32214,5998,-32286,5602,-32352,5205,-32413,4808,-32470,4410,-32522,4011,-32568,3612,-32610,3212,-32647,2811,-32679,2411,-32706,2009,-32729,1608,-32746,1206,-32758,804,-32766,402
};
const uint16_t equalTab[256] = {
65535,55632,53523,50609,54253,52340,53456,53478,49388,52336,51126,48616,49671,49450,48798,46384,46564,44843,43275,41828,40083,39990,37111,34038,33309,31487,28794,28072,25657,25753,26029,22973,24195,23288,24138,26278,22857,25142,27776,23562,23318,23088,22873,22672,22485,22311,22150,22003,21868,21745,21635,21537,21451,21376,21313,21262,21222,21194,21177,21171,21177,21194,21222,21262,21313,21217,21285,21194,21279,21194,21109,21024,20940,20856,20773,20901,21041,21194,21126,21058,20991,20923,21109,21047,20985,21194,21137,21081,21024,20968,20912,20856,20801,20745,20076,20627,19586,20413,19909,20537,20927,21293,21106,21099,19320,19265,17492,16154,16074,14165,14586,12945,13662,12636,13208,12269,12679,10999,10865,10629,10474,10481,10764,10046,10005,10762,10272,10535,10400,10160,10473,10245,10514,10946,11583,11830,12156,11458,11984,12396,12968,13296,13134,13689,14172,14578,15016,15045,15583,14996,16203,15153,16352,16421,16418,17864,17397,18517,18848,19018,19645,20237,21002,21174,22645,22185,24305,24607,27901,28736,32819,31347,34095,33166,34221,30707,33333,30343,33363,32096,32030,31323,31057,30274,29439,27028,27968,26241,28075,26281,27162,27009,29121,29228,29257,30890,29044,32442,31294,32678,33030,33843,33158,34565,32534,34232,33338,32993,32866,31375,31382,30415,32385,29085,31425,29076,30246,27990,28385,26381,25462,24856,23744,23538,22850,23994,23949,23567,23132,21633,21445,21770,21516,21210,20987,20480,19966,20848,19706,19450,19162,18060,18230,17830,18029,17739,17102,17760,15797,16757,15478,15060,14932,14194,14345,14148
};
const uint16_t equalWeight_A[256] = {
0, 4798, 12805, 19307, 27461, 32110, 37668, 41785, 41757, 47047, 48234, 47668, 50239, 51293, 51673, 49958, 50861, 49554, 48285, 47046, 45382, 45525, 42435, 39061, 38334, 36316, 33264, 32466, 29692, 29811, 30127, 26577, 27970, 26894, 27839, 30262, 26276, 28847, 31800, 26913, 26568, 26237, 25919, 25616, 25326, 25050, 24786, 24536, 24298, 24073, 23860, 23659, 23471, 23293, 23127, 22973, 22830, 22699, 22578, 22467, 22368, 22280, 22201, 22134, 22077, 21866, 21825, 21619, 21592, 21392, 21192, 20992, 20794, 20596, 20400, 20410, 20430, 20461, 20278, 20095, 19913, 19731, 19788, 19612, 19436, 19511, 19339, 19169, 18999, 18831, 18663, 18496, 18330, 18165, 17467, 17831, 16822, 17419, 16878, 17297, 17510, 17699, 17428, 17307, 15743, 15593, 14063, 12901, 12750, 11160, 11414, 10062, 10547, 9688, 10058, 9279, 9523, 8205, 8049, 7820, 7653, 7605, 7756, 7189, 7110, 7595, 7199, 7331, 7187, 6972, 7137, 6933, 7065, 7304, 7675, 7784, 7942, 7434, 7721, 7930, 8238, 8387, 8227, 8514, 8753, 8941, 9145, 9098, 9357, 8942, 9594, 8909, 9547, 9520, 9452, 10212, 9876, 10438, 10551, 10572, 10844, 11093, 11432, 11446, 12156, 11826, 12866, 12936, 14566, 14898, 16898, 16028, 17313, 16725, 17139, 15273, 16465, 14886, 16255, 15531, 15393, 14950, 14722, 14254, 13766, 12553, 12901, 12023, 12776, 11879, 12195, 12044, 12899, 12859, 12786, 13409, 12524, 13896, 13315, 13811, 13867, 14114, 13737, 14226, 13302, 13904, 13452, 13225, 13088, 12412, 12334, 11876, 12563, 11210, 12033, 11062, 11433, 10512, 10592, 9781, 9379, 9098, 8635, 8506, 8204, 8561, 8490, 8302, 8097, 7525, 7413, 7478, 7344, 7195, 7074, 6861, 6647, 6897, 6479, 6356, 6223, 5829, 5848, 5684, 5713, 5586, 5353, 5525, 4885, 5150, 4728, 4573, 4507, 4258, 4278, 4194
};
const uint16_t equalWeight_C[256] = {
0, 52984, 53123, 50615, 54391, 52516, 53644, 53654, 49527, 52449, 51195, 48636, 49638, 49359, 48646, 46175, 46285, 44503, 42874, 41366, 39565, 39395, 36482, 33388, 32599, 30743, 28045, 27272, 24860, 24885, 25081, 22072, 23177, 22239, 22978, 24934, 21616, 23696, 26087, 22051, 21743, 21448, 21167, 20900, 20645, 20403, 20173, 19955, 19748, 19552, 19368, 19194, 19031, 18877, 18734, 18601, 18477, 18363, 18258, 18162, 18076, 17998, 17929, 17870, 17818, 17644, 17605, 17435, 17409, 17244, 17079, 16915, 16752, 16589, 16428, 16433, 16446, 16468, 16318, 16168, 16020, 15872, 15915, 15771, 15628, 15686, 15546, 15408, 15269, 15132, 14996, 14860, 14726, 14591, 14029, 14321, 13509, 13987, 13552, 13887, 14057, 14208, 13990, 13891, 12635, 12514, 11286, 10352, 10231, 8954, 9158, 8072, 8461, 7772, 8068, 7442, 7638, 6580, 6455, 6271, 6137, 6098, 6219, 5764, 5700, 6089, 5771, 5877, 5761, 5589, 5721, 5557, 5663, 5854, 6151, 6238, 6365, 5958, 6187, 6355, 6601, 6721, 6592, 6822, 7013, 7163, 7327, 7289, 7497, 7164, 7686, 7137, 7648, 7626, 7571, 8181, 7911, 8361, 8451, 8468, 8686, 8885, 9157, 9167, 9736, 9472, 10305, 10360, 11666, 11931, 13532, 12836, 13865, 13394, 13725, 12230, 13185, 11920, 13016, 12436, 12326, 11971, 11788, 11413, 11022, 10051, 10330, 9626, 10229, 9511, 9763, 9643, 10327, 10295, 10236, 10735, 10026, 11125, 10659, 11057, 11102, 11299, 10997, 11388, 10648, 11130, 10768, 10587, 10477, 9936, 9873, 9507, 10057, 8973, 9632, 8854, 9151, 8414, 8478, 7829, 7507, 7282, 6912, 6808, 6567, 6852, 6796, 6645, 6481, 6023, 5933, 5985, 5878, 5758, 5662, 5491, 5320, 5520, 5186, 5086, 4980, 4665, 4680, 4549, 4572, 4471, 4284, 4422, 3909, 4121, 3784, 3659, 3606, 3408, 3423, 3356
};