Index: libmpcdec/branches/zorg/include/Makefile.am
===================================================================
--- libmpcdec/branches/zorg/include/Makefile.am	(revision 63)
+++ 	(revision )
@@ -1,13 +1,0 @@
-## Process this file with automake to produce Makefile.in
-
-AUTOMAKE_OPTIONS = foreign
-
-nobase_include_HEADERS = \
-	mpcdec/config_types.h \
-	mpcdec/decoder.h \
-	mpcdec/huffman.h \
-	mpcdec/math.h \
-	mpcdec/mpcdec.h \
-	mpcdec/reader.h \
-	mpcdec/requant.h \
-	mpcdec/streaminfo.h
Index: libmpcdec/branches/zorg/include/config.h.in
===================================================================
--- libmpcdec/branches/zorg/include/config.h.in	(revision 63)
+++ 	(revision )
@@ -1,104 +1,0 @@
-/* include/config.h.in.  Generated from configure.ac by autoheader.  */
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the `memmove' function. */
-#undef HAVE_MEMMOVE
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the `memset' function. */
-#undef HAVE_MEMSET
-
-/* Define to 1 if the system has the type `ptrdiff_t'. */
-#undef HAVE_PTRDIFF_T
-
-/* Define to 1 if you have the `sqrt' function. */
-#undef HAVE_SQRT
-
-/* Define to 1 if stdbool.h conforms to C99. */
-#undef HAVE_STDBOOL_H
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if the system has the type `_Bool'. */
-#undef HAVE__BOOL
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* The size of a `int', as computed by sizeof. */
-#undef SIZEOF_INT
-
-/* The size of a `long', as computed by sizeof. */
-#undef SIZEOF_LONG
-
-/* The size of a `long long', as computed by sizeof. */
-#undef SIZEOF_LONG_LONG
-
-/* The size of a `short', as computed by sizeof. */
-#undef SIZEOF_SHORT
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Version number of package */
-#undef VERSION
-
-/* Define to 1 if your processor stores words with the most significant byte
-   first (like Motorola and SPARC, unlike Intel and VAX). */
-#undef WORDS_BIGENDIAN
-
-/* Define to empty if `const' does not conform to ANSI C. */
-#undef const
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
-   calls it, or to nothing if 'inline' is not supported under any name.  */
-#ifndef __cplusplus
-#undef inline
-#endif
-
-/* Define to `long' if <sys/types.h> does not define. */
-#undef off_t
-
-/* Define to `unsigned' if <sys/types.h> does not define. */
-#undef size_t
Index: libmpcdec/branches/zorg/include/mainpage.h
===================================================================
--- libmpcdec/branches/zorg/include/mainpage.h	(revision 63)
+++ 	(revision )
@@ -1,38 +1,0 @@
-/**
-   \mainpage libmpcdec documentation
-
-   \section whats what is libmpcdec
-   libmpcdec is a library that decodes musepack compressed audio data.  Musepack
-   is a free, high performance, high quality lossy audio compression codec.  For
-   more information on musepack visit http://www.musepack.net.
-
-   \section using using libmpcdec
-
-   Using libmpcdec is very straightforward.  There are typically four things you must
-   do to use libmpcdec in your application.
-
-   \subsection step1 step 1: implement an mpc_reader to provide raw data to the decoder library
-   The role of the mpc_reader is to provide raw mpc stream data to the mpc decoding library.
-   This data can come from a file, a network socket, or any other source you wish.
-
-   See the documentation of 
-   \link mpc_reader_t mpc_reader \endlink 
-   for more information.
-
-   \subsection step2 step2: read the streaminfo properties structure from the stream
-   This is a simple matter of calling the streaminfo_init() and streaminfo_read() functions, 
-   supplying your mpc_reader as a source of raw data.  This reads the stream properties header from the 
-   mpc stream.  This information will be used to prime the decoder for decoding in
-   the next step.
-
-   \subsection step3 step 3: initialize an mpc_decoder with your mpc_reader source
-   This is just a matter of calling the mpc_decoder_setup() and mpc_decoder_initialize()
-   functions with your mpc_decoder, mpc_reader data source and streaminfo information.
-
-   \subsection step4 step 4: iteratively read raw sample data from the mpc decoder
-   Once you've initialized the decoding library you just iteratively call the 
-   mpc_decoder_decode routine until it indicates that the entire stream has been read.
-
-   For a simple example of all of these steps see the sample application distributed with
-   libmpcdec in src/sample.cpp.
-*/
Index: libmpcdec/branches/zorg/include/mpcdec/config_types.h.in
===================================================================
--- libmpcdec/branches/zorg/include/mpcdec/config_types.h.in	(revision 63)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*
-  Copyright (c) 2005, The Musepack Development Team
-  All rights reserved.
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions are
-  met:
-
-  * Redistributions of source code must retain the above copyright
-  notice, this list of conditions and the following disclaimer.
-
-  * Redistributions in binary form must reproduce the above
-  copyright notice, this list of conditions and the following
-  disclaimer in the documentation and/or other materials provided
-  with the distribution.
-
-  * Neither the name of the The Musepack Development Team nor the
-  names of its contributors may be used to endorse or promote
-  products derived from this software without specific prior
-  written permission.
-
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef __MUSEPACK_CONFIG_TYPES_H__
-#define __MUSEPACK_CONFIG_TYPES_H__
-
-typedef unsigned char mpc_bool_t;
-#define TRUE  1
-#define FALSE 0
-
-typedef @SIZE16@ mpc_int16_t;
-typedef @USIZE16@ mpc_uint16_t;
-typedef @SIZE32@ mpc_int32_t;
-typedef @USIZE32@ mpc_uint32_t;
-typedef @SIZE64@ mpc_int64_t;
-
-#endif // __MUSEPACK_CONFIG_TYPES_H__
Index: libmpcdec/branches/zorg/include/mpcdec/config_win32.h
===================================================================
--- libmpcdec/branches/zorg/include/mpcdec/config_win32.h	(revision 63)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/*
-  Copyright (c) 2005, The Musepack Development Team
-  All rights reserved.
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions are
-  met:
-
-  * Redistributions of source code must retain the above copyright
-  notice, this list of conditions and the following disclaimer.
-
-  * Redistributions in binary form must reproduce the above
-  copyright notice, this list of conditions and the following
-  disclaimer in the documentation and/or other materials provided
-  with the distribution.
-
-  * Neither the name of the The Musepack Development Team nor the
-  names of its contributors may be used to endorse or promote
-  products derived from this software without specific prior
-  written permission.
-
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef __MUSEPACK_CONFIG_WIN32_H__
-#define __MUSEPACK_CONFIG_WIN32_H__
-
-typedef unsigned char mpc_bool_t;
-#define TRUE  1
-#define FALSE 0
-
-typedef __int8           mpc_int8_t;
-typedef unsigned __int8  mpc_uint8_t;
-typedef __int16          mpc_int16_t;
-typedef unsigned __int16 mpc_uint16_t;
-typedef __int32          mpc_int32_t;
-typedef unsigned __int32 mpc_uint32_t;
-typedef __int64          mpc_int64_t;
-
-#define MPC_LITTLE_ENDIAN
-
-#endif // __MUSEPACK_CONFIG_WIN32_H__
Index: libmpcdec/branches/zorg/include/mpcdec/decoder.h
===================================================================
--- libmpcdec/branches/zorg/include/mpcdec/decoder.h	(revision 63)
+++ 	(revision )
@@ -1,124 +1,0 @@
-/*
-  Copyright (c) 2005, The Musepack Development Team
-  All rights reserved.
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions are
-  met:
-
-  * Redistributions of source code must retain the above copyright
-  notice, this list of conditions and the following disclaimer.
-
-  * Redistributions in binary form must reproduce the above
-  copyright notice, this list of conditions and the following
-  disclaimer in the documentation and/or other materials provided
-  with the distribution.
-
-  * Neither the name of the The Musepack Development Team nor the
-  names of its contributors may be used to endorse or promote
-  products derived from this software without specific prior
-  written permission.
-
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/// \file decoder.h
-
-#ifndef _mpcdec_decoder_h_
-#define _mpcdec_decoder_h_
-
-#include "huffman.h"
-#include "math.h"
-#include "mpcdec.h"
-#include "reader.h"
-#include "streaminfo.h"
-
-#define MPC_SUPPORT_SV456
-
-#define SEEKING_TABLE_SIZE  256u
-// set it to SLOW_SEEKING_WINDOW to not use fast seeking
-#define FAST_SEEKING_WINDOW 32
-// set it to FAST_SEEKING_WINDOW to only use fast seeking
-#define SLOW_SEEKING_WINDOW 0x80000000
-
-enum {
-    MPC_V_MEM = 2304,
-    MPC_DECODER_MEMSIZE = 16384,  // overall buffer size
-};
-
-typedef struct {
-    mpc_int32_t  L [36];
-    mpc_int32_t  R [36];
-} QuantTyp;
-
-typedef struct mpc_decoder_t {
-    mpc_reader *r;
-
-    /// @name internal state variables
-    //@{
-
-    mpc_uint32_t  dword; /// currently decoded 32bit-word
-    mpc_uint32_t  pos;   /// bit-position within dword
-    mpc_uint32_t  Speicher[MPC_DECODER_MEMSIZE]; /// read-buffer
-    mpc_uint32_t  Zaehler; /// actual index within read-buffer
-
-    mpc_uint32_t  samples_to_skip;
-
-    mpc_uint32_t  DecodedFrames;
-    mpc_uint32_t  OverallFrames;
-    mpc_int32_t   SampleRate;                 // Sample frequency
-
-    mpc_uint32_t  StreamVersion;              // version of bitstream
-    mpc_int32_t   Max_Band;
-    mpc_uint32_t  MPCHeaderPos;               // AB: needed to support ID3v2
-
-    mpc_uint32_t  FrameWasValid;
-    mpc_uint32_t  MS_used;                    // MS-coding used ?
-    mpc_uint32_t  TrueGaplessPresent;
-
-    mpc_uint32_t  WordsRead;                  // counts amount of decoded dwords
-
-    // randomizer state variables
-    mpc_uint32_t  __r1; 
-    mpc_uint32_t  __r2; 
-
-    // seeking
-    mpc_uint32_t  seeking_table[SEEKING_TABLE_SIZE];
-    mpc_uint32_t  seeking_pwr;                // distance between 2 frames in seeking_table = 2^seeking_pwr
-    mpc_uint32_t  seeking_table_frames;       // last frame in seaking table
-    mpc_uint32_t  seeking_window;             // number of frames to look for scalefactors
-
-    mpc_int32_t   SCF_Index_L [32] [3];
-    mpc_int32_t   SCF_Index_R [32] [3];       // holds scalefactor-indices
-    QuantTyp      Q [32];                     // holds quantized samples
-    mpc_int32_t   Res_L [32];
-    mpc_int32_t   Res_R [32];                 // holds the chosen quantizer for each subband
-    mpc_bool_t    DSCF_Flag_L [32];
-    mpc_bool_t    DSCF_Flag_R [32];           // differential SCF used?
-    mpc_int32_t   SCFI_L [32];
-    mpc_int32_t   SCFI_R [32];                // describes order of transmitted SCF
-    mpc_bool_t    MS_Flag[32];                // MS used?
-#ifdef MPC_FIXED_POINT
-    unsigned char SCF_shift[256];
-#endif
-
-    MPC_SAMPLE_FORMAT V_L[MPC_V_MEM + 960];
-    MPC_SAMPLE_FORMAT V_R[MPC_V_MEM + 960];
-    MPC_SAMPLE_FORMAT Y_L[36][32];
-    MPC_SAMPLE_FORMAT Y_R[36][32];
-    MPC_SAMPLE_FORMAT SCF[256]; ///< holds adapted scalefactors (for clipping prevention)
-    //@}
-
-} mpc_decoder;
-
-#endif // _mpc_decoder_h
Index: libmpcdec/branches/zorg/include/mpcdec/huffman.h
===================================================================
--- libmpcdec/branches/zorg/include/mpcdec/huffman.h	(revision 63)
+++ 	(revision )
@@ -1,58 +1,0 @@
-/*
-  Copyright (c) 2005, The Musepack Development Team
-  All rights reserved.
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions are
-  met:
-
-  * Redistributions of source code must retain the above copyright
-  notice, this list of conditions and the following disclaimer.
-
-  * Redistributions in binary form must reproduce the above
-  copyright notice, this list of conditions and the following
-  disclaimer in the documentation and/or other materials provided
-  with the distribution.
-
-  * Neither the name of the The Musepack Development Team nor the
-  names of its contributors may be used to endorse or promote
-  products derived from this software without specific prior
-  written permission.
-
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/// \file huffman.h
-/// Data structures and functions for huffman coding.
-
-#ifndef _mpcdec_huffman_h_
-#define _mpcdec_huffman_h_
-
-#ifndef WIN32
-#include "mpcdec/config_types.h"
-#else
-#include "mpcdec/config_win32.h"
-#endif
-
-#include "decoder.h"
-
-struct mpc_decoder_t; // forward declare to break circular dependencies
-
-/// Huffman table entry.
-typedef struct huffman_type_t {
-    mpc_uint32_t  Code;
-    mpc_uint16_t  Length;
-    mpc_int16_t   Value;
-} HuffmanTyp;
-
-#endif // _mpcdec_huffman_h_
Index: libmpcdec/branches/zorg/include/mpcdec/internal.h
===================================================================
--- libmpcdec/branches/zorg/include/mpcdec/internal.h	(revision 63)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/*
-  Copyright (c) 2005, The Musepack Development Team
-  All rights reserved.
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions are
-  met:
-
-  * Redistributions of source code must retain the above copyright
-  notice, this list of conditions and the following disclaimer.
-
-  * Redistributions in binary form must reproduce the above
-  copyright notice, this list of conditions and the following
-  disclaimer in the documentation and/or other materials provided
-  with the distribution.
-
-  * Neither the name of the The Musepack Development Team nor the
-  names of its contributors may be used to endorse or promote
-  products derived from this software without specific prior
-  written permission.
-
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/// \file internal.h
-/// Definitions and structures used only internally by the libmpcdec.
-
-#ifndef _mpcdec_internal_h
-#define _mpcdec_internal_h
-
-
-enum {
-    MPC_DECODER_SYNTH_DELAY = 481
-};
-
-/// Big/little endian 32 bit byte swapping routine.
-static __inline
-mpc_uint32_t mpc_swap32(mpc_uint32_t val) {
-    return (((val & 0xff000000) >> 24) | ((val & 0x00ff0000) >> 8) |
-            ((val & 0x0000ff00) <<  8) | ((val & 0x000000ff) << 24));
-}
-
-/// Searches for a ID3v2-tag and reads the length (in bytes) of it.
-/// \param reader supplying raw stream data
-/// \return size of tag, in bytes
-/// \return -1 on errors of any kind
-mpc_int32_t JumpID3v2(mpc_reader* fp);
-
-/// helper functions used by multiple files
-mpc_uint32_t mpc_random_int(mpc_decoder *d); // in synth_filter.c
-void mpc_decoder_initialisiere_quantisierungstabellen(mpc_decoder *d, double scale_factor);
-void mpc_decoder_synthese_filter_float(mpc_decoder *d, MPC_SAMPLE_FORMAT* OutData);
-
-#endif // _mpcdec_internal_h
-
Index: libmpcdec/branches/zorg/include/mpcdec/math.h
===================================================================
--- libmpcdec/branches/zorg/include/mpcdec/math.h	(revision 63)
+++ 	(revision )
@@ -1,144 +1,0 @@
-/*
-  Copyright (c) 2005, The Musepack Development Team
-  All rights reserved.
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions are
-  met:
-
-  * Redistributions of source code must retain the above copyright
-  notice, this list of conditions and the following disclaimer.
-
-  * Redistributions in binary form must reproduce the above
-  copyright notice, this list of conditions and the following
-  disclaimer in the documentation and/or other materials provided
-  with the distribution.
-
-  * Neither the name of the The Musepack Development Team nor the
-  names of its contributors may be used to endorse or promote
-  products derived from this software without specific prior
-  written permission.
-
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/// \file math.h
-/// Libmpcdec internal math routines.  
-
-#ifndef _mpcdec_math_h_
-#define _mpcdec_math_h_
-
-//#define MPC_FIXED_POINT
-
-#define MPC_FIXED_POINT_SHIFT 16
-
-#ifdef MPC_FIXED_POINT
-
-
-#ifdef _WIN32_WCE
-
-#include <cmnintrin.h>
-
-#define MPC_HAVE_MULHIGH
-
-#endif
-
-
-#define MPC_FIXED_POINT_SCALE_SHIFT (MPC_FIXED_POINT_SHIFT + MPC_FIXED_POINT_FRACTPART)
-#define MPC_FIXED_POINT_SCALE (1 << (MPC_FIXED_POINT_SCALE_SHIFT - 1))
-
-
-//in fixedpoint mode, results in decode output buffer are in -MPC_FIXED_POINT_SCALE ... MPC_FIXED_POINT_SCALE range
-
-#define MPC_FIXED_POINT_FRACTPART 14
-typedef mpc_int32_t MPC_SAMPLE_FORMAT;
-
-typedef mpc_int64_t MPC_SAMPLE_FORMAT_MULTIPLY;
-
-#define MAKE_MPC_SAMPLE(X) (MPC_SAMPLE_FORMAT)((double)(X) * (double)(((mpc_int64_t)1)<<MPC_FIXED_POINT_FRACTPART))
-#define MAKE_MPC_SAMPLE_EX(X,Y) (MPC_SAMPLE_FORMAT)((double)(X) * (double)(((mpc_int64_t)1)<<(Y)))
-
-#define MPC_MULTIPLY_NOTRUNCATE(X,Y) \
-	(((MPC_SAMPLE_FORMAT_MULTIPLY)(X) * (MPC_SAMPLE_FORMAT_MULTIPLY)(Y)) >> MPC_FIXED_POINT_FRACTPART)
-
-#define MPC_MULTIPLY_EX_NOTRUNCATE(X,Y,Z) \
-	(((MPC_SAMPLE_FORMAT_MULTIPLY)(X) * (MPC_SAMPLE_FORMAT_MULTIPLY)(Y)) >> (Z))
-
-#ifdef _DEBUG
-static inline MPC_SAMPLE_FORMAT MPC_MULTIPLY(MPC_SAMPLE_FORMAT item1,MPC_SAMPLE_FORMAT item2)
-{
-	MPC_SAMPLE_FORMAT_MULTIPLY temp = MPC_MULTIPLY_NOTRUNCATE(item1,item2);
-	assert(temp == (MPC_SAMPLE_FORMAT_MULTIPLY)(MPC_SAMPLE_FORMAT)temp);
-	return (MPC_SAMPLE_FORMAT)temp;
-}
-
-static inline MPC_SAMPLE_FORMAT MPC_MULTIPLY_EX(MPC_SAMPLE_FORMAT item1,MPC_SAMPLE_FORMAT item2,unsigned shift)
-{
-	MPC_SAMPLE_FORMAT_MULTIPLY temp = MPC_MULTIPLY_EX_NOTRUNCATE(item1,item2,shift);
-	assert(temp == (MPC_SAMPLE_FORMAT_MULTIPLY)(MPC_SAMPLE_FORMAT)temp);
-	return (MPC_SAMPLE_FORMAT)temp;
-}
-
-#else
-
-#define MPC_MULTIPLY(X,Y) ((MPC_SAMPLE_FORMAT)MPC_MULTIPLY_NOTRUNCATE(X,Y))
-#define MPC_MULTIPLY_EX(X,Y,Z) ((MPC_SAMPLE_FORMAT)MPC_MULTIPLY_EX_NOTRUNCATE(X,Y,Z))
-
-#endif
-
-#ifdef MPC_HAVE_MULHIGH
-#define MPC_MULTIPLY_FRACT(X,Y) _MulHigh(X,Y)
-#else
-#define MPC_MULTIPLY_FRACT(X,Y) MPC_MULTIPLY_EX(X,Y,32)
-#endif
-
-#define MPC_MAKE_FRACT_CONST(X) (MPC_SAMPLE_FORMAT)((X) * (double)(((mpc_int64_t)1)<<32) )
-#define MPC_MULTIPLY_FRACT_CONST(X,Y) MPC_MULTIPLY_FRACT(X,MPC_MAKE_FRACT_CONST(Y))
-#define MPC_MULTIPLY_FRACT_CONST_FIX(X,Y,Z) ( MPC_MULTIPLY_FRACT(X,MPC_MAKE_FRACT_CONST( Y / (1<<(Z)) )) << (Z) )
-#define MPC_MULTIPLY_FRACT_CONST_SHR(X,Y,Z) MPC_MULTIPLY_FRACT(X,MPC_MAKE_FRACT_CONST( Y / (1<<(Z)) ))
-
-#define MPC_MULTIPLY_FLOAT_INT(X,Y) ((X)*(Y))
-#define MPC_SCALE_CONST(X,Y,Z) MPC_MULTIPLY_EX(X,MAKE_MPC_SAMPLE_EX(Y,Z),(Z))
-#define MPC_SCALE_CONST_SHL(X,Y,Z,S) MPC_MULTIPLY_EX(X,MAKE_MPC_SAMPLE_EX(Y,Z),(Z)-(S))
-#define MPC_SCALE_CONST_SHR(X,Y,Z,S) MPC_MULTIPLY_EX(X,MAKE_MPC_SAMPLE_EX(Y,Z),(Z)+(S))
-#define MPC_SHR(X,Y) ((X)>>(Y))
-#define MPC_SHL(X,Y) ((X)<<(Y))
-
-#else
-
-//in floating-point mode, decoded samples are in -1...1 range
-
-typedef float MPC_SAMPLE_FORMAT;
-
-#define MAKE_MPC_SAMPLE(X) ((MPC_SAMPLE_FORMAT)(X))
-#define MAKE_MPC_SAMPLE_EX(X,Y) ((MPC_SAMPLE_FORMAT)(X))
-
-#define MPC_MULTIPLY_FRACT(X,Y) ((X)*(Y))
-#define MPC_MAKE_FRACT_CONST(X) (X)
-#define MPC_MULTIPLY_FRACT_CONST(X,Y) MPC_MULTPLY_FRACT(X,MPC_MAKE_FRACT_CONST(Y))
-#define MPC_MULTIPLY_FRACT_CONST_SHR(X,Y,Z) MPC_MULTIPLY_FRACT(X,MPC_MAKE_FRACT_CONST( Y ))
-#define MPC_MULTIPLY_FRACT_CONST_FIX(X,Y,Z) MPC_MULTIPLY_FRACT(X,MPC_MAKE_FRACT_CONST( Y ))
-
-#define MPC_MULTIPLY_FLOAT_INT(X,Y) ((X)*(Y))
-#define MPC_MULTIPLY(X,Y) ((X)*(Y))
-#define MPC_MULTIPLY_EX(X,Y,Z) ((X)*(Y))
-#define MPC_SCALE_CONST(X,Y,Z) ((X)*(Y))
-#define MPC_SCALE_CONST_SHL(X,Y,Z,S) ((X)*(Y))
-#define MPC_SCALE_CONST_SHR(X,Y,Z,S) ((X)*(Y))
-#define MPC_SHR(X,Y) (X)
-#define MPC_SHL(X,Y) (X)
-
-#endif
-
-#endif // _mpcdec_math_h_
-
Index: libmpcdec/branches/zorg/include/mpcdec/mpc_types.h
===================================================================
--- libmpcdec/branches/zorg/include/mpcdec/mpc_types.h	(revision 68)
+++ libmpcdec/branches/zorg/include/mpcdec/mpc_types.h	(revision 68)
@@ -0,0 +1,96 @@
+/*
+  Copyright (c) 2005, The Musepack Development Team
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions are
+  met:
+
+  * Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+
+  * Redistributions in binary form must reproduce the above
+  copyright notice, this list of conditions and the following
+  disclaimer in the documentation and/or other materials provided
+  with the distribution.
+
+  * Neither the name of the The Musepack Development Team nor the
+  names of its contributors may be used to endorse or promote
+  products derived from this software without specific prior
+  written permission.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+#ifndef _MPC_TYPES_H_
+#define _MPC_TYPES_H_
+#ifdef WIN32
+#pragma once
+#endif
+
+#include <stdlib.h>
+#include <memory.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef WIN32
+typedef __int8           mpc_int8_t;
+typedef unsigned __int8  mpc_uint8_t;
+typedef __int16          mpc_int16_t;
+typedef unsigned __int16 mpc_uint16_t;
+typedef __int32          mpc_int32_t;
+typedef unsigned __int32 mpc_uint32_t;
+typedef __int64          mpc_int64_t;
+#define mpc_inline __inline
+#define MPC_LITTLE_ENDIAN
+#else
+#include <stdint.h>
+typedef int8_t   mpc_int8_t;
+typedef uint8_t  mpc_uint8_t;
+typedef int16_t  mpc_int16_t;
+typedef uint16_t mpc_uint16_t;
+typedef int32_t  mpc_int32_t;
+typedef uint32_t mpc_uint32_t;
+typedef int64_t  mpc_int64_t;
+#define mpc_inline inline
+#endif
+
+/// Libmpcdec error codes
+typedef enum mpc_status {
+    MPC_STATUS_OK        =  0,
+    MPC_STATUS_FILE      = -1,
+    MPC_STATUS_SV7BETA   = -2,
+    MPC_STATUS_CBR       = -3,
+    MPC_STATUS_IS        = -4,
+    MPC_STATUS_BLOCKSIZE = -5,
+    MPC_STATUS_INVALIDSV = -6
+} mpc_status;
+
+#ifdef MPC_FIXED_POINT
+typedef mpc_int32_t MPC_SAMPLE_FORMAT;
+#else
+typedef float       MPC_SAMPLE_FORMAT;
+#endif
+
+typedef mpc_uint8_t mpc_bool_t;
+
+enum {
+    FALSE = 0,
+    TRUE  = !FALSE
+};
+
+#ifdef __cplusplus
+}
+#endif
+#endif
Index: libmpcdec/branches/zorg/include/mpcdec/mpcdec.h
===================================================================
--- libmpcdec/branches/zorg/include/mpcdec/mpcdec.h	(revision 63)
+++ libmpcdec/branches/zorg/include/mpcdec/mpcdec.h	(revision 68)
@@ -32,10 +32,13 @@
   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
-
 /// \file mpcdec.h
 /// Top level include file for libmpcdec.
+#ifndef _MPCDEC_H_
+#define _MPCDEC_H_
+#ifdef WIN32
+#pragma once
+#endif
 
-#ifndef _mpcdec_h_
-#define _mpcdec_h_
+#include "streaminfo.h"
 
 #ifdef __cplusplus
@@ -43,73 +46,30 @@
 #endif
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifndef WIN32
-#include "mpcdec/config_types.h"
-#else
-#include "mpcdec/config_win32.h"
-#endif
-
-#include "decoder.h"
-#include "math.h"
-#include "reader.h"
-#include "streaminfo.h"
-    
-enum {
-    MPC_FRAME_LENGTH = (36 * 32),    /// samples per mpc frame
-    MPC_DECODER_BUFFER_LENGTH = 4 * MPC_FRAME_LENGTH /// required buffer size for decoder
-};
-
-// error codes
-#define ERROR_CODE_OK            0
-#define ERROR_CODE_FILE         -1
-#define ERROR_CODE_SV7BETA       1
-#define ERROR_CODE_CBR           2
-#define ERROR_CODE_IS            3
-#define ERROR_CODE_BLOCKSIZE     4
-#define ERROR_CODE_INVALIDSV     5
-
-/// Initializes a streaminfo structure.
-/// \param si streaminfo structure to initialize
-void mpc_streaminfo_init(mpc_streaminfo *si);
-
-/// Reads streaminfo header from the mpc stream supplied by r.
-/// \param si streaminfo pointer to which info will be written
-/// \param r stream reader to supply raw data
-/// \return error code
-mpc_int32_t mpc_streaminfo_read(mpc_streaminfo *si, mpc_reader *r);
-
-/// Gets length of stream si, in seconds.
-/// \return length of stream in seconds
-double mpc_streaminfo_get_length(mpc_streaminfo *si);
-
-/// Returns length of stream si, in samples.
-/// \return length of stream in samples
-mpc_int64_t mpc_streaminfo_get_length_samples(mpc_streaminfo *si);
+typedef struct mpc_decoder_t mpc_decoder;
 
 /// Sets up decoder library.
 /// Call this first when preparing to decode an mpc stream.
-/// \param r reader that will supply raw data to the decoder
-void mpc_decoder_setup(mpc_decoder *d, mpc_reader *r);
+/// \param p_reader reader that will supply raw data to the decoder
+void mpc_decoder_setup(mpc_decoder *p_dec, mpc_reader *p_reader);
 
 /// Initializes mpc decoder with the supplied stream info parameters.
-/// Call this next after calling mpc_decoder_setup.
 /// \param si streaminfo structure indicating format of source stream
 /// \return TRUE if decoder was initalized successfully, FALSE otherwise    
-mpc_bool_t mpc_decoder_initialize(mpc_decoder *d, mpc_streaminfo *si);
+mpc_status mpc_init_decoder(mpc_decoder **p_dec, mpc_streaminfo *si);
+
+/// Releases input mpc decoder 
+void mpc_exit_decoder(mpc_decoder *p_dec);
 
 /// Call this next after calling mpc_decoder_setup.
 /// \param si streaminfo structure indicating format of source stream
 /// \param fast_seeking boolean 0 = use fast seeking if safe, 1 = force fast seeking
-void mpc_decoder_set_seeking(mpc_decoder *d, mpc_streaminfo *si, mpc_bool_t fast_seeking);
+void mpc_decoder_set_seeking(mpc_decoder *p_dec, mpc_streaminfo *si, mpc_bool_t fast_seeking);
 
-void mpc_decoder_set_streaminfo(mpc_decoder *d, mpc_streaminfo *si);
+void mpc_decoder_set_streaminfo(mpc_decoder *p_dec, mpc_streaminfo *si);
 
 /// Sets decoder sample scaling factor.  All decoded samples will be multiplied
 /// by this factor.
 /// \param scale_factor multiplicative scaling factor
-void mpc_decoder_scale_output(mpc_decoder *d, double scale_factor);
+void mpc_decoder_scale_output(mpc_decoder *p_dec, double scale_factor);
 
 /// Actually reads data from previously initialized stream.  Call
@@ -122,24 +82,23 @@
 /// \return > 0 to indicate the number of bytes that were actually read from the stream.
 mpc_uint32_t mpc_decoder_decode(
-    mpc_decoder *d,
+    mpc_decoder       *p_dec,
     MPC_SAMPLE_FORMAT *buffer, 
-    mpc_uint32_t *vbr_update_acc, 
-    mpc_uint32_t *vbr_update_bits);
+    mpc_uint32_t      *vbr_update_acc, 
+    mpc_uint32_t      *vbr_update_bits);
 
 mpc_uint32_t mpc_decoder_decode_frame(
-    mpc_decoder *d,
-    mpc_uint32_t *in_buffer,
-    mpc_uint32_t in_len,
+    mpc_decoder       *p_dec,
+    mpc_uint32_t      *in_buffer,
+    mpc_uint32_t      in_len,
     MPC_SAMPLE_FORMAT *out_buffer);
 
 /// Seeks to the specified sample in the source stream.
-mpc_bool_t mpc_decoder_seek_sample(mpc_decoder *d, mpc_int64_t destsample);
+mpc_bool_t mpc_decoder_seek_sample(mpc_decoder *p_dec, mpc_int64_t destsample);
 
 /// Seeks to specified position in seconds in the source stream.
-mpc_bool_t mpc_decoder_seek_seconds(mpc_decoder *d, double seconds);
+mpc_bool_t mpc_decoder_seek_seconds(mpc_decoder *p_dec, double seconds);
 
 #ifdef __cplusplus
 }
-#endif // __cplusplus
-
-#endif // _mpcdec_h_
+#endif
+#endif
Index: libmpcdec/branches/zorg/include/mpcdec/reader.h
===================================================================
--- libmpcdec/branches/zorg/include/mpcdec/reader.h	(revision 63)
+++ libmpcdec/branches/zorg/include/mpcdec/reader.h	(revision 68)
@@ -32,9 +32,17 @@
   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
+/// \file reader.h
+#ifndef _MPCDEC_READER_H_
+#define _MPCDEC_READER_H_
+#ifdef WIN32
+#pragma once
+#endif
 
-/// \file reader.h
+#include "mpc_types.h"
 
-#ifndef _mpcdec_reader_h_
-#define _mpcdec_reader_h_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 
 /// \brief Stream reader interface structure.
@@ -43,40 +51,40 @@
 /// to feed it with raw data.  Implement the five member functions to provide
 /// a functional reader.
-typedef struct mpc_reader_t {
+typedef struct mpc_reader_t mpc_reader;
+struct mpc_reader_t {
     /// Reads size bytes of data into buffer at ptr.
-	mpc_int32_t (*read)(void *t, void *ptr, mpc_int32_t size);
+	mpc_int32_t (*read)(mpc_reader *p_reader, void *ptr, mpc_int32_t size);
 
     /// Seeks to byte position offset.
-	mpc_bool_t (*seek)(void *t, mpc_int32_t offset);
+	mpc_bool_t (*seek)(mpc_reader *p_reader, mpc_int32_t offset);
 
     /// Returns the current byte offset in the stream.
-	mpc_int32_t (*tell)(void *t);
+	mpc_int32_t (*tell)(mpc_reader *p_reader);
 
     /// Returns the total length of the source stream, in bytes.
-	mpc_int32_t (*get_size)(void *t);
+	mpc_int32_t (*get_size)(mpc_reader *p_reader);
 
     /// True if the stream is a seekable stream.
-	mpc_bool_t (*canseek)(void *t);
+	mpc_bool_t (*canseek)(mpc_reader *p_reader);
 
     /// Field that can be used to identify a particular instance of
     /// reader or carry along data associated with that reader.
     void *data;
-
-} mpc_reader;
-
-typedef struct mpc_reader_file_t {
-	mpc_reader reader;
-
-    FILE *file;
-    long file_size;
-    mpc_bool_t is_seekable;
-} mpc_reader_file;
+};
 
 /// Initializes reader with default stdio file reader implementation.  Use
 /// this if you're just reading from a plain file.
 ///
-/// \param r reader struct to initalize
-/// \param input input stream to attach to the reader
-void mpc_reader_setup_file_reader(mpc_reader_file *r, FILE *input);
+/// \param r p_reader handle to initialize
+/// \param filename input filename to attach to the reader
+mpc_status mpc_init_stdio_reader(mpc_reader *p_reader, char *filename);
 
-#endif // _mpcdec_reader_h_
+/// Release reader with default stdio file reader implementation.
+///
+/// \param r reader handle to release
+void mpc_exit_stdio_reader(mpc_reader *p_reader);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
Index: libmpcdec/branches/zorg/include/mpcdec/requant.h
===================================================================
--- libmpcdec/branches/zorg/include/mpcdec/requant.h	(revision 63)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*
-  Copyright (c) 2005, The Musepack Development Team
-  All rights reserved.
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions are
-  met:
-
-  * Redistributions of source code must retain the above copyright
-  notice, this list of conditions and the following disclaimer.
-
-  * Redistributions in binary form must reproduce the above
-  copyright notice, this list of conditions and the following
-  disclaimer in the documentation and/or other materials provided
-  with the distribution.
-
-  * Neither the name of the The Musepack Development Team nor the
-  names of its contributors may be used to endorse or promote
-  products derived from this software without specific prior
-  written permission.
-
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/// \file requant.h
-/// Requantization function definitions.
-
-#ifndef _mpcdec_requant_h
-#define _mpcdec_requant_h_
-
-#include "mpcdec.h"
-
-/* C O N S T A N T S */
-extern const mpc_uint32_t Res_bit [18];         // bits per sample for chosen quantizer
-extern const MPC_SAMPLE_FORMAT __Cc    [1 + 18];     // coefficients for requantization
-extern const mpc_int32_t          __Dc    [1 + 18];     // offset for requantization
-
-#define Cc      (__Cc + 1)
-#define Dc      (__Dc + 1)
-
-#endif // _mpcdec_requant_h_
Index: libmpcdec/branches/zorg/include/mpcdec/streaminfo.h
===================================================================
--- libmpcdec/branches/zorg/include/mpcdec/streaminfo.h	(revision 63)
+++ libmpcdec/branches/zorg/include/mpcdec/streaminfo.h	(revision 68)
@@ -32,9 +32,18 @@
   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
+/// \file streaminfo.h
+#ifndef _MPCDEC_STREAMINFO_H_
+#define _MPCDEC_STREAMINFO_H_
+#ifdef WIN32
+#pragma once
+#endif
 
-/// \file streaminfo.h
+#include "mpc_types.h"
+#include "reader.h"
 
-#ifndef _mpcdec_streaminfo_h_
-#define _mpcdec_streaminfo_h_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 
 typedef mpc_int32_t mpc_streaminfo_off_t;
@@ -45,47 +54,64 @@
 /// by the streaminfo_read function.
 typedef struct mpc_streaminfo {
-    /// @name core mpc stream properties
+    /// @name Core mpc stream properties
     //@{
-    mpc_uint32_t         sample_freq;        ///< sample frequency of stream
-    mpc_uint32_t         channels;           ///< number of channels in stream
-    mpc_streaminfo_off_t header_position;    ///< byte offset of position of header in stream
-    mpc_uint32_t         stream_version;     ///< streamversion of stream
-    mpc_uint32_t         bitrate;            ///< bitrate of stream file (in bps)
-    double               average_bitrate;    ///< average bitrate of stream (in bits/sec)
-    mpc_uint32_t         frames;             ///< number of frames in stream
-    mpc_int64_t          pcm_samples;
-    mpc_uint32_t         max_band;           ///< maximum band-index used in stream (0...31)
-    mpc_uint32_t         is;                 ///< intensity stereo (0: off, 1: on)
-    mpc_uint32_t         ms;                 ///< mid/side stereo (0: off, 1: on)
-    mpc_uint32_t         block_size;         ///< only needed for SV4...SV6 -> not supported
-    mpc_uint32_t         profile;            ///< quality profile of stream
-    const char*          profile_name;       ///< name of profile used by stream
+    mpc_uint32_t         sample_freq;        ///< Sample frequency of stream
+    mpc_uint32_t         channels;           ///< Number of channels in stream
+    mpc_streaminfo_off_t header_position;    ///< Byte offset of position of header in stream
+    mpc_uint32_t         stream_version;     ///< Streamversion of stream
+    mpc_uint32_t         bitrate;            ///< Bitrate of stream file (in bps)
+    double               average_bitrate;    ///< Average bitrate of stream (in bits/sec)
+    mpc_uint32_t         frames;             ///< Number of frames in stream
+    mpc_int64_t          pcm_samples;        ///< Approximate number of pcm samples in stream
+    mpc_uint32_t         max_band;           ///< Maximum band-index used in stream (0...31)
+    mpc_uint32_t         is;                 ///< Intensity stereo (0: off, 1: on)
+    mpc_uint32_t         ms;                 ///< Mid/side stereo (0: off, 1: on)
+    mpc_uint32_t         block_size;         ///< Only needed for SV4...SV6 -> not supported
+    mpc_uint32_t         profile;            ///< Quality profile of stream
+    const char*          profile_name;       ///< Name of profile used by stream
+    mpc_uint32_t         fast_seek;          ///< True if stream supports fast-seeking
     //@}
 
-    /// @name replaygain related fields
+    /// @name Replaygain properties
     //@{
-    mpc_int16_t         gain_title;          ///< replaygain title value 
-    mpc_int16_t         gain_album;          ///< replaygain album value
-    mpc_uint16_t        peak_album;          ///< peak album loudness level
-    mpc_uint16_t        peak_title;          ///< peak title loudness level
+    mpc_int16_t          gain_title;         ///< Replaygain title value 
+    mpc_int16_t          gain_album;         ///< Replaygain album value
+    mpc_uint16_t         peak_album;         ///< Peak album loudness level
+    mpc_uint16_t         peak_title;         ///< Peak title loudness level
     //@}
 
-    /// @name true gapless support data
+    /// @name True gapless properties
     //@{
-    mpc_uint32_t        is_true_gapless;     ///< true gapless? (0: no, 1: yes)
-    mpc_uint32_t        last_frame_samples;  ///< number of valid samples within last frame
+    mpc_uint32_t         is_true_gapless;    ///< True gapless? (0: no, 1: yes)
+    mpc_uint32_t         last_frame_samples; ///< Number of valid samples within last frame
 
-    mpc_uint32_t        encoder_version;     ///< version of encoder used
-    char                encoder[256];        ///< encoder name
+    mpc_uint32_t         encoder_version;    ///< Version of encoder used
+    char                 encoder[256];       ///< Encoder name
 
-    mpc_streaminfo_off_t tag_offset;         ///< offset to file tags
-    mpc_streaminfo_off_t total_file_length;  ///< total length of underlying file
-    //@}
-
-    /// @name fast seeking support
-    //@{
-    mpc_uint32_t        fast_seek;           ///< support fast seeking ? (0: no, 1: yes)
+    mpc_streaminfo_off_t tag_offset;         ///< Ofset to file tags
+    mpc_streaminfo_off_t total_file_length;  ///< Total length of underlying file
     //@}
 } mpc_streaminfo;
 
-#endif // _mpcdec_streaminfo_h_
+/// Initializes a streaminfo structure.
+/// \param si streaminfo structure to initialize
+void mpc_streaminfo_init(mpc_streaminfo *si);
+
+/// Reads streaminfo header from the mpc stream supplied by r.
+/// \param si si pointer to which info will be written
+/// \param p_reader stream reader to supply raw data
+/// \return error code
+mpc_status mpc_streaminfo_read(mpc_streaminfo *si, mpc_reader *p_reader);
+
+/// Gets length of stream si, in seconds.
+/// \return length of stream in seconds
+double mpc_streaminfo_get_length(mpc_streaminfo *si);
+
+/// Returns length of stream si, in samples.
+/// \return length of stream in samples
+mpc_int64_t mpc_streaminfo_get_length_samples(mpc_streaminfo *si);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
