floor_all.h 7.22 KB
Newer Older
Monty's avatar
 
Monty committed
1 2 3 4 5 6 7
/********************************************************************
 *                                                                  *
 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
 *                                                                  *
Monty's avatar
Monty committed
8
 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
9
 * by the Xiph.Org Foundation http://www.xiph.org/                  *
Monty's avatar
 
Monty committed
10 11 12
 *                                                                  *
 ********************************************************************

Monty's avatar
 
Monty committed
13
 function: key floor settings
Monty's avatar
 
Monty committed
14 15 16 17 18

 ********************************************************************/

#include "vorbis/codec.h"
#include "backends.h"
Monty's avatar
 
Monty committed
19 20
#include "books/floor/floor_books.h"

21
static const static_codebook*const _floor_128x4_books[]={
Monty's avatar
 
Monty committed
22 23 24 25 26 27
  &_huff_book_line_128x4_class0,
  &_huff_book_line_128x4_0sub0,
  &_huff_book_line_128x4_0sub1,
  &_huff_book_line_128x4_0sub2,
  &_huff_book_line_128x4_0sub3,
};
28
static const static_codebook*const _floor_256x4_books[]={
Monty's avatar
 
Monty committed
29 30 31 32 33 34
  &_huff_book_line_256x4_class0,
  &_huff_book_line_256x4_0sub0,
  &_huff_book_line_256x4_0sub1,
  &_huff_book_line_256x4_0sub2,
  &_huff_book_line_256x4_0sub3,
};
35
static const static_codebook*const _floor_128x7_books[]={
Monty's avatar
 
Monty committed
36
  &_huff_book_line_128x7_class0,
Monty's avatar
 
Monty committed
37
  &_huff_book_line_128x7_class1,
Monty's avatar
Monty committed
38

Monty's avatar
 
Monty committed
39 40 41
  &_huff_book_line_128x7_0sub1,
  &_huff_book_line_128x7_0sub2,
  &_huff_book_line_128x7_0sub3,
Monty's avatar
 
Monty committed
42 43
  &_huff_book_line_128x7_1sub1,
  &_huff_book_line_128x7_1sub2,
Monty's avatar
Monty committed
44
  &_huff_book_line_128x7_1sub3,
Monty's avatar
 
Monty committed
45
};
46
static const static_codebook*const _floor_256x7_books[]={
Monty's avatar
 
Monty committed
47 48
  &_huff_book_line_256x7_class0,
  &_huff_book_line_256x7_class1,
Monty's avatar
Monty committed
49

Monty's avatar
 
Monty committed
50 51 52 53 54
  &_huff_book_line_256x7_0sub1,
  &_huff_book_line_256x7_0sub2,
  &_huff_book_line_256x7_0sub3,
  &_huff_book_line_256x7_1sub1,
  &_huff_book_line_256x7_1sub2,
Monty's avatar
Monty committed
55
  &_huff_book_line_256x7_1sub3,
Monty's avatar
 
Monty committed
56
};
57
static const static_codebook*const _floor_128x11_books[]={
Monty's avatar
 
Monty committed
58 59 60
  &_huff_book_line_128x11_class1,
  &_huff_book_line_128x11_class2,
  &_huff_book_line_128x11_class3,
Monty's avatar
Monty committed
61

Monty's avatar
 
Monty committed
62 63 64 65 66
  &_huff_book_line_128x11_0sub0,
  &_huff_book_line_128x11_1sub0,
  &_huff_book_line_128x11_1sub1,
  &_huff_book_line_128x11_2sub1,
  &_huff_book_line_128x11_2sub2,
Monty's avatar
Monty committed
67
  &_huff_book_line_128x11_2sub3,
Monty's avatar
 
Monty committed
68 69
  &_huff_book_line_128x11_3sub1,
  &_huff_book_line_128x11_3sub2,
Monty's avatar
Monty committed
70
  &_huff_book_line_128x11_3sub3,
Monty's avatar
 
Monty committed
71
};
72
static const static_codebook*const _floor_128x17_books[]={
Monty's avatar
 
Monty committed
73 74 75
  &_huff_book_line_128x17_class1,
  &_huff_book_line_128x17_class2,
  &_huff_book_line_128x17_class3,
Monty's avatar
Monty committed
76

Monty's avatar
 
Monty committed
77 78 79 80 81
  &_huff_book_line_128x17_0sub0,
  &_huff_book_line_128x17_1sub0,
  &_huff_book_line_128x17_1sub1,
  &_huff_book_line_128x17_2sub1,
  &_huff_book_line_128x17_2sub2,
Monty's avatar
Monty committed
82
  &_huff_book_line_128x17_2sub3,
Monty's avatar
 
Monty committed
83 84
  &_huff_book_line_128x17_3sub1,
  &_huff_book_line_128x17_3sub2,
Monty's avatar
Monty committed
85
  &_huff_book_line_128x17_3sub3,
Monty's avatar
 
Monty committed
86
};
87
static const static_codebook*const _floor_256x4low_books[]={
88 89 90 91 92
  &_huff_book_line_256x4low_class0,
  &_huff_book_line_256x4low_0sub0,
  &_huff_book_line_256x4low_0sub1,
  &_huff_book_line_256x4low_0sub2,
  &_huff_book_line_256x4low_0sub3,
Monty's avatar
 
Monty committed
93
};
94
static const static_codebook*const _floor_1024x27_books[]={
Monty's avatar
 
Monty committed
95 96 97 98
  &_huff_book_line_1024x27_class1,
  &_huff_book_line_1024x27_class2,
  &_huff_book_line_1024x27_class3,
  &_huff_book_line_1024x27_class4,
Monty's avatar
Monty committed
99

Monty's avatar
 
Monty committed
100 101 102 103 104 105 106 107 108 109 110
  &_huff_book_line_1024x27_0sub0,
  &_huff_book_line_1024x27_1sub0,
  &_huff_book_line_1024x27_1sub1,
  &_huff_book_line_1024x27_2sub0,
  &_huff_book_line_1024x27_2sub1,
  &_huff_book_line_1024x27_3sub1,
  &_huff_book_line_1024x27_3sub2,
  &_huff_book_line_1024x27_3sub3,
  &_huff_book_line_1024x27_4sub1,
  &_huff_book_line_1024x27_4sub2,
  &_huff_book_line_1024x27_4sub3,
Monty's avatar
 
Monty committed
111
};
112
static const static_codebook*const _floor_2048x27_books[]={
113 114 115 116
  &_huff_book_line_2048x27_class1,
  &_huff_book_line_2048x27_class2,
  &_huff_book_line_2048x27_class3,
  &_huff_book_line_2048x27_class4,
Monty's avatar
Monty committed
117

118 119 120 121 122 123 124 125 126 127 128 129 130
  &_huff_book_line_2048x27_0sub0,
  &_huff_book_line_2048x27_1sub0,
  &_huff_book_line_2048x27_1sub1,
  &_huff_book_line_2048x27_2sub0,
  &_huff_book_line_2048x27_2sub1,
  &_huff_book_line_2048x27_3sub1,
  &_huff_book_line_2048x27_3sub2,
  &_huff_book_line_2048x27_3sub3,
  &_huff_book_line_2048x27_4sub1,
  &_huff_book_line_2048x27_4sub2,
  &_huff_book_line_2048x27_4sub3,
};

131
static const static_codebook*const _floor_512x17_books[]={
132 133 134
  &_huff_book_line_512x17_class1,
  &_huff_book_line_512x17_class2,
  &_huff_book_line_512x17_class3,
Monty's avatar
Monty committed
135

136 137 138 139 140
  &_huff_book_line_512x17_0sub0,
  &_huff_book_line_512x17_1sub0,
  &_huff_book_line_512x17_1sub1,
  &_huff_book_line_512x17_2sub1,
  &_huff_book_line_512x17_2sub2,
Monty's avatar
Monty committed
141
  &_huff_book_line_512x17_2sub3,
142 143
  &_huff_book_line_512x17_3sub1,
  &_huff_book_line_512x17_3sub2,
Monty's avatar
Monty committed
144
  &_huff_book_line_512x17_3sub3,
145
};
Monty's avatar
 
Monty committed
146

Monty's avatar
Monty committed
147
static const static_codebook*const _floor_Xx0_books[]={
148
  0
Monty's avatar
Monty committed
149 150 151
};

static const static_codebook*const *const _floor_books[11]={
Monty's avatar
 
Monty committed
152 153 154 155 156 157
  _floor_128x4_books,
  _floor_256x4_books,
  _floor_128x7_books,
  _floor_256x7_books,
  _floor_128x11_books,
  _floor_128x17_books,
158
  _floor_256x4low_books,
Monty's avatar
 
Monty committed
159
  _floor_1024x27_books,
160
  _floor_2048x27_books,
Monty's avatar
 
Monty committed
161
  _floor_512x17_books,
Monty's avatar
Monty committed
162
  _floor_Xx0_books,
Monty's avatar
 
Monty committed
163 164
};

Monty's avatar
Monty committed
165 166
static const vorbis_info_floor1 _floor[11]={
  /* 0: 128 x 4 */
Monty's avatar
 
Monty committed
167 168 169 170
  {
    1,{0},{4},{2},{0},
    {{1,2,3,4}},
    4,{0,128, 33,8,16,70},
Monty's avatar
 
Monty committed
171

172
    60,30,500,   1.,18.,  128
Monty's avatar
 
Monty committed
173
  },
Monty's avatar
Monty committed
174
  /* 1: 256 x 4 */
Monty's avatar
 
Monty committed
175 176 177 178
  {
    1,{0},{4},{2},{0},
    {{1,2,3,4}},
    4,{0,256, 66,16,32,140},
Monty's avatar
 
Monty committed
179

180
    60,30,500,   1.,18.,  256
Monty's avatar
 
Monty committed
181
  },
Monty's avatar
Monty committed
182
  /* 2: 128 x 7 */
Monty's avatar
 
Monty committed
183
  {
Monty's avatar
 
Monty committed
184 185 186
    2,{0,1},{3,4},{2,2},{0,1},
    {{-1,2,3,4},{-1,5,6,7}},
    4,{0,128, 14,4,58, 2,8,28,90},
Monty's avatar
Monty committed
187

188
    60,30,500,   1.,18.,  128
Monty's avatar
 
Monty committed
189
  },
Monty's avatar
Monty committed
190
  /* 3: 256 x 7 */
Monty's avatar
 
Monty committed
191
  {
Monty's avatar
 
Monty committed
192 193 194
    2,{0,1},{3,4},{2,2},{0,1},
    {{-1,2,3,4},{-1,5,6,7}},
    4,{0,256, 28,8,116, 4,16,56,180},
Monty's avatar
Monty committed
195

196
    60,30,500,   1.,18.,  256
Monty's avatar
 
Monty committed
197
  },
Monty's avatar
Monty committed
198
  /* 4: 128 x 11 */
Monty's avatar
 
Monty committed
199
  {
Monty's avatar
 
Monty committed
200 201
    4,{0,1,2,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2},
    {{3},{4,5},{-1,6,7,8},{-1,9,10,11}},
Monty's avatar
Monty committed
202

Monty's avatar
 
Monty committed
203
    2,{0,128,  8,33,  4,16,70,  2,6,12,  23,46,90},
Monty's avatar
Monty committed
204

205
     60,30,500,   1,18.,  128
Monty's avatar
 
Monty committed
206
  },
Monty's avatar
Monty committed
207
  /* 5: 128 x 17 */
Monty's avatar
 
Monty committed
208
  {
Monty's avatar
 
Monty committed
209 210 211
    6,{0,1,1,2,3,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2},
    {{3},{4,5},{-1,6,7,8},{-1,9,10,11}},
    2,{0,128,  12,46,  4,8,16,  23,33,70,  2,6,10,  14,19,28,  39,58,90},
Monty's avatar
Monty committed
212

213
    60,30,500,    1,18.,  128
Monty's avatar
 
Monty committed
214
  },
Monty's avatar
Monty committed
215
  /* 6: 256 x 4 (low bitrate version) */
Monty's avatar
 
Monty committed
216
  {
217 218 219 220
    1,{0},{4},{2},{0},
    {{1,2,3,4}},
    4,{0,256, 66,16,32,140},

221
    60,30,500,   1.,18.,  256
Monty's avatar
 
Monty committed
222
  },
Monty's avatar
Monty committed
223
  /* 7: 1024 x 27 */
Monty's avatar
 
Monty committed
224 225 226 227 228
  {
    8,{0,1,2,2,3,3,4,4},{3,4,3,4,3},{0,1,1,2,2},{-1,0,1,2,3},
    {{4},{5,6},{7,8},{-1,9,10,11},{-1,12,13,14}},
    2,{0,1024,   93,23,372, 6,46,186,750,  14,33,65, 130,260,556,
       3,10,18,28,  39,55,79,111,  158,220,312,  464,650,850},
Monty's avatar
Monty committed
229

230
    60,30,500,    3,18.,  1024
Monty's avatar
 
Monty committed
231
  },
Monty's avatar
Monty committed
232
  /* 8: 2048 x 27 */
Monty's avatar
 
Monty committed
233 234 235 236 237
  {
    8,{0,1,2,2,3,3,4,4},{3,4,3,4,3},{0,1,1,2,2},{-1,0,1,2,3},
    {{4},{5,6},{7,8},{-1,9,10,11},{-1,12,13,14}},
    2,{0,2048,   186,46,744, 12,92,372,1500,  28,66,130, 260,520,1112,
       6,20,36,56,  78,110,158,222,  316,440,624,  928,1300,1700},
Monty's avatar
Monty committed
238

239
    60,30,500,    3,18.,  2048
Monty's avatar
 
Monty committed
240
  },
Monty's avatar
Monty committed
241
  /* 9: 512 x 17 */
Monty's avatar
 
Monty committed
242 243 244
  {
    6,{0,1,1,2,3,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2},
    {{3},{4,5},{-1,6,7,8},{-1,9,10,11}},
Monty's avatar
Monty committed
245
    2,{0,512,  46,186,  16,33,65,  93,130,278,
Monty's avatar
 
Monty committed
246
       7,23,39,  55,79,110,  156,232,360},
Monty's avatar
Monty committed
247

248
    60,30,500,    1,18.,  512
Monty's avatar
 
Monty committed
249 250
  },

Monty's avatar
Monty committed
251 252 253 254 255 256 257 258
  /* 10: X x 0 (LFE floor; edge posts only) */
  {
    0,{0}, {0},{0},{-1},
    {{-1}},
    2,{0,12},
    60,30,500,   1.,18.,  10
  },

Monty's avatar
 
Monty committed
259
};