4b311378aba40978452ca05247cb5cce1abac53a
[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.8 2000/02/23 09:24:01 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
26 #include "vorbis/book/lsp20_0.vqh"
27 #include "vorbis/book/lsp32_0.vqh"
28
29 #include "vorbis/book/resshort8aux.vqh"
30 #include "vorbis/book/reslong8aux.vqh"
31
32 #include "vorbis/book/resX_1.vqh"
33
34 /*#include "vorbis/book/res128_0a.vqh"
35 #include "vorbis/book/res128_0b.vqh"
36 #include "vorbis/book/res128_0c7x4.vqh"
37 #include "vorbis/book/res1024_1a.vqh"
38 #include "vorbis/book/res1024_0b.vqh"
39 #include "vorbis/book/res1024_0c8x4.vqh"*/
40
41 /*
42    0      1      2      3      4     5      6     7     8     9 
43    0,   100,  200,   300,   400,   510,   630,  770,  920, 1080,
44
45    10    11    12     13     14     15     16    17    18    19
46  1270, 1480, 1720,  2000,  2320,  2700,  3150, 3700, 4400, 5300,
47
48    20    21    22     23     24     25     26 Bark
49  6400, 7700, 9500, 12000, 15500, 20500, 27000 Hz    */
50
51 /* a good set of rolloffs for nigh-transparent masking */
52 static vorbis_info_psy _psy_set0={
53   { -20, -20, -14, -14, -14, -14, -14, -14, -14, -14,
54     -14, -14, -16, -16, -16, -16, -18, -18, -16, -16,
55     -12, -10, -6, -3, -2, -1, -0}, 16,8
56 };
57
58 /* with GNUisms, this could be short and readable. Oh well */
59 static vorbis_info_time0 _time_set0={0};
60 static vorbis_info_floor0 _floor_set0={20, 44100,  64, 12,140, 1, {0} };
61 static vorbis_info_floor0 _floor_set1={32, 44100, 256, 12,140, 1, {1} };
62 static vorbis_info_residue0 _residue_set0={0, 128, 8,4,2,{0,1,1,1},{4,4,4}};
63 static vorbis_info_residue0 _residue_set1={0,1024, 8,4,3,{0,1,1,1},{4,4,4}};
64 static vorbis_info_mapping0 _mapping_set0={1, {0,0}, {0}, {0}, {0}, {0}};
65 static vorbis_info_mapping0 _mapping_set1={1, {0,0}, {0}, {1}, {1}, {0}};
66 static vorbis_info_mode _mode_set0={0,0,0,0};
67 static vorbis_info_mode _mode_set1={1,0,0,1};
68
69 /* CD quality stereo, no channel coupling */
70 vorbis_info info_A={
71   /* channels, sample rate, upperkbps, nominalkbps, lowerkbps */
72   0, 2, 44100, 0,0,0,
73   /* smallblock, largeblock */
74   {256, 2048}, 
75   /* modes,maps,times,floors,residues,books,psys */
76   2,          2,    1,     2,       2,   5,   1,
77   /* modes */
78   {&_mode_set0,&_mode_set1},
79   /* maps */
80   {0,0},{&_mapping_set0,&_mapping_set1},
81   /* times */
82   {0,0},{&_time_set0},
83   /* floors */
84   {0,0},{&_floor_set0,&_floor_set1},
85   /* residue */
86   {0,0},{&_residue_set0,&_residue_set1},
87   /* books */
88   {&_vq_book_lsp20_0,      /* 0 */
89    &_vq_book_lsp32_0,      /* 1 */
90
91    &_huff_book_resshort8aux,/* 2 */
92    &_huff_book_reslong8aux, /* 3 */
93
94 #if 0
95    &_vq_book_res128_0a,    /* 4 */
96    &_vq_book_res128_0b,    /* 5 */
97    &_vq_book_res128_0c7x4, /* 6 */
98    &_vq_book_res1024_1a,   /* 7 */
99    &_vq_book_res1024_0b,   /* 8 */
100    &_vq_book_res1024_0c8x4,/* 9 */
101 #endif
102
103    &_vq_book_resX_1,
104
105   },
106   /* psy */
107   {&_psy_set0},
108   /* thresh sample period, preecho clamp trigger threshhold, range */
109   64, 10, 2 
110 };
111
112 #define PREDEF_INFO_MAX 0
113
114 #endif