summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/libmpeg3/audio/mpeg3audio.h
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/libmpeg3/audio/mpeg3audio.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/libmpeg3/audio/mpeg3audio.h144
1 files changed, 144 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/libmpeg3/audio/mpeg3audio.h b/core/multimedia/opieplayer/libmpeg3/audio/mpeg3audio.h
new file mode 100644
index 0000000..2117be7
--- a/dev/null
+++ b/core/multimedia/opieplayer/libmpeg3/audio/mpeg3audio.h
@@ -0,0 +1,144 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#ifndef MPEG3AUDIO_H
21#define MPEG3AUDIO_H
22
23#include "ac3.h"
24#include "../bitstream.h"
25typedef struct mpeg3_atrack_rec mpeg3_atrack_t;
26
27#define MAXFRAMESIZE 1792
28#define HDRCMPMASK 0xfffffd00
29#define SBLIMIT 32
30#define SSLIMIT 18
31#define SCALE_BLOCK 12
32#define MPEG3AUDIO_PADDING 1024
33
34/* Values for mode */
35 #define MPG_MD_STEREO 0
36 #define MPG_MD_JOINT_STEREO 1
37 #define MPG_MD_DUAL_CHANNEL 2
38 #define MPG_MD_MONO 3
39
40/* IMDCT variables */
41typedef struct
42{
43 mpeg3_real_t real;
44 mpeg3_real_t imag;
45} mpeg3_complex_t;
46
47#define AC3_N 512
48
49struct al_table
50{
51 short bits;
52 short d;
53};
54
55typedef struct
56{
57 struct mpeg3_rec* file;
58 mpeg3_atrack_t* track;
59 mpeg3_bits_t *astream;
60
61/* In order of importance */
62 int format; /* format of audio */
63 int layer; /* layer if mpeg */
64 int channels;
65 long outscale;
66 long framenum;
67 long prev_framesize;
68 long framesize; /* For mp3 current framesize without header. For AC3 current framesize with header. */
69 int avg_framesize; /* Includes the 4 byte header */
70 mpeg3_real_t *pcm_sample; /* Interlaced output from synthesizer in floats */
71 int pcm_point; /* Float offset in pcm_sample to write to */
72 long pcm_position; /* Sample start of pcm_samples in file */
73 long pcm_size; /* Number of pcm samples in the buffer */
74 long pcm_allocated; /* Allocated number of samples in pcm_samples */
75 int sample_seek;
76 double percentage_seek;
77 unsigned long oldhead;
78 unsigned long newhead;
79 unsigned long firsthead;
80 int bsnum;
81 int lsf;
82 int mpeg35;
83 int sampling_frequency_code;
84 int bitrate_index;
85 int bitrate;
86 int samples_per_frame;
87 int padding;
88 int extension;
89 int mode;
90 int mode_ext;
91 int copyright;
92 int original;
93 int emphasis;
94 int error_protection;
95
96/* Back step buffers for mp3 */
97 unsigned char bsspace[2][MAXFRAMESIZE + 512]; /* MAXFRAMESIZE */
98 unsigned char *bsbuf, *bsbufold;
99 long ssize;
100 int init;
101 int single;
102 struct al_table *alloc;
103 int II_sblimit;
104 int jsbound;
105 int bo; /* Static variable in synthesizer */
106
107/* MP3 Static arrays here */
108 mpeg3_real_t synth_stereo_buffs[2][2][0x110];
109 mpeg3_real_t synth_mono_buff[64];
110 unsigned int layer2_scfsi_buf[64];
111
112 mpeg3_real_t mp3_block[2][2][SBLIMIT * SSLIMIT];
113 int mp3_blc[2];
114
115/* AC3 specific stuff. AC3 also shares objects with MPEG */
116 unsigned int ac3_framesize_code;
117 mpeg3_ac3bsi_t ac3_bsi;
118 mpeg3_ac3audblk_t ac3_audblk;
119 mpeg3_ac3_bitallocation_t ac3_bit_allocation;
120 mpeg3_ac3_mantissa_t ac3_mantissa;
121 mpeg3_complex_t ac3_imdct_buf[AC3_N / 4];
122
123/* Delay buffer for DCT interleaving */
124 mpeg3_real_t ac3_delay[6][AC3_N / 2];
125/* Twiddle factor LUT */
126 mpeg3_complex_t *ac3_w[7];
127#if !defined(USE_FIXED_POINT) || defined(PRINT_FIXED_POINT_TABLES)
128 /* Just for allocated memory */
129 mpeg3_complex_t ac3_w_1[1];
130 mpeg3_complex_t ac3_w_2[2];
131 mpeg3_complex_t ac3_w_4[4];
132 mpeg3_complex_t ac3_w_8[8];
133 mpeg3_complex_t ac3_w_16[16];
134 mpeg3_complex_t ac3_w_32[32];
135 mpeg3_complex_t ac3_w_64[64];
136#endif
137 int ac3_lfsr_state;
138 unsigned char ac3_buffer[MAX_AC3_FRAMESIZE];
139 mpeg3ac3_stream_samples_t ac3_samples;
140} mpeg3audio_t;
141
142
143
144#endif