+ vlc_fourcc_t i_format;
+ unsigned int i_rate;
+ /* Describes the channels configuration of the samples (ie. number of
+ * channels which are available in the buffer, and positions). */
+ u32 i_physical_channels;
+ /* Describes from which original channels, before downmixing, the
+ * buffer is derived. */
+ u32 i_original_channels;
+ /* Optional - for A52, SPDIF and DTS types */
+ unsigned int i_bytes_per_frame;
+ unsigned int i_frame_length;
+ /* Please note that it may be completely arbitrary - buffers are not
+ * obliged to contain a integral number of so-called "frames". It's
+ * just here for the division :
+ * i_nb_samples * i_bytes_per_frame / i_frame_length */
+};
+
+#define AOUT_FMTS_IDENTICAL( p_first, p_second ) ( \
+ ((p_first)->i_format == (p_second)->i_format) \
+ && ((p_first)->i_rate == (p_second)->i_rate) \
+ && ((p_first)->i_physical_channels == (p_second)->i_physical_channels)\
+ && ((p_first)->i_original_channels == (p_second)->i_original_channels) )
+
+/* Check if i_rate == i_rate and i_channels == i_channels */
+#define AOUT_FMTS_SIMILAR( p_first, p_second ) ( \
+ ((p_first)->i_rate == (p_second)->i_rate) \
+ && ((p_first)->i_physical_channels == (p_second)->i_physical_channels)\
+ && ((p_first)->i_original_channels == (p_second)->i_original_channels) )
+
+#ifdef WORDS_BIGENDIAN
+# define AOUT_FMT_S16_NE VLC_FOURCC('s','1','6','b')
+# define AOUT_FMT_U16_NE VLC_FOURCC('u','1','6','b')
+#else
+# define AOUT_FMT_S16_NE VLC_FOURCC('s','1','6','l')
+# define AOUT_FMT_U16_NE VLC_FOURCC('u','1','6','l')
+#endif
+
+#define AOUT_FMT_NON_LINEAR( p_format ) \
+ ( ((p_format)->i_format == VLC_FOURCC('s','p','d','i')) \
+ || ((p_format)->i_format == VLC_FOURCC('a','5','2',' ')) \
+ || ((p_format)->i_format == VLC_FOURCC('d','t','s',' ')) )
+
+/* This is heavily borrowed from libmad, by Robert Leslie <rob@mars.org> */
+/*
+ * Fixed-point format: 0xABBBBBBB
+ * A == whole part (sign + 3 bits)
+ * B == fractional part (28 bits)
+ *
+ * Values are signed two's complement, so the effective range is:
+ * 0x80000000 to 0x7fffffff
+ * -8.0 to +7.9999999962747097015380859375
+ *
+ * The smallest representable value is:
+ * 0x00000001 == 0.0000000037252902984619140625 (i.e. about 3.725e-9)
+ *
+ * 28 bits of fractional accuracy represent about
+ * 8.6 digits of decimal accuracy.
+ *
+ * Fixed-point numbers can be added or subtracted as normal
+ * integers, but multiplication requires shifting the 64-bit result
+ * from 56 fractional bits back to 28 (and rounding.)
+ */
+typedef int32_t vlc_fixed_t;
+#define FIXED32_FRACBITS 28
+#define FIXED32_MIN ((vlc_fixed_t) -0x80000000L)
+#define FIXED32_MAX ((vlc_fixed_t) +0x7fffffffL)
+#define FIXED32_ONE ((vlc_fixed_t) 0x10000000)
+
+
+/*
+ * Channels descriptions
+ */
+
+/* Values available for physical and original channels */
+#define AOUT_CHAN_CENTER 0x1
+#define AOUT_CHAN_LEFT 0x2
+#define AOUT_CHAN_RIGHT 0x4
+#define AOUT_CHAN_REARCENTER 0x10
+#define AOUT_CHAN_REARLEFT 0x20
+#define AOUT_CHAN_REARRIGHT 0x40
+#define AOUT_CHAN_LFE 0x100
+
+/* Values available for original channels only */
+#define AOUT_CHAN_DOLBYSTEREO 0x10000
+#define AOUT_CHAN_DUALMONO 0x20000
+
+#define AOUT_CHAN_PHYSMASK 0xFFFF
+