baf0162b4a49d769e69cc29f2185299f3d9618a8
[platform/upstream/libvorbis.git] / include / vorbis / mode_C.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_C.h,v 1.2 2000/08/15 14:01:02 xiphmont Exp $
16
17  ********************************************************************/
18
19 #ifndef _V_MODES_C_H_
20 #define _V_MODES_C_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_192.vqh"
30 #include "vorbis/book/resaux0_1024a_192.vqh"
31
32 #include "vorbis/book/res0_128a_192_1.vqh"
33 #include "vorbis/book/res0_128a_192_2.vqh"
34 #include "vorbis/book/res0_128a_192_3.vqh"
35 #include "vorbis/book/res0_128a_192_4.vqh"
36 #include "vorbis/book/res0_128a_192_5.vqh"
37 #include "vorbis/book/res0_1024a_192_1.vqh"
38 #include "vorbis/book/res0_1024a_192_2.vqh"
39 #include "vorbis/book/res0_1024a_192_3.vqh"
40 #include "vorbis/book/res0_1024a_192_4.vqh"
41 #include "vorbis/book/res0_1024a_192_5.vqh"
42
43 static vorbis_info_psy _psy_set_C={
44   1,/*athp*/
45   0,/*decayp*/
46   1,/*smoothp*/
47   0,.1,
48
49   -100.,
50   -140.,
51
52   /*     0  1  2   3   4   5   6   7   8   9  10  11  12  13  14  15   16   */
53   /* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz */
54   /* y: 0 10 20 30 40 50 60 70 80 90 100 dB */
55
56   1,/* tonemaskp */
57   /*  0   10   20   30   40   50   60   70   80   90   100 */
58   {{-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*63*/
59    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*88*/
60    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*125*/
61    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*175*/
62    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*250*/
63    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*350*/
64    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*500*/
65    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*700*/
66    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*1000*/
67    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*1400*/
68    {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*2000*/
69    {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*2800*/
70    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*4000*/
71    {-30.,-30.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*5600*/
72    {-30.,-30.,-35.,-35.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*8000*/
73    {-30.,-30.,-35.,-33.,-35.,-45.,-55.,-65.,-75.,-90.,-100.}, /*11500*/
74    {-30.,-28.,-30.,-32.,-35.,-45.,-55.,-65.,-75.,-90.,-100.}, /*16000*/
75   },
76
77   1,/* peakattp */
78   {{-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*63*/
79    {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*88*/
80    {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*125*/
81    { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
82    { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
83    { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
84    { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
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.,-16.,-17.}, /*8000*/
93    { -6., -7., -9., -9., -9., -9.,-10.,-11.,-12.,-13.,-14.}, /*11500*/
94    { -6., -6., -9., -9., -9., -9., -9., -9.,-10.,-11.,-12.}, /*16000*/
95   },
96
97   1,/*noisemaskp */
98   /*  0   10   20   30   40   50   60    70    80    90   100 */
99   {{-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*63*/
100    {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*88*/
101    {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*125*/
102    {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*175*/
103    {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*250*/
104    {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*350*/
105    {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*500*/
106    {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*700*/
107    {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*1000*/
108    {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*1400*/
109
110    {  0., -4., -4., -4., -6., -6., -6.,  -6.,  -6.,  -6.,  -6.}, /*2000*/
111    {  0., -3., -4., -4., -4., -5., -6.,  -6.,  -6.,  -6.,  -6.}, /*2800*/
112    {  0., -2., -2., -2., -2., -2., -2.,  -2.,  -4.,  -4.,  -4.}, /*4000*/
113    {  0., -0., -0., -0., -0., -2., -2.,  -2.,  -2.,  -2.,  -2.}, /*5600*/
114    {  0.,  0.,  0.,  0.,  0.,  0.,  0.,   0.,   0.,  -2.,  -4.}, /*8000*/
115    {  2.,  2.,  2.,  2.,  2.,  2.,  0.,   0.,   0.,   0.,   0.}, /*11500*/
116    {  2.,  2.,  2.,  2.,  2.,  4.,  4.,   4.,   4.,   4.,   4.}, /*16000*/
117   },
118  
119   100.,
120
121   -0., -.004   /* attack/decay control */
122 };
123
124 /* with GNUisms, this could be short and readable. Oh well */
125 static vorbis_info_time0 _time_set0C={0};
126 static vorbis_info_floor0 _floor_set0C={12, 44100,  64, 12,150, 1, {0} };
127 static vorbis_info_floor0 _floor_set1C={30, 44100, 256, 12,150, 1, {1} };
128 static vorbis_info_residue0 _residue_set0C={0,128, 32,6,2,
129                                             {0,1,1,1,1,1},
130                                             {4,5,6,7,8},
131                                             
132                                             {0,99999,9999,9999,9999},
133                                             {99,1.5,2.5,3.5,5},
134                                             {5,5,5,5,5},
135                                             {99,99,99,99,99}};
136
137 static vorbis_info_residue0 _residue_set1C={0,1024, 32,6,3,
138                                             {0,1,1,1,1,1},
139                                             {9,10,11,12,13},
140                                            
141                                             {0,99999,9999,9999,9999},
142                                             {99,1.5,2.5,3.5,5},
143                                             {5,5,5,5,5},
144                                             {99,99,99,99,99}};
145
146 static vorbis_info_mapping0 _mapping_set0C={1, {0,0}, {0}, {0}, {0}, {0}};
147 static vorbis_info_mapping0 _mapping_set1C={1, {0,0}, {0}, {1}, {1}, {0}};
148 static vorbis_info_mode _mode_set0C={0,0,0,0};
149 static vorbis_info_mode _mode_set1C={1,0,0,1};
150
151 /* CD quality stereo, no channel coupling */
152 vorbis_info info_C={
153   /* channels, sample rate, upperkbps, nominalkbps, lowerkbps */
154   0, 2, 44100, 0,0,0,
155   /* smallblock, largeblock */
156   {256, 2048}, 
157   /* modes,maps,times,floors,residues,books,psys */
158   2,          2,    1,     2,       2,   14,   1,
159   /* modes */
160   {&_mode_set0C,&_mode_set1C},
161   /* maps */
162   {0,0},{&_mapping_set0C,&_mapping_set1C},
163   /* times */
164   {0,0},{&_time_set0C},
165   /* floors */
166   {0,0},{&_floor_set0C,&_floor_set1C},
167   /* residue */
168   {0,0},{&_residue_set0C,&_residue_set1C},
169   /* books */
170   {&_vq_book_lsp12_0,      /* 0 */
171    &_vq_book_lsp30_0,      /* 1 */
172
173    &_huff_book_resaux0_128a_192,
174    &_huff_book_resaux0_1024a_192,
175
176    &_vq_book_res0_128a_192_1,
177    &_vq_book_res0_128a_192_2,
178    &_vq_book_res0_128a_192_3,
179    &_vq_book_res0_128a_192_4,
180    &_vq_book_res0_128a_192_5,
181    &_vq_book_res0_1024a_192_1,
182    &_vq_book_res0_1024a_192_2,
183    &_vq_book_res0_1024a_192_3,
184    &_vq_book_res0_1024a_192_4,
185    &_vq_book_res0_1024a_192_5,
186
187   },
188   /* psy */
189   {&_psy_set_C},
190   /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
191   256, 24, 6, -96.
192 };
193
194 #define PREDEF_INFO_MAX 0
195
196 #endif