FS#10785: Add new context CONTEXT_MORSE_INPUT for keymaps which is used during morse...
[kugel-rb.git] / apps / codecs / libatrac / atrac3.h
bloba817db2b559a26a35810c6bcbe6839cee03b902a
1 #include "ffmpeg_bitstream.h"
2 #include "../librm/rm.h"
4 #if (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024) || (CONFIG_CPU == MCF5250)
5 /* PP5022/24 and MCF5250 have larger IRAM */
6 #define IBSS_ATTR_LARGE_IRAM IBSS_ATTR
7 #else
8 /* other CPUs IRAM is not large enough */
9 #define IBSS_ATTR_LARGE_IRAM
10 #endif
12 /* These structures are needed to store the parsed gain control data. */
13 typedef struct {
14 int num_gain_data;
15 int levcode[8];
16 int loccode[8];
17 } gain_info;
19 typedef struct {
20 gain_info gBlock[4];
21 } gain_block;
23 typedef struct {
24 int pos;
25 int numCoefs;
26 int32_t coef[8];
27 } tonal_component;
29 typedef struct {
30 int bandsCoded;
31 int numComponents;
32 tonal_component components[64];
33 int32_t prevFrame[1024];
34 int gcBlkSwitch;
35 gain_block gainBlock[2];
37 int32_t spectrum[1024] __attribute__((aligned(16)));
38 int32_t IMDCT_buf[1024] __attribute__((aligned(16)));
40 int32_t delayBuf1[46]; ///<qmf delay buffers
41 int32_t delayBuf2[46];
42 int32_t delayBuf3[46];
43 } channel_unit;
45 typedef struct {
46 GetBitContext gb;
47 //@{
48 /** stream data */
49 int channels;
50 int codingMode;
51 int bit_rate;
52 int sample_rate;
53 int samples_per_channel;
54 int samples_per_frame;
56 int bits_per_frame;
57 int bytes_per_frame;
58 int pBs;
59 channel_unit* pUnits;
60 //@}
61 //@{
62 /** joint-stereo related variables */
63 int matrix_coeff_index_prev[4];
64 int matrix_coeff_index_now[4];
65 int matrix_coeff_index_next[4];
66 int weighting_delay[6];
67 //@}
68 //@{
69 /** data buffers */
70 int32_t outSamples[2048];
71 uint8_t decoded_bytes_buffer[1024];
72 int32_t tempBuf[1070];
73 //@}
74 //@{
75 /** extradata */
76 int atrac3version;
77 int delay;
78 int scrambled_stream;
79 int frame_factor;
80 //@}
81 } ATRAC3Context;
83 int atrac3_decode_init(ATRAC3Context *q, RMContext *rmctx);
85 int atrac3_decode_frame(RMContext *rmctx, ATRAC3Context *q,
86 int *data_size, const uint8_t *buf, int buf_size);