summaryrefslogtreecommitdiff
path: root/include/vorbis/modes.h
blob: 5c1262e5ecba2f58daf44fa7494faa374273e46c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
/********************************************************************
 *                                                                  *
 * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE.  *
 * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
 * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE.    *
 * PLEASE READ THESE TERMS DISTRIBUTING.                            *
 *                                                                  *
 * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-2000             *
 * by Monty <monty@xiph.org> and The XIPHOPHORUS Company            *
 * http://www.xiph.org/                                             *
 *                                                                  *
 ********************************************************************

 function: predefined encoding modes
 last mod: $Id: modes.h,v 1.16.2.8 2000/08/09 20:22:04 xiphmont Exp $

 ********************************************************************/

#ifndef _V_MODES_H_
#define _V_MODES_H_

#include <stdio.h>
#include "vorbis/codec.h"
#include "vorbis/backends.h"

#include "vorbis/book/lsp12_0.vqh"
#include "vorbis/book/lsp30_0.vqh"
#include "vorbis/book/resaux0_short.vqh"
#include "vorbis/book/resaux0_long.vqh"
#include "vorbis/book/resaux0b_long.vqh"

#include "vorbis/book/res0b_1.vqh"
#include "vorbis/book/res0b_2.vqh"
#include "vorbis/book/res0b_3.vqh"
#include "vorbis/book/res0b_4.vqh"
#include "vorbis/book/res0b_5.vqh"
#include "vorbis/book/res0b_6.vqh"
#include "vorbis/book/res0b_7.vqh"
#include "vorbis/book/res0b_8.vqh"
#include "vorbis/book/res0b_9.vqh"
#include "vorbis/book/res0b_10.vqh"
#include "vorbis/book/res0b_11.vqh"
#include "vorbis/book/res0b_12.vqh"
#include "vorbis/book/res0b_13.vqh"

#include "vorbis/book/res0a_1.vqh"
#include "vorbis/book/res0a_2.vqh"
#include "vorbis/book/res0a_3.vqh"
#include "vorbis/book/res0a_4.vqh"
#include "vorbis/book/res0a_5.vqh"
#include "vorbis/book/res0a_6.vqh"
#include "vorbis/book/res0a_7.vqh"
#include "vorbis/book/res0a_8.vqh"
#include "vorbis/book/res0a_9.vqh"
#include "vorbis/book/res0a_10.vqh"
#include "vorbis/book/res0a_11.vqh"
#include "vorbis/book/res0a_12.vqh"
#include "vorbis/book/res0a_13.vqh"

/* A farily high quality setting mix */

static vorbis_info_psy _psy_set0={
  1,/*athp*/
  1,/*decayp*/
  1,/*smoothp*/
  0,.1,

  -100.,
  -140.,

  /*     0  1  2   3   4   5   6   7   8   9  10  11  12  13  14  15   16   */
  /* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz */
  /* y: 0 10 20 30 40 50 60 70 80 90 100 dB */

  1,/* tonemaskp */
  /*  0   10   20   30   40   50   60   70   80   90   100 */
  {{-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*63*/
   {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*88*/
   {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*125*/
   {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*175*/
   {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*250*/
   {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*350*/
   {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*500*/
   {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*700*/
   {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*1000*/
   {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*1400*/
   {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*2000*/
   {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*2800*/
   {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*4000*/
   {-30.,-30.,-35.,-37.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*5600*/
   {-20.,-25.,-30.,-35.,-35.,-45.,-55.,-65.,-75.,-90.,-100.}, /*8000*/
   {-20.,-25.,-30.,-33.,-35.,-45.,-55.,-65.,-75.,-83., -90.}, /*11500*/
   {-20.,-24.,-26.,-32.,-35.,-45.,-55.,-65.,-75.,-83., -90.}, /*16000*/
  },

  1,/* peakattp */
  /*  0   10   20   30   40   50   60   70   80   90   100 */
  {{-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*63*/
   {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*88*/
   {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*125*/
   { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
   { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
   { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
   { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
   { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
   { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
   { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
   { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
   { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
   { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
   { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-18.,-20.}, /*8000*/
   { -7., -8., -9.,-10.,-10.,-11.,-12.,-13.,-15.,-16.,-17.}, /*8000*/
   { -6., -7., -9., -9., -9., -9.,-10.,-11.,-12.,-13.,-14.}, /*11500*/
   { -6., -6., -9., -9., -9., -9., -9., -9.,-10.,-11.,-12.}, /*16000*/
  },

  0,/*noisemaskp */
  /*  0   10   20   30   40   50   60    70    80    90   100 */
  {{-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*63*/
   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*88*/
   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*125*/
   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*175*/
   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*250*/
   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*350*/
   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-199.,-199.,-199.,-199.}, /*500*/
   { 10., 10., 10.,  6.,  6.,  5.,  4.,   3.,   2.,   1.,   0.}, /*700*/

   { 10., 10., 10., 10., 10.,  8.,  7.,   6.,   5.,   4.,   3.}, /*1000*/
   { 10., 10., 10., 10., 10.,  8.,  7.,   6.,   5.,   4.,   3.}, /*1400*/
   { 10., 10., 10., 10.,  8.,  8.,  7.,   6.,   5.,   4.,   3.}, /*2000*/
   { 10., 10., 10., 10.,  8.,  8.,  7.,   6.,   5.,   4.,   3.}, /*2800*/
   { 10., 10., 10., 10., 10., 10., 10.,  10.,  10.,  10.,  10.}, /*4000*/
   { 10., 10., 10., 10., 10., 10., 10.,  10.,  10.,  10.,  10.}, /*5600*/
   { 10., 10., 10., 10., 10., 10., 10.,  10.,  10.,  10.,  10.}, /*8000*/
   { 10., 10., 10., 10., 10., 10., 10.,  10.,  10.,  10.,  10.}, /*11500*/
   { 10., 10., 10., 10., 10., 10., 10.,  10.,  10.,  10.,  10.}, /*16000*/

  },

  110.,

  0., -.005   /* attack/decay control */
};



/* with GNUisms, this could be short and readable. Oh well */
static vorbis_info_time0 _time_set0={0};
static vorbis_info_floor0 _floor_set0={12, 44100,  64, 12,150, 1, {0} };
static vorbis_info_floor0 _floor_set1={30, 44100, 256, 12,150, 1, {1} };
static vorbis_info_residue0 _residue_set0={0,128, 64,14,2,
					   {0,1,1,1,1,1,1,1,1,1,1,1,1,1,
					    0,1,1,1,1,1,1,1,1,1,1,1,1,1},
					   {4,5,6,7,8,9,10,11,12,13,14,15,16},

					   {0,16,9999,30,9999,41,9999,47,9999,60,9999,128,9999},
					   {1.5,1.5,1.5,2.5,2.5,3.5,3.5,5,5,9,9,18,18},
					   {6,6,6,6,6,6,6,6,6,6,6,6,6},
					   {99,99,99,99,99,99,99,
					    99,99,99,99,99,99,99}};

static vorbis_info_residue0 _residue_set1={0,1024, 64,14,3,
					   {0,1,1,1,1,1,1,1,1,1,1,1,1,1,
					    0,1,1,1,1,1,1,1,1,1,1,1,1,1},
					   {4,5,6,7,8,9,10,11,12,13,14,15,16,
					    17,18,19,20,21,22,23,24,25,26,27,28,29},
					   
					   {0, 16,9999, 30,9999, 41,9999,
					    47,9999,60,9999,128,9999,9999,
					    0, 16,9999, 30,9999, 41,9999,
					    47,9999,60,9999,128,9999},

					   {1.5, 1.5,1.5, 2.5,2.5, 3.5,3.5,
					    5,5, 9,9, 18,18, 9999,
					   1.5, 1.5,1.5, 2.5,2.5, 3.5,3.5,
					    5,5, 9,9, 18,18},

					   {6,6,6,6,6,6,6,6,6,6,6,6,6,6,
					   6,6,6,6,6,6,6,6,6,6,6,6,6},/*6==64*/

					   {
					    99,99,99,99,99,99,99,
					    99,99,99,99,99,99}};

static vorbis_info_mapping0 _mapping_set0={1, {0,0}, {0}, {0}, {0}, {0}};
static vorbis_info_mapping0 _mapping_set1={1, {0,0}, {0}, {1}, {1}, {0}};
static vorbis_info_mode _mode_set0={0,0,0,0};
static vorbis_info_mode _mode_set1={1,0,0,1};

/* CD quality stereo, no channel coupling */
vorbis_info info_A={
  /* channels, sample rate, upperkbps, nominalkbps, lowerkbps */
  0, 2, 44100, 0,0,0,
  /* smallblock, largeblock */
  {256, 2048}, 
  /* modes,maps,times,floors,residues,books,psys */
  2,          2,    1,     2,       2,   30,   1,
  /* modes */
  {&_mode_set0,&_mode_set1},
  /* maps */
  {0,0},{&_mapping_set0,&_mapping_set1},
  /* times */
  {0,0},{&_time_set0},
  /* floors */
  {0,0},{&_floor_set0,&_floor_set1},
  /* residue */
  {0,0},{&_residue_set0,&_residue_set1},
  /* books */
  {&_vq_book_lsp12_0,      /* 0 */
   &_vq_book_lsp30_0,      /* 1 */

   &_huff_book_resaux0_short,
   &_huff_book_resaux0b_long,

   &_vq_book_res0a_1,
   &_vq_book_res0a_2,
   &_vq_book_res0a_3,
   &_vq_book_res0a_4,
   &_vq_book_res0a_5,
   &_vq_book_res0a_6,
   &_vq_book_res0a_7,
   &_vq_book_res0a_8,
   &_vq_book_res0a_9,
   &_vq_book_res0a_10,
   &_vq_book_res0a_11,
   &_vq_book_res0a_12,
   &_vq_book_res0a_13,
   &_vq_book_res0b_1,
   &_vq_book_res0b_2,
   &_vq_book_res0b_3,
   &_vq_book_res0b_4,
   &_vq_book_res0b_5,
   &_vq_book_res0b_6,
   &_vq_book_res0b_7,
   &_vq_book_res0b_8,
   &_vq_book_res0b_9,
   &_vq_book_res0b_10,
   &_vq_book_res0b_11,
   &_vq_book_res0b_12,
   &_vq_book_res0b_13,
  },
  /* psy */
  {&_psy_set0},
  /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
  256, 32, 6, -96.
};

#define PREDEF_INFO_MAX 0

#endif