media/libtremor/lib/backends.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /********************************************************************
michael@0 2 * *
michael@0 3 * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
michael@0 4 * *
michael@0 5 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
michael@0 6 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
michael@0 7 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
michael@0 8 * *
michael@0 9 * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
michael@0 10 * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
michael@0 11 * *
michael@0 12 ********************************************************************
michael@0 13
michael@0 14 function: backend and mapping structures
michael@0 15
michael@0 16 ********************************************************************/
michael@0 17
michael@0 18 /* this is exposed up here because we need it for static modes.
michael@0 19 Lookups for each backend aren't exposed because there's no reason
michael@0 20 to do so */
michael@0 21
michael@0 22 #ifndef _vorbis_backend_h_
michael@0 23 #define _vorbis_backend_h_
michael@0 24
michael@0 25 #include "codec_internal.h"
michael@0 26
michael@0 27 /* this would all be simpler/shorter with templates, but.... */
michael@0 28 /* Transform backend generic *************************************/
michael@0 29
michael@0 30 /* only mdct right now. Flesh it out more if we ever transcend mdct
michael@0 31 in the transform domain */
michael@0 32
michael@0 33 /* Floor backend generic *****************************************/
michael@0 34 typedef struct{
michael@0 35 vorbis_info_floor *(*unpack)(vorbis_info *,oggpack_buffer *);
michael@0 36 vorbis_look_floor *(*look) (vorbis_dsp_state *,vorbis_info_mode *,
michael@0 37 vorbis_info_floor *);
michael@0 38 void (*free_info) (vorbis_info_floor *);
michael@0 39 void (*free_look) (vorbis_look_floor *);
michael@0 40 void *(*inverse1) (struct vorbis_block *,vorbis_look_floor *);
michael@0 41 int (*inverse2) (struct vorbis_block *,vorbis_look_floor *,
michael@0 42 void *buffer,ogg_int32_t *);
michael@0 43 } vorbis_func_floor;
michael@0 44
michael@0 45 typedef struct{
michael@0 46 int order;
michael@0 47 long rate;
michael@0 48 long barkmap;
michael@0 49
michael@0 50 int ampbits;
michael@0 51 int ampdB;
michael@0 52
michael@0 53 int numbooks; /* <= 16 */
michael@0 54 int books[16];
michael@0 55
michael@0 56 } vorbis_info_floor0;
michael@0 57
michael@0 58 #define VIF_POSIT 63
michael@0 59 #define VIF_CLASS 16
michael@0 60 #define VIF_PARTS 31
michael@0 61 typedef struct{
michael@0 62 int partitions; /* 0 to 31 */
michael@0 63 int partitionclass[VIF_PARTS]; /* 0 to 15 */
michael@0 64
michael@0 65 int class_dim[VIF_CLASS]; /* 1 to 8 */
michael@0 66 int class_subs[VIF_CLASS]; /* 0,1,2,3 (bits: 1<<n poss) */
michael@0 67 int class_book[VIF_CLASS]; /* subs ^ dim entries */
michael@0 68 int class_subbook[VIF_CLASS][8]; /* [VIF_CLASS][subs] */
michael@0 69
michael@0 70
michael@0 71 int mult; /* 1 2 3 or 4 */
michael@0 72 int postlist[VIF_POSIT+2]; /* first two implicit */
michael@0 73
michael@0 74 } vorbis_info_floor1;
michael@0 75
michael@0 76 /* Residue backend generic *****************************************/
michael@0 77 typedef struct{
michael@0 78 vorbis_info_residue *(*unpack)(vorbis_info *,oggpack_buffer *);
michael@0 79 vorbis_look_residue *(*look) (vorbis_dsp_state *,vorbis_info_mode *,
michael@0 80 vorbis_info_residue *);
michael@0 81 void (*free_info) (vorbis_info_residue *);
michael@0 82 void (*free_look) (vorbis_look_residue *);
michael@0 83 int (*inverse) (struct vorbis_block *,vorbis_look_residue *,
michael@0 84 ogg_int32_t **,int *,int);
michael@0 85 } vorbis_func_residue;
michael@0 86
michael@0 87 typedef struct vorbis_info_residue0{
michael@0 88 /* block-partitioned VQ coded straight residue */
michael@0 89 long begin;
michael@0 90 long end;
michael@0 91
michael@0 92 /* first stage (lossless partitioning) */
michael@0 93 int grouping; /* group n vectors per partition */
michael@0 94 int partitions; /* possible codebooks for a partition */
michael@0 95 int partvals; /* partitions ^ groupbook dim */
michael@0 96 int groupbook; /* huffbook for partitioning */
michael@0 97 int secondstages[64]; /* expanded out to pointers in lookup */
michael@0 98 int booklist[512]; /* list of second stage books */
michael@0 99 } vorbis_info_residue0;
michael@0 100
michael@0 101 /* Mapping backend generic *****************************************/
michael@0 102 typedef struct{
michael@0 103 vorbis_info_mapping *(*unpack)(vorbis_info *,oggpack_buffer *);
michael@0 104 vorbis_look_mapping *(*look) (vorbis_dsp_state *,vorbis_info_mode *,
michael@0 105 vorbis_info_mapping *);
michael@0 106 void (*free_info) (vorbis_info_mapping *);
michael@0 107 void (*free_look) (vorbis_look_mapping *);
michael@0 108 int (*inverse) (struct vorbis_block *vb,vorbis_look_mapping *);
michael@0 109 } vorbis_func_mapping;
michael@0 110
michael@0 111 typedef struct vorbis_info_mapping0{
michael@0 112 int submaps; /* <= 16 */
michael@0 113 int chmuxlist[256]; /* up to 256 channels in a Vorbis stream */
michael@0 114
michael@0 115 int floorsubmap[16]; /* [mux] submap to floors */
michael@0 116 int residuesubmap[16]; /* [mux] submap to residue */
michael@0 117
michael@0 118 int psy[2]; /* by blocktype; impulse/padding for short,
michael@0 119 transition/normal for long */
michael@0 120
michael@0 121 int coupling_steps;
michael@0 122 int coupling_mag[256];
michael@0 123 int coupling_ang[256];
michael@0 124 } vorbis_info_mapping0;
michael@0 125
michael@0 126 #endif
michael@0 127
michael@0 128
michael@0 129
michael@0 130
michael@0 131

mercurial