diff options
| author | cooljqln <cooljqln@noreply.codeberg.org> | 2025-08-04 03:39:16 +0200 |
|---|---|---|
| committer | cooljqln <cooljqln@noreply.codeberg.org> | 2025-08-04 03:39:16 +0200 |
| commit | df8fc4104e5ed884f3b52257558191955375d1e7 (patch) | |
| tree | 8a3b07dc014050c82443ef4b0e83e8de2ebbf24b /lib/alac/decomp.h | |
| parent | b68ac702817316e75270355e19231e04f484cb74 (diff) | |
| parent | 4887378ce74c27f837fe1939ad5917b221736fac (diff) | |
| download | tangara-fw-df8fc4104e5ed884f3b52257558191955375d1e7.tar.gz | |
Merge pull request 'Preliminary ALAC support' (#416) from ayumi/tangara-fw:alac into main
Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/416
Diffstat (limited to 'lib/alac/decomp.h')
| -rw-r--r-- | lib/alac/decomp.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/alac/decomp.h b/lib/alac/decomp.h new file mode 100644 index 00000000..50e26b24 --- /dev/null +++ b/lib/alac/decomp.h @@ -0,0 +1,35 @@ +#ifndef __ALAC__DECOMP_H +#define __ALAC__DECOMP_H + +typedef struct alac_file { + unsigned char *input_buffer; + int input_buffer_bitaccumulator; /* used so we can do arbitary bit reads */ + int samplesize; + int numchannels; + int bytespersample; + /* buffers */ + int32_t *predicterror_buffer_a; + int32_t *predicterror_buffer_b; + int32_t *outputsamples_buffer_a; + int32_t *outputsamples_buffer_b; + int32_t *uncompressed_bytes_buffer_a; + int32_t *uncompressed_bytes_buffer_b; + /* 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 */ /* max sample size?? */ + uint32_t setinfo_86; /* 0x00069fe4 */ /* bit rate (avarge)?? */ + uint32_t setinfo_8a_rate; /* 0x0000ac44 */ + /* end setinfo stuff */ +} alac_file; +void create_alac(alac_file *alac, int samplesize, int numchannels); +int decode_frame(alac_file *alac, unsigned char *inbuffer, void *outbuffer, int *outputsize); +void alac_set_info(alac_file *alac, char *inputbuffer); + +#endif /* __ALAC__DECOMP_H */ |
