floor_all.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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: key floor settings
  13. ********************************************************************/
  14. #include "vorbis/codec.h"
  15. #include "backends.h"
  16. #include "books/floor/floor_books.h"
  17. static const static_codebook*const _floor_128x4_books[]={
  18. &_huff_book_line_128x4_class0,
  19. &_huff_book_line_128x4_0sub0,
  20. &_huff_book_line_128x4_0sub1,
  21. &_huff_book_line_128x4_0sub2,
  22. &_huff_book_line_128x4_0sub3,
  23. };
  24. static const static_codebook*const _floor_256x4_books[]={
  25. &_huff_book_line_256x4_class0,
  26. &_huff_book_line_256x4_0sub0,
  27. &_huff_book_line_256x4_0sub1,
  28. &_huff_book_line_256x4_0sub2,
  29. &_huff_book_line_256x4_0sub3,
  30. };
  31. static const static_codebook*const _floor_128x7_books[]={
  32. &_huff_book_line_128x7_class0,
  33. &_huff_book_line_128x7_class1,
  34. &_huff_book_line_128x7_0sub1,
  35. &_huff_book_line_128x7_0sub2,
  36. &_huff_book_line_128x7_0sub3,
  37. &_huff_book_line_128x7_1sub1,
  38. &_huff_book_line_128x7_1sub2,
  39. &_huff_book_line_128x7_1sub3,
  40. };
  41. static const static_codebook*const _floor_256x7_books[]={
  42. &_huff_book_line_256x7_class0,
  43. &_huff_book_line_256x7_class1,
  44. &_huff_book_line_256x7_0sub1,
  45. &_huff_book_line_256x7_0sub2,
  46. &_huff_book_line_256x7_0sub3,
  47. &_huff_book_line_256x7_1sub1,
  48. &_huff_book_line_256x7_1sub2,
  49. &_huff_book_line_256x7_1sub3,
  50. };
  51. static const static_codebook*const _floor_128x11_books[]={
  52. &_huff_book_line_128x11_class1,
  53. &_huff_book_line_128x11_class2,
  54. &_huff_book_line_128x11_class3,
  55. &_huff_book_line_128x11_0sub0,
  56. &_huff_book_line_128x11_1sub0,
  57. &_huff_book_line_128x11_1sub1,
  58. &_huff_book_line_128x11_2sub1,
  59. &_huff_book_line_128x11_2sub2,
  60. &_huff_book_line_128x11_2sub3,
  61. &_huff_book_line_128x11_3sub1,
  62. &_huff_book_line_128x11_3sub2,
  63. &_huff_book_line_128x11_3sub3,
  64. };
  65. static const static_codebook*const _floor_128x17_books[]={
  66. &_huff_book_line_128x17_class1,
  67. &_huff_book_line_128x17_class2,
  68. &_huff_book_line_128x17_class3,
  69. &_huff_book_line_128x17_0sub0,
  70. &_huff_book_line_128x17_1sub0,
  71. &_huff_book_line_128x17_1sub1,
  72. &_huff_book_line_128x17_2sub1,
  73. &_huff_book_line_128x17_2sub2,
  74. &_huff_book_line_128x17_2sub3,
  75. &_huff_book_line_128x17_3sub1,
  76. &_huff_book_line_128x17_3sub2,
  77. &_huff_book_line_128x17_3sub3,
  78. };
  79. static const static_codebook*const _floor_256x4low_books[]={
  80. &_huff_book_line_256x4low_class0,
  81. &_huff_book_line_256x4low_0sub0,
  82. &_huff_book_line_256x4low_0sub1,
  83. &_huff_book_line_256x4low_0sub2,
  84. &_huff_book_line_256x4low_0sub3,
  85. };
  86. static const static_codebook*const _floor_1024x27_books[]={
  87. &_huff_book_line_1024x27_class1,
  88. &_huff_book_line_1024x27_class2,
  89. &_huff_book_line_1024x27_class3,
  90. &_huff_book_line_1024x27_class4,
  91. &_huff_book_line_1024x27_0sub0,
  92. &_huff_book_line_1024x27_1sub0,
  93. &_huff_book_line_1024x27_1sub1,
  94. &_huff_book_line_1024x27_2sub0,
  95. &_huff_book_line_1024x27_2sub1,
  96. &_huff_book_line_1024x27_3sub1,
  97. &_huff_book_line_1024x27_3sub2,
  98. &_huff_book_line_1024x27_3sub3,
  99. &_huff_book_line_1024x27_4sub1,
  100. &_huff_book_line_1024x27_4sub2,
  101. &_huff_book_line_1024x27_4sub3,
  102. };
  103. static const static_codebook*const _floor_2048x27_books[]={
  104. &_huff_book_line_2048x27_class1,
  105. &_huff_book_line_2048x27_class2,
  106. &_huff_book_line_2048x27_class3,
  107. &_huff_book_line_2048x27_class4,
  108. &_huff_book_line_2048x27_0sub0,
  109. &_huff_book_line_2048x27_1sub0,
  110. &_huff_book_line_2048x27_1sub1,
  111. &_huff_book_line_2048x27_2sub0,
  112. &_huff_book_line_2048x27_2sub1,
  113. &_huff_book_line_2048x27_3sub1,
  114. &_huff_book_line_2048x27_3sub2,
  115. &_huff_book_line_2048x27_3sub3,
  116. &_huff_book_line_2048x27_4sub1,
  117. &_huff_book_line_2048x27_4sub2,
  118. &_huff_book_line_2048x27_4sub3,
  119. };
  120. static const static_codebook*const _floor_512x17_books[]={
  121. &_huff_book_line_512x17_class1,
  122. &_huff_book_line_512x17_class2,
  123. &_huff_book_line_512x17_class3,
  124. &_huff_book_line_512x17_0sub0,
  125. &_huff_book_line_512x17_1sub0,
  126. &_huff_book_line_512x17_1sub1,
  127. &_huff_book_line_512x17_2sub1,
  128. &_huff_book_line_512x17_2sub2,
  129. &_huff_book_line_512x17_2sub3,
  130. &_huff_book_line_512x17_3sub1,
  131. &_huff_book_line_512x17_3sub2,
  132. &_huff_book_line_512x17_3sub3,
  133. };
  134. static const static_codebook*const _floor_Xx0_books[]={
  135. 0
  136. };
  137. static const static_codebook*const *const _floor_books[11]={
  138. _floor_128x4_books,
  139. _floor_256x4_books,
  140. _floor_128x7_books,
  141. _floor_256x7_books,
  142. _floor_128x11_books,
  143. _floor_128x17_books,
  144. _floor_256x4low_books,
  145. _floor_1024x27_books,
  146. _floor_2048x27_books,
  147. _floor_512x17_books,
  148. _floor_Xx0_books,
  149. };
  150. static const vorbis_info_floor1 _floor[11]={
  151. /* 0: 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., 128
  157. },
  158. /* 1: 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., 256
  164. },
  165. /* 2: 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., 128
  171. },
  172. /* 3: 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., 256
  178. },
  179. /* 4: 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., 128
  185. },
  186. /* 5: 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., 128
  192. },
  193. /* 6: 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., 256
  199. },
  200. /* 7: 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., 1024
  207. },
  208. /* 8: 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., 2048
  215. },
  216. /* 9: 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., 512
  223. },
  224. /* 10: X x 0 (LFE floor; edge posts only) */
  225. {
  226. 0,{0}, {0},{0},{-1},
  227. {{-1}},
  228. 2,{0,12},
  229. 60,30,500, 1.,18., 10
  230. },
  231. };