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-2001 *
9 * by the XIPHOPHORUS Company http://www.xiph.org/ *
11 ********************************************************************
13 function: predefined encoding modes
14 last mod: $Id: mode_E.h,v 1.9 2001/02/15 19:06:02 xiphmont Exp $
16 ********************************************************************/
22 #include "vorbis/codec.h"
25 #include "books/lsp12_0.vqh"
26 #include "books/lsp30_0.vqh"
27 #include "books/lsp12_1.vqh"
28 #include "books/lsp30_1.vqh"
30 #include "books/res0_256_128aux.vqh"
31 #include "books/res0_256_1024aux.vqh"
33 #include "books/res0_256_128_1.vqh"
34 #include "books/res0_256_128_2.vqh"
35 #include "books/res0_256_128_3.vqh"
36 #include "books/res0_256_128_4.vqh"
37 #include "books/res0_256_128_5.vqh"
39 #include "books/res0_256_1024_1.vqh"
40 #include "books/res0_256_1024_2.vqh"
41 #include "books/res0_256_1024_3.vqh"
42 #include "books/res0_256_1024_4.vqh"
43 #include "books/res0_256_1024_5.vqh"
44 #include "books/res0_256_1024_6.vqh"
45 #include "books/res0_256_1024_7.vqh"
48 static vorbis_info_psy _psy_set_E0={
57 /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */
58 /* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz */
59 /* y: 0 10 20 30 40 50 60 70 80 90 100 dB */
62 /* 0 10 20 30 40 50 60 70 80 90 100 */
64 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*63*/
65 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*88*/
66 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*125*/
67 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*175*/
68 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*250*/
69 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*350*/
70 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*500*/
71 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*700*/
73 {-35.,-35.,-35.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*1000*/
74 {-35.,-35.,-35.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*1400*/
75 {-45.,-45.,-45.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*2000*/
76 {-45.,-45.,-45.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*2800*/
77 {-35.,-35.,-35.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*4000*/
78 {-35.,-35.,-35.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*5600*/
79 {-35.,-35.,-35.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*8000*/
80 {-35.,-35.,-35.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*11500*/
81 {-35.,-35.,-35.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*16000*/
85 {{-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*63*/
86 {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*88*/
87 {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*125*/
88 {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*175*/
89 {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*250*/
90 {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*350*/
91 {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*500*/
92 {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*700*/
93 {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*1000*/
94 {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*1400*/
95 {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*2000*/
96 {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*2800*/
97 {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*4000*/
99 {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*5600*/
100 {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*8000*/
101 {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*11500*/
102 {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f},/*16000*/
106 -30.f, /* suppress any noise curve over maxspec+n */
107 .5f, /* low window */
108 .5f, /* high window */
126 .500f, -5.f,/*11500*/
127 .500f, -4.f,/*16000*/
130 105.f, /* even decade + 5 is important; saves an rint() later in a
134 -0., -.004 /* attack/decay control */
137 static vorbis_info_psy _psy_set_E={
146 /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */
147 /* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz */
148 /* y: 0 10 20 30 40 50 60 70 80 90 100 dB */
150 /* 0 10 20 30 40 50 60 70 80 90 100 */
152 {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*63*/
153 {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*88*/
154 {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*125*/
155 // {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*175*/
156 // {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*250*/
157 // {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*350*/
158 // {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*500*/
159 // {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*700*/
161 // {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*63*/
162 // {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*88*/
163 // {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*125*/
164 {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*175*/
165 {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*250*/
166 {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*350*/
167 {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*500*/
168 {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*700*/
169 {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*1000*/
170 {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*1400*/
171 {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*2000*/
172 {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*2800*/
173 {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*4000*/
174 {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*5600*/
175 {-35.f,-45.f,-45.f,-45.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f}, /*8000*/
176 {-35.f,-45.f,-45.f,-45.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f}, /*11500*/
177 {-35.f,-35.f,-45.f,-45.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f}, /*16000*/
182 {{-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*63*/
183 {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*88*/
184 {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*125*/
185 {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*175*/
186 {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*250*/
187 {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*350*/
188 {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*500*/
189 {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*700*/
190 {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*1000*/
191 {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*1400*/
192 {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*2800*/
193 {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*2800*/
194 {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*4000*/
195 {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*5600*/
196 {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*8000*/
197 {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*11500*/
198 {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*16000*/
202 -15.f, /* suppress any noise curve over maxspec+n */
203 .5f, /* low window */
204 .5f, /* high window */
220 .500f, -12.f, /*5600*/
221 .500f, -12.f, /*8000*/
222 .500f, -10.f, /*11500*/
223 .500f, -10.f, /*16000*/
226 105.f, /* even decade + 5 is important; saves an rint() later in a
230 -0.f, -.004f, /* attack/decay control */
234 /* with GNUisms, this could be short and readable. Oh well */
235 static vorbis_info_time0 _time_set0E={0};
236 static vorbis_info_floor0 _floor_set0E={12, 44100, 64, 10,130, 2, {0,1},
238 static vorbis_info_floor0 _floor_set1E={30, 44100, 256, 12,150, 2, {2,3},
240 static vorbis_info_residue0 _residue_set0E={0,128,16,6,4,
244 {0,99999,9999,9999,9999},
245 {999.f,1.5f,2.5f,6.5f,40.5f},
249 static vorbis_info_residue0 _residue_set1E={0,1024, 32,8,5,
250 {0,1,1,1,1,1,1,1,1,1},
251 {11,12,13,14,15,16,17,18,19},
253 {0,9999,9999,60,9999,
255 {999.f,2.5f,4.5f,10.5f,10.5f,
258 {99,99,99,99,99,99,99,99,99}};
260 static vorbis_info_mapping0 _mapping_set0E={1, {0,0}, {0}, {0}, {0}, {0}};
261 static vorbis_info_mapping0 _mapping_set1E={1, {0,0}, {0}, {1}, {1}, {1}};
262 static vorbis_info_mode _mode_set0E={0,0,0,0};
263 static vorbis_info_mode _mode_set1E={1,0,0,1};
265 /* CD quality stereo, no channel coupling */
266 codec_setup_info info_E={
268 /* smallblock, largeblock */
270 /* modes,maps,times,floors,residues,books,psys */
271 2, 2, 1, 2, 2, 18, 2,
273 {&_mode_set0E,&_mode_set1E},
275 {0,0},{&_mapping_set0E,&_mapping_set1E},
277 {0,0},{&_time_set0E},
279 {0,0},{&_floor_set0E,&_floor_set1E},
281 {0,0},{&_residue_set0E,&_residue_set1E},
283 {&_vq_book_lsp12_0, /* 0 */
284 &_vq_book_lsp12_1, /* 1 */
285 &_vq_book_lsp30_0, /* 2 */
286 &_vq_book_lsp30_1, /* 3 */
288 &_huff_book_res0_256_128aux,
289 &_huff_book_res0_256_1024aux,
291 &_vq_book_res0_256_128_1,
292 &_vq_book_res0_256_128_2,
293 &_vq_book_res0_256_128_3,
294 &_vq_book_res0_256_128_4,
295 &_vq_book_res0_256_128_5,
297 &_vq_book_res0_256_1024_1,
298 &_vq_book_res0_256_1024_2,
299 &_vq_book_res0_256_1024_3,
300 &_vq_book_res0_256_1024_4,
301 &_vq_book_res0_256_1024_5,
302 &_vq_book_res0_256_1024_6,
303 &_vq_book_res0_256_1024_7,
307 {&_psy_set_E0,&_psy_set_E},
308 /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
309 256, {26.f,26.f,26.f,30.f}, {-90.f,-90.f,-90.f,-90.f}, -90.f,
316 #define PREDEF_INFO_MAX 0