1 /********************************************************************
3 * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
5 * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
6 * PLEASE READ THESE TERMS DISTRIBUTING. *
8 * THE OggSQUISH 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_C.h,v 1.1 2000/08/15 12:21:55 xiphmont Exp $
17 ********************************************************************/
23 #include "vorbis/codec.h"
24 #include "vorbis/backends.h"
26 #include "vorbis/book/lsp12_0.vqh"
27 #include "vorbis/book/lsp30_0.vqh"
29 #include "vorbis/book/resaux0_128a_160.vqh"
30 #include "vorbis/book/resaux0_1024a_160.vqh"
32 #include "vorbis/book/res0_128a_160_1.vqh"
33 #include "vorbis/book/res0_128a_160_2.vqh"
34 #include "vorbis/book/res0_128a_160_3.vqh"
35 #include "vorbis/book/res0_128a_160_4.vqh"
36 #include "vorbis/book/res0_128a_160_5.vqh"
37 #include "vorbis/book/res0_1024a_160_1.vqh"
38 #include "vorbis/book/res0_1024a_160_2.vqh"
39 #include "vorbis/book/res0_1024a_160_3.vqh"
40 #include "vorbis/book/res0_1024a_160_4.vqh"
41 #include "vorbis/book/res0_1024a_160_5.vqh"
42 #include "vorbis/book/res0_1024a_160_6.vqh"
43 #include "vorbis/book/res0_1024a_160_7.vqh"
44 #include "vorbis/book/res0_1024a_160_8.vqh"
45 #include "vorbis/book/res0_1024a_160_9.vqh"
47 static vorbis_info_psy _psy_set_C={
56 /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */
57 /* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz */
58 /* y: 0 10 20 30 40 50 60 70 80 90 100 dB */
61 /* 0 10 20 30 40 50 60 70 80 90 100 */
62 {{-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*63*/
63 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*88*/
64 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*125*/
65 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*175*/
66 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*250*/
67 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*350*/
68 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*500*/
69 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*700*/
70 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*1000*/
71 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*1400*/
72 {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*2000*/
73 {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*2800*/
74 {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*4000*/
75 {-30.,-30.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*5600*/
76 {-30.,-30.,-35.,-35.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*8000*/
77 {-30.,-30.,-35.,-33.,-35.,-45.,-55.,-65.,-75.,-90.,-100.}, /*11500*/
78 {-30.,-28.,-30.,-32.,-35.,-45.,-55.,-65.,-75.,-90.,-100.}, /*16000*/
82 {{-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*63*/
83 {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*88*/
84 {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*125*/
85 { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
86 { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
87 { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
88 { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
89 { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
90 { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
91 { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
92 { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
93 { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
94 { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
95 { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
96 { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-16.,-17.}, /*8000*/
97 { -6., -7., -9., -9., -9., -9.,-10.,-11.,-12.,-13.,-14.}, /*11500*/
98 { -6., -6., -9., -9., -9., -9., -9., -9.,-10.,-11.,-12.}, /*16000*/
102 /* 0 10 20 30 40 50 60 70 80 90 100 */
103 {{-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*63*/
104 {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*88*/
105 {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*125*/
106 {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*175*/
107 {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*250*/
108 {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*350*/
109 {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*500*/
110 {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*700*/
111 {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*1000*/
112 {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*1400*/
114 { -4., -4., -4., -4., -6., -6., -7., -8., -9., -10., -11.}, /*2000*/
115 { -3., -3., -4., -4., -4., -5., -7., -8., -8., -8., -8.}, /*2800*/
116 { -2., -2., -4., -4., -4., -4., -4., -4., -4., -4., -4.}, /*4000*/
117 { -1., -1., -2., -2., -2., -2., -2., -4., -4., -4., -4.}, /*5600*/
118 { 0., 0., 0., 0., -2., -2., -2., -2., -2., -4., -4.}, /*8000*/
119 { 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.}, /*11500*/
120 { 2., 2., 2., 2., 2., 4., 4., 4., 4., 4., 4.}, /*16000*/
125 -0., -.004 /* attack/decay control */
128 /* with GNUisms, this could be short and readable. Oh well */
129 static vorbis_info_time0 _time_set0C={0};
130 static vorbis_info_floor0 _floor_set0C={12, 44100, 64, 12,150, 1, {0} };
131 static vorbis_info_floor0 _floor_set1C={30, 44100, 256, 12,150, 1, {1} };
132 static vorbis_info_residue0 _residue_set0C={0,128, 32,6,2,
136 {0,99999,9999,9999,9999},
141 static vorbis_info_residue0 _residue_set1C={0,1024, 32,10,3,
142 {0,1,1,1,1,1,1,1,1,1},
143 {9,10,11,12,13,14,15,16,17},
147 {99,1.5,1.5,2.5,2.5,3.5,3.5,7,13},
149 {99,99,99,99,99,99,99,99,99}};
151 static vorbis_info_mapping0 _mapping_set0C={1, {0,0}, {0}, {0}, {0}, {0}};
152 static vorbis_info_mapping0 _mapping_set1C={1, {0,0}, {0}, {1}, {1}, {0}};
153 static vorbis_info_mode _mode_set0C={0,0,0,0};
154 static vorbis_info_mode _mode_set1C={1,0,0,1};
156 /* CD quality stereo, no channel coupling */
158 /* channels, sample rate, upperkbps, nominalkbps, lowerkbps */
160 /* smallblock, largeblock */
162 /* modes,maps,times,floors,residues,books,psys */
163 2, 2, 1, 2, 2, 18, 1,
165 {&_mode_set0C,&_mode_set1C},
167 {0,0},{&_mapping_set0C,&_mapping_set1C},
169 {0,0},{&_time_set0C},
171 {0,0},{&_floor_set0C,&_floor_set1C},
173 {0,0},{&_residue_set0C,&_residue_set1C},
175 {&_vq_book_lsp12_0, /* 0 */
176 &_vq_book_lsp30_0, /* 1 */
178 &_huff_book_resaux0_128a_160,
179 &_huff_book_resaux0_1024a_160,
181 &_vq_book_res0_128a_160_1,
182 &_vq_book_res0_128a_160_2,
183 &_vq_book_res0_128a_160_3,
184 &_vq_book_res0_128a_160_4,
185 &_vq_book_res0_128a_160_5,
186 &_vq_book_res0_1024a_160_1,
187 &_vq_book_res0_1024a_160_2,
188 &_vq_book_res0_1024a_160_3,
189 &_vq_book_res0_1024a_160_4,
190 &_vq_book_res0_1024a_160_5,
191 &_vq_book_res0_1024a_160_6,
192 &_vq_book_res0_1024a_160_7,
193 &_vq_book_res0_1024a_160_8,
194 &_vq_book_res0_1024a_160_9,
199 /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
203 #define PREDEF_INFO_MAX 0