dbf-halloween2015
diff libs/vorbis/backends.h @ 1:c3f5c32cb210
barfed all the libraries in the source tree to make porting easier
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 01 Nov 2015 00:36:56 +0200 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libs/vorbis/backends.h Sun Nov 01 00:36:56 2015 +0200 1.3 @@ -0,0 +1,144 @@ 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 backend and mapping structures; needed for 1.17 + static mode headers 1.18 + last mod: $Id: backends.h 16962 2010-03-11 07:30:34Z xiphmont $ 1.19 + 1.20 + ********************************************************************/ 1.21 + 1.22 +/* this is exposed up here because we need it for static modes. 1.23 + Lookups for each backend aren't exposed because there's no reason 1.24 + to do so */ 1.25 + 1.26 +#ifndef _vorbis_backend_h_ 1.27 +#define _vorbis_backend_h_ 1.28 + 1.29 +#include "codec_internal.h" 1.30 + 1.31 +/* this would all be simpler/shorter with templates, but.... */ 1.32 +/* Floor backend generic *****************************************/ 1.33 +typedef struct{ 1.34 + void (*pack) (vorbis_info_floor *,oggpack_buffer *); 1.35 + vorbis_info_floor *(*unpack)(vorbis_info *,oggpack_buffer *); 1.36 + vorbis_look_floor *(*look) (vorbis_dsp_state *,vorbis_info_floor *); 1.37 + void (*free_info) (vorbis_info_floor *); 1.38 + void (*free_look) (vorbis_look_floor *); 1.39 + void *(*inverse1) (struct vorbis_block *,vorbis_look_floor *); 1.40 + int (*inverse2) (struct vorbis_block *,vorbis_look_floor *, 1.41 + void *buffer,float *); 1.42 +} vorbis_func_floor; 1.43 + 1.44 +typedef struct{ 1.45 + int order; 1.46 + long rate; 1.47 + long barkmap; 1.48 + 1.49 + int ampbits; 1.50 + int ampdB; 1.51 + 1.52 + int numbooks; /* <= 16 */ 1.53 + int books[16]; 1.54 + 1.55 + float lessthan; /* encode-only config setting hacks for libvorbis */ 1.56 + float greaterthan; /* encode-only config setting hacks for libvorbis */ 1.57 + 1.58 +} vorbis_info_floor0; 1.59 + 1.60 + 1.61 +#define VIF_POSIT 63 1.62 +#define VIF_CLASS 16 1.63 +#define VIF_PARTS 31 1.64 +typedef struct{ 1.65 + int partitions; /* 0 to 31 */ 1.66 + int partitionclass[VIF_PARTS]; /* 0 to 15 */ 1.67 + 1.68 + int class_dim[VIF_CLASS]; /* 1 to 8 */ 1.69 + int class_subs[VIF_CLASS]; /* 0,1,2,3 (bits: 1<<n poss) */ 1.70 + int class_book[VIF_CLASS]; /* subs ^ dim entries */ 1.71 + int class_subbook[VIF_CLASS][8]; /* [VIF_CLASS][subs] */ 1.72 + 1.73 + 1.74 + int mult; /* 1 2 3 or 4 */ 1.75 + int postlist[VIF_POSIT+2]; /* first two implicit */ 1.76 + 1.77 + 1.78 + /* encode side analysis parameters */ 1.79 + float maxover; 1.80 + float maxunder; 1.81 + float maxerr; 1.82 + 1.83 + float twofitweight; 1.84 + float twofitatten; 1.85 + 1.86 + int n; 1.87 + 1.88 +} vorbis_info_floor1; 1.89 + 1.90 +/* Residue backend generic *****************************************/ 1.91 +typedef struct{ 1.92 + void (*pack) (vorbis_info_residue *,oggpack_buffer *); 1.93 + vorbis_info_residue *(*unpack)(vorbis_info *,oggpack_buffer *); 1.94 + vorbis_look_residue *(*look) (vorbis_dsp_state *, 1.95 + vorbis_info_residue *); 1.96 + void (*free_info) (vorbis_info_residue *); 1.97 + void (*free_look) (vorbis_look_residue *); 1.98 + long **(*class) (struct vorbis_block *,vorbis_look_residue *, 1.99 + int **,int *,int); 1.100 + int (*forward) (oggpack_buffer *,struct vorbis_block *, 1.101 + vorbis_look_residue *, 1.102 + int **,int *,int,long **,int); 1.103 + int (*inverse) (struct vorbis_block *,vorbis_look_residue *, 1.104 + float **,int *,int); 1.105 +} vorbis_func_residue; 1.106 + 1.107 +typedef struct vorbis_info_residue0{ 1.108 +/* block-partitioned VQ coded straight residue */ 1.109 + long begin; 1.110 + long end; 1.111 + 1.112 + /* first stage (lossless partitioning) */ 1.113 + int grouping; /* group n vectors per partition */ 1.114 + int partitions; /* possible codebooks for a partition */ 1.115 + int partvals; /* partitions ^ groupbook dim */ 1.116 + int groupbook; /* huffbook for partitioning */ 1.117 + int secondstages[64]; /* expanded out to pointers in lookup */ 1.118 + int booklist[512]; /* list of second stage books */ 1.119 + 1.120 + const int classmetric1[64]; 1.121 + const int classmetric2[64]; 1.122 +} vorbis_info_residue0; 1.123 + 1.124 +/* Mapping backend generic *****************************************/ 1.125 +typedef struct{ 1.126 + void (*pack) (vorbis_info *,vorbis_info_mapping *, 1.127 + oggpack_buffer *); 1.128 + vorbis_info_mapping *(*unpack)(vorbis_info *,oggpack_buffer *); 1.129 + void (*free_info) (vorbis_info_mapping *); 1.130 + int (*forward) (struct vorbis_block *vb); 1.131 + int (*inverse) (struct vorbis_block *vb,vorbis_info_mapping *); 1.132 +} vorbis_func_mapping; 1.133 + 1.134 +typedef struct vorbis_info_mapping0{ 1.135 + int submaps; /* <= 16 */ 1.136 + int chmuxlist[256]; /* up to 256 channels in a Vorbis stream */ 1.137 + 1.138 + int floorsubmap[16]; /* [mux] submap to floors */ 1.139 + int residuesubmap[16]; /* [mux] submap to residue */ 1.140 + 1.141 + int coupling_steps; 1.142 + int coupling_mag[256]; 1.143 + int coupling_ang[256]; 1.144 + 1.145 +} vorbis_info_mapping0; 1.146 + 1.147 +#endif