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.18 2001/08/13 07:43:15 xiphmont Exp $
16 ********************************************************************/
22 #include "vorbis/codec.h"
25 #include "books/line0_class1.vqh"
26 #include "books/line0_class2.vqh"
27 #include "books/line1_class0.vqh"
28 #include "books/line1_class1.vqh"
29 #include "books/line1_class2.vqh"
30 #include "books/line1_class3.vqh"
32 #include "books/line0_0sub0.vqh"
33 #include "books/line0_1sub1.vqh"
34 #include "books/line0_1sub2.vqh"
35 #include "books/line0_1sub3.vqh"
36 #include "books/line0_2sub1.vqh"
37 #include "books/line0_2sub2.vqh"
38 #include "books/line0_2sub3.vqh"
40 #include "books/line1_0sub0.vqh"
41 #include "books/line1_0sub1.vqh"
42 #include "books/line1_1sub0.vqh"
43 #include "books/line1_1sub1.vqh"
44 #include "books/line1_2sub1.vqh"
45 #include "books/line1_2sub2.vqh"
46 #include "books/line1_2sub3.vqh"
47 #include "books/line1_3sub1.vqh"
48 #include "books/line1_3sub2.vqh"
49 #include "books/line1_3sub3.vqh"
51 #include "books/res0_128_128aux.vqh"
52 #include "books/res0_128_1024aux.vqh"
54 #include "books/res0_128_1024_1.vqh"
55 #include "books/res0_128_1024_2.vqh"
56 #include "books/res0_128_1024_3.vqh"
57 #include "books/res0_128_1024_4.vqh"
58 #include "books/res0_128_1024_5.vqh"
59 #include "books/res0_128_1024_6.vqh"
60 #include "books/res0_128_1024_7.vqh"
61 #include "books/res0_128_1024_7a.vqh"
62 #include "books/res0_128_1024_8.vqh"
63 #include "books/res0_128_1024_8a.vqh"
64 #include "books/res0_128_1024_9.vqh"
65 #include "books/res0_128_1024_9a.vqh"
66 #include "books/res0_128_1024_9b.vqh"
69 static vorbis_info_psy_global _psy_set_AG={
71 8, /* lines per eighth octave */
73 /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
74 256, {26.f,26.f,26.f,30.f}, {-90.f,-90.f,-90.f,-90.f}, -90.f,
80 static struct vp_couple_pass _psy_passA0[]={
83 {64, 0,0, 12.5f,12, 0,0},
84 {9999, 0,0, 12.5f,12, 2.5f,0}}
88 static vp_couple_pass _psy_passA[]={
90 {{288, 0,0, 0,0, 0,0},
91 {512, 0,0, 12.5f,12, 0,0},
92 {9999, 0,0, 12.5f,12, 2.5f,0}}
96 static vp_attenblock _vp_tonemask_consbass_A={
97 {{-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*63*/
98 {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*88*/
99 {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*125*/
100 {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*175*/
101 {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*250*/
102 {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*350*/
103 {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*500*/
104 {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*700*/
106 {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1000*/
107 {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1400*/
108 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2000*/
109 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2800*/
110 {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*4000*/
111 {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*5600*/
113 {-30.f,-30.f,-33.f,-35.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*8000*/
114 {-30.f,-30.f,-33.f,-35.f,-35.f,-45.f,-50.f,-60.f,-70.f,-90.f,-100.f}, /*11500*/
115 {-24.f,-24.f,-26.f,-32.f,-32.f,-42.f,-50.f,-60.f,-70.f,-90.f,-100.f}, /*16000*/
118 static vp_attenblock _vp_tonemask_A={
120 {{-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*63*/
121 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*88*/
122 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*125*/
125 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*175*/
126 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*250*/
127 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*350*/
128 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*500*/
129 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*700*/
130 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1000*/
131 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1400*/
132 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2000*/
133 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2800*/
134 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*4000*/
136 {-30.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*5600*/
138 {-30.f,-30.f,-33.f,-35.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*8000*/
139 {-30.f,-30.f,-33.f,-35.f,-40.f,-45.f,-50.f,-60.f,-70.f,-85.f,-100.f}, /*11500*/
140 {-24.f,-24.f,-26.f,-32.f,-32.f,-42.f,-50.f,-60.f,-70.f,-85.f,-100.f}, /*16000*/
143 static vp_attenblock _vp_peakatt_A={
144 {{-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*63*/
145 {-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*88*/
146 {-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*125*/
147 {-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*175*/
148 {-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*250*/
149 {-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*350*/
150 {-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*500*/
151 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-14.f,-20.f,-26.f,-32.f,-40.f},/*700*/
152 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-14.f,-20.f,-22.f,-32.f,-40.f},/*1000*/
153 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-32.f,-40.f},/*1400*/
154 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-32.f,-40.f},/*2000*/
155 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-32.f,-40.f},/*2400*/
156 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-32.f,-40.f},/*4000*/
157 {-10.f,-10.f,-10.f,-10.f,-10.f,-11.f,-12.f,-13.f,-22.f,-32.f,-40.f},/*5600*/
158 {-10.f,-10.f,-10.f,-10.f,-10.f,-11.f,-12.f,-13.f,-22.f,-32.f,-40.f},/*8000*/
159 {-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-11.f,-22.f,-32.f,-40.f},/*11500*/
160 {-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-20.f,-32.f,-40.f},/*16000*/
163 static vorbis_info_psy _psy_set_A0={
164 ATH_Bark_dB_lineaggressive,
170 0.f, -40.f,&_vp_tonemask_consbass_A,
176 -30.f, /* suppress any noise curve over maxspec+n */
177 .6f, .6f, /* low/high window */
180 /*63 125 250 500 1k 2k 4k 8k 16k*/
181 {-30,-30,-30,-30,-30,-30,-20,-10, 0, 0, 0, 0, 0, 1, 1, 2, 3},
182 {.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.7f,.8f,.9f,.9f,.9f},
184 95.f, /* even decade + 5 is important; saves an rint() later in a
190 static vorbis_info_psy _psy_set_A={
191 ATH_Bark_dB_lineaggressive,
197 0.f,-40.f,&_vp_tonemask_consbass_A,
202 1, -30.f, /* suppress any noise curve over maxspec+n */
203 .4f,.4f, /* low/high window */
206 /*63 125 250 500 1k 2k 4k 8k 16k*/
207 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
208 {.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.7f,.75f,.8f,.8f,.85f},
210 95.f, /* even decade + 5 is important; saves an rint() later in a
215 static vorbis_info_psy _psy_set_AT={
216 ATH_Bark_dB_lineaggressive,
222 0.f,-40.f,&_vp_tonemask_consbass_A,
227 1, -30.f, /* suppress any noise curve over maxspec+n */
228 .4f,.4f, /* low/high window */
231 /*63 125 250 500 1k 2k 4k 8k 16k*/
232 {-30,-30,-30,-30,-30,-30,-30,-20, 0, 0, 0, 0, 0, 0, 0, 0, 0},
233 {.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.7f,.75f,.8f,.8f,.85f},
235 95.f, /* even decade + 5 is important; saves an rint() later in a
239 /* with GNUisms, this could be short and readable. Oh well */
240 static vorbis_info_time0 _time_set0A={0};
242 static vorbis_info_floor1 _floor_set0A={6,
248 {{2},{-1,3,4,5},{-1,6,7,8}},
256 2,1,4, 11,8,14, 23,20,26,
257 41,35,48, 84,69,103},
264 static vorbis_info_floor1 _floor_set1A={10,
265 {0,1,2,2,2,2,2, 3,3,3},
283 6,3,10, 22,18,26, 41,36,47,
284 69,61,78, 112,99,126, 185,162,211,
285 329,282,387, 672,553,825
293 static vorbis_info_residue0 _residue_set0A={0,192,8,10,23,
294 {0,1,1,1,1,1,1,3,3,7},
304 {9999,9999,9999,9999,9999,9999,
305 9999,9999,9999,9999},
311 {99,16,99,6,16,99,99,99,99,99},
314 static vorbis_info_residue0 _residue_set1A={0,1536, 32,10,24,
315 {0,1,1,1,1,1,1,3,3,7},
325 {9999,9999,9999,9999,9999,9999,
326 9999,9999,9999,9999},
332 {99,32,99,18,32,99,99,99,99,99},
335 static vorbis_info_mapping0 _mapping_set0A={1, {0,0}, {0}, {0}, {0}, {0,0},
337 static vorbis_info_mapping0 _mapping_set1A={1, {0,0}, {0}, {1}, {1}, {1,2},
339 static vorbis_info_mode _mode_set0A={0,0,0,0};
340 static vorbis_info_mode _mode_set1A={1,0,0,1};
342 /* CD quality stereo, no channel coupling */
343 codec_setup_info info_A={
345 /* smallblock, largeblock */
347 /* modes,maps,times,floors,residues,books,psys */
348 2, 2, 1, 2, 2, 38, 3,
350 {&_mode_set0A,&_mode_set1A},
352 {0,0},{&_mapping_set0A,&_mapping_set1A},
354 {0,0},{&_time_set0A},
356 {1,1},{&_floor_set0A,&_floor_set1A},
358 {2,2},{&_residue_set0A,&_residue_set1A},
362 &_huff_book_line0_class1,
363 &_huff_book_line0_class2, /* 1 */
365 &_huff_book_line0_0sub0, /* 2 */
366 &_huff_book_line0_1sub1, /* 3 */
367 &_huff_book_line0_1sub2,
368 &_huff_book_line0_1sub3, /* 5 */
369 &_huff_book_line0_2sub1,
370 &_huff_book_line0_2sub2, /* 7 */
371 &_huff_book_line0_2sub3,
373 &_huff_book_line1_class0,
374 &_huff_book_line1_class1, /* 10 */
375 &_huff_book_line1_class2,
376 &_huff_book_line1_class3, /* 12 */
378 &_huff_book_line1_0sub0,
379 &_huff_book_line1_0sub1, /* 14 */
380 &_huff_book_line1_1sub0,
381 &_huff_book_line1_1sub1,
382 &_huff_book_line1_2sub1,
383 &_huff_book_line1_2sub2, /* 18 */
384 &_huff_book_line1_2sub3,
385 &_huff_book_line1_3sub1,
386 &_huff_book_line1_3sub2,
387 &_huff_book_line1_3sub3, /* 22 */
389 &_huff_book_res0_128_128aux,
390 &_huff_book_res0_128_1024aux,
392 &_vq_book_res0_128_1024_1,
393 &_vq_book_res0_128_1024_2,
394 &_vq_book_res0_128_1024_3,
395 &_vq_book_res0_128_1024_4,
396 &_vq_book_res0_128_1024_5,
397 &_vq_book_res0_128_1024_6,
398 &_vq_book_res0_128_1024_7,
399 &_vq_book_res0_128_1024_7a,
400 &_vq_book_res0_128_1024_8,
401 &_vq_book_res0_128_1024_8a,
402 &_vq_book_res0_128_1024_9,
403 &_vq_book_res0_128_1024_9a,
404 &_vq_book_res0_128_1024_9b,
408 {&_psy_set_A0,&_psy_set_AT,&_psy_set_A},