blob: 00f06e8bd353e76754cab83774d9537b17785cfe (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
/*************************************************************************** *
* MPEG Layer3-Audio Decoder
* © 1997-2006 by Fraunhofer IIS
* All Rights Reserved
*
* filename: mpeg.h
* project : ISO/MPEG-Decoder
* author : Markus Werner, addings: Martin Sieler
* date : 1995-07-07
* contents/description: HEADER - iso/mpeg-definitions
*
*
\***************************************************************************/
/*
* $Date: 2011/01/20 22:14:40 $
* $Id: mpeg.h,v 1.3 2011/01/20 22:14:40 audiodsp Exp $
*/
/*-------------------------------------------------------------------------*/
#ifndef __MPEG_H__
#define __MPEG_H__
#include "foundation/align.h"
/* ------------------------ includes --------------------------------------*/
/* ------------------------------------------------------------------------*/
//
// MPEG ID (fhgVersion)
//
#define MPG_MPEG1 1
#define MPG_MPEG2 0
#define MPG_MPEG25 2
/* ------------------------------------------------------------------------*/
//
// sample rate
//
#define MPG_SF_LOW 2
/* ------------------------------------------------------------------------*/
//
// header-mode field
//
#define MPG_MD_STEREO 0
#define MPG_MD_JOINT_STEREO 1
#define MPG_MD_DUAL_CHANNEL 2
#define MPG_MD_MONO 3
/*-------------------------------------------------------------------------*/
//
// channels
//
#define MONO 1
#define STEREO 2
/* ------------------------------------------------------------------------*/
//
// subbands, samples/subband
//
#define SBLIMIT 32
#define SSLIMIT 18
/* ------------------------------------------------------------------------*/
//
// info structure
//
typedef struct
{
int stereo;
int sample_rate_ndx;
int frame_bits;
int mode;
int mode_ext;
int header_size;
int fhgVersion;
int protection;
bool IsMpeg1;
} MPEG_INFO;
/* ------------------------------------------------------------------------*/
//
// MPEG Layer-3 sideinfo (per channel/granule)
//
typedef struct
{
int part2_3_length;
int big_values;
int global_gain;
int scalefac_compress;
int window_switching_flag;
int block_type;
int mixed_block_flag;
int table_select[3];
int subblock_gain[3];
int region0_count;
int region1_count;
int preflag;
int scalefac_scale;
int count1table_select;
// additional calced values
int intensity_scale; // MPEG 2, MPEG 2.5 only
int zeroStartNdx;
int zeroSfbStartNdxIsLong;
int zeroSfbStartNdxL;
int zeroSfbStartNdxSMax;
int zeroSfbStartNdxS[3];
int zeroSbStartNdx;
} MP3SI_GRCH;
/* ------------------------------------------------------------------------*/
//
// MPEG Layer-3 sideinfo
//
typedef struct
{
int main_data_begin;
int private_bits;
struct
{
int scfsi[4];
MP3SI_GRCH gr[2];
} ch[2];
} MP3SI;
/* ------------------------------------------------------------------------*/
//
// MPEG Layer-3 scalefactors
//
typedef struct
{
// scalefactors
int l[23];
int s[3][13];
// illegal intensity position
int l_iip[23];
int s_iip[13];
} MP3SCF;
/* ------------------------------------------------------------------------*/
//
// spectrum (as transmitted)
//
typedef NALIGN(16) float SPECTRUM[2][SBLIMIT][SSLIMIT];
//
// spectrum (after mdct)
//
typedef NALIGN(16) float POLYSPECTRUM[2][SSLIMIT][SBLIMIT];
/* Nullsoft added 25 Oct 2007 */
struct DecoderHooks
{
void (*layer3_vis)(SPECTRUM vistable,int gr, int nch);
void (*layer2_eq)(float *xr, int nch, int srate, int nparts);
void (*layer3_eq)(float *xr, int nch, int srate);
};
/* ------------------------------------------------------------------------*/
#endif
|