1 /********************************************************************
3 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
5 * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH *
6 * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
8 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2000 *
9 * by Monty <monty@xiph.org> and the XIPHOPHORUS Company *
10 * http://www.xiph.org/ *
12 ********************************************************************
14 function: predefined encoding modes
15 last mod: $Id: mode_B.h,v 1.8 2001/02/01 01:03:30 xiphmont Exp $
17 ********************************************************************/
23 #include "vorbis/codec.h"
26 #include "books/lsp12_0.vqh"
27 #include "books/lsp30_0.vqh"
28 #include "books/lsp12_1.vqh"
29 #include "books/lsp30_1.vqh"
31 #include "books/res0_160_128aux.vqh"
32 #include "books/res0_160_1024aux.vqh"
34 #include "books/res0_160_128_1.vqh"
35 #include "books/res0_160_128_2.vqh"
36 #include "books/res0_160_128_3.vqh"
37 #include "books/res0_160_128_4.vqh"
38 #include "books/res0_160_128_5.vqh"
40 #include "books/res0_160_1024_1.vqh"
41 #include "books/res0_160_1024_2.vqh"
42 #include "books/res0_160_1024_3.vqh"
43 #include "books/res0_160_1024_4.vqh"
44 #include "books/res0_160_1024_5.vqh"
45 #include "books/res0_160_1024_6.vqh"
46 #include "books/res0_160_1024_7.vqh"
47 #include "books/res0_160_1024_8.vqh"
48 #include "books/res0_160_1024_9.vqh"
51 static vorbis_info_psy _psy_set_B0={
60 /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */
61 /* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz */
62 /* y: 0 10 20 30 40 50 60 70 80 90 100 dB */
65 /* 0 10 20 30 40 50 60 70 80 90 100 */
67 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*63*/
68 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*88*/
69 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*125*/
70 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*175*/
71 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*250*/
72 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*350*/
73 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*500*/
74 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*700*/
76 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*1000*/
77 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*1400*/
78 {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*2000*/
79 {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*2800*/
80 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*4000*/
81 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*5600*/
82 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*8000*/
83 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*11500*/
84 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*16000*/
88 {{-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*63*/
89 {-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*88*/
90 {-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*125*/
91 {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*175*/
92 {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*250*/
93 {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*350*/
94 {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*500*/
95 {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*700*/
96 {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-24.f,-28.f,-28.f,-28.f},/*1000*/
97 {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*1400*/
98 {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*2000*/
99 {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*2400*/
100 {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*4000*/
101 {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-12.f,-20.f,-28.f,-28.f,-28.f},/*5600*/
102 {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-20.f,-28.f,-28.f,-28.f},/*8000*/
103 {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-20.f,-28.f,-28.f,-28.f},/*11500*/
104 {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-20.f,-24.f,-28.f},/*16000*/
108 -10.f, /* suppress any noise curve over maxspec+n */
109 .5f, /* low window */
110 .5f, /* high window */
132 105.f, /* even decade + 5 is important; saves an rint() later in a
136 -0., -.004 /* attack/decay control */
139 static vorbis_info_psy _psy_set_B={
148 /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */
149 /* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz */
150 /* y: 0 10 20 30 40 50 60 70 80 90 100 dB */
152 /* 0 10 20 30 40 50 60 70 80 90 100 */
154 {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*63*/
155 {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*88*/
156 {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*125*/
157 // {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*175*/
158 // {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*250*/
159 // {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*350*/
160 // {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*500*/
161 // {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*700*/
163 // {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*63*/
164 // {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*88*/
165 // {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*125*/
166 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*175*/
167 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*250*/
168 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*350*/
169 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*500*/
170 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*700*/
172 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1000*/
173 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1400*/
174 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2000*/
175 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2800*/
176 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*4000*/
177 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*5600*/
179 {-30.f,-35.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*8000*/
180 {-30.f,-35.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*11500*/
181 {-30.f,-34.f,-36.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*16000*/
186 {{-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*63*/
187 {-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*88*/
188 {-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*125*/
189 {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*175*/
190 {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*250*/
191 {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*350*/
192 {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*500*/
193 {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*700*/
194 {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-24.f,-28.f,-28.f,-28.f},/*1000*/
195 {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*1400*/
196 {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*2000*/
197 {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*2400*/
198 {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*4000*/
199 {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-12.f,-20.f,-28.f,-28.f,-28.f},/*5600*/
200 {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-20.f,-28.f,-28.f,-28.f},/*8000*/
201 {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-20.f,-28.f,-28.f,-28.f},/*11500*/
202 {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-20.f,-24.f,-28.f},/*16000*/
206 -10.f, /* suppress any noise curve over maxspec+n */
207 .5f, /* low window */
208 .5f, /* high window */
219 .300f, -2.f, /*1000*/
220 .400f, -2.f, /*1400*/
221 .400f, -2.f, /*2000*/
222 .400f, -2.f, /*2800*/
223 .700f, -2.f, /*4000*/
224 .850f, -3.f, /*5600*/
225 .900f, -3.f, /*8000*/
226 .900f, -3.f, /*11500*/
227 .900f, -3.f, /*16000*/
230 105.f, /* even decade + 5 is important; saves an rint() later in a
234 -0.f, -.004f, /* attack/decay control */
238 /* with GNUisms, this could be short and readable. Oh well */
239 static vorbis_info_time0 _time_set0B={0};
240 static vorbis_info_floor0 _floor_set0B={12, 44100, 64, 10,130, 2, {0,1},
242 static vorbis_info_floor0 _floor_set1B={30, 44100, 256, 12,150, 2, {2,3},
244 static vorbis_info_residue0 _residue_set0B={0,96,16,6,4,
248 {0,99999,9999,9999,9999},
249 {999.f,1.5f,3.5f,15.5f,26.5f},
253 static vorbis_info_residue0 _residue_set1B={0,1024, 32,10,5,
254 {0,1,1,1,1,1,1,1,1,1},
255 {11,12,13,14,15,16,17,18,19},
259 {999.f,1.5f,1.5f,2.5f,2.5f,
260 6.5f,6.5f,14.5f,30.f},
262 {99,99,99,99,99,99,99,99,99}};
264 static vorbis_info_mapping0 _mapping_set0B={1, {0,0}, {0}, {0}, {0}, {0}};
265 static vorbis_info_mapping0 _mapping_set1B={1, {0,0}, {0}, {1}, {1}, {1}};
266 static vorbis_info_mode _mode_set0B={0,0,0,0};
267 static vorbis_info_mode _mode_set1B={1,0,0,1};
269 /* CD quality stereo, no channel coupling */
270 codec_setup_info info_B={
272 /* smallblock, largeblock */
274 /* modes,maps,times,floors,residues,books,psys */
275 2, 2, 1, 2, 2, 20, 2,
277 {&_mode_set0B,&_mode_set1B},
279 {0,0},{&_mapping_set0B,&_mapping_set1B},
281 {0,0},{&_time_set0B},
283 {0,0},{&_floor_set0B,&_floor_set1B},
285 {0,0},{&_residue_set0B,&_residue_set1B},
287 {&_vq_book_lsp12_0, /* 0 */
288 &_vq_book_lsp12_1, /* 1 */
289 &_vq_book_lsp30_0, /* 2 */
290 &_vq_book_lsp30_1, /* 3 */
292 &_huff_book_res0_160_128aux,
293 &_huff_book_res0_160_1024aux,
295 &_vq_book_res0_160_128_1,
296 &_vq_book_res0_160_128_2,
297 &_vq_book_res0_160_128_3,
298 &_vq_book_res0_160_128_4,
299 &_vq_book_res0_160_128_5,
301 &_vq_book_res0_160_1024_1,
302 &_vq_book_res0_160_1024_2,
303 &_vq_book_res0_160_1024_3,
304 &_vq_book_res0_160_1024_4,
305 &_vq_book_res0_160_1024_5,
306 &_vq_book_res0_160_1024_6,
307 &_vq_book_res0_160_1024_7,
308 &_vq_book_res0_160_1024_8,
309 &_vq_book_res0_160_1024_9,
313 {&_psy_set_B0,&_psy_set_B},
314 /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
315 256, 20.f, -20.f, -96.f,
322 #define PREDEF_INFO_MAX 0