lsp_lookup.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /************************************************************************
  2. * Copyright (C) 2002-2009, Xiph.org Foundation
  3. * Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * * Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * * Redistributions in binary form must reproduce the above
  13. * copyright notice, this list of conditions and the following disclaimer
  14. * in the documentation and/or other materials provided with the
  15. * distribution.
  16. * * Neither the names of the Xiph.org Foundation nor Pinknoise
  17. * Productions Ltd nor the names of its contributors may be used to
  18. * endorse or promote products derived from this software without
  19. * specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. ************************************************************************
  33. function: lookup data
  34. ************************************************************************/
  35. #ifndef _V_LOOKUP_DATA_H_
  36. #define _V_LOOKUP_DATA_H_
  37. #include "os_types.h"
  38. #define INVSQ_LOOKUP_I_SHIFT 10
  39. #define INVSQ_LOOKUP_I_MASK 1023
  40. static const long INVSQ_LOOKUP_I[64+1]={
  41. 92682, 91966, 91267, 90583,
  42. 89915, 89261, 88621, 87995,
  43. 87381, 86781, 86192, 85616,
  44. 85051, 84497, 83953, 83420,
  45. 82897, 82384, 81880, 81385,
  46. 80899, 80422, 79953, 79492,
  47. 79039, 78594, 78156, 77726,
  48. 77302, 76885, 76475, 76072,
  49. 75674, 75283, 74898, 74519,
  50. 74146, 73778, 73415, 73058,
  51. 72706, 72359, 72016, 71679,
  52. 71347, 71019, 70695, 70376,
  53. 70061, 69750, 69444, 69141,
  54. 68842, 68548, 68256, 67969,
  55. 67685, 67405, 67128, 66855,
  56. 66585, 66318, 66054, 65794,
  57. 65536,
  58. };
  59. static const long INVSQ_LOOKUP_IDel[64]={
  60. 716, 699, 684, 668,
  61. 654, 640, 626, 614,
  62. 600, 589, 576, 565,
  63. 554, 544, 533, 523,
  64. 513, 504, 495, 486,
  65. 477, 469, 461, 453,
  66. 445, 438, 430, 424,
  67. 417, 410, 403, 398,
  68. 391, 385, 379, 373,
  69. 368, 363, 357, 352,
  70. 347, 343, 337, 332,
  71. 328, 324, 319, 315,
  72. 311, 306, 303, 299,
  73. 294, 292, 287, 284,
  74. 280, 277, 273, 270,
  75. 267, 264, 260, 258,
  76. };
  77. #define COS_LOOKUP_I_SHIFT 9
  78. #define COS_LOOKUP_I_MASK 511
  79. #define COS_LOOKUP_I_SZ 128
  80. static const ogg_int32_t COS_LOOKUP_I[COS_LOOKUP_I_SZ+1]={
  81. 16384, 16379, 16364, 16340,
  82. 16305, 16261, 16207, 16143,
  83. 16069, 15986, 15893, 15791,
  84. 15679, 15557, 15426, 15286,
  85. 15137, 14978, 14811, 14635,
  86. 14449, 14256, 14053, 13842,
  87. 13623, 13395, 13160, 12916,
  88. 12665, 12406, 12140, 11866,
  89. 11585, 11297, 11003, 10702,
  90. 10394, 10080, 9760, 9434,
  91. 9102, 8765, 8423, 8076,
  92. 7723, 7366, 7005, 6639,
  93. 6270, 5897, 5520, 5139,
  94. 4756, 4370, 3981, 3590,
  95. 3196, 2801, 2404, 2006,
  96. 1606, 1205, 804, 402,
  97. 0, -401, -803, -1204,
  98. -1605, -2005, -2403, -2800,
  99. -3195, -3589, -3980, -4369,
  100. -4755, -5138, -5519, -5896,
  101. -6269, -6638, -7004, -7365,
  102. -7722, -8075, -8422, -8764,
  103. -9101, -9433, -9759, -10079,
  104. -10393, -10701, -11002, -11296,
  105. -11584, -11865, -12139, -12405,
  106. -12664, -12915, -13159, -13394,
  107. -13622, -13841, -14052, -14255,
  108. -14448, -14634, -14810, -14977,
  109. -15136, -15285, -15425, -15556,
  110. -15678, -15790, -15892, -15985,
  111. -16068, -16142, -16206, -16260,
  112. -16304, -16339, -16363, -16378,
  113. -16383,
  114. };
  115. #endif