diff options
author | Sean Bartell <wingedtachikoma@gmail.com> | 2011-06-25 21:32:25 -0400 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2012-04-25 22:13:20 +0200 |
commit | f40bfc9267b13b54e6379dfe7539447662879d24 (patch) | |
tree | 9b20069d5e62809ff434061ad730096836f916f2 /lib/rbcodec/codecs/libffmpegFLAC/decoder.h | |
parent | a0009907de7a0107d49040d8a180f140e2eff299 (diff) | |
download | rockbox-f40bfc9267b13b54e6379dfe7539447662879d24.tar.gz rockbox-f40bfc9267b13b54e6379dfe7539447662879d24.zip |
Add codecs to librbcodec.
Change-Id: Id7f4717d51ed02d67cb9f9cb3c0ada4a81843f97
Reviewed-on: http://gerrit.rockbox.org/137
Reviewed-by: Nils Wallménius <nils@rockbox.org>
Tested-by: Nils Wallménius <nils@rockbox.org>
Diffstat (limited to 'lib/rbcodec/codecs/libffmpegFLAC/decoder.h')
-rw-r--r-- | lib/rbcodec/codecs/libffmpegFLAC/decoder.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/libffmpegFLAC/decoder.h b/lib/rbcodec/codecs/libffmpegFLAC/decoder.h new file mode 100644 index 0000000000..677a21ac98 --- /dev/null +++ b/lib/rbcodec/codecs/libffmpegFLAC/decoder.h | |||
@@ -0,0 +1,49 @@ | |||
1 | #ifndef _FLAC_DECODER_H | ||
2 | #define _FLAC_DECODER_H | ||
3 | |||
4 | #include "bitstream.h" | ||
5 | |||
6 | #define MAX_CHANNELS 6 /* Maximum supported channels, only left/right will be played back */ | ||
7 | #define MAX_BLOCKSIZE 4608 /* Maxsize in samples of one uncompressed frame */ | ||
8 | #define MAX_FRAMESIZE 65536 /* Maxsize in bytes of one compressed frame */ | ||
9 | |||
10 | #define FLAC_OUTPUT_DEPTH 29 /* Provide samples left-shifted to 28 bits+sign */ | ||
11 | |||
12 | enum decorrelation_type { | ||
13 | INDEPENDENT, | ||
14 | LEFT_SIDE, | ||
15 | RIGHT_SIDE, | ||
16 | MID_SIDE, | ||
17 | }; | ||
18 | |||
19 | typedef struct FLACContext { | ||
20 | GetBitContext gb; | ||
21 | |||
22 | int min_blocksize, max_blocksize; | ||
23 | int min_framesize, max_framesize; | ||
24 | int samplerate, channels; | ||
25 | int blocksize/*, last_blocksize*/; | ||
26 | int bps, curr_bps; | ||
27 | unsigned long samplenumber; | ||
28 | unsigned long totalsamples; | ||
29 | enum decorrelation_type decorrelation; | ||
30 | |||
31 | int filesize; | ||
32 | int length; | ||
33 | int bitrate; | ||
34 | int metadatalength; | ||
35 | |||
36 | int bitstream_size; | ||
37 | int bitstream_index; | ||
38 | |||
39 | int sample_skip; | ||
40 | int framesize; | ||
41 | |||
42 | int32_t *decoded[MAX_CHANNELS]; | ||
43 | } FLACContext; | ||
44 | |||
45 | int flac_decode_frame(FLACContext *s, | ||
46 | uint8_t *buf, int buf_size, | ||
47 | void (*yield)(void)) ICODE_ATTR_FLAC; | ||
48 | |||
49 | #endif | ||