tables_NLSF_CB_WB.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. /***********************************************************************
  2. Copyright (c) 2006-2011, Skype Limited. All rights reserved.
  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 notice,
  7. 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 Internet Society, IETF or IETF Trust, nor the
  12. names of specific contributors, may be used to endorse or promote
  13. products derived from this software without specific prior written
  14. permission.
  15. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  16. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  17. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  18. ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  19. LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  20. CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  21. SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  22. INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  23. CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  24. ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  25. POSSIBILITY OF SUCH DAMAGE.
  26. ***********************************************************************/
  27. #ifdef HAVE_CONFIG_H
  28. #include "config.h"
  29. #endif
  30. #include "tables.h"
  31. static const opus_uint8 silk_NLSF_CB1_WB_Q8[ 512 ] = {
  32. 7, 23, 38, 54, 69, 85, 100, 116,
  33. 131, 147, 162, 178, 193, 208, 223, 239,
  34. 13, 25, 41, 55, 69, 83, 98, 112,
  35. 127, 142, 157, 171, 187, 203, 220, 236,
  36. 15, 21, 34, 51, 61, 78, 92, 106,
  37. 126, 136, 152, 167, 185, 205, 225, 240,
  38. 10, 21, 36, 50, 63, 79, 95, 110,
  39. 126, 141, 157, 173, 189, 205, 221, 237,
  40. 17, 20, 37, 51, 59, 78, 89, 107,
  41. 123, 134, 150, 164, 184, 205, 224, 240,
  42. 10, 15, 32, 51, 67, 81, 96, 112,
  43. 129, 142, 158, 173, 189, 204, 220, 236,
  44. 8, 21, 37, 51, 65, 79, 98, 113,
  45. 126, 138, 155, 168, 179, 192, 209, 218,
  46. 12, 15, 34, 55, 63, 78, 87, 108,
  47. 118, 131, 148, 167, 185, 203, 219, 236,
  48. 16, 19, 32, 36, 56, 79, 91, 108,
  49. 118, 136, 154, 171, 186, 204, 220, 237,
  50. 11, 28, 43, 58, 74, 89, 105, 120,
  51. 135, 150, 165, 180, 196, 211, 226, 241,
  52. 6, 16, 33, 46, 60, 75, 92, 107,
  53. 123, 137, 156, 169, 185, 199, 214, 225,
  54. 11, 19, 30, 44, 57, 74, 89, 105,
  55. 121, 135, 152, 169, 186, 202, 218, 234,
  56. 12, 19, 29, 46, 57, 71, 88, 100,
  57. 120, 132, 148, 165, 182, 199, 216, 233,
  58. 17, 23, 35, 46, 56, 77, 92, 106,
  59. 123, 134, 152, 167, 185, 204, 222, 237,
  60. 14, 17, 45, 53, 63, 75, 89, 107,
  61. 115, 132, 151, 171, 188, 206, 221, 240,
  62. 9, 16, 29, 40, 56, 71, 88, 103,
  63. 119, 137, 154, 171, 189, 205, 222, 237,
  64. 16, 19, 36, 48, 57, 76, 87, 105,
  65. 118, 132, 150, 167, 185, 202, 218, 236,
  66. 12, 17, 29, 54, 71, 81, 94, 104,
  67. 126, 136, 149, 164, 182, 201, 221, 237,
  68. 15, 28, 47, 62, 79, 97, 115, 129,
  69. 142, 155, 168, 180, 194, 208, 223, 238,
  70. 8, 14, 30, 45, 62, 78, 94, 111,
  71. 127, 143, 159, 175, 192, 207, 223, 239,
  72. 17, 30, 49, 62, 79, 92, 107, 119,
  73. 132, 145, 160, 174, 190, 204, 220, 235,
  74. 14, 19, 36, 45, 61, 76, 91, 108,
  75. 121, 138, 154, 172, 189, 205, 222, 238,
  76. 12, 18, 31, 45, 60, 76, 91, 107,
  77. 123, 138, 154, 171, 187, 204, 221, 236,
  78. 13, 17, 31, 43, 53, 70, 83, 103,
  79. 114, 131, 149, 167, 185, 203, 220, 237,
  80. 17, 22, 35, 42, 58, 78, 93, 110,
  81. 125, 139, 155, 170, 188, 206, 224, 240,
  82. 8, 15, 34, 50, 67, 83, 99, 115,
  83. 131, 146, 162, 178, 193, 209, 224, 239,
  84. 13, 16, 41, 66, 73, 86, 95, 111,
  85. 128, 137, 150, 163, 183, 206, 225, 241,
  86. 17, 25, 37, 52, 63, 75, 92, 102,
  87. 119, 132, 144, 160, 175, 191, 212, 231,
  88. 19, 31, 49, 65, 83, 100, 117, 133,
  89. 147, 161, 174, 187, 200, 213, 227, 242,
  90. 18, 31, 52, 68, 88, 103, 117, 126,
  91. 138, 149, 163, 177, 192, 207, 223, 239,
  92. 16, 29, 47, 61, 76, 90, 106, 119,
  93. 133, 147, 161, 176, 193, 209, 224, 240,
  94. 15, 21, 35, 50, 61, 73, 86, 97,
  95. 110, 119, 129, 141, 175, 198, 218, 237
  96. };
  97. static const opus_int16 silk_NLSF_CB1_WB_Wght_Q9[ 512 ] = {
  98. 3657, 2925, 2925, 2925, 2925, 2925, 2925, 2925, 2925, 2925, 2925, 2925, 2963, 2963, 2925, 2846,
  99. 3216, 3085, 2972, 3056, 3056, 3010, 3010, 3010, 2963, 2963, 3010, 2972, 2888, 2846, 2846, 2726,
  100. 3920, 4014, 2981, 3207, 3207, 2934, 3056, 2846, 3122, 3244, 2925, 2846, 2620, 2553, 2780, 2925,
  101. 3516, 3197, 3010, 3103, 3019, 2888, 2925, 2925, 2925, 2925, 2888, 2888, 2888, 2888, 2888, 2753,
  102. 5054, 5054, 2934, 3573, 3385, 3056, 3085, 2793, 3160, 3160, 2972, 2846, 2513, 2540, 2753, 2888,
  103. 4428, 4149, 2700, 2753, 2972, 3010, 2925, 2846, 2981, 3019, 2925, 2925, 2925, 2925, 2888, 2726,
  104. 3620, 3019, 2972, 3056, 3056, 2873, 2806, 3056, 3216, 3047, 2981, 3291, 3291, 2981, 3310, 2991,
  105. 5227, 5014, 2540, 3338, 3526, 3385, 3197, 3094, 3376, 2981, 2700, 2647, 2687, 2793, 2846, 2673,
  106. 5081, 5174, 4615, 4428, 2460, 2897, 3047, 3207, 3169, 2687, 2740, 2888, 2846, 2793, 2846, 2700,
  107. 3122, 2888, 2963, 2925, 2925, 2925, 2925, 2963, 2963, 2963, 2963, 2925, 2925, 2963, 2963, 2963,
  108. 4202, 3207, 2981, 3103, 3010, 2888, 2888, 2925, 2972, 2873, 2916, 3019, 2972, 3010, 3197, 2873,
  109. 3760, 3760, 3244, 3103, 2981, 2888, 2925, 2888, 2972, 2934, 2793, 2793, 2846, 2888, 2888, 2660,
  110. 3854, 4014, 3207, 3122, 3244, 2934, 3047, 2963, 2963, 3085, 2846, 2793, 2793, 2793, 2793, 2580,
  111. 3845, 4080, 3357, 3516, 3094, 2740, 3010, 2934, 3122, 3085, 2846, 2846, 2647, 2647, 2846, 2806,
  112. 5147, 4894, 3225, 3845, 3441, 3169, 2897, 3413, 3451, 2700, 2580, 2673, 2740, 2846, 2806, 2753,
  113. 4109, 3789, 3291, 3160, 2925, 2888, 2888, 2925, 2793, 2740, 2793, 2740, 2793, 2846, 2888, 2806,
  114. 5081, 5054, 3047, 3545, 3244, 3056, 3085, 2944, 3103, 2897, 2740, 2740, 2740, 2846, 2793, 2620,
  115. 4309, 4309, 2860, 2527, 3207, 3376, 3376, 3075, 3075, 3376, 3056, 2846, 2647, 2580, 2726, 2753,
  116. 3056, 2916, 2806, 2888, 2740, 2687, 2897, 3103, 3150, 3150, 3216, 3169, 3056, 3010, 2963, 2846,
  117. 4375, 3882, 2925, 2888, 2846, 2888, 2846, 2846, 2888, 2888, 2888, 2846, 2888, 2925, 2888, 2846,
  118. 2981, 2916, 2916, 2981, 2981, 3056, 3122, 3216, 3150, 3056, 3010, 2972, 2972, 2972, 2925, 2740,
  119. 4229, 4149, 3310, 3347, 2925, 2963, 2888, 2981, 2981, 2846, 2793, 2740, 2846, 2846, 2846, 2793,
  120. 4080, 4014, 3103, 3010, 2925, 2925, 2925, 2888, 2925, 2925, 2846, 2846, 2846, 2793, 2888, 2780,
  121. 4615, 4575, 3169, 3441, 3207, 2981, 2897, 3038, 3122, 2740, 2687, 2687, 2687, 2740, 2793, 2700,
  122. 4149, 4269, 3789, 3657, 2726, 2780, 2888, 2888, 3010, 2972, 2925, 2846, 2687, 2687, 2793, 2888,
  123. 4215, 3554, 2753, 2846, 2846, 2888, 2888, 2888, 2925, 2925, 2888, 2925, 2925, 2925, 2963, 2888,
  124. 5174, 4921, 2261, 3432, 3789, 3479, 3347, 2846, 3310, 3479, 3150, 2897, 2460, 2487, 2753, 2925,
  125. 3451, 3685, 3122, 3197, 3357, 3047, 3207, 3207, 2981, 3216, 3085, 2925, 2925, 2687, 2540, 2434,
  126. 2981, 3010, 2793, 2793, 2740, 2793, 2846, 2972, 3056, 3103, 3150, 3150, 3150, 3103, 3010, 3010,
  127. 2944, 2873, 2687, 2726, 2780, 3010, 3432, 3545, 3357, 3244, 3056, 3010, 2963, 2925, 2888, 2846,
  128. 3019, 2944, 2897, 3010, 3010, 2972, 3019, 3103, 3056, 3056, 3010, 2888, 2846, 2925, 2925, 2888,
  129. 3920, 3967, 3010, 3197, 3357, 3216, 3291, 3291, 3479, 3704, 3441, 2726, 2181, 2460, 2580, 2607
  130. };
  131. static const opus_uint8 silk_NLSF_CB1_iCDF_WB[ 64 ] = {
  132. 225, 204, 201, 184, 183, 175, 158, 154,
  133. 153, 135, 119, 115, 113, 110, 109, 99,
  134. 98, 95, 79, 68, 52, 50, 48, 45,
  135. 43, 32, 31, 27, 18, 10, 3, 0,
  136. 255, 251, 235, 230, 212, 201, 196, 182,
  137. 167, 166, 163, 151, 138, 124, 110, 104,
  138. 90, 78, 76, 70, 69, 57, 45, 34,
  139. 24, 21, 11, 6, 5, 4, 3, 0
  140. };
  141. static const opus_uint8 silk_NLSF_CB2_SELECT_WB[ 256 ] = {
  142. 0, 0, 0, 0, 0, 0, 0, 1,
  143. 100, 102, 102, 68, 68, 36, 34, 96,
  144. 164, 107, 158, 185, 180, 185, 139, 102,
  145. 64, 66, 36, 34, 34, 0, 1, 32,
  146. 208, 139, 141, 191, 152, 185, 155, 104,
  147. 96, 171, 104, 166, 102, 102, 102, 132,
  148. 1, 0, 0, 0, 0, 16, 16, 0,
  149. 80, 109, 78, 107, 185, 139, 103, 101,
  150. 208, 212, 141, 139, 173, 153, 123, 103,
  151. 36, 0, 0, 0, 0, 0, 0, 1,
  152. 48, 0, 0, 0, 0, 0, 0, 32,
  153. 68, 135, 123, 119, 119, 103, 69, 98,
  154. 68, 103, 120, 118, 118, 102, 71, 98,
  155. 134, 136, 157, 184, 182, 153, 139, 134,
  156. 208, 168, 248, 75, 189, 143, 121, 107,
  157. 32, 49, 34, 34, 34, 0, 17, 2,
  158. 210, 235, 139, 123, 185, 137, 105, 134,
  159. 98, 135, 104, 182, 100, 183, 171, 134,
  160. 100, 70, 68, 70, 66, 66, 34, 131,
  161. 64, 166, 102, 68, 36, 2, 1, 0,
  162. 134, 166, 102, 68, 34, 34, 66, 132,
  163. 212, 246, 158, 139, 107, 107, 87, 102,
  164. 100, 219, 125, 122, 137, 118, 103, 132,
  165. 114, 135, 137, 105, 171, 106, 50, 34,
  166. 164, 214, 141, 143, 185, 151, 121, 103,
  167. 192, 34, 0, 0, 0, 0, 0, 1,
  168. 208, 109, 74, 187, 134, 249, 159, 137,
  169. 102, 110, 154, 118, 87, 101, 119, 101,
  170. 0, 2, 0, 36, 36, 66, 68, 35,
  171. 96, 164, 102, 100, 36, 0, 2, 33,
  172. 167, 138, 174, 102, 100, 84, 2, 2,
  173. 100, 107, 120, 119, 36, 197, 24, 0
  174. };
  175. static const opus_uint8 silk_NLSF_CB2_iCDF_WB[ 72 ] = {
  176. 255, 254, 253, 244, 12, 3, 2, 1,
  177. 0, 255, 254, 252, 224, 38, 3, 2,
  178. 1, 0, 255, 254, 251, 209, 57, 4,
  179. 2, 1, 0, 255, 254, 244, 195, 69,
  180. 4, 2, 1, 0, 255, 251, 232, 184,
  181. 84, 7, 2, 1, 0, 255, 254, 240,
  182. 186, 86, 14, 2, 1, 0, 255, 254,
  183. 239, 178, 91, 30, 5, 1, 0, 255,
  184. 248, 227, 177, 100, 19, 2, 1, 0
  185. };
  186. static const opus_uint8 silk_NLSF_CB2_BITS_WB_Q5[ 72 ] = {
  187. 255, 255, 255, 156, 4, 154, 255, 255,
  188. 255, 255, 255, 227, 102, 15, 92, 255,
  189. 255, 255, 255, 255, 213, 83, 24, 72,
  190. 236, 255, 255, 255, 255, 150, 76, 33,
  191. 63, 214, 255, 255, 255, 190, 121, 77,
  192. 43, 55, 185, 255, 255, 255, 245, 137,
  193. 71, 43, 59, 139, 255, 255, 255, 255,
  194. 131, 66, 50, 66, 107, 194, 255, 255,
  195. 166, 116, 76, 55, 53, 125, 255, 255
  196. };
  197. static const opus_uint8 silk_NLSF_PRED_WB_Q8[ 30 ] = {
  198. 175, 148, 160, 176, 178, 173, 174, 164,
  199. 177, 174, 196, 182, 198, 192, 182, 68,
  200. 62, 66, 60, 72, 117, 85, 90, 118,
  201. 136, 151, 142, 160, 142, 155
  202. };
  203. static const opus_int16 silk_NLSF_DELTA_MIN_WB_Q15[ 17 ] = {
  204. 100, 3, 40, 3, 3, 3, 5, 14,
  205. 14, 10, 11, 3, 8, 9, 7, 3,
  206. 347
  207. };
  208. const silk_NLSF_CB_struct silk_NLSF_CB_WB =
  209. {
  210. 32,
  211. 16,
  212. SILK_FIX_CONST( 0.15, 16 ),
  213. SILK_FIX_CONST( 1.0 / 0.15, 6 ),
  214. silk_NLSF_CB1_WB_Q8,
  215. silk_NLSF_CB1_WB_Wght_Q9,
  216. silk_NLSF_CB1_iCDF_WB,
  217. silk_NLSF_PRED_WB_Q8,
  218. silk_NLSF_CB2_SELECT_WB,
  219. silk_NLSF_CB2_iCDF_WB,
  220. silk_NLSF_CB2_BITS_WB_Q5,
  221. silk_NLSF_DELTA_MIN_WB_Q15,
  222. };