* Onda VX747: add browse screen, pitchscreen, context menu, quickscreen, rewind...
[kugel-rb.git] / apps / codecs / libffmpegFLAC / shndec.h
blob068f4faf28ea067ecbec0f741cbcf91d0f9f2f25
1 #include "bitstream.h"
3 #define SHN_OUTPUT_DEPTH 29 /* 28 bits + sign */
5 #define MAX_CHANNELS 2
6 #define MAX_PRED_ORDER 16
7 #define MAX_NWRAP MAX_PRED_ORDER
8 #define MAX_NMEAN 4
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
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
30 typedef 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;
47 int shorten_init(ShortenContext* s, uint8_t *buf, int buf_size);
48 int 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;