c04e94df73c9686ef77f2473ad3fe31ea84581fc
[platform/upstream/libvorbis.git] / include / vorbis / mode_D.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_D.h,v 1.5 2000/10/12 03:12:41 xiphmont Exp $
16
17  ********************************************************************/
18
19 /* this is really a freeform VBR mode.  It roughly centers on 256 kbps stereo */
20
21 #ifndef _V_MODES_D_H_
22 #define _V_MODES_D_H_
23
24 #include <stdio.h>
25 #include "vorbis/codec.h"
26 #include "vorbis/backends.h"
27
28 #include "vorbis/book/lsp12_0.vqh"
29 #include "vorbis/book/lsp30_0.vqh"
30
31 #include "vorbis/book/resaux0_128a_256.vqh"
32 #include "vorbis/book/resaux0_1024a_256.vqh"
33
34 #include "vorbis/book/res0_128a_256_1.vqh"
35 #include "vorbis/book/res0_128a_256_2.vqh"
36 #include "vorbis/book/res0_128a_256_3.vqh"
37 #include "vorbis/book/res0_128a_256_4.vqh"
38 #include "vorbis/book/res0_128a_256_5.vqh"
39 #include "vorbis/book/res0_1024a_256_1.vqh"
40 #include "vorbis/book/res0_1024a_256_2.vqh"
41 #include "vorbis/book/res0_1024a_256_3.vqh"
42 #include "vorbis/book/res0_1024a_256_4.vqh"
43 #include "vorbis/book/res0_1024a_256_5.vqh"
44
45 static vorbis_info_psy _psy_set_256 ={
46   1,/*athp*/
47   0,/*decayp*/
48   1,/*smoothp*/
49   0,.1,
50
51   -100.,
52   -140.,
53
54   /*     0  1  2   3   4   5   6   7   8   9  10  11  12  13  14  15   16   */
55   /* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz */
56   /* y: 0 10 20 30 40 50 60 70 80 90 100 dB */
57
58   1,/* tonemaskp */
59   /*  0   10   20   30   40   50   60   70   80   90   100 */
60   {{-40.,-40.,-40.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*63*/
61    {-40.,-40.,-40.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*125*/
62    {-40.,-40.,-40.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*175*/
63    {-40.,-40.,-40.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*250*/
64    {-40.,-40.,-40.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*350*/
65    {-40.,-40.,-40.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*500*/
66    {-40.,-40.,-40.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*700*/
67    {-40.,-40.,-40.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*1000*/
68    {-40.,-40.,-40.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*1400*/
69    {-40.,-40.,-40.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*2000*/
70    {-40.,-40.,-40.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*2800*/
71    {-40.,-40.,-40.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*4000*/
72    {-40.,-40.,-40.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*5600*/
73    {-40.,-40.,-40.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*8000*/
74    {-40.,-40.,-40.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*11500*/
75    {-40.,-40.,-40.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*16000*/
76   },
77
78   1,/* peakattp */
79   {{-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*63*/
80    {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*88*/
81    {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*125*/
82    {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*175*/
83    {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*250*/
84    {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*350*/
85    {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*500*/
86    {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*700*/
87    {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*1000*/
88    {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*1400*/
89    {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*2000*/
90    {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*2800*/
91    {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*4000*/
92    {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*5600*/
93    {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*8000*/
94    {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*11500*/
95    {-14.,-16.,-18.,-19.,-20.,-21.,-22.,-22.,-22.,-22.,-22.}, /*16000*/
96   },
97
98   0,/*noisemaskp */
99   /*  0   10   20   30   40   50   60    70    80    90   100 */
100   {{0}},
101  
102   110.,
103
104   -0., -.004   /* attack/decay control */
105 };
106
107 /* with GNUisms, this could be short and readable. Oh well */
108 static vorbis_info_time0 _time_set0_256={0};
109 static vorbis_info_floor0 _floor_set0_256={12, 44100,  64, 12,150, 1, {0} };
110 static vorbis_info_floor0 _floor_set1_256={30, 44100, 256, 12,150, 1, {1} };
111 static vorbis_info_residue0 _residue_set0_256={0,128, 32,6,2,
112                                            {0,1,1,1,1,1},
113                                             {4,5,6,7,8},
114
115                                            {0,9999,9999,9999,9999},
116                                            {99,2.5,7,13.5,27.5},
117                                            {5,5,5,5,5},
118                                            {99,99,99,99,99}};
119
120 static vorbis_info_residue0 _residue_set1_256={0,1024, 32,6,3,
121                                            {0,1,1,1,1,1},
122                                             {9,10,11,12,13},
123                                            
124                                            {0,9999,9999,9999,9999},
125                                            {99,2.5,7,13.5,27.5},
126                                            {5,5,5,5,5},
127                                            {99,99,99,99,99}};
128
129 static vorbis_info_mapping0 _mapping_set0_256={1, {0,0}, {0}, {0}, {0}, {0}};
130 static vorbis_info_mapping0 _mapping_set1_256={1, {0,0}, {0}, {1}, {1}, {0}};
131 static vorbis_info_mode _mode_set0_256={0,0,0,0};
132 static vorbis_info_mode _mode_set1_256={1,0,0,1};
133
134 /* CD quality stereo, no channel coupling */
135 vorbis_info info_D={
136   /* channels, sample rate, upperkbps, nominalkbps, lowerkbps */
137   0, 2, 44100, 0,0,0,
138   /* smallblock, largeblock */
139   {256, 2048}, 
140   /* modes,maps,times,floors,residues,books,psys */
141   2,          2,    1,     2,       2,   14,   1,
142   /* modes */
143   {&_mode_set0_256,&_mode_set1_256},
144   /* maps */
145   {0,0},{&_mapping_set0_256,&_mapping_set1_256},
146   /* times */
147   {0,0},{&_time_set0_256},
148   /* floors */
149   {0,0},{&_floor_set0_256,&_floor_set1_256},
150   /* residue */
151   {0,0},{&_residue_set0_256,&_residue_set1_256},
152   /* books */
153   {&_vq_book_lsp12_0,      /* 0 */
154    &_vq_book_lsp30_0,      /* 1 */
155
156    &_huff_book_resaux0_128a_256,
157    &_huff_book_resaux0_1024a_256,
158
159    &_vq_book_res0_128a_256_1,
160    &_vq_book_res0_128a_256_2,
161    &_vq_book_res0_128a_256_3,
162    &_vq_book_res0_128a_256_4,
163    &_vq_book_res0_128a_256_5,
164    &_vq_book_res0_1024a_256_1,
165    &_vq_book_res0_1024a_256_2,
166    &_vq_book_res0_1024a_256_3,
167    &_vq_book_res0_1024a_256_4,
168    &_vq_book_res0_1024a_256_5,
169
170   },
171   /* psy */
172   {&_psy_set_256},
173   /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
174   256, 24, 6, -96.
175 };
176
177 #define PREDEF_INFO_MAX 0
178
179 #endif