* audio_output.h : audio output interface
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: audio_output.h,v 1.55 2002/08/09 23:52:31 sam Exp $
+ * $Id: audio_output.h,v 1.56 2002/08/11 22:46:34 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
|| ((p_format)->i_format == AOUT_FMT_A52) \
|| ((p_format)->i_format == AOUT_FMT_DTS) )
+/* 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 s32 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)
+
+
+
/*****************************************************************************
* aout_buffer_t : audio output buffer
*****************************************************************************/
* (http://liba52.sf.net/).
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: a52.c,v 1.1 2002/08/11 01:27:01 massiot Exp $
+ * $Id: a52.c,v 1.2 2002/08/11 22:46:34 massiot Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Christophe Massiot <massiot@via.ecp.fr>
*****************************************************************************/
static int OpenDecoder ( vlc_object_t * );
static int RunDecoder ( decoder_fifo_t * );
-static int DecodeFrame ( a52_thread_t *, const byte_t * );
+static int DecodeFrame ( a52_thread_t *, byte_t * );
static int InitThread ( a52_thread_t *, decoder_fifo_t * );
static void EndThread ( a52_thread_t * );
/*****************************************************************************
* DecodeFrame: decode an ATSC A/52 frame.
*****************************************************************************/
-static int DecodeFrame( a52_thread_t * p_dec, const byte_t * p_frame_buffer )
+static int DecodeFrame( a52_thread_t * p_dec, byte_t * p_frame_buffer )
{
sample_t i_sample_level = 1;
aout_buffer_t * p_buffer;