residue_44.h 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  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-2009 *
  9. * by the Xiph.Org Foundation http://www.xiph.org/ *
  10. * *
  11. ********************************************************************
  12. function: toplevel residue templates for 32/44.1/48kHz
  13. last mod: $Id: residue_44.h 16962 2010-03-11 07:30:34Z xiphmont $
  14. ********************************************************************/
  15. #include "vorbis/codec.h"
  16. #include "backends.h"
  17. #include "books/coupled/res_books_stereo.h"
  18. /***** residue backends *********************************************/
  19. static const vorbis_info_residue0 _residue_44_low={
  20. 0,-1, -1, 9,-1,-1,
  21. /* 0 1 2 3 4 5 6 7 */
  22. {0},
  23. {-1},
  24. { 0, 1, 2, 2, 4, 8, 16, 32},
  25. { 0, 0, 0,999, 4, 8, 16, 32},
  26. };
  27. static const vorbis_info_residue0 _residue_44_mid={
  28. 0,-1, -1, 10,-1,-1,
  29. /* 0 1 2 3 4 5 6 7 8 */
  30. {0},
  31. {-1},
  32. { 0, 1, 1, 2, 2, 4, 8, 16, 32},
  33. { 0, 0,999, 0,999, 4, 8, 16, 32},
  34. };
  35. static const vorbis_info_residue0 _residue_44_high={
  36. 0,-1, -1, 10,-1,-1,
  37. /* 0 1 2 3 4 5 6 7 8 */
  38. {0},
  39. {-1},
  40. { 0, 1, 2, 4, 8, 16, 32, 71,157},
  41. { 0, 1, 2, 3, 4, 8, 16, 71,157},
  42. };
  43. static const static_bookblock _resbook_44s_n1={
  44. {
  45. {0},{0,0,&_44cn1_s_p1_0},{0,0,&_44cn1_s_p2_0},
  46. {0,0,&_44cn1_s_p3_0},{0,0,&_44cn1_s_p4_0},{0,0,&_44cn1_s_p5_0},
  47. {&_44cn1_s_p6_0,&_44cn1_s_p6_1},{&_44cn1_s_p7_0,&_44cn1_s_p7_1},
  48. {&_44cn1_s_p8_0,&_44cn1_s_p8_1,&_44cn1_s_p8_2}
  49. }
  50. };
  51. static const static_bookblock _resbook_44sm_n1={
  52. {
  53. {0},{0,0,&_44cn1_sm_p1_0},{0,0,&_44cn1_sm_p2_0},
  54. {0,0,&_44cn1_sm_p3_0},{0,0,&_44cn1_sm_p4_0},{0,0,&_44cn1_sm_p5_0},
  55. {&_44cn1_sm_p6_0,&_44cn1_sm_p6_1},{&_44cn1_sm_p7_0,&_44cn1_sm_p7_1},
  56. {&_44cn1_sm_p8_0,&_44cn1_sm_p8_1,&_44cn1_sm_p8_2}
  57. }
  58. };
  59. static const static_bookblock _resbook_44s_0={
  60. {
  61. {0},{0,0,&_44c0_s_p1_0},{0,0,&_44c0_s_p2_0},
  62. {0,0,&_44c0_s_p3_0},{0,0,&_44c0_s_p4_0},{0,0,&_44c0_s_p5_0},
  63. {&_44c0_s_p6_0,&_44c0_s_p6_1},{&_44c0_s_p7_0,&_44c0_s_p7_1},
  64. {&_44c0_s_p8_0,&_44c0_s_p8_1,&_44c0_s_p8_2}
  65. }
  66. };
  67. static const static_bookblock _resbook_44sm_0={
  68. {
  69. {0},{0,0,&_44c0_sm_p1_0},{0,0,&_44c0_sm_p2_0},
  70. {0,0,&_44c0_sm_p3_0},{0,0,&_44c0_sm_p4_0},{0,0,&_44c0_sm_p5_0},
  71. {&_44c0_sm_p6_0,&_44c0_sm_p6_1},{&_44c0_sm_p7_0,&_44c0_sm_p7_1},
  72. {&_44c0_sm_p8_0,&_44c0_sm_p8_1,&_44c0_sm_p8_2}
  73. }
  74. };
  75. static const static_bookblock _resbook_44s_1={
  76. {
  77. {0},{0,0,&_44c1_s_p1_0},{0,0,&_44c1_s_p2_0},
  78. {0,0,&_44c1_s_p3_0},{0,0,&_44c1_s_p4_0},{0,0,&_44c1_s_p5_0},
  79. {&_44c1_s_p6_0,&_44c1_s_p6_1},{&_44c1_s_p7_0,&_44c1_s_p7_1},
  80. {&_44c1_s_p8_0,&_44c1_s_p8_1,&_44c1_s_p8_2}
  81. }
  82. };
  83. static const static_bookblock _resbook_44sm_1={
  84. {
  85. {0},{0,0,&_44c1_sm_p1_0},{0,0,&_44c1_sm_p2_0},
  86. {0,0,&_44c1_sm_p3_0},{0,0,&_44c1_sm_p4_0},{0,0,&_44c1_sm_p5_0},
  87. {&_44c1_sm_p6_0,&_44c1_sm_p6_1},{&_44c1_sm_p7_0,&_44c1_sm_p7_1},
  88. {&_44c1_sm_p8_0,&_44c1_sm_p8_1,&_44c1_sm_p8_2}
  89. }
  90. };
  91. static const static_bookblock _resbook_44s_2={
  92. {
  93. {0},{0,0,&_44c2_s_p1_0},{0,0,&_44c2_s_p2_0},{0,0,&_44c2_s_p3_0},
  94. {0,0,&_44c2_s_p4_0},{0,0,&_44c2_s_p5_0},{0,0,&_44c2_s_p6_0},
  95. {&_44c2_s_p7_0,&_44c2_s_p7_1},{&_44c2_s_p8_0,&_44c2_s_p8_1},
  96. {&_44c2_s_p9_0,&_44c2_s_p9_1,&_44c2_s_p9_2}
  97. }
  98. };
  99. static const static_bookblock _resbook_44s_3={
  100. {
  101. {0},{0,0,&_44c3_s_p1_0},{0,0,&_44c3_s_p2_0},{0,0,&_44c3_s_p3_0},
  102. {0,0,&_44c3_s_p4_0},{0,0,&_44c3_s_p5_0},{0,0,&_44c3_s_p6_0},
  103. {&_44c3_s_p7_0,&_44c3_s_p7_1},{&_44c3_s_p8_0,&_44c3_s_p8_1},
  104. {&_44c3_s_p9_0,&_44c3_s_p9_1,&_44c3_s_p9_2}
  105. }
  106. };
  107. static const static_bookblock _resbook_44s_4={
  108. {
  109. {0},{0,0,&_44c4_s_p1_0},{0,0,&_44c4_s_p2_0},{0,0,&_44c4_s_p3_0},
  110. {0,0,&_44c4_s_p4_0},{0,0,&_44c4_s_p5_0},{0,0,&_44c4_s_p6_0},
  111. {&_44c4_s_p7_0,&_44c4_s_p7_1},{&_44c4_s_p8_0,&_44c4_s_p8_1},
  112. {&_44c4_s_p9_0,&_44c4_s_p9_1,&_44c4_s_p9_2}
  113. }
  114. };
  115. static const static_bookblock _resbook_44s_5={
  116. {
  117. {0},{0,0,&_44c5_s_p1_0},{0,0,&_44c5_s_p2_0},{0,0,&_44c5_s_p3_0},
  118. {0,0,&_44c5_s_p4_0},{0,0,&_44c5_s_p5_0},{0,0,&_44c5_s_p6_0},
  119. {&_44c5_s_p7_0,&_44c5_s_p7_1},{&_44c5_s_p8_0,&_44c5_s_p8_1},
  120. {&_44c5_s_p9_0,&_44c5_s_p9_1,&_44c5_s_p9_2}
  121. }
  122. };
  123. static const static_bookblock _resbook_44s_6={
  124. {
  125. {0},{0,0,&_44c6_s_p1_0},{0,0,&_44c6_s_p2_0},{0,0,&_44c6_s_p3_0},
  126. {0,0,&_44c6_s_p4_0},
  127. {&_44c6_s_p5_0,&_44c6_s_p5_1},
  128. {&_44c6_s_p6_0,&_44c6_s_p6_1},
  129. {&_44c6_s_p7_0,&_44c6_s_p7_1},
  130. {&_44c6_s_p8_0,&_44c6_s_p8_1},
  131. {&_44c6_s_p9_0,&_44c6_s_p9_1,&_44c6_s_p9_2}
  132. }
  133. };
  134. static const static_bookblock _resbook_44s_7={
  135. {
  136. {0},{0,0,&_44c7_s_p1_0},{0,0,&_44c7_s_p2_0},{0,0,&_44c7_s_p3_0},
  137. {0,0,&_44c7_s_p4_0},
  138. {&_44c7_s_p5_0,&_44c7_s_p5_1},
  139. {&_44c7_s_p6_0,&_44c7_s_p6_1},
  140. {&_44c7_s_p7_0,&_44c7_s_p7_1},
  141. {&_44c7_s_p8_0,&_44c7_s_p8_1},
  142. {&_44c7_s_p9_0,&_44c7_s_p9_1,&_44c7_s_p9_2}
  143. }
  144. };
  145. static const static_bookblock _resbook_44s_8={
  146. {
  147. {0},{0,0,&_44c8_s_p1_0},{0,0,&_44c8_s_p2_0},{0,0,&_44c8_s_p3_0},
  148. {0,0,&_44c8_s_p4_0},
  149. {&_44c8_s_p5_0,&_44c8_s_p5_1},
  150. {&_44c8_s_p6_0,&_44c8_s_p6_1},
  151. {&_44c8_s_p7_0,&_44c8_s_p7_1},
  152. {&_44c8_s_p8_0,&_44c8_s_p8_1},
  153. {&_44c8_s_p9_0,&_44c8_s_p9_1,&_44c8_s_p9_2}
  154. }
  155. };
  156. static const static_bookblock _resbook_44s_9={
  157. {
  158. {0},{0,0,&_44c9_s_p1_0},{0,0,&_44c9_s_p2_0},{0,0,&_44c9_s_p3_0},
  159. {0,0,&_44c9_s_p4_0},
  160. {&_44c9_s_p5_0,&_44c9_s_p5_1},
  161. {&_44c9_s_p6_0,&_44c9_s_p6_1},
  162. {&_44c9_s_p7_0,&_44c9_s_p7_1},
  163. {&_44c9_s_p8_0,&_44c9_s_p8_1},
  164. {&_44c9_s_p9_0,&_44c9_s_p9_1,&_44c9_s_p9_2}
  165. }
  166. };
  167. static const vorbis_residue_template _res_44s_n1[]={
  168. {2,0,32, &_residue_44_low,
  169. &_huff_book__44cn1_s_short,&_huff_book__44cn1_sm_short,
  170. &_resbook_44s_n1,&_resbook_44sm_n1},
  171. {2,0,32, &_residue_44_low,
  172. &_huff_book__44cn1_s_long,&_huff_book__44cn1_sm_long,
  173. &_resbook_44s_n1,&_resbook_44sm_n1}
  174. };
  175. static const vorbis_residue_template _res_44s_0[]={
  176. {2,0,16, &_residue_44_low,
  177. &_huff_book__44c0_s_short,&_huff_book__44c0_sm_short,
  178. &_resbook_44s_0,&_resbook_44sm_0},
  179. {2,0,32, &_residue_44_low,
  180. &_huff_book__44c0_s_long,&_huff_book__44c0_sm_long,
  181. &_resbook_44s_0,&_resbook_44sm_0}
  182. };
  183. static const vorbis_residue_template _res_44s_1[]={
  184. {2,0,16, &_residue_44_low,
  185. &_huff_book__44c1_s_short,&_huff_book__44c1_sm_short,
  186. &_resbook_44s_1,&_resbook_44sm_1},
  187. {2,0,32, &_residue_44_low,
  188. &_huff_book__44c1_s_long,&_huff_book__44c1_sm_long,
  189. &_resbook_44s_1,&_resbook_44sm_1}
  190. };
  191. static const vorbis_residue_template _res_44s_2[]={
  192. {2,0,16, &_residue_44_mid,
  193. &_huff_book__44c2_s_short,&_huff_book__44c2_s_short,
  194. &_resbook_44s_2,&_resbook_44s_2},
  195. {2,0,32, &_residue_44_mid,
  196. &_huff_book__44c2_s_long,&_huff_book__44c2_s_long,
  197. &_resbook_44s_2,&_resbook_44s_2}
  198. };
  199. static const vorbis_residue_template _res_44s_3[]={
  200. {2,0,16, &_residue_44_mid,
  201. &_huff_book__44c3_s_short,&_huff_book__44c3_s_short,
  202. &_resbook_44s_3,&_resbook_44s_3},
  203. {2,0,32, &_residue_44_mid,
  204. &_huff_book__44c3_s_long,&_huff_book__44c3_s_long,
  205. &_resbook_44s_3,&_resbook_44s_3}
  206. };
  207. static const vorbis_residue_template _res_44s_4[]={
  208. {2,0,16, &_residue_44_mid,
  209. &_huff_book__44c4_s_short,&_huff_book__44c4_s_short,
  210. &_resbook_44s_4,&_resbook_44s_4},
  211. {2,0,32, &_residue_44_mid,
  212. &_huff_book__44c4_s_long,&_huff_book__44c4_s_long,
  213. &_resbook_44s_4,&_resbook_44s_4}
  214. };
  215. static const vorbis_residue_template _res_44s_5[]={
  216. {2,0,16, &_residue_44_mid,
  217. &_huff_book__44c5_s_short,&_huff_book__44c5_s_short,
  218. &_resbook_44s_5,&_resbook_44s_5},
  219. {2,0,32, &_residue_44_mid,
  220. &_huff_book__44c5_s_long,&_huff_book__44c5_s_long,
  221. &_resbook_44s_5,&_resbook_44s_5}
  222. };
  223. static const vorbis_residue_template _res_44s_6[]={
  224. {2,0,16, &_residue_44_high,
  225. &_huff_book__44c6_s_short,&_huff_book__44c6_s_short,
  226. &_resbook_44s_6,&_resbook_44s_6},
  227. {2,0,32, &_residue_44_high,
  228. &_huff_book__44c6_s_long,&_huff_book__44c6_s_long,
  229. &_resbook_44s_6,&_resbook_44s_6}
  230. };
  231. static const vorbis_residue_template _res_44s_7[]={
  232. {2,0,16, &_residue_44_high,
  233. &_huff_book__44c7_s_short,&_huff_book__44c7_s_short,
  234. &_resbook_44s_7,&_resbook_44s_7},
  235. {2,0,32, &_residue_44_high,
  236. &_huff_book__44c7_s_long,&_huff_book__44c7_s_long,
  237. &_resbook_44s_7,&_resbook_44s_7}
  238. };
  239. static const vorbis_residue_template _res_44s_8[]={
  240. {2,0,16, &_residue_44_high,
  241. &_huff_book__44c8_s_short,&_huff_book__44c8_s_short,
  242. &_resbook_44s_8,&_resbook_44s_8},
  243. {2,0,32, &_residue_44_high,
  244. &_huff_book__44c8_s_long,&_huff_book__44c8_s_long,
  245. &_resbook_44s_8,&_resbook_44s_8}
  246. };
  247. static const vorbis_residue_template _res_44s_9[]={
  248. {2,0,16, &_residue_44_high,
  249. &_huff_book__44c9_s_short,&_huff_book__44c9_s_short,
  250. &_resbook_44s_9,&_resbook_44s_9},
  251. {2,0,32, &_residue_44_high,
  252. &_huff_book__44c9_s_long,&_huff_book__44c9_s_long,
  253. &_resbook_44s_9,&_resbook_44s_9}
  254. };
  255. static const vorbis_mapping_template _mapres_template_44_stereo[]={
  256. { _map_nominal, _res_44s_n1 }, /* -1 */
  257. { _map_nominal, _res_44s_0 }, /* 0 */
  258. { _map_nominal, _res_44s_1 }, /* 1 */
  259. { _map_nominal, _res_44s_2 }, /* 2 */
  260. { _map_nominal, _res_44s_3 }, /* 3 */
  261. { _map_nominal, _res_44s_4 }, /* 4 */
  262. { _map_nominal, _res_44s_5 }, /* 5 */
  263. { _map_nominal, _res_44s_6 }, /* 6 */
  264. { _map_nominal, _res_44s_7 }, /* 7 */
  265. { _map_nominal, _res_44s_8 }, /* 8 */
  266. { _map_nominal, _res_44s_9 }, /* 9 */
  267. };