9 const unsigned char *next_in;
10 size_t avail_in; /* number of bytes available at
12 size_t total_in; /* total number of input bytes read so
14 unsigned char *next_out;
15 size_t avail_out; /* remaining free space at next_out */
16 size_t total_out; /* total number of bytes output so far */
17 int bit_per_sample; /* resolution in bits per sample (n =
19 int block_size; /* block size in samples */
20 int rsi; /* Reference sample interval, the number of
21 blocks between consecutive reference
25 struct internal_state *state;
29 #define AEC_DATA_UNSIGNED 0
30 #define AEC_DATA_SIGNED 1
31 #define AEC_DATA_3BYTE 2 /* 24 bit samples coded in 3 bytes */
32 #define AEC_DATA_LSB 0
33 #define AEC_DATA_MSB 16
34 #define AEC_DATA_PREPROCESS 32 /* Set if preprocessor should be used */
36 /* Return codes of library functions */
38 #define AEC_CONF_ERROR (-1)
39 #define AEC_STREAM_ERROR (-2)
40 #define AEC_DATA_ERROR (-3)
41 #define AEC_MEM_ERROR (-4)
43 /* Options for flushing */
44 #define AEC_NO_FLUSH 0 /* Do not enforce output flushing. More
45 * input may be provided with later
46 * calls. So far only relevant for
49 #define AEC_FLUSH 1 /* Flush output and end encoding. The last
50 * call to aec_encode() must set AEC_FLUSH to
53 * It is not possible to continue encoding
54 * of the same stream after it has been
55 * flushed because the last byte may be
56 * padded with fill bits.
59 int aec_decode_init(struct aec_stream *strm);
60 int aec_decode(struct aec_stream *strm, int flush);
61 int aec_decode_end(struct aec_stream *strm);
63 int aec_encode_init(struct aec_stream *strm);
64 int aec_encode(struct aec_stream *strm, int flush);
65 int aec_encode_end(struct aec_stream *strm);