summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/libmad/mad.h
Side-by-side diff
Diffstat (limited to 'core/multimedia/opieplayer/libmad/mad.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/libmad/mad.h376
1 files changed, 255 insertions, 121 deletions
diff --git a/core/multimedia/opieplayer/libmad/mad.h b/core/multimedia/opieplayer/libmad/mad.h
index 9db9da3..9ef6cc8 100644
--- a/core/multimedia/opieplayer/libmad/mad.h
+++ b/core/multimedia/opieplayer/libmad/mad.h
@@ -1,4 +1,4 @@
/*
- * mad - MPEG audio decoder
- * Copyright (C) 2000-2001 Robert Leslie
+ * libmad - MPEG audio decoder library
+ * Copyright (C) 2000-2004 Underbit Technologies, Inc.
*
@@ -19,5 +19,13 @@
* If you would like to negotiate alternate licensing terms, you may do
- * so by contacting the author: Robert Leslie <rob@mars.org>
+ * so by contacting: Underbit Technologies, Inc. <info@underbit.com>
*/
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# define FPM_INTEL
+
+
+
# define SIZEOF_INT 4
@@ -26,3 +34,4 @@
-/* Id: version.h,v 1.16 2001/04/05 04:57:11 rob Exp */
+
+/* Id: version.h,v 1.26 2004/01/23 09:41:33 rob Exp */
@@ -32,4 +41,4 @@
# define MAD_VERSION_MAJOR 0
-# define MAD_VERSION_MINOR 13
-# define MAD_VERSION_PATCH 0
+# define MAD_VERSION_MINOR 15
+# define MAD_VERSION_PATCH 1
# define MAD_VERSION_EXTRA " (beta)"
@@ -44,5 +53,5 @@
-# define MAD_PUBLISHYEAR "2000-2001"
-# define MAD_AUTHOR "Robert Leslie"
-# define MAD_EMAIL "rob@mars.org"
+# define MAD_PUBLISHYEAR "2000-2004"
+# define MAD_AUTHOR "Underbit Technologies, Inc."
+# define MAD_EMAIL "info@underbit.com"
@@ -55,3 +64,3 @@ extern char const mad_build[];
-/* Id: fixed.h,v 1.23 2001/04/05 04:57:11 rob Exp */
+/* Id: fixed.h,v 1.38 2004/02/17 02:02:03 rob Exp */
@@ -72,2 +81,14 @@ typedef unsigned long mad_fixed64lo_t;
+# if defined(_MSC_VER)
+# define mad_fixed64_t signed __int64
+# elif 1 || defined(__GNUC__)
+# define mad_fixed64_t signed long long
+# endif
+
+# if defined(FPM_FLOAT)
+typedef double mad_sample_t;
+# else
+typedef mad_fixed_t mad_sample_t;
+# endif
+
/*
@@ -132,7 +153,18 @@ typedef unsigned long mad_fixed64lo_t;
-# if defined(FPM_64BIT)
+# if defined(FPM_FLOAT)
+# error "FPM_FLOAT not yet supported"
+
+# undef MAD_F
+# define MAD_F(x) mad_f_todouble(x)
+
+# define mad_f_mul(x, y) ((x) * (y))
+# define mad_f_scale64
+
+# undef ASO_ZEROCHECK
+
+# elif defined(FPM_64BIT)
/*
- * This version should be the most accurate if 64-bit (long long) types are
- * supported by the compiler, although it may not be the most efficient.
+ * This version should be the most accurate if 64-bit types are supported by
+ * the compiler, although it may not be the most efficient.
*/
@@ -141,3 +173,3 @@ typedef unsigned long mad_fixed64lo_t;
((mad_fixed_t) \
- ((((signed long long) (x) * (y)) + \
+ ((((mad_fixed64_t) (x) * (y)) + \
(1L << (MAD_F_SCALEBITS - 1))) >> MAD_F_SCALEBITS))
@@ -145,3 +177,3 @@ typedef unsigned long mad_fixed64lo_t;
# define mad_f_mul(x, y) \
- ((mad_fixed_t) (((signed long long) (x) * (y)) >> MAD_F_SCALEBITS))
+ ((mad_fixed_t) (((mad_fixed64_t) (x) * (y)) >> MAD_F_SCALEBITS))
# endif
@@ -154,2 +186,25 @@ typedef unsigned long mad_fixed64lo_t;
+# if defined(_MSC_VER)
+# pragma warning(push)
+# pragma warning(disable: 4035) /* no return value */
+static __forceinline
+mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
+{
+ enum {
+ fracbits = MAD_F_FRACBITS
+ };
+
+ __asm {
+ mov eax, x
+ imul y
+ shrd eax, edx, fracbits
+ }
+
+ /* implicit return of eax */
+}
+# pragma warning(pop)
+
+# define mad_f_mul mad_f_mul_inline
+# define mad_f_scale64
+# else
/*
@@ -158,3 +213,3 @@ typedef unsigned long mad_fixed64lo_t;
*/
-# define MAD_F_MLX(hi, lo, x, y) \
+# define MAD_F_MLX(hi, lo, x, y) \
asm ("imull %3" \
@@ -164,3 +219,3 @@ typedef unsigned long mad_fixed64lo_t;
-# if defined(OPT_ACCURACY)
+# if defined(OPT_ACCURACY)
/*
@@ -168,3 +223,3 @@ typedef unsigned long mad_fixed64lo_t;
*/
-# define MAD_F_MLA(hi, lo, x, y) \
+# define MAD_F_MLA(hi, lo, x, y) \
({ mad_fixed64hi_t __hi; \
@@ -178,5 +233,5 @@ typedef unsigned long mad_fixed64lo_t;
})
-# endif /* OPT_ACCURACY */
+# endif /* OPT_ACCURACY */
-# if defined(OPT_ACCURACY)
+# if defined(OPT_ACCURACY)
/*
@@ -184,3 +239,3 @@ typedef unsigned long mad_fixed64lo_t;
*/
-# define mad_f_scale64(hi, lo) \
+# define mad_f_scale64(hi, lo) \
({ mad_fixed64hi_t __hi_; \
@@ -200,4 +255,19 @@ typedef unsigned long mad_fixed64lo_t;
})
-# else
-# define mad_f_scale64(hi, lo) \
+# elif defined(OPT_INTEL)
+/*
+ * Alternate Intel scaling that may or may not perform better.
+ */
+# define mad_f_scale64(hi, lo) \
+ ({ mad_fixed_t __result; \
+ asm ("shrl %3,%1\n\t" \
+ "shll %4,%2\n\t" \
+ "orl %2,%1" \
+ : "=rm" (__result) \
+ : "0" (lo), "r" (hi), \
+ "I" (MAD_F_SCALEBITS), "I" (32 - MAD_F_SCALEBITS) \
+ : "cc"); \
+ __result; \
+ })
+# else
+# define mad_f_scale64(hi, lo) \
({ mad_fixed_t __result; \
@@ -209,5 +279,6 @@ typedef unsigned long mad_fixed64lo_t;
})
-# endif /* OPT_ACCURACY */
+# endif /* OPT_ACCURACY */
-# define MAD_F_SCALEBITS MAD_F_FRACBITS
+# define MAD_F_SCALEBITS MAD_F_FRACBITS
+# endif
@@ -223,8 +294,4 @@ typedef unsigned long mad_fixed64lo_t;
/*
- * There's a bug somewhere, possibly in the compiler, that sometimes makes
- * this necessary instead of the default implementation via MAD_F_MLX and
- * mad_f_scale64. It may be related to the use (or lack) of
- * -finline-functions and/or -fstrength-reduce.
- *
- * This is also apparently faster than MAD_F_MLX/mad_f_scale64.
+ * This is faster than the default implementation via MAD_F_MLX() and
+ * mad_f_scale64().
*/
@@ -255,2 +322,9 @@ typedef unsigned long mad_fixed64lo_t;
+# define MAD_F_MLN(hi, lo) \
+ asm ("rsbs %0, %2, #0\n\t" \
+ "rsc %1, %3, #0" \
+ : "=r" (lo), "=r" (hi) \
+ : "0" (lo), "1" (hi) \
+ : "cc")
+
# define mad_f_scale64(hi, lo) \
@@ -259,3 +333,3 @@ typedef unsigned long mad_fixed64lo_t;
"adc %0, %0, %2, lsl %4" \
- : "=r" (__result) \
+ : "=&r" (__result) \
: "r" (lo), "r" (hi), \
@@ -327,14 +401,21 @@ typedef unsigned long mad_fixed64lo_t;
/*
- * This PowerPC version is tuned for the 4xx embedded processors. It is
- * effectively a tuned version of FPM_64BIT. It is a little faster and just
- * as accurate. The disposition of the least significant bit depends on
- * OPT_ACCURACY via mad_f_scale64().
+ * This PowerPC version is fast and accurate; the disposition of the least
+ * significant bit depends on OPT_ACCURACY via mad_f_scale64().
*/
# define MAD_F_MLX(hi, lo, x, y) \
- asm ("mulhw %1, %2, %3\n\t" \
- "mullw %0, %2, %3" \
- : "=&r" (lo), "=&r" (hi) \
- : "%r" (x), "r" (y))
+ do { \
+ asm ("mullw %0,%1,%2" \
+ : "=r" (lo) \
+ : "%r" (x), "r" (y)); \
+ asm ("mulhw %0,%1,%2" \
+ : "=r" (hi) \
+ : "%r" (x), "r" (y)); \
+ } \
+ while (0)
-# define MAD_F_MLA(hi, lo, x, y) \
+# if defined(OPT_ACCURACY)
+/*
+ * This gives best accuracy but is not very fast.
+ */
+# define MAD_F_MLA(hi, lo, x, y) \
({ mad_fixed64hi_t __hi; \
@@ -342,7 +423,10 @@ typedef unsigned long mad_fixed64lo_t;
MAD_F_MLX(__hi, __lo, (x), (y)); \
- asm ("addc %0, %2, %3\n\t" \
- "adde %1, %4, %5" \
+ asm ("addc %0,%2,%3\n\t" \
+ "adde %1,%4,%5" \
: "=r" (lo), "=r" (hi) \
- : "%r" (__lo), "0" (lo), "%r" (__hi), "1" (hi)); \
+ : "%r" (lo), "r" (__lo), \
+ "%r" (hi), "r" (__hi) \
+ : "xer"); \
})
+# endif
@@ -350,20 +434,19 @@ typedef unsigned long mad_fixed64lo_t;
/*
- * This is accurate and ~2 - 2.5 times slower than the unrounded version.
- *
- * The __volatile__ improves the generated code by another 5% (fewer spills
- * to memory); eventually they should be removed.
+ * This is slower than the truncating version below it.
*/
# define mad_f_scale64(hi, lo) \
- ({ mad_fixed_t __result; \
- mad_fixed64hi_t __hi_; \
- mad_fixed64lo_t __lo_; \
- asm __volatile__ ("addc %0, %2, %4\n\t" \
- "addze %1, %3" \
- : "=r" (__lo_), "=r" (__hi_) \
- : "r" (lo), "r" (hi), "r" (1 << (MAD_F_SCALEBITS - 1))); \
- asm __volatile__ ("rlwinm %0, %2,32-%3,0,%3-1\n\t" \
- "rlwimi %0, %1,32-%3,%3,31" \
- : "=&r" (__result) \
- : "r" (__lo_), "r" (__hi_), "I" (MAD_F_SCALEBITS)); \
- __result; \
+ ({ mad_fixed_t __result, __round; \
+ asm ("rotrwi %0,%1,%2" \
+ : "=r" (__result) \
+ : "r" (lo), "i" (MAD_F_SCALEBITS)); \
+ asm ("extrwi %0,%1,1,0" \
+ : "=r" (__round) \
+ : "r" (__result)); \
+ asm ("insrwi %0,%1,%2,0" \
+ : "+r" (__result) \
+ : "r" (hi), "i" (MAD_F_SCALEBITS)); \
+ asm ("add %0,%1,%2" \
+ : "=r" (__result) \
+ : "%r" (__result), "r" (__round)); \
+ __result; \
})
@@ -372,9 +455,11 @@ typedef unsigned long mad_fixed64lo_t;
({ mad_fixed_t __result; \
- asm ("rlwinm %0, %2,32-%3,0,%3-1\n\t" \
- "rlwimi %0, %1,32-%3,%3,31" \
+ asm ("rotrwi %0,%1,%2" \
: "=r" (__result) \
- : "r" (lo), "r" (hi), "I" (MAD_F_SCALEBITS)); \
- __result; \
+ : "r" (lo), "i" (MAD_F_SCALEBITS)); \
+ asm ("insrwi %0,%1,%2,0" \
+ : "+r" (__result) \
+ : "r" (hi), "i" (MAD_F_SCALEBITS)); \
+ __result; \
})
-# endif /* OPT_ACCURACY */
+# endif
@@ -395,4 +480,8 @@ typedef unsigned long mad_fixed64lo_t;
*/
-# define mad_f_mul(x, y) ((((x) + (1L << 11)) >> 12) * \
+# if defined(OPT_SPEED)
+# define mad_f_mul(x, y) (((x) >> 12) * ((y) >> 16))
+# else
+# define mad_f_mul(x, y) ((((x) + (1L << 11)) >> 12) * \
(((y) + (1L << 15)) >> 16))
+# endif
@@ -408,4 +497,4 @@ typedef unsigned long mad_fixed64lo_t;
# define mad_f_mul(x, y) \
- ({ mad_fixed64hi_t __hi; \
- mad_fixed64lo_t __lo; \
+ ({ register mad_fixed64hi_t __hi; \
+ register mad_fixed64lo_t __lo; \
MAD_F_MLX(__hi, __lo, (x), (y)); \
@@ -418,2 +507,3 @@ typedef unsigned long mad_fixed64lo_t;
# define MAD_F_MLA(hi, lo, x, y) ((lo) += mad_f_mul((x), (y)))
+# define MAD_F_MLN(hi, lo) ((lo) = -(lo))
# define MAD_F_MLZ(hi, lo) ((void) (hi), (mad_fixed_t) (lo))
@@ -425,2 +515,6 @@ typedef unsigned long mad_fixed64lo_t;
+# if !defined(MAD_F_MLN)
+# define MAD_F_MLN(hi, lo) ((hi) = ((lo) = -(lo)) ? ~(hi) : -(hi))
+# endif
+
# if !defined(MAD_F_MLZ)
@@ -444,5 +538,6 @@ typedef unsigned long mad_fixed64lo_t;
-/* miscellaneous C routines */
+/* C routines */
mad_fixed_t mad_f_abs(mad_fixed_t);
+mad_fixed_t mad_f_div(mad_fixed_t, mad_fixed_t);
@@ -450,3 +545,3 @@ mad_fixed_t mad_f_abs(mad_fixed_t);
-/* Id: bit.h,v 1.7 2001/04/05 04:57:11 rob Exp */
+/* Id: bit.h,v 1.12 2004/01/23 09:41:32 rob Exp */
@@ -479,3 +574,3 @@ unsigned short mad_bit_crc(struct mad_bitptr, unsigned int, unsigned short);
-/* Id: timer.h,v 1.10 2001/04/05 04:57:11 rob Exp */
+/* Id: timer.h,v 1.16 2004/01/23 09:41:33 rob Exp */
@@ -541,3 +636,3 @@ enum mad_units {
-# define mad_timer_reset(timer) (*(timer) = mad_timer_zero)
+# define mad_timer_reset(timer) ((void) (*(timer) = mad_timer_zero))
@@ -561,3 +656,3 @@ void mad_timer_string(mad_timer_t, char *, char const *,
-/* Id: stream.h,v 1.12 2001/04/10 05:18:21 rob Exp */
+/* Id: stream.h,v 1.20 2004/02/05 09:02:39 rob Exp */
@@ -566,2 +661,3 @@ void mad_timer_string(mad_timer_t, char *, char const *,
+
# define MAD_BUFFER_GUARD 8
@@ -570,2 +666,4 @@ void mad_timer_string(mad_timer_t, char *, char const *,
enum mad_error {
+ MAD_ERROR_NONE = 0x0000, /* no error */
+
MAD_ERROR_BUFLEN = 0x0001, /* input buffer too small (or EOF) */
@@ -584,2 +682,3 @@ enum mad_error {
MAD_ERROR_BADSCALEFACTOR = 0x0221, /* bad scalefactor index */
+ MAD_ERROR_BADMODE = 0x0222, /* bad bitrate/mode combination */
MAD_ERROR_BADFRAMELEN = 0x0231, /* bad frame length */
@@ -622,3 +721,3 @@ enum {
MAD_OPTION_IGNORECRC = 0x0001, /* ignore CRC errors */
- MAD_OPTION_HALFSAMPLERATE = 0x0002, /* generate PCM at 1/2 sample rate */
+ MAD_OPTION_HALFSAMPLERATE = 0x0002 /* generate PCM at 1/2 sample rate */
# if 0 /* not yet implemented */
@@ -626,3 +725,3 @@ enum {
MAD_OPTION_RIGHTCHANNEL = 0x0020, /* decode right channel only */
- MAD_OPTION_SINGLECHANNEL = 0x0030, /* combine channels */
+ MAD_OPTION_SINGLECHANNEL = 0x0030 /* combine channels */
# endif
@@ -633,3 +732,4 @@ void mad_stream_finish(struct mad_stream *);
-# define mad_stream_options(stream, opts) ((stream)->options = (opts))
+# define mad_stream_options(stream, opts) \
+ ((void) ((stream)->options = (opts)))
@@ -641,5 +741,7 @@ int mad_stream_sync(struct mad_stream *);
+char const *mad_stream_errorstr(struct mad_stream const *);
+
# endif
-/* Id: frame.h,v 1.13 2001/04/05 04:57:11 rob Exp */
+/* Id: frame.h,v 1.20 2004/01/23 09:41:32 rob Exp */
@@ -648,2 +750,3 @@ int mad_stream_sync(struct mad_stream *);
+
enum mad_layer {
@@ -664,23 +767,26 @@ enum mad_emphasis {
MAD_EMPHASIS_50_15_US = 1, /* 50/15 microseconds emphasis */
- MAD_EMPHASIS_CCITT_J_17 = 3 /* CCITT J.17 emphasis */
+ MAD_EMPHASIS_CCITT_J_17 = 3, /* CCITT J.17 emphasis */
+ MAD_EMPHASIS_RESERVED = 2 /* unknown emphasis */
};
-struct mad_frame {
- struct mad_header {
- enum mad_layer layer; /* audio layer (1, 2, or 3) */
- enum mad_mode mode; /* channel mode (see above) */
- int mode_extension; /* additional mode info */
- enum mad_emphasis emphasis; /* de-emphasis to use (see above) */
+struct mad_header {
+ enum mad_layer layer; /* audio layer (1, 2, or 3) */
+ enum mad_mode mode; /* channel mode (see above) */
+ int mode_extension; /* additional mode info */
+ enum mad_emphasis emphasis; /* de-emphasis to use (see above) */
+
+ unsigned long bitrate; /* stream bitrate (bps) */
+ unsigned int samplerate; /* sampling frequency (Hz) */
- unsigned long bitrate; /* stream bitrate (bps) */
- unsigned int samplerate; /* sampling frequency (Hz) */
+ unsigned short crc_check; /* frame CRC accumulator */
+ unsigned short crc_target; /* final target CRC checksum */
- unsigned short crc_check; /* frame CRC accumulator */
- unsigned short crc_target; /* final target CRC checksum */
+ int flags; /* flags (see below) */
+ int private_bits; /* private bits (see below) */
- int flags; /* flags (see below) */
- int private_bits; /* private bits (see below) */
+ mad_timer_t duration; /* audio playing time of frame */
+};
- mad_timer_t duration; /* audio playing time of frame */
- } header;
+struct mad_frame {
+ struct mad_header header; /* MPEG audio header */
@@ -699,17 +805,17 @@ struct mad_frame {
enum {
- MAD_FLAG_NPRIVATE_III = 0x0007, /* number of Layer III private bits */
- MAD_FLAG_INCOMPLETE = 0x0008, /* header but not data is decoded */
+ MAD_FLAG_NPRIVATE_III = 0x0007, /* number of Layer III private bits */
+ MAD_FLAG_INCOMPLETE = 0x0008, /* header but not data is decoded */
- MAD_FLAG_PROTECTION = 0x0010, /* frame has CRC protection */
- MAD_FLAG_COPYRIGHT = 0x0020, /* frame is copyright */
- MAD_FLAG_ORIGINAL = 0x0040, /* frame is original (else copy) */
- MAD_FLAG_PADDING = 0x0080, /* frame has additional slot */
+ MAD_FLAG_PROTECTION = 0x0010, /* frame has CRC protection */
+ MAD_FLAG_COPYRIGHT = 0x0020, /* frame is copyright */
+ MAD_FLAG_ORIGINAL = 0x0040, /* frame is original (else copy) */
+ MAD_FLAG_PADDING = 0x0080, /* frame has additional slot */
- MAD_FLAG_I_STEREO = 0x0100, /* uses intensity joint stereo */
- MAD_FLAG_MS_STEREO = 0x0200, /* uses middle/side joint stereo */
- MAD_FLAG_FREEFORMAT = 0x0400, /* uses free format bitrate */
+ MAD_FLAG_I_STEREO = 0x0100, /* uses intensity joint stereo */
+ MAD_FLAG_MS_STEREO = 0x0200, /* uses middle/side joint stereo */
+ MAD_FLAG_FREEFORMAT = 0x0400, /* uses free format bitrate */
- MAD_FLAG_LSF_EXT = 0x1000, /* lower sampling freq. extension */
- MAD_FLAG_MC_EXT = 0x2000, /* multichannel audio extension */
- MAD_FLAG_MPEG_2_5_EXT = 0x4000 /* MPEG 2.5 (unofficial) extension */
+ MAD_FLAG_LSF_EXT = 0x1000, /* lower sampling freq. extension */
+ MAD_FLAG_MC_EXT = 0x2000, /* multichannel audio extension */
+ MAD_FLAG_MPEG_2_5_EXT = 0x4000 /* MPEG 2.5 (unofficial) extension */
};
@@ -717,4 +823,4 @@ enum {
enum {
- MAD_PRIVATE_HEADER = 0x0100, /* header private bit */
- MAD_PRIVATE_III = 0x001f /* Layer III private bits (up to 5) */
+ MAD_PRIVATE_HEADER = 0x0100, /* header private bit */
+ MAD_PRIVATE_III = 0x001f /* Layer III private bits (up to 5) */
};
@@ -736,3 +842,3 @@ void mad_frame_mute(struct mad_frame *);
-/* Id: synth.h,v 1.8 2001/04/05 04:57:11 rob Exp */
+/* Id: synth.h,v 1.15 2004/01/23 09:41:33 rob Exp */
@@ -741,2 +847,10 @@ void mad_frame_mute(struct mad_frame *);
+
+struct mad_pcm {
+ unsigned int samplerate; /* sampling frequency (Hz) */
+ unsigned short channels; /* number of channels */
+ unsigned short length; /* number of samples per channel */
+ mad_fixed_t samples[2][1152]; /* PCM output samples [ch][sample] */
+};
+
struct mad_synth {
@@ -747,8 +861,20 @@ struct mad_synth {
- struct mad_pcm {
- unsigned int samplerate; /* sampling frequency (Hz) */
- unsigned short channels; /* number of channels */
- unsigned short length; /* number of samples per channel */
- mad_fixed_t samples[2][1152]; /* PCM output samples */
- } pcm;
+ struct mad_pcm pcm; /* PCM output */
+};
+
+/* single channel PCM selector */
+enum {
+ MAD_PCM_CHANNEL_SINGLE = 0
+};
+
+/* dual channel PCM selector */
+enum {
+ MAD_PCM_CHANNEL_DUAL_1 = 0,
+ MAD_PCM_CHANNEL_DUAL_2 = 1
+};
+
+/* stereo PCM selector */
+enum {
+ MAD_PCM_CHANNEL_STEREO_LEFT = 0,
+ MAD_PCM_CHANNEL_STEREO_RIGHT = 1
};
@@ -765,3 +891,3 @@ void mad_synth_frame(struct mad_synth *, struct mad_frame const *);
-/* Id: decoder.h,v 1.9 2001/04/05 04:57:11 rob Exp */
+/* Id: decoder.h,v 1.17 2004/01/23 09:41:32 rob Exp */
@@ -770,2 +896,3 @@ void mad_synth_frame(struct mad_synth *, struct mad_frame const *);
+
enum mad_decoder_mode {
@@ -776,6 +903,6 @@ enum mad_decoder_mode {
enum mad_flow {
- MAD_FLOW_CONTINUE = 0x0000,
- MAD_FLOW_STOP = 0x0010,
- MAD_FLOW_BREAK = 0x0011,
- MAD_FLOW_IGNORE = 0x0020
+ MAD_FLOW_CONTINUE = 0x0000, /* continue normally */
+ MAD_FLOW_STOP = 0x0010, /* stop decoding normally */
+ MAD_FLOW_BREAK = 0x0011, /* stop decoding and signal an error */
+ MAD_FLOW_IGNORE = 0x0020 /* ignore the current frame */
};
@@ -803,3 +930,4 @@ struct mad_decoder {
enum mad_flow (*header_func)(void *, struct mad_header const *);
- enum mad_flow (*filter_func)(void *, struct mad_frame *);
+ enum mad_flow (*filter_func)(void *,
+ struct mad_stream const *, struct mad_frame *);
enum mad_flow (*output_func)(void *,
@@ -813,3 +941,5 @@ void mad_decoder_init(struct mad_decoder *, void *,
enum mad_flow (*)(void *, struct mad_header const *),
- enum mad_flow (*)(void *, struct mad_frame *),
+ enum mad_flow (*)(void *,
+ struct mad_stream const *,
+ struct mad_frame *),
enum mad_flow (*)(void *,
@@ -823,3 +953,4 @@ int mad_decoder_finish(struct mad_decoder *);
-# define mad_decoder_options(decoder, opts) ((decoder)->options = (opts))
+# define mad_decoder_options(decoder, opts) \
+ ((void) ((decoder)->options = (opts)))
@@ -830 +961,4 @@ int mad_decoder_message(struct mad_decoder *, void *, unsigned int *);
+# ifdef __cplusplus
+}
+# endif