Home | History | Annotate | Download | only in source
      1 /*
      2  *  Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
      3  *
      4  *  Use of this source code is governed by a BSD-style license
      5  *  that can be found in the LICENSE file in the root of the source
      6  *  tree. An additional intellectual property rights grant can be found
      7  *  in the file PATENTS.  All contributing project authors may
      8  *  be found in the AUTHORS file in the root of the source tree.
      9  */
     10 
     11 /*
     12  * This file contains trigonometric functions look-up tables used in
     13  * transform functions WebRtcIsacfix_Time2Spec and WebRtcIsacfix_Spec2Time.
     14  */
     15 
     16 #include "webrtc/modules/audio_coding/codecs/isac/fix/source/settings.h"
     17 #include "webrtc/typedefs.h"
     18 
     19 /* Cosine table 1 in Q14. */
     20 const int16_t WebRtcIsacfix_kCosTab1[FRAMESAMPLES/2] = {
     21   16384,  16383,  16378,  16371,  16362,  16349,  16333,  16315,  16294,  16270,
     22   16244,  16214,  16182,  16147,  16110,  16069,  16026,  15980,  15931,  15880,
     23   15826,  15769,  15709,  15647,  15582,  15515,  15444,  15371,  15296,  15218,
     24   15137,  15053,  14968,  14879,  14788,  14694,  14598,  14500,  14399,  14295,
     25   14189,  14081,  13970,  13856,  13741,  13623,  13502,  13380,  13255,  13128,
     26   12998,  12867,  12733,  12597,  12458,  12318,  12176,  12031,  11885,  11736,
     27   11585,  11433,  11278,  11121,  10963,  10803,  10641,  10477,  10311,  10143,
     28   9974,   9803,   9630,   9456,   9280,   9102,   8923,   8743,   8561,   8377,
     29   8192,   8006,   7818,   7629,   7438,   7246,   7053,   6859,   6664,   6467,
     30   6270,   6071,   5872,   5671,   5469,   5266,   5063,   4859,   4653,   4447,
     31   4240,   4033,   3825,   3616,   3406,   3196,   2986,   2775,   2563,   2351,
     32   2139,   1926,   1713,   1499,   1285,   1072,    857,    643,    429,    214,
     33   0,   -214,   -429,   -643,   -857,  -1072,  -1285,  -1499,  -1713,  -1926,
     34   -2139,  -2351,  -2563,  -2775,  -2986,  -3196,  -3406,  -3616,  -3825,  -4033,
     35   -4240,  -4447,  -4653,  -4859,  -5063,  -5266,  -5469,  -5671,  -5872,  -6071,
     36   -6270,  -6467,  -6664,  -6859,  -7053,  -7246,  -7438,  -7629,  -7818,  -8006,
     37   -8192,  -8377,  -8561,  -8743,  -8923,  -9102,  -9280,  -9456,  -9630,  -9803,
     38   -9974, -10143, -10311, -10477, -10641, -10803, -10963, -11121, -11278, -11433,
     39   -11585, -11736, -11885, -12031, -12176, -12318, -12458, -12597, -12733,
     40   -12867, -12998, -13128, -13255, -13380, -13502, -13623, -13741, -13856,
     41   -13970, -14081, -14189, -14295, -14399, -14500, -14598, -14694, -14788,
     42   -14879, -14968, -15053, -15137, -15218, -15296, -15371, -15444, -15515,
     43   -15582, -15647, -15709, -15769, -15826, -15880, -15931, -15980, -16026,
     44   -16069, -16110, -16147, -16182, -16214, -16244, -16270, -16294, -16315,
     45   -16333, -16349, -16362, -16371, -16378, -16383
     46 };
     47 
     48 /* Sine table 1 in Q14. */
     49 const int16_t WebRtcIsacfix_kSinTab1[FRAMESAMPLES/2] = {
     50   0,   214,   429,   643,   857,  1072,  1285,  1499,  1713,  1926,
     51   2139,  2351,  2563,  2775,  2986,  3196,  3406,  3616,  3825,  4033,
     52   4240,  4447,  4653,  4859,  5063,  5266,  5469,  5671,  5872,  6071,
     53   6270,  6467,  6664,  6859,  7053,  7246,  7438,  7629,  7818,  8006,
     54   8192,  8377,  8561,  8743,  8923,  9102,  9280,  9456,  9630,  9803,
     55   9974, 10143, 10311, 10477, 10641, 10803, 10963, 11121, 11278, 11433,
     56   11585, 11736, 11885, 12031, 12176, 12318, 12458, 12597, 12733, 12867,
     57   12998, 13128, 13255, 13380, 13502, 13623, 13741, 13856, 13970, 14081,
     58   14189, 14295, 14399, 14500, 14598, 14694, 14788, 14879, 14968, 15053,
     59   15137, 15218, 15296, 15371, 15444, 15515, 15582, 15647, 15709, 15769,
     60   15826, 15880, 15931, 15980, 16026, 16069, 16110, 16147, 16182, 16214,
     61   16244, 16270, 16294, 16315, 16333, 16349, 16362, 16371, 16378, 16383,
     62   16384, 16383, 16378, 16371, 16362, 16349, 16333, 16315, 16294, 16270,
     63   16244, 16214, 16182, 16147, 16110, 16069, 16026, 15980, 15931, 15880,
     64   15826, 15769, 15709, 15647, 15582, 15515, 15444, 15371, 15296, 15218,
     65   15137, 15053, 14968, 14879, 14788, 14694, 14598, 14500, 14399, 14295,
     66   14189, 14081, 13970, 13856, 13741, 13623, 13502, 13380, 13255, 13128,
     67   12998, 12867, 12733, 12597, 12458, 12318, 12176, 12031, 11885, 11736,
     68   11585, 11433, 11278, 11121, 10963, 10803, 10641, 10477, 10311, 10143,
     69   9974,  9803,  9630,  9456,  9280,  9102,  8923,  8743,  8561,  8377,
     70   8192,  8006,  7818,  7629,  7438,  7246,  7053,  6859,  6664,  6467,
     71   6270,  6071,  5872,  5671,  5469,  5266,  5063,  4859,  4653,  4447,
     72   4240,  4033,  3825,  3616,  3406,  3196,  2986,  2775,  2563,  2351,
     73   2139,  1926,  1713,  1499,  1285,  1072,   857,   643,   429,   214
     74 };
     75 
     76 
     77 /* Sine table 2 in Q14. */
     78 const int16_t WebRtcIsacfix_kSinTab2[FRAMESAMPLES/4] = {
     79   16384, -16381, 16375, -16367, 16356, -16342, 16325, -16305, 16283, -16257,
     80   16229, -16199, 16165, -16129, 16090, -16048, 16003, -15956, 15906, -15853,
     81   15798, -15739, 15679, -15615, 15549, -15480, 15408, -15334, 15257, -15178,
     82   15095, -15011, 14924, -14834, 14741, -14647, 14549, -14449, 14347, -14242,
     83   14135, -14025, 13913, -13799, 13682, -13563, 13441, -13318, 13192, -13063,
     84   12933, -12800, 12665, -12528, 12389, -12247, 12104, -11958, 11810, -11661,
     85   11509, -11356, 11200, -11042, 10883, -10722, 10559, -10394, 10227, -10059,
     86   9889,  -9717,  9543,  -9368,  9191,  -9013,  8833,  -8652,  8469,  -8285,
     87   8099,  -7912,  7723,  -7534,  7342,  -7150,  6957,  -6762,  6566,  -6369,
     88   6171,  -5971,  5771,  -5570,  5368,  -5165,  4961,  -4756,  4550,  -4344,
     89   4137,  -3929,  3720,  -3511,  3301,  -3091,  2880,  -2669,  2457,  -2245,
     90   2032,  -1819,  1606,  -1392,  1179,   -965,   750,   -536,   322,   -107
     91 };
     92 
     93 #if defined(MIPS32_LE)
     94 /* Cosine table 2 in Q14. Used only on MIPS platforms. */
     95 const int16_t WebRtcIsacfix_kCosTab2[FRAMESAMPLES/4] = {
     96   107,   -322,   536,   -750,   965,  -1179,  1392,  -1606,  1819,  -2032,
     97   2245,  -2457,  2669,  -2880,  3091,  -3301,  3511,  -3720,  3929,  -4137,
     98   4344,  -4550,  4756,  -4961,  5165,  -5368,  5570,  -5771,  5971,  -6171,
     99   6369,  -6566,  6762,  -6957,  7150,  -7342,  7534,  -7723,  7912,  -8099,
    100   8285,  -8469,  8652,  -8833,  9013,  -9191,  9368,  -9543,  9717,  -9889,
    101   10059, -10227, 10394, -10559, 10722, -10883, 11042, -11200, 11356, -11509,
    102   11661, -11810, 11958, -12104, 12247, -12389, 12528, -12665, 12800, -12933,
    103   13063, -13192, 13318, -13441, 13563, -13682, 13799, -13913, 14025, -14135,
    104   14242, -14347, 14449, -14549, 14647, -14741, 14834, -14924, 15011, -15095,
    105   15178, -15257, 15334, -15408, 15480, -15549, 15615, -15679, 15739, -15798,
    106   15853, -15906, 15956, -16003, 16048, -16090, 16129, -16165, 16199, -16229,
    107   16257, -16283, 16305, -16325, 16342, -16356, 16367, -16375, 16381, -16384
    108 };
    109 #endif
    110