lsp_tables_nb.c 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. /* Copyright (C) 2002 Jean-Marc Valin
  2. File: lsp_tables_nb.c
  3. Codebooks for LSPs in narrowband CELP mode
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions are
  6. met:
  7. 1. Redistributions of source code must retain the above copyright notice,
  8. this list of conditions and the following disclaimer.
  9. 2. Redistributions in binary form must reproduce the above copyright
  10. notice, this list of conditions and the following disclaimer in the
  11. documentation and/or other materials provided with the distribution.
  12. 3. The name of the author may not be used to endorse or promote products
  13. derived from this software without specific prior written permission.
  14. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  15. IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  16. OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  17. DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
  18. INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  19. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  20. SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  21. HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  22. STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  23. ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  24. POSSIBILITY OF SUCH DAMAGE.
  25. */
  26. const signed char cdbk_nb[640]={
  27. 30,19,38,34,40,32,46,43,58,43,
  28. 5,-18,-25,-40,-33,-55,-52,20,34,28,
  29. -20,-63,-97,-92,61,53,47,49,53,75,
  30. -14,-53,-77,-79,0,-3,-5,19,22,26,
  31. -9,-53,-55,66,90,72,85,68,74,52,
  32. -4,-41,-58,-31,-18,-31,27,32,30,18,
  33. 24,3,8,5,-12,-3,26,28,74,63,
  34. -2,-39,-67,-77,-106,-74,59,59,73,65,
  35. 44,40,71,72,82,83,98,88,89,60,
  36. -6,-31,-47,-48,-13,-39,-9,7,2,79,
  37. -1,-39,-60,-17,87,81,65,50,45,19,
  38. -21,-67,-91,-87,-41,-50,7,18,39,74,
  39. 10,-31,-28,39,24,13,23,5,56,45,
  40. 29,10,-5,-13,-11,-35,-18,-8,-10,-8,
  41. -25,-71,-77,-21,2,16,50,63,87,87,
  42. 5,-32,-40,-51,-68,0,12,6,54,34,
  43. 5,-12,32,52,68,64,69,59,65,45,
  44. 14,-16,-31,-40,-65,-67,41,49,47,37,
  45. -11,-52,-75,-84,-4,57,48,42,42,33,
  46. -11,-51,-68,-6,13,0,8,-8,26,32,
  47. -23,-53,0,36,56,76,97,105,111,97,
  48. -1,-28,-39,-40,-43,-54,-44,-40,-18,35,
  49. 16,-20,-19,-28,-42,29,47,38,74,45,
  50. 3,-29,-48,-62,-80,-104,-33,56,59,59,
  51. 10,17,46,72,84,101,117,123,123,106,
  52. -7,-33,-49,-51,-70,-67,-27,-31,70,67,
  53. -16,-62,-85,-20,82,71,86,80,85,74,
  54. -19,-58,-75,-45,-29,-33,-18,-25,45,57,
  55. -12,-42,-5,12,28,36,52,64,81,82,
  56. 13,-9,-27,-28,22,3,2,22,26,6,
  57. -6,-44,-51,2,15,10,48,43,49,34,
  58. -19,-62,-84,-89,-102,-24,8,17,61,68,
  59. 39,24,23,19,16,-5,12,15,27,15,
  60. -8,-44,-49,-60,-18,-32,-28,52,54,62,
  61. -8,-48,-77,-70,66,101,83,63,61,37,
  62. -12,-50,-75,-64,33,17,13,25,15,77,
  63. 1,-42,-29,72,64,46,49,31,61,44,
  64. -8,-47,-54,-46,-30,19,20,-1,-16,0,
  65. 16,-12,-18,-9,-26,-27,-10,-22,53,45,
  66. -10,-47,-75,-82,-105,-109,8,25,49,77,
  67. 50,65,114,117,124,118,115,96,90,61,
  68. -9,-45,-63,-60,-75,-57,8,11,20,29,
  69. 0,-35,-49,-43,40,47,35,40,55,38,
  70. -24,-76,-103,-112,-27,3,23,34,52,75,
  71. 8,-29,-43,12,63,38,35,29,24,8,
  72. 25,11,1,-15,-18,-43,-7,37,40,21,
  73. -20,-56,-19,-19,-4,-2,11,29,51,63,
  74. -2,-44,-62,-75,-89,30,57,51,74,51,
  75. 50,46,68,64,65,52,63,55,65,43,
  76. 18,-9,-26,-35,-55,-69,3,6,8,17,
  77. -15,-61,-86,-97,1,86,93,74,78,67,
  78. -1,-38,-66,-48,48,39,29,25,17,-1,
  79. 13,13,29,39,50,51,69,82,97,98,
  80. -2,-36,-46,-27,-16,-30,-13,-4,-7,-4,
  81. 25,-5,-11,-6,-25,-21,33,12,31,29,
  82. -8,-38,-52,-63,-68,-89,-33,-1,10,74,
  83. -2,-15,59,91,105,105,101,87,84,62,
  84. -7,-33,-50,-35,-54,-47,25,17,82,81,
  85. -13,-56,-83,21,58,31,42,25,72,65,
  86. -24,-66,-91,-56,9,-2,21,10,69,75,
  87. 2,-24,11,22,25,28,38,34,48,33,
  88. 7,-29,-26,17,15,-1,14,0,-2,0,
  89. -6,-41,-67,6,-2,-9,19,2,85,74,
  90. -22,-67,-84,-71,-50,3,11,-9,2,62};
  91. const signed char cdbk_nb_low1[320]={
  92. -34,-52,-15,45,2,
  93. 23,21,52,24,-33,
  94. -9,-1,9,-44,-41,
  95. -13,-17,44,22,-17,
  96. -6,-4,-1,22,38,
  97. 26,16,2,50,27,
  98. -35,-34,-9,-41,6,
  99. 0,-16,-34,51,8,
  100. -14,-31,-49,15,-33,
  101. 45,49,33,-11,-37,
  102. -62,-54,45,11,-5,
  103. -72,11,-1,-12,-11,
  104. 24,27,-11,-43,46,
  105. 43,33,-12,-9,-1,
  106. 1,-4,-23,-57,-71,
  107. 11,8,16,17,-8,
  108. -20,-31,-41,53,48,
  109. -16,3,65,-24,-8,
  110. -23,-32,-37,-32,-49,
  111. -10,-17,6,38,5,
  112. -9,-17,-46,8,52,
  113. 3,6,45,40,39,
  114. -7,-6,-34,-74,31,
  115. 8,1,-16,43,68,
  116. -11,-19,-31,4,6,
  117. 0,-6,-17,-16,-38,
  118. -16,-30,2,9,-39,
  119. -16,-1,43,-10,48,
  120. 3,3,-16,-31,-3,
  121. 62,68,43,13,3,
  122. -10,8,20,-56,12,
  123. 12,-2,-18,22,-15,
  124. -40,-36,1,7,41,
  125. 0,1,46,-6,-62,
  126. -4,-12,-2,-11,-83,
  127. -13,-2,91,33,-10,
  128. 0,4,-11,-16,79,
  129. 32,37,14,9,51,
  130. -21,-28,-56,-34,0,
  131. 21,9,-26,11,28,
  132. -42,-54,-23,-2,-15,
  133. 31,30,8,-39,-66,
  134. -39,-36,31,-28,-40,
  135. -46,35,40,22,24,
  136. 33,48,23,-34,14,
  137. 40,32,17,27,-3,
  138. 25,26,-13,-61,-17,
  139. 11,4,31,60,-6,
  140. -26,-41,-64,13,16,
  141. -26,54,31,-11,-23,
  142. -9,-11,-34,-71,-21,
  143. -34,-35,55,50,29,
  144. -22,-27,-50,-38,57,
  145. 33,42,57,48,26,
  146. 11,0,-49,-31,26,
  147. -4,-14,5,78,37,
  148. 17,0,-49,-12,-23,
  149. 26,14,2,2,-43,
  150. -17,-12,10,-8,-4,
  151. 8,18,12,-6,20,
  152. -12,-6,-13,-25,34,
  153. 15,40,49,7,8,
  154. 13,20,20,-19,-22,
  155. -2,-8,2,51,-51};
  156. const signed char cdbk_nb_low2[320]={
  157. -6,53,-21,-24,4,
  158. 26,17,-4,-37,25,
  159. 17,-36,-13,31,3,
  160. -6,27,15,-10,31,
  161. 28,26,-10,-10,-40,
  162. 16,-7,15,13,41,
  163. -9,0,-4,50,-6,
  164. -7,14,38,22,0,
  165. -48,2,1,-13,-19,
  166. 32,-3,-60,11,-17,
  167. -1,-24,-34,-1,35,
  168. -5,-27,28,44,13,
  169. 25,15,42,-11,15,
  170. 51,35,-36,20,8,
  171. -4,-12,-29,19,-47,
  172. 49,-15,-4,16,-29,
  173. -39,14,-30,4,25,
  174. -9,-5,-51,-14,-3,
  175. -40,-32,38,5,-9,
  176. -8,-4,-1,-22,71,
  177. -3,14,26,-18,-22,
  178. 24,-41,-25,-24,6,
  179. 23,19,-10,39,-26,
  180. -27,65,45,2,-7,
  181. -26,-8,22,-12,16,
  182. 15,16,-35,-5,33,
  183. -21,-8,0,23,33,
  184. 34,6,21,36,6,
  185. -7,-22,8,-37,-14,
  186. 31,38,11,-4,-3,
  187. -39,-32,-8,32,-23,
  188. -6,-12,16,20,-28,
  189. -4,23,13,-52,-1,
  190. 22,6,-33,-40,-6,
  191. 4,-62,13,5,-26,
  192. 35,39,11,2,57,
  193. -11,9,-20,-28,-33,
  194. 52,-5,-6,-2,22,
  195. -14,-16,-48,35,1,
  196. -58,20,13,33,-1,
  197. -74,56,-18,-22,-31,
  198. 12,6,-14,4,-2,
  199. -9,-47,10,-3,29,
  200. -17,-5,61,14,47,
  201. -12,2,72,-39,-17,
  202. 92,64,-53,-51,-15,
  203. -30,-38,-41,-29,-28,
  204. 27,9,36,9,-35,
  205. -42,81,-21,20,25,
  206. -16,-5,-17,-35,21,
  207. 15,-28,48,2,-2,
  208. 9,-19,29,-40,30,
  209. -18,-18,18,-16,-57,
  210. 15,-20,-12,-15,-37,
  211. -15,33,-39,21,-22,
  212. -13,35,11,13,-38,
  213. -63,29,23,-27,32,
  214. 18,3,-26,42,33,
  215. -64,-66,-17,16,56,
  216. 2,36,3,31,21,
  217. -41,-39,8,-57,14,
  218. 37,-2,19,-36,-19,
  219. -23,-29,-16,1,-3,
  220. -8,-10,31,64,-65};
  221. const signed char cdbk_nb_high1[320]={
  222. -26,-8,29,21,4,
  223. 19,-39,33,-7,-36,
  224. 56,54,48,40,29,
  225. -4,-24,-42,-66,-43,
  226. -60,19,-2,37,41,
  227. -10,-37,-60,-64,18,
  228. -22,77,73,40,25,
  229. 4,19,-19,-66,-2,
  230. 11,5,21,14,26,
  231. -25,-86,-4,18,1,
  232. 26,-37,10,37,-1,
  233. 24,-12,-59,-11,20,
  234. -6,34,-16,-16,42,
  235. 19,-28,-51,53,32,
  236. 4,10,62,21,-12,
  237. -34,27,4,-48,-48,
  238. -50,-49,31,-7,-21,
  239. -42,-25,-4,-43,-22,
  240. 59,2,27,12,-9,
  241. -6,-16,-8,-32,-58,
  242. -16,-29,-5,41,23,
  243. -30,-33,-46,-13,-10,
  244. -38,52,52,1,-17,
  245. -9,10,26,-25,-6,
  246. 33,-20,53,55,25,
  247. -32,-5,-42,23,21,
  248. 66,5,-28,20,9,
  249. 75,29,-7,-42,-39,
  250. 15,3,-23,21,6,
  251. 11,1,-29,14,63,
  252. 10,54,26,-24,-51,
  253. -49,7,-23,-51,15,
  254. -66,1,60,25,10,
  255. 0,-30,-4,-15,17,
  256. 19,59,40,4,-5,
  257. 33,6,-22,-58,-70,
  258. -5,23,-6,60,44,
  259. -29,-16,-47,-29,52,
  260. -19,50,28,16,35,
  261. 31,36,0,-21,6,
  262. 21,27,22,42,7,
  263. -66,-40,-8,7,19,
  264. 46,0,-4,60,36,
  265. 45,-7,-29,-6,-32,
  266. -39,2,6,-9,33,
  267. 20,-51,-34,18,-6,
  268. 19,6,11,5,-19,
  269. -29,-2,42,-11,-45,
  270. -21,-55,57,37,2,
  271. -14,-67,-16,-27,-38,
  272. 69,48,19,2,-17,
  273. 20,-20,-16,-34,-17,
  274. -25,-61,10,73,45,
  275. 16,-40,-64,-17,-29,
  276. -22,56,17,-39,8,
  277. -11,8,-25,-18,-13,
  278. -19,8,54,57,36,
  279. -17,-26,-4,6,-21,
  280. 40,42,-4,20,31,
  281. 53,10,-34,-53,31,
  282. -17,35,0,15,-6,
  283. -20,-63,-73,22,25,
  284. 29,17,8,-29,-39,
  285. -69,18,15,-15,-5};
  286. const signed char cdbk_nb_high2[320]={
  287. 11,47,16,-9,-46,
  288. -32,26,-64,34,-5,
  289. 38,-7,47,20,2,
  290. -73,-99,-3,-45,20,
  291. 70,-52,15,-6,-7,
  292. -82,31,21,47,51,
  293. 39,-3,9,0,-41,
  294. -7,-15,-54,2,0,
  295. 27,-31,9,-45,-22,
  296. -38,-24,-24,8,-33,
  297. 23,5,50,-36,-17,
  298. -18,-51,-2,13,19,
  299. 43,12,-15,-12,61,
  300. 38,38,7,13,0,
  301. 6,-1,3,62,9,
  302. 27,22,-33,38,-35,
  303. -9,30,-43,-9,-32,
  304. -1,4,-4,1,-5,
  305. -11,-8,38,31,11,
  306. -10,-42,-21,-37,1,
  307. 43,15,-13,-35,-19,
  308. -18,15,23,-26,59,
  309. 1,-21,53,8,-41,
  310. -50,-14,-28,4,21,
  311. 25,-28,-40,5,-40,
  312. -41,4,51,-33,-8,
  313. -8,1,17,-60,12,
  314. 25,-41,17,34,43,
  315. 19,45,7,-37,24,
  316. -15,56,-2,35,-10,
  317. 48,4,-47,-2,5,
  318. -5,-54,5,-3,-33,
  319. -10,30,-2,-44,-24,
  320. -38,9,-9,42,4,
  321. 6,-56,44,-16,9,
  322. -40,-26,18,-20,10,
  323. 28,-41,-21,-4,13,
  324. -18,32,-30,-3,37,
  325. 15,22,28,50,-40,
  326. 3,-29,-64,7,51,
  327. -19,-11,17,-27,-40,
  328. -64,24,-12,-7,-27,
  329. 3,37,48,-1,2,
  330. -9,-38,-34,46,1,
  331. 27,-6,19,-13,26,
  332. 10,34,20,25,40,
  333. 50,-6,-7,30,9,
  334. -24,0,-23,71,-61,
  335. 22,58,-34,-4,2,
  336. -49,-33,25,30,-8,
  337. -6,-16,77,2,38,
  338. -8,-35,-6,-30,56,
  339. 78,31,33,-20,13,
  340. -39,20,22,4,21,
  341. -8,4,-6,10,-83,
  342. -41,9,-25,-43,15,
  343. -7,-12,-34,-39,-37,
  344. -33,19,30,16,-33,
  345. 42,-25,25,-68,44,
  346. -15,-11,-4,23,50,
  347. 14,4,-39,-43,20,
  348. -30,60,9,-20,7,
  349. 16,19,-33,37,29,
  350. 16,-35,7,38,-27};