mode_C.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  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-2001 *
  9. * by the XIPHOPHORUS Company http://www.xiph.org/ *
  10. ********************************************************************
  11. function: predefined encoding modes
  12. last mod: $Id: mode_C.h,v 1.13.2.3 2001/08/12 11:03:20 xiphmont Exp $
  13. ********************************************************************/
  14. #ifndef _V_MODES_C_H_
  15. #define _V_MODES_C_H_
  16. #include <stdio.h>
  17. #include "vorbis/codec.h"
  18. #include "backends.h"
  19. #include "books/line0_class1.vqh"
  20. #include "books/line0_class2.vqh"
  21. #include "books/line1_class0.vqh"
  22. #include "books/line1_class1.vqh"
  23. #include "books/line1_class2.vqh"
  24. #include "books/line1_class3.vqh"
  25. #include "books/line0_0sub0.vqh"
  26. #include "books/line0_1sub1.vqh"
  27. #include "books/line0_1sub2.vqh"
  28. #include "books/line0_1sub3.vqh"
  29. #include "books/line0_2sub1.vqh"
  30. #include "books/line0_2sub2.vqh"
  31. #include "books/line0_2sub3.vqh"
  32. #include "books/line1_0sub0.vqh"
  33. #include "books/line1_0sub1.vqh"
  34. #include "books/line1_1sub0.vqh"
  35. #include "books/line1_1sub1.vqh"
  36. #include "books/line1_2sub1.vqh"
  37. #include "books/line1_2sub2.vqh"
  38. #include "books/line1_2sub3.vqh"
  39. #include "books/line1_3sub1.vqh"
  40. #include "books/line1_3sub2.vqh"
  41. #include "books/line1_3sub3.vqh"
  42. #include "books/res0_128_128aux.vqh"
  43. #include "books/res0_128_1024aux.vqh"
  44. #include "books/res0_128_1024_1.vqh"
  45. #include "books/res0_128_1024_2.vqh"
  46. #include "books/res0_128_1024_3.vqh"
  47. #include "books/res0_128_1024_4.vqh"
  48. #include "books/res0_128_1024_5.vqh"
  49. #include "books/res0_128_1024_6.vqh"
  50. #include "books/res0_128_1024_7.vqh"
  51. #include "books/res0_128_1024_8.vqh"
  52. #include "books/res0_128_1024_8a.vqh"
  53. #include "books/res0_128_1024_9.vqh"
  54. #include "books/res0_128_1024_9a.vqh"
  55. #include "books/res0_128_1024_9b.vqh"
  56. static vorbis_info_psy_global _psy_set_CG={
  57. 0, /* decaydBpms */
  58. 8, /* lines per eighth octave */
  59. /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
  60. 256, {26.f,26.f,26.f,30.f}, {-90.f,-90.f,-90.f,-90.f}, -90.f,
  61. -6.f,
  62. 0,
  63. };
  64. static struct vp_couple_pass _psy_passC0[]={
  65. {1.f,1.f,
  66. {{24, 0,0, 0,0, 0,0},
  67. {9999, 4.5,0, 0,12, 0,0}}
  68. },
  69. };
  70. static vp_couple_pass _psy_passC[]={
  71. {1.f,1.f,
  72. {{512, 0,0, 0,0, 0,0},
  73. {9999, 4.5,0, 0,12, 0,0}}
  74. }
  75. };
  76. static vp_attenblock _vp_tonemask_consbass_C={
  77. {{-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*63*/
  78. {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*88*/
  79. {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*125*/
  80. {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*175*/
  81. {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*250*/
  82. {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*350*/
  83. {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*500*/
  84. {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*700*/
  85. {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1000*/
  86. {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1400*/
  87. {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2000*/
  88. {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2800*/
  89. {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*4000*/
  90. {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*5600*/
  91. {-30.f,-30.f,-33.f,-35.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*8000*/
  92. {-30.f,-30.f,-33.f,-35.f,-35.f,-45.f,-50.f,-60.f,-70.f,-90.f,-100.f}, /*11500*/
  93. {-24.f,-24.f,-26.f,-32.f,-32.f,-42.f,-50.f,-60.f,-70.f,-90.f,-100.f}, /*16000*/
  94. }};
  95. static vp_attenblock _vp_tonemask_C={
  96. {{-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*63*/
  97. {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*88*/
  98. {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*125*/
  99. {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*175*/
  100. {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*250*/
  101. {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*350*/
  102. {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*500*/
  103. {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*700*/
  104. {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1000*/
  105. {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1400*/
  106. {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2000*/
  107. {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2800*/
  108. {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*4000*/
  109. {-30.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*5600*/
  110. {-30.f,-30.f,-33.f,-35.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*8000*/
  111. {-30.f,-30.f,-33.f,-35.f,-40.f,-45.f,-50.f,-60.f,-70.f,-85.f,-100.f}, /*11500*/
  112. {-24.f,-24.f,-26.f,-32.f,-32.f,-42.f,-50.f,-60.f,-70.f,-85.f,-100.f}, /*16000*/
  113. }};
  114. static vp_attenblock _vp_peakatt_C={
  115. {{-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*63*/
  116. {-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*88*/
  117. {-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*125*/
  118. {-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*175*/
  119. {-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*250*/
  120. {-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*350*/
  121. {-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*500*/
  122. {-10.f,-10.f,-10.f,-14.f,-20.f,-20.f,-20.f,-24.f,-26.f,-32.f,-40.f},/*700*/
  123. {-10.f,-10.f,-10.f,-14.f,-20.f,-20.f,-20.f,-24.f,-26.f,-32.f,-40.f},/*1000*/
  124. {-10.f,-10.f,-10.f,-14.f,-20.f,-20.f,-20.f,-24.f,-26.f,-32.f,-40.f},/*1400*/
  125. {-10.f,-10.f,-10.f,-14.f,-20.f,-20.f,-20.f,-24.f,-26.f,-32.f,-40.f},/*2000*/
  126. {-10.f,-10.f,-10.f,-14.f,-20.f,-20.f,-20.f,-24.f,-26.f,-32.f,-40.f},/*2800*/
  127. {-10.f,-10.f,-10.f,-10.f,-18.f,-20.f,-20.f,-22.f,-24.f,-32.f,-40.f},/*4000*/
  128. {-10.f,-10.f,-10.f,-10.f,-12.f,-14.f,-16.f,-18.f,-22.f,-32.f,-40.f},/*5600*/
  129. {-10.f,-10.f,-10.f,-10.f,-10.f,-11.f,-12.f,-13.f,-22.f,-32.f,-40.f},/*8000*/
  130. {-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-11.f,-22.f,-32.f,-40.f},/*11500*/
  131. {-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-20.f,-32.f,-40.f},/*16000*/
  132. }};
  133. static vorbis_info_psy _psy_set_C0={
  134. ATH_Bark_dB_lineaggressive,
  135. -100.,
  136. -140.,
  137. /* tonemask */
  138. -3.f, -45.f, &_vp_tonemask_consbass_C,
  139. /* peakattp */
  140. 0, &_vp_peakatt_C,
  141. /*noisemaskp */
  142. 1,-30.f, /* suppress any noise curve over maxspec+n */
  143. .6f, .6f, /* low/high window */
  144. 5, 5, 10,
  145. /*63 125 250 500 1k 2k 4k 8k 16k*/
  146. {-30,-30,-30,-30,-30,-30,-20,-10, 0, 0, 0, 0, 0, 0, 0, 0, 0},
  147. {.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.6f,.7f,.8f,.8f},
  148. 105.f, /* even decade + 5 is important; saves an rint() later in a
  149. tight loop) */
  150. 1,
  151. _psy_passC0
  152. };
  153. static vorbis_info_psy _psy_set_C={
  154. ATH_Bark_dB_lineaggressive,
  155. -100.f,
  156. -140.f,
  157. /* tonemask */
  158. -6.f,-45.f,&_vp_tonemask_consbass_C,
  159. /* peakattp */
  160. 0, &_vp_peakatt_C,
  161. /*noisemaskp */
  162. 1, -30.f, /* suppress any noise curve over maxspec+n */
  163. .4f,.4f, /* low/high window */
  164. 10,10,100,
  165. /*63 125 250 500 1k 2k 4k 8k 16k*/
  166. { 0, 0, 0, 0, 0, 0, 0, 0, -6, -6, -6, -6, 0, 0, 0, 0, 0},
  167. {.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.5f,.6f,.7f,.7f},
  168. 105.f, /* even decade + 5 is important; saves an rint() later in a
  169. tight loop) */
  170. 1,_psy_passC
  171. };
  172. static vorbis_info_psy _psy_set_CT={
  173. ATH_Bark_dB_lineaggressive,
  174. -100.f,
  175. -140.f,
  176. /* tonemask */
  177. -6.f,-45.f,&_vp_tonemask_consbass_C,
  178. /* peakattp */
  179. 0, &_vp_peakatt_C,
  180. /*noisemaskp */
  181. 1, -30.f, /* suppress any noise curve over maxspec+n */
  182. .4f,.4f, /* low/high window */
  183. 10,10,100,
  184. /*63 125 250 500 1k 2k 4k 8k 16k*/
  185. {-30,-30,-30,-30,-30,-30,-30,-20, -6, -6, -6, -6, 0, 0, 0, 0, 0},
  186. {.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.5f,.6f,.7f,.7f},
  187. 105.f, /* even decade + 5 is important; saves an rint() later in a
  188. tight loop) */
  189. 1,_psy_passC
  190. };
  191. /* with GNUisms, this could be short and readable. Oh well */
  192. static vorbis_info_time0 _time_set0C={0};
  193. /*static vorbis_info_floor0 _floor_set0B={9, 44100, 64, 10,130, 2, {0,1},
  194. 0.246f, .387f};*/
  195. /*static vorbis_info_floor0 _floor_set1B={30, 44100, 256, 12,150, 2, {2,3},
  196. .082f, .126f};*/
  197. static vorbis_info_floor1 _floor_set0C={6,
  198. {0,1,1,1,2,2},
  199. {4,3,3},
  200. {0,2,2},
  201. {-1,0,1},
  202. {{2},{-1,3,4,5},{-1,6,7,8}},
  203. 4,
  204. {0,128,
  205. 6,17,30,58,
  206. 2,1,4, 11,8,14, 23,20,26,
  207. 41,35,48, 84,69,103},
  208. 60,30,500,
  209. 999,999,1,18.,
  210. 8,70,
  211. 128};
  212. static vorbis_info_floor1 _floor_set1C={10,
  213. {0,1,2,2,2,2,2, 3,3,3},
  214. {3,4,3,3},
  215. {1,1,2,2},
  216. {9,10,11,12},
  217. {{13,14},
  218. {15,16},
  219. {-1,17,18,19},
  220. {-1,20,21,22},
  221. },
  222. 2,
  223. {0,1024,
  224. 88,31,243,
  225. 14,54,143,460,
  226. 6,3,10, 22,18,26, 41,36,47,
  227. 69,61,78, 112,99,126, 185,162,211,
  228. 329,282,387, 672,553,825
  229. },
  230. 60,30,300,
  231. 20,8,1,18.,
  232. 20,600,
  233. 1024};
  234. static vorbis_info_residue0 _residue_set0C={0,256,16,10,23,
  235. {0,1,1,1,1,1,1,1,3,7},
  236. {25,
  237. 26,
  238. 27,
  239. 28,
  240. 29,
  241. 30,
  242. 31,32,
  243. 33,34,
  244. 35,36},
  245. {9999,
  246. 9999,
  247. 12,9999,
  248. 18,9999,
  249. 28,9999,
  250. 9999,9999},
  251. {.5f,
  252. 1.5f,
  253. 2.5f,2.5f,
  254. 4.5f,4.5,
  255. 16.5f,16.5,
  256. 84.5f},
  257. {0},
  258. {99,
  259. 99,
  260. 99,99,
  261. 99,99,
  262. 99,99,
  263. 99,99},
  264. {3}};
  265. static vorbis_info_residue0 _residue_set1C={0,2048, 32,10,24,
  266. {0,1,1,1,1,1,1,1,3,7},
  267. {25,
  268. 26,
  269. 27,
  270. 28,
  271. 29,
  272. 30,
  273. 31,
  274. 32,33,
  275. 34,35,36},
  276. {9999,
  277. 9999,
  278. 22,9999,
  279. 34,9999,
  280. 64,999,
  281. 9999,9999},
  282. {.5f,
  283. 1.5f,
  284. 2.5f,2.5f,
  285. 4.5f,4.5,
  286. 16.5f,16.5,
  287. 84.f},
  288. {0},
  289. {99,
  290. 99,
  291. 99,99,
  292. 99,99,
  293. 99,99,
  294. 99,99},
  295. {3}};
  296. static vorbis_info_mapping0 _mapping_set0C={1, {0,0}, {0}, {0}, {0}, {0,0},
  297. 1,{0},{1}};
  298. static vorbis_info_mapping0 _mapping_set1C={1, {0,0}, {0}, {1}, {1}, {1,2},
  299. 1,{0},{1}};
  300. static vorbis_info_mode _mode_set0C={0,0,0,0};
  301. static vorbis_info_mode _mode_set1C={1,0,0,1};
  302. /* CD quality stereo, no channel coupling */
  303. codec_setup_info info_C={
  304. /* smallblock, largeblock */
  305. {256, 2048},
  306. /* modes,maps,times,floors,residues,books,psys */
  307. 2, 2, 1, 2, 2, 37, 3,
  308. /* modes */
  309. {&_mode_set0C,&_mode_set1C},
  310. /* maps */
  311. {0,0},{&_mapping_set0C,&_mapping_set1C},
  312. /* times */
  313. {0,0},{&_time_set0C},
  314. /* floors */
  315. {1,1},{&_floor_set0C,&_floor_set1C},
  316. /* residue */
  317. {2,2},{&_residue_set0C,&_residue_set1C},
  318. /* books */
  319. {
  320. &_huff_book_line0_class1,
  321. &_huff_book_line0_class2, /* 1 */
  322. &_huff_book_line0_0sub0, /* 2 */
  323. &_huff_book_line0_1sub1, /* 3 */
  324. &_huff_book_line0_1sub2,
  325. &_huff_book_line0_1sub3, /* 5 */
  326. &_huff_book_line0_2sub1,
  327. &_huff_book_line0_2sub2, /* 7 */
  328. &_huff_book_line0_2sub3,
  329. &_huff_book_line1_class0,
  330. &_huff_book_line1_class1, /* 10 */
  331. &_huff_book_line1_class2,
  332. &_huff_book_line1_class3, /* 12 */
  333. &_huff_book_line1_0sub0,
  334. &_huff_book_line1_0sub1, /* 14 */
  335. &_huff_book_line1_1sub0,
  336. &_huff_book_line1_1sub1,
  337. &_huff_book_line1_2sub1,
  338. &_huff_book_line1_2sub2, /* 18 */
  339. &_huff_book_line1_2sub3,
  340. &_huff_book_line1_3sub1,
  341. &_huff_book_line1_3sub2,
  342. &_huff_book_line1_3sub3, /* 22 */
  343. &_huff_book_res0_128_128aux,
  344. &_huff_book_res0_128_1024aux,
  345. &_vq_book_res0_128_1024_1,
  346. &_vq_book_res0_128_1024_2,
  347. &_vq_book_res0_128_1024_3,
  348. &_vq_book_res0_128_1024_4,
  349. &_vq_book_res0_128_1024_5,
  350. &_vq_book_res0_128_1024_6,
  351. &_vq_book_res0_128_1024_7,
  352. &_vq_book_res0_128_1024_8,
  353. &_vq_book_res0_128_1024_8a,
  354. &_vq_book_res0_128_1024_9,
  355. &_vq_book_res0_128_1024_9a,
  356. &_vq_book_res0_128_1024_9b,
  357. },
  358. /* psy */
  359. {&_psy_set_C0,&_psy_set_CT,&_psy_set_C},
  360. &_psy_set_CG
  361. };
  362. #endif