"L. Spiro Engine"

F:/My Projects/LSEngine/Modules/LSSoundLib/Src/Ogg/LSSVorbisBackends.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-2009             *
00009  * by the Xiph.Org Foundation 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 16962 2010-03-11 07:30:34Z xiphmont $
00016 
00017  ********************************************************************/
00018 
00019 #ifndef __LSS_VORBISBACKENDS_H__
00020 #define __LSS_VORBISBACKENDS_H__
00021 
00022 #include "../LSSSoundLib.h"
00023 #include "LSSOgg.h"
00024 #include "LSSVorbisCodec.h"
00025 #include "LSSVorbisConstants.h"
00026 #include "LSSVorbisStructs.h"
00027 
00028 namespace lss {
00029 
00036         class CVorbisBackends {
00037         public :
00038                 // == Types.
00042                 typedef struct vorbis_func_floor {
00043                         LSVOID                                                                                  (* pack)( CVorbisStructs::vorbis_info_floor *, COgg::oggpack_buffer * );
00044                         CVorbisStructs::vorbis_info_floor *                             (* unpack)( CVorbisCodec::vorbis_info *, COgg::oggpack_buffer * );
00045                         CVorbisStructs::vorbis_look_floor *                             (* look)( CVorbisCodec::vorbis_dsp_state *, CVorbisStructs::vorbis_info_floor * );
00046                         LSVOID                                                                                  (* free_info)( CVorbisStructs::vorbis_info_floor * );
00047                         LSVOID                                                                                  (* free_look)( CVorbisStructs::vorbis_look_floor * );
00048                         LSVOID *                                                                                (* inverse1)( CVorbisCodec::vorbis_block *, CVorbisStructs::vorbis_look_floor * );
00049                         LSINT32                                                                                 (* inverse2)( CVorbisCodec::vorbis_block *, CVorbisStructs::vorbis_look_floor *, 
00050                                 LSVOID *buffer, LSFLOAT * );
00051                 } * LPvorbis_func_floor, * const LPCvorbis_func_floor;
00052 
00056                 typedef struct vorbis_info_floor0 {
00057                         LSINT32                                                                                 order;
00058                         LSINT32                                                                                 rate;
00059                         LSINT32                                                                                 barkmap;
00060 
00061                         LSINT32                                                                                 ampbits;
00062                         LSINT32                                                                                 ampdB;
00063 
00064                         LSINT32                                                                                 numbooks;                                               // <= 16.
00065                         LSINT32                                                                                 books[16];
00066 
00067                         LSFLOAT                                                                                 lessthan;                                               // Encode-only config setting hacks for libvorbis.
00068                         LSFLOAT                                                                                 greaterthan;                                    // Encode-only config setting hacks for libvorbis.
00069 
00070                 } * LPvorbis_info_floor0, * const LPCvorbis_info_floor0;
00071 
00075                 typedef struct vorbis_info_floor1 {
00076                         LSINT32                                                                                 partitions;                                             // 0 to 31.
00077                         LSINT32                                                                                 partitionclass[VIF_PARTS];              // 0 to 15.
00078 
00079                         LSINT32                                                                                 class_dim[VIF_CLASS];                   // 1 to 8.
00080                         LSINT32                                                                                 class_subs[VIF_CLASS];                  // 0, 1, 2, 3 (bits: 1 << n possible).
00081                         LSINT32                                                                                 class_book[VIF_CLASS];                  // subs ^ dim entries.
00082                         LSINT32                                                                                 class_subbook[VIF_CLASS][8];    // [VIF_CLASS][subs].
00083 
00084 
00085                         LSINT32                                                                                 mult;                                                   // 1 2 3 or 4.
00086                         LSINT32                                                                                 postlist[VIF_POSIT+2];                  // First two implicit.
00087 
00088 
00089                         // Encode side analysis parameters.
00090                         LSFLOAT                                                                                 maxover;
00091                         LSFLOAT                                                                                 maxunder;
00092                         LSFLOAT                                                                                 maxerr;
00093 
00094                         LSFLOAT                                                                                 twofitweight;
00095                         LSFLOAT                                                                                 twofitatten;
00096 
00097                         LSINT32                                                                                 n;
00098 
00099                 } * LPvorbis_info_floor1, * const LPCvorbis_info_floor1;
00100 
00104                 typedef struct vorbis_func_residue {
00105                         LSVOID                                                                                  (* pack)( CVorbisStructs::vorbis_info_residue *, COgg::oggpack_buffer * );
00106                         CVorbisStructs::vorbis_info_residue *                   (* unpack)( CVorbisCodec::vorbis_info *, COgg::oggpack_buffer * );
00107                         CVorbisStructs::vorbis_look_residue *                   (* look)( CVorbisCodec::vorbis_dsp_state *, 
00108                                 CVorbisStructs::vorbis_info_residue * );
00109                         LSVOID                                                                                  (* free_info)( CVorbisStructs::vorbis_info_residue * );
00110                         LSVOID                                                                                  (* free_look)( CVorbisStructs::vorbis_look_residue * );
00111                         LSINT32 **                                                                              (* class0)( CVorbisCodec::vorbis_block *, CVorbisStructs::vorbis_look_residue *, 
00112                                 LSINT32 **, LSINT32 *, LSINT32 );
00113                         LSINT32                                                                                 (* forward)( COgg::oggpack_buffer *, CVorbisCodec::vorbis_block *, 
00114                                 CVorbisStructs::vorbis_look_residue *, 
00115                                 LSINT32 **, LSINT32 *, LSINT32, LSINT32 **, LSINT32 );
00116                         LSINT32                                                                                 (* inverse)( CVorbisCodec::vorbis_block *, CVorbisStructs::vorbis_look_residue *, 
00117                                 LSFLOAT **, LSINT32 *, LSINT32 );
00118                 } * LPvorbis_func_residue, * const LPCvorbis_func_residue;
00119 
00123                 typedef struct vorbis_info_residue0 {
00124                         // Block-partitioned VQ coded straight residue.
00125                         LSINT32                                                                                 begin;
00126                         LSINT32                                                                                 end;
00127 
00128                         // First stage (lossless partitioning).
00129                         LSINT32                                                                                 grouping;                                               // Froup n vectors per partition.
00130                         LSINT32                                                                                 partitions;                                             // Possible codebooks for a partition.
00131                         LSINT32                                                                                 partvals;                                               // Partitions ^ groupbook dim.
00132                         LSINT32                                                                                 groupbook;                                              // Huffbook for partitioning.
00133                         LSINT32                                                                                 secondstages[64];                               // Expanded out to pointers in lookup.
00134                         LSINT32                                                                                 booklist[512];                                  // List of second stage books.
00135 
00136                         LSINT32                                                                                 classmetric1[64];
00137                         LSINT32                                                                                 classmetric2[64];
00138                 } * LPvorbis_info_residue0, * const LPCvorbis_info_residue0;
00139 
00143                 typedef struct vorbis_func_mapping {
00144                         LSVOID                                                                                  (* pack)( CVorbisCodec::vorbis_info *, CVorbisStructs::vorbis_info_mapping *, 
00145                                 COgg::oggpack_buffer * );
00146                         CVorbisStructs::vorbis_info_mapping *                   (* unpack)( CVorbisCodec::vorbis_info *, COgg::oggpack_buffer * );
00147                         LSVOID                                                                                  (* free_info)( CVorbisStructs::vorbis_info_mapping * );
00148                         LSINT32                                                                                 (* forward)( CVorbisCodec::vorbis_block * vb );
00149                         LSINT32                                                                                 (* inverse)( CVorbisCodec::vorbis_block * vb, CVorbisStructs::vorbis_info_mapping * );
00150                 } * LPvorbis_func_mapping, * const LPCvorbis_func_mapping;
00151 
00152 
00153                 // == Members.
00154                 
00155         };
00156 
00157 }       // namespace lss
00158 
00159 #endif  // __LSS_VORBISBACKENDS_H__
00160 
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator