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