/********************************************************************1* *2* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *3* *4* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *5* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *6* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *7* *8* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *9* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *10* *11********************************************************************1213function: backend and mapping structures1415********************************************************************/1617/* this is exposed up here because we need it for static modes.18Lookups for each backend aren't exposed because there's no reason19to do so */2021#ifndef _vorbis_backend_h_22#define _vorbis_backend_h_2324#include "codec_internal.h"2526/* this would all be simpler/shorter with templates, but.... */27/* Transform backend generic *************************************/2829/* only mdct right now. Flesh it out more if we ever transcend mdct30in the transform domain */3132/* Floor backend generic *****************************************/33typedef struct{34vorbis_info_floor *(*unpack)(vorbis_info *,oggpack_buffer *);35vorbis_look_floor *(*look) (vorbis_dsp_state *,vorbis_info_mode *,36vorbis_info_floor *);37void (*free_info) (vorbis_info_floor *);38void (*free_look) (vorbis_look_floor *);39void *(*inverse1) (struct vorbis_block *,vorbis_look_floor *);40int (*inverse2) (struct vorbis_block *,vorbis_look_floor *,41void *buffer,ogg_int32_t *);42} vorbis_func_floor;4344typedef struct{45int order;46long rate;47long barkmap;4849int ampbits;50int ampdB;5152int numbooks; /* <= 16 */53int books[16];5455} vorbis_info_floor0;5657#define VIF_POSIT 6358#define VIF_CLASS 1659#define VIF_PARTS 3160typedef struct{61int partitions; /* 0 to 31 */62int partitionclass[VIF_PARTS]; /* 0 to 15 */6364int class_dim[VIF_CLASS]; /* 1 to 8 */65int class_subs[VIF_CLASS]; /* 0,1,2,3 (bits: 1<<n poss) */66int class_book[VIF_CLASS]; /* subs ^ dim entries */67int class_subbook[VIF_CLASS][8]; /* [VIF_CLASS][subs] */686970int mult; /* 1 2 3 or 4 */71int postlist[VIF_POSIT+2]; /* first two implicit */7273} vorbis_info_floor1;7475/* Residue backend generic *****************************************/76typedef struct{77vorbis_info_residue *(*unpack)(vorbis_info *,oggpack_buffer *);78vorbis_look_residue *(*look) (vorbis_dsp_state *,vorbis_info_mode *,79vorbis_info_residue *);80void (*free_info) (vorbis_info_residue *);81void (*free_look) (vorbis_look_residue *);82int (*inverse) (struct vorbis_block *,vorbis_look_residue *,83ogg_int32_t **,int *,int);84} vorbis_func_residue;8586typedef struct vorbis_info_residue0{87/* block-partitioned VQ coded straight residue */88long begin;89long end;9091/* first stage (lossless partitioning) */92int grouping; /* group n vectors per partition */93int partitions; /* possible codebooks for a partition */94int groupbook; /* huffbook for partitioning */95int secondstages[64]; /* expanded out to pointers in lookup */96int booklist[256]; /* list of second stage books */97} vorbis_info_residue0;9899/* Mapping backend generic *****************************************/100typedef struct{101vorbis_info_mapping *(*unpack)(vorbis_info *,oggpack_buffer *);102vorbis_look_mapping *(*look) (vorbis_dsp_state *,vorbis_info_mode *,103vorbis_info_mapping *);104void (*free_info) (vorbis_info_mapping *);105void (*free_look) (vorbis_look_mapping *);106int (*inverse) (struct vorbis_block *vb,vorbis_look_mapping *);107} vorbis_func_mapping;108109typedef struct vorbis_info_mapping0{110int submaps; /* <= 16 */111int chmuxlist[256]; /* up to 256 channels in a Vorbis stream */112113int floorsubmap[16]; /* [mux] submap to floors */114int residuesubmap[16]; /* [mux] submap to residue */115116int psy[2]; /* by blocktype; impulse/padding for short,117transition/normal for long */118119int coupling_steps;120int coupling_mag[256];121int coupling_ang[256];122} vorbis_info_mapping0;123124#endif125126127128129130131132