9 const unsigned char *next_in;
10 size_t avail_in; /* number of bytes available at
13 size_t total_in; /* total number of input bytes read so
16 unsigned char *next_out;
17 size_t avail_out; /* remaining free space at next_out */
18 size_t total_out; /* total number of bytes output so far */
19 int bit_per_sample; /* resolution in bits per sample (n =
22 int block_size; /* block size in samples */
23 int rsi; /* Reference sample interval, the number
24 * of _blocks_ between consecutive
25 * reference samples (up to 4096).
29 struct internal_state *state;
32 /* Sample data description flags */
33 #define AEC_DATA_UNSIGNED 0 /* Samples are unsigned integers (default) */
34 #define AEC_DATA_SIGNED 1 /* Samples are signed. Telling libaec
35 * this results in a slightly better
38 #define AEC_DATA_3BYTE 2 /* 24 bit samples are coded in 3 bytes */
39 #define AEC_DATA_MSB 16 /* Samples are stored with their most
40 * significant bit first. This has
41 * nothing to do with the endianness
44 #define AEC_DATA_LSB 0 /* Samples are stored LSB first (default) */
45 #define AEC_DATA_PREPROCESS 32 /* Set if preprocessor should be used */
47 /* Return codes of library functions */
49 #define AEC_CONF_ERROR (-1)
50 #define AEC_STREAM_ERROR (-2)
51 #define AEC_DATA_ERROR (-3)
52 #define AEC_MEM_ERROR (-4)
54 /* Options for flushing */
55 #define AEC_NO_FLUSH 0 /* Do not enforce output
56 * flushing. More input may be
57 * provided with later calls. So far
58 * only relevant for encoding.
60 #define AEC_FLUSH 1 /* Flush output and end encoding. The
61 * last call to aec_encode() must set
62 * AEC_FLUSH to drain all output.
64 * It is not possible to continue
65 * encoding of the same stream after it
66 * has been flushed because the last byte
67 * may be padded with fill bits.
70 /* Streaming encoding and decoding functions */
71 int aec_encode_init(struct aec_stream *strm);
72 int aec_encode(struct aec_stream *strm, int flush);
73 int aec_encode_end(struct aec_stream *strm);
75 int aec_decode_init(struct aec_stream *strm);
76 int aec_decode(struct aec_stream *strm, int flush);
77 int aec_decode_end(struct aec_stream *strm);
79 /* Utility functions for encoding or decoding a memory buffer. */
80 int aec_buffer_encode(struct aec_stream *strm);
81 int aec_buffer_decode(struct aec_stream *strm);