examples/SFExamples/oggvorbiscodec/src/libvorbis/lib/backends.h

00001 /********************************************************************
00002  *                                                                  *
00003  * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
00004  * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
00005  * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
00006  * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
00007  *                                                                  *
00008  * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002             *
00009  * by the XIPHOPHORUS Company http://www.xiph.org/                  *
00010  *                                                                  *
00011  ********************************************************************
00012 
00013  function: libvorbis backend and mapping structures; needed for 
00014            static mode headers
00015  last mod: $Id: backends.h 7187 2004-07-20 07:24:27Z xiphmont $
00016 
00017  ********************************************************************/
00018 
00019 /* this is exposed up here because we need it for static modes.
00020    Lookups for each backend aren't exposed because there's no reason
00021    to do so */
00022 
00023 #ifndef _vorbis_backend_h_
00024 #define _vorbis_backend_h_
00025 
00026 #include "codec_internal.h"
00027 
00028 /* this would all be simpler/shorter with templates, but.... */
00029 /* Floor backend generic *****************************************/
00030 typedef struct{
00031   void                   (*pack)  (vorbis_info_floor *,oggpack_buffer *);
00032   vorbis_info_floor     *(*unpack)(vorbis_info *,oggpack_buffer *);
00033   vorbis_look_floor     *(*look)  (vorbis_dsp_state *,vorbis_info_floor *);
00034   void (*free_info) (vorbis_info_floor *);
00035   void (*free_look) (vorbis_look_floor *);
00036   void *(*inverse1)  (struct vorbis_block *,vorbis_look_floor *);
00037   int   (*inverse2)  (struct vorbis_block *,vorbis_look_floor *,
00038                      void *buffer,float *);
00039 } vorbis_func_floor;
00040 
00041 typedef struct{
00042   int   order;
00043   long  rate;
00044   long  barkmap;
00045 
00046   int   ampbits;
00047   int   ampdB;
00048 
00049   int   numbooks; /* <= 16 */
00050   int   books[16];
00051 
00052   float lessthan;     /* encode-only config setting hacks for libvorbis */
00053   float greaterthan;  /* encode-only config setting hacks for libvorbis */
00054 
00055 } vorbis_info_floor0;
00056 
00057 
00058 #define VIF_POSIT 63
00059 #define VIF_CLASS 16
00060 #define VIF_PARTS 31
00061 typedef struct{
00062   int   partitions;                /* 0 to 31 */
00063   int   partitionclass[VIF_PARTS]; /* 0 to 15 */
00064 
00065   int   class_dim[VIF_CLASS];        /* 1 to 8 */
00066   int   class_subs[VIF_CLASS];       /* 0,1,2,3 (bits: 1<<n poss) */
00067   int   class_book[VIF_CLASS];       /* subs ^ dim entries */
00068   int   class_subbook[VIF_CLASS][8]; /* [VIF_CLASS][subs] */
00069 
00070 
00071   int   mult;                      /* 1 2 3 or 4 */ 
00072   int   postlist[VIF_POSIT+2];    /* first two implicit */ 
00073 
00074 
00075   /* encode side analysis parameters */
00076   float maxover;     
00077   float maxunder;  
00078   float maxerr;    
00079 
00080   float twofitweight;  
00081   float twofitatten;
00082 
00083   int   n;
00084 
00085 } vorbis_info_floor1;
00086 
00087 /* Residue backend generic *****************************************/
00088 typedef struct{
00089   void                 (*pack)  (vorbis_info_residue *,oggpack_buffer *);
00090   vorbis_info_residue *(*unpack)(vorbis_info *,oggpack_buffer *);
00091   vorbis_look_residue *(*look)  (vorbis_dsp_state *,
00092                                  vorbis_info_residue *);
00093   void (*free_info)    (vorbis_info_residue *);
00094   void (*free_look)    (vorbis_look_residue *);
00095   long **(*fpclass)      (struct vorbis_block *,vorbis_look_residue *,
00096                         float **,int *,int);
00097   int  (*forward)      (oggpack_buffer *,struct vorbis_block *,
00098                         vorbis_look_residue *,
00099                         float **,float **,int *,int,long **);
00100   int  (*inverse)      (struct vorbis_block *,vorbis_look_residue *,
00101                         float **,int *,int);
00102 } vorbis_func_residue;
00103 
00104 typedef struct vorbis_info_residue0{
00105 /* block-partitioned VQ coded straight residue */
00106   long  begin;
00107   long  end;
00108 
00109   /* first stage (lossless partitioning) */
00110   int    grouping;         /* group n vectors per partition */
00111   int    partitions;       /* possible codebooks for a partition */
00112   int    groupbook;        /* huffbook for partitioning */
00113   int    secondstages[64]; /* expanded out to pointers in lookup */
00114   int    booklist[256];    /* list of second stage books */
00115 
00116   float  classmetric1[64];  
00117   float  classmetric2[64];  
00118 
00119 } vorbis_info_residue0;
00120 
00121 /* Mapping backend generic *****************************************/
00122 typedef struct{
00123   void                 (*pack)  (vorbis_info *,vorbis_info_mapping *,
00124                                  oggpack_buffer *);
00125   vorbis_info_mapping *(*unpack)(vorbis_info *,oggpack_buffer *);
00126   void (*free_info)    (vorbis_info_mapping *);
00127   int  (*forward)      (struct vorbis_block *vb);
00128   int  (*inverse)      (struct vorbis_block *vb,vorbis_info_mapping *);
00129 } vorbis_func_mapping;
00130 
00131 typedef struct vorbis_info_mapping0{
00132   int   submaps;  /* <= 16 */
00133   int   chmuxlist[256];   /* up to 256 channels in a Vorbis stream */
00134   
00135   int   floorsubmap[16];   /* [mux] submap to floors */
00136   int   residuesubmap[16]; /* [mux] submap to residue */
00137 
00138   int   coupling_steps;
00139   int   coupling_mag[256];
00140   int   coupling_ang[256];
00141 
00142 } vorbis_info_mapping0;
00143 
00144 #endif
00145 
00146 

Generated by  doxygen 1.6.2