Subversion Repositories AndroidProjects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
244 chris 1
 
2
 
3
 
4
 
5
 
6
 
7
/********************************************************************
8
 *                                                                  *
9
 * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE.   *
10
 *                                                                  *
11
 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
12
 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
13
 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
14
 *                                                                  *
15
 * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002    *
16
 * BY THE Xiph.Org FOUNDATION http://www.xiph.org/                  *
17
 *                                                                  *
18
 ********************************************************************
19
 
20
 function: backend and mapping structures
21
 
22
 ********************************************************************/
23
 
24
/* this is exposed up here because we need it for static modes.
25
   Lookups for each backend aren't exposed because there's no reason
26
   to do so */
27
 
28
#ifndef _vorbis_backend_h_
29
#define _vorbis_backend_h_
30
 
31
#include "codec_internal.h"
32
 
33
/* this would all be simpler/shorter with templates, but.... */
34
/* Transform backend generic *************************************/
35
 
36
/* only mdct right now.  Flesh it out more if we ever transcend mdct
37
   in the transform domain */
38
 
39
/* Floor backend generic *****************************************/
40
typedef struct{
41
  vorbis_info_floor     *(*unpack)(vorbis_info *,oggpack_buffer *);
42
  vorbis_look_floor     *(*look)  (vorbis_dsp_state *,vorbis_info_mode *,
43
                                   vorbis_info_floor *);
44
  void (*free_info) (vorbis_info_floor *);
45
  void (*free_look) (vorbis_look_floor *);
46
  void *(*inverse1)  (struct vorbis_block *,vorbis_look_floor *);
47
  int   (*inverse2)  (struct vorbis_block *,vorbis_look_floor *,
48
                     void *buffer,ogg_int32_t *);
49
} vorbis_func_floor;
50
 
51
typedef struct{
52
  int   order;
53
  long  rate;
54
  long  barkmap;
55
 
56
  int   ampbits;
57
  int   ampdB;
58
 
59
  int   numbooks; /* <= 16 */
60
  int   books[16];
61
 
62
} vorbis_info_floor0;
63
 
64
#define VIF_POSIT 63
65
#define VIF_CLASS 16
66
#define VIF_PARTS 31
67
typedef struct{
68
  int   partitions;                /* 0 to 31 */
69
  int   partitionclass[VIF_PARTS]; /* 0 to 15 */
70
 
71
  int   class_dim[VIF_CLASS];        /* 1 to 8 */
72
  int   class_subs[VIF_CLASS];       /* 0,1,2,3 (bits: 1<<n poss) */
73
  int   class_book[VIF_CLASS];       /* subs ^ dim entries */
74
  int   class_subbook[VIF_CLASS][8]; /* [VIF_CLASS][subs] */
75
 
76
 
77
  int   mult;                      /* 1 2 3 or 4 */
78
  int   postlist[VIF_POSIT+2];    /* first two implicit */
79
 
80
} vorbis_info_floor1;
81
 
82
/* Residue backend generic *****************************************/
83
typedef struct{
84
  vorbis_info_residue *(*unpack)(vorbis_info *,oggpack_buffer *);
85
  vorbis_look_residue *(*look)  (vorbis_dsp_state *,vorbis_info_mode *,
86
                                 vorbis_info_residue *);
87
  void (*free_info)    (vorbis_info_residue *);
88
  void (*free_look)    (vorbis_look_residue *);
89
  int  (*inverse)      (struct vorbis_block *,vorbis_look_residue *,
90
                        ogg_int32_t **,int *,int);
91
} vorbis_func_residue;
92
 
93
typedef struct vorbis_info_residue0{
94
/* block-partitioned VQ coded straight residue */
95
  long  begin;
96
  long  end;
97
 
98
  /* first stage (lossless partitioning) */
99
  int    grouping;         /* group n vectors per partition */
100
  int    partitions;       /* possible codebooks for a partition */
101
  int    groupbook;        /* huffbook for partitioning */
102
  int    secondstages[64]; /* expanded out to pointers in lookup */
103
  int    booklist[256];    /* list of second stage books */
104
} vorbis_info_residue0;
105
 
106
/* Mapping backend generic *****************************************/
107
typedef struct{
108
  vorbis_info_mapping *(*unpack)(vorbis_info *,oggpack_buffer *);
109
  vorbis_look_mapping *(*look)  (vorbis_dsp_state *,vorbis_info_mode *,
110
                                 vorbis_info_mapping *);
111
  void (*free_info)    (vorbis_info_mapping *);
112
  void (*free_look)    (vorbis_look_mapping *);
113
  int  (*inverse)      (struct vorbis_block *vb,vorbis_look_mapping *);
114
} vorbis_func_mapping;
115
 
116
typedef struct vorbis_info_mapping0{
117
  int   submaps;  /* <= 16 */
118
  int   chmuxlist[256];   /* up to 256 channels in a Vorbis stream */
119
 
120
  int   floorsubmap[16];   /* [mux] submap to floors */
121
  int   residuesubmap[16]; /* [mux] submap to residue */
122
 
123
  int   psy[2]; /* by blocktype; impulse/padding for short,
124
                   transition/normal for long */
125
 
126
  int   coupling_steps;
127
  int   coupling_mag[256];
128
  int   coupling_ang[256];
129
} vorbis_info_mapping0;
130
 
131
#endif
132
 
133
 
134
 
135
 
136