diff options
| author | Dave Chapman <dave@dchapman.com> | 2005-10-26 12:35:58 +0000 |
|---|---|---|
| committer | Dave Chapman <dave@dchapman.com> | 2005-10-26 12:35:58 +0000 |
| commit | 273d2e81f72c7721447ab9c539877f6712faaecc (patch) | |
| tree | 79c66b0b699ca65ac2cc2369cd5bbed764c35a4b /apps/codecs/libffmpegFLAC/decoder.h | |
| parent | 48be8e6a8b45fa16380af97829ba944430a78f17 (diff) | |
| download | rockbox-273d2e81f72c7721447ab9c539877f6712faaecc.zip rockbox-273d2e81f72c7721447ab9c539877f6712faaecc.tar.gz rockbox-273d2e81f72c7721447ab9c539877f6712faaecc.tar.bz2 rockbox-273d2e81f72c7721447ab9c539877f6712faaecc.tar.xz | |
New FLAC decoder from the ffmpeg project
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7656 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libffmpegFLAC/decoder.h')
| -rw-r--r-- | apps/codecs/libffmpegFLAC/decoder.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/apps/codecs/libffmpegFLAC/decoder.h b/apps/codecs/libffmpegFLAC/decoder.h new file mode 100644 index 0000000..5d503ad --- /dev/null +++ b/apps/codecs/libffmpegFLAC/decoder.h @@ -0,0 +1,46 @@ +#ifndef _FLAC_DECODER_H +#define _FLAC_DECODER_H + +#include "bitstream.h" + +#define MAX_CHANNELS 2 /* Maximum supported channels */ +#define MAX_BLOCKSIZE 4608 /* Maxsize in samples of one uncompressed frame */ +#define MAX_FRAMESIZE 32768 /* Maxsize in bytes of one compressed frame */ + +#define FLAC_OUTPUT_DEPTH 28 /* Provide samples left-shifted to 28-bits */ + +enum decorrelation_type { + INDEPENDENT, + LEFT_SIDE, + RIGHT_SIDE, + MID_SIDE, +}; + +typedef struct FLACContext { + GetBitContext gb; + + int min_blocksize, max_blocksize; + int min_framesize, max_framesize; + int samplerate, channels; + int blocksize/*, last_blocksize*/; + int bps, curr_bps; + unsigned long samplenumber; + unsigned long totalsamples; + enum decorrelation_type decorrelation; + + int filesize; + int length; + int bitrate; + int metadatalength; + + int bitstream_size; + int bitstream_index; +} FLACContext; + +int flac_decode_frame(FLACContext *s, + int32_t* decoded0, + int32_t* decoded1, + uint8_t *buf, int buf_size, + void (*yield)(void)); + +#endif |