summaryrefslogtreecommitdiff
path: root/lib/modes/residue_44.h
blob: 904ae50dc07336d7915f2e4535f597ed8c8b3304 (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
/********************************************************************
 *                                                                  *
 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
 *                                                                  *
 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001             *
 * by the XIPHOPHORUS Company http://www.xiph.org/                  *
 *                                                                  *
 ********************************************************************

 function: toplevel residue templates for 32/44.1/48kHz
 last mod: $Id: residue_44.h,v 1.1.2.6 2001/12/11 08:19:47 xiphmont Exp $

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

#include "vorbis/codec.h"
#include "backends.h"

static bitrate_manager_info _bm_44_default={
  /* progressive coding and bitrate controls */
  2.,.5,
  2.,       0,           0,  
            0,           0,
           
  4.0, 0.,  -1.,              .05, 
            -.05,             .05,
  3.5,5.0,
  -10.f,+2.f
};

/***** residue backends *********************************************/

/* the books used depend on stereo-or-not, but the residue setup below
   can apply to coupled or not.  These templates are for a first pass;
   a last pass is mechanically added in vorbisenc for residue backfill
   at 1/3 and 1/9, as well as an optional middle pass for stereo
   backfill */

/*     0   1   2   4  26   1   2   4  26   +      
           0   0   0   0         

       0   1   2   3   4   5   6   7   8   9
   1                   .               .   .
   2                   .               .   .
   4       .   .   .       .   .   .       .
 
       0   4   4   4   3   4   4   4   3   7 */
static vorbis_info_residue0 _residue_44_low={
  0,-1, -1, 8,-1,
  {0},
  {-1},
  {9999, 9999, 9999, 9999, 9999, 9999, 9999},
  {  .5,  1.5,  2.5,  4.5, 26.5,  1.5,  4.5},
  {0},
  {  99,   -1,   -1,   -1,   -1,   99,   99}
};

/*     0   1   2   4   1   2   4  16  42   +      
           0   0   0            

       0   1   2   3   4   5   6   7   8   9
   1                               .   .   .
   2                               .   .   .
   4       .   .   .   .   .   .           .
 
       0   4   4   4   4   4   4   3   3   7 */
static vorbis_info_residue0 _residue_44_mid={
  0,-1, -1, 10,-1,
  /*  0     1     2     3     4     5     6     7     8     9 */
  {0},
  {-1},
  {9999, 9999, 9999, 9999, 9999, 9999, 9999, 9999, 9999},
  {  .5,  1.5,  2.5,  4.5,  1.5,  2.5,  4.5, 16.5, 42.5},
  {0},
  {  99,   -1,   -1,   -1,   99,   99,   99,   99,   99}
};


/*     0   4  42   1   2   4   8  16  56   +      
           0   0   0            

       0   1   2   3   4   5   6   7   8   9
   1           .                   .   .   .
   2           .                   .   .   .
   4       .       .   .   .   .           .
 
       0   4   3   4   4   4   4   3   3   7 */
static vorbis_info_residue0 _residue_44_high={
  0,-1, -1, 10,-1,
  /*  0     1     2     3     4     5     6     7     8     9 */
  {0},
  {-1},
  {9999, 9999, 9999, 9999, 9999, 9999, 9999, 9999, 9999},
  {  .5,  4.5, 42.5,  1.5,  2.5,  4.5,  8.5, 16.5, 56.5},
  {0},
  {  99,   -1,   -1,   99,   99,   99,   99,   99,   99}
};

#include "books/coupled/_44c0_short.vqh"
#include "books/coupled/_44c0_long.vqh"

#include "books/coupled/_44c0_s0_p1_0.vqh"
#include "books/coupled/_44c0_s0_p2_0.vqh"
#include "books/coupled/_44c0_s0_p3_0.vqh"
#include "books/coupled/_44c0_s0_p4_0.vqh"
#include "books/coupled/_44c0_s0_p4_1.vqh"
#include "books/coupled/_44c0_s1_p5_0.vqh"
#include "books/coupled/_44c0_s2_p6_0.vqh"
#include "books/coupled/_44c0_s4_p7_0.vqh"
#include "books/coupled/_44c0_s4_p7_1.vqh"
#include "books/coupled/_44c0_s4_p7_2.vqh"

/* residue backfill is entered in the template array as if stereo
   backfill is not in use.  It's up to vorbisenc to make the
   appropriate index adjustment */
static vorbis_residue_template _residue_template_44_stereo[11]={
  /* mode 0; 64-ish */
  {{&_residue_44_low, &_residue_44_low},  
   {&_huff_book__44c0_short,&_huff_book__44c0_long},
   { {{0}}, /* lossless stereo */
     {{0}}, /* 6dB (2.5) stereo */
     {{0}}, /* 12dB (4.5) stereo */
     {{0}}, /* 18dB (8.5) stereo */
     {{0},{0,0,&_44c0_s0_p1_0},{0,0,&_44c0_s0_p2_0},{0,0,&_44c0_s0_p3_0},
      {&_44c0_s0_p4_0,&_44c0_s0_p4_1},{0,0,&_44c0_s1_p5_0},{0,0,&_44c0_s2_p6_0},
      {&_44c0_s4_p7_0,&_44c0_s4_p7_1,&_44c0_s4_p7_2}}, /* 24dB (16.5) stereo */
   },
   { {0}, /* lossless stereo */
     {0}, /* 6dB (2.5) stereo */
     {0}, /* 12dB (4.5) stereo */
     {0}, /* 18dB (8.5) stereo */
     {0},
     //{0,0,0,0,0,0,0,0,&44c0_s4_s8,&44c0_s4_s9},/* 24dB (16.5) stereo */
   },
   { {{0}}, /* lossless stereo */
     {{0}}, /* 6dB (2.5) stereo */
     {{0}}, /* 12dB (4.5) stereo */
     {{0}}, /* 18dB (8.5) stereo */
     //{{&44c0_s0_r0_0,&44c0_s0_r0_1},{&44c0_s0_r1_0,&44c0_s0_r1_1},
     // {&44c0_s0_r2_0,&44c0_s0_r2_1},{&44c0_s0_r3_0,&44c0_s0_r3_1},
     // {&44c0_s0_r4_0,&44c0_s0_r4_1},{&44c0_s1_r5_0,&44c0_s1_r5_1},
     // {&44c0_s1_r6_0,&44c0_s1_r6_1},{&44c0_s2_r7_0,&44c0_s2_r7_1},
     // {&44c0_s4_r8_0,&44c0_s3_r8_1},{&44c0_s4_r9_0,&44c0_s3_r9_1}}, /* 18dB (8.5) stereo */
     {{0}}, /* 24dB (16.5) stereo */
   },
  }

  /* mode 1; 80-ish */

};