residue_44p51.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. /********************************************************************
  2. * *
  3. * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
  4. * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
  5. * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
  6. * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
  7. * *
  8. * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 *
  9. * by the Xiph.Org Foundation http://www.xiph.org/ *
  10. * *
  11. ********************************************************************
  12. function: toplevel residue templates for 32/44.1/48kHz uncoupled
  13. last mod: $Id: residue_44p51.h 19013 2013-11-12 04:04:50Z giles $
  14. ********************************************************************/
  15. #include "vorbis/codec.h"
  16. #include "backends.h"
  17. #include "books/coupled/res_books_51.h"
  18. /***** residue backends *********************************************/
  19. static const vorbis_info_residue0 _residue_44p_lo={
  20. 0,-1, -1, 7,-1,-1,
  21. /* 0 1 2 3 4 5 6 7 8 */
  22. {0},
  23. {-1},
  24. { 0, 1, 2, 7, 17, 31},
  25. { 0, 0, 99, 7, 17, 31},
  26. };
  27. static const vorbis_info_residue0 _residue_44p={
  28. 0,-1, -1, 8,-1,-1,
  29. /* 0 1 2 3 4 5 6 7 8 */
  30. {0},
  31. {-1},
  32. { 0, 1, 1, 2, 7, 17, 31},
  33. { 0, 0, 99, 99, 7, 17, 31},
  34. };
  35. static const vorbis_info_residue0 _residue_44p_hi={
  36. 0,-1, -1, 8,-1,-1,
  37. /* 0 1 2 3 4 5 6 7 8 */
  38. {0},
  39. {-1},
  40. { 0, 1, 2, 4, 7, 17, 31},
  41. { 0, 1, 2, 4, 7, 17, 31},
  42. };
  43. static const vorbis_info_residue0 _residue_44p_lfe={
  44. 0,-1, -1, 2,-1,-1,
  45. /* 0 1 2 3 4 5 6 7 8 */
  46. {0},
  47. {-1},
  48. { 32},
  49. { -1}
  50. };
  51. static const static_bookblock _resbook_44p_n1={
  52. {
  53. {0},
  54. {0,&_44pn1_p1_0},
  55. {&_44pn1_p2_0,&_44pn1_p2_1,0},
  56. {&_44pn1_p3_0,&_44pn1_p3_1,0},
  57. {&_44pn1_p4_0,&_44pn1_p4_1,0},
  58. {&_44pn1_p5_0,&_44pn1_p5_1,&_44pn1_p4_1},
  59. {&_44pn1_p6_0,&_44pn1_p6_1,&_44pn1_p6_2},
  60. }
  61. };
  62. static const static_bookblock _resbook_44p_0={
  63. {
  64. {0},
  65. {0,&_44p0_p1_0},
  66. {&_44p0_p2_0,&_44p0_p2_1,0},
  67. {&_44p0_p3_0,&_44p0_p3_1,0},
  68. {&_44p0_p4_0,&_44p0_p4_1,0},
  69. {&_44p0_p5_0,&_44p0_p5_1,&_44p0_p4_1},
  70. {&_44p0_p6_0,&_44p0_p6_1,&_44p0_p6_2},
  71. }
  72. };
  73. static const static_bookblock _resbook_44p_1={
  74. {
  75. {0},
  76. {0,&_44p1_p1_0},
  77. {&_44p1_p2_0,&_44p1_p2_1,0},
  78. {&_44p1_p3_0,&_44p1_p3_1,0},
  79. {&_44p1_p4_0,&_44p1_p4_1,0},
  80. {&_44p1_p5_0,&_44p1_p5_1,&_44p1_p4_1},
  81. {&_44p1_p6_0,&_44p1_p6_1,&_44p1_p6_2},
  82. }
  83. };
  84. static const static_bookblock _resbook_44p_2={
  85. {
  86. {0},
  87. {0,0,&_44p2_p1_0},
  88. {0,&_44p2_p2_0,0},
  89. {&_44p2_p3_0,&_44p2_p3_1,0},
  90. {&_44p2_p4_0,&_44p2_p4_1,0},
  91. {&_44p2_p5_0,&_44p2_p5_1,0},
  92. {&_44p2_p6_0,&_44p2_p6_1,&_44p2_p5_1},
  93. {&_44p2_p7_0,&_44p2_p7_1,&_44p2_p7_2,&_44p2_p7_3}
  94. }
  95. };
  96. static const static_bookblock _resbook_44p_3={
  97. {
  98. {0},
  99. {0,0,&_44p3_p1_0},
  100. {0,&_44p3_p2_0,0},
  101. {&_44p3_p3_0,&_44p3_p3_1,0},
  102. {&_44p3_p4_0,&_44p3_p4_1,0},
  103. {&_44p3_p5_0,&_44p3_p5_1,0},
  104. {&_44p3_p6_0,&_44p3_p6_1,&_44p3_p5_1},
  105. {&_44p3_p7_0,&_44p3_p7_1,&_44p3_p7_2,&_44p3_p7_3}
  106. }
  107. };
  108. static const static_bookblock _resbook_44p_4={
  109. {
  110. {0},
  111. {0,0,&_44p4_p1_0},
  112. {0,&_44p4_p2_0,0},
  113. {&_44p4_p3_0,&_44p4_p3_1,0},
  114. {&_44p4_p4_0,&_44p4_p4_1,0},
  115. {&_44p4_p5_0,&_44p4_p5_1,0},
  116. {&_44p4_p6_0,&_44p4_p6_1,&_44p4_p5_1},
  117. {&_44p4_p7_0,&_44p4_p7_1,&_44p4_p7_2,&_44p4_p7_3}
  118. }
  119. };
  120. static const static_bookblock _resbook_44p_5={
  121. {
  122. {0},
  123. {0,0,&_44p5_p1_0},
  124. {0,&_44p5_p2_0,0},
  125. {&_44p5_p3_0,&_44p5_p3_1,0},
  126. {&_44p5_p4_0,&_44p5_p4_1,0},
  127. {&_44p5_p5_0,&_44p5_p5_1,0},
  128. {&_44p5_p6_0,&_44p5_p6_1,&_44p5_p5_1},
  129. {&_44p5_p7_0,&_44p5_p7_1,&_44p5_p7_2,&_44p5_p7_3}
  130. }
  131. };
  132. static const static_bookblock _resbook_44p_6={
  133. {
  134. {0},
  135. {0,0,&_44p6_p1_0},
  136. {0,&_44p6_p2_0,0},
  137. {&_44p6_p3_0,&_44p6_p3_1,0},
  138. {&_44p6_p4_0,&_44p6_p4_1,0},
  139. {&_44p6_p5_0,&_44p6_p5_1,0},
  140. {&_44p6_p6_0,&_44p6_p6_1,&_44p6_p5_1},
  141. {&_44p6_p7_0,&_44p6_p7_1,&_44p6_p7_2,&_44p6_p7_3}
  142. }
  143. };
  144. static const static_bookblock _resbook_44p_7={
  145. {
  146. {0},
  147. {0,0,&_44p7_p1_0},
  148. {0,&_44p7_p2_0,0},
  149. {&_44p7_p3_0,&_44p7_p3_1,0},
  150. {&_44p7_p4_0,&_44p7_p4_1,0},
  151. {&_44p7_p5_0,&_44p7_p5_1,0},
  152. {&_44p7_p6_0,&_44p7_p6_1,&_44p7_p5_1},
  153. {&_44p7_p7_0,&_44p7_p7_1,&_44p7_p7_2,&_44p7_p7_3}
  154. }
  155. };
  156. static const static_bookblock _resbook_44p_8={
  157. {
  158. {0},
  159. {0,0,&_44p8_p1_0},
  160. {0,&_44p8_p2_0,0},
  161. {&_44p8_p3_0,&_44p8_p3_1,0},
  162. {&_44p8_p4_0,&_44p8_p4_1,0},
  163. {&_44p8_p5_0,&_44p8_p5_1,0},
  164. {&_44p8_p6_0,&_44p8_p6_1,&_44p8_p5_1},
  165. {&_44p8_p7_0,&_44p8_p7_1,&_44p8_p7_2,&_44p8_p7_3}
  166. }
  167. };
  168. static const static_bookblock _resbook_44p_9={
  169. {
  170. {0},
  171. {0,0,&_44p9_p1_0},
  172. {0,&_44p9_p2_0,0},
  173. {&_44p9_p3_0,&_44p9_p3_1,0},
  174. {&_44p9_p4_0,&_44p9_p4_1,0},
  175. {&_44p9_p5_0,&_44p9_p5_1,0},
  176. {&_44p9_p6_0,&_44p9_p6_1,&_44p9_p5_1},
  177. {&_44p9_p7_0,&_44p9_p7_1,&_44p9_p7_2,&_44p9_p7_3}
  178. }
  179. };
  180. static const static_bookblock _resbook_44p_ln1={
  181. {
  182. {&_44pn1_l0_0,&_44pn1_l0_1,0},
  183. {&_44pn1_l1_0,&_44pn1_p6_1,&_44pn1_p6_2},
  184. }
  185. };
  186. static const static_bookblock _resbook_44p_l0={
  187. {
  188. {&_44p0_l0_0,&_44p0_l0_1,0},
  189. {&_44p0_l1_0,&_44p0_p6_1,&_44p0_p6_2},
  190. }
  191. };
  192. static const static_bookblock _resbook_44p_l1={
  193. {
  194. {&_44p1_l0_0,&_44p1_l0_1,0},
  195. {&_44p1_l1_0,&_44p1_p6_1,&_44p1_p6_2},
  196. }
  197. };
  198. static const static_bookblock _resbook_44p_l2={
  199. {
  200. {&_44p2_l0_0,&_44p2_l0_1,0},
  201. {&_44p2_l1_0,&_44p2_p7_2,&_44p2_p7_3},
  202. }
  203. };
  204. static const static_bookblock _resbook_44p_l3={
  205. {
  206. {&_44p3_l0_0,&_44p3_l0_1,0},
  207. {&_44p3_l1_0,&_44p3_p7_2,&_44p3_p7_3},
  208. }
  209. };
  210. static const static_bookblock _resbook_44p_l4={
  211. {
  212. {&_44p4_l0_0,&_44p4_l0_1,0},
  213. {&_44p4_l1_0,&_44p4_p7_2,&_44p4_p7_3},
  214. }
  215. };
  216. static const static_bookblock _resbook_44p_l5={
  217. {
  218. {&_44p5_l0_0,&_44p5_l0_1,0},
  219. {&_44p5_l1_0,&_44p5_p7_2,&_44p5_p7_3},
  220. }
  221. };
  222. static const static_bookblock _resbook_44p_l6={
  223. {
  224. {&_44p6_l0_0,&_44p6_l0_1,0},
  225. {&_44p6_l1_0,&_44p6_p7_2,&_44p6_p7_3},
  226. }
  227. };
  228. static const static_bookblock _resbook_44p_l7={
  229. {
  230. {&_44p7_l0_0,&_44p7_l0_1,0},
  231. {&_44p7_l1_0,&_44p7_p7_2,&_44p7_p7_3},
  232. }
  233. };
  234. static const static_bookblock _resbook_44p_l8={
  235. {
  236. {&_44p8_l0_0,&_44p8_l0_1,0},
  237. {&_44p8_l1_0,&_44p8_p7_2,&_44p8_p7_3},
  238. }
  239. };
  240. static const static_bookblock _resbook_44p_l9={
  241. {
  242. {&_44p9_l0_0,&_44p9_l0_1,0},
  243. {&_44p9_l1_0,&_44p9_p7_2,&_44p9_p7_3},
  244. }
  245. };
  246. static const vorbis_info_mapping0 _map_nominal_51[2]={
  247. {2, {0,0,0,0,0,1}, {0,2}, {0,2}, 4,{0,3,0,0},{2,4,1,3}},
  248. {2, {0,0,0,0,0,1}, {1,2}, {1,2}, 4,{0,3,0,0},{2,4,1,3}}
  249. };
  250. static const vorbis_info_mapping0 _map_nominal_51u[2]={
  251. {2, {0,0,0,0,0,1}, {0,2}, {0,2}, 0,{0},{0}},
  252. {2, {0,0,0,0,0,1}, {1,2}, {1,2}, 0,{0},{0}}
  253. };
  254. static const vorbis_residue_template _res_44p51_n1[]={
  255. {2,0,30, &_residue_44p_lo,
  256. &_huff_book__44pn1_short,&_huff_book__44pn1_short,
  257. &_resbook_44p_n1,&_resbook_44p_n1},
  258. {2,0,30, &_residue_44p_lo,
  259. &_huff_book__44pn1_long,&_huff_book__44pn1_long,
  260. &_resbook_44p_n1,&_resbook_44p_n1},
  261. {1,2,6, &_residue_44p_lfe,
  262. &_huff_book__44pn1_lfe,&_huff_book__44pn1_lfe,
  263. &_resbook_44p_ln1,&_resbook_44p_ln1}
  264. };
  265. static const vorbis_residue_template _res_44p51_0[]={
  266. {2,0,15, &_residue_44p_lo,
  267. &_huff_book__44p0_short,&_huff_book__44p0_short,
  268. &_resbook_44p_0,&_resbook_44p_0},
  269. {2,0,30, &_residue_44p_lo,
  270. &_huff_book__44p0_long,&_huff_book__44p0_long,
  271. &_resbook_44p_0,&_resbook_44p_0},
  272. {1,2,6, &_residue_44p_lfe,
  273. &_huff_book__44p0_lfe,&_huff_book__44p0_lfe,
  274. &_resbook_44p_l0,&_resbook_44p_l0}
  275. };
  276. static const vorbis_residue_template _res_44p51_1[]={
  277. {2,0,15, &_residue_44p_lo,
  278. &_huff_book__44p1_short,&_huff_book__44p1_short,
  279. &_resbook_44p_1,&_resbook_44p_1},
  280. {2,0,30, &_residue_44p_lo,
  281. &_huff_book__44p1_long,&_huff_book__44p1_long,
  282. &_resbook_44p_1,&_resbook_44p_1},
  283. {1,2,6, &_residue_44p_lfe,
  284. &_huff_book__44p1_lfe,&_huff_book__44p1_lfe,
  285. &_resbook_44p_l1,&_resbook_44p_l1}
  286. };
  287. static const vorbis_residue_template _res_44p51_2[]={
  288. {2,0,15, &_residue_44p,
  289. &_huff_book__44p2_short,&_huff_book__44p2_short,
  290. &_resbook_44p_2,&_resbook_44p_2},
  291. {2,0,30, &_residue_44p,
  292. &_huff_book__44p2_long,&_huff_book__44p2_long,
  293. &_resbook_44p_2,&_resbook_44p_2},
  294. {1,2,6, &_residue_44p_lfe,
  295. &_huff_book__44p2_lfe,&_huff_book__44p2_lfe,
  296. &_resbook_44p_l2,&_resbook_44p_l2}
  297. };
  298. static const vorbis_residue_template _res_44p51_3[]={
  299. {2,0,15, &_residue_44p,
  300. &_huff_book__44p3_short,&_huff_book__44p3_short,
  301. &_resbook_44p_3,&_resbook_44p_3},
  302. {2,0,30, &_residue_44p,
  303. &_huff_book__44p3_long,&_huff_book__44p3_long,
  304. &_resbook_44p_3,&_resbook_44p_3},
  305. {1,2,6, &_residue_44p_lfe,
  306. &_huff_book__44p3_lfe,&_huff_book__44p3_lfe,
  307. &_resbook_44p_l3,&_resbook_44p_l3}
  308. };
  309. static const vorbis_residue_template _res_44p51_4[]={
  310. {2,0,15, &_residue_44p,
  311. &_huff_book__44p4_short,&_huff_book__44p4_short,
  312. &_resbook_44p_4,&_resbook_44p_4},
  313. {2,0,30, &_residue_44p,
  314. &_huff_book__44p4_long,&_huff_book__44p4_long,
  315. &_resbook_44p_4,&_resbook_44p_4},
  316. {1,2,6, &_residue_44p_lfe,
  317. &_huff_book__44p4_lfe,&_huff_book__44p4_lfe,
  318. &_resbook_44p_l4,&_resbook_44p_l4}
  319. };
  320. static const vorbis_residue_template _res_44p51_5[]={
  321. {2,0,15, &_residue_44p_hi,
  322. &_huff_book__44p5_short,&_huff_book__44p5_short,
  323. &_resbook_44p_5,&_resbook_44p_5},
  324. {2,0,30, &_residue_44p_hi,
  325. &_huff_book__44p5_long,&_huff_book__44p5_long,
  326. &_resbook_44p_5,&_resbook_44p_5},
  327. {1,2,6, &_residue_44p_lfe,
  328. &_huff_book__44p5_lfe,&_huff_book__44p5_lfe,
  329. &_resbook_44p_l5,&_resbook_44p_l5}
  330. };
  331. static const vorbis_residue_template _res_44p51_6[]={
  332. {2,0,15, &_residue_44p_hi,
  333. &_huff_book__44p6_short,&_huff_book__44p6_short,
  334. &_resbook_44p_6,&_resbook_44p_6},
  335. {2,0,30, &_residue_44p_hi,
  336. &_huff_book__44p6_long,&_huff_book__44p6_long,
  337. &_resbook_44p_6,&_resbook_44p_6},
  338. {1,2,6, &_residue_44p_lfe,
  339. &_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
  340. &_resbook_44p_l6,&_resbook_44p_l6}
  341. };
  342. static const vorbis_residue_template _res_44p51_7[]={
  343. {2,0,15, &_residue_44p_hi,
  344. &_huff_book__44p7_short,&_huff_book__44p7_short,
  345. &_resbook_44p_7,&_resbook_44p_7},
  346. {2,0,30, &_residue_44p_hi,
  347. &_huff_book__44p7_long,&_huff_book__44p7_long,
  348. &_resbook_44p_7,&_resbook_44p_7},
  349. {1,2,6, &_residue_44p_lfe,
  350. &_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
  351. &_resbook_44p_l6,&_resbook_44p_l6}
  352. };
  353. static const vorbis_residue_template _res_44p51_8[]={
  354. {2,0,15, &_residue_44p_hi,
  355. &_huff_book__44p8_short,&_huff_book__44p8_short,
  356. &_resbook_44p_8,&_resbook_44p_8},
  357. {2,0,30, &_residue_44p_hi,
  358. &_huff_book__44p8_long,&_huff_book__44p8_long,
  359. &_resbook_44p_8,&_resbook_44p_8},
  360. {1,2,6, &_residue_44p_lfe,
  361. &_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
  362. &_resbook_44p_l6,&_resbook_44p_l6}
  363. };
  364. static const vorbis_residue_template _res_44p51_9[]={
  365. {2,0,15, &_residue_44p_hi,
  366. &_huff_book__44p9_short,&_huff_book__44p9_short,
  367. &_resbook_44p_9,&_resbook_44p_9},
  368. {2,0,30, &_residue_44p_hi,
  369. &_huff_book__44p9_long,&_huff_book__44p9_long,
  370. &_resbook_44p_9,&_resbook_44p_9},
  371. {1,2,6, &_residue_44p_lfe,
  372. &_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
  373. &_resbook_44p_l6,&_resbook_44p_l6}
  374. };
  375. static const vorbis_mapping_template _mapres_template_44_51[]={
  376. { _map_nominal_51, _res_44p51_n1 }, /* -1 */
  377. { _map_nominal_51, _res_44p51_0 }, /* 0 */
  378. { _map_nominal_51, _res_44p51_1 }, /* 1 */
  379. { _map_nominal_51, _res_44p51_2 }, /* 2 */
  380. { _map_nominal_51, _res_44p51_3 }, /* 3 */
  381. { _map_nominal_51, _res_44p51_4 }, /* 4 */
  382. { _map_nominal_51u, _res_44p51_5 }, /* 5 */
  383. { _map_nominal_51u, _res_44p51_6 }, /* 6 */
  384. { _map_nominal_51u, _res_44p51_7 }, /* 7 */
  385. { _map_nominal_51u, _res_44p51_8 }, /* 8 */
  386. { _map_nominal_51u, _res_44p51_9 }, /* 9 */
  387. };