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-2001 *
9 * by the XIPHOPHORUS Company http://www.xiph.org/ *
11 ********************************************************************
13 function: predefined encoding modes
14 last mod: $Id: mode_A.h,v 1.16 2001/06/18 09:07:32 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_128_128aux.vqh"
31 #include "books/res0_128_1024aux.vqh"
33 #include "books/res0_128_128_1.vqh"
34 #include "books/res0_128_128_2.vqh"
35 #include "books/res0_128_128_3.vqh"
36 #include "books/res0_128_128_4.vqh"
37 #include "books/res0_128_128_5.vqh"
39 #include "books/res0_128_1024_1.vqh"
40 #include "books/res0_128_1024_2.vqh"
41 #include "books/res0_128_1024_3.vqh"
42 #include "books/res0_128_1024_4.vqh"
43 #include "books/res0_128_1024_5.vqh"
44 #include "books/res0_128_1024_6.vqh"
45 #include "books/res0_128_1024_7.vqh"
46 #include "books/res0_128_1024_8.vqh"
47 #include "books/res0_128_1024_9.vqh"
50 static vorbis_info_psy _psy_set_A0={
51 ATH_Bark_dB_lspconservative,
59 /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */
60 /* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz */
61 /* y: 0 10 20 30 40 50 60 70 80 90 100 dB */
64 /* 0 10 20 30 40 50 60 70 80 90 100 */
66 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*63*/
67 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*88*/
68 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*125*/
69 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*175*/
70 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*250*/
71 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*350*/
72 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*500*/
73 {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*700*/
75 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*1000*/
76 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*1400*/
77 {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*2000*/
78 {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*2800*/
79 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*4000*/
80 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*5600*/
81 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*8000*/
82 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*11500*/
83 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*16000*/
87 {{-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-22.f,-22.f,-22.f,-22.f,-22.f},/*63*/
88 {-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-22.f,-22.f,-22.f,-22.f,-22.f},/*88*/
89 {-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-22.f,-22.f,-22.f,-22.f,-22.f},/*125*/
90 {-10.f,-10.f,-10.f,-10.f,-16.f,-16.f,-18.f,-20.f,-22.f,-22.f,-22.f},/*175*/
91 {-10.f,-10.f,-10.f,-10.f,-16.f,-16.f,-18.f,-20.f,-22.f,-22.f,-22.f},/*250*/
92 {-10.f,-10.f,-10.f,-10.f,-16.f,-16.f,-18.f,-20.f,-22.f,-22.f,-22.f},/*350*/
93 {-10.f,-10.f,-10.f,-10.f,-16.f,-16.f,-18.f,-20.f,-22.f,-22.f,-22.f},/*500*/
94 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-14.f,-20.f,-22.f,-22.f,-22.f},/*700*/
95 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-14.f,-20.f,-22.f,-22.f,-22.f},/*1000*/
96 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-22.f,-22.f},/*1400*/
97 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-22.f,-22.f},/*2000*/
98 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-22.f,-22.f},/*2400*/
99 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-22.f,-22.f},/*4000*/
100 {-10.f,-10.f,-10.f,-10.f,-10.f,-11.f,-12.f,-13.f,-22.f,-22.f,-22.f},/*5600*/
101 {-10.f,-10.f,-10.f,-10.f,-10.f,-11.f,-12.f,-13.f,-22.f,-22.f,-22.f},/*8000*/
102 {-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-11.f,-22.f,-22.f,-22.f},/*11500*/
103 {-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-20.f,-21.f,-22.f},/*16000*/
107 -10.f, /* suppress any noise curve over maxspec+n */
108 .5f, /* low window */
109 .5f, /* high window */
132 95.f, /* even decade + 5 is important; saves an rint() later in a
138 static vorbis_info_psy _psy_set_A={
139 ATH_Bark_dB_lspconservative,
147 /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */
148 /* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz */
149 /* y: 0 10 20 30 40 50 60 70 80 90 100 dB */
151 /* 0 10 20 30 40 50 60 70 80 90 100 */
153 {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*63*/
154 {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*88*/
155 {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*125*/
157 {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*175*/
158 {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*250*/
159 {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*350*/
160 {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*500*/
161 {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*700*/
163 {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1000*/
164 {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1400*/
165 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2000*/
166 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2800*/
167 {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*4000*/
168 {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*5600*/
170 {-30.f,-30.f,-33.f,-35.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*8000*/
171 {-30.f,-30.f,-33.f,-35.f,-35.f,-45.f,-50.f,-60.f,-70.f,-90.f,-100.f}, /*11500*/
172 {-24.f,-24.f,-26.f,-32.f,-32.f,-42.f,-50.f,-60.f,-70.f,-90.f,-100.f}, /*16000*/
177 {{-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-22.f,-22.f,-24.f,-24.f,-24.f},/*63*/
178 {-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-22.f,-22.f,-24.f,-24.f,-24.f},/*88*/
179 {-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-22.f,-22.f,-24.f,-24.f,-24.f},/*125*/
180 {-10.f,-10.f,-10.f,-10.f,-16.f,-16.f,-18.f,-20.f,-24.f,-24.f,-24.f},/*175*/
181 {-10.f,-10.f,-10.f,-10.f,-16.f,-16.f,-18.f,-20.f,-24.f,-24.f,-24.f},/*250*/
182 {-10.f,-10.f,-10.f,-10.f,-16.f,-16.f,-18.f,-20.f,-22.f,-24.f,-24.f},/*350*/
183 {-10.f,-10.f,-10.f,-10.f,-16.f,-16.f,-18.f,-20.f,-22.f,-24.f,-24.f},/*500*/
184 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-24.f,-24.f},/*700*/
185 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-24.f,-24.f},/*1000*/
186 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-24.f,-24.f},/*1400*/
187 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-24.f,-24.f},/*2000*/
188 {-10.f,-10.f,-10.f,-12.f,-16.f,-16.f,-16.f,-20.f,-22.f,-24.f,-24.f},/*2400*/
189 {-10.f,-10.f,-10.f,-12.f,-16.f,-16.f,-16.f,-20.f,-22.f,-24.f,-24.f},/*4000*/
190 {-10.f,-10.f,-10.f,-12.f,-12.f,-14.f,-16.f,-18.f,-22.f,-24.f,-24.f},/*5600*/
191 {-10.f,-10.f,-10.f,-10.f,-10.f,-14.f,-16.f,-18.f,-22.f,-24.f,-24.f},/*8000*/
192 {-10.f,-10.f,-10.f,-10.f,-10.f,-14.f,-16.f,-18.f,-22.f,-24.f,-24.f},/*11500*/
193 {-10.f,-10.f,-10.f,-10.f,-10.f,-12.f,-16.f,-18.f,-22.f,-24.f,-24.f},/*16000*/
197 -24.f, /* suppress any noise curve over maxspec+n */
198 .5f, /* low window */
199 .5f, /* high window */
218 .900f, 0.f, /*11500*/
219 .900f, 1.f, /*16000*/
222 95.f, /* even decade + 5 is important; saves an rint() later in a
228 /* with GNUisms, this could be short and readable. Oh well */
229 static vorbis_info_time0 _time_set0A={0};
230 static vorbis_info_floor0 _floor_set0A={12, 44100, 64, 10,130, 2, {0,1},
232 static vorbis_info_floor0 _floor_set1A={30, 44100, 256, 12,150, 2, {2,3},
234 static vorbis_info_residue0 _residue_set0A={0,96,16,6,4,
238 {0,99999,9999,9999,9999},
239 {999.f,1.5f,3.5f,15.5f,26.5f},
243 static vorbis_info_residue0 _residue_set1A={0, 960, 32,10,5,
244 {0,1,1,1,1,1,1,1,1,1},
245 {11,12,13,14,15,16,17,18,19},
249 {999.f,1.5f,1.5f,2.5f,2.5f,
250 6.5f,6.5f,12.5f,22.5f},
252 {99,99,99,99,99,99,99,99,99}};
254 static vorbis_info_mapping0 _mapping_set0A={1, {0,0}, {0}, {0}, {0}, {0},
256 static vorbis_info_mapping0 _mapping_set1A={1, {0,0}, {0}, {1}, {1}, {1},
258 static vorbis_info_mode _mode_set0A={0,0,0,0};
259 static vorbis_info_mode _mode_set1A={1,0,0,1};
261 /* CD quality stereo, no channel coupling */
262 codec_setup_info info_A={
264 /* smallblock, largeblock */
266 /* modes,maps,times,floors,residues,books,psys */
267 2, 2, 1, 2, 2, 20, 2,
269 {&_mode_set0A,&_mode_set1A},
271 {0,0},{&_mapping_set0A,&_mapping_set1A},
273 {0,0},{&_time_set0A},
275 {0,0},{&_floor_set0A,&_floor_set1A},
277 {0,0},{&_residue_set0A,&_residue_set1A},
279 {&_vq_book_lsp12_0, /* 0 */
280 &_vq_book_lsp12_1, /* 1 */
281 &_vq_book_lsp30_0, /* 2 */
282 &_vq_book_lsp30_1, /* 3 */
284 &_huff_book_res0_128_128aux,
285 &_huff_book_res0_128_1024aux,
287 &_vq_book_res0_128_128_1,
288 &_vq_book_res0_128_128_2,
289 &_vq_book_res0_128_128_3,
290 &_vq_book_res0_128_128_4,
291 &_vq_book_res0_128_128_5,
293 &_vq_book_res0_128_1024_1,
294 &_vq_book_res0_128_1024_2,
295 &_vq_book_res0_128_1024_3,
296 &_vq_book_res0_128_1024_4,
297 &_vq_book_res0_128_1024_5,
298 &_vq_book_res0_128_1024_6,
299 &_vq_book_res0_128_1024_7,
300 &_vq_book_res0_128_1024_8,
301 &_vq_book_res0_128_1024_9,
305 {&_psy_set_A0,&_psy_set_A},
307 /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
308 256, {26.f,26.f,26.f,30.f}, {-90.f,-90.f,-90.f,-90.f}, -90.f,
315 #define PREDEF_INFO_MAX 0