1 /********************************************************************
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. *
8 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
9 * by the Xiph.Org Foundation https://xiph.org/ *
11 ********************************************************************
13 function: key floor settings
15 ********************************************************************/
17 #include "vorbis/codec.h"
19 #include "books/floor/floor_books.h"
21 static const static_codebook*const _floor_128x4_books[]={
22 &_huff_book_line_128x4_class0,
23 &_huff_book_line_128x4_0sub0,
24 &_huff_book_line_128x4_0sub1,
25 &_huff_book_line_128x4_0sub2,
26 &_huff_book_line_128x4_0sub3,
28 static const static_codebook*const _floor_256x4_books[]={
29 &_huff_book_line_256x4_class0,
30 &_huff_book_line_256x4_0sub0,
31 &_huff_book_line_256x4_0sub1,
32 &_huff_book_line_256x4_0sub2,
33 &_huff_book_line_256x4_0sub3,
35 static const static_codebook*const _floor_128x7_books[]={
36 &_huff_book_line_128x7_class0,
37 &_huff_book_line_128x7_class1,
39 &_huff_book_line_128x7_0sub1,
40 &_huff_book_line_128x7_0sub2,
41 &_huff_book_line_128x7_0sub3,
42 &_huff_book_line_128x7_1sub1,
43 &_huff_book_line_128x7_1sub2,
44 &_huff_book_line_128x7_1sub3,
46 static const static_codebook*const _floor_256x7_books[]={
47 &_huff_book_line_256x7_class0,
48 &_huff_book_line_256x7_class1,
50 &_huff_book_line_256x7_0sub1,
51 &_huff_book_line_256x7_0sub2,
52 &_huff_book_line_256x7_0sub3,
53 &_huff_book_line_256x7_1sub1,
54 &_huff_book_line_256x7_1sub2,
55 &_huff_book_line_256x7_1sub3,
57 static const static_codebook*const _floor_128x11_books[]={
58 &_huff_book_line_128x11_class1,
59 &_huff_book_line_128x11_class2,
60 &_huff_book_line_128x11_class3,
62 &_huff_book_line_128x11_0sub0,
63 &_huff_book_line_128x11_1sub0,
64 &_huff_book_line_128x11_1sub1,
65 &_huff_book_line_128x11_2sub1,
66 &_huff_book_line_128x11_2sub2,
67 &_huff_book_line_128x11_2sub3,
68 &_huff_book_line_128x11_3sub1,
69 &_huff_book_line_128x11_3sub2,
70 &_huff_book_line_128x11_3sub3,
72 static const static_codebook*const _floor_128x17_books[]={
73 &_huff_book_line_128x17_class1,
74 &_huff_book_line_128x17_class2,
75 &_huff_book_line_128x17_class3,
77 &_huff_book_line_128x17_0sub0,
78 &_huff_book_line_128x17_1sub0,
79 &_huff_book_line_128x17_1sub1,
80 &_huff_book_line_128x17_2sub1,
81 &_huff_book_line_128x17_2sub2,
82 &_huff_book_line_128x17_2sub3,
83 &_huff_book_line_128x17_3sub1,
84 &_huff_book_line_128x17_3sub2,
85 &_huff_book_line_128x17_3sub3,
87 static const static_codebook*const _floor_256x4low_books[]={
88 &_huff_book_line_256x4low_class0,
89 &_huff_book_line_256x4low_0sub0,
90 &_huff_book_line_256x4low_0sub1,
91 &_huff_book_line_256x4low_0sub2,
92 &_huff_book_line_256x4low_0sub3,
94 static const static_codebook*const _floor_1024x27_books[]={
95 &_huff_book_line_1024x27_class1,
96 &_huff_book_line_1024x27_class2,
97 &_huff_book_line_1024x27_class3,
98 &_huff_book_line_1024x27_class4,
100 &_huff_book_line_1024x27_0sub0,
101 &_huff_book_line_1024x27_1sub0,
102 &_huff_book_line_1024x27_1sub1,
103 &_huff_book_line_1024x27_2sub0,
104 &_huff_book_line_1024x27_2sub1,
105 &_huff_book_line_1024x27_3sub1,
106 &_huff_book_line_1024x27_3sub2,
107 &_huff_book_line_1024x27_3sub3,
108 &_huff_book_line_1024x27_4sub1,
109 &_huff_book_line_1024x27_4sub2,
110 &_huff_book_line_1024x27_4sub3,
112 static const static_codebook*const _floor_2048x27_books[]={
113 &_huff_book_line_2048x27_class1,
114 &_huff_book_line_2048x27_class2,
115 &_huff_book_line_2048x27_class3,
116 &_huff_book_line_2048x27_class4,
118 &_huff_book_line_2048x27_0sub0,
119 &_huff_book_line_2048x27_1sub0,
120 &_huff_book_line_2048x27_1sub1,
121 &_huff_book_line_2048x27_2sub0,
122 &_huff_book_line_2048x27_2sub1,
123 &_huff_book_line_2048x27_3sub1,
124 &_huff_book_line_2048x27_3sub2,
125 &_huff_book_line_2048x27_3sub3,
126 &_huff_book_line_2048x27_4sub1,
127 &_huff_book_line_2048x27_4sub2,
128 &_huff_book_line_2048x27_4sub3,
131 static const static_codebook*const _floor_512x17_books[]={
132 &_huff_book_line_512x17_class1,
133 &_huff_book_line_512x17_class2,
134 &_huff_book_line_512x17_class3,
136 &_huff_book_line_512x17_0sub0,
137 &_huff_book_line_512x17_1sub0,
138 &_huff_book_line_512x17_1sub1,
139 &_huff_book_line_512x17_2sub1,
140 &_huff_book_line_512x17_2sub2,
141 &_huff_book_line_512x17_2sub3,
142 &_huff_book_line_512x17_3sub1,
143 &_huff_book_line_512x17_3sub2,
144 &_huff_book_line_512x17_3sub3,
147 static const static_codebook*const _floor_Xx0_books[]={
151 static const static_codebook*const *const _floor_books[11]={
158 _floor_256x4low_books,
159 _floor_1024x27_books,
160 _floor_2048x27_books,
165 static const vorbis_info_floor1 _floor[11]={
170 4,{0,128, 33,8,16,70},
172 60,30,500, 1.,18., 128
178 4,{0,256, 66,16,32,140},
180 60,30,500, 1.,18., 256
184 2,{0,1},{3,4},{2,2},{0,1},
185 {{-1,2,3,4},{-1,5,6,7}},
186 4,{0,128, 14,4,58, 2,8,28,90},
188 60,30,500, 1.,18., 128
192 2,{0,1},{3,4},{2,2},{0,1},
193 {{-1,2,3,4},{-1,5,6,7}},
194 4,{0,256, 28,8,116, 4,16,56,180},
196 60,30,500, 1.,18., 256
200 4,{0,1,2,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2},
201 {{3},{4,5},{-1,6,7,8},{-1,9,10,11}},
203 2,{0,128, 8,33, 4,16,70, 2,6,12, 23,46,90},
205 60,30,500, 1,18., 128
209 6,{0,1,1,2,3,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2},
210 {{3},{4,5},{-1,6,7,8},{-1,9,10,11}},
211 2,{0,128, 12,46, 4,8,16, 23,33,70, 2,6,10, 14,19,28, 39,58,90},
213 60,30,500, 1,18., 128
215 /* 6: 256 x 4 (low bitrate version) */
219 4,{0,256, 66,16,32,140},
221 60,30,500, 1.,18., 256
225 8,{0,1,2,2,3,3,4,4},{3,4,3,4,3},{0,1,1,2,2},{-1,0,1,2,3},
226 {{4},{5,6},{7,8},{-1,9,10,11},{-1,12,13,14}},
227 2,{0,1024, 93,23,372, 6,46,186,750, 14,33,65, 130,260,556,
228 3,10,18,28, 39,55,79,111, 158,220,312, 464,650,850},
230 60,30,500, 3,18., 1024
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,744, 12,92,372,1500, 28,66,130, 260,520,1112,
237 6,20,36,56, 78,110,158,222, 316,440,624, 928,1300,1700},
239 60,30,500, 3,18., 2048
243 6,{0,1,1,2,3,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2},
244 {{3},{4,5},{-1,6,7,8},{-1,9,10,11}},
245 2,{0,512, 46,186, 16,33,65, 93,130,278,
246 7,23,39, 55,79,110, 156,232,360},
248 60,30,500, 1,18., 512
251 /* 10: X x 0 (LFE floor; edge posts only) */
256 60,30,500, 1.,18., 10