annotate libac3/ac3.h @ 2:2e2c46c87460 libavcodec

fixed config for direct mplayer build compatibility
author glantau
date Mon, 23 Jul 2001 20:06:54 +0000
parents 986e461dc072
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
1 /*
986e461dc072 Initial revision
glantau
parents:
diff changeset
2 * ac3.h
986e461dc072 Initial revision
glantau
parents:
diff changeset
3 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
4 * Copyright (C) Aaron Holtzman - May 1999
986e461dc072 Initial revision
glantau
parents:
diff changeset
5 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
6 * This file is part of ac3dec, a free Dolby AC-3 stream decoder.
986e461dc072 Initial revision
glantau
parents:
diff changeset
7 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
8 * ac3dec is free software; you can redistribute it and/or modify
986e461dc072 Initial revision
glantau
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
986e461dc072 Initial revision
glantau
parents:
diff changeset
10 * the Free Software Foundation; either version 2, or (at your option)
986e461dc072 Initial revision
glantau
parents:
diff changeset
11 * any later version.
986e461dc072 Initial revision
glantau
parents:
diff changeset
12 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
13 * ac3dec is distributed in the hope that it will be useful,
986e461dc072 Initial revision
glantau
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
986e461dc072 Initial revision
glantau
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
986e461dc072 Initial revision
glantau
parents:
diff changeset
16 * GNU General Public License for more details.
986e461dc072 Initial revision
glantau
parents:
diff changeset
17 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
986e461dc072 Initial revision
glantau
parents:
diff changeset
19 * along with GNU Make; see the file COPYING. If not, write to
986e461dc072 Initial revision
glantau
parents:
diff changeset
20 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
986e461dc072 Initial revision
glantau
parents:
diff changeset
21 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
22 *
986e461dc072 Initial revision
glantau
parents:
diff changeset
23 */
986e461dc072 Initial revision
glantau
parents:
diff changeset
24
986e461dc072 Initial revision
glantau
parents:
diff changeset
25 typedef struct ac3_ba_s {
986e461dc072 Initial revision
glantau
parents:
diff changeset
26 uint16_t fsnroffst; // fine SNR offset
986e461dc072 Initial revision
glantau
parents:
diff changeset
27 uint16_t fgaincod; // fast gain
986e461dc072 Initial revision
glantau
parents:
diff changeset
28 uint16_t deltbae; // delta bit allocation exists
986e461dc072 Initial revision
glantau
parents:
diff changeset
29 int8_t deltba[50]; // per-band delta bit allocation
986e461dc072 Initial revision
glantau
parents:
diff changeset
30 } ac3_ba_t;
986e461dc072 Initial revision
glantau
parents:
diff changeset
31
986e461dc072 Initial revision
glantau
parents:
diff changeset
32 typedef struct ac3_state_s {
986e461dc072 Initial revision
glantau
parents:
diff changeset
33 uint8_t fscod; // sample rate
986e461dc072 Initial revision
glantau
parents:
diff changeset
34 uint8_t halfrate; // halfrate factor
986e461dc072 Initial revision
glantau
parents:
diff changeset
35 uint8_t acmod; // coded channels
986e461dc072 Initial revision
glantau
parents:
diff changeset
36 float clev; // centre channel mix level
986e461dc072 Initial revision
glantau
parents:
diff changeset
37 float slev; // surround channels mix level
986e461dc072 Initial revision
glantau
parents:
diff changeset
38 uint8_t lfeon; // coded lfe channel
986e461dc072 Initial revision
glantau
parents:
diff changeset
39
986e461dc072 Initial revision
glantau
parents:
diff changeset
40 int output; // type of output
986e461dc072 Initial revision
glantau
parents:
diff changeset
41 float level; // output level
986e461dc072 Initial revision
glantau
parents:
diff changeset
42 float bias; // output bias
986e461dc072 Initial revision
glantau
parents:
diff changeset
43
986e461dc072 Initial revision
glantau
parents:
diff changeset
44 uint16_t cplinu; // coupling in use
986e461dc072 Initial revision
glantau
parents:
diff changeset
45 uint16_t chincpl[5]; // channel coupled
986e461dc072 Initial revision
glantau
parents:
diff changeset
46 uint16_t phsflginu; // phase flags in use (stereo only)
986e461dc072 Initial revision
glantau
parents:
diff changeset
47 uint16_t cplbndstrc[18]; // coupling band structure
986e461dc072 Initial revision
glantau
parents:
diff changeset
48 uint16_t cplstrtmant; // coupling channel start mantissa
986e461dc072 Initial revision
glantau
parents:
diff changeset
49 uint16_t cplendmant; // coupling channel end mantissa
986e461dc072 Initial revision
glantau
parents:
diff changeset
50 float cplco[5][18]; // coupling coordinates
986e461dc072 Initial revision
glantau
parents:
diff changeset
51
986e461dc072 Initial revision
glantau
parents:
diff changeset
52 // derived information
986e461dc072 Initial revision
glantau
parents:
diff changeset
53 uint16_t cplstrtbnd; // coupling start band (for bit allocation)
986e461dc072 Initial revision
glantau
parents:
diff changeset
54 uint16_t ncplbnd; // number of coupling bands
986e461dc072 Initial revision
glantau
parents:
diff changeset
55
986e461dc072 Initial revision
glantau
parents:
diff changeset
56 uint16_t rematflg[4]; // stereo rematrixing
986e461dc072 Initial revision
glantau
parents:
diff changeset
57
986e461dc072 Initial revision
glantau
parents:
diff changeset
58 uint16_t endmant[5]; // channel end mantissa
986e461dc072 Initial revision
glantau
parents:
diff changeset
59
986e461dc072 Initial revision
glantau
parents:
diff changeset
60 uint8_t cpl_exp[256]; // decoded coupling channel exponents
986e461dc072 Initial revision
glantau
parents:
diff changeset
61 uint8_t fbw_exp[5][256]; // decoded channel exponents
986e461dc072 Initial revision
glantau
parents:
diff changeset
62 uint8_t lfe_exp[7]; // decoded lfe channel exponents
986e461dc072 Initial revision
glantau
parents:
diff changeset
63
986e461dc072 Initial revision
glantau
parents:
diff changeset
64 uint16_t sdcycod; // slow decay
986e461dc072 Initial revision
glantau
parents:
diff changeset
65 uint16_t fdcycod; // fast decay
986e461dc072 Initial revision
glantau
parents:
diff changeset
66 uint16_t sgaincod; // slow gain
986e461dc072 Initial revision
glantau
parents:
diff changeset
67 uint16_t dbpbcod; // dB per bit - encodes the dbknee value
986e461dc072 Initial revision
glantau
parents:
diff changeset
68 uint16_t floorcod; // masking floor
986e461dc072 Initial revision
glantau
parents:
diff changeset
69
986e461dc072 Initial revision
glantau
parents:
diff changeset
70 uint16_t csnroffst; // coarse SNR offset
986e461dc072 Initial revision
glantau
parents:
diff changeset
71 ac3_ba_t cplba; // coupling bit allocation parameters
986e461dc072 Initial revision
glantau
parents:
diff changeset
72 ac3_ba_t ba[5]; // channel bit allocation parameters
986e461dc072 Initial revision
glantau
parents:
diff changeset
73 ac3_ba_t lfeba; // lfe bit allocation parameters
986e461dc072 Initial revision
glantau
parents:
diff changeset
74
986e461dc072 Initial revision
glantau
parents:
diff changeset
75 uint16_t cplfleak; // coupling fast leak init
986e461dc072 Initial revision
glantau
parents:
diff changeset
76 uint16_t cplsleak; // coupling slow leak init
986e461dc072 Initial revision
glantau
parents:
diff changeset
77
986e461dc072 Initial revision
glantau
parents:
diff changeset
78 // derived bit allocation information
986e461dc072 Initial revision
glantau
parents:
diff changeset
79 int8_t fbw_bap[5][256];
986e461dc072 Initial revision
glantau
parents:
diff changeset
80 int8_t cpl_bap[256];
986e461dc072 Initial revision
glantau
parents:
diff changeset
81 int8_t lfe_bap[7];
986e461dc072 Initial revision
glantau
parents:
diff changeset
82 } ac3_state_t;
986e461dc072 Initial revision
glantau
parents:
diff changeset
83
986e461dc072 Initial revision
glantau
parents:
diff changeset
84 /* samples work structure */
986e461dc072 Initial revision
glantau
parents:
diff changeset
85 typedef float stream_samples_t[6][256];
986e461dc072 Initial revision
glantau
parents:
diff changeset
86
986e461dc072 Initial revision
glantau
parents:
diff changeset
87 #define AC3_CHANNEL 0
986e461dc072 Initial revision
glantau
parents:
diff changeset
88 #define AC3_MONO 1
986e461dc072 Initial revision
glantau
parents:
diff changeset
89 #define AC3_STEREO 2
986e461dc072 Initial revision
glantau
parents:
diff changeset
90 #define AC3_3F 3
986e461dc072 Initial revision
glantau
parents:
diff changeset
91 #define AC3_2F1R 4
986e461dc072 Initial revision
glantau
parents:
diff changeset
92 #define AC3_3F1R 5
986e461dc072 Initial revision
glantau
parents:
diff changeset
93 #define AC3_2F2R 6
986e461dc072 Initial revision
glantau
parents:
diff changeset
94 #define AC3_3F2R 7
986e461dc072 Initial revision
glantau
parents:
diff changeset
95 #define AC3_CHANNEL1 8
986e461dc072 Initial revision
glantau
parents:
diff changeset
96 #define AC3_CHANNEL2 9
986e461dc072 Initial revision
glantau
parents:
diff changeset
97 #define AC3_DOLBY 10
986e461dc072 Initial revision
glantau
parents:
diff changeset
98 #define AC3_CHANNEL_MASK 15
986e461dc072 Initial revision
glantau
parents:
diff changeset
99
986e461dc072 Initial revision
glantau
parents:
diff changeset
100 #define AC3_LFE 16
986e461dc072 Initial revision
glantau
parents:
diff changeset
101 #define AC3_ADJUST_LEVEL 32
986e461dc072 Initial revision
glantau
parents:
diff changeset
102
986e461dc072 Initial revision
glantau
parents:
diff changeset
103 void ac3_init (void);
986e461dc072 Initial revision
glantau
parents:
diff changeset
104 int ac3_syncinfo (uint8_t * buf, int * flags,
986e461dc072 Initial revision
glantau
parents:
diff changeset
105 int * sample_rate, int * bit_rate);
986e461dc072 Initial revision
glantau
parents:
diff changeset
106 int ac3_frame (ac3_state_t * state, uint8_t * buf, int * flags,
986e461dc072 Initial revision
glantau
parents:
diff changeset
107 float * level, float bias);
986e461dc072 Initial revision
glantau
parents:
diff changeset
108 int ac3_block (ac3_state_t * state);