* Onda VX747: add browse screen, pitchscreen, context menu, quickscreen, rewind...
[kugel-rb.git] / apps / codecs / libalac / decomp.h
blobe4a19a72526febcdf7be7be50bd6dc5c15b393f7
1 #ifndef __ALAC__DECOMP_H
2 #define __ALAC__DECOMP_H
4 #ifndef ICODE_ATTR_ALAC
5 #define ICODE_ATTR_ALAC ICODE_ATTR
6 #endif
8 /* Always output samples shifted to 28 bits + sign*/
9 #define ALAC_OUTPUT_DEPTH 29
10 #define SCALE16 (ALAC_OUTPUT_DEPTH - 16)
11 #define ALAC_MAX_CHANNELS 2
12 #define ALAC_BLOCKSIZE 4096 /* Number of samples per channel per block */
14 typedef struct
16 unsigned char *input_buffer;
17 int input_buffer_bitaccumulator; /* used so we can do arbitary
18 bit reads */
19 int samplesize;
20 int numchannels;
21 int bytespersample;
23 /* stuff from setinfo */
24 uint32_t setinfo_max_samples_per_frame; /* 0x1000 = 4096 */ /* max samples per frame? */
25 uint8_t setinfo_7a; /* 0x00 */
26 uint8_t setinfo_sample_size; /* 0x10 */
27 uint8_t setinfo_rice_historymult; /* 0x28 */
28 uint8_t setinfo_rice_initialhistory; /* 0x0a */
29 uint8_t setinfo_rice_kmodifier; /* 0x0e */
30 uint8_t setinfo_7f; /* 0x02 */
31 uint16_t setinfo_80; /* 0x00ff */
32 uint32_t setinfo_82; /* 0x000020e7 */
33 uint32_t setinfo_86; /* 0x00069fe4 */
34 uint32_t setinfo_8a_rate; /* 0x0000ac44 */
35 /* end setinfo stuff */
36 } alac_file;
38 void create_alac(int samplesize, int numchannels, alac_file* alac)
39 ICODE_ATTR_ALAC;
40 int alac_decode_frame(alac_file *alac,
41 unsigned char *inbuffer,
42 int32_t outputbuffer[ALAC_MAX_CHANNELS][ALAC_BLOCKSIZE],
43 void (*yield)(void)) ICODE_ATTR_ALAC;
44 void alac_set_info(alac_file *alac, char *inputbuffer) ICODE_ATTR_ALAC;
46 #endif /* __ALAC__DECOMP_H */