zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
codec_internal.h
Go to the documentation of this file.
1 /********************************************************************
2  * *
3  * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
4  * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
5  * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
6  * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
7  * *
8  * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
9  * by the Xiph.Org Foundation http://www.xiph.org/ *
10  * *
11  ********************************************************************
12 
13  function: libvorbis codec headers
14  last mod: $Id: codec_internal.h 16227 2009-07-08 06:58:46Z xiphmont $
15 
16  ********************************************************************/
17 
18 #ifndef _V_CODECI_H_
19 #define _V_CODECI_H_
20 
21 #include "envelope.h"
22 #include "codebook.h"
23 
24 #define BLOCKTYPE_IMPULSE 0
25 #define BLOCKTYPE_PADDING 1
26 #define BLOCKTYPE_TRANSITION 0
27 #define BLOCKTYPE_LONG 1
28 
29 #define PACKETBLOBS 15
30 
31 typedef struct vorbis_block_internal{
32  float **pcmdelay; /* this is a pointer into local storage */
33  float ampmax;
34  int blocktype;
35 
36  oggpack_buffer *packetblob[PACKETBLOBS]; /* initialized, must be freed;
37  blob [PACKETBLOBS/2] points to
38  the oggpack_buffer in the
39  main vorbis_block */
41 
42 typedef void vorbis_look_floor;
43 typedef void vorbis_look_residue;
44 typedef void vorbis_look_transform;
45 
46 /* mode ************************************************************/
47 typedef struct {
48  int blockflag;
51  int mapping;
53 
54 typedef void vorbis_info_floor;
55 typedef void vorbis_info_residue;
56 typedef void vorbis_info_mapping;
57 
58 #include "psy.h"
59 #include "bitrate.h"
60 
61 typedef struct private_state {
62  /* local lookup storage */
63  envelope_lookup *ve; /* envelope lookup */
64  int window[2];
65  vorbis_look_transform **transform[2]; /* block, type */
67 
68  int modebits;
73 
74  /* local storage, only used on the encoding side. This way the
75  application does not need to worry about freeing some packets'
76  memory and not others'; packet storage is always tracked.
77  Cleared next call to a _dsp_ function */
78  unsigned char *header;
79  unsigned char *header1;
80  unsigned char *header2;
81 
83 
86 
87 /* codec_setup_info contains all the setup information specific to the
88  specific compression/decompression mode in progress (eg,
89  psychoacoustic settings, channel setup, options, codebook
90  etc).
91 *********************************************************************/
92 
93 #include "highlevel.h"
94 typedef struct codec_setup_info {
95 
96  /* Vorbis supports only short and long blocks, but allows the
97  encoder to choose the sizes */
98 
99  long blocksizes[2];
100 
101  /* modes are the primary means of supporting on-the-fly different
102  blocksizes, different channel mappings (LR or M/A),
103  different residue backends, etc. Each mode consists of a
104  blocksize flag and a mapping (along with the mapping setup */
105 
106  int modes;
107  int maps;
108  int floors;
109  int residues;
110  int books;
111  int psys; /* encode only */
112 
114  int map_type[64];
116  int floor_type[64];
118  int residue_type[64];
122 
123  vorbis_info_psy *psy_param[4]; /* encode only */
125 
127  highlevel_encode_setup hi; /* used only by vorbisenc.c. It's a
128  highly redundant structure, but
129  improves clarity of program flow. */
130  int halfrate_flag; /* painless downsample for decode */
132 
134 extern void _vp_global_free(vorbis_look_psy_global *look);
135 
136 
137 
138 typedef struct {
139  int sorted_index[VIF_POSIT+2];
140  int forward_index[VIF_POSIT+2];
141  int reverse_index[VIF_POSIT+2];
142 
143  int hineighbor[VIF_POSIT];
144  int loneighbor[VIF_POSIT];
145  int posts;
146 
147  int n;
148  int quant_q;
150 
152  long postbits;
153  long frames;
155 
156 
157 
158 extern int *floor1_fit(vorbis_block *vb,vorbis_look_floor1 *look,
159  const float *logmdct, /* in */
160  const float *logmask);
162  int *A,int *B,
163  int del);
164 extern int floor1_encode(oggpack_buffer *opb,vorbis_block *vb,
165  vorbis_look_floor1 *look,
166  int *post,int *ilogmask);
167 #endif
#define VIF_POSIT
Definition: backends.h:58
vorbis_info_residue * residue_param[64]
#define PACKETBLOBS
vorbis_look_psy_global * psy_g_look
vorbis_info_floor * floor_param[64]
static_codebook * book_param[256]
void vorbis_info_floor
unsigned char * header
vorbis_look_psy * psy
ogg_int64_t sample_count
drft_lookup fft_look[2]
struct codec_setup_info codec_setup_info
vorbis_info_mode * mode_param[64]
vorbis_look_psy_global * _vp_global_look(vorbis_info *vi)
Definition: psy.c:36
vorbis_look_floor ** flr
void vorbis_look_residue
vorbis_info_psy_global psy_g_param
unsigned char * header2
bitrate_manager_state bms
void vorbis_look_floor
highlevel_encode_setup hi
struct vorbis_block_internal vorbis_block_internal
oggpack_buffer * packetblob[PACKETBLOBS]
int * floor1_interpolate_fit(vorbis_block *vb, vorbis_look_floor1 *look, int *A, int *B, int del)
Definition: floor1.c:746
XVisualInfo * vi
vorbis_look_residue ** residue
envelope_lookup * ve
void vorbis_info_residue
GLuint GLenum GLenum transform
Definition: glew.h:13408
void vorbis_look_transform
codebook * fullbooks
vorbis_info_psy * psy_param[4]
void vorbis_info_mapping
unsigned char * header1
void _vp_global_free(vorbis_look_psy_global *look)
Definition: psy.c:48
struct private_state private_state
int * floor1_fit(vorbis_block *vb, vorbis_look_floor1 *look, const float *logmdct, const float *logmask)
Definition: floor1.c:591
long ogg_int64_t
Definition: config_types.h:23
bitrate_manager_info bi
int floor1_encode(oggpack_buffer *opb, vorbis_block *vb, vorbis_look_floor1 *look, int *post, int *ilogmask)
Definition: floor1.c:768
vorbis_info_floor1 * vi
vorbis_info_mapping * map_param[64]