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_Zc.h,v 1.2 2001/08/13 01:37:14 xiphmont Exp $
16 ********************************************************************/
18 #ifndef _V_MODES_Zc_H_
19 #define _V_MODES_Zc_H_
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_9.vqh"
63 #include "books/res0_128_1024_9a.vqh"
64 #include "books/res0_128_1024_9b.vqh"
67 static vorbis_info_psy_global _psy_set_ZcG={
69 8, /* lines per eighth octave */
71 /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
72 256, {26.f,26.f,26.f,30.f}, {-90.f,-90.f,-90.f,-90.f}, -90.f,
78 static struct vp_couple_pass _psy_passZc0[]={
81 {9999, 0,0, 7.5f,12, 7.5f,0}}
85 static vp_couple_pass _psy_passZc[]={
87 {{288, 0,0, 0,0, 0,0},
88 {9999, 0,0, 7.5f,12, 7.5f,0}}
92 static vp_attenblock _vp_tonemask_consbass_Zc={
93 {{-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*63*/
94 {-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*88*/
95 {-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*125*/
96 {-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*175*/
97 {-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*250*/
98 {-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*350*/
100 {-35.f,-35.f,-35.f,-45.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f}, /*500*/
101 {-35.f,-35.f,-35.f,-45.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f}, /*700*/
103 {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1000*/
104 {-35.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1400*/
106 {-30.f,-30.f,-30.f,-30.f,-30.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f}, /*2000*/
107 {-30.f,-30.f,-30.f,-30.f,-30.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f},
108 {-30.f,-30.f,-30.f,-30.f,-30.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f}, /*2000*/
109 {-30.f,-30.f,-30.f,-30.f,-30.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f},
110 {-30.f,-30.f,-30.f,-30.f,-30.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f}, /*2000*/
111 {-30.f,-30.f,-30.f,-30.f,-30.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f},
112 {-24.f,-24.f,-26.f,-30.f,-30.f,-35.f,-45.f,-55.f,-65.f,-75.f,-90.f}, /*16000*/
115 static vp_attenblock _vp_tonemask_Zc={
117 {{-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*63*/
118 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*88*/
119 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*125*/
122 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*175*/
123 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*250*/
124 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*350*/
125 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*500*/
126 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*700*/
127 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1000*/
128 {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1400*/
131 {-30.f,-30.f,-30.f,-30.f,-30.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f}, /*2000*/
132 {-30.f,-30.f,-30.f,-30.f,-30.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f},
133 {-30.f,-30.f,-30.f,-30.f,-30.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f}, /*2000*/
134 {-30.f,-30.f,-30.f,-30.f,-30.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f},
135 {-30.f,-30.f,-30.f,-30.f,-30.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f}, /*2000*/
136 {-30.f,-30.f,-30.f,-30.f,-30.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f},
137 {-24.f,-24.f,-26.f,-30.f,-30.f,-35.f,-45.f,-55.f,-65.f,-75.f,-90.f}, /*16000*/
141 static vp_attenblock _vp_peakatt_Zc={
142 {{-14.f,-16.f,-18.f,-19.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f},/*63*/
143 {-14.f,-16.f,-18.f,-19.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f},/*88*/
144 {-14.f,-16.f,-18.f,-19.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f},/*125*/
145 {-14.f,-16.f,-18.f,-19.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f},/*125*/
146 {-14.f,-16.f,-18.f,-19.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f},/*125*/
147 {-14.f,-16.f,-18.f,-19.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f},/*125*/
148 {-10.f,-10.f,-10.f,-10.f,-16.f,-16.f,-18.f,-20.f,-22.f,-24.f,-24.f},/*500*/
149 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-24.f,-24.f},/*700*/
150 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-24.f,-24.f},/*1000*/
151 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-24.f,-24.f},/*1400*/
152 {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-24.f,-24.f},/*2000*/
153 {-10.f,-10.f,-10.f,-12.f,-16.f,-16.f,-16.f,-20.f,-22.f,-24.f,-24.f},/*2400*/
154 {-10.f,-10.f,-10.f,-12.f,-16.f,-16.f,-16.f,-20.f,-22.f,-24.f,-24.f},/*4000*/
155 {-10.f,-10.f,-10.f,-12.f,-12.f,-14.f,-16.f,-18.f,-22.f,-24.f,-24.f},/*5600*/
156 {-10.f,-10.f,-10.f,-10.f,-10.f,-14.f,-16.f,-18.f,-22.f,-24.f,-24.f},/*8000*/
157 {-10.f,-10.f,-10.f,-10.f,-10.f,-14.f,-16.f,-18.f,-22.f,-24.f,-24.f},/*11500*/
158 {-10.f,-10.f,-10.f,-10.f,-10.f,-12.f,-16.f,-18.f,-22.f,-24.f,-24.f},/*16000*/
161 static vorbis_info_psy _psy_set_Zc0={
162 ATH_Bark_dB_lineaggressive,
168 3.f, -24.f,&_vp_tonemask_consbass_Zc,
174 1,-24.f, /* suppress any noise curve over maxspec+n */
175 1.f, 1.f, /* low/high window */
178 /*63 125 250 500 1k 2k 4k 8k 16k*/
179 {-20,-20,-20,-20,-20,-20,-10, -5, 3, 3, 4, 4, 4, 4, 4, 4, 8},
180 {1.f,1.f,1.f,1.f,1.f,1.f,.8f,.7f,.7f,.7f,.7f,.7f,.8f,.88f,.89f,.9f,.9f},
182 95.f, /* even decade + 5 is important; saves an rint() later in a
188 static vorbis_info_psy _psy_set_ZcT={
189 ATH_Bark_dB_lineaggressive,
195 3.f,-20.f,&_vp_tonemask_consbass_Zc,
200 1, -24.f, /* suppress any noise curve over maxspec+n */
201 .5f,.5f, /* low/high window */
204 /*63 125 250 500 1k 2k 4k 8k 16k*/
205 {-20,-20,-20,-20,-20,-20,-20, -6, 3, 3, 4, 5, 5, 5, 5, 6, 10},
206 {1.f,1.f,1.f,1.f,1.f,1.f,.8f,.7f,.7f,.7f,.7f,.7f,.8f,.88f,.89f,.9f,.9f},
208 95.f, /* even decade + 5 is important; saves an rint() later in a
213 static vorbis_info_psy _psy_set_Zc={
214 ATH_Bark_dB_lineaggressive,
220 -3.f,-20.f,&_vp_tonemask_Zc,
225 1, -24.f, /* suppress any noise curve over maxspec+n */
226 .5f,.5f, /* low/high window */
229 /*63 125 250 500 1k 2k 4k 8k 16k*/
230 {-20,-20,-20,-20,-20,-20,-10, 0, 3, 3, 4, 5, 5, 5, 5, 6, 10},
231 {1.f,1.f,1.f,1.f,1.f,1.f,.8f,.7f,.7f,.7f,.7f,.8f,.85f,.88f,.89f,.9f,.9f},
233 95.f, /* even decade + 5 is important; saves an rint() later in a
238 /* with GNUisms, this could be short and readable. Oh well */
239 static vorbis_info_time0 _time_set0Zc={0};
240 /*static vorbis_info_floor0 _floor_set0Zc={9, 44100, 64, 10,130, 2, {0,1},
242 /*static vorbis_info_floor0 _floor_set1Zc={30, 44100, 256, 12,150, 2, {2,3},
245 static vorbis_info_floor1 _floor_set0Zc={3,
251 {{2},{-1,3,4,5},{-1,6,7,8}},
267 static vorbis_info_floor1 _floor_set1Zc={10,
268 {0,1,2,2,2,2,2, 3,3,3},
286 6,3,10, 22,18,26, 41,36,47,
287 69,61,78, 112,99,126, 185,162,211,
288 329,282,387, 672,553,825
296 static vorbis_info_residue0 _residue_set0Zc={0,180,12,10,23,
297 {0,1,1,1,1,1,1,1,1,7},
336 static vorbis_info_residue0 _residue_set1Zc={0,1408, 32,10,24,
337 {0,1,1,1,1,1,1,1,1,7},
376 static vorbis_info_mapping0 _mapping_set0Zc={1, {0,0}, {0}, {0}, {0}, {0,0},
378 static vorbis_info_mapping0 _mapping_set1Zc={1, {0,0}, {0}, {1}, {1}, {1,2},
380 static vorbis_info_mode _mode_set0Zc={0,0,0,0};
381 static vorbis_info_mode _mode_set1Zc={1,0,0,1};
383 /* CD quality stereo, no channel coupling */
384 codec_setup_info info_Zc={
386 /* smallblock, largeblock */
388 /* modes,maps,times,floors,residues,books,psys */
389 2, 2, 1, 2, 2, 36, 3,
391 {&_mode_set0Zc,&_mode_set1Zc},
393 {0,0},{&_mapping_set0Zc,&_mapping_set1Zc},
395 {0,0},{&_time_set0Zc},
397 {1,1},{&_floor_set0Zc,&_floor_set1Zc},
399 {2,2},{&_residue_set0Zc,&_residue_set1Zc},
403 &_huff_book_line0_class1,
404 &_huff_book_line0_class2, /* 1 */
406 &_huff_book_line0_0sub0, /* 2 */
407 &_huff_book_line0_1sub1, /* 3 */
408 &_huff_book_line0_1sub2,
409 &_huff_book_line0_1sub3, /* 5 */
410 &_huff_book_line0_2sub1,
411 &_huff_book_line0_2sub2, /* 7 */
412 &_huff_book_line0_2sub3,
414 &_huff_book_line1_class0,
415 &_huff_book_line1_class1, /* 10 */
416 &_huff_book_line1_class2,
417 &_huff_book_line1_class3, /* 12 */
419 &_huff_book_line1_0sub0,
420 &_huff_book_line1_0sub1, /* 14 */
421 &_huff_book_line1_1sub0,
422 &_huff_book_line1_1sub1,
423 &_huff_book_line1_2sub1,
424 &_huff_book_line1_2sub2, /* 18 */
425 &_huff_book_line1_2sub3,
426 &_huff_book_line1_3sub1,
427 &_huff_book_line1_3sub2,
428 &_huff_book_line1_3sub3, /* 22 */
430 &_huff_book_res0_128_128aux,
431 &_huff_book_res0_128_1024aux,
433 &_vq_book_res0_128_1024_1,
434 &_vq_book_res0_128_1024_2,
435 &_vq_book_res0_128_1024_3,
436 &_vq_book_res0_128_1024_4,
437 &_vq_book_res0_128_1024_5,
438 &_vq_book_res0_128_1024_6,
439 &_vq_book_res0_128_1024_7,
440 &_vq_book_res0_128_1024_8,
441 &_vq_book_res0_128_1024_9,
442 &_vq_book_res0_128_1024_9a,
443 &_vq_book_res0_128_1024_9b,
447 {&_psy_set_Zc0,&_psy_set_ZcT,&_psy_set_Zc},