modes.h 5.88 KB
Newer Older
Monty's avatar
 
Monty committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/********************************************************************
 *                                                                  *
 * 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
Monty's avatar
 
Monty committed
15
 last mod: $Id: modes.h,v 1.10.2.8 2000/06/14 01:24:18 xiphmont Exp $
Monty's avatar
 
Monty committed
16 17 18 19 20 21 22 23 24 25

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

#ifndef _V_MODES_H_
#define _V_MODES_H_

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

Monty's avatar
 
Monty committed
26 27
#include "vorbis/book/lsp12_0.vqh"
#include "vorbis/book/lsp30_0.vqh"
Monty's avatar
 
Monty committed
28 29
#include "vorbis/book/resaux0_short.vqh"
#include "vorbis/book/resaux0_long.vqh"
Monty's avatar
 
Monty committed
30 31
#include "vorbis/book/resaux0b_short.vqh"
#include "vorbis/book/resaux0b_long.vqh"
Monty's avatar
 
Monty committed
32

Monty's avatar
 
Monty committed
33 34 35 36 37 38 39 40 41 42 43 44 45 46
#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"

Monty's avatar
 
Monty committed
47 48 49 50
#include "vorbis/book/res0a_1.vqh"
#include "vorbis/book/res0a_2.vqh"
#include "vorbis/book/res0a_3.vqh"
#include "vorbis/book/res0a_4.vqh"
Monty's avatar
 
Monty committed
51 52 53 54 55 56 57 58 59
#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"
Monty's avatar
 
Monty committed
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79

/* A farily high quality setting mix */
static vorbis_info_psy _psy_set0={
  1,/*athp*/
  1,/*decayp*/
  1,/*smoothp*/
  0,8,0.,

  -130.,

  1,/* tonemaskp */
  {-80.,-80.,-80.,-80.,-100.}, /* remember that el 0,2 is a 80 dB curve */
  {-35.,-40.,-60.,-80.,-80.}, /* remember that el 4 is an 80 dB curve, not 100 */
  {-35.,-40.,-60.,-80.,-100.},
  {-35.,-40.,-60.,-80.,-100.},
  {-35.,-40.,-60.,-80.,-100.},
  {-35.,-40.,-60.,-80.,-100.},
  {-35.,-40.,-60.,-80.,-100.},  

  1,/* peakattp */
Monty's avatar
 
Monty committed
80 81 82 83 84 85
  {-12.,-12.,-12.,-16.,-16.},
  {-12.,-12.,-12.,-16.,-16.},
  {-12.,-12.,-12.,-16.,-16.},
  {-12.,-12.,-12.,-16.,-16.},
  {-12.,-12.,-12.,-16.,-16.},
  {-10.,-10.,-12.,-16.,-16.},
Monty's avatar
 
Monty committed
86
  {-6.,-8.,-10.,-12.,-12.},
Monty's avatar
 
Monty committed
87 88 89 90 91 92 93 94

  1,/*noisemaskp */
  {-100.,-100.,-100.,-200.,-200.},
  {-100.,-100.,-100.,-200.,-200.},
  {-100.,-100.,-100.,-200.,-200.},
  {-60.,-60.,-60.,-80.,-80.},
  {-60.,-60.,-60.,-80.,-80.},
  {-60.,-60.,-60.,-80.,-80.},
Monty's avatar
 
Monty committed
95
  {-52.,-55.,-60.,-80.,-80.},
Monty's avatar
 
Monty committed
96 97 98

  100.,

Monty's avatar
 
Monty committed
99
  .9998, .9999  /* attack/decay control */
Monty's avatar
 
Monty committed
100 101 102 103
};

/* with GNUisms, this could be short and readable. Oh well */
static vorbis_info_time0 _time_set0={0};
Monty's avatar
 
Monty committed
104 105
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} };
Monty's avatar
 
Monty committed
106
static vorbis_info_residue0 _residue_set0={0,128, 64,14,2,
Monty's avatar
 
Monty committed
107 108 109 110 111
					   {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},

Monty's avatar
 
Monty committed
112 113 114
					   {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},
Monty's avatar
 
Monty committed
115
					   -1,-1};
Monty's avatar
 
Monty committed
116

Monty's avatar
 
Monty committed
117
static vorbis_info_residue0 _residue_set1={0,768, 64,28,3,
Monty's avatar
 
Monty committed
118 119 120 121 122
					   {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},
					   
Monty's avatar
 
Monty committed
123 124 125
					   {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},/*6==64*/
Monty's avatar
 
Monty committed
126
					   2,-1};
Monty's avatar
 
Monty committed
127

Monty's avatar
 
Monty committed
128 129 130 131 132 133 134 135 136 137 138 139
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 */
Monty's avatar
 
Monty committed
140
  2,          2,    1,     2,       2,   30,   1,
Monty's avatar
 
Monty committed
141 142 143 144 145 146 147 148 149 150 151
  /* 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 */
Monty's avatar
 
Monty committed
152 153
  {&_vq_book_lsp12_0,      /* 0 */
   &_vq_book_lsp30_0,      /* 1 */
Monty's avatar
 
Monty committed
154

Monty's avatar
 
Monty committed
155
   &_huff_book_resaux0_short,
Monty's avatar
 
Monty committed
156
   &_huff_book_resaux0b_long,
Monty's avatar
 
Monty committed
157 158 159 160 161

   &_vq_book_res0a_1,
   &_vq_book_res0a_2,
   &_vq_book_res0a_3,
   &_vq_book_res0a_4,
Monty's avatar
 
Monty committed
162 163 164 165 166 167 168 169 170
   &_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,
Monty's avatar
 
Monty committed
171 172 173 174 175 176 177 178 179 180 181 182 183
   &_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,
Monty's avatar
 
Monty committed
184 185 186 187
  },
  /* psy */
  {&_psy_set0},
  /* thresh sample period, preecho clamp trigger threshhold, range */
Monty's avatar
 
Monty committed
188
  128, 4, 2 
Monty's avatar
 
Monty committed
189 190 191 192 193
};

#define PREDEF_INFO_MAX 0

#endif