annotate src/libvorbis-1.3.3/lib/backends.h @ 83:ae30d91d2ffe

Replace these with versions built using an older toolset (so as to avoid ABI compatibilities when linking on Ubuntu 14.04 for packaging purposes)
author Chris Cannam
date Fri, 07 Feb 2020 11:51:13 +0000
parents 05aa0afa9217
children
rev   line source
Chris@1 1 /********************************************************************
Chris@1 2 * *
Chris@1 3 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
Chris@1 4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
Chris@1 5 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
Chris@1 6 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
Chris@1 7 * *
Chris@1 8 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
Chris@1 9 * by the Xiph.Org Foundation http://www.xiph.org/ *
Chris@1 10 * *
Chris@1 11 ********************************************************************
Chris@1 12
Chris@1 13 function: libvorbis backend and mapping structures; needed for
Chris@1 14 static mode headers
Chris@1 15 last mod: $Id: backends.h 16962 2010-03-11 07:30:34Z xiphmont $
Chris@1 16
Chris@1 17 ********************************************************************/
Chris@1 18
Chris@1 19 /* this is exposed up here because we need it for static modes.
Chris@1 20 Lookups for each backend aren't exposed because there's no reason
Chris@1 21 to do so */
Chris@1 22
Chris@1 23 #ifndef _vorbis_backend_h_
Chris@1 24 #define _vorbis_backend_h_
Chris@1 25
Chris@1 26 #include "codec_internal.h"
Chris@1 27
Chris@1 28 /* this would all be simpler/shorter with templates, but.... */
Chris@1 29 /* Floor backend generic *****************************************/
Chris@1 30 typedef struct{
Chris@1 31 void (*pack) (vorbis_info_floor *,oggpack_buffer *);
Chris@1 32 vorbis_info_floor *(*unpack)(vorbis_info *,oggpack_buffer *);
Chris@1 33 vorbis_look_floor *(*look) (vorbis_dsp_state *,vorbis_info_floor *);
Chris@1 34 void (*free_info) (vorbis_info_floor *);
Chris@1 35 void (*free_look) (vorbis_look_floor *);
Chris@1 36 void *(*inverse1) (struct vorbis_block *,vorbis_look_floor *);
Chris@1 37 int (*inverse2) (struct vorbis_block *,vorbis_look_floor *,
Chris@1 38 void *buffer,float *);
Chris@1 39 } vorbis_func_floor;
Chris@1 40
Chris@1 41 typedef struct{
Chris@1 42 int order;
Chris@1 43 long rate;
Chris@1 44 long barkmap;
Chris@1 45
Chris@1 46 int ampbits;
Chris@1 47 int ampdB;
Chris@1 48
Chris@1 49 int numbooks; /* <= 16 */
Chris@1 50 int books[16];
Chris@1 51
Chris@1 52 float lessthan; /* encode-only config setting hacks for libvorbis */
Chris@1 53 float greaterthan; /* encode-only config setting hacks for libvorbis */
Chris@1 54
Chris@1 55 } vorbis_info_floor0;
Chris@1 56
Chris@1 57
Chris@1 58 #define VIF_POSIT 63
Chris@1 59 #define VIF_CLASS 16
Chris@1 60 #define VIF_PARTS 31
Chris@1 61 typedef struct{
Chris@1 62 int partitions; /* 0 to 31 */
Chris@1 63 int partitionclass[VIF_PARTS]; /* 0 to 15 */
Chris@1 64
Chris@1 65 int class_dim[VIF_CLASS]; /* 1 to 8 */
Chris@1 66 int class_subs[VIF_CLASS]; /* 0,1,2,3 (bits: 1<<n poss) */
Chris@1 67 int class_book[VIF_CLASS]; /* subs ^ dim entries */
Chris@1 68 int class_subbook[VIF_CLASS][8]; /* [VIF_CLASS][subs] */
Chris@1 69
Chris@1 70
Chris@1 71 int mult; /* 1 2 3 or 4 */
Chris@1 72 int postlist[VIF_POSIT+2]; /* first two implicit */
Chris@1 73
Chris@1 74
Chris@1 75 /* encode side analysis parameters */
Chris@1 76 float maxover;
Chris@1 77 float maxunder;
Chris@1 78 float maxerr;
Chris@1 79
Chris@1 80 float twofitweight;
Chris@1 81 float twofitatten;
Chris@1 82
Chris@1 83 int n;
Chris@1 84
Chris@1 85 } vorbis_info_floor1;
Chris@1 86
Chris@1 87 /* Residue backend generic *****************************************/
Chris@1 88 typedef struct{
Chris@1 89 void (*pack) (vorbis_info_residue *,oggpack_buffer *);
Chris@1 90 vorbis_info_residue *(*unpack)(vorbis_info *,oggpack_buffer *);
Chris@1 91 vorbis_look_residue *(*look) (vorbis_dsp_state *,
Chris@1 92 vorbis_info_residue *);
Chris@1 93 void (*free_info) (vorbis_info_residue *);
Chris@1 94 void (*free_look) (vorbis_look_residue *);
Chris@1 95 long **(*class) (struct vorbis_block *,vorbis_look_residue *,
Chris@1 96 int **,int *,int);
Chris@1 97 int (*forward) (oggpack_buffer *,struct vorbis_block *,
Chris@1 98 vorbis_look_residue *,
Chris@1 99 int **,int *,int,long **,int);
Chris@1 100 int (*inverse) (struct vorbis_block *,vorbis_look_residue *,
Chris@1 101 float **,int *,int);
Chris@1 102 } vorbis_func_residue;
Chris@1 103
Chris@1 104 typedef struct vorbis_info_residue0{
Chris@1 105 /* block-partitioned VQ coded straight residue */
Chris@1 106 long begin;
Chris@1 107 long end;
Chris@1 108
Chris@1 109 /* first stage (lossless partitioning) */
Chris@1 110 int grouping; /* group n vectors per partition */
Chris@1 111 int partitions; /* possible codebooks for a partition */
Chris@1 112 int partvals; /* partitions ^ groupbook dim */
Chris@1 113 int groupbook; /* huffbook for partitioning */
Chris@1 114 int secondstages[64]; /* expanded out to pointers in lookup */
Chris@1 115 int booklist[512]; /* list of second stage books */
Chris@1 116
Chris@1 117 const int classmetric1[64];
Chris@1 118 const int classmetric2[64];
Chris@1 119 } vorbis_info_residue0;
Chris@1 120
Chris@1 121 /* Mapping backend generic *****************************************/
Chris@1 122 typedef struct{
Chris@1 123 void (*pack) (vorbis_info *,vorbis_info_mapping *,
Chris@1 124 oggpack_buffer *);
Chris@1 125 vorbis_info_mapping *(*unpack)(vorbis_info *,oggpack_buffer *);
Chris@1 126 void (*free_info) (vorbis_info_mapping *);
Chris@1 127 int (*forward) (struct vorbis_block *vb);
Chris@1 128 int (*inverse) (struct vorbis_block *vb,vorbis_info_mapping *);
Chris@1 129 } vorbis_func_mapping;
Chris@1 130
Chris@1 131 typedef struct vorbis_info_mapping0{
Chris@1 132 int submaps; /* <= 16 */
Chris@1 133 int chmuxlist[256]; /* up to 256 channels in a Vorbis stream */
Chris@1 134
Chris@1 135 int floorsubmap[16]; /* [mux] submap to floors */
Chris@1 136 int residuesubmap[16]; /* [mux] submap to residue */
Chris@1 137
Chris@1 138 int coupling_steps;
Chris@1 139 int coupling_mag[256];
Chris@1 140 int coupling_ang[256];
Chris@1 141
Chris@1 142 } vorbis_info_mapping0;
Chris@1 143
Chris@1 144 #endif