dc6138f9a7dea8d6249b41c11db45036425a8cd6
[platform/upstream/libvorbis.git] / include / vorbis / modes.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: modes.h,v 1.3 2000/01/28 14:31:24 xiphmont Exp $
16
17  ********************************************************************/
18
19 #ifndef _V_MODES_H_
20 #define _V_MODES_H_
21
22 #include <stdio.h>
23 #include "vorbis/codec.h"
24 #include "vorbis/backends.h"
25 #include "vorbis/book/lsp20_0.h"
26 #include "vorbis/book/lsp32_0.h"
27
28 /*
29    0      1      2      3      4     5      6     7     8     9 
30    0,   100,  200,   300,   400,   510,   630,  770,  920, 1080,
31
32    10    11    12     13     14     15     16    17    18    19
33  1270, 1480, 1720,  2000,  2320,  2700,  3150, 3700, 4400, 5300,
34
35    20    21    22     23     24     25     26 Bark
36  6400, 7700, 9500, 12000, 15500, 20500, 27000 Hz    */
37
38 /* a good set of rolloffs for nigh-transparent masking */
39 static vorbis_info_psy _psy_set0={
40   { -10, -10, -10, -10, -10, -10, -10, -10, -10, -10,
41     -12, -14, -16, -16, -16, -16, -18, -18, -16, -16,
42     -12, -10, -8, -6, -6, -6, -4}, 24,10
43 };
44
45 /* with GNUisms, this could be short and readable. Oh well */
46 static static_codebook *_book_vec0[2]={&_vq_book_lsp20_0,&_vq_book_lsp32_0};
47 static vorbis_info_time0 _time_set0={0};
48 static vorbis_info_floor0 _floor_set0={20, 44100,  64, 1, {0} };
49 static vorbis_info_floor0 _floor_set1={32, 44100, 256, 1, {1} };
50 static vorbis_info_residue0 _residue_set0={0,0};
51 static vorbis_info_mapping0 _mapping_set0={1, {0,0}, {0}, {0}, {0}, {0}};
52 static vorbis_info_mapping0 _mapping_set1={1, {0,0}, {0}, {1}, {0}, {0}};
53 static vorbis_info mode _mode_set0={0,0,0,0};
54 static vorbis_info mode _mode_set1={1,0,0,1};
55
56 static vorbis_info_time *_time_A[1]={&_time_set0};
57 static vorbis_info_floor *_floor_A[2]={&_floor_set0,&_floor_set1};
58 static vorbis_info_residue *_res_A[1]={&_residue_set0};
59 static vorbis_info_psy *_psy_A[1]={&_psy_set0};
60 static vorbis_info_mode *_mode_A[2]=
61
62
63 /* CD quality stereo, no channel coupling */
64 vorbis_info info_A={
65   {
66     /* channels, sample rate, upperkbps, nominalkbps, lowerkbps */
67     2, 44100, 0,0,0,
68     /* smallblock, largeblock */
69     {256, 2048}, 
70     /* modes,maps,times,floors,residues,books,psys */
71     2,          2,    1,     2,       2,    2,   1,
72     /* modes */
73     {&_mode_set0,&mode_set1},
74     /* maps */
75     {0,0},{&_mapping_set0,&_mapping_set1},
76     /* times */
77     {0,0},{&_time_set0},
78     /* floors */
79     {0,0},{&_floor_set0,&_floor_set1},
80     /* residue */
81     {0,0},{&_residue_set0},
82     /* books */
83     {&_vq_book_lsp20_0,&_vq_book_lsp32_0},
84     /* psy */
85     {&_psy_set0},
86     /* thresh sample period, preecho clamp trigger threshhold, range */
87     64, 10, 2 
88   }
89 };
90
91 #define PREDEF_INFO_MAX 0
92
93 #endif