summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs/libffmpegFLAC/shndec.h
diff options
context:
space:
mode:
authorSean Bartell <wingedtachikoma@gmail.com>2011-06-25 21:32:25 -0400
committerNils Wallménius <nils@rockbox.org>2012-04-25 22:13:20 +0200
commitf40bfc9267b13b54e6379dfe7539447662879d24 (patch)
tree9b20069d5e62809ff434061ad730096836f916f2 /lib/rbcodec/codecs/libffmpegFLAC/shndec.h
parenta0009907de7a0107d49040d8a180f140e2eff299 (diff)
downloadrockbox-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/shndec.h')
-rw-r--r--lib/rbcodec/codecs/libffmpegFLAC/shndec.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/libffmpegFLAC/shndec.h b/lib/rbcodec/codecs/libffmpegFLAC/shndec.h
new file mode 100644
index 0000000000..068f4faf28
--- /dev/null
+++ b/lib/rbcodec/codecs/libffmpegFLAC/shndec.h
@@ -0,0 +1,52 @@
1#include "bitstream.h"
2
3#define SHN_OUTPUT_DEPTH 29 /* 28 bits + sign */
4
5#define MAX_CHANNELS 2
6#define MAX_PRED_ORDER 16
7#define MAX_NWRAP MAX_PRED_ORDER
8#define MAX_NMEAN 4
9
10/* NUM_DEC_LOOPS should be even number */
11#define NUM_DEC_LOOPS 26
12#define DEFAULT_BLOCK_SIZE 256
13#define MAX_HEADER_SIZE DEFAULT_BLOCK_SIZE*4
14#define MAX_BUFFER_SIZE 2*DEFAULT_BLOCK_SIZE*NUM_DEC_LOOPS
15#define MAX_DECODE_SIZE ((DEFAULT_BLOCK_SIZE*NUM_DEC_LOOPS/2) + MAX_NWRAP)
16#define MAX_OFFSET_SIZE MAX_NMEAN
17
18#define FN_DIFF0 0
19#define FN_DIFF1 1
20#define FN_DIFF2 2
21#define FN_DIFF3 3
22#define FN_QUIT 4
23#define FN_BLOCKSIZE 5
24#define FN_BITSHIFT 6
25#define FN_QLPC 7
26#define FN_ZERO 8
27#define FN_VERBATIM 9
28#define FN_ERROR 10
29
30typedef struct ShortenContext {
31 GetBitContext gb;
32 int32_t lpcqoffset;
33 uint32_t totalsamples;
34 int header_bits;
35 int channels;
36 int sample_rate;
37 int bits_per_sample;
38 int version;
39 int bitshift;
40 int last_bitshift;
41 int nmean;
42 int nwrap;
43 int blocksize;
44 int bitindex;
45} ShortenContext;
46
47int shorten_init(ShortenContext* s, uint8_t *buf, int buf_size);
48int shorten_decode_frames(ShortenContext *s, int *nsamples,
49 int32_t *decoded0, int32_t *decoded1,
50 int32_t *offset0, int32_t *offset1,
51 uint8_t *buf, int buf_size,
52 void (*yield)(void)) ICODE_ATTR;