annotate win32-mingw/include/vorbis/codec.h @ 169:223a55898ab9 tip default

Add null config files
author Chris Cannam <cannam@all-day-breakfast.com>
date Mon, 02 Mar 2020 14:03:47 +0000
parents fe7c3a0b0259
children
rev   line source
cannam@88 1 /********************************************************************
cannam@88 2 * *
cannam@88 3 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
cannam@88 4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
cannam@88 5 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
cannam@88 6 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
cannam@88 7 * *
cannam@88 8 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
cannam@88 9 * by the Xiph.Org Foundation http://www.xiph.org/ *
cannam@88 10
cannam@88 11 ********************************************************************
cannam@88 12
cannam@88 13 function: libvorbis codec headers
cannam@88 14 last mod: $Id: codec.h 17021 2010-03-24 09:29:41Z xiphmont $
cannam@88 15
cannam@88 16 ********************************************************************/
cannam@88 17
cannam@88 18 #ifndef _vorbis_codec_h_
cannam@88 19 #define _vorbis_codec_h_
cannam@88 20
cannam@88 21 #ifdef __cplusplus
cannam@88 22 extern "C"
cannam@88 23 {
cannam@88 24 #endif /* __cplusplus */
cannam@88 25
cannam@88 26 #include <ogg/ogg.h>
cannam@88 27
cannam@88 28 typedef struct vorbis_info{
cannam@88 29 int version;
cannam@88 30 int channels;
cannam@88 31 long rate;
cannam@88 32
cannam@88 33 /* The below bitrate declarations are *hints*.
cannam@88 34 Combinations of the three values carry the following implications:
cannam@88 35
cannam@88 36 all three set to the same value:
cannam@88 37 implies a fixed rate bitstream
cannam@88 38 only nominal set:
cannam@88 39 implies a VBR stream that averages the nominal bitrate. No hard
cannam@88 40 upper/lower limit
cannam@88 41 upper and or lower set:
cannam@88 42 implies a VBR bitstream that obeys the bitrate limits. nominal
cannam@88 43 may also be set to give a nominal rate.
cannam@88 44 none set:
cannam@88 45 the coder does not care to speculate.
cannam@88 46 */
cannam@88 47
cannam@88 48 long bitrate_upper;
cannam@88 49 long bitrate_nominal;
cannam@88 50 long bitrate_lower;
cannam@88 51 long bitrate_window;
cannam@88 52
cannam@88 53 void *codec_setup;
cannam@88 54 } vorbis_info;
cannam@88 55
cannam@88 56 /* vorbis_dsp_state buffers the current vorbis audio
cannam@88 57 analysis/synthesis state. The DSP state belongs to a specific
cannam@88 58 logical bitstream ****************************************************/
cannam@88 59 typedef struct vorbis_dsp_state{
cannam@88 60 int analysisp;
cannam@88 61 vorbis_info *vi;
cannam@88 62
cannam@88 63 float **pcm;
cannam@88 64 float **pcmret;
cannam@88 65 int pcm_storage;
cannam@88 66 int pcm_current;
cannam@88 67 int pcm_returned;
cannam@88 68
cannam@88 69 int preextrapolate;
cannam@88 70 int eofflag;
cannam@88 71
cannam@88 72 long lW;
cannam@88 73 long W;
cannam@88 74 long nW;
cannam@88 75 long centerW;
cannam@88 76
cannam@88 77 ogg_int64_t granulepos;
cannam@88 78 ogg_int64_t sequence;
cannam@88 79
cannam@88 80 ogg_int64_t glue_bits;
cannam@88 81 ogg_int64_t time_bits;
cannam@88 82 ogg_int64_t floor_bits;
cannam@88 83 ogg_int64_t res_bits;
cannam@88 84
cannam@88 85 void *backend_state;
cannam@88 86 } vorbis_dsp_state;
cannam@88 87
cannam@88 88 typedef struct vorbis_block{
cannam@88 89 /* necessary stream state for linking to the framing abstraction */
cannam@88 90 float **pcm; /* this is a pointer into local storage */
cannam@88 91 oggpack_buffer opb;
cannam@88 92
cannam@88 93 long lW;
cannam@88 94 long W;
cannam@88 95 long nW;
cannam@88 96 int pcmend;
cannam@88 97 int mode;
cannam@88 98
cannam@88 99 int eofflag;
cannam@88 100 ogg_int64_t granulepos;
cannam@88 101 ogg_int64_t sequence;
cannam@88 102 vorbis_dsp_state *vd; /* For read-only access of configuration */
cannam@88 103
cannam@88 104 /* local storage to avoid remallocing; it's up to the mapping to
cannam@88 105 structure it */
cannam@88 106 void *localstore;
cannam@88 107 long localtop;
cannam@88 108 long localalloc;
cannam@88 109 long totaluse;
cannam@88 110 struct alloc_chain *reap;
cannam@88 111
cannam@88 112 /* bitmetrics for the frame */
cannam@88 113 long glue_bits;
cannam@88 114 long time_bits;
cannam@88 115 long floor_bits;
cannam@88 116 long res_bits;
cannam@88 117
cannam@88 118 void *internal;
cannam@88 119
cannam@88 120 } vorbis_block;
cannam@88 121
cannam@88 122 /* vorbis_block is a single block of data to be processed as part of
cannam@88 123 the analysis/synthesis stream; it belongs to a specific logical
cannam@88 124 bitstream, but is independent from other vorbis_blocks belonging to
cannam@88 125 that logical bitstream. *************************************************/
cannam@88 126
cannam@88 127 struct alloc_chain{
cannam@88 128 void *ptr;
cannam@88 129 struct alloc_chain *next;
cannam@88 130 };
cannam@88 131
cannam@88 132 /* vorbis_info contains all the setup information specific to the
cannam@88 133 specific compression/decompression mode in progress (eg,
cannam@88 134 psychoacoustic settings, channel setup, options, codebook
cannam@88 135 etc). vorbis_info and substructures are in backends.h.
cannam@88 136 *********************************************************************/
cannam@88 137
cannam@88 138 /* the comments are not part of vorbis_info so that vorbis_info can be
cannam@88 139 static storage */
cannam@88 140 typedef struct vorbis_comment{
cannam@88 141 /* unlimited user comment fields. libvorbis writes 'libvorbis'
cannam@88 142 whatever vendor is set to in encode */
cannam@88 143 char **user_comments;
cannam@88 144 int *comment_lengths;
cannam@88 145 int comments;
cannam@88 146 char *vendor;
cannam@88 147
cannam@88 148 } vorbis_comment;
cannam@88 149
cannam@88 150
cannam@88 151 /* libvorbis encodes in two abstraction layers; first we perform DSP
cannam@88 152 and produce a packet (see docs/analysis.txt). The packet is then
cannam@88 153 coded into a framed OggSquish bitstream by the second layer (see
cannam@88 154 docs/framing.txt). Decode is the reverse process; we sync/frame
cannam@88 155 the bitstream and extract individual packets, then decode the
cannam@88 156 packet back into PCM audio.
cannam@88 157
cannam@88 158 The extra framing/packetizing is used in streaming formats, such as
cannam@88 159 files. Over the net (such as with UDP), the framing and
cannam@88 160 packetization aren't necessary as they're provided by the transport
cannam@88 161 and the streaming layer is not used */
cannam@88 162
cannam@88 163 /* Vorbis PRIMITIVES: general ***************************************/
cannam@88 164
cannam@88 165 extern void vorbis_info_init(vorbis_info *vi);
cannam@88 166 extern void vorbis_info_clear(vorbis_info *vi);
cannam@88 167 extern int vorbis_info_blocksize(vorbis_info *vi,int zo);
cannam@88 168 extern void vorbis_comment_init(vorbis_comment *vc);
cannam@88 169 extern void vorbis_comment_add(vorbis_comment *vc, const char *comment);
cannam@88 170 extern void vorbis_comment_add_tag(vorbis_comment *vc,
cannam@88 171 const char *tag, const char *contents);
cannam@88 172 extern char *vorbis_comment_query(vorbis_comment *vc, const char *tag, int count);
cannam@88 173 extern int vorbis_comment_query_count(vorbis_comment *vc, const char *tag);
cannam@88 174 extern void vorbis_comment_clear(vorbis_comment *vc);
cannam@88 175
cannam@88 176 extern int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb);
cannam@88 177 extern int vorbis_block_clear(vorbis_block *vb);
cannam@88 178 extern void vorbis_dsp_clear(vorbis_dsp_state *v);
cannam@88 179 extern double vorbis_granule_time(vorbis_dsp_state *v,
cannam@88 180 ogg_int64_t granulepos);
cannam@88 181
cannam@88 182 extern const char *vorbis_version_string(void);
cannam@88 183
cannam@88 184 /* Vorbis PRIMITIVES: analysis/DSP layer ****************************/
cannam@88 185
cannam@88 186 extern int vorbis_analysis_init(vorbis_dsp_state *v,vorbis_info *vi);
cannam@88 187 extern int vorbis_commentheader_out(vorbis_comment *vc, ogg_packet *op);
cannam@88 188 extern int vorbis_analysis_headerout(vorbis_dsp_state *v,
cannam@88 189 vorbis_comment *vc,
cannam@88 190 ogg_packet *op,
cannam@88 191 ogg_packet *op_comm,
cannam@88 192 ogg_packet *op_code);
cannam@88 193 extern float **vorbis_analysis_buffer(vorbis_dsp_state *v,int vals);
cannam@88 194 extern int vorbis_analysis_wrote(vorbis_dsp_state *v,int vals);
cannam@88 195 extern int vorbis_analysis_blockout(vorbis_dsp_state *v,vorbis_block *vb);
cannam@88 196 extern int vorbis_analysis(vorbis_block *vb,ogg_packet *op);
cannam@88 197
cannam@88 198 extern int vorbis_bitrate_addblock(vorbis_block *vb);
cannam@88 199 extern int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd,
cannam@88 200 ogg_packet *op);
cannam@88 201
cannam@88 202 /* Vorbis PRIMITIVES: synthesis layer *******************************/
cannam@88 203 extern int vorbis_synthesis_idheader(ogg_packet *op);
cannam@88 204 extern int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,
cannam@88 205 ogg_packet *op);
cannam@88 206
cannam@88 207 extern int vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi);
cannam@88 208 extern int vorbis_synthesis_restart(vorbis_dsp_state *v);
cannam@88 209 extern int vorbis_synthesis(vorbis_block *vb,ogg_packet *op);
cannam@88 210 extern int vorbis_synthesis_trackonly(vorbis_block *vb,ogg_packet *op);
cannam@88 211 extern int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb);
cannam@88 212 extern int vorbis_synthesis_pcmout(vorbis_dsp_state *v,float ***pcm);
cannam@88 213 extern int vorbis_synthesis_lapout(vorbis_dsp_state *v,float ***pcm);
cannam@88 214 extern int vorbis_synthesis_read(vorbis_dsp_state *v,int samples);
cannam@88 215 extern long vorbis_packet_blocksize(vorbis_info *vi,ogg_packet *op);
cannam@88 216
cannam@88 217 extern int vorbis_synthesis_halfrate(vorbis_info *v,int flag);
cannam@88 218 extern int vorbis_synthesis_halfrate_p(vorbis_info *v);
cannam@88 219
cannam@88 220 /* Vorbis ERRORS and return codes ***********************************/
cannam@88 221
cannam@88 222 #define OV_FALSE -1
cannam@88 223 #define OV_EOF -2
cannam@88 224 #define OV_HOLE -3
cannam@88 225
cannam@88 226 #define OV_EREAD -128
cannam@88 227 #define OV_EFAULT -129
cannam@88 228 #define OV_EIMPL -130
cannam@88 229 #define OV_EINVAL -131
cannam@88 230 #define OV_ENOTVORBIS -132
cannam@88 231 #define OV_EBADHEADER -133
cannam@88 232 #define OV_EVERSION -134
cannam@88 233 #define OV_ENOTAUDIO -135
cannam@88 234 #define OV_EBADPACKET -136
cannam@88 235 #define OV_EBADLINK -137
cannam@88 236 #define OV_ENOSEEK -138
cannam@88 237
cannam@88 238 #ifdef __cplusplus
cannam@88 239 }
cannam@88 240 #endif /* __cplusplus */
cannam@88 241
cannam@88 242 #endif
cannam@88 243