vrshoot

diff libs/vorbis/codec_internal.h @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libs/vorbis/codec_internal.h	Sat Feb 01 19:58:19 2014 +0200
     1.3 @@ -0,0 +1,167 @@
     1.4 +/********************************************************************
     1.5 + *                                                                  *
     1.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
     1.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
     1.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
     1.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
    1.10 + *                                                                  *
    1.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
    1.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
    1.13 + *                                                                  *
    1.14 + ********************************************************************
    1.15 +
    1.16 + function: libvorbis codec headers
    1.17 + last mod: $Id: codec_internal.h 16227 2009-07-08 06:58:46Z xiphmont $
    1.18 +
    1.19 + ********************************************************************/
    1.20 +
    1.21 +#ifndef _V_CODECI_H_
    1.22 +#define _V_CODECI_H_
    1.23 +
    1.24 +#include "envelope.h"
    1.25 +#include "codebook.h"
    1.26 +
    1.27 +#define BLOCKTYPE_IMPULSE    0
    1.28 +#define BLOCKTYPE_PADDING    1
    1.29 +#define BLOCKTYPE_TRANSITION 0
    1.30 +#define BLOCKTYPE_LONG       1
    1.31 +
    1.32 +#define PACKETBLOBS 15
    1.33 +
    1.34 +typedef struct vorbis_block_internal{
    1.35 +  float  **pcmdelay;  /* this is a pointer into local storage */
    1.36 +  float  ampmax;
    1.37 +  int    blocktype;
    1.38 +
    1.39 +  oggpack_buffer *packetblob[PACKETBLOBS]; /* initialized, must be freed;
    1.40 +                                              blob [PACKETBLOBS/2] points to
    1.41 +                                              the oggpack_buffer in the
    1.42 +                                              main vorbis_block */
    1.43 +} vorbis_block_internal;
    1.44 +
    1.45 +typedef void vorbis_look_floor;
    1.46 +typedef void vorbis_look_residue;
    1.47 +typedef void vorbis_look_transform;
    1.48 +
    1.49 +/* mode ************************************************************/
    1.50 +typedef struct {
    1.51 +  int blockflag;
    1.52 +  int windowtype;
    1.53 +  int transformtype;
    1.54 +  int mapping;
    1.55 +} vorbis_info_mode;
    1.56 +
    1.57 +typedef void vorbis_info_floor;
    1.58 +typedef void vorbis_info_residue;
    1.59 +typedef void vorbis_info_mapping;
    1.60 +
    1.61 +#include "psy.h"
    1.62 +#include "bitrate.h"
    1.63 +
    1.64 +typedef struct private_state {
    1.65 +  /* local lookup storage */
    1.66 +  envelope_lookup        *ve; /* envelope lookup */
    1.67 +  int                     window[2];
    1.68 +  vorbis_look_transform **transform[2];    /* block, type */
    1.69 +  drft_lookup             fft_look[2];
    1.70 +
    1.71 +  int                     modebits;
    1.72 +  vorbis_look_floor     **flr;
    1.73 +  vorbis_look_residue   **residue;
    1.74 +  vorbis_look_psy        *psy;
    1.75 +  vorbis_look_psy_global *psy_g_look;
    1.76 +
    1.77 +  /* local storage, only used on the encoding side.  This way the
    1.78 +     application does not need to worry about freeing some packets'
    1.79 +     memory and not others'; packet storage is always tracked.
    1.80 +     Cleared next call to a _dsp_ function */
    1.81 +  unsigned char *header;
    1.82 +  unsigned char *header1;
    1.83 +  unsigned char *header2;
    1.84 +
    1.85 +  bitrate_manager_state bms;
    1.86 +
    1.87 +  ogg_int64_t sample_count;
    1.88 +} private_state;
    1.89 +
    1.90 +/* codec_setup_info contains all the setup information specific to the
    1.91 +   specific compression/decompression mode in progress (eg,
    1.92 +   psychoacoustic settings, channel setup, options, codebook
    1.93 +   etc).
    1.94 +*********************************************************************/
    1.95 +
    1.96 +#include "highlevel.h"
    1.97 +typedef struct codec_setup_info {
    1.98 +
    1.99 +  /* Vorbis supports only short and long blocks, but allows the
   1.100 +     encoder to choose the sizes */
   1.101 +
   1.102 +  long blocksizes[2];
   1.103 +
   1.104 +  /* modes are the primary means of supporting on-the-fly different
   1.105 +     blocksizes, different channel mappings (LR or M/A),
   1.106 +     different residue backends, etc.  Each mode consists of a
   1.107 +     blocksize flag and a mapping (along with the mapping setup */
   1.108 +
   1.109 +  int        modes;
   1.110 +  int        maps;
   1.111 +  int        floors;
   1.112 +  int        residues;
   1.113 +  int        books;
   1.114 +  int        psys;     /* encode only */
   1.115 +
   1.116 +  vorbis_info_mode       *mode_param[64];
   1.117 +  int                     map_type[64];
   1.118 +  vorbis_info_mapping    *map_param[64];
   1.119 +  int                     floor_type[64];
   1.120 +  vorbis_info_floor      *floor_param[64];
   1.121 +  int                     residue_type[64];
   1.122 +  vorbis_info_residue    *residue_param[64];
   1.123 +  static_codebook        *book_param[256];
   1.124 +  codebook               *fullbooks;
   1.125 +
   1.126 +  vorbis_info_psy        *psy_param[4]; /* encode only */
   1.127 +  vorbis_info_psy_global psy_g_param;
   1.128 +
   1.129 +  bitrate_manager_info   bi;
   1.130 +  highlevel_encode_setup hi; /* used only by vorbisenc.c.  It's a
   1.131 +                                highly redundant structure, but
   1.132 +                                improves clarity of program flow. */
   1.133 +  int         halfrate_flag; /* painless downsample for decode */
   1.134 +} codec_setup_info;
   1.135 +
   1.136 +extern vorbis_look_psy_global *_vp_global_look(vorbis_info *vi);
   1.137 +extern void _vp_global_free(vorbis_look_psy_global *look);
   1.138 +
   1.139 +
   1.140 +
   1.141 +typedef struct {
   1.142 +  int sorted_index[VIF_POSIT+2];
   1.143 +  int forward_index[VIF_POSIT+2];
   1.144 +  int reverse_index[VIF_POSIT+2];
   1.145 +
   1.146 +  int hineighbor[VIF_POSIT];
   1.147 +  int loneighbor[VIF_POSIT];
   1.148 +  int posts;
   1.149 +
   1.150 +  int n;
   1.151 +  int quant_q;
   1.152 +  vorbis_info_floor1 *vi;
   1.153 +
   1.154 +  long phrasebits;
   1.155 +  long postbits;
   1.156 +  long frames;
   1.157 +} vorbis_look_floor1;
   1.158 +
   1.159 +
   1.160 +
   1.161 +extern int *floor1_fit(vorbis_block *vb,vorbis_look_floor1 *look,
   1.162 +                          const float *logmdct,   /* in */
   1.163 +                          const float *logmask);
   1.164 +extern int *floor1_interpolate_fit(vorbis_block *vb,vorbis_look_floor1 *look,
   1.165 +                          int *A,int *B,
   1.166 +                          int del);
   1.167 +extern int floor1_encode(oggpack_buffer *opb,vorbis_block *vb,
   1.168 +                  vorbis_look_floor1 *look,
   1.169 +                  int *post,int *ilogmask);
   1.170 +#endif