| 1 | /******************************************************************** |
| 2 | * * |
| 3 | * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * |
| 4 | * * |
| 5 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * |
| 6 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * |
| 7 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * |
| 8 | * * |
| 9 | * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * |
| 10 | * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * |
| 11 | * * |
| 12 | ******************************************************************** |
| 13 | |
| 14 | function: libvorbis codec headers |
| 15 | |
| 16 | ********************************************************************/ |
| 17 | |
| 18 | #ifndef _vorbis_codec_h_ |
| 19 | #define _vorbis_codec_h_cxx . . $ `mednafen/tremor/ivorbiscodec.h:19:9`! |
| 20 | |
| 21 | #ifdef __cpluspluscxx . . $ `<built-in>:471:9`! |
| 22 | extern "C" |
| 23 | { |
| 24 | #endif /* __cplusplus */ |
| 25 | |
| 26 | #include "ogg.h"cxx . . $ `<file>/mednafen/tremor/ogg.h`/ |
| 27 | |
| 28 | typedef struct vorbis_infocxx . . $ vorbis_info#{ |
| 29 | int versioncxx . . $ vorbis_info#version.; |
| 30 | int channelscxx . . $ vorbis_info#channels.; |
| 31 | long ratecxx . . $ vorbis_info#rate.; |
| 32 | |
| 33 | /* The below bitrate declarations are *hints*. |
| 34 | Combinations of the three values carry the following implications: |
| 35 | |
| 36 | all three set to the same value: |
| 37 | implies a fixed rate bitstream |
| 38 | only nominal set: |
| 39 | implies a VBR stream that averages the nominal bitrate. No hard |
| 40 | upper/lower limit |
| 41 | upper and or lower set: |
| 42 | implies a VBR bitstream that obeys the bitrate limits. nominal |
| 43 | may also be set to give a nominal rate. |
| 44 | none set: |
| 45 | the coder does not care to speculate. |
| 46 | */ |
| 47 | |
| 48 | long bitrate_uppercxx . . $ vorbis_info#bitrate_upper.; |
| 49 | long bitrate_nominalcxx . . $ vorbis_info#bitrate_nominal.; |
| 50 | long bitrate_lowercxx . . $ vorbis_info#bitrate_lower.; |
| 51 | long bitrate_windowcxx . . $ vorbis_info#bitrate_window.; |
| 52 | |
| 53 | void *codec_setupcxx . . $ vorbis_info#codec_setup.; |
| 54 | } vorbis_infocxx . . $ vorbis_info#; |
| 55 | |
| 56 | /* vorbis_dsp_state buffers the current vorbis audio |
| 57 | analysis/synthesis state. The DSP state belongs to a specific |
| 58 | logical bitstream ****************************************************/ |
| 59 | typedef struct vorbis_dsp_statecxx . . $ vorbis_dsp_state#{ |
| 60 | int analysispcxx . . $ vorbis_dsp_state#analysisp.; |
| 61 | vorbis_infocxx . . $ vorbis_info# *vicxx . . $ vorbis_dsp_state#vi.; |
| 62 | |
| 63 | ogg_int32_tcxx . . $ ogg_int32_t# **pcmcxx . . $ vorbis_dsp_state#pcm.; |
| 64 | ogg_int32_tcxx . . $ ogg_int32_t# **pcmretcxx . . $ vorbis_dsp_state#pcmret.; |
| 65 | int pcm_storagecxx . . $ vorbis_dsp_state#pcm_storage.; |
| 66 | int pcm_currentcxx . . $ vorbis_dsp_state#pcm_current.; |
| 67 | int pcm_returnedcxx . . $ vorbis_dsp_state#pcm_returned.; |
| 68 | |
| 69 | int preextrapolatecxx . . $ vorbis_dsp_state#preextrapolate.; |
| 70 | int eofflagcxx . . $ vorbis_dsp_state#eofflag.; |
| 71 | |
| 72 | long lWcxx . . $ vorbis_dsp_state#lW.; |
| 73 | long Wcxx . . $ vorbis_dsp_state#W.; |
| 74 | long nWcxx . . $ vorbis_dsp_state#nW.; |
| 75 | long centerWcxx . . $ vorbis_dsp_state#centerW.; |
| 76 | |
| 77 | ogg_int64_tcxx . . $ ogg_int64_t# granuleposcxx . . $ vorbis_dsp_state#granulepos.; |
| 78 | ogg_int64_tcxx . . $ ogg_int64_t# sequencecxx . . $ vorbis_dsp_state#sequence.; |
| 79 | |
| 80 | void *backend_statecxx . . $ vorbis_dsp_state#backend_state.; |
| 81 | } vorbis_dsp_statecxx . . $ vorbis_dsp_state#; |
| 82 | |
| 83 | typedef struct vorbis_blockcxx . . $ vorbis_block#{ |
| 84 | /* necessary stream state for linking to the framing abstraction */ |
| 85 | ogg_int32_tcxx . . $ ogg_int32_t# **pcmcxx . . $ vorbis_block#pcm.; /* this is a pointer into local storage */ |
| 86 | oggpack_buffercxx . . $ oggpack_buffer# opbcxx . . $ vorbis_block#opb.; |
| 87 | |
| 88 | long lWcxx . . $ vorbis_block#lW.; |
| 89 | long Wcxx . . $ vorbis_block#W.; |
| 90 | long nWcxx . . $ vorbis_block#nW.; |
| 91 | int pcmendcxx . . $ vorbis_block#pcmend.; |
| 92 | int modecxx . . $ vorbis_block#mode.; |
| 93 | |
| 94 | int eofflagcxx . . $ vorbis_block#eofflag.; |
| 95 | ogg_int64_tcxx . . $ ogg_int64_t# granuleposcxx . . $ vorbis_block#granulepos.; |
| 96 | ogg_int64_tcxx . . $ ogg_int64_t# sequencecxx . . $ vorbis_block#sequence.; |
| 97 | vorbis_dsp_statecxx . . $ vorbis_dsp_state# *vdcxx . . $ vorbis_block#vd.; /* For read-only access of configuration */ |
| 98 | |
| 99 | /* local storage to avoid remallocing; it's up to the mapping to |
| 100 | structure it */ |
| 101 | void *localstorecxx . . $ vorbis_block#localstore.; |
| 102 | long localtopcxx . . $ vorbis_block#localtop.; |
| 103 | long localalloccxx . . $ vorbis_block#localalloc.; |
| 104 | long totalusecxx . . $ vorbis_block#totaluse.; |
| 105 | struct alloc_chaincxx . . $ alloc_chain# *reapcxx . . $ vorbis_block#reap.; |
| 106 | |
| 107 | } vorbis_blockcxx . . $ vorbis_block#; |
| 108 | |
| 109 | /* vorbis_block is a single block of data to be processed as part of |
| 110 | the analysis/synthesis stream; it belongs to a specific logical |
| 111 | bitstream, but is independant from other vorbis_blocks belonging to |
| 112 | that logical bitstream. *************************************************/ |
| 113 | |
| 114 | struct alloc_chaincxx . . $ alloc_chain#{ |
| 115 | void *ptrcxx . . $ alloc_chain#ptr.; |
| 116 | struct alloc_chaincxx . . $ alloc_chain# *nextcxx . . $ alloc_chain#next.; |
| 117 | }; |
| 118 | |
| 119 | /* vorbis_info contains all the setup information specific to the |
| 120 | specific compression/decompression mode in progress (eg, |
| 121 | psychoacoustic settings, channel setup, options, codebook |
| 122 | etc). vorbis_info and substructures are in backends.h. |
| 123 | *********************************************************************/ |
| 124 | |
| 125 | /* the comments are not part of vorbis_info so that vorbis_info can be |
| 126 | static storage */ |
| 127 | typedef struct vorbis_commentcxx . . $ vorbis_comment#{ |
| 128 | /* unlimited user comment fields. libvorbis writes 'libvorbis' |
| 129 | whatever vendor is set to in encode */ |
| 130 | char **user_commentscxx . . $ vorbis_comment#user_comments.; |
| 131 | int *comment_lengthscxx . . $ vorbis_comment#comment_lengths.; |
| 132 | int commentscxx . . $ vorbis_comment#comments.; |
| 133 | char *vendorcxx . . $ vorbis_comment#vendor.; |
| 134 | |
| 135 | } vorbis_commentcxx . . $ vorbis_comment#; |
| 136 | |
| 137 | |
| 138 | /* libvorbis encodes in two abstraction layers; first we perform DSP |
| 139 | and produce a packet (see docs/analysis.txt). The packet is then |
| 140 | coded into a framed OggSquish bitstream by the second layer (see |
| 141 | docs/framing.txt). Decode is the reverse process; we sync/frame |
| 142 | the bitstream and extract individual packets, then decode the |
| 143 | packet back into PCM audio. |
| 144 | |
| 145 | The extra framing/packetizing is used in streaming formats, such as |
| 146 | files. Over the net (such as with UDP), the framing and |
| 147 | packetization aren't necessary as they're provided by the transport |
| 148 | and the streaming layer is not used */ |
| 149 | |
| 150 | /* Vorbis PRIMITIVES: general ***************************************/ |
| 151 | |
| 152 | extern void vorbis_info_initcxx . . $ vorbis_info_init(d534a068b27cdae4).(vorbis_infocxx . . $ vorbis_info# *vi); |
| 153 | extern void vorbis_info_clearcxx . . $ vorbis_info_clear(d534a068b27cdae4).(vorbis_infocxx . . $ vorbis_info# *vi); |
| 154 | extern int vorbis_info_blocksizecxx . . $ vorbis_info_blocksize(567c21d5828d03ac).(vorbis_infocxx . . $ vorbis_info# *vi,int zo); |
| 155 | extern void vorbis_comment_initcxx . . $ vorbis_comment_init(93d47bffb8aa4dc6).(vorbis_commentcxx . . $ vorbis_comment# *vc); |
| 156 | extern void vorbis_comment_addcxx . . $ vorbis_comment_add(ac66abfe45591005).(vorbis_commentcxx . . $ vorbis_comment# *vc, char *comment); |
| 157 | extern void vorbis_comment_add_tagcxx . . $ vorbis_comment_add_tag(f661309d9d9ac9ff).(vorbis_commentcxx . . $ vorbis_comment# *vc, |
| 158 | char *tag, char *contents); |
| 159 | extern char *vorbis_comment_querycxx . . $ vorbis_comment_query(f76539686bec7ac2).(vorbis_commentcxx . . $ vorbis_comment# *vc, char *tag, int count); |
| 160 | extern int vorbis_comment_query_countcxx . . $ vorbis_comment_query_count(ee1b7d08fa4bd0ec).(vorbis_commentcxx . . $ vorbis_comment# *vc, char *tag); |
| 161 | extern void vorbis_comment_clearcxx . . $ vorbis_comment_clear(93d47bffb8aa4dc6).(vorbis_commentcxx . . $ vorbis_comment# *vc); |
| 162 | |
| 163 | extern int vorbis_block_initcxx . . $ vorbis_block_init(c8f1c0cf9c31dd14).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v, vorbis_blockcxx . . $ vorbis_block# *vb); |
| 164 | extern int vorbis_block_clearcxx . . $ vorbis_block_clear(e7ca6336a14cf342).(vorbis_blockcxx . . $ vorbis_block# *vb); |
| 165 | extern void vorbis_dsp_clearcxx . . $ vorbis_dsp_clear(1841c7801a59e076).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v); |
| 166 | |
| 167 | /* Vorbis PRIMITIVES: synthesis layer *******************************/ |
| 168 | extern int vorbis_synthesis_idheadercxx . . $ vorbis_synthesis_idheader(93d9f7a6e445c2aa).(ogg_packetcxx . . $ ogg_packet# *op); |
| 169 | extern int vorbis_synthesis_headerincxx . . $ vorbis_synthesis_headerin(3ae6e73fba03d214).(vorbis_infocxx . . $ vorbis_info# *vi,vorbis_commentcxx . . $ vorbis_comment# *vc, |
| 170 | ogg_packetcxx . . $ ogg_packet# *op); |
| 171 | |
| 172 | extern int vorbis_synthesis_initcxx . . $ vorbis_synthesis_init(eac5c897194134f0).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v,vorbis_infocxx . . $ vorbis_info# *vi); |
| 173 | extern int vorbis_synthesis_restartcxx . . $ vorbis_synthesis_restart(6cb399ae167b2de8).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v); |
| 174 | extern int vorbis_synthesiscxx . . $ vorbis_synthesis(e9de88148c52a299).(vorbis_blockcxx . . $ vorbis_block# *vb,ogg_packetcxx . . $ ogg_packet# *op); |
| 175 | extern int vorbis_synthesis_trackonlycxx . . $ vorbis_synthesis_trackonly(e9de88148c52a299).(vorbis_blockcxx . . $ vorbis_block# *vb,ogg_packetcxx . . $ ogg_packet# *op); |
| 176 | extern int vorbis_synthesis_blockincxx . . $ vorbis_synthesis_blockin(c8f1c0cf9c31dd14).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v,vorbis_blockcxx . . $ vorbis_block# *vb); |
| 177 | extern int vorbis_synthesis_pcmoutcxx . . $ vorbis_synthesis_pcmout(a5862dcc143b250).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v,ogg_int32_tcxx . . $ ogg_int32_t# ***pcm); |
| 178 | extern int vorbis_synthesis_readcxx . . $ vorbis_synthesis_read(462060a1f4fafeae).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v,int samples); |
| 179 | extern long vorbis_packet_blocksizecxx . . $ vorbis_packet_blocksize(5c730016bfddf4b1).(vorbis_infocxx . . $ vorbis_info# *vi,ogg_packetcxx . . $ ogg_packet# *op); |
| 180 | |
| 181 | /* Vorbis ERRORS and return codes ***********************************/ |
| 182 | |
| 183 | #define OV_FALSEcxx . . $ `mednafen/tremor/ivorbiscodec.h:183:9`! -1 |
| 184 | #define OV_EOFcxx . . $ `mednafen/tremor/ivorbiscodec.h:184:9`! -2 |
| 185 | #define OV_HOLEcxx . . $ `mednafen/tremor/ivorbiscodec.h:185:9`! -3 |
| 186 | |
| 187 | #define OV_EREADcxx . . $ `mednafen/tremor/ivorbiscodec.h:187:9`! -128 |
| 188 | #define OV_EFAULTcxx . . $ `mednafen/tremor/ivorbiscodec.h:188:9`! -129 |
| 189 | #define OV_EIMPLcxx . . $ `mednafen/tremor/ivorbiscodec.h:189:9`! -130 |
| 190 | #define OV_EINVALcxx . . $ `mednafen/tremor/ivorbiscodec.h:190:9`! -131 |
| 191 | #define OV_ENOTVORBIScxx . . $ `mednafen/tremor/ivorbiscodec.h:191:9`! -132 |
| 192 | #define OV_EBADHEADERcxx . . $ `mednafen/tremor/ivorbiscodec.h:192:9`! -133 |
| 193 | #define OV_EVERSIONcxx . . $ `mednafen/tremor/ivorbiscodec.h:193:9`! -134 |
| 194 | #define OV_ENOTAUDIOcxx . . $ `mednafen/tremor/ivorbiscodec.h:194:9`! -135 |
| 195 | #define OV_EBADPACKETcxx . . $ `mednafen/tremor/ivorbiscodec.h:195:9`! -136 |
| 196 | #define OV_EBADLINKcxx . . $ `mednafen/tremor/ivorbiscodec.h:196:9`! -137 |
| 197 | #define OV_ENOSEEKcxx . . $ `mednafen/tremor/ivorbiscodec.h:197:9`! -138 |
| 198 | |
| 199 | #ifdef __cpluspluscxx . . $ `<built-in>:471:9`! |
| 200 | } |
| 201 | #endif /* __cplusplus */ |
| 202 | |
| 203 | #endif |
| 204 |