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_D.h,v 1.16 2001/08/13 01:37:14 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_8.vqh"
62 #include "books/res0_128_1024_8a.vqh"
63 #include "books/res0_128_1024_9.vqh"
64 #include "books/res0_128_1024_9a.vqh"
65 #include "books/res0_128_1024_9b.vqh"
68 static vorbis_info_psy_global _psy_set_DG={
70 8, /* lines per eighth octave */
72 /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
73 256, {26.f,26.f,26.f,30.f}, {-90.f,-90.f,-90.f,-90.f}, -90.f,
79 static struct vp_couple_pass _psy_passD[]={
81 {{9999, 0,0, 0,0, 0,0}}
85 static vp_attenblock _vp_tonemask_consbass_D={
86 {{-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*63*/
87 {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*88*/
88 {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*125*/
89 {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*175*/
90 {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*250*/
91 {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*350*/
92 {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*500*/
93 {-40.f,-40.f,-40.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f,-115.f}, /*700*/
95 {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1000*/
96 {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1400*/
97 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2000*/
98 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2800*/
99 {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*4000*/
100 {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*5600*/
102 {-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f}, /*8000*/
103 {-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f},
104 {-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f},
107 static vp_attenblock _vp_tonemask_D={
109 {{-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*63*/
110 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*88*/
111 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*125*/
114 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*175*/
115 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*250*/
116 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*350*/
117 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*500*/
118 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*700*/
119 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1000*/
120 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1400*/
121 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2000*/
122 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2800*/
123 {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*4000*/
126 {-30.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*5600*/
127 {-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f}, /*8000*/
128 {-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f},
129 {-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f,-9e9f},
133 static vp_attenblock _vp_peakatt_D={
135 {-14.f,-20.f,-24.f,-26.f,-32.f,-34.f,-36.f,-38.f,-40.f,-40.f,-40.f},/*63*/
136 {-14.f,-20.f,-24.f,-26.f,-32.f,-34.f,-36.f,-38.f,-40.f,-40.f,-40.f},/*88*/
137 {-14.f,-20.f,-24.f,-26.f,-32.f,-34.f,-36.f,-38.f,-40.f,-40.f,-40.f},/*125*/
138 {-14.f,-20.f,-24.f,-26.f,-32.f,-34.f,-36.f,-38.f,-40.f,-40.f,-40.f},/*170*/
139 {-14.f,-20.f,-24.f,-26.f,-32.f,-34.f,-36.f,-38.f,-40.f,-40.f,-40.f},/*250*/
140 {-14.f,-20.f,-24.f,-26.f,-32.f,-34.f,-36.f,-38.f,-40.f,-40.f,-40.f},/*350*/
141 {-14.f,-20.f,-24.f,-26.f,-32.f,-34.f,-36.f,-38.f,-40.f,-40.f,-40.f},/*500*/
142 {-14.f,-20.f,-24.f,-26.f,-32.f,-34.f,-36.f,-38.f,-40.f,-40.f,-40.f},/*700*/
143 {-14.f,-20.f,-24.f,-26.f,-32.f,-34.f,-36.f,-38.f,-40.f,-40.f,-40.f},/*1000*/
144 {-14.f,-20.f,-24.f,-26.f,-32.f,-34.f,-36.f,-38.f,-40.f,-40.f,-40.f},/*1400*/
145 {-14.f,-20.f,-24.f,-26.f,-32.f,-34.f,-36.f,-38.f,-40.f,-40.f,-40.f},/*2000*/
146 {-14.f,-20.f,-24.f,-26.f,-32.f,-34.f,-36.f,-38.f,-40.f,-40.f,-40.f},/*2800*/
147 {-14.f,-20.f,-24.f,-26.f,-32.f,-34.f,-36.f,-38.f,-40.f,-40.f,-40.f},/*4000*/
148 {-14.f,-20.f,-24.f,-26.f,-32.f,-34.f,-36.f,-38.f,-40.f,-40.f,-40.f},/*5600*/
149 {-14.f,-20.f,-24.f,-26.f,-32.f,-34.f,-36.f,-38.f,-40.f,-40.f,-40.f},/*8000*/
150 {-14.f,-20.f,-24.f,-26.f,-32.f,-34.f,-36.f,-38.f,-40.f,-40.f,-40.f},/*11500*/
151 {-14.f,-20.f,-24.f,-26.f,-32.f,-34.f,-36.f,-38.f,-40.f,-40.f,-40.f},/*1600*/
154 static vorbis_info_psy _psy_set_D0={
155 ATH_Bark_dB_lineconservative,
161 -6.f, -45.f,&_vp_tonemask_consbass_D,
167 1,-30.f, /* suppress any noise curve over maxspec+n */
168 .6f, .6f, /* low/high window */
171 /*63 125 250 500 1k 2k 4k 8k 16k*/
172 {-30,-30,-30,-30,-30,-30,-20,-10, 0, 0, 0, 0, 0, 0, 0, 0, 1},
173 {.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.4f,.4f,.5f,.5f,.6f,.7f,.7f},
175 105.f, /* even decade + 5 is important; saves an rint() later in a
181 static vorbis_info_psy _psy_set_D={
182 ATH_Bark_dB_lineconservative,
188 -6.f,-45.f,&_vp_tonemask_consbass_D,
193 1, -30.f, /* suppress any noise curve over maxspec+n */
194 .4f,.4f, /* low/high window */
197 /*63 125 250 500 1k 2k 4k 8k 16k*/
198 { 0, 0, 0, 0, 0, 0, 0, -3,-10,-10,-12,-12, -6, -3, -2, -1, -0},
199 {.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.5f,.6f,.7f,.7f},
201 105.f, /* even decade + 5 is important; saves an rint() later in a
206 static vorbis_info_psy _psy_set_DT={
207 ATH_Bark_dB_lineconservative,
213 -6.f,-45.f,&_vp_tonemask_consbass_D,
218 1, -30.f, /* suppress any noise curve over maxspec+n */
219 .4f,.4f, /* low/high window */
222 /*63 125 250 500 1k 2k 4k 8k 16k*/
223 {-30,-30,-30,-30,-30,-30,-30,-20,-10,-12,-16,-16, -10, -6, -6, -6, -6},
224 {.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.4f,.4f,.4f,.4f,.4f,.5f,.5f,.6f},
226 105.f, /* even decade + 5 is important; saves an rint() later in a
231 /* with GNUisms, this could be short and readable. Oh well */
232 static vorbis_info_time0 _time_set0D={0};
233 /*static vorbis_info_floor0 _floor_set0B={9, 44100, 64, 10,130, 2, {0,1},
235 /*static vorbis_info_floor0 _floor_set1B={30, 44100, 256, 12,150, 2, {2,3},
238 static vorbis_info_floor1 _floor_set0D={6,
244 {{2},{-1,3,4,5},{-1,6,7,8}},
252 2,1,4, 11,8,14, 23,20,26,
253 41,35,48, 84,69,103},
260 static vorbis_info_floor1 _floor_set1D={10,
261 {0,1,2,2,2,2,2, 3,3,3},
279 6,3,10, 22,18,26, 41,36,47,
280 69,61,78, 112,99,126, 185,162,211,
281 329,282,387, 672,553,825
289 static vorbis_info_residue0 _residue_set0D={0,256,16,10,23,
290 {0,1,1,1,1,1,1,1,3,7},
321 static vorbis_info_residue0 _residue_set1D={0,2048, 32,10,24,
322 {0,1,1,1,1,1,1,1,3,7},
353 static vorbis_info_mapping0 _mapping_set0D={1, {0,0}, {0}, {0}, {0}, {0,0},
355 static vorbis_info_mapping0 _mapping_set1D={1, {0,0}, {0}, {1}, {1}, {1,2},
357 static vorbis_info_mode _mode_set0D={0,0,0,0};
358 static vorbis_info_mode _mode_set1D={1,0,0,1};
360 /* CD quality stereo, losslesschannel coupling */
361 codec_setup_info info_D={
363 /* smallblock, largeblock */
365 /* modes,maps,times,floors,residues,books,psys */
366 2, 2, 1, 2, 2, 37, 3,
368 {&_mode_set0D,&_mode_set1D},
370 {0,0},{&_mapping_set0D,&_mapping_set1D},
372 {0,0},{&_time_set0D},
374 {1,1},{&_floor_set0D,&_floor_set1D},
376 {2,2},{&_residue_set0D,&_residue_set1D},
380 &_huff_book_line0_class1,
381 &_huff_book_line0_class2, /* 1 */
383 &_huff_book_line0_0sub0, /* 2 */
384 &_huff_book_line0_1sub1, /* 3 */
385 &_huff_book_line0_1sub2,
386 &_huff_book_line0_1sub3, /* 5 */
387 &_huff_book_line0_2sub1,
388 &_huff_book_line0_2sub2, /* 7 */
389 &_huff_book_line0_2sub3,
391 &_huff_book_line1_class0,
392 &_huff_book_line1_class1, /* 10 */
393 &_huff_book_line1_class2,
394 &_huff_book_line1_class3, /* 12 */
396 &_huff_book_line1_0sub0,
397 &_huff_book_line1_0sub1, /* 14 */
398 &_huff_book_line1_1sub0,
399 &_huff_book_line1_1sub1,
400 &_huff_book_line1_2sub1,
401 &_huff_book_line1_2sub2, /* 18 */
402 &_huff_book_line1_2sub3,
403 &_huff_book_line1_3sub1,
404 &_huff_book_line1_3sub2,
405 &_huff_book_line1_3sub3, /* 22 */
407 &_huff_book_res0_128_128aux,
408 &_huff_book_res0_128_1024aux,
410 &_vq_book_res0_128_1024_1,
411 &_vq_book_res0_128_1024_2,
412 &_vq_book_res0_128_1024_3,
413 &_vq_book_res0_128_1024_4,
414 &_vq_book_res0_128_1024_5,
415 &_vq_book_res0_128_1024_6,
416 &_vq_book_res0_128_1024_7,
417 &_vq_book_res0_128_1024_8,
418 &_vq_book_res0_128_1024_8a,
419 &_vq_book_res0_128_1024_9,
420 &_vq_book_res0_128_1024_9a,
421 &_vq_book_res0_128_1024_9b,
425 {&_psy_set_D0,&_psy_set_DT,&_psy_set_D},