nuclear@0: /******************************************************************** nuclear@0: * * nuclear@0: * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * nuclear@0: * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * nuclear@0: * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * nuclear@0: * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * nuclear@0: * * nuclear@0: * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * nuclear@0: * by the Xiph.Org Foundation http://www.xiph.org/ * nuclear@0: * * nuclear@0: ******************************************************************** nuclear@0: nuclear@0: function: libvorbis codec headers nuclear@0: last mod: $Id: codec_internal.h 16227 2009-07-08 06:58:46Z xiphmont $ nuclear@0: nuclear@0: ********************************************************************/ nuclear@0: nuclear@0: #ifndef _V_CODECI_H_ nuclear@0: #define _V_CODECI_H_ nuclear@0: nuclear@0: #include "envelope.h" nuclear@0: #include "codebook.h" nuclear@0: nuclear@0: #define BLOCKTYPE_IMPULSE 0 nuclear@0: #define BLOCKTYPE_PADDING 1 nuclear@0: #define BLOCKTYPE_TRANSITION 0 nuclear@0: #define BLOCKTYPE_LONG 1 nuclear@0: nuclear@0: #define PACKETBLOBS 15 nuclear@0: nuclear@0: typedef struct vorbis_block_internal{ nuclear@0: float **pcmdelay; /* this is a pointer into local storage */ nuclear@0: float ampmax; nuclear@0: int blocktype; nuclear@0: nuclear@0: oggpack_buffer *packetblob[PACKETBLOBS]; /* initialized, must be freed; nuclear@0: blob [PACKETBLOBS/2] points to nuclear@0: the oggpack_buffer in the nuclear@0: main vorbis_block */ nuclear@0: } vorbis_block_internal; nuclear@0: nuclear@0: typedef void vorbis_look_floor; nuclear@0: typedef void vorbis_look_residue; nuclear@0: typedef void vorbis_look_transform; nuclear@0: nuclear@0: /* mode ************************************************************/ nuclear@0: typedef struct { nuclear@0: int blockflag; nuclear@0: int windowtype; nuclear@0: int transformtype; nuclear@0: int mapping; nuclear@0: } vorbis_info_mode; nuclear@0: nuclear@0: typedef void vorbis_info_floor; nuclear@0: typedef void vorbis_info_residue; nuclear@0: typedef void vorbis_info_mapping; nuclear@0: nuclear@0: #include "psy.h" nuclear@0: #include "bitrate.h" nuclear@0: nuclear@0: typedef struct private_state { nuclear@0: /* local lookup storage */ nuclear@0: envelope_lookup *ve; /* envelope lookup */ nuclear@0: int window[2]; nuclear@0: vorbis_look_transform **transform[2]; /* block, type */ nuclear@0: drft_lookup fft_look[2]; nuclear@0: nuclear@0: int modebits; nuclear@0: vorbis_look_floor **flr; nuclear@0: vorbis_look_residue **residue; nuclear@0: vorbis_look_psy *psy; nuclear@0: vorbis_look_psy_global *psy_g_look; nuclear@0: nuclear@0: /* local storage, only used on the encoding side. This way the nuclear@0: application does not need to worry about freeing some packets' nuclear@0: memory and not others'; packet storage is always tracked. nuclear@0: Cleared next call to a _dsp_ function */ nuclear@0: unsigned char *header; nuclear@0: unsigned char *header1; nuclear@0: unsigned char *header2; nuclear@0: nuclear@0: bitrate_manager_state bms; nuclear@0: nuclear@0: ogg_int64_t sample_count; nuclear@0: } private_state; nuclear@0: nuclear@0: /* codec_setup_info contains all the setup information specific to the nuclear@0: specific compression/decompression mode in progress (eg, nuclear@0: psychoacoustic settings, channel setup, options, codebook nuclear@0: etc). nuclear@0: *********************************************************************/ nuclear@0: nuclear@0: #include "highlevel.h" nuclear@0: typedef struct codec_setup_info { nuclear@0: nuclear@0: /* Vorbis supports only short and long blocks, but allows the nuclear@0: encoder to choose the sizes */ nuclear@0: nuclear@0: long blocksizes[2]; nuclear@0: nuclear@0: /* modes are the primary means of supporting on-the-fly different nuclear@0: blocksizes, different channel mappings (LR or M/A), nuclear@0: different residue backends, etc. Each mode consists of a nuclear@0: blocksize flag and a mapping (along with the mapping setup */ nuclear@0: nuclear@0: int modes; nuclear@0: int maps; nuclear@0: int floors; nuclear@0: int residues; nuclear@0: int books; nuclear@0: int psys; /* encode only */ nuclear@0: nuclear@0: vorbis_info_mode *mode_param[64]; nuclear@0: int map_type[64]; nuclear@0: vorbis_info_mapping *map_param[64]; nuclear@0: int floor_type[64]; nuclear@0: vorbis_info_floor *floor_param[64]; nuclear@0: int residue_type[64]; nuclear@0: vorbis_info_residue *residue_param[64]; nuclear@0: static_codebook *book_param[256]; nuclear@0: codebook *fullbooks; nuclear@0: nuclear@0: vorbis_info_psy *psy_param[4]; /* encode only */ nuclear@0: vorbis_info_psy_global psy_g_param; nuclear@0: nuclear@0: bitrate_manager_info bi; nuclear@0: highlevel_encode_setup hi; /* used only by vorbisenc.c. It's a nuclear@0: highly redundant structure, but nuclear@0: improves clarity of program flow. */ nuclear@0: int halfrate_flag; /* painless downsample for decode */ nuclear@0: } codec_setup_info; nuclear@0: nuclear@0: extern vorbis_look_psy_global *_vp_global_look(vorbis_info *vi); nuclear@0: extern void _vp_global_free(vorbis_look_psy_global *look); nuclear@0: nuclear@0: nuclear@0: nuclear@0: typedef struct { nuclear@0: int sorted_index[VIF_POSIT+2]; nuclear@0: int forward_index[VIF_POSIT+2]; nuclear@0: int reverse_index[VIF_POSIT+2]; nuclear@0: nuclear@0: int hineighbor[VIF_POSIT]; nuclear@0: int loneighbor[VIF_POSIT]; nuclear@0: int posts; nuclear@0: nuclear@0: int n; nuclear@0: int quant_q; nuclear@0: vorbis_info_floor1 *vi; nuclear@0: nuclear@0: long phrasebits; nuclear@0: long postbits; nuclear@0: long frames; nuclear@0: } vorbis_look_floor1; nuclear@0: nuclear@0: nuclear@0: nuclear@0: extern int *floor1_fit(vorbis_block *vb,vorbis_look_floor1 *look, nuclear@0: const float *logmdct, /* in */ nuclear@0: const float *logmask); nuclear@0: extern int *floor1_interpolate_fit(vorbis_block *vb,vorbis_look_floor1 *look, nuclear@0: int *A,int *B, nuclear@0: int del); nuclear@0: extern int floor1_encode(oggpack_buffer *opb,vorbis_block *vb, nuclear@0: vorbis_look_floor1 *look, nuclear@0: int *post,int *ilogmask); nuclear@0: #endif