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