summaryrefslogtreecommitdiff
path: root/apps/codecs/libatrac/atrac3.h
diff options
context:
space:
mode:
authorMohamed Tarek <mt@rockbox.org>2009-08-14 08:24:39 +0000
committerMohamed Tarek <mt@rockbox.org>2009-08-14 08:24:39 +0000
commit0b6aa3851631eacba413d965f931f59cc8e37773 (patch)
treea21580e6bc4ecfb8524c42e7517bc27bf19f53e6 /apps/codecs/libatrac/atrac3.h
parentebd67b1c6f06b93235700bfef0011b331669ee2f (diff)
downloadrockbox-0b6aa3851631eacba413d965f931f59cc8e37773.tar.gz
rockbox-0b6aa3851631eacba413d965f931f59cc8e37773.zip
Move main() outside atrac3.c and create atrac3.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22307 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libatrac/atrac3.h')
-rw-r--r--apps/codecs/libatrac/atrac3.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/apps/codecs/libatrac/atrac3.h b/apps/codecs/libatrac/atrac3.h
new file mode 100644
index 0000000000..e4121d7b4e
--- /dev/null
+++ b/apps/codecs/libatrac/atrac3.h
@@ -0,0 +1,80 @@
1#include "bitstream.h"
2#include "../librm/rm.h"
3
4/* These structures are needed to store the parsed gain control data. */
5typedef struct {
6 int num_gain_data;
7 int levcode[8];
8 int loccode[8];
9} gain_info;
10
11typedef struct {
12 gain_info gBlock[4];
13} gain_block;
14
15typedef struct {
16 int pos;
17 int numCoefs;
18 int32_t coef[8];
19} tonal_component;
20
21typedef struct {
22 int bandsCoded;
23 int numComponents;
24 tonal_component components[64];
25 int32_t prevFrame[1024];
26 int gcBlkSwitch;
27 gain_block gainBlock[2];
28
29 int32_t spectrum[1024] __attribute__((aligned(16)));
30 int32_t IMDCT_buf[1024] __attribute__((aligned(16)));
31
32 int32_t delayBuf1[46]; ///<qmf delay buffers
33 int32_t delayBuf2[46];
34 int32_t delayBuf3[46];
35} channel_unit;
36
37typedef struct {
38 GetBitContext gb;
39 //@{
40 /** stream data */
41 int channels;
42 int codingMode;
43 int bit_rate;
44 int sample_rate;
45 int samples_per_channel;
46 int samples_per_frame;
47
48 int bits_per_frame;
49 int bytes_per_frame;
50 int pBs;
51 channel_unit* pUnits;
52 //@}
53 //@{
54 /** joint-stereo related variables */
55 int matrix_coeff_index_prev[4];
56 int matrix_coeff_index_now[4];
57 int matrix_coeff_index_next[4];
58 int weighting_delay[6];
59 //@}
60 //@{
61 /** data buffers */
62 int32_t outSamples[2048];
63 uint8_t decoded_bytes_buffer[1024];
64 int32_t tempBuf[1070];
65 //@}
66 //@{
67 /** extradata */
68 int atrac3version;
69 int delay;
70 int scrambled_stream;
71 int frame_factor;
72 //@}
73} ATRAC3Context;
74
75int atrac3_decode_init(ATRAC3Context *q, RMContext *rmctx);
76
77int atrac3_decode_frame(RMContext *rmctx, ATRAC3Context *q,
78 void *data, int *data_size,
79 const uint8_t *buf, int buf_size);
80