decomp.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* copyright 2006 David Hammerton, Ben Allison */
  2. #ifndef __ALAC__DECOMP_H
  3. #define __ALAC__DECOMP_H
  4. #include <bfc/platform/types.h>
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. typedef struct alac_file
  9. {
  10. unsigned char *input_buffer;
  11. int input_buffer_bitaccumulator; /* used so we can do arbitary
  12. bit reads */
  13. int samplesize;
  14. int numchannels;
  15. int bytespersample;
  16. /* buffers */
  17. int32_t *predicterror_buffer_a;
  18. int32_t *predicterror_buffer_b;
  19. int32_t *outputsamples_buffer_a;
  20. int32_t *outputsamples_buffer_b;
  21. int32_t *uncompressed_bytes_buffer_a;
  22. int32_t *uncompressed_bytes_buffer_b;
  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 */ /* bits per sample */
  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 */ /* channels? */
  31. uint16_t setinfo_80; /* 0x00ff, 255 */
  32. uint32_t setinfo_82; /* 0x000020e7, 8423 */ /* max sample size?? */
  33. uint32_t setinfo_86; /* 0x00069fe4, 434148 */ /* bit rate (avarge)?? */
  34. uint32_t setinfo_sample_rate; /* 0x0000ac44, 44100 */ /* samplerate? */
  35. /* end setinfo stuff */
  36. int32_t last_bitrate;
  37. } alac_file;
  38. alac_file *create_alac(int samplesize, int numchannels);
  39. void decode_frame(alac_file *alac,
  40. unsigned char *inbuffer,
  41. void *outbuffer, int *outputsize);
  42. void alac_set_info(alac_file *alac, char *inputbuffer);
  43. void destroy_alac(alac_file *alac);
  44. #ifdef __cplusplus
  45. }
  46. #endif
  47. #endif /* __ALAC__DECOMP_H */