| 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-2001 * |
| 9 | * by the Xiph.Org Foundation https://xiph.org/ * |
| 10 | |
| 11 | ******************************************************************** |
| 12 | |
| 13 | function: libvorbis codec headers |
| 14 | |
| 15 | ********************************************************************/ |
| 16 | |
| 17 | #ifndef _vorbis_codec_h_ |
| 18 | #define _vorbis_codec_h_cxx . . $ `external/vorbis/vorbis_codec.h:18:9`! |
| 19 | |
| 20 | #include "ogg.h"cxx . . $ `<file>/external/vorbis/ogg.h`/ |
| 21 | |
| 22 | typedef struct vorbis_infocxx . . $ vorbis_info#{ |
| 23 | int versioncxx . . $ vorbis_info#version.; |
| 24 | int channelscxx . . $ vorbis_info#channels.; |
| 25 | long ratecxx . . $ vorbis_info#rate.; |
| 26 | |
| 27 | /* The below bitrate declarations are *hints*. |
| 28 | Combinations of the three values carry the following implications: |
| 29 | |
| 30 | all three set to the same value: |
| 31 | implies a fixed rate bitstream |
| 32 | only nominal set: |
| 33 | implies a VBR stream that averages the nominal bitrate. No hard |
| 34 | upper/lower limit |
| 35 | upper and or lower set: |
| 36 | implies a VBR bitstream that obeys the bitrate limits. nominal |
| 37 | may also be set to give a nominal rate. |
| 38 | none set: |
| 39 | the coder does not care to speculate. |
| 40 | */ |
| 41 | |
| 42 | long bitrate_uppercxx . . $ vorbis_info#bitrate_upper.; |
| 43 | long bitrate_nominalcxx . . $ vorbis_info#bitrate_nominal.; |
| 44 | long bitrate_lowercxx . . $ vorbis_info#bitrate_lower.; |
| 45 | long bitrate_windowcxx . . $ vorbis_info#bitrate_window.; |
| 46 | |
| 47 | void *codec_setupcxx . . $ vorbis_info#codec_setup.; |
| 48 | } vorbis_infocxx . . $ vorbis_info#; |
| 49 | |
| 50 | /* vorbis_dsp_state buffers the current vorbis audio |
| 51 | analysis/synthesis state. The DSP state belongs to a specific |
| 52 | logical bitstream ****************************************************/ |
| 53 | typedef struct vorbis_dsp_statecxx . . $ vorbis_dsp_state#{ |
| 54 | int analysispcxx . . $ vorbis_dsp_state#analysisp.; |
| 55 | vorbis_infocxx . . $ vorbis_info# *vicxx . . $ vorbis_dsp_state#vi.; |
| 56 | |
| 57 | float **pcmcxx . . $ vorbis_dsp_state#pcm.; |
| 58 | float **pcmretcxx . . $ vorbis_dsp_state#pcmret.; |
| 59 | int pcm_storagecxx . . $ vorbis_dsp_state#pcm_storage.; |
| 60 | int pcm_currentcxx . . $ vorbis_dsp_state#pcm_current.; |
| 61 | int pcm_returnedcxx . . $ vorbis_dsp_state#pcm_returned.; |
| 62 | |
| 63 | int preextrapolatecxx . . $ vorbis_dsp_state#preextrapolate.; |
| 64 | int eofflagcxx . . $ vorbis_dsp_state#eofflag.; |
| 65 | |
| 66 | long lWcxx . . $ vorbis_dsp_state#lW.; |
| 67 | long Wcxx . . $ vorbis_dsp_state#W.; |
| 68 | long nWcxx . . $ vorbis_dsp_state#nW.; |
| 69 | long centerWcxx . . $ vorbis_dsp_state#centerW.; |
| 70 | |
| 71 | ogg_int64_tcxx . . $ ogg_int64_t# granuleposcxx . . $ vorbis_dsp_state#granulepos.; |
| 72 | ogg_int64_tcxx . . $ ogg_int64_t# sequencecxx . . $ vorbis_dsp_state#sequence.; |
| 73 | |
| 74 | ogg_int64_tcxx . . $ ogg_int64_t# glue_bitscxx . . $ vorbis_dsp_state#glue_bits.; |
| 75 | ogg_int64_tcxx . . $ ogg_int64_t# time_bitscxx . . $ vorbis_dsp_state#time_bits.; |
| 76 | ogg_int64_tcxx . . $ ogg_int64_t# floor_bitscxx . . $ vorbis_dsp_state#floor_bits.; |
| 77 | ogg_int64_tcxx . . $ ogg_int64_t# res_bitscxx . . $ vorbis_dsp_state#res_bits.; |
| 78 | |
| 79 | void *backend_statecxx . . $ vorbis_dsp_state#backend_state.; |
| 80 | } vorbis_dsp_statecxx . . $ vorbis_dsp_state#; |
| 81 | |
| 82 | typedef struct vorbis_blockcxx . . $ vorbis_block#{ |
| 83 | /* necessary stream state for linking to the framing abstraction */ |
| 84 | float **pcmcxx . . $ vorbis_block#pcm.; /* this is a pointer into local storage */ |
| 85 | oggpack_buffercxx . . $ oggpack_buffer# opbcxx . . $ vorbis_block#opb.; |
| 86 | |
| 87 | long lWcxx . . $ vorbis_block#lW.; |
| 88 | long Wcxx . . $ vorbis_block#W.; |
| 89 | long nWcxx . . $ vorbis_block#nW.; |
| 90 | int pcmendcxx . . $ vorbis_block#pcmend.; |
| 91 | int modecxx . . $ vorbis_block#mode.; |
| 92 | |
| 93 | int eofflagcxx . . $ vorbis_block#eofflag.; |
| 94 | ogg_int64_tcxx . . $ ogg_int64_t# granuleposcxx . . $ vorbis_block#granulepos.; |
| 95 | ogg_int64_tcxx . . $ ogg_int64_t# sequencecxx . . $ vorbis_block#sequence.; |
| 96 | vorbis_dsp_statecxx . . $ vorbis_dsp_state# *vdcxx . . $ vorbis_block#vd.; /* For read-only access of configuration */ |
| 97 | |
| 98 | /* local storage to avoid remallocing; it's up to the mapping to |
| 99 | structure it */ |
| 100 | void *localstorecxx . . $ vorbis_block#localstore.; |
| 101 | long localtopcxx . . $ vorbis_block#localtop.; |
| 102 | long localalloccxx . . $ vorbis_block#localalloc.; |
| 103 | long totalusecxx . . $ vorbis_block#totaluse.; |
| 104 | struct alloc_chaincxx . . $ alloc_chain# *reapcxx . . $ vorbis_block#reap.; |
| 105 | |
| 106 | /* bitmetrics for the frame */ |
| 107 | long glue_bitscxx . . $ vorbis_block#glue_bits.; |
| 108 | long time_bitscxx . . $ vorbis_block#time_bits.; |
| 109 | long floor_bitscxx . . $ vorbis_block#floor_bits.; |
| 110 | long res_bitscxx . . $ vorbis_block#res_bits.; |
| 111 | |
| 112 | void *internalcxx . . $ vorbis_block#internal.; |
| 113 | |
| 114 | } vorbis_blockcxx . . $ vorbis_block#; |
| 115 | |
| 116 | /* vorbis_block is a single block of data to be processed as part of |
| 117 | the analysis/synthesis stream; it belongs to a specific logical |
| 118 | bitstream, but is independent from other vorbis_blocks belonging to |
| 119 | that logical bitstream. *************************************************/ |
| 120 | |
| 121 | struct alloc_chaincxx . . $ alloc_chain#{ |
| 122 | void *ptrcxx . . $ alloc_chain#ptr.; |
| 123 | struct alloc_chaincxx . . $ alloc_chain# *nextcxx . . $ alloc_chain#next.; |
| 124 | }; |
| 125 | |
| 126 | /* vorbis_info contains all the setup information specific to the |
| 127 | specific compression/decompression mode in progress (eg, |
| 128 | psychoacoustic settings, channel setup, options, codebook |
| 129 | etc). vorbis_info and substructures are in backends.h. |
| 130 | *********************************************************************/ |
| 131 | |
| 132 | /* the comments are not part of vorbis_info so that vorbis_info can be |
| 133 | static storage */ |
| 134 | typedef struct vorbis_commentcxx . . $ vorbis_comment#{ |
| 135 | /* unlimited user comment fields. libvorbis writes 'libvorbis' |
| 136 | whatever vendor is set to in encode */ |
| 137 | char **user_commentscxx . . $ vorbis_comment#user_comments.; |
| 138 | int *comment_lengthscxx . . $ vorbis_comment#comment_lengths.; |
| 139 | int commentscxx . . $ vorbis_comment#comments.; |
| 140 | char *vendorcxx . . $ vorbis_comment#vendor.; |
| 141 | |
| 142 | } vorbis_commentcxx . . $ vorbis_comment#; |
| 143 | |
| 144 | |
| 145 | /* libvorbis encodes in two abstraction layers; first we perform DSP |
| 146 | and produce a packet (see docs/analysis.txt). The packet is then |
| 147 | coded into a framed OggSquish bitstream by the second layer (see |
| 148 | docs/framing.txt). Decode is the reverse process; we sync/frame |
| 149 | the bitstream and extract individual packets, then decode the |
| 150 | packet back into PCM audio. |
| 151 | |
| 152 | The extra framing/packetizing is used in streaming formats, such as |
| 153 | files. Over the net (such as with UDP), the framing and |
| 154 | packetization aren't necessary as they're provided by the transport |
| 155 | and the streaming layer is not used */ |
| 156 | |
| 157 | /* Vorbis PRIMITIVES: general ***************************************/ |
| 158 | |
| 159 | extern void vorbis_info_initcxx . . $ vorbis_info_init(d534a068b27cdae4).(vorbis_infocxx . . $ vorbis_info# *vi); |
| 160 | extern void vorbis_info_clearcxx . . $ vorbis_info_clear(d534a068b27cdae4).(vorbis_infocxx . . $ vorbis_info# *vi); |
| 161 | extern int vorbis_info_blocksizecxx . . $ vorbis_info_blocksize(567c21d5828d03ac).(vorbis_infocxx . . $ vorbis_info# *vi,int zo); |
| 162 | extern void vorbis_comment_initcxx . . $ vorbis_comment_init(93d47bffb8aa4dc6).(vorbis_commentcxx . . $ vorbis_comment# *vc); |
| 163 | extern void vorbis_comment_addcxx . . $ vorbis_comment_add(fc813bfcf59a3529).(vorbis_commentcxx . . $ vorbis_comment# *vc, const char *comment); |
| 164 | extern void vorbis_comment_add_tagcxx . . $ vorbis_comment_add_tag(1324fd773c411d7a).(vorbis_commentcxx . . $ vorbis_comment# *vc, |
| 165 | const char *tag, const char *contents); |
| 166 | extern char *vorbis_comment_querycxx . . $ vorbis_comment_query(c477d1dd5eaaa2b).(vorbis_commentcxx . . $ vorbis_comment# *vc, const char *tag, int count); |
| 167 | extern int vorbis_comment_query_countcxx . . $ vorbis_comment_query_count(ad5e27f81de964b2).(vorbis_commentcxx . . $ vorbis_comment# *vc, const char *tag); |
| 168 | extern void vorbis_comment_clearcxx . . $ vorbis_comment_clear(93d47bffb8aa4dc6).(vorbis_commentcxx . . $ vorbis_comment# *vc); |
| 169 | |
| 170 | extern int vorbis_block_initcxx . . $ vorbis_block_init(c8f1c0cf9c31dd14).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v, vorbis_blockcxx . . $ vorbis_block# *vb); |
| 171 | extern int vorbis_block_clearcxx . . $ vorbis_block_clear(e7ca6336a14cf342).(vorbis_blockcxx . . $ vorbis_block# *vb); |
| 172 | extern void vorbis_dsp_clearcxx . . $ vorbis_dsp_clear(1841c7801a59e076).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v); |
| 173 | extern double vorbis_granule_timecxx . . $ vorbis_granule_time(ff837de03bb0110e).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v, |
| 174 | ogg_int64_tcxx . . $ ogg_int64_t# granulepos); |
| 175 | |
| 176 | extern const char *vorbis_version_stringcxx . . $ vorbis_version_string(33a1f659e94feb42).(void); |
| 177 | |
| 178 | /* Vorbis PRIMITIVES: analysis/DSP layer ****************************/ |
| 179 | |
| 180 | extern int vorbis_analysis_initcxx . . $ vorbis_analysis_init(eac5c897194134f0).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v,vorbis_infocxx . . $ vorbis_info# *vi); |
| 181 | extern int vorbis_commentheader_outcxx . . $ vorbis_commentheader_out(253fc6b7c88125aa).(vorbis_commentcxx . . $ vorbis_comment# *vc, ogg_packetcxx . . $ ogg_packet# *op); |
| 182 | extern int vorbis_analysis_headeroutcxx . . $ vorbis_analysis_headerout(81775acc1ee0075d).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v, |
| 183 | vorbis_commentcxx . . $ vorbis_comment# *vc, |
| 184 | ogg_packetcxx . . $ ogg_packet# *op, |
| 185 | ogg_packetcxx . . $ ogg_packet# *op_comm, |
| 186 | ogg_packetcxx . . $ ogg_packet# *op_code); |
| 187 | extern float **vorbis_analysis_buffercxx . . $ vorbis_analysis_buffer(3cc628d017a07439).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v,int vals); |
| 188 | extern int vorbis_analysis_wrotecxx . . $ vorbis_analysis_wrote(462060a1f4fafeae).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v,int vals); |
| 189 | extern int vorbis_analysis_blockoutcxx . . $ vorbis_analysis_blockout(c8f1c0cf9c31dd14).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v,vorbis_blockcxx . . $ vorbis_block# *vb); |
| 190 | extern int vorbis_analysiscxx . . $ vorbis_analysis(e9de88148c52a299).(vorbis_blockcxx . . $ vorbis_block# *vb,ogg_packetcxx . . $ ogg_packet# *op); |
| 191 | |
| 192 | extern int vorbis_bitrate_addblockcxx . . $ vorbis_bitrate_addblock(e7ca6336a14cf342).(vorbis_blockcxx . . $ vorbis_block# *vb); |
| 193 | extern int vorbis_bitrate_flushpacketcxx . . $ vorbis_bitrate_flushpacket(f774a63b8d86ed29).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *vd, |
| 194 | ogg_packetcxx . . $ ogg_packet# *op); |
| 195 | |
| 196 | /* Vorbis PRIMITIVES: synthesis layer *******************************/ |
| 197 | extern int vorbis_synthesis_idheadercxx . . $ vorbis_synthesis_idheader(93d9f7a6e445c2aa).(ogg_packetcxx . . $ ogg_packet# *op); |
| 198 | extern int vorbis_synthesis_headerincxx . . $ vorbis_synthesis_headerin(3ae6e73fba03d214).(vorbis_infocxx . . $ vorbis_info# *vi,vorbis_commentcxx . . $ vorbis_comment# *vc, |
| 199 | ogg_packetcxx . . $ ogg_packet# *op); |
| 200 | |
| 201 | extern int vorbis_synthesis_initcxx . . $ vorbis_synthesis_init(eac5c897194134f0).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v,vorbis_infocxx . . $ vorbis_info# *vi); |
| 202 | extern int vorbis_synthesis_restartcxx . . $ vorbis_synthesis_restart(6cb399ae167b2de8).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v); |
| 203 | extern int vorbis_synthesiscxx . . $ vorbis_synthesis(e9de88148c52a299).(vorbis_blockcxx . . $ vorbis_block# *vb,ogg_packetcxx . . $ ogg_packet# *op); |
| 204 | extern int vorbis_synthesis_trackonlycxx . . $ vorbis_synthesis_trackonly(e9de88148c52a299).(vorbis_blockcxx . . $ vorbis_block# *vb,ogg_packetcxx . . $ ogg_packet# *op); |
| 205 | extern int vorbis_synthesis_blockincxx . . $ vorbis_synthesis_blockin(c8f1c0cf9c31dd14).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v,vorbis_blockcxx . . $ vorbis_block# *vb); |
| 206 | extern int vorbis_synthesis_pcmoutcxx . . $ vorbis_synthesis_pcmout(fd400e10b261aeec).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v,float ***pcm); |
| 207 | extern int vorbis_synthesis_lapoutcxx . . $ vorbis_synthesis_lapout(fd400e10b261aeec).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v,float ***pcm); |
| 208 | extern int vorbis_synthesis_readcxx . . $ vorbis_synthesis_read(462060a1f4fafeae).(vorbis_dsp_statecxx . . $ vorbis_dsp_state# *v,int samples); |
| 209 | extern long vorbis_packet_blocksizecxx . . $ vorbis_packet_blocksize(5c730016bfddf4b1).(vorbis_infocxx . . $ vorbis_info# *vi,ogg_packetcxx . . $ ogg_packet# *op); |
| 210 | |
| 211 | extern int vorbis_synthesis_halfratecxx . . $ vorbis_synthesis_halfrate(567c21d5828d03ac).(vorbis_infocxx . . $ vorbis_info# *v,int flag); |
| 212 | extern int vorbis_synthesis_halfrate_pcxx . . $ vorbis_synthesis_halfrate_p(8afef93073a461ef).(vorbis_infocxx . . $ vorbis_info# *v); |
| 213 | |
| 214 | /* Vorbis ERRORS and return codes ***********************************/ |
| 215 | |
| 216 | #define OV_FALSEcxx . . $ `external/vorbis/vorbis_codec.h:216:9`! -1 |
| 217 | #define OV_EOFcxx . . $ `external/vorbis/vorbis_codec.h:217:9`! -2 |
| 218 | #define OV_HOLEcxx . . $ `external/vorbis/vorbis_codec.h:218:9`! -3 |
| 219 | |
| 220 | #define OV_EREADcxx . . $ `external/vorbis/vorbis_codec.h:220:9`! -128 |
| 221 | #define OV_EFAULTcxx . . $ `external/vorbis/vorbis_codec.h:221:9`! -129 |
| 222 | #define OV_EIMPLcxx . . $ `external/vorbis/vorbis_codec.h:222:9`! -130 |
| 223 | #define OV_EINVALcxx . . $ `external/vorbis/vorbis_codec.h:223:9`! -131 |
| 224 | #define OV_ENOTVORBIScxx . . $ `external/vorbis/vorbis_codec.h:224:9`! -132 |
| 225 | #define OV_EBADHEADERcxx . . $ `external/vorbis/vorbis_codec.h:225:9`! -133 |
| 226 | #define OV_EVERSIONcxx . . $ `external/vorbis/vorbis_codec.h:226:9`! -134 |
| 227 | #define OV_ENOTAUDIOcxx . . $ `external/vorbis/vorbis_codec.h:227:9`! -135 |
| 228 | #define OV_EBADPACKETcxx . . $ `external/vorbis/vorbis_codec.h:228:9`! -136 |
| 229 | #define OV_EBADLINKcxx . . $ `external/vorbis/vorbis_codec.h:229:9`! -137 |
| 230 | #define OV_ENOSEEKcxx . . $ `external/vorbis/vorbis_codec.h:230:9`! -138 |
| 231 | |
| 232 | #endif |
| 233 |