summaryrefslogtreecommitdiff
path: root/apps/codecs/libmad/stream.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libmad/stream.h')
-rw-r--r--apps/codecs/libmad/stream.h46
1 files changed, 23 insertions, 23 deletions
diff --git a/apps/codecs/libmad/stream.h b/apps/codecs/libmad/stream.h
index c89c40e088..be48edbd19 100644
--- a/apps/codecs/libmad/stream.h
+++ b/apps/codecs/libmad/stream.h
@@ -24,16 +24,16 @@
24 24
25# include "bit.h" 25# include "bit.h"
26 26
27# define MAD_BUFFER_GUARD 8 27# define MAD_BUFFER_GUARD 8
28# define MAD_BUFFER_MDLEN (511 + 2048 + MAD_BUFFER_GUARD) 28# define MAD_BUFFER_MDLEN (511 + 2048 + MAD_BUFFER_GUARD)
29 29
30enum mad_error { 30enum mad_error {
31 MAD_ERROR_NONE = 0x0000, /* no error */ 31 MAD_ERROR_NONE = 0x0000, /* no error */
32 32
33 MAD_ERROR_BUFLEN = 0x0001, /* input buffer too small (or EOF) */ 33 MAD_ERROR_BUFLEN = 0x0001, /* input buffer too small (or EOF) */
34 MAD_ERROR_BUFPTR = 0x0002, /* invalid (null) buffer pointer */ 34 MAD_ERROR_BUFPTR = 0x0002, /* invalid (null) buffer pointer */
35 35
36 MAD_ERROR_NOMEM = 0x0031, /* not enough memory */ 36 MAD_ERROR_NOMEM = 0x0031, /* not enough memory */
37 37
38 MAD_ERROR_LOSTSYNC = 0x0101, /* lost synchronization */ 38 MAD_ERROR_LOSTSYNC = 0x0101, /* lost synchronization */
39 MAD_ERROR_BADLAYER = 0x0102, /* reserved header layer value */ 39 MAD_ERROR_BADLAYER = 0x0102, /* reserved header layer value */
@@ -41,7 +41,7 @@ enum mad_error {
41 MAD_ERROR_BADSAMPLERATE = 0x0104, /* reserved sample frequency value */ 41 MAD_ERROR_BADSAMPLERATE = 0x0104, /* reserved sample frequency value */
42 MAD_ERROR_BADEMPHASIS = 0x0105, /* reserved emphasis value */ 42 MAD_ERROR_BADEMPHASIS = 0x0105, /* reserved emphasis value */
43 43
44 MAD_ERROR_BADCRC = 0x0201, /* CRC check failed */ 44 MAD_ERROR_BADCRC = 0x0201, /* CRC check failed */
45 MAD_ERROR_BADBITALLOC = 0x0211, /* forbidden bit allocation value */ 45 MAD_ERROR_BADBITALLOC = 0x0211, /* forbidden bit allocation value */
46 MAD_ERROR_BADSCALEFACTOR = 0x0221, /* bad scalefactor index */ 46 MAD_ERROR_BADSCALEFACTOR = 0x0221, /* bad scalefactor index */
47 MAD_ERROR_BADMODE = 0x0222, /* bad bitrate/mode combination */ 47 MAD_ERROR_BADMODE = 0x0222, /* bad bitrate/mode combination */
@@ -53,32 +53,32 @@ enum mad_error {
53 MAD_ERROR_BADPART3LEN = 0x0236, /* bad audio data length */ 53 MAD_ERROR_BADPART3LEN = 0x0236, /* bad audio data length */
54 MAD_ERROR_BADHUFFTABLE = 0x0237, /* bad Huffman table select */ 54 MAD_ERROR_BADHUFFTABLE = 0x0237, /* bad Huffman table select */
55 MAD_ERROR_BADHUFFDATA = 0x0238, /* Huffman data overrun */ 55 MAD_ERROR_BADHUFFDATA = 0x0238, /* Huffman data overrun */
56 MAD_ERROR_BADSTEREO = 0x0239 /* incompatible block_type for JS */ 56 MAD_ERROR_BADSTEREO = 0x0239 /* incompatible block_type for JS */
57}; 57};
58 58
59# define MAD_RECOVERABLE(error) ((error) & 0xff00) 59# define MAD_RECOVERABLE(error) ((error) & 0xff00)
60 60
61struct mad_stream { 61struct mad_stream {
62 unsigned char const *buffer; /* input bitstream buffer */ 62 unsigned char const *buffer; /* input bitstream buffer */
63 unsigned char const *bufend; /* end of buffer */ 63 unsigned char const *bufend; /* end of buffer */
64 unsigned long skiplen; /* bytes to skip before next frame */ 64 unsigned long skiplen; /* bytes to skip before next frame */
65 65
66 int sync; /* stream sync found */ 66 int sync; /* stream sync found */
67 unsigned long freerate; /* free bitrate (fixed) */ 67 unsigned long freerate; /* free bitrate (fixed) */
68 68
69 unsigned char const *this_frame; /* start of current frame */ 69 unsigned char const *this_frame; /* start of current frame */
70 unsigned char const *next_frame; /* start of next frame */ 70 unsigned char const *next_frame; /* start of next frame */
71 struct mad_bitptr ptr; /* current processing bit pointer */ 71 struct mad_bitptr ptr; /* current processing bit pointer */
72 72
73 struct mad_bitptr anc_ptr; /* ancillary bits pointer */ 73 struct mad_bitptr anc_ptr; /* ancillary bits pointer */
74 unsigned int anc_bitlen; /* number of ancillary bits */ 74 unsigned int anc_bitlen; /* number of ancillary bits */
75 75
76 unsigned char (*main_data)[MAD_BUFFER_MDLEN]; 76 unsigned char (*main_data)[MAD_BUFFER_MDLEN];
77 /* Layer III main_data() */ 77 /* Layer III main_data() */
78 unsigned int md_len; /* bytes in main_data */ 78 unsigned int md_len; /* bytes in main_data */
79 79
80 int options; /* decoding options (see below) */ 80 int options; /* decoding options (see below) */
81 enum mad_error error; /* error code (see above) */ 81 enum mad_error error; /* error code (see above) */
82}; 82};
83 83
84enum { 84enum {
@@ -98,7 +98,7 @@ void mad_stream_finish(struct mad_stream *);
98 ((void) ((stream)->options = (opts))) 98 ((void) ((stream)->options = (opts)))
99 99
100void mad_stream_buffer(struct mad_stream *, 100void mad_stream_buffer(struct mad_stream *,
101 unsigned char const *, unsigned long); 101 unsigned char const *, unsigned long);
102void mad_stream_skip(struct mad_stream *, unsigned long); 102void mad_stream_skip(struct mad_stream *, unsigned long);
103 103
104int mad_stream_sync(struct mad_stream *); 104int mad_stream_sync(struct mad_stream *);