annotate src/libvorbis-1.3.3/lib/codec_internal.h @ 127:7867fa7e1b6b

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