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_AA.h,v 1.5 2001/02/01 01:03:30 xiphmont Exp $
17 ********************************************************************/
19 #ifndef _V_MODES_AA_H_
20 #define _V_MODES_AA_H_
23 #include "vorbis/codec.h"
26 #include "books/lsp9_0.vqh"
27 #include "books/lsp30_0.vqh"
28 #include "books/lsp9_1.vqh"
29 #include "books/lsp30_1.vqh"
31 #include "books/res0_96_128aux.vqh"
32 #include "books/res0_96_1024aux.vqh"
34 #include "books/res0_96_128_1.vqh"
35 #include "books/res0_96_128_2.vqh"
36 #include "books/res0_96_128_3.vqh"
37 #include "books/res0_96_128_4.vqh"
38 #include "books/res0_96_128_5.vqh"
40 #include "books/res0_96_1024_1.vqh"
41 #include "books/res0_96_1024_2.vqh"
42 #include "books/res0_96_1024_3.vqh"
43 #include "books/res0_96_1024_4.vqh"
44 #include "books/res0_96_1024_5.vqh"
45 #include "books/res0_96_1024_6.vqh"
46 #include "books/res0_96_1024_7.vqh"
47 #include "books/res0_96_1024_8.vqh"
48 #include "books/res0_96_1024_9.vqh"
51 static vorbis_info_psy _psy_set_AA0={
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,-22.f,-22.f,-22.f,-22.f,-22.f},/*63*/
89 {-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-22.f,-22.f,-22.f,-22.f,-22.f},/*88*/
90 {-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-22.f,-22.f,-22.f,-22.f,-22.f},/*125*/
91 {-10.f,-10.f,-10.f,-10.f,-16.f,-16.f,-18.f,-20.f,-22.f,-22.f,-22.f},/*175*/
92 {-10.f,-10.f,-10.f,-10.f,-16.f,-16.f,-18.f,-20.f,-22.f,-22.f,-22.f},/*250*/
93 {-10.f,-10.f,-10.f,-10.f,-16.f,-16.f,-18.f,-20.f,-22.f,-22.f,-22.f},/*350*/
94 {-10.f,-10.f,-10.f,-10.f,-16.f,-16.f,-18.f,-20.f,-22.f,-22.f,-22.f},/*500*/
95 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-14.f,-20.f,-22.f,-22.f,-22.f},/*700*/
96 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-14.f,-20.f,-22.f,-22.f,-22.f},/*1000*/
97 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-22.f,-22.f},/*1400*/
98 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-22.f,-22.f},/*2000*/
99 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-22.f,-22.f},/*2400*/
100 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-22.f,-22.f},/*4000*/
101 {-10.f,-10.f,-10.f,-10.f,-10.f,-11.f,-12.f,-13.f,-22.f,-22.f,-22.f},/*5600*/
102 {-10.f,-10.f,-10.f,-10.f,-10.f,-11.f,-12.f,-13.f,-22.f,-22.f,-22.f},/*8000*/
103 {-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-11.f,-22.f,-22.f,-22.f},/*11500*/
104 {-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-20.f,-21.f,-22.f},/*16000*/
108 -0.f, /* suppress any noise curve over maxspec+n */
109 .5f, /* low window */
110 .5f, /* high window */
132 95.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_AA={
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 {-30.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*175*/
167 {-30.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*250*/
168 {-30.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*350*/
169 {-30.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*500*/
170 {-30.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*700*/
172 {-30.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1000*/
173 {-30.f,-35.f,-35.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 {-30.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*4000*/
177 {-30.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*5600*/
179 {-20.f,-25.f,-30.f,-35.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*8000*/
180 {-20.f,-25.f,-30.f,-35.f,-35.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f}, /*11500*/
181 {-20.f,-24.f,-26.f,-32.f,-35.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f}, /*16000*/
186 {{-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-22.f,-22.f,-22.f,-22.f,-22.f},/*63*/
187 {-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-22.f,-22.f,-22.f,-22.f,-22.f},/*88*/
188 {-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-22.f,-22.f,-22.f,-22.f,-22.f},/*125*/
189 {-10.f,-10.f,-10.f,-10.f,-16.f,-16.f,-18.f,-20.f,-22.f,-22.f,-22.f},/*175*/
190 {-10.f,-10.f,-10.f,-10.f,-16.f,-16.f,-18.f,-20.f,-22.f,-22.f,-22.f},/*250*/
191 {-10.f,-10.f,-10.f,-10.f,-16.f,-16.f,-18.f,-20.f,-22.f,-22.f,-22.f},/*350*/
192 {-10.f,-10.f,-10.f,-10.f,-16.f,-16.f,-18.f,-20.f,-22.f,-22.f,-22.f},/*500*/
193 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-22.f,-22.f},/*700*/
194 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-22.f,-22.f},/*1000*/
195 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-22.f,-22.f},/*1400*/
196 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-22.f,-22.f},/*2000*/
197 {-10.f,-10.f,-10.f,-12.f,-16.f,-16.f,-16.f,-20.f,-22.f,-22.f,-22.f},/*2400*/
198 {-10.f,-10.f,-10.f,-12.f,-16.f,-16.f,-16.f,-20.f,-22.f,-22.f,-22.f},/*4000*/
199 {-10.f,-10.f,-10.f,-12.f,-12.f,-14.f,-16.f,-18.f,-22.f,-22.f,-22.f},/*5600*/
200 {-10.f,-10.f,-10.f,-10.f,-10.f,-14.f,-16.f,-18.f,-22.f,-22.f,-22.f},/*8000*/
201 {-10.f,-10.f,-10.f,-10.f,-10.f,-14.f,-16.f,-18.f,-22.f,-22.f,-22.f},/*11500*/
202 {-10.f,-10.f,-10.f,-10.f,-10.f,-12.f,-16.f,-18.f,-22.f,-22.f,-22.f},/*16000*/
206 -0.f, /* suppress any noise curve over maxspec+n */
207 .7f, /* low window */
208 .7f, /* high window */
226 .900f, 0.f, /*11500*/
227 .900f, 1.f, /*16000*/
230 95.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_set0AA={0};
240 static vorbis_info_floor0 _floor_set0AA={9, 44100, 64, 10,130, 2, {0,1},
242 static vorbis_info_floor0 _floor_set1AA={30, 44100, 256, 12,150, 2, {2,3},
244 static vorbis_info_residue0 _residue_set0AA={0,64,16,6,4,
248 {0,7,9999,9999,9999},
249 {999.f,2.f,2.f,9.5f,26.f},
253 static vorbis_info_residue0 _residue_set1AA={0, 768, 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,2.f,2.f,4.f,4.f,
260 9.5f,9.5f,18.f,37.f},
262 {99,99,99,99,99,99,99,99,99}};
264 static vorbis_info_mapping0 _mapping_set0AA={1, {0,0}, {0}, {0}, {0}, {0}};
265 static vorbis_info_mapping0 _mapping_set1AA={1, {0,0}, {0}, {1}, {1}, {1}};
266 static vorbis_info_mode _mode_set0AA={0,0,0,0};
267 static vorbis_info_mode _mode_set1AA={1,0,0,1};
269 /* CD quality stereo, no channel coupling */
270 codec_setup_info info_AA={
272 /* smallblock, largeblock */
274 /* modes,maps,times,floors,residues,books,psys */
275 2, 2, 1, 2, 2, 20, 2,
277 {&_mode_set0AA,&_mode_set1AA},
279 {0,0},{&_mapping_set0AA,&_mapping_set1AA},
281 {0,0},{&_time_set0AA},
283 {0,0},{&_floor_set0AA,&_floor_set1AA},
285 {0,0},{&_residue_set0AA,&_residue_set1AA},
287 {&_vq_book_lsp9_0, /* 0 */
288 &_vq_book_lsp9_1, /* 1 */
289 &_vq_book_lsp30_0, /* 2 */
290 &_vq_book_lsp30_1, /* 3 */
292 &_huff_book_res0_96_128aux,
293 &_huff_book_res0_96_1024aux,
295 &_vq_book_res0_96_128_1,
296 &_vq_book_res0_96_128_2,
297 &_vq_book_res0_96_128_3,
298 &_vq_book_res0_96_128_4,
299 &_vq_book_res0_96_128_5,
301 &_vq_book_res0_96_1024_1,
302 &_vq_book_res0_96_1024_2,
303 &_vq_book_res0_96_1024_3,
304 &_vq_book_res0_96_1024_4,
305 &_vq_book_res0_96_1024_5,
306 &_vq_book_res0_96_1024_6,
307 &_vq_book_res0_96_1024_7,
308 &_vq_book_res0_96_1024_8,
309 &_vq_book_res0_96_1024_9,
313 {&_psy_set_AA0,&_psy_set_AA},
314 /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
315 256, 22.f, -22.f, -96.f,
322 #define PREDEF_INFO_MAX 0