floor_all.h 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  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-2007 *
  9. * by the Xiph.Org Foundation http://www.xiph.org/ *
  10. * *
  11. ********************************************************************
  12. function: key floor settings
  13. last mod: $Id$
  14. ********************************************************************/
  15. #include "vorbis/codec.h"
  16. #include "backends.h"
  17. #include "books/floor/floor_books.h"
  18. static static_codebook *_floor_128x4_books[]={
  19. &_huff_book_line_128x4_class0,
  20. &_huff_book_line_128x4_0sub0,
  21. &_huff_book_line_128x4_0sub1,
  22. &_huff_book_line_128x4_0sub2,
  23. &_huff_book_line_128x4_0sub3,
  24. };
  25. static static_codebook *_floor_256x4_books[]={
  26. &_huff_book_line_256x4_class0,
  27. &_huff_book_line_256x4_0sub0,
  28. &_huff_book_line_256x4_0sub1,
  29. &_huff_book_line_256x4_0sub2,
  30. &_huff_book_line_256x4_0sub3,
  31. };
  32. static static_codebook *_floor_128x7_books[]={
  33. &_huff_book_line_128x7_class0,
  34. &_huff_book_line_128x7_class1,
  35. &_huff_book_line_128x7_0sub1,
  36. &_huff_book_line_128x7_0sub2,
  37. &_huff_book_line_128x7_0sub3,
  38. &_huff_book_line_128x7_1sub1,
  39. &_huff_book_line_128x7_1sub2,
  40. &_huff_book_line_128x7_1sub3,
  41. };
  42. static static_codebook *_floor_256x7_books[]={
  43. &_huff_book_line_256x7_class0,
  44. &_huff_book_line_256x7_class1,
  45. &_huff_book_line_256x7_0sub1,
  46. &_huff_book_line_256x7_0sub2,
  47. &_huff_book_line_256x7_0sub3,
  48. &_huff_book_line_256x7_1sub1,
  49. &_huff_book_line_256x7_1sub2,
  50. &_huff_book_line_256x7_1sub3,
  51. };
  52. static static_codebook *_floor_128x11_books[]={
  53. &_huff_book_line_128x11_class1,
  54. &_huff_book_line_128x11_class2,
  55. &_huff_book_line_128x11_class3,
  56. &_huff_book_line_128x11_0sub0,
  57. &_huff_book_line_128x11_1sub0,
  58. &_huff_book_line_128x11_1sub1,
  59. &_huff_book_line_128x11_2sub1,
  60. &_huff_book_line_128x11_2sub2,
  61. &_huff_book_line_128x11_2sub3,
  62. &_huff_book_line_128x11_3sub1,
  63. &_huff_book_line_128x11_3sub2,
  64. &_huff_book_line_128x11_3sub3,
  65. };
  66. static static_codebook *_floor_128x17_books[]={
  67. &_huff_book_line_128x17_class1,
  68. &_huff_book_line_128x17_class2,
  69. &_huff_book_line_128x17_class3,
  70. &_huff_book_line_128x17_0sub0,
  71. &_huff_book_line_128x17_1sub0,
  72. &_huff_book_line_128x17_1sub1,
  73. &_huff_book_line_128x17_2sub1,
  74. &_huff_book_line_128x17_2sub2,
  75. &_huff_book_line_128x17_2sub3,
  76. &_huff_book_line_128x17_3sub1,
  77. &_huff_book_line_128x17_3sub2,
  78. &_huff_book_line_128x17_3sub3,
  79. };
  80. static static_codebook *_floor_256x4low_books[]={
  81. &_huff_book_line_256x4low_class0,
  82. &_huff_book_line_256x4low_0sub0,
  83. &_huff_book_line_256x4low_0sub1,
  84. &_huff_book_line_256x4low_0sub2,
  85. &_huff_book_line_256x4low_0sub3,
  86. };
  87. static static_codebook *_floor_1024x27_books[]={
  88. &_huff_book_line_1024x27_class1,
  89. &_huff_book_line_1024x27_class2,
  90. &_huff_book_line_1024x27_class3,
  91. &_huff_book_line_1024x27_class4,
  92. &_huff_book_line_1024x27_0sub0,
  93. &_huff_book_line_1024x27_1sub0,
  94. &_huff_book_line_1024x27_1sub1,
  95. &_huff_book_line_1024x27_2sub0,
  96. &_huff_book_line_1024x27_2sub1,
  97. &_huff_book_line_1024x27_3sub1,
  98. &_huff_book_line_1024x27_3sub2,
  99. &_huff_book_line_1024x27_3sub3,
  100. &_huff_book_line_1024x27_4sub1,
  101. &_huff_book_line_1024x27_4sub2,
  102. &_huff_book_line_1024x27_4sub3,
  103. };
  104. static static_codebook *_floor_2048x27_books[]={
  105. &_huff_book_line_2048x27_class1,
  106. &_huff_book_line_2048x27_class2,
  107. &_huff_book_line_2048x27_class3,
  108. &_huff_book_line_2048x27_class4,
  109. &_huff_book_line_2048x27_0sub0,
  110. &_huff_book_line_2048x27_1sub0,
  111. &_huff_book_line_2048x27_1sub1,
  112. &_huff_book_line_2048x27_2sub0,
  113. &_huff_book_line_2048x27_2sub1,
  114. &_huff_book_line_2048x27_3sub1,
  115. &_huff_book_line_2048x27_3sub2,
  116. &_huff_book_line_2048x27_3sub3,
  117. &_huff_book_line_2048x27_4sub1,
  118. &_huff_book_line_2048x27_4sub2,
  119. &_huff_book_line_2048x27_4sub3,
  120. };
  121. static static_codebook *_floor_512x17_books[]={
  122. &_huff_book_line_512x17_class1,
  123. &_huff_book_line_512x17_class2,
  124. &_huff_book_line_512x17_class3,
  125. &_huff_book_line_512x17_0sub0,
  126. &_huff_book_line_512x17_1sub0,
  127. &_huff_book_line_512x17_1sub1,
  128. &_huff_book_line_512x17_2sub1,
  129. &_huff_book_line_512x17_2sub2,
  130. &_huff_book_line_512x17_2sub3,
  131. &_huff_book_line_512x17_3sub1,
  132. &_huff_book_line_512x17_3sub2,
  133. &_huff_book_line_512x17_3sub3,
  134. };
  135. static static_codebook **_floor_books[13]={
  136. _floor_128x4_books,
  137. _floor_256x4_books,
  138. _floor_128x7_books,
  139. _floor_256x7_books,
  140. _floor_128x11_books,
  141. _floor_128x17_books,
  142. _floor_256x4low_books,
  143. _floor_1024x27_books,
  144. _floor_2048x27_books,
  145. _floor_512x17_books,
  146. _floor_1024x27_books,
  147. _floor_2048x27_books,
  148. _floor_256x4low_books,
  149. };
  150. static vorbis_info_floor1 _floor[13]={
  151. /* 128 x 4 */
  152. {
  153. 1,{0},{4},{2},{0},
  154. {{1,2,3,4}},
  155. 4,{0,128, 33,8,16,70},
  156. 60,30,500, 1.,18., -1
  157. },
  158. /* 256 x 4 */
  159. {
  160. 1,{0},{4},{2},{0},
  161. {{1,2,3,4}},
  162. 4,{0,256, 66,16,32,140},
  163. 60,30,500, 1.,18., -1
  164. },
  165. /* 128 x 7 */
  166. {
  167. 2,{0,1},{3,4},{2,2},{0,1},
  168. {{-1,2,3,4},{-1,5,6,7}},
  169. 4,{0,128, 14,4,58, 2,8,28,90},
  170. 60,30,500, 1.,18., -1
  171. },
  172. /* 256 x 7 */
  173. {
  174. 2,{0,1},{3,4},{2,2},{0,1},
  175. {{-1,2,3,4},{-1,5,6,7}},
  176. 4,{0,256, 28,8,116, 4,16,56,180},
  177. 60,30,500, 1.,18., -1
  178. },
  179. /* 128 x 11 */
  180. {
  181. 4,{0,1,2,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2},
  182. {{3},{4,5},{-1,6,7,8},{-1,9,10,11}},
  183. 2,{0,128, 8,33, 4,16,70, 2,6,12, 23,46,90},
  184. 60,30,500, 1,18., -1
  185. },
  186. /* 128 x 17 */
  187. {
  188. 6,{0,1,1,2,3,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2},
  189. {{3},{4,5},{-1,6,7,8},{-1,9,10,11}},
  190. 2,{0,128, 12,46, 4,8,16, 23,33,70, 2,6,10, 14,19,28, 39,58,90},
  191. 60,30,500, 1,18., -1
  192. },
  193. /* 256 x 4 (low bitrate version) */
  194. {
  195. 1,{0},{4},{2},{0},
  196. {{1,2,3,4}},
  197. 4,{0,256, 66,16,32,140},
  198. 60,30,500, 1.,18., -1
  199. },
  200. /* 1024 x 27 */
  201. {
  202. 8,{0,1,2,2,3,3,4,4},{3,4,3,4,3},{0,1,1,2,2},{-1,0,1,2,3},
  203. {{4},{5,6},{7,8},{-1,9,10,11},{-1,12,13,14}},
  204. 2,{0,1024, 93,23,372, 6,46,186,750, 14,33,65, 130,260,556,
  205. 3,10,18,28, 39,55,79,111, 158,220,312, 464,650,850},
  206. 60,30,500, 3,18., -1 /* lowpass */
  207. },
  208. /* 2048 x 27 */
  209. {
  210. 8,{0,1,2,2,3,3,4,4},{3,4,3,4,3},{0,1,1,2,2},{-1,0,1,2,3},
  211. {{4},{5,6},{7,8},{-1,9,10,11},{-1,12,13,14}},
  212. 2,{0,2048, 186,46,744, 12,92,372,1500, 28,66,130, 260,520,1112,
  213. 6,20,36,56, 78,110,158,222, 316,440,624, 928,1300,1700},
  214. 60,30,500, 3,18., -1 /* lowpass */
  215. },
  216. /* 512 x 17 */
  217. {
  218. 6,{0,1,1,2,3,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2},
  219. {{3},{4,5},{-1,6,7,8},{-1,9,10,11}},
  220. 2,{0,512, 46,186, 16,33,65, 93,130,278,
  221. 7,23,39, 55,79,110, 156,232,360},
  222. 60,30,500, 1,18., -1 /* lowpass! */
  223. },
  224. /* 1024 x 27 (44.1/48kHz low bitrate) */
  225. {
  226. 8,{0,1,2,2,3,3,4,4},{3,4,3,4,3},{0,1,1,2,2},{-1,0,1,2,3},
  227. {{4},{5,6},{7,8},{-1,9,10,11},{-1,12,13,14}},
  228. 2,{0,1024, 93,23,358, 6,46,186,750, 14,33,65, 130,260,485,
  229. 3,10,18,28, 39,55,79,111, 158,220,306, 418,650,560},
  230. 60,30,500, 3,18., -1 /* lowpass */
  231. },
  232. /* 2048 x 27 (44.1/48kHz) */
  233. {
  234. 8,{0,1,2,2,3,3,4,4},{3,4,3,4,3},{0,1,1,2,2},{-1,0,1,2,3},
  235. {{4},{5,6},{7,8},{-1,9,10,11},{-1,12,13,14}},
  236. 2,{0,2048, 186,46,716, 12,92,372,1500, 28,66,130, 260,520,970,
  237. 6,20,36,56, 78,110,158,222, 316,440,612, 836,1300,1120},
  238. 60,30,500, 3,18., -1 /* lowpass */
  239. },
  240. /* 512 x 4 (256 x 4) */
  241. {
  242. 1,{0},{4},{2},{0},
  243. {{1,2,3,4}},
  244. 4,{0,512, 132,32,64,280},
  245. 60,30,500, 1.,18., -1
  246. },
  247. };