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_B.h,v 1.16 2001/08/13 01:37:13 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_BG={
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_passB0[]={
83 {64, 4.5,0, 0,12, 0,0},
84 {9999, 7.5,0, 4.5,12, 1.5,0}}
88 static vp_couple_pass _psy_passB[]={
90 {{288, 0,0, 0,0, 0,0},
91 {512, 4.5,0, 0,12, 0,0},
92 {9999, 7.5,0, 4.5,12, 1.5,0}}
96 static vp_attenblock _vp_tonemask_consbass_B={
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_B={
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*/
144 static vp_attenblock _vp_peakatt_B={
145 {{-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*63*/
146 {-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*88*/
147 {-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*125*/
148 {-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*175*/
149 {-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*250*/
150 {-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*350*/
151 {-14.f,-20.f,-20.f,-20.f,-26.f,-32.f,-32.f,-32.f,-32.f,-32.f,-40.f},/*500*/
152 {-10.f,-10.f,-10.f,-14.f,-20.f,-20.f,-20.f,-24.f,-26.f,-32.f,-40.f},/*700*/
153 {-10.f,-10.f,-10.f,-14.f,-20.f,-20.f,-20.f,-24.f,-26.f,-32.f,-40.f},/*1000*/
154 {-10.f,-10.f,-10.f,-14.f,-20.f,-20.f,-20.f,-24.f,-26.f,-32.f,-40.f},/*1400*/
155 {-10.f,-10.f,-10.f,-14.f,-20.f,-20.f,-20.f,-24.f,-26.f,-32.f,-40.f},/*2000*/
156 {-10.f,-10.f,-10.f,-14.f,-20.f,-20.f,-20.f,-24.f,-26.f,-32.f,-40.f},/*2800*/
157 {-10.f,-10.f,-10.f,-10.f,-18.f,-20.f,-20.f,-22.f,-24.f,-32.f,-40.f},/*4000*/
158 {-10.f,-10.f,-10.f,-10.f,-12.f,-14.f,-16.f,-18.f,-22.f,-32.f,-40.f},/*5600*/
159 {-10.f,-10.f,-10.f,-10.f,-10.f,-11.f,-12.f,-13.f,-22.f,-32.f,-40.f},/*8000*/
160 {-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-11.f,-22.f,-32.f,-40.f},/*11500*/
161 {-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-20.f,-32.f,-40.f},/*16000*/
164 static vorbis_info_psy _psy_set_B0={
165 ATH_Bark_dB_lineaggressive,
171 -3.f, -40.f, &_vp_tonemask_consbass_B,
177 1,-10.f, /* suppress any noise curve over maxspec+n */
178 .6f, .6f, /* low/high window */
181 /*63 125 250 500 1k 2k 4k 8k 16k*/
182 {-30,-30,-30,-30,-30,-30,-20,-10, 0, 0, 0, 0, 0, 1, 1, 2, 3},
183 {.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.6f,.75f,.85f,.85f,.85f},
185 105.f, /* even decade + 5 is important; saves an rint() later in a
191 static vorbis_info_psy _psy_set_B={
192 ATH_Bark_dB_lineaggressive,
198 -3.f,-40.f,&_vp_tonemask_consbass_B,
203 1, -10.f, /* suppress any noise curve over maxspec+n */
204 .4f,.4f, /* low/high window */
207 /*63 125 250 500 1k 2k 4k 8k 16k*/
208 { 0, 0, 0, 0, 0, 0, 0, 0, -6, -6, -6, -6, 0, 0, 0, 0, 0},
209 {.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.6f,.7f,.75f,.8f},
211 105.f, /* even decade + 5 is important; saves an rint() later in a
216 static vorbis_info_psy _psy_set_BT={
217 ATH_Bark_dB_lineaggressive,
223 -3.f,-40.f,&_vp_tonemask_consbass_B,
228 1, -10.f, /* suppress any noise curve over maxspec+n */
229 .4f,.4f, /* low/high window */
232 /*63 125 250 500 1k 2k 4k 8k 16k*/
233 {-30,-30,-30,-30,-30,-30,-30,-20, -6, -6, -6, -6, 0, 0, 0, 0, 0},
234 {.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.6f,.7f,.75f,.8f},
236 105.f, /* even decade + 5 is important; saves an rint() later in a
241 /* with GNUisms, this could be short and readable. Oh well */
242 static vorbis_info_time0 _time_set0B={0};
244 static vorbis_info_floor1 _floor_set0B={6,
250 {{2},{-1,3,4,5},{-1,6,7,8}},
258 2,1,4, 11,8,14, 23,20,26,
259 41,35,48, 84,69,103},
266 static vorbis_info_floor1 _floor_set1B={10,
267 {0,1,2,2,2,2,2, 3,3,3},
285 6,3,10, 22,18,26, 41,36,47,
286 69,61,78, 112,99,126, 185,162,211,
287 329,282,387, 672,553,825
295 static vorbis_info_residue0 _residue_set0B={0,224,16,10,23,
296 {0,1,1,1,1,1,1,3,3,7},
309 9999,9999,9999,9999},
321 static vorbis_info_residue0 _residue_set1B={0,1792, 32,10,24,
322 {0,1,1,1,1,1,1,3,3,7},
335 9999,9999,9999,9999},
347 static vorbis_info_mapping0 _mapping_set0B={1, {0,0}, {0}, {0}, {0}, {0,0},
349 static vorbis_info_mapping0 _mapping_set1B={1, {0,0}, {0}, {1}, {1}, {1,2},
351 static vorbis_info_mode _mode_set0B={0,0,0,0};
352 static vorbis_info_mode _mode_set1B={1,0,0,1};
354 /* CD quality stereo, no channel coupling */
355 codec_setup_info info_B={
357 /* smallblock, largeblock */
359 /* modes,maps,times,floors,residues,books,psys */
360 2, 2, 1, 2, 2, 38, 3,
362 {&_mode_set0B,&_mode_set1B},
364 {0,0},{&_mapping_set0B,&_mapping_set1B},
366 {0,0},{&_time_set0B},
368 {1,1},{&_floor_set0B,&_floor_set1B},
370 {2,2},{&_residue_set0B,&_residue_set1B},
374 &_huff_book_line0_class1,
375 &_huff_book_line0_class2, /* 1 */
377 &_huff_book_line0_0sub0, /* 2 */
378 &_huff_book_line0_1sub1, /* 3 */
379 &_huff_book_line0_1sub2,
380 &_huff_book_line0_1sub3, /* 5 */
381 &_huff_book_line0_2sub1,
382 &_huff_book_line0_2sub2, /* 7 */
383 &_huff_book_line0_2sub3,
385 &_huff_book_line1_class0,
386 &_huff_book_line1_class1, /* 10 */
387 &_huff_book_line1_class2,
388 &_huff_book_line1_class3, /* 12 */
390 &_huff_book_line1_0sub0,
391 &_huff_book_line1_0sub1, /* 14 */
392 &_huff_book_line1_1sub0,
393 &_huff_book_line1_1sub1,
394 &_huff_book_line1_2sub1,
395 &_huff_book_line1_2sub2, /* 18 */
396 &_huff_book_line1_2sub3,
397 &_huff_book_line1_3sub1,
398 &_huff_book_line1_3sub2,
399 &_huff_book_line1_3sub3, /* 22 */
401 &_huff_book_res0_128_128aux,
402 &_huff_book_res0_128_1024aux,
404 &_vq_book_res0_128_1024_1,
405 &_vq_book_res0_128_1024_2,
406 &_vq_book_res0_128_1024_3,
407 &_vq_book_res0_128_1024_4,
408 &_vq_book_res0_128_1024_5,
409 &_vq_book_res0_128_1024_6,
410 &_vq_book_res0_128_1024_7,
411 &_vq_book_res0_128_1024_7a,
412 &_vq_book_res0_128_1024_8,
413 &_vq_book_res0_128_1024_8a,
414 &_vq_book_res0_128_1024_9,
415 &_vq_book_res0_128_1024_9a,
416 &_vq_book_res0_128_1024_9b,
420 {&_psy_set_B0,&_psy_set_BT,&_psy_set_B},