2005-09-22 18:47:04 +00:00
|
|
|
#ifndef __ALAC__DECOMP_H
|
|
|
|
#define __ALAC__DECOMP_H
|
|
|
|
|
2006-11-09 21:59:27 +00:00
|
|
|
#ifndef ICODE_ATTR_ALAC
|
|
|
|
#define ICODE_ATTR_ALAC ICODE_ATTR
|
|
|
|
#endif
|
|
|
|
|
2006-02-13 19:26:18 +00:00
|
|
|
/* Always output samples shifted to 28 bits + sign*/
|
|
|
|
#define ALAC_OUTPUT_DEPTH 29
|
2005-10-28 00:11:28 +00:00
|
|
|
#define SCALE16 (ALAC_OUTPUT_DEPTH - 16)
|
2010-02-03 00:37:24 +00:00
|
|
|
#define SCALE24 (ALAC_OUTPUT_DEPTH - 24)
|
2005-10-28 00:11:28 +00:00
|
|
|
#define ALAC_MAX_CHANNELS 2
|
|
|
|
#define ALAC_BLOCKSIZE 4096 /* Number of samples per channel per block */
|
|
|
|
|
2005-09-22 20:46:58 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
unsigned char *input_buffer;
|
|
|
|
int input_buffer_bitaccumulator; /* used so we can do arbitary
|
|
|
|
bit reads */
|
2011-06-02 14:59:15 +00:00
|
|
|
|
|
|
|
/* rockbox: not used
|
2005-09-22 20:46:58 +00:00
|
|
|
int samplesize;
|
|
|
|
int numchannels;
|
2011-06-02 14:59:15 +00:00
|
|
|
int bytespersample; */
|
|
|
|
|
2011-04-16 19:08:50 +00:00
|
|
|
int bytes_consumed;
|
2005-09-22 18:47:04 +00:00
|
|
|
|
2005-09-22 20:46:58 +00:00
|
|
|
/* stuff from setinfo */
|
|
|
|
uint32_t setinfo_max_samples_per_frame; /* 0x1000 = 4096 */ /* max samples per frame? */
|
|
|
|
uint8_t setinfo_7a; /* 0x00 */
|
|
|
|
uint8_t setinfo_sample_size; /* 0x10 */
|
|
|
|
uint8_t setinfo_rice_historymult; /* 0x28 */
|
|
|
|
uint8_t setinfo_rice_initialhistory; /* 0x0a */
|
|
|
|
uint8_t setinfo_rice_kmodifier; /* 0x0e */
|
|
|
|
uint8_t setinfo_7f; /* 0x02 */
|
|
|
|
uint16_t setinfo_80; /* 0x00ff */
|
|
|
|
uint32_t setinfo_82; /* 0x000020e7 */
|
|
|
|
uint32_t setinfo_86; /* 0x00069fe4 */
|
|
|
|
uint32_t setinfo_8a_rate; /* 0x0000ac44 */
|
|
|
|
/* end setinfo stuff */
|
|
|
|
} alac_file;
|
|
|
|
|
2011-06-02 14:59:15 +00:00
|
|
|
/* rockbox: not used
|
2006-11-09 21:59:27 +00:00
|
|
|
void create_alac(int samplesize, int numchannels, alac_file* alac)
|
2011-06-02 14:59:15 +00:00
|
|
|
ICODE_ATTR_ALAC; */
|
|
|
|
|
2005-10-28 00:11:28 +00:00
|
|
|
int alac_decode_frame(alac_file *alac,
|
|
|
|
unsigned char *inbuffer,
|
|
|
|
int32_t outputbuffer[ALAC_MAX_CHANNELS][ALAC_BLOCKSIZE],
|
2006-11-09 21:59:27 +00:00
|
|
|
void (*yield)(void)) ICODE_ATTR_ALAC;
|
|
|
|
void alac_set_info(alac_file *alac, char *inputbuffer) ICODE_ATTR_ALAC;
|
2005-09-22 18:47:04 +00:00
|
|
|
|
|
|
|
#endif /* __ALAC__DECOMP_H */
|
|
|
|
|