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