window.c 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* Copyright (C) 2006 Jean-Marc Valin
  2. File: window.c
  3. Redistribution and use in source and binary forms, with or without
  4. modification, are permitted provided that the following conditions
  5. are met:
  6. - Redistributions of source code must retain the above copyright
  7. notice, this list of conditions and the following disclaimer.
  8. - Redistributions in binary form must reproduce the above copyright
  9. notice, this list of conditions and the following disclaimer in the
  10. documentation and/or other materials provided with the distribution.
  11. - Neither the name of the Xiph.org Foundation nor the names of its
  12. contributors may be used to endorse or promote products derived from
  13. this software without specific prior written permission.
  14. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  15. ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  16. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  17. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
  18. CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  19. EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  20. PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  21. PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  22. LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  23. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  24. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. */
  26. #ifdef HAVE_CONFIG_H
  27. #include "config.h"
  28. #endif
  29. #include "arch.h"
  30. #ifdef FIXED_POINT
  31. const spx_word16_t lag_window[11] = {
  32. 16384, 16337, 16199, 15970, 15656, 15260, 14790, 14254, 13659, 13015, 12330
  33. };
  34. const spx_word16_t lpc_window[200] = {
  35. 1310, 1313, 1321, 1333, 1352, 1375, 1403, 1436,
  36. 1475, 1518, 1567, 1621, 1679, 1743, 1811, 1884,
  37. 1962, 2044, 2132, 2224, 2320, 2421, 2526, 2636,
  38. 2750, 2868, 2990, 3116, 3246, 3380, 3518, 3659,
  39. 3804, 3952, 4104, 4259, 4417, 4578, 4742, 4909,
  40. 5079, 5251, 5425, 5602, 5781, 5963, 6146, 6331,
  41. 6518, 6706, 6896, 7087, 7280, 7473, 7668, 7863,
  42. 8059, 8256, 8452, 8650, 8847, 9044, 9241, 9438,
  43. 9635, 9831, 10026, 10220, 10414, 10606, 10797, 10987,
  44. 11176, 11363, 11548, 11731, 11912, 12091, 12268, 12443,
  45. 12615, 12785, 12952, 13116, 13277, 13435, 13590, 13742,
  46. 13890, 14035, 14176, 14314, 14448, 14578, 14704, 14826,
  47. 14944, 15058, 15168, 15273, 15374, 15470, 15562, 15649,
  48. 15732, 15810, 15883, 15951, 16015, 16073, 16127, 16175,
  49. 16219, 16257, 16291, 16319, 16342, 16360, 16373, 16381,
  50. 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
  51. 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
  52. 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
  53. 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
  54. 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
  55. 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
  56. 16384, 16384, 16384, 16361, 16294, 16183, 16028, 15830,
  57. 15588, 15304, 14979, 14613, 14207, 13763, 13282, 12766,
  58. 12215, 11631, 11016, 10373, 9702, 9007, 8289, 7551,
  59. 6797, 6028, 5251, 4470, 3695, 2943, 2248, 1696
  60. };
  61. #else
  62. const spx_word16_t lag_window[11] = {
  63. 1.00000, 0.99716, 0.98869, 0.97474, 0.95554, 0.93140, 0.90273, 0.86998, 0.83367, 0.79434, 0.75258
  64. };
  65. const spx_word16_t lpc_window[200] = {
  66. 0.080000f, 0.080158f, 0.080630f, 0.081418f, 0.082520f, 0.083935f, 0.085663f, 0.087703f,
  67. 0.090052f, 0.092710f, 0.095674f, 0.098943f, 0.102514f, 0.106385f, 0.110553f, 0.115015f,
  68. 0.119769f, 0.124811f, 0.130137f, 0.135744f, 0.141628f, 0.147786f, 0.154212f, 0.160902f,
  69. 0.167852f, 0.175057f, 0.182513f, 0.190213f, 0.198153f, 0.206328f, 0.214731f, 0.223357f,
  70. 0.232200f, 0.241254f, 0.250513f, 0.259970f, 0.269619f, 0.279453f, 0.289466f, 0.299651f,
  71. 0.310000f, 0.320507f, 0.331164f, 0.341965f, 0.352901f, 0.363966f, 0.375151f, 0.386449f,
  72. 0.397852f, 0.409353f, 0.420943f, 0.432615f, 0.444361f, 0.456172f, 0.468040f, 0.479958f,
  73. 0.491917f, 0.503909f, 0.515925f, 0.527959f, 0.540000f, 0.552041f, 0.564075f, 0.576091f,
  74. 0.588083f, 0.600042f, 0.611960f, 0.623828f, 0.635639f, 0.647385f, 0.659057f, 0.670647f,
  75. 0.682148f, 0.693551f, 0.704849f, 0.716034f, 0.727099f, 0.738035f, 0.748836f, 0.759493f,
  76. 0.770000f, 0.780349f, 0.790534f, 0.800547f, 0.810381f, 0.820030f, 0.829487f, 0.838746f,
  77. 0.847800f, 0.856643f, 0.865269f, 0.873672f, 0.881847f, 0.889787f, 0.897487f, 0.904943f,
  78. 0.912148f, 0.919098f, 0.925788f, 0.932214f, 0.938372f, 0.944256f, 0.949863f, 0.955189f,
  79. 0.960231f, 0.964985f, 0.969447f, 0.973615f, 0.977486f, 0.981057f, 0.984326f, 0.987290f,
  80. 0.989948f, 0.992297f, 0.994337f, 0.996065f, 0.997480f, 0.998582f, 0.999370f, 0.999842f,
  81. 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f,
  82. 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f,
  83. 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f,
  84. 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f,
  85. 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f,
  86. 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f,
  87. 1.000000f, 1.000000f, 1.000000f, 0.998640f, 0.994566f, 0.987787f, 0.978324f, 0.966203f,
  88. 0.951458f, 0.934131f, 0.914270f, 0.891931f, 0.867179f, 0.840084f, 0.810723f, 0.779182f,
  89. 0.745551f, 0.709930f, 0.672424f, 0.633148f, 0.592223f, 0.549781f, 0.505964f, 0.460932f,
  90. 0.414863f, 0.367968f, 0.320511f, 0.272858f, 0.225569f, 0.179655f, 0.137254f, 0.103524f
  91. };
  92. #endif