more automation work
[platform/upstream/libvorbis.git] / include / vorbis / mode_B.h
1 /********************************************************************
2  *                                                                  *
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.                            *
7  *                                                                  *
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/                                             *
11  *                                                                  *
12  ********************************************************************
13
14  function: predefined encoding modes
15  last mod: $Id: mode_B.h,v 1.1 2000/08/15 11:53:18 xiphmont Exp $
16
17  ********************************************************************/
18
19 #ifndef _V_MODES_B_H_
20 #define _V_MODES_B_H_
21
22 #include <stdio.h>
23 #include "vorbis/codec.h"
24 #include "vorbis/backends.h"
25
26 #include "vorbis/book/lsp12_0.vqh"
27 #include "vorbis/book/lsp30_0.vqh"
28
29 #include "vorbis/book/resaux0_128a_160.vqh"
30 #include "vorbis/book/resaux0_1024a_160.vqh"
31
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"
46
47 static vorbis_info_psy _psy_set_B={
48   1,/*athp*/
49   1,/*decayp*/
50   1,/*smoothp*/
51   0,.1,
52
53   -100.,
54   -140.,
55
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 */
59
60   1,/* tonemaskp */
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*/
79   },
80
81   1,/* peakattp */
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*/
99   },
100
101   1,/*noisemaskp */
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
112    {  4.,  4.,  4.,  4.,  4.,  2.,  1.,   0.,  -1.,  -2.,  -3.}, /*1000*/
113    {  4.,  4.,  4.,  4.,  4.,  2.,  1.,   0.,   0.,  -2.,  -3.}, /*1400*/
114    {  4.,  4.,  4.,  4.,  2.,  2.,  1.,   0.,   0.,  -2.,  -3.}, /*2000*/
115    {  4.,  4.,  4.,  4.,  2.,  2.,  1.,   0.,   0.,  -2.,  -3.}, /*2800*/
116    {  4.,  4.,  4.,  4.,  4.,  4.,  2.,   0.,   0.,   0.,   0.}, /*4000*/
117    {  4.,  4.,  4.,  4.,  4.,  4.,  2.,   2.,   2.,   2.,   2.}, /*5600*/
118    {  6.,  6.,  6.,  6.,  4.,  4.,  4.,   4.,   4.,   2.,   2.}, /*8000*/
119    {  8.,  8.,  8.,  8.,  6.,  6.,  6.,   6.,   6.,   4.,   4.}, /*11500*/
120    {  8.,  8.,  8.,  8.,  8.,  8.,  8.,   6.,   6.,   6.,   4.}, /*16000*/
121   },
122  
123   110.,
124
125   -0., -.004   /* attack/decay control */
126 };
127
128 /* with GNUisms, this could be short and readable. Oh well */
129 static vorbis_info_time0 _time_set0B={0};
130 static vorbis_info_floor0 _floor_set0B={12, 44100,  64, 12,150, 1, {0} };
131 static vorbis_info_floor0 _floor_set1B={30, 44100, 256, 12,150, 1, {1} };
132 static vorbis_info_residue0 _residue_set0B={0,128, 32,6,2,
133                                             {0,1,1,1,1,1},
134                                             {4,5,6,7,8},
135                                             
136                                             {0,99999,9999,9999,9999},
137                                             {99,1.5,2.5,3.5,5},
138                                             {5,5,5,5,5},
139                                             {99,99,99,99,99}};
140
141 static vorbis_info_residue0 _residue_set1B={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},
144                                            
145                                             {0,9,9999,17,9999,
146                                              27,9999,9999,9999},
147                                             {99,1.5,1.5,2.5,2.5,3.5,3.5,7,13},
148                                             {5,5,5,5,5,5,5,5,5},
149                                             {99,99,99,99,99,99,99,99,99}};
150
151 static vorbis_info_mapping0 _mapping_set0B={1, {0,0}, {0}, {0}, {0}, {0}};
152 static vorbis_info_mapping0 _mapping_set1B={1, {0,0}, {0}, {1}, {1}, {0}};
153 static vorbis_info_mode _mode_set0B={0,0,0,0};
154 static vorbis_info_mode _mode_set1B={1,0,0,1};
155
156 /* CD quality stereo, no channel coupling */
157 vorbis_info info_B={
158   /* channels, sample rate, upperkbps, nominalkbps, lowerkbps */
159   0, 2, 44100, 0,0,0,
160   /* smallblock, largeblock */
161   {256, 2048}, 
162   /* modes,maps,times,floors,residues,books,psys */
163   2,          2,    1,     2,       2,   18,   1,
164   /* modes */
165   {&_mode_set0B,&_mode_set1B},
166   /* maps */
167   {0,0},{&_mapping_set0B,&_mapping_set1B},
168   /* times */
169   {0,0},{&_time_set0B},
170   /* floors */
171   {0,0},{&_floor_set0B,&_floor_set1B},
172   /* residue */
173   {0,0},{&_residue_set0B,&_residue_set1B},
174   /* books */
175   {&_vq_book_lsp12_0,      /* 0 */
176    &_vq_book_lsp30_0,      /* 1 */
177
178    &_huff_book_resaux0_128a_160,
179    &_huff_book_resaux0_1024a_160,
180
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,
195
196   },
197   /* psy */
198   {&_psy_set_B},
199   /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
200   256, 32, 6, -96.
201 };
202
203 #define PREDEF_INFO_MAX 0
204
205 #endif