Index: /libmpcdec/tags/release-1.1/AUTHORS
===================================================================
--- /libmpcdec/tags/release-1.1/AUTHORS	(revision 30)
+++ /libmpcdec/tags/release-1.1/AUTHORS	(revision 30)
@@ -0,0 +1,10 @@
+libmusepack is the result of the work of many people:
+
+* Andree Buschmann and Frank Klemm
+  Original implementation and core development.
+
+* Peter Pawlowski and Benoit Amiaux
+  Portability and further optimizations.
+
+* Miles Egan
+  Port to pure C, documentation, and api refinements.
Index: /libmpcdec/tags/release-1.1/COPYING
===================================================================
--- /libmpcdec/tags/release-1.1/COPYING	(revision 30)
+++ /libmpcdec/tags/release-1.1/COPYING	(revision 30)
@@ -0,0 +1,31 @@
+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.
Index: /libmpcdec/tags/release-1.1/ChangeLog
===================================================================
--- /libmpcdec/tags/release-1.1/ChangeLog	(revision 30)
+++ /libmpcdec/tags/release-1.1/ChangeLog	(revision 30)
@@ -0,0 +1,12 @@
+
+1.1
+    * add compliance & cleanup patches from Michael Roitzsch of xine project 	
+    * switch to BSD license
+    * port to pure C
+    * add doxygen documentation
+    * revise API somewhat
+	
+1.0.3			
+    * autotools build process
+    * sample binary added
+    * floating-point mode by default
Index: /libmpcdec/tags/release-1.1/INSTALL
===================================================================
--- /libmpcdec/tags/release-1.1/INSTALL	(revision 30)
+++ /libmpcdec/tags/release-1.1/INSTALL	(revision 30)
@@ -0,0 +1,3 @@
+How to install libmusepack:
+"./configure && make" as a regular user
+"make install" as root
Index: /libmpcdec/tags/release-1.1/Makefile.am
===================================================================
--- /libmpcdec/tags/release-1.1/Makefile.am	(revision 30)
+++ /libmpcdec/tags/release-1.1/Makefile.am	(revision 30)
@@ -0,0 +1,5 @@
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+
+SUBDIRS = src include
Index: /libmpcdec/tags/release-1.1/README
===================================================================
--- /libmpcdec/tags/release-1.1/README	(revision 30)
+++ /libmpcdec/tags/release-1.1/README	(revision 30)
@@ -0,0 +1,6 @@
+Musepack Decoder Library 1.1:
+
+run "./configure; make"
+
+To create a sample app using the musepack decoder library in src/
+Check src/sample.cpp for more details.
Index: /libmpcdec/tags/release-1.1/autogen.sh
===================================================================
--- /libmpcdec/tags/release-1.1/autogen.sh	(revision 30)
+++ /libmpcdec/tags/release-1.1/autogen.sh	(revision 30)
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+libtoolize --copy --force
+aclocal
+autoheader
+automake --gnu --add-missing --copy
+autoconf
Index: /libmpcdec/tags/release-1.1/configure.in
===================================================================
--- /libmpcdec/tags/release-1.1/configure.in	(revision 30)
+++ /libmpcdec/tags/release-1.1/configure.in	(revision 30)
@@ -0,0 +1,202 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(src/mpc_decoder.c)
+AC_CONFIG_AUX_DIR(config)
+AM_INIT_AUTOMAKE(libmusepack,1.1)
+AM_CONFIG_HEADER(include/config.h)
+
+AM_PROG_LIBTOOL
+
+CFLAGS="$CFLAGS -O3 -fomit-frame-pointer -fPIC"
+
+AC_C_BIGENDIAN(,CFLAGS="$CFLAGS -DMPC_LITTLE_ENDIAN",)
+
+AC_HEADER_STDC
+AC_CHECK_HEADERS([inttypes.h string.h])
+
+AC_HEADER_STDBOOL
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_OFF_T
+AC_TYPE_SIZE_T
+AC_CHECK_TYPES([ptrdiff_t])
+
+AC_FUNC_MEMCMP
+AC_CHECK_FUNCS([memmove memset sqrt])
+
+AC_MSG_CHECKING(for int16_t)
+AC_CACHE_VAL(has_int16_t,
+[AC_TRY_RUN([
+int16_t foo;
+int main() {return 0;}
+],
+has_int16_t=yes,
+has_int16_t=no,
+has_int16_t=no
+)])
+AC_MSG_RESULT($has_int16_t)
+
+AC_MSG_CHECKING(for int32_t)
+AC_CACHE_VAL(has_int32_t,
+[AC_TRY_RUN([
+int32_t foo;
+int main() {return 0;}
+],
+has_int32_t=yes,
+has_int32_t=no,
+has_int32_t=no
+)])
+AC_MSG_RESULT($has_int32_t)
+
+AC_MSG_CHECKING(for uint32_t)
+AC_CACHE_VAL(has_uint32_t,
+[AC_TRY_RUN([
+uint32_t foo;
+int main() {return 0;}
+],
+has_uint32_t=yes,
+has_uint32_t=no,
+has_uint32_t=no
+)])
+AC_MSG_RESULT($has_uint32_t)
+
+AC_MSG_CHECKING(for uint16_t)
+AC_CACHE_VAL(has_uint16_t,
+[AC_TRY_RUN([
+uint16_t foo;
+int main() {return 0;}
+],
+has_uint16_t=yes,
+has_uint16_t=no,
+has_uint16_t=no
+)])
+AC_MSG_RESULT($has_uint16_t)
+
+AC_MSG_CHECKING(for u_int32_t)
+AC_CACHE_VAL(has_u_int32_t,
+[AC_TRY_RUN([
+u_int32_t foo;
+int main() {return 0;}
+],
+has_u_int32_t=yes,
+has_u_int32_t=no,
+has_u_int32_t=no
+)])
+AC_MSG_RESULT($has_u_int32_t)
+
+AC_MSG_CHECKING(for u_int16_t)
+AC_CACHE_VAL(has_u_int16_t,
+[AC_TRY_RUN([
+u_int16_t foo;
+int main() {return 0;}
+],
+has_u_int16_t=yes,
+has_u_int16_t=no,
+has_u_int16_t=no
+)])
+AC_MSG_RESULT($has_u_int16_t)
+
+AC_MSG_CHECKING(for int64_t)
+AC_CACHE_VAL(has_int64_t,
+[AC_TRY_RUN([
+int64_t foo;
+int main() {return 0;}
+],
+has_int64_t=yes,
+has_int64_t=no,
+has_int64_t=no
+)])
+AC_MSG_RESULT($has_int64_t)
+
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+
+
+if test x$has_int16_t = "xyes" ; then
+        SIZE16="int16_t"
+else
+        case 2 in
+                $ac_cv_sizeof_short) SIZE16="short";;
+                $ac_cv_sizeof_int) SIZE16="int";;
+        esac
+fi
+
+if test x$has_int32_t = "xyes" ; then
+        SIZE32="int32_t"
+else
+        case 4 in
+                $ac_cv_sizeof_short) SIZE32="short";;
+                $ac_cv_sizeof_int) SIZE32="int";;
+                $ac_cv_sizeof_long) SIZE32="long";;
+        esac
+fi
+
+if test x$has_uint32_t = "xyes" ; then
+        USIZE32="uint32_t"
+else
+        if test x$has_u_int32_t = "xyes" ; then
+                USIZE32="u_int32_t"
+        else
+                case 4 in
+                        $ac_cv_sizeof_short) USIZE32="unsigned short";;
+                        $ac_cv_sizeof_int) USIZE32="unsigned int";;
+                        $ac_cv_sizeof_long) USIZE32="unsigned long";;
+                esac
+        fi
+fi
+
+if test x$has_uint16_t = "xyes" ; then
+        USIZE16="uint16_t"
+else
+        if test x$has_u_int16_t = "xyes" ; then
+                USIZE16="u_int16_t"
+        else
+                case 2 in
+                        $ac_cv_sizeof_short) USIZE16="unsigned short";;
+                        $ac_cv_sizeof_int) USIZE16="unsigned int";;
+                        $ac_cv_sizeof_long) USIZE16="unsigned long";;
+                esac
+        fi
+fi
+
+if test x$has_int64_t = "xyes" ; then
+        SIZE64="int64_t"
+else
+case 8 in
+        $ac_cv_sizeof_int) SIZE64="int";;
+        $ac_cv_sizeof_long) SIZE64="long";;
+        $ac_cv_sizeof_long_long) SIZE64="long long";;
+esac
+fi
+
+if test -z "$SIZE16"; then
+        AC_MSG_ERROR(No 16 bit type found on this platform!)
+fi
+if test -z "$USIZE16"; then
+        AC_MSG_ERROR(No unsigned 16 bit type found on this platform!)
+fi
+if test -z "$SIZE32"; then
+        AC_MSG_ERROR(No 32 bit type found on this platform!)
+fi
+if test -z "$USIZE32"; then
+        AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
+fi
+if test -z "$SIZE64"; then
+        AC_MSG_WARN(No 64 bit type found on this platform!)
+fi
+
+dnl Make substitutions
+
+AC_SUBST(VERSION)
+AC_SUBST(LIBTOOL_DEPS)
+AC_SUBST(SIZE16)
+AC_SUBST(USIZE16)
+AC_SUBST(SIZE32)
+AC_SUBST(USIZE32)
+AC_SUBST(SIZE64)
+AC_SUBST(OPT)
+AC_SUBST(LIBS)
+
+AC_OUTPUT(Makefile src/Makefile include/Makefile include/musepack/config_types.h)
+AC_MSG_RESULT([ libmusepack $VERSION configured successfully.])
Index: /libmpcdec/tags/release-1.1/docs/Doxyfile
===================================================================
--- /libmpcdec/tags/release-1.1/docs/Doxyfile	(revision 30)
+++ /libmpcdec/tags/release-1.1/docs/Doxyfile	(revision 30)
@@ -0,0 +1,1161 @@
+# Doxyfile 1.3.9.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = libmusepack
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 1.1
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = docs
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of source 
+# files, where putting all generated files in the same directory would otherwise 
+# cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, 
+# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, 
+# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, 
+# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, 
+# Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE        = English
+
+# This tag can be used to specify the encoding used in the generated output. 
+# The encoding is not always determined by the language that is chosen, 
+# but also whether or not the output is meant for Windows or non-Windows users. 
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES 
+# forces the Windows encoding (this is the default for the Windows binary), 
+# whereas setting the tag to NO uses a Unix-style encoding (the default for 
+# all platforms other than Windows).
+
+USE_WINDOWS_ENCODING   = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is used 
+# as the annotated text. Otherwise, the brief description is used as-is. If left 
+# blank, the following values are used ("$name" is automatically replaced with the 
+# name of the entity): "The $name class" "The $name widget" "The $name file" 
+# "is" "provides" "specifies" "contains" "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = 
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited 
+# members of a class in the documentation of that class as if those members were 
+# ordinary class members. Constructors, destructors and assignment operators of 
+# the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like the Qt-style comments (thus requiring an 
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF      = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member 
+# documentation.
+
+DETAILS_AT_TOP         = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = 
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources 
+# only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources 
+# only. Doxygen will then generate output that is more tailored for Java. 
+# For instance, namespaces will be presented as packages, qualified scopes 
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories 
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
+# in the documentation.
+
+SHOW_DIRECTORIES       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text.
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT                  = include src
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp 
+# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm
+
+FILE_PATTERNS          = 
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                = include/config.h
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories 
+# that are symbolic links (a Unix filesystem feature) are excluded from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories.
+
+EXCLUDE_PATTERNS       = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = 
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# ignored.
+
+INPUT_FILTER           = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis.  Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match.  The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
+# is applied to all files.
+
+FILTER_PATTERNS        = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default) 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        = docs/custom.css
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+
+PREDEFINED             = 
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line, have an all uppercase name, and do not end with a semicolon. Such 
+# function macros are typically used for boiler-plate code, and will confuse the 
+# parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or 
+# super classes. Setting the tag to NO turns the diagrams off. Note that this 
+# option is superseded by the HAVE_DOT option below. This is only a fallback. It is 
+# recommended to install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+
+UML_LOOK               = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
+# generate a call dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable call graphs for selected 
+# functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found on the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+
+MAX_DOT_GRAPH_WIDTH    = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT   = 1024
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
+# graphs generated by dot. A depth value of 3 means that only nodes reachable 
+# from the root by following a path via at most 3 edges will be shown. Nodes that 
+# lay further from the root node will be omitted. Note that setting this option to 
+# 1 or 2 may greatly reduce the computation time needed for large code bases. Also 
+# note that a graph may be further truncated if the graph's image dimensions are 
+# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). 
+# If 0 is used for the depth value (the default), the graph is not depth-constrained.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE           = NO
Index: /libmpcdec/tags/release-1.1/docs/custom.css
===================================================================
--- /libmpcdec/tags/release-1.1/docs/custom.css	(revision 30)
+++ /libmpcdec/tags/release-1.1/docs/custom.css	(revision 30)
@@ -0,0 +1,212 @@
+BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
+	font-family: sans-serif;
+}
+h1 {
+	text-align: center;
+    text-transform: lowercase;
+    margin: 0.5em 0;
+}
+h2, h2 a { color: #f90; margin: 1em 0 0.25em 0; }
+h3, h3 a { color: #88f; margin: 1em 0 0.25em 0; }
+
+CAPTION { font-weight: bold }
+DIV.qindex {
+	width: 100%;
+	background-color: #eeeeff;
+	border: 1px solid #b0b0b0;
+	text-align: center;
+	margin: 2px;
+	padding: 2px;
+	line-height: 140%;
+}
+DIV.nav {
+	text-align: center;
+    padding: 0.25em 0;
+}
+A.qindex {
+    text-decoration: none;
+    font-weight: bold;
+    color: #1A419D;
+    text-transform: lowercase;
+}
+A.qindex:visited {
+    text-decoration: none;
+    font-weight: bold;
+    color: #1A419D
+}
+A.qindex:hover {
+	text-decoration: none;
+	background-color: #ddddff;
+}
+A.qindexHL {
+	text-decoration: none;
+	font-weight: bold;
+	background-color: #6666cc;
+	color: #ffffff;
+	border: 1px double #9295C2;
+    text-transform: lowercase;
+}
+A.qindexHL:hover {
+	text-decoration: none;
+	background-color: #6666cc;
+	color: #ffffff;
+}
+A.qindex, A.qindexHL { padding: 0.1em 0.5em; }
+A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff }
+A.el { text-decoration: none; font-weight: bold; color: #d66; font-style: italic }
+A.elRef { font-weight: bold }
+A.code:link { text-decoration: none; font-weight: normal; color: #0000FF}
+A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF}
+A.codeRef:link { font-weight: normal; color: #0000FF}
+A.codeRef:visited { font-weight: normal; color: #0000FF}
+A:hover { text-decoration: none; background-color: #f2f2ff }
+DL.el { margin-left: -1cm }
+.fragment {
+       font-family: monospace
+}
+PRE.fragment {
+	border: 1px solid #CCCCCC;
+	background-color: #f5f5f5;
+	margin-top: 4px;
+	margin-bottom: 4px;
+	margin-left: 2px;
+	margin-right: 8px;
+	padding-left: 6px;
+	padding-right: 6px;
+	padding-top: 4px;
+	padding-bottom: 4px;
+}
+hr { display: none }
+DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
+TD.md { font-weight: bold; }
+TD.mdname1, TD.mdname { color: #088; font-weight: bold; }
+TABLE[cellspacing="5"] { margin-left: 2em; }
+TABLE[cellspacing="5"] dl em { color: #088; font-weight: bold; }
+DIV.groupHeader {
+       margin-left: 16px;
+       margin-top: 12px;
+       margin-bottom: 6px;
+       font-weight: bold;
+}
+DIV.groupText { margin-left: 16px; font-style: italic; font-size: 14px }
+BODY {
+	background: white;
+	color: black;
+	margin-right: 20px;
+	margin-left: 20px;
+}
+TD.indexkey, TD.indexvalue {
+    padding: 0.1em 1em 0.1em 0.1em;
+}
+TD.indexkey {
+	font-weight: bold;
+}
+TD.indexvalue {
+	font-style: italic;
+}
+TR.memlist {
+   background-color: #f0f0f0; 
+}
+P.formulaDsp { text-align: center; }
+IMG.formulaDsp { }
+IMG.formulaInl { vertical-align: middle; }
+SPAN.keyword       { color: #008000 }
+SPAN.keywordtype   { color: #604020 }
+SPAN.keywordflow   { color: #e08000 }
+SPAN.comment       { color: #800000 }
+SPAN.preprocessor  { color: #806020 }
+SPAN.stringliteral { color: #002080 }
+SPAN.charliteral   { color: #008080 }
+.mdTable {
+}
+.mdRow {
+}
+.mdescLeft, .mdescRight {
+    font-style: italic;
+    font-size: 80%;
+}
+.mdescRight {
+}
+.memItemLeft {
+    font-style: italic;
+}
+.memItemLeft, .memItemRight {
+    font-size: 80%;
+}
+.memItemRight {
+}
+.memTemplItemLeft {
+	padding: 1px 0px 0px 8px;
+	margin: 4px;
+	border-top-width: 1px;
+	border-right-width: 1px;
+	border-bottom-width: 1px;
+	border-left-width: 1px;
+	border-top-color: #E0E0E0;
+	border-right-color: #E0E0E0;
+	border-bottom-color: #E0E0E0;
+	border-left-color: #E0E0E0;
+	border-top-style: none;
+	border-right-style: none;
+	border-bottom-style: none;
+	border-left-style: none;
+	background-color: #FAFAFA;
+	font-size: 12px;
+}
+.memTemplItemRight {
+	padding: 1px 8px 0px 8px;
+	margin: 4px;
+	border-top-width: 1px;
+	border-right-width: 1px;
+	border-bottom-width: 1px;
+	border-left-width: 1px;
+	border-top-color: #E0E0E0;
+	border-right-color: #E0E0E0;
+	border-bottom-color: #E0E0E0;
+	border-left-color: #E0E0E0;
+	border-top-style: none;
+	border-right-style: none;
+	border-bottom-style: none;
+	border-left-style: none;
+	background-color: #FAFAFA;
+	font-size: 13px;
+}
+.memTemplParams {
+	padding: 1px 0px 0px 8px;
+	margin: 4px;
+	border-top-width: 1px;
+	border-right-width: 1px;
+	border-bottom-width: 1px;
+	border-left-width: 1px;
+	border-top-color: #E0E0E0;
+	border-right-color: #E0E0E0;
+	border-bottom-color: #E0E0E0;
+	border-left-color: #E0E0E0;
+	border-top-style: solid;
+	border-right-style: none;
+	border-bottom-style: none;
+	border-left-style: none;
+       color: #606060;
+	background-color: #FAFAFA;
+	font-size: 12px;
+}
+.search     { color: #003399;
+              font-weight: bold;
+}
+FORM.search {
+              margin-bottom: 0px;
+              margin-top: 0px;
+}
+INPUT.search { font-size: 75%;
+               color: #000080;
+               font-weight: normal;
+               background-color: #eeeeff;
+}
+TD.tiny      { font-size: 75%;
+}
+a {
+	color: #252E78;
+}
+a:visited {
+	color: #3D2185;
+}
Index: /libmpcdec/tags/release-1.1/include/Makefile.am
===================================================================
--- /libmpcdec/tags/release-1.1/include/Makefile.am	(revision 30)
+++ /libmpcdec/tags/release-1.1/include/Makefile.am	(revision 30)
@@ -0,0 +1,13 @@
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+
+nobase_include_HEADERS = \
+	musepack/config_types.h \
+	musepack/decoder.h \
+	musepack/huffman.h \
+	musepack/math.h \
+	musepack/musepack.h \
+	musepack/reader.h \
+	musepack/requant.h \
+	musepack/streaminfo.h
Index: /libmpcdec/tags/release-1.1/include/config.h.in
===================================================================
--- /libmpcdec/tags/release-1.1/include/config.h.in	(revision 30)
+++ /libmpcdec/tags/release-1.1/include/config.h.in	(revision 30)
@@ -0,0 +1,102 @@
+/* include/config.h.in.  Generated from configure.in 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 as `__inline' if that's what the C compiler calls it, or to nothing
+   if it is not supported. */
+#undef inline
+
+/* 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/tags/release-1.1/include/mainpage.h
===================================================================
--- /libmpcdec/tags/release-1.1/include/mainpage.h	(revision 30)
+++ /libmpcdec/tags/release-1.1/include/mainpage.h	(revision 30)
@@ -0,0 +1,38 @@
+/**
+   \mainpage libmusepack documentation
+
+   \section whats what is libmusepack
+   libmusepack 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 libmusepack
+
+   Using libmusepack is very straightforward.  There are typically four things you must
+   do to use libmusepack 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
+   libmusepack in src/sample.cpp.
+*/
Index: /libmpcdec/tags/release-1.1/include/musepack/config_types.h.in
===================================================================
--- /libmpcdec/tags/release-1.1/include/musepack/config_types.h.in	(revision 30)
+++ /libmpcdec/tags/release-1.1/include/musepack/config_types.h.in	(revision 30)
@@ -0,0 +1,49 @@
+/*
+  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 BOOL;
+#define TRUE  1
+#define FALSE 0
+
+/* these are filled in by configure */
+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/tags/release-1.1/include/musepack/decoder.h
===================================================================
--- /libmpcdec/tags/release-1.1/include/musepack/decoder.h	(revision 30)
+++ /libmpcdec/tags/release-1.1/include/musepack/decoder.h	(revision 30)
@@ -0,0 +1,148 @@
+/*
+  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 _musepack_decoder_h_
+#define _musepack_decoder_h_
+
+#include "musepack/huffman.h"
+#include "musepack/math.h"
+#include "musepack/musepack.h"
+#include "musepack/reader.h"
+#include "musepack/streaminfo.h"
+
+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; /// actually 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  FwdJumpInfo;
+    mpc_uint32_t  ActDecodePos;
+    mpc_uint32_t  FrameWasValid;
+
+    mpc_uint32_t  DecodedFrames;
+    mpc_uint32_t  OverallFrames;
+    mpc_int32_t   SampleRate;                 // Sample frequency
+
+    mpc_uint32_t  StreamVersion;              // version of bitstream
+    mpc_uint32_t  MS_used;                    // MS-coding used ?
+    mpc_int32_t   Max_Band;
+    mpc_uint32_t  MPCHeaderPos;               // AB: needed to support ID3v2
+    mpc_uint32_t  LastValidSamples;
+    mpc_uint32_t  TrueGaplessPresent;
+
+    mpc_uint32_t  EQ_activated;
+
+    mpc_uint32_t  WordsRead;                  // counts amount of decoded dwords
+
+    // randomizer state variables
+    mpc_uint32_t  __r1; 
+    mpc_uint32_t  __r2; 
+
+    mpc_uint32_t  Q_bit [32];     
+    mpc_uint32_t  Q_res [32][16];
+
+    // huffman table stuff
+    HuffmanTyp    HuffHdr  [10];
+    HuffmanTyp    HuffSCFI [ 4];
+    HuffmanTyp    HuffDSCF [16];
+    HuffmanTyp*   HuffQ [2] [8];
+
+    HuffmanTyp    HuffQ1 [2] [3*3*3];
+    HuffmanTyp    HuffQ2 [2] [5*5];
+    HuffmanTyp    HuffQ3 [2] [ 7];
+    HuffmanTyp    HuffQ4 [2] [ 9];
+    HuffmanTyp    HuffQ5 [2] [15];
+    HuffmanTyp    HuffQ6 [2] [31];
+    HuffmanTyp    HuffQ7 [2] [63];
+    const HuffmanTyp* SampleHuff [18];
+    HuffmanTyp    SCFI_Bundle   [ 8];
+    HuffmanTyp    DSCF_Entropie [13];
+    HuffmanTyp    Region_A [16];
+    HuffmanTyp    Region_B [ 8];
+    HuffmanTyp    Region_C [ 4];
+
+    HuffmanTyp    Entropie_1 [ 3];
+    HuffmanTyp    Entropie_2 [ 5];
+    HuffmanTyp    Entropie_3 [ 7];
+    HuffmanTyp    Entropie_4 [ 9];
+    HuffmanTyp    Entropie_5 [15];
+    HuffmanTyp    Entropie_6 [31];
+    HuffmanTyp    Entropie_7 [63];
+
+    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_int32_t   DSCF_Flag_L [32];
+    mpc_int32_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_int32_t   DSCF_Reference_L [32];
+    mpc_int32_t   DSCF_Reference_R [32];      // holds last frames SCF
+    mpc_int32_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/tags/release-1.1/include/musepack/huffman.h
===================================================================
--- /libmpcdec/tags/release-1.1/include/musepack/huffman.h	(revision 30)
+++ /libmpcdec/tags/release-1.1/include/musepack/huffman.h	(revision 30)
@@ -0,0 +1,75 @@
+/*
+  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 _musepack_huffman_h_
+#define _musepack_huffman_h_
+
+#include "musepack/config_types.h"
+#include "musepack/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_uint32_t  Length;
+    mpc_int32_t   Value;
+} HuffmanTyp;
+
+//! \brief Sorts huffman-tables by codeword.
+//!
+//! offset resulting value.
+//! \param elements
+//! \param Table table to sort
+//! \param offset offset of resulting sort
+void
+mpc_decoder_resort_huff_tables(
+    const mpc_uint32_t elements, HuffmanTyp *Table, const mpc_int32_t offset);
+
+/// Initializes sv6 huffman decoding structures.
+void mpc_decoder_init_huffman_sv6(struct mpc_decoder_t *d);
+
+/// Initializes sv6 huffman decoding tables.
+void mpc_decoder_init_huffman_sv6_tables(struct mpc_decoder_t *d);
+
+/// Initializes sv7 huffman decoding structures.
+void mpc_decoder_init_huffman_sv7(struct mpc_decoder_t *d);
+
+/// Initializes sv7 huffman decoding tables.
+void mpc_decoder_init_huffman_sv7_tables(struct mpc_decoder_t *d);
+
+#endif // _musepack_huffman_h_
Index: /libmpcdec/tags/release-1.1/include/musepack/internal.h
===================================================================
--- /libmpcdec/tags/release-1.1/include/musepack/internal.h	(revision 30)
+++ /libmpcdec/tags/release-1.1/include/musepack/internal.h	(revision 30)
@@ -0,0 +1,66 @@
+/*
+  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 musepack_internal.h
+/// Definitions and structures used only internally by the libmusepack.
+
+#ifndef _musepack_internal_h
+#define _musepack_internal_h
+
+enum {
+    MPC_DECODER_SYNTH_DELAY = 481
+};
+
+/// Big/little endian 32 bit byte swapping routine.
+static inline
+mpc_uint32_t swap32(mpc_uint32_t val) {
+    const unsigned char* src = (const unsigned char*)&val;
+    return 
+        (mpc_uint32_t)src[0] | 
+        ((mpc_uint32_t)src[1] << 8) | ((mpc_uint32_t)src[2] << 16) | ((mpc_uint32_t)src[3] << 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 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 // _musepack_internal_h
+
Index: /libmpcdec/tags/release-1.1/include/musepack/math.h
===================================================================
--- /libmpcdec/tags/release-1.1/include/musepack/math.h	(revision 30)
+++ /libmpcdec/tags/release-1.1/include/musepack/math.h	(revision 30)
@@ -0,0 +1,144 @@
+/*
+  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 mpc_math.h
+/// Libmusepack internal math routines.  
+
+#ifndef _musepack_math_h_
+#define _musepack_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 // _musepack_math_h_
+
Index: /libmpcdec/tags/release-1.1/include/musepack/musepack.h
===================================================================
--- /libmpcdec/tags/release-1.1/include/musepack/musepack.h	(revision 30)
+++ /libmpcdec/tags/release-1.1/include/musepack/musepack.h	(revision 30)
@@ -0,0 +1,128 @@
+/*
+  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 musepack.h
+/// Top level include file for libmusepack.
+
+#ifndef _musepack_h_
+#define _musepack_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#include "musepack/config_types.h"
+#include "musepack/decoder.h"
+#include "musepack/math.h"
+#include "musepack/reader.h"
+#include "musepack/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);
+
+/// 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);
+
+/// 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    
+BOOL mpc_decoder_initialize(mpc_decoder *d, 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);
+
+/// Actually reads data from previously initialized stream.  Call
+/// this iteratively to decode the mpc stream.
+/// \param buffer destination buffer for decoded samples
+/// \param vbr_update_acc \todo document me
+/// \param vbr_update_bits \todo document me
+/// \return -1 if an error is encountered
+/// \return 0 if the stream has been completely decoded successfully and there are no more samples
+/// \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_SAMPLE_FORMAT *buffer, 
+    mpc_uint32_t *vbr_update_acc, 
+    mpc_uint32_t *vbr_update_bits);
+
+/// Seeks to the specified sample in the source stream.
+BOOL mpc_decoder_seek_sample(mpc_decoder *d, mpc_int64_t destsample);
+
+/// Seeks to specified position in seconds in the source stream.
+BOOL mpc_decoder_seek_seconds(mpc_decoder *d, double seconds);
+
+#ifdef __cplusplus
+}
+#endif // __cplusplus
+
+#endif // _musepack_h_
Index: /libmpcdec/tags/release-1.1/include/musepack/reader.h
===================================================================
--- /libmpcdec/tags/release-1.1/include/musepack/reader.h	(revision 30)
+++ /libmpcdec/tags/release-1.1/include/musepack/reader.h	(revision 30)
@@ -0,0 +1,80 @@
+/*
+  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 reader.h
+
+#ifndef _musepack_reader_h_
+#define _musepack_reader_h_
+
+/// \brief Stream reader interface structure.
+///
+/// This is the structure you must supply to the musepack decoding library
+/// to feed it with raw data.  Implement the five member functions to provide
+/// a functional reader.
+typedef 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);
+
+    /// Seeks to byte position offset.
+	BOOL (*seek)(void *t, mpc_int32_t offset);
+
+    /// Returns the current byte offset in the stream.
+	mpc_int32_t (*tell)(void *t);
+
+    /// Returns the total length of the source stream, in bytes.
+	mpc_int32_t (*get_size)(void *t);
+
+    /// True if the stream is a seekable stream.
+	BOOL (*canseek)(void *t);
+
+    /// Optional field that can be used to identify a particular instance of
+    /// reader or carry along data associated with that reader.
+    void *data;
+
+    // These are used by provided internal standard file-based reader implementation.
+    // You shouldn't touch them.  They're included in the main struct to avoid
+    // malloc/free.
+    FILE *file;
+    long file_size;
+    BOOL is_seekable;
+} mpc_reader;
+
+/// 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 *r, FILE *input);
+
+#endif // _musepack_reader_h_
Index: /libmpcdec/tags/release-1.1/include/musepack/requant.h
===================================================================
--- /libmpcdec/tags/release-1.1/include/musepack/requant.h	(revision 30)
+++ /libmpcdec/tags/release-1.1/include/musepack/requant.h	(revision 30)
@@ -0,0 +1,51 @@
+/*
+  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 _musepack_requant_h
+#define _musepack_requant_h_
+
+#include "musepack/musepack.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 // _musepack_requant_h_
Index: /libmpcdec/tags/release-1.1/include/musepack/streaminfo.h
===================================================================
--- /libmpcdec/tags/release-1.1/include/musepack/streaminfo.h	(revision 30)
+++ /libmpcdec/tags/release-1.1/include/musepack/streaminfo.h	(revision 30)
@@ -0,0 +1,86 @@
+/*
+  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 streaminfo.h
+
+#ifndef _musepack_streaminfo_h_
+#define _musepack_streaminfo_h_
+
+typedef mpc_int32_t mpc_streaminfo_off_t;
+
+/// \brief mpc stream properties structure
+///
+/// Structure containing all the properties of an mpc stream.  Populated
+/// by the streaminfo_read function.
+typedef struct mpc_streaminfo {
+    /// @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
+    //@}
+
+    /// @name replaygain related fields
+    //@{
+    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
+    //@{
+    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_streaminfo_off_t tag_offset;         ///< offset to file tags
+    mpc_streaminfo_off_t total_file_length;  ///< total length of underlying file
+    //@}
+} mpc_streaminfo;
+
+#endif // _musepack_streaminfo_h_
Index: /libmpcdec/tags/release-1.1/src/Makefile.am
===================================================================
--- /libmpcdec/tags/release-1.1/src/Makefile.am	(revision 30)
+++ /libmpcdec/tags/release-1.1/src/Makefile.am	(revision 30)
@@ -0,0 +1,23 @@
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+
+INCLUDES = -I$(top_builddir)/include
+
+lib_LTLIBRARIES = libmusepack.la
+
+libmusepack_la_SOURCES = \
+	huffsv46.c \
+	huffsv7.c \
+	idtag.c \
+	mpc_decoder.c \
+	mpc_reader.c \
+	requant.c \
+	streaminfo.c \
+	synth_filter.c
+libmusepack_la_LDFLAGS = -no-undefined -version-info 2:0:0
+
+noinst_PROGRAMS = sample
+sample_SOURCES = sample.cpp
+sample_LDADD = libmusepack.la
+
Index: /libmpcdec/tags/release-1.1/src/huffsv46.c
===================================================================
--- /libmpcdec/tags/release-1.1/src/huffsv46.c	(revision 30)
+++ /libmpcdec/tags/release-1.1/src/huffsv46.c	(revision 30)
@@ -0,0 +1,268 @@
+/*
+  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 huffsv46.c
+/// Implementations of huffman decoding for streamversions < 7.
+
+#include "musepack/musepack.h"
+#include "musepack/requant.h"
+#include "musepack/huffman.h"
+
+void
+mpc_decoder_init_huffman_sv6(mpc_decoder *d) 
+{
+    mpc_decoder_init_huffman_sv6_tables(d);
+    mpc_decoder_resort_huff_tables(16, d->Region_A      , 0);
+    mpc_decoder_resort_huff_tables( 8, d->Region_B      , 0);
+    mpc_decoder_resort_huff_tables( 4, d->Region_C      , 0);
+    mpc_decoder_resort_huff_tables( 8, d->SCFI_Bundle   , 0);
+    mpc_decoder_resort_huff_tables(13, d->DSCF_Entropie , 6);
+    mpc_decoder_resort_huff_tables( 3, d->Entropie_1    , Dc[1]);
+    mpc_decoder_resort_huff_tables( 5, d->Entropie_2    , Dc[2]);
+    mpc_decoder_resort_huff_tables( 7, d->Entropie_3    , Dc[3]);
+    mpc_decoder_resort_huff_tables( 9, d->Entropie_4    , Dc[4]);
+    mpc_decoder_resort_huff_tables(15, d->Entropie_5    , Dc[5]);
+    mpc_decoder_resort_huff_tables(31, d->Entropie_6    , Dc[6]);
+    mpc_decoder_resort_huff_tables(63, d->Entropie_7    , Dc[7]);
+}
+
+void 
+mpc_decoder_init_huffman_sv6_tables(mpc_decoder *d) 
+{
+    // SCFI-bundle
+    d->SCFI_Bundle[7].Code=  1; d->SCFI_Bundle[7].Length= 1;
+    d->SCFI_Bundle[3].Code=  1; d->SCFI_Bundle[3].Length= 2;
+    d->SCFI_Bundle[5].Code=  0; d->SCFI_Bundle[5].Length= 3;
+    d->SCFI_Bundle[1].Code=  7; d->SCFI_Bundle[1].Length= 5;
+    d->SCFI_Bundle[2].Code=  6; d->SCFI_Bundle[2].Length= 5;
+    d->SCFI_Bundle[4].Code=  4; d->SCFI_Bundle[4].Length= 5;
+    d->SCFI_Bundle[0].Code= 11; d->SCFI_Bundle[0].Length= 6;
+    d->SCFI_Bundle[6].Code= 10; d->SCFI_Bundle[6].Length= 6;
+
+    // region A (subbands  0..10)
+    d->Region_A[ 1].Code=    1; d->Region_A[ 1].Length=  1;
+    d->Region_A[ 2].Code=    0; d->Region_A[ 2].Length=  2;
+    d->Region_A[ 0].Code=    2; d->Region_A[ 0].Length=  3;
+    d->Region_A[ 3].Code=   15; d->Region_A[ 3].Length=  5;
+    d->Region_A[ 5].Code=   13; d->Region_A[ 5].Length=  5;
+    d->Region_A[ 6].Code=   12; d->Region_A[ 6].Length=  5;
+    d->Region_A[ 4].Code=   29; d->Region_A[ 4].Length=  6;
+    d->Region_A[ 7].Code=   57; d->Region_A[ 7].Length=  7;
+    d->Region_A[ 8].Code=  113; d->Region_A[ 8].Length=  8;
+    d->Region_A[ 9].Code=  225; d->Region_A[ 9].Length=  9;
+    d->Region_A[10].Code=  449; d->Region_A[10].Length= 10;
+    d->Region_A[11].Code=  897; d->Region_A[11].Length= 11;
+    d->Region_A[12].Code= 1793; d->Region_A[12].Length= 12;
+    d->Region_A[13].Code= 3585; d->Region_A[13].Length= 13;
+    d->Region_A[14].Code= 7169; d->Region_A[14].Length= 14;
+    d->Region_A[15].Code= 7168; d->Region_A[15].Length= 14;
+
+    // region B (subbands 11..22)
+    d->Region_B[1].Code= 1; d->Region_B[1].Length= 1;
+    d->Region_B[0].Code= 1; d->Region_B[0].Length= 2;
+    d->Region_B[2].Code= 1; d->Region_B[2].Length= 3;
+    d->Region_B[3].Code= 1; d->Region_B[3].Length= 4;
+    d->Region_B[4].Code= 1; d->Region_B[4].Length= 5;
+    d->Region_B[5].Code= 1; d->Region_B[5].Length= 6;
+    d->Region_B[6].Code= 1; d->Region_B[6].Length= 7;
+    d->Region_B[7].Code= 0; d->Region_B[7].Length= 7;
+
+    // region C (subbands 23..31)
+    d->Region_C[0].Code= 1; d->Region_C[0].Length= 1;
+    d->Region_C[1].Code= 1; d->Region_C[1].Length= 2;
+    d->Region_C[2].Code= 1; d->Region_C[2].Length= 3;
+    d->Region_C[3].Code= 0; d->Region_C[3].Length= 3;
+
+    // DSCF
+    d->DSCF_Entropie[ 6].Code=  0; d->DSCF_Entropie[ 6].Length= 2;
+    d->DSCF_Entropie[ 7].Code=  7; d->DSCF_Entropie[ 7].Length= 3;
+    d->DSCF_Entropie[ 5].Code=  4; d->DSCF_Entropie[ 5].Length= 3;
+    d->DSCF_Entropie[ 8].Code=  3; d->DSCF_Entropie[ 8].Length= 3;
+    d->DSCF_Entropie[ 9].Code= 13; d->DSCF_Entropie[ 9].Length= 4;
+    d->DSCF_Entropie[ 4].Code= 11; d->DSCF_Entropie[ 4].Length= 4;
+    d->DSCF_Entropie[10].Code= 10; d->DSCF_Entropie[10].Length= 4;
+    d->DSCF_Entropie[ 2].Code=  4; d->DSCF_Entropie[ 2].Length= 4;
+    d->DSCF_Entropie[11].Code= 25; d->DSCF_Entropie[11].Length= 5;
+    d->DSCF_Entropie[ 3].Code= 24; d->DSCF_Entropie[ 3].Length= 5;
+    d->DSCF_Entropie[ 1].Code= 11; d->DSCF_Entropie[ 1].Length= 5;
+    d->DSCF_Entropie[12].Code= 21; d->DSCF_Entropie[12].Length= 6;
+    d->DSCF_Entropie[ 0].Code= 20; d->DSCF_Entropie[ 0].Length= 6;
+
+    // first quantizer
+    d->Entropie_1[1].Code= 1; d->Entropie_1[1].Length= 1;
+    d->Entropie_1[0].Code= 1; d->Entropie_1[0].Length= 2;
+    d->Entropie_1[2].Code= 0; d->Entropie_1[2].Length= 2;
+
+    // second quantizer
+    d->Entropie_2[2].Code=  3; d->Entropie_2[2].Length= 2;
+    d->Entropie_2[3].Code=  1; d->Entropie_2[3].Length= 2;
+    d->Entropie_2[1].Code=  0; d->Entropie_2[1].Length= 2;
+    d->Entropie_2[4].Code=  5; d->Entropie_2[4].Length= 3;
+    d->Entropie_2[0].Code=  4; d->Entropie_2[0].Length= 3;
+
+    // third quantizer
+    d->Entropie_3[3].Code=  3; d->Entropie_3[3].Length= 2;
+    d->Entropie_3[2].Code=  1; d->Entropie_3[2].Length= 2;
+    d->Entropie_3[4].Code=  0; d->Entropie_3[4].Length= 2;
+    d->Entropie_3[1].Code=  5; d->Entropie_3[1].Length= 3;
+    d->Entropie_3[5].Code=  9; d->Entropie_3[5].Length= 4;
+    d->Entropie_3[0].Code= 17; d->Entropie_3[0].Length= 5;
+    d->Entropie_3[6].Code= 16; d->Entropie_3[6].Length= 5;
+
+    // forth quantizer
+    d->Entropie_4[4].Code=  0; d->Entropie_4[4].Length= 2;
+    d->Entropie_4[5].Code=  6; d->Entropie_4[5].Length= 3;
+    d->Entropie_4[3].Code=  5; d->Entropie_4[3].Length= 3;
+    d->Entropie_4[6].Code=  4; d->Entropie_4[6].Length= 3;
+    d->Entropie_4[2].Code=  3; d->Entropie_4[2].Length= 3;
+    d->Entropie_4[7].Code= 15; d->Entropie_4[7].Length= 4;
+    d->Entropie_4[1].Code= 14; d->Entropie_4[1].Length= 4;
+    d->Entropie_4[0].Code=  5; d->Entropie_4[0].Length= 4;
+    d->Entropie_4[8].Code=  4; d->Entropie_4[8].Length= 4;
+
+    // fifth quantizer
+    d->Entropie_5[7 ].Code=  4; d->Entropie_5[7 ].Length= 3;
+    d->Entropie_5[8 ].Code=  3; d->Entropie_5[8 ].Length= 3;
+    d->Entropie_5[6 ].Code=  2; d->Entropie_5[6 ].Length= 3;
+    d->Entropie_5[9 ].Code=  0; d->Entropie_5[9 ].Length= 3;
+    d->Entropie_5[5 ].Code= 15; d->Entropie_5[5 ].Length= 4;
+    d->Entropie_5[4 ].Code= 13; d->Entropie_5[4 ].Length= 4;
+    d->Entropie_5[10].Code= 12; d->Entropie_5[10].Length= 4;
+    d->Entropie_5[11].Code= 10; d->Entropie_5[11].Length= 4;
+    d->Entropie_5[3 ].Code=  3; d->Entropie_5[3 ].Length= 4;
+    d->Entropie_5[12].Code=  2; d->Entropie_5[12].Length= 4;
+    d->Entropie_5[2 ].Code= 29; d->Entropie_5[2 ].Length= 5;
+    d->Entropie_5[1 ].Code= 23; d->Entropie_5[1 ].Length= 5;
+    d->Entropie_5[13].Code= 22; d->Entropie_5[13].Length= 5;
+    d->Entropie_5[0 ].Code= 57; d->Entropie_5[0 ].Length= 6;
+    d->Entropie_5[14].Code= 56; d->Entropie_5[14].Length= 6;
+
+    // sixth quantizer
+    d->Entropie_6[15].Code=  9; d->Entropie_6[15].Length= 4;
+    d->Entropie_6[16].Code=  8; d->Entropie_6[16].Length= 4;
+    d->Entropie_6[14].Code=  7; d->Entropie_6[14].Length= 4;
+    d->Entropie_6[18].Code=  6; d->Entropie_6[18].Length= 4;
+    d->Entropie_6[17].Code=  5; d->Entropie_6[17].Length= 4;
+    d->Entropie_6[12].Code=  3; d->Entropie_6[12].Length= 4;
+    d->Entropie_6[13].Code=  2; d->Entropie_6[13].Length= 4;
+    d->Entropie_6[19].Code=  0; d->Entropie_6[19].Length= 4;
+    d->Entropie_6[11].Code= 31; d->Entropie_6[11].Length= 5;
+    d->Entropie_6[20].Code= 30; d->Entropie_6[20].Length= 5;
+    d->Entropie_6[10].Code= 29; d->Entropie_6[10].Length= 5;
+    d->Entropie_6[9 ].Code= 27; d->Entropie_6[9 ].Length= 5;
+    d->Entropie_6[21].Code= 26; d->Entropie_6[21].Length= 5;
+    d->Entropie_6[22].Code= 25; d->Entropie_6[22].Length= 5;
+    d->Entropie_6[8 ].Code= 24; d->Entropie_6[8 ].Length= 5;
+    d->Entropie_6[7 ].Code= 23; d->Entropie_6[7 ].Length= 5;
+    d->Entropie_6[23].Code= 21; d->Entropie_6[23].Length= 5;
+    d->Entropie_6[6 ].Code=  9; d->Entropie_6[6 ].Length= 5;
+    d->Entropie_6[24].Code=  3; d->Entropie_6[24].Length= 5;
+    d->Entropie_6[25].Code= 57; d->Entropie_6[25].Length= 6;
+    d->Entropie_6[5 ].Code= 56; d->Entropie_6[5 ].Length= 6;
+    d->Entropie_6[4 ].Code= 45; d->Entropie_6[4 ].Length= 6;
+    d->Entropie_6[26].Code= 41; d->Entropie_6[26].Length= 6;
+    d->Entropie_6[2 ].Code= 40; d->Entropie_6[2 ].Length= 6;
+    d->Entropie_6[27].Code= 17; d->Entropie_6[27].Length= 6;
+    d->Entropie_6[28].Code= 16; d->Entropie_6[28].Length= 6;
+    d->Entropie_6[3 ].Code=  5; d->Entropie_6[3 ].Length= 6;
+    d->Entropie_6[29].Code= 89; d->Entropie_6[29].Length= 7;
+    d->Entropie_6[1 ].Code= 88; d->Entropie_6[1 ].Length= 7;
+    d->Entropie_6[30].Code=  9; d->Entropie_6[30].Length= 7;
+    d->Entropie_6[0 ].Code=  8; d->Entropie_6[0 ].Length= 7;
+
+    // seventh quantizer
+    d->Entropie_7[25].Code=   0; d->Entropie_7[25].Length= 5;
+    d->Entropie_7[37].Code=   1; d->Entropie_7[37].Length= 5;
+    d->Entropie_7[62].Code=  16; d->Entropie_7[62].Length= 8;
+    d->Entropie_7[ 0].Code=  17; d->Entropie_7[ 0].Length= 8;
+    d->Entropie_7[ 3].Code=   9; d->Entropie_7[ 3].Length= 7;
+    d->Entropie_7[ 5].Code=  10; d->Entropie_7[ 5].Length= 7;
+    d->Entropie_7[ 6].Code=  11; d->Entropie_7[ 6].Length= 7;
+    d->Entropie_7[38].Code=   3; d->Entropie_7[38].Length= 5;
+    d->Entropie_7[35].Code=   4; d->Entropie_7[35].Length= 5;
+    d->Entropie_7[33].Code=   5; d->Entropie_7[33].Length= 5;
+    d->Entropie_7[24].Code=   6; d->Entropie_7[24].Length= 5;
+    d->Entropie_7[27].Code=   7; d->Entropie_7[27].Length= 5;
+    d->Entropie_7[26].Code=   8; d->Entropie_7[26].Length= 5;
+    d->Entropie_7[12].Code=  18; d->Entropie_7[12].Length= 6;
+    d->Entropie_7[50].Code=  19; d->Entropie_7[50].Length= 6;
+    d->Entropie_7[29].Code=  10; d->Entropie_7[29].Length= 5;
+    d->Entropie_7[31].Code=  11; d->Entropie_7[31].Length= 5;
+    d->Entropie_7[36].Code=  12; d->Entropie_7[36].Length= 5;
+    d->Entropie_7[34].Code=  13; d->Entropie_7[34].Length= 5;
+    d->Entropie_7[28].Code=  14; d->Entropie_7[28].Length= 5;
+    d->Entropie_7[49].Code=  30; d->Entropie_7[49].Length= 6;
+    d->Entropie_7[56].Code=  62; d->Entropie_7[56].Length= 7;
+    d->Entropie_7[ 7].Code=  63; d->Entropie_7[ 7].Length= 7;
+    d->Entropie_7[32].Code=  16; d->Entropie_7[32].Length= 5;
+    d->Entropie_7[30].Code=  17; d->Entropie_7[30].Length= 5;
+    d->Entropie_7[13].Code=  36; d->Entropie_7[13].Length= 6;
+    d->Entropie_7[55].Code=  74; d->Entropie_7[55].Length= 7;
+    d->Entropie_7[61].Code= 150; d->Entropie_7[61].Length= 8;
+    d->Entropie_7[ 1].Code= 151; d->Entropie_7[ 1].Length= 8;
+    d->Entropie_7[14].Code=  38; d->Entropie_7[14].Length= 6;
+    d->Entropie_7[48].Code=  39; d->Entropie_7[48].Length= 6;
+    d->Entropie_7[ 4].Code=  80; d->Entropie_7[ 4].Length= 7;
+    d->Entropie_7[58].Code=  81; d->Entropie_7[58].Length= 7;
+    d->Entropie_7[47].Code=  41; d->Entropie_7[47].Length= 6;
+    d->Entropie_7[15].Code=  42; d->Entropie_7[15].Length= 6;
+    d->Entropie_7[16].Code=  43; d->Entropie_7[16].Length= 6;
+    d->Entropie_7[54].Code=  88; d->Entropie_7[54].Length= 7;
+    d->Entropie_7[ 8].Code=  89; d->Entropie_7[ 8].Length= 7;
+    d->Entropie_7[17].Code=  45; d->Entropie_7[17].Length= 6;
+    d->Entropie_7[46].Code=  46; d->Entropie_7[46].Length= 6;
+    d->Entropie_7[45].Code=  47; d->Entropie_7[45].Length= 6;
+    d->Entropie_7[53].Code=  96; d->Entropie_7[53].Length= 7;
+    d->Entropie_7[ 9].Code=  97; d->Entropie_7[ 9].Length= 7;
+    d->Entropie_7[43].Code=  49; d->Entropie_7[43].Length= 6;
+    d->Entropie_7[19].Code=  50; d->Entropie_7[19].Length= 6;
+    d->Entropie_7[18].Code=  51; d->Entropie_7[18].Length= 6;
+    d->Entropie_7[44].Code=  52; d->Entropie_7[44].Length= 6;
+    d->Entropie_7[ 2].Code= 212; d->Entropie_7[ 2].Length= 8;
+    d->Entropie_7[60].Code= 213; d->Entropie_7[60].Length= 8;
+    d->Entropie_7[10].Code= 107; d->Entropie_7[10].Length= 7;
+    d->Entropie_7[42].Code=  54; d->Entropie_7[42].Length= 6;
+    d->Entropie_7[41].Code=  55; d->Entropie_7[41].Length= 6;
+    d->Entropie_7[20].Code=  56; d->Entropie_7[20].Length= 6;
+    d->Entropie_7[21].Code=  57; d->Entropie_7[21].Length= 6;
+    d->Entropie_7[52].Code= 116; d->Entropie_7[52].Length= 7;
+    d->Entropie_7[51].Code= 117; d->Entropie_7[51].Length= 7;
+    d->Entropie_7[40].Code=  59; d->Entropie_7[40].Length= 6;
+    d->Entropie_7[22].Code=  60; d->Entropie_7[22].Length= 6;
+    d->Entropie_7[23].Code=  61; d->Entropie_7[23].Length= 6;
+    d->Entropie_7[39].Code=  62; d->Entropie_7[39].Length= 6;
+    d->Entropie_7[11].Code= 126; d->Entropie_7[11].Length= 7;
+    d->Entropie_7[57].Code= 254; d->Entropie_7[57].Length= 8;
+    d->Entropie_7[59].Code= 255; d->Entropie_7[59].Length= 8;
+}
Index: /libmpcdec/tags/release-1.1/src/huffsv7.c
===================================================================
--- /libmpcdec/tags/release-1.1/src/huffsv7.c	(revision 30)
+++ /libmpcdec/tags/release-1.1/src/huffsv7.c	(revision 30)
@@ -0,0 +1,500 @@
+/*
+  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 huffsv7.c
+/// Implementations of sv7 huffman decoding functions.
+
+#include "musepack/musepack.h"
+#include "musepack/huffman.h"
+#include "musepack/requant.h"
+
+void
+mpc_decoder_init_huffman_sv7(mpc_decoder *d) 
+{
+    mpc_decoder_init_huffman_sv7_tables(d);
+    mpc_decoder_resort_huff_tables(10, &(d->HuffHdr[0])   , 5);
+    mpc_decoder_resort_huff_tables( 4, &(d->HuffSCFI[0])  , 0);
+    mpc_decoder_resort_huff_tables(16, &(d->HuffDSCF[0])  , 7);
+    mpc_decoder_resort_huff_tables(27, &(d->HuffQ1[0][0]) , 0);
+    mpc_decoder_resort_huff_tables(27, &(d->HuffQ1[1][0]) , 0);
+    mpc_decoder_resort_huff_tables(25, &(d->HuffQ2[0][0]) , 0);
+    mpc_decoder_resort_huff_tables(25, &(d->HuffQ2[1][0]) , 0);
+    mpc_decoder_resort_huff_tables( 7, &(d->HuffQ3[0][0]) , Dc[3]);
+    mpc_decoder_resort_huff_tables( 7, &(d->HuffQ3[1][0]) , Dc[3]);
+    mpc_decoder_resort_huff_tables( 9, &(d->HuffQ4[0][0]) , Dc[4]);
+    mpc_decoder_resort_huff_tables( 9, &(d->HuffQ4[1][0]) , Dc[4]);
+    mpc_decoder_resort_huff_tables(15, &(d->HuffQ5[0][0]) , Dc[5]);
+    mpc_decoder_resort_huff_tables(15, &(d->HuffQ5[1][0]) , Dc[5]);
+    mpc_decoder_resort_huff_tables(31, &(d->HuffQ6[0][0]) , Dc[6]);
+    mpc_decoder_resort_huff_tables(31, &(d->HuffQ6[1][0]) , Dc[6]);
+    mpc_decoder_resort_huff_tables(63, &(d->HuffQ7[0][0]) , Dc[7]);
+    mpc_decoder_resort_huff_tables(63, &(d->HuffQ7[1][0]) , Dc[7]);
+}
+
+void 
+mpc_decoder_init_huffman_sv7_tables(mpc_decoder *d) 
+{
+    /***************************** SCFI *******************************/
+    d->HuffSCFI[0].Code = 2; d->HuffSCFI[0].Length = 3;
+    d->HuffSCFI[1].Code = 1; d->HuffSCFI[1].Length = 1;
+    d->HuffSCFI[2].Code = 3; d->HuffSCFI[2].Length = 3;
+    d->HuffSCFI[3].Code = 0; d->HuffSCFI[3].Length = 2;
+
+    /***************************** DSCF *******************************/
+    d->HuffDSCF[ 0].Code = 32; d->HuffDSCF[ 0].Length = 6;
+    d->HuffDSCF[ 1].Code =  4; d->HuffDSCF[ 1].Length = 5;
+    d->HuffDSCF[ 2].Code = 17; d->HuffDSCF[ 2].Length = 5;
+    d->HuffDSCF[ 3].Code = 30; d->HuffDSCF[ 3].Length = 5;
+    d->HuffDSCF[ 4].Code = 13; d->HuffDSCF[ 4].Length = 4;
+    d->HuffDSCF[ 5].Code =  0; d->HuffDSCF[ 5].Length = 3;
+    d->HuffDSCF[ 6].Code =  3; d->HuffDSCF[ 6].Length = 3;
+    d->HuffDSCF[ 7].Code =  9; d->HuffDSCF[ 7].Length = 4;
+    d->HuffDSCF[ 8].Code =  5; d->HuffDSCF[ 8].Length = 3;
+    d->HuffDSCF[ 9].Code =  2; d->HuffDSCF[ 9].Length = 3;
+    d->HuffDSCF[10].Code = 14; d->HuffDSCF[10].Length = 4;
+    d->HuffDSCF[11].Code =  3; d->HuffDSCF[11].Length = 4;
+    d->HuffDSCF[12].Code = 31; d->HuffDSCF[12].Length = 5;
+    d->HuffDSCF[13].Code =  5; d->HuffDSCF[13].Length = 5;
+    d->HuffDSCF[14].Code = 33; d->HuffDSCF[14].Length = 6;
+    d->HuffDSCF[15].Code = 12; d->HuffDSCF[15].Length = 4;
+
+    /************************* frame-header ***************************/
+    /***************** differential quantizer indizes *****************/
+    d->HuffHdr[0].Code =  92; d->HuffHdr[0].Length = 8;
+    d->HuffHdr[1].Code =  47; d->HuffHdr[1].Length = 7;
+    d->HuffHdr[2].Code =  10; d->HuffHdr[2].Length = 5;
+    d->HuffHdr[3].Code =   4; d->HuffHdr[3].Length = 4;
+    d->HuffHdr[4].Code =   0; d->HuffHdr[4].Length = 2;
+    d->HuffHdr[5].Code =   1; d->HuffHdr[5].Length = 1;
+    d->HuffHdr[6].Code =   3; d->HuffHdr[6].Length = 3;
+    d->HuffHdr[7].Code =  22; d->HuffHdr[7].Length = 6;
+    d->HuffHdr[8].Code = 187; d->HuffHdr[8].Length = 9;
+    d->HuffHdr[9].Code = 186; d->HuffHdr[9].Length = 9;
+
+    /********************** 3-step quantizer **************************/
+    /********************* 3 bundled samples **************************/
+    //less shaped, book 0
+    d->HuffQ1[0][ 0].Code = 54; d->HuffQ1[0][ 0].Length = 6;
+    d->HuffQ1[0][ 1].Code =  9; d->HuffQ1[0][ 1].Length = 5;
+    d->HuffQ1[0][ 2].Code = 32; d->HuffQ1[0][ 2].Length = 6;
+    d->HuffQ1[0][ 3].Code =  5; d->HuffQ1[0][ 3].Length = 5;
+    d->HuffQ1[0][ 4].Code = 10; d->HuffQ1[0][ 4].Length = 4;
+    d->HuffQ1[0][ 5].Code =  7; d->HuffQ1[0][ 5].Length = 5;
+    d->HuffQ1[0][ 6].Code = 52; d->HuffQ1[0][ 6].Length = 6;
+    d->HuffQ1[0][ 7].Code =  0; d->HuffQ1[0][ 7].Length = 5;
+    d->HuffQ1[0][ 8].Code = 35; d->HuffQ1[0][ 8].Length = 6;
+    d->HuffQ1[0][ 9].Code = 10; d->HuffQ1[0][ 9].Length = 5;
+    d->HuffQ1[0][10].Code =  6; d->HuffQ1[0][10].Length = 4;
+    d->HuffQ1[0][11].Code =  4; d->HuffQ1[0][11].Length = 5;
+    d->HuffQ1[0][12].Code = 11; d->HuffQ1[0][12].Length = 4;
+    d->HuffQ1[0][13].Code =  7; d->HuffQ1[0][13].Length = 3;
+    d->HuffQ1[0][14].Code = 12; d->HuffQ1[0][14].Length = 4;
+    d->HuffQ1[0][15].Code =  3; d->HuffQ1[0][15].Length = 5;
+    d->HuffQ1[0][16].Code =  7; d->HuffQ1[0][16].Length = 4;
+    d->HuffQ1[0][17].Code = 11; d->HuffQ1[0][17].Length = 5;
+    d->HuffQ1[0][18].Code = 34; d->HuffQ1[0][18].Length = 6;
+    d->HuffQ1[0][19].Code =  1; d->HuffQ1[0][19].Length = 5;
+    d->HuffQ1[0][20].Code = 53; d->HuffQ1[0][20].Length = 6;
+    d->HuffQ1[0][21].Code =  6; d->HuffQ1[0][21].Length = 5;
+    d->HuffQ1[0][22].Code =  9; d->HuffQ1[0][22].Length = 4;
+    d->HuffQ1[0][23].Code =  2; d->HuffQ1[0][23].Length = 5;
+    d->HuffQ1[0][24].Code = 33; d->HuffQ1[0][24].Length = 6;
+    d->HuffQ1[0][25].Code =  8; d->HuffQ1[0][25].Length = 5;
+    d->HuffQ1[0][26].Code = 55; d->HuffQ1[0][26].Length = 6;
+
+    //more shaped, book 1
+    d->HuffQ1[1][ 0].Code = 103; d->HuffQ1[1][ 0].Length = 8;
+    d->HuffQ1[1][ 1].Code =  62; d->HuffQ1[1][ 1].Length = 7;
+    d->HuffQ1[1][ 2].Code = 225; d->HuffQ1[1][ 2].Length = 9;
+    d->HuffQ1[1][ 3].Code =  55; d->HuffQ1[1][ 3].Length = 7;
+    d->HuffQ1[1][ 4].Code =   3; d->HuffQ1[1][ 4].Length = 4;
+    d->HuffQ1[1][ 5].Code =  52; d->HuffQ1[1][ 5].Length = 7;
+    d->HuffQ1[1][ 6].Code = 101; d->HuffQ1[1][ 6].Length = 8;
+    d->HuffQ1[1][ 7].Code =  60; d->HuffQ1[1][ 7].Length = 7;
+    d->HuffQ1[1][ 8].Code = 227; d->HuffQ1[1][ 8].Length = 9;
+    d->HuffQ1[1][ 9].Code =  24; d->HuffQ1[1][ 9].Length = 6;
+    d->HuffQ1[1][10].Code =   0; d->HuffQ1[1][10].Length = 4;
+    d->HuffQ1[1][11].Code =  61; d->HuffQ1[1][11].Length = 7;
+    d->HuffQ1[1][12].Code =   4; d->HuffQ1[1][12].Length = 4;
+    d->HuffQ1[1][13].Code =   1; d->HuffQ1[1][13].Length = 1;
+    d->HuffQ1[1][14].Code =   5; d->HuffQ1[1][14].Length = 4;
+    d->HuffQ1[1][15].Code =  63; d->HuffQ1[1][15].Length = 7;
+    d->HuffQ1[1][16].Code =   1; d->HuffQ1[1][16].Length = 4;
+    d->HuffQ1[1][17].Code =  59; d->HuffQ1[1][17].Length = 7;
+    d->HuffQ1[1][18].Code = 226; d->HuffQ1[1][18].Length = 9;
+    d->HuffQ1[1][19].Code =  57; d->HuffQ1[1][19].Length = 7;
+    d->HuffQ1[1][20].Code = 100; d->HuffQ1[1][20].Length = 8;
+    d->HuffQ1[1][21].Code =  53; d->HuffQ1[1][21].Length = 7;
+    d->HuffQ1[1][22].Code =   2; d->HuffQ1[1][22].Length = 4;
+    d->HuffQ1[1][23].Code =  54; d->HuffQ1[1][23].Length = 7;
+    d->HuffQ1[1][24].Code = 224; d->HuffQ1[1][24].Length = 9;
+    d->HuffQ1[1][25].Code =  58; d->HuffQ1[1][25].Length = 7;
+    d->HuffQ1[1][26].Code = 102; d->HuffQ1[1][26].Length = 8;
+
+    /********************** 5-step quantizer **************************/
+    /********************* 2 bundled samples **************************/
+    //less shaped, book 0
+    d->HuffQ2[0][ 0].Code =  89; d->HuffQ2[0][ 0].Length = 7;
+    d->HuffQ2[0][ 1].Code =  47; d->HuffQ2[0][ 1].Length = 6;
+    d->HuffQ2[0][ 2].Code =  15; d->HuffQ2[0][ 2].Length = 5;
+    d->HuffQ2[0][ 3].Code =   0; d->HuffQ2[0][ 3].Length = 5;
+    d->HuffQ2[0][ 4].Code =  91; d->HuffQ2[0][ 4].Length = 7;
+    d->HuffQ2[0][ 5].Code =   4; d->HuffQ2[0][ 5].Length = 5;
+    d->HuffQ2[0][ 6].Code =   6; d->HuffQ2[0][ 6].Length = 4;
+    d->HuffQ2[0][ 7].Code =  13; d->HuffQ2[0][ 7].Length = 4;
+    d->HuffQ2[0][ 8].Code =   4; d->HuffQ2[0][ 8].Length = 4;
+    d->HuffQ2[0][ 9].Code =   5; d->HuffQ2[0][ 9].Length = 5;
+    d->HuffQ2[0][10].Code =  20; d->HuffQ2[0][10].Length = 5;
+    d->HuffQ2[0][11].Code =  12; d->HuffQ2[0][11].Length = 4;
+    d->HuffQ2[0][12].Code =   4; d->HuffQ2[0][12].Length = 3;
+    d->HuffQ2[0][13].Code =  15; d->HuffQ2[0][13].Length = 4;
+    d->HuffQ2[0][14].Code =  14; d->HuffQ2[0][14].Length = 5;
+    d->HuffQ2[0][15].Code =   3; d->HuffQ2[0][15].Length = 5;
+    d->HuffQ2[0][16].Code =   3; d->HuffQ2[0][16].Length = 4;
+    d->HuffQ2[0][17].Code =  14; d->HuffQ2[0][17].Length = 4;
+    d->HuffQ2[0][18].Code =   5; d->HuffQ2[0][18].Length = 4;
+    d->HuffQ2[0][19].Code =   1; d->HuffQ2[0][19].Length = 5;
+    d->HuffQ2[0][20].Code =  90; d->HuffQ2[0][20].Length = 7;
+    d->HuffQ2[0][21].Code =   2; d->HuffQ2[0][21].Length = 5;
+    d->HuffQ2[0][22].Code =  21; d->HuffQ2[0][22].Length = 5;
+    d->HuffQ2[0][23].Code =  46; d->HuffQ2[0][23].Length = 6;
+    d->HuffQ2[0][24].Code =  88; d->HuffQ2[0][24].Length = 7;
+
+    //more shaped, book 1
+    d->HuffQ2[1][ 0].Code =  921; d->HuffQ2[1][ 0].Length = 10;
+    d->HuffQ2[1][ 1].Code =  113; d->HuffQ2[1][ 1].Length =  7;
+    d->HuffQ2[1][ 2].Code =   51; d->HuffQ2[1][ 2].Length =  6;
+    d->HuffQ2[1][ 3].Code =  231; d->HuffQ2[1][ 3].Length =  8;
+    d->HuffQ2[1][ 4].Code =  922; d->HuffQ2[1][ 4].Length = 10;
+    d->HuffQ2[1][ 5].Code =  104; d->HuffQ2[1][ 5].Length =  7;
+    d->HuffQ2[1][ 6].Code =   30; d->HuffQ2[1][ 6].Length =  5;
+    d->HuffQ2[1][ 7].Code =    0; d->HuffQ2[1][ 7].Length =  3;
+    d->HuffQ2[1][ 8].Code =   29; d->HuffQ2[1][ 8].Length =  5;
+    d->HuffQ2[1][ 9].Code =  105; d->HuffQ2[1][ 9].Length =  7;
+    d->HuffQ2[1][10].Code =   50; d->HuffQ2[1][10].Length =  6;
+    d->HuffQ2[1][11].Code =    1; d->HuffQ2[1][11].Length =  3;
+    d->HuffQ2[1][12].Code =    2; d->HuffQ2[1][12].Length =  2;
+    d->HuffQ2[1][13].Code =    3; d->HuffQ2[1][13].Length =  3;
+    d->HuffQ2[1][14].Code =   49; d->HuffQ2[1][14].Length =  6;
+    d->HuffQ2[1][15].Code =  107; d->HuffQ2[1][15].Length =  7;
+    d->HuffQ2[1][16].Code =   27; d->HuffQ2[1][16].Length =  5;
+    d->HuffQ2[1][17].Code =    2; d->HuffQ2[1][17].Length =  3;
+    d->HuffQ2[1][18].Code =   31; d->HuffQ2[1][18].Length =  5;
+    d->HuffQ2[1][19].Code =  112; d->HuffQ2[1][19].Length =  7;
+    d->HuffQ2[1][20].Code =  920; d->HuffQ2[1][20].Length = 10;
+    d->HuffQ2[1][21].Code =  106; d->HuffQ2[1][21].Length =  7;
+    d->HuffQ2[1][22].Code =   48; d->HuffQ2[1][22].Length =  6;
+    d->HuffQ2[1][23].Code =  114; d->HuffQ2[1][23].Length =  7;
+    d->HuffQ2[1][24].Code =  923; d->HuffQ2[1][24].Length = 10;
+
+    /********************** 7-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ3[0][0].Code = 12; d->HuffQ3[0][0].Length = 4;
+    d->HuffQ3[0][1].Code =  4; d->HuffQ3[0][1].Length = 3;
+    d->HuffQ3[0][2].Code =  0; d->HuffQ3[0][2].Length = 2;
+    d->HuffQ3[0][3].Code =  1; d->HuffQ3[0][3].Length = 2;
+    d->HuffQ3[0][4].Code =  7; d->HuffQ3[0][4].Length = 3;
+    d->HuffQ3[0][5].Code =  5; d->HuffQ3[0][5].Length = 3;
+    d->HuffQ3[0][6].Code = 13; d->HuffQ3[0][6].Length = 4;
+
+    //more shaped, book 1
+    d->HuffQ3[1][0].Code = 4; d->HuffQ3[1][0].Length = 5;
+    d->HuffQ3[1][1].Code = 3; d->HuffQ3[1][1].Length = 4;
+    d->HuffQ3[1][2].Code = 2; d->HuffQ3[1][2].Length = 2;
+    d->HuffQ3[1][3].Code = 3; d->HuffQ3[1][3].Length = 2;
+    d->HuffQ3[1][4].Code = 1; d->HuffQ3[1][4].Length = 2;
+    d->HuffQ3[1][5].Code = 0; d->HuffQ3[1][5].Length = 3;
+    d->HuffQ3[1][6].Code = 5; d->HuffQ3[1][6].Length = 5;
+
+    /********************** 9-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ4[0][0].Code = 5; d->HuffQ4[0][0].Length = 4;
+    d->HuffQ4[0][1].Code = 0; d->HuffQ4[0][1].Length = 3;
+    d->HuffQ4[0][2].Code = 4; d->HuffQ4[0][2].Length = 3;
+    d->HuffQ4[0][3].Code = 6; d->HuffQ4[0][3].Length = 3;
+    d->HuffQ4[0][4].Code = 7; d->HuffQ4[0][4].Length = 3;
+    d->HuffQ4[0][5].Code = 5; d->HuffQ4[0][5].Length = 3;
+    d->HuffQ4[0][6].Code = 3; d->HuffQ4[0][6].Length = 3;
+    d->HuffQ4[0][7].Code = 1; d->HuffQ4[0][7].Length = 3;
+    d->HuffQ4[0][8].Code = 4; d->HuffQ4[0][8].Length = 4;
+
+    //more shaped, book 1
+    d->HuffQ4[1][0].Code =  9; d->HuffQ4[1][0].Length = 5;
+    d->HuffQ4[1][1].Code = 12; d->HuffQ4[1][1].Length = 4;
+    d->HuffQ4[1][2].Code =  3; d->HuffQ4[1][2].Length = 3;
+    d->HuffQ4[1][3].Code =  0; d->HuffQ4[1][3].Length = 2;
+    d->HuffQ4[1][4].Code =  2; d->HuffQ4[1][4].Length = 2;
+    d->HuffQ4[1][5].Code =  7; d->HuffQ4[1][5].Length = 3;
+    d->HuffQ4[1][6].Code = 13; d->HuffQ4[1][6].Length = 4;
+    d->HuffQ4[1][7].Code =  5; d->HuffQ4[1][7].Length = 4;
+    d->HuffQ4[1][8].Code =  8; d->HuffQ4[1][8].Length = 5;
+
+    /********************* 15-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ5[0][ 0].Code = 57; d->HuffQ5[0][ 0].Length = 6;
+    d->HuffQ5[0][ 1].Code = 23; d->HuffQ5[0][ 1].Length = 5;
+    d->HuffQ5[0][ 2].Code =  8; d->HuffQ5[0][ 2].Length = 4;
+    d->HuffQ5[0][ 3].Code = 10; d->HuffQ5[0][ 3].Length = 4;
+    d->HuffQ5[0][ 4].Code = 13; d->HuffQ5[0][ 4].Length = 4;
+    d->HuffQ5[0][ 5].Code =  0; d->HuffQ5[0][ 5].Length = 3;
+    d->HuffQ5[0][ 6].Code =  2; d->HuffQ5[0][ 6].Length = 3;
+    d->HuffQ5[0][ 7].Code =  3; d->HuffQ5[0][ 7].Length = 3;
+    d->HuffQ5[0][ 8].Code =  1; d->HuffQ5[0][ 8].Length = 3;
+    d->HuffQ5[0][ 9].Code = 15; d->HuffQ5[0][ 9].Length = 4;
+    d->HuffQ5[0][10].Code = 12; d->HuffQ5[0][10].Length = 4;
+    d->HuffQ5[0][11].Code =  9; d->HuffQ5[0][11].Length = 4;
+    d->HuffQ5[0][12].Code = 29; d->HuffQ5[0][12].Length = 5;
+    d->HuffQ5[0][13].Code = 22; d->HuffQ5[0][13].Length = 5;
+    d->HuffQ5[0][14].Code = 56; d->HuffQ5[0][14].Length = 6;
+
+    //more shaped, book 1
+    d->HuffQ5[1][ 0].Code = 229; d->HuffQ5[1][ 0].Length = 8;
+    d->HuffQ5[1][ 1].Code =  56; d->HuffQ5[1][ 1].Length = 6;
+    d->HuffQ5[1][ 2].Code =   7; d->HuffQ5[1][ 2].Length = 5;
+    d->HuffQ5[1][ 3].Code =   2; d->HuffQ5[1][ 3].Length = 4;
+    d->HuffQ5[1][ 4].Code =   0; d->HuffQ5[1][ 4].Length = 3;
+    d->HuffQ5[1][ 5].Code =   3; d->HuffQ5[1][ 5].Length = 3;
+    d->HuffQ5[1][ 6].Code =   5; d->HuffQ5[1][ 6].Length = 3;
+    d->HuffQ5[1][ 7].Code =   6; d->HuffQ5[1][ 7].Length = 3;
+    d->HuffQ5[1][ 8].Code =   4; d->HuffQ5[1][ 8].Length = 3;
+    d->HuffQ5[1][ 9].Code =   2; d->HuffQ5[1][ 9].Length = 3;
+    d->HuffQ5[1][10].Code =  15; d->HuffQ5[1][10].Length = 4;
+    d->HuffQ5[1][11].Code =  29; d->HuffQ5[1][11].Length = 5;
+    d->HuffQ5[1][12].Code =   6; d->HuffQ5[1][12].Length = 5;
+    d->HuffQ5[1][13].Code = 115; d->HuffQ5[1][13].Length = 7;
+    d->HuffQ5[1][14].Code = 228; d->HuffQ5[1][14].Length = 8;
+
+    /********************* 31-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ6[0][ 0].Code =  65; d->HuffQ6[0][ 0].Length = 7;
+    d->HuffQ6[0][ 1].Code =   6; d->HuffQ6[0][ 1].Length = 6;
+    d->HuffQ6[0][ 2].Code =  44; d->HuffQ6[0][ 2].Length = 6;
+    d->HuffQ6[0][ 3].Code =  45; d->HuffQ6[0][ 3].Length = 6;
+    d->HuffQ6[0][ 4].Code =  59; d->HuffQ6[0][ 4].Length = 6;
+    d->HuffQ6[0][ 5].Code =  13; d->HuffQ6[0][ 5].Length = 5;
+    d->HuffQ6[0][ 6].Code =  17; d->HuffQ6[0][ 6].Length = 5;
+    d->HuffQ6[0][ 7].Code =  19; d->HuffQ6[0][ 7].Length = 5;
+    d->HuffQ6[0][ 8].Code =  23; d->HuffQ6[0][ 8].Length = 5;
+    d->HuffQ6[0][ 9].Code =  21; d->HuffQ6[0][ 9].Length = 5;
+    d->HuffQ6[0][10].Code =  26; d->HuffQ6[0][10].Length = 5;
+    d->HuffQ6[0][11].Code =  30; d->HuffQ6[0][11].Length = 5;
+    d->HuffQ6[0][12].Code =   0; d->HuffQ6[0][12].Length = 4;
+    d->HuffQ6[0][13].Code =   2; d->HuffQ6[0][13].Length = 4;
+    d->HuffQ6[0][14].Code =   5; d->HuffQ6[0][14].Length = 4;
+    d->HuffQ6[0][15].Code =   7; d->HuffQ6[0][15].Length = 4;
+    d->HuffQ6[0][16].Code =   3; d->HuffQ6[0][16].Length = 4;
+    d->HuffQ6[0][17].Code =   4; d->HuffQ6[0][17].Length = 4;
+    d->HuffQ6[0][18].Code =  31; d->HuffQ6[0][18].Length = 5;
+    d->HuffQ6[0][19].Code =  28; d->HuffQ6[0][19].Length = 5;
+    d->HuffQ6[0][20].Code =  25; d->HuffQ6[0][20].Length = 5;
+    d->HuffQ6[0][21].Code =  27; d->HuffQ6[0][21].Length = 5;
+    d->HuffQ6[0][22].Code =  24; d->HuffQ6[0][22].Length = 5;
+    d->HuffQ6[0][23].Code =  20; d->HuffQ6[0][23].Length = 5;
+    d->HuffQ6[0][24].Code =  18; d->HuffQ6[0][24].Length = 5;
+    d->HuffQ6[0][25].Code =  12; d->HuffQ6[0][25].Length = 5;
+    d->HuffQ6[0][26].Code =   2; d->HuffQ6[0][26].Length = 5;
+    d->HuffQ6[0][27].Code =  58; d->HuffQ6[0][27].Length = 6;
+    d->HuffQ6[0][28].Code =  33; d->HuffQ6[0][28].Length = 6;
+    d->HuffQ6[0][29].Code =   7; d->HuffQ6[0][29].Length = 6;
+    d->HuffQ6[0][30].Code =  64; d->HuffQ6[0][30].Length = 7;
+
+    //more shaped, book 1
+    d->HuffQ6[1][ 0].Code = 6472; d->HuffQ6[1][ 0].Length = 13;
+    d->HuffQ6[1][ 1].Code = 6474; d->HuffQ6[1][ 1].Length = 13;
+    d->HuffQ6[1][ 2].Code =  808; d->HuffQ6[1][ 2].Length = 10;
+    d->HuffQ6[1][ 3].Code =  405; d->HuffQ6[1][ 3].Length =  9;
+    d->HuffQ6[1][ 4].Code =  203; d->HuffQ6[1][ 4].Length =  8;
+    d->HuffQ6[1][ 5].Code =  102; d->HuffQ6[1][ 5].Length =  7;
+    d->HuffQ6[1][ 6].Code =   49; d->HuffQ6[1][ 6].Length =  6;
+    d->HuffQ6[1][ 7].Code =    9; d->HuffQ6[1][ 7].Length =  5;
+    d->HuffQ6[1][ 8].Code =   15; d->HuffQ6[1][ 8].Length =  5;
+    d->HuffQ6[1][ 9].Code =   31; d->HuffQ6[1][ 9].Length =  5;
+    d->HuffQ6[1][10].Code =    2; d->HuffQ6[1][10].Length =  4;
+    d->HuffQ6[1][11].Code =    6; d->HuffQ6[1][11].Length =  4;
+    d->HuffQ6[1][12].Code =    8; d->HuffQ6[1][12].Length =  4;
+    d->HuffQ6[1][13].Code =   11; d->HuffQ6[1][13].Length =  4;
+    d->HuffQ6[1][14].Code =   13; d->HuffQ6[1][14].Length =  4;
+    d->HuffQ6[1][15].Code =    0; d->HuffQ6[1][15].Length =  3;
+    d->HuffQ6[1][16].Code =   14; d->HuffQ6[1][16].Length =  4;
+    d->HuffQ6[1][17].Code =   10; d->HuffQ6[1][17].Length =  4;
+    d->HuffQ6[1][18].Code =    9; d->HuffQ6[1][18].Length =  4;
+    d->HuffQ6[1][19].Code =    5; d->HuffQ6[1][19].Length =  4;
+    d->HuffQ6[1][20].Code =    3; d->HuffQ6[1][20].Length =  4;
+    d->HuffQ6[1][21].Code =   30; d->HuffQ6[1][21].Length =  5;
+    d->HuffQ6[1][22].Code =   14; d->HuffQ6[1][22].Length =  5;
+    d->HuffQ6[1][23].Code =    8; d->HuffQ6[1][23].Length =  5;
+    d->HuffQ6[1][24].Code =   48; d->HuffQ6[1][24].Length =  6;
+    d->HuffQ6[1][25].Code =  103; d->HuffQ6[1][25].Length =  7;
+    d->HuffQ6[1][26].Code =  201; d->HuffQ6[1][26].Length =  8;
+    d->HuffQ6[1][27].Code =  200; d->HuffQ6[1][27].Length =  8;
+    d->HuffQ6[1][28].Code = 1619; d->HuffQ6[1][28].Length = 11;
+    d->HuffQ6[1][29].Code = 6473; d->HuffQ6[1][29].Length = 13;
+    d->HuffQ6[1][30].Code = 6475; d->HuffQ6[1][30].Length = 13;
+
+    /********************* 63-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ7[0][ 0].Code = 103; d->HuffQ7[0][ 0].Length = 8;    /* 0.003338  -          01100111  */
+    d->HuffQ7[0][ 1].Code = 153; d->HuffQ7[0][ 1].Length = 8;    /* 0.003766  -          10011001  */
+    d->HuffQ7[0][ 2].Code = 181; d->HuffQ7[0][ 2].Length = 8;    /* 0.004715  -          10110101  */
+    d->HuffQ7[0][ 3].Code = 233; d->HuffQ7[0][ 3].Length = 8;    /* 0.005528  -          11101001  */
+    d->HuffQ7[0][ 4].Code =  64; d->HuffQ7[0][ 4].Length = 7;    /* 0.006677  -           1000000  */
+    d->HuffQ7[0][ 5].Code =  65; d->HuffQ7[0][ 5].Length = 7;    /* 0.007041  -           1000001  */
+    d->HuffQ7[0][ 6].Code =  77; d->HuffQ7[0][ 6].Length = 7;    /* 0.007733  -           1001101  */
+    d->HuffQ7[0][ 7].Code =  81; d->HuffQ7[0][ 7].Length = 7;    /* 0.008296  -           1010001  */
+    d->HuffQ7[0][ 8].Code =  91; d->HuffQ7[0][ 8].Length = 7;    /* 0.009295  -           1011011  */
+    d->HuffQ7[0][ 9].Code = 113; d->HuffQ7[0][ 9].Length = 7;    /* 0.010814  -           1110001  */
+    d->HuffQ7[0][10].Code = 112; d->HuffQ7[0][10].Length = 7;    /* 0.010807  -           1110000  */
+    d->HuffQ7[0][11].Code =  24; d->HuffQ7[0][11].Length = 6;    /* 0.012748  -            011000  */
+    d->HuffQ7[0][12].Code =  29; d->HuffQ7[0][12].Length = 6;    /* 0.013390  -            011101  */
+    d->HuffQ7[0][13].Code =  35; d->HuffQ7[0][13].Length = 6;    /* 0.014224  -            100011  */
+    d->HuffQ7[0][14].Code =  37; d->HuffQ7[0][14].Length = 6;    /* 0.015201  -            100101  */
+    d->HuffQ7[0][15].Code =  41; d->HuffQ7[0][15].Length = 6;    /* 0.016642  -            101001  */
+    d->HuffQ7[0][16].Code =  44; d->HuffQ7[0][16].Length = 6;    /* 0.017292  -            101100  */
+    d->HuffQ7[0][17].Code =  46; d->HuffQ7[0][17].Length = 6;    /* 0.018647  -            101110  */
+    d->HuffQ7[0][18].Code =  51; d->HuffQ7[0][18].Length = 6;    /* 0.020473  -            110011  */
+    d->HuffQ7[0][19].Code =  49; d->HuffQ7[0][19].Length = 6;    /* 0.020152  -            110001  */
+    d->HuffQ7[0][20].Code =  54; d->HuffQ7[0][20].Length = 6;    /* 0.021315  -            110110  */
+    d->HuffQ7[0][21].Code =  55; d->HuffQ7[0][21].Length = 6;    /* 0.021358  -            110111  */
+    d->HuffQ7[0][22].Code =  57; d->HuffQ7[0][22].Length = 6;    /* 0.021700  -            111001  */
+    d->HuffQ7[0][23].Code =  60; d->HuffQ7[0][23].Length = 6;    /* 0.022449  -            111100  */
+    d->HuffQ7[0][24].Code =   0; d->HuffQ7[0][24].Length = 5;    /* 0.023063  -             00000  */
+    d->HuffQ7[0][25].Code =   2; d->HuffQ7[0][25].Length = 5;    /* 0.023854  -             00010  */
+    d->HuffQ7[0][26].Code =  10; d->HuffQ7[0][26].Length = 5;    /* 0.025481  -             01010  */
+    d->HuffQ7[0][27].Code =   5; d->HuffQ7[0][27].Length = 5;    /* 0.024867  -             00101  */
+    d->HuffQ7[0][28].Code =   9; d->HuffQ7[0][28].Length = 5;    /* 0.025352  -             01001  */
+    d->HuffQ7[0][29].Code =   6; d->HuffQ7[0][29].Length = 5;    /* 0.025074  -             00110  */
+    d->HuffQ7[0][30].Code =  13; d->HuffQ7[0][30].Length = 5;    /* 0.025745  -             01101  */
+    d->HuffQ7[0][31].Code =   7; d->HuffQ7[0][31].Length = 5;    /* 0.025195  -             00111  */
+    d->HuffQ7[0][32].Code =  11; d->HuffQ7[0][32].Length = 5;    /* 0.025502  -             01011  */
+    d->HuffQ7[0][33].Code =  15; d->HuffQ7[0][33].Length = 5;    /* 0.026251  -             01111  */
+    d->HuffQ7[0][34].Code =   8; d->HuffQ7[0][34].Length = 5;    /* 0.025260  -             01000  */
+    d->HuffQ7[0][35].Code =   4; d->HuffQ7[0][35].Length = 5;    /* 0.024418  -             00100  */
+    d->HuffQ7[0][36].Code =   3; d->HuffQ7[0][36].Length = 5;    /* 0.023983  -             00011  */
+    d->HuffQ7[0][37].Code =   1; d->HuffQ7[0][37].Length = 5;    /* 0.023697  -             00001  */
+    d->HuffQ7[0][38].Code =  63; d->HuffQ7[0][38].Length = 6;    /* 0.023041  -            111111  */
+    d->HuffQ7[0][39].Code =  62; d->HuffQ7[0][39].Length = 6;    /* 0.022656  -            111110  */
+    d->HuffQ7[0][40].Code =  61; d->HuffQ7[0][40].Length = 6;    /* 0.022549  -            111101  */
+    d->HuffQ7[0][41].Code =  53; d->HuffQ7[0][41].Length = 6;    /* 0.021151  -            110101  */
+    d->HuffQ7[0][42].Code =  59; d->HuffQ7[0][42].Length = 6;    /* 0.022042  -            111011  */
+    d->HuffQ7[0][43].Code =  52; d->HuffQ7[0][43].Length = 6;    /* 0.020837  -            110100  */
+    d->HuffQ7[0][44].Code =  48; d->HuffQ7[0][44].Length = 6;    /* 0.019446  -            110000  */
+    d->HuffQ7[0][45].Code =  47; d->HuffQ7[0][45].Length = 6;    /* 0.019189  -            101111  */
+    d->HuffQ7[0][46].Code =  43; d->HuffQ7[0][46].Length = 6;    /* 0.017177  -            101011  */
+    d->HuffQ7[0][47].Code =  42; d->HuffQ7[0][47].Length = 6;    /* 0.017035  -            101010  */
+    d->HuffQ7[0][48].Code =  39; d->HuffQ7[0][48].Length = 6;    /* 0.015287  -            100111  */
+    d->HuffQ7[0][49].Code =  36; d->HuffQ7[0][49].Length = 6;    /* 0.014559  -            100100  */
+    d->HuffQ7[0][50].Code =  33; d->HuffQ7[0][50].Length = 6;    /* 0.014117  -            100001  */
+    d->HuffQ7[0][51].Code =  28; d->HuffQ7[0][51].Length = 6;    /* 0.012776  -            011100  */
+    d->HuffQ7[0][52].Code = 117; d->HuffQ7[0][52].Length = 7;    /* 0.011107  -           1110101  */
+    d->HuffQ7[0][53].Code = 101; d->HuffQ7[0][53].Length = 7;    /* 0.010636  -           1100101  */
+    d->HuffQ7[0][54].Code = 100; d->HuffQ7[0][54].Length = 7;    /* 0.009751  -           1100100  */
+    d->HuffQ7[0][55].Code =  80; d->HuffQ7[0][55].Length = 7;    /* 0.008132  -           1010000  */
+    d->HuffQ7[0][56].Code =  69; d->HuffQ7[0][56].Length = 7;    /* 0.007091  -           1000101  */
+    d->HuffQ7[0][57].Code =  68; d->HuffQ7[0][57].Length = 7;    /* 0.007084  -           1000100  */
+    d->HuffQ7[0][58].Code =  50; d->HuffQ7[0][58].Length = 7;    /* 0.006277  -           0110010  */
+    d->HuffQ7[0][59].Code = 232; d->HuffQ7[0][59].Length = 8;    /* 0.005386  -          11101000  */
+    d->HuffQ7[0][60].Code = 180; d->HuffQ7[0][60].Length = 8;    /* 0.004408  -          10110100  */
+    d->HuffQ7[0][61].Code = 152; d->HuffQ7[0][61].Length = 8;    /* 0.003759  -          10011000  */
+    d->HuffQ7[0][62].Code = 102; d->HuffQ7[0][62].Length = 8;    /* 0.003160  -          01100110  */
+
+    //more shaped, book 1
+    d->HuffQ7[1][ 0].Code = 14244; d->HuffQ7[1][ 0].Length = 14;    /* 0.000059  -        11011110100100  */
+    d->HuffQ7[1][ 1].Code = 14253; d->HuffQ7[1][ 1].Length = 14;    /* 0.000098  -        11011110101101  */
+    d->HuffQ7[1][ 2].Code = 14246; d->HuffQ7[1][ 2].Length = 14;    /* 0.000078  -        11011110100110  */
+    d->HuffQ7[1][ 3].Code = 14254; d->HuffQ7[1][ 3].Length = 14;    /* 0.000111  -        11011110101110  */
+    d->HuffQ7[1][ 4].Code =  3562; d->HuffQ7[1][ 4].Length = 12;    /* 0.000320  -          110111101010  */
+    d->HuffQ7[1][ 5].Code =   752; d->HuffQ7[1][ 5].Length = 10;    /* 0.000920  -            1011110000  */
+    d->HuffQ7[1][ 6].Code =   753; d->HuffQ7[1][ 6].Length = 10;    /* 0.001057  -            1011110001  */
+    d->HuffQ7[1][ 7].Code =   160; d->HuffQ7[1][ 7].Length =  9;    /* 0.001403  -             010100000  */
+    d->HuffQ7[1][ 8].Code =   162; d->HuffQ7[1][ 8].Length =  9;    /* 0.001579  -             010100010  */
+    d->HuffQ7[1][ 9].Code =   444; d->HuffQ7[1][ 9].Length =  9;    /* 0.002486  -             110111100  */
+    d->HuffQ7[1][10].Code =   122; d->HuffQ7[1][10].Length =  8;    /* 0.003772  -              01111010  */
+    d->HuffQ7[1][11].Code =   223; d->HuffQ7[1][11].Length =  8;    /* 0.005710  -              11011111  */
+    d->HuffQ7[1][12].Code =    60; d->HuffQ7[1][12].Length =  7;    /* 0.006858  -               0111100  */
+    d->HuffQ7[1][13].Code =    73; d->HuffQ7[1][13].Length =  7;    /* 0.008033  -               1001001  */
+    d->HuffQ7[1][14].Code =   110; d->HuffQ7[1][14].Length =  7;    /* 0.009827  -               1101110  */
+    d->HuffQ7[1][15].Code =    14; d->HuffQ7[1][15].Length =  6;    /* 0.012601  -                001110  */
+    d->HuffQ7[1][16].Code =    24; d->HuffQ7[1][16].Length =  6;    /* 0.013194  -                011000  */
+    d->HuffQ7[1][17].Code =    25; d->HuffQ7[1][17].Length =  6;    /* 0.013938  -                011001  */
+    d->HuffQ7[1][18].Code =    34; d->HuffQ7[1][18].Length =  6;    /* 0.015693  -                100010  */
+    d->HuffQ7[1][19].Code =    37; d->HuffQ7[1][19].Length =  6;    /* 0.017846  -                100101  */
+    d->HuffQ7[1][20].Code =    54; d->HuffQ7[1][20].Length =  6;    /* 0.020078  -                110110  */
+    d->HuffQ7[1][21].Code =     3; d->HuffQ7[1][21].Length =  5;    /* 0.022975  -                 00011  */
+    d->HuffQ7[1][22].Code =     9; d->HuffQ7[1][22].Length =  5;    /* 0.025631  -                 01001  */
+    d->HuffQ7[1][23].Code =    11; d->HuffQ7[1][23].Length =  5;    /* 0.027021  -                 01011  */
+    d->HuffQ7[1][24].Code =    16; d->HuffQ7[1][24].Length =  5;    /* 0.031465  -                 10000  */
+    d->HuffQ7[1][25].Code =    19; d->HuffQ7[1][25].Length =  5;    /* 0.034244  -                 10011  */
+    d->HuffQ7[1][26].Code =    21; d->HuffQ7[1][26].Length =  5;    /* 0.035921  -                 10101  */
+    d->HuffQ7[1][27].Code =    24; d->HuffQ7[1][27].Length =  5;    /* 0.037938  -                 11000  */
+    d->HuffQ7[1][28].Code =    26; d->HuffQ7[1][28].Length =  5;    /* 0.039595  -                 11010  */
+    d->HuffQ7[1][29].Code =    29; d->HuffQ7[1][29].Length =  5;    /* 0.041546  -                 11101  */
+    d->HuffQ7[1][30].Code =    31; d->HuffQ7[1][30].Length =  5;    /* 0.042623  -                 11111  */
+    d->HuffQ7[1][31].Code =     2; d->HuffQ7[1][31].Length =  4;    /* 0.045180  -                  0010  */
+    d->HuffQ7[1][32].Code =     0; d->HuffQ7[1][32].Length =  4;    /* 0.043151  -                  0000  */
+    d->HuffQ7[1][33].Code =    30; d->HuffQ7[1][33].Length =  5;    /* 0.042538  -                 11110  */
+    d->HuffQ7[1][34].Code =    28; d->HuffQ7[1][34].Length =  5;    /* 0.041422  -                 11100  */
+    d->HuffQ7[1][35].Code =    25; d->HuffQ7[1][35].Length =  5;    /* 0.039145  -                 11001  */
+    d->HuffQ7[1][36].Code =    22; d->HuffQ7[1][36].Length =  5;    /* 0.036691  -                 10110  */
+    d->HuffQ7[1][37].Code =    20; d->HuffQ7[1][37].Length =  5;    /* 0.034955  -                 10100  */
+    d->HuffQ7[1][38].Code =    14; d->HuffQ7[1][38].Length =  5;    /* 0.029155  -                 01110  */
+    d->HuffQ7[1][39].Code =    13; d->HuffQ7[1][39].Length =  5;    /* 0.027921  -                 01101  */
+    d->HuffQ7[1][40].Code =     8; d->HuffQ7[1][40].Length =  5;    /* 0.025553  -                 01000  */
+    d->HuffQ7[1][41].Code =     6; d->HuffQ7[1][41].Length =  5;    /* 0.023093  -                 00110  */
+    d->HuffQ7[1][42].Code =     2; d->HuffQ7[1][42].Length =  5;    /* 0.021200  -                 00010  */
+    d->HuffQ7[1][43].Code =    46; d->HuffQ7[1][43].Length =  6;    /* 0.018134  -                101110  */
+    d->HuffQ7[1][44].Code =    35; d->HuffQ7[1][44].Length =  6;    /* 0.015824  -                100011  */
+    d->HuffQ7[1][45].Code =    31; d->HuffQ7[1][45].Length =  6;    /* 0.014701  -                011111  */
+    d->HuffQ7[1][46].Code =    21; d->HuffQ7[1][46].Length =  6;    /* 0.013187  -                010101  */
+    d->HuffQ7[1][47].Code =    15; d->HuffQ7[1][47].Length =  6;    /* 0.012776  -                001111  */
+    d->HuffQ7[1][48].Code =    95; d->HuffQ7[1][48].Length =  7;    /* 0.009664  -               1011111  */
+    d->HuffQ7[1][49].Code =    72; d->HuffQ7[1][49].Length =  7;    /* 0.007922  -               1001000  */
+    d->HuffQ7[1][50].Code =    41; d->HuffQ7[1][50].Length =  7;    /* 0.006838  -               0101001  */
+    d->HuffQ7[1][51].Code =   189; d->HuffQ7[1][51].Length =  8;    /* 0.005024  -              10111101  */
+    d->HuffQ7[1][52].Code =   123; d->HuffQ7[1][52].Length =  8;    /* 0.003830  -              01111011  */
+    d->HuffQ7[1][53].Code =   377; d->HuffQ7[1][53].Length =  9;    /* 0.002232  -             101111001  */
+    d->HuffQ7[1][54].Code =   161; d->HuffQ7[1][54].Length =  9;    /* 0.001566  -             010100001  */
+    d->HuffQ7[1][55].Code =   891; d->HuffQ7[1][55].Length = 10;    /* 0.001383  -            1101111011  */
+    d->HuffQ7[1][56].Code =   327; d->HuffQ7[1][56].Length = 10;    /* 0.000900  -            0101000111  */
+    d->HuffQ7[1][57].Code =   326; d->HuffQ7[1][57].Length = 10;    /* 0.000790  -            0101000110  */
+    d->HuffQ7[1][58].Code =  3560; d->HuffQ7[1][58].Length = 12;    /* 0.000254  -          110111101000  */
+    d->HuffQ7[1][59].Code = 14255; d->HuffQ7[1][59].Length = 14;    /* 0.000117  -        11011110101111  */
+    d->HuffQ7[1][60].Code = 14247; d->HuffQ7[1][60].Length = 14;    /* 0.000085  -        11011110100111  */
+    d->HuffQ7[1][61].Code = 14252; d->HuffQ7[1][61].Length = 14;    /* 0.000085  -        11011110101100  */
+    d->HuffQ7[1][62].Code = 14245; d->HuffQ7[1][62].Length = 14;    /* 0.000065  -        11011110100101  */
+}
Index: /libmpcdec/tags/release-1.1/src/idtag.c
===================================================================
--- /libmpcdec/tags/release-1.1/src/idtag.c	(revision 30)
+++ /libmpcdec/tags/release-1.1/src/idtag.c	(revision 30)
@@ -0,0 +1,83 @@
+/*
+  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 idtag.c
+/// Rudimentary id3tag handling routines, just enough to skip id3v2 tags,
+/// if present.
+
+#include "musepack/musepack.h"
+#include "musepack/internal.h"
+
+mpc_int32_t
+JumpID3v2 (mpc_reader* r) {
+    unsigned char  tmp [10];
+    mpc_uint32_t   Unsynchronisation;   // ID3v2.4-flag
+    mpc_uint32_t   ExtHeaderPresent;    // ID3v2.4-flag
+    mpc_uint32_t   ExperimentalFlag;    // ID3v2.4-flag
+    mpc_uint32_t   FooterPresent;       // ID3v2.4-flag
+    mpc_int32_t    ret;
+
+    // seek to first byte of mpc data
+    if (!r->seek (r->data, 0)) {
+        return 0;  
+    }
+    
+    r->read(r->data, tmp, sizeof(tmp));
+
+    // check id3-tag
+    if ( 0 != memcmp ( tmp, "ID3", 3) )
+        return 0;
+
+    // read flags
+    Unsynchronisation = tmp[5] & 0x80;
+    ExtHeaderPresent  = tmp[5] & 0x40;
+    ExperimentalFlag  = tmp[5] & 0x20;
+    FooterPresent     = tmp[5] & 0x10;
+
+    if ( tmp[5] & 0x0F )
+        return -1;              // not (yet???) allowed
+    if ( (tmp[6] | tmp[7] | tmp[8] | tmp[9]) & 0x80 )
+        return -1;              // not allowed
+
+    // read HeaderSize (syncsave: 4 * $0xxxxxxx = 28 significant bits)
+    ret  = tmp[6] << 21;
+    ret += tmp[7] << 14;
+    ret += tmp[8] <<  7;
+    ret += tmp[9]      ;
+    ret += 10;
+    if ( FooterPresent )
+        ret += 10;
+
+    return ret;
+}
Index: /libmpcdec/tags/release-1.1/src/mpc_decoder.c
===================================================================
--- /libmpcdec/tags/release-1.1/src/mpc_decoder.c	(revision 30)
+++ /libmpcdec/tags/release-1.1/src/mpc_decoder.c	(revision 30)
@@ -0,0 +1,1349 @@
+/*
+  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 mpc_decoder.c
+/// Core decoding routines and logic.
+
+#include "musepack/musepack.h"
+#include "musepack/internal.h"
+#include "musepack/requant.h"
+#include "musepack/huffman.h"
+
+//------------------------------------------------------------------------------
+// types
+//------------------------------------------------------------------------------
+enum
+    {
+        EQ_TAP = 13,                        // length of FIR filter for EQ
+        DELAY = ((EQ_TAP + 1) / 2),         // delay of FIR
+        FIR_BANDS = 4,                      // number of subbands to be FIR filtered
+        MEMSIZE = MPC_DECODER_MEMSIZE,      // overall buffer size
+        MEMSIZE2 = (MEMSIZE/2),             // size of one buffer
+        MEMMASK = (MEMSIZE-1)
+    };
+
+//------------------------------------------------------------------------------
+// forward declarations
+//------------------------------------------------------------------------------
+void mpc_decoder_init_huffman_sv6(mpc_decoder *d);
+void mpc_decoder_init_huffman_sv7(mpc_decoder *d);
+void mpc_decoder_read_bitstream_sv6(mpc_decoder *d);
+void mpc_decoder_read_bitstream_sv7(mpc_decoder *d);
+void mpc_decoder_update_buffer(mpc_decoder *d, mpc_uint32_t RING);
+BOOL mpc_decoder_seek_sample(mpc_decoder *d, mpc_int64_t destsample);
+void mpc_decoder_requantisierung(mpc_decoder *d, const mpc_int32_t Last_Band);
+
+//------------------------------------------------------------------------------
+// utility functions
+//------------------------------------------------------------------------------
+static mpc_int32_t f_read(mpc_decoder *d, void *ptr, size_t size) 
+{ 
+    return d->r->read(d->r->data, ptr, size); 
+};
+
+static BOOL f_seek(mpc_decoder *d, mpc_int32_t offset) 
+{ 
+    return d->r->seek(d->r->data, offset); 
+};
+
+static mpc_int32_t f_read_dword(mpc_decoder *d, mpc_uint32_t * ptr, mpc_uint32_t count) 
+{
+    count = f_read(d, ptr, count << 2) >> 2;
+#ifndef MPC_LITTLE_ENDIAN
+    mpc_uint32_t n;
+    for(n = 0; n< count; n++) {
+        ptr[n] = swap32(ptr[n]);
+    }
+#endif
+    return count;
+}
+
+//------------------------------------------------------------------------------
+// huffman & bitstream functions
+//------------------------------------------------------------------------------
+static const mpc_uint32_t mask [33] = {
+    0x00000000, 0x00000001, 0x00000003, 0x00000007,
+    0x0000000F, 0x0000001F, 0x0000003F, 0x0000007F,
+    0x000000FF, 0x000001FF, 0x000003FF, 0x000007FF,
+    0x00000FFF, 0x00001FFF, 0x00003FFF, 0x00007FFF,
+    0x0000FFFF, 0x0001FFFF, 0x0003FFFF, 0x0007FFFF,
+    0x000FFFFF, 0x001FFFFF, 0x003FFFFF, 0x007FFFFF,
+    0x00FFFFFF, 0x01FFFFFF, 0x03FFFFFF, 0x07FFFFFF,
+    0x0FFFFFFF, 0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF,
+    0xFFFFFFFF
+};
+
+/* F U N C T I O N S */
+
+// resets bitstream decoding
+static void
+mpc_decoder_reset_bitstream_decode(mpc_decoder *d) 
+{
+    d->dword = 0;
+    d->pos = 0;
+    d->Zaehler = 0;
+    d->WordsRead = 0;
+}
+
+// reports the number of read bits
+static mpc_uint32_t
+mpc_decoder_bits_read(mpc_decoder *d) 
+{
+    return 32 * d->WordsRead + d->pos;
+}
+
+// read desired number of bits out of the bitstream
+static mpc_uint32_t
+mpc_decoder_bitstream_read(mpc_decoder *d, const mpc_uint32_t bits) 
+{
+    mpc_uint32_t out = d->dword;
+
+    d->pos += bits;
+
+    if (d->pos < 32) {
+        out >>= (32 - d->pos);
+    }
+    else {
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
+        d->pos -= 32;
+        if (d->pos) {
+            out <<= d->pos;
+            out |= d->dword >> (32 - d->pos);
+        }
+        ++(d->WordsRead);
+    }
+
+    return out & mask[bits];
+}
+
+// decode SCFI-bundle (sv4,5,6)
+static void
+mpc_decoder_scfi_bundle_read(
+    mpc_decoder *d,
+    HuffmanTyp* Table, mpc_int32_t* SCFI, mpc_int32_t* DSCF) 
+{
+    // load preview and decode
+    mpc_uint32_t code  = d->dword << d->pos;
+    if (d->pos > 26) {
+        code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
+    }
+    while (code < Table->Code) {
+        Table++;
+    }
+
+    // set the new position within bitstream without performing a dummy-read
+    if ((d->pos += Table->Length) >= 32) {
+        d->pos -= 32;
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler+1) & MEMMASK];
+        ++(d->WordsRead);
+    }
+
+    *SCFI = Table->Value >> 1;
+    *DSCF = Table->Value &  1;
+}
+
+static int
+mpc_decoder_huffman_typ_cmpfn(const void* p1, const void* p2)
+{
+    if (((HuffmanTyp*) p1)->Code < ((HuffmanTyp*) p2)->Code ) return +1;
+    if (((HuffmanTyp*) p1)->Code > ((HuffmanTyp*) p2)->Code ) return -1;
+    return 0;
+}
+
+// sort huffman-tables by codeword
+// offset resulting value
+void
+mpc_decoder_resort_huff_tables(
+    const mpc_uint32_t elements, HuffmanTyp* Table, const mpc_int32_t offset ) 
+{
+    mpc_uint32_t  i;
+
+    for ( i = 0; i < elements; i++ ) {
+        Table[i].Code <<= 32 - Table[i].Length;
+        Table[i].Value  =  i - offset;
+    }
+    qsort(Table, elements, sizeof(*Table), mpc_decoder_huffman_typ_cmpfn);
+}
+
+// basic huffman decoding routine
+// works with maximum lengths up to 14
+static mpc_int32_t
+mpc_decoder_huffman_decode(mpc_decoder *d, const HuffmanTyp *Table) 
+{
+    // load preview and decode
+    mpc_uint32_t code = d->dword << d->pos;
+    if (d->pos > 18) {
+        code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
+    }
+    while (code < Table->Code) {
+        Table++;
+    }
+
+    // set the new position within bitstream without performing a dummy-read
+    if ((d->pos += Table->Length) >= 32) {
+        d->pos -= 32;
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
+        ++(d->WordsRead);
+    }
+
+    return Table->Value;
+}
+
+// faster huffman through previewing less bits
+// works with maximum lengths up to 10
+static mpc_int32_t
+mpc_decoder_huffman_decode_fast(mpc_decoder *d, const HuffmanTyp* Table)
+{
+    // load preview and decode
+    mpc_uint32_t code  = d->dword << d->pos;
+    if (d->pos > 22) {
+        code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
+    }
+    while (code < Table->Code) {
+        Table++;
+    }
+
+    // set the new position within bitstream without performing a dummy-read
+    if ((d->pos += Table->Length) >= 32) {
+        d->pos -= 32;
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
+        ++(d->WordsRead);
+    }
+
+    return Table->Value;
+}
+
+// even faster huffman through previewing even less bits
+// works with maximum lengths up to 5
+static mpc_int32_t
+mpc_decoder_huffman_decode_faster(mpc_decoder *d, const HuffmanTyp* Table)
+{
+    // load preview and decode
+    mpc_uint32_t code  = d->dword << d->pos;
+    if (d->pos > 27) {
+        code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
+    }
+    while (code < Table->Code) {
+        Table++;
+    }
+
+    // set the new position within bitstream without performing a dummy-read
+    if ((d->pos += Table->Length) >= 32) {
+        d->pos -= 32;
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
+        ++(d->WordsRead);
+    }
+
+    return Table->Value;
+}
+
+static void
+mpc_decoder_reset_v(mpc_decoder *d) 
+{
+    memset(d->V_L, 0, sizeof d->V_L);
+    memset(d->V_R, 0, sizeof d->V_R);
+}
+
+static void
+mpc_decoder_reset_synthesis(mpc_decoder *d) 
+{
+    mpc_decoder_reset_v(d);
+}
+
+static void
+mpc_decoder_reset_y(mpc_decoder *d) 
+{
+    memset(d->Y_L, 0, sizeof d->Y_L);
+    memset(d->Y_R, 0, sizeof d->Y_R);
+}
+
+static void
+mpc_decoder_reset_globals(mpc_decoder *d) 
+{
+    mpc_decoder_reset_bitstream_decode(d);
+
+    d->DecodedFrames  = 0;
+    d->StreamVersion  = 0;
+    d->MS_used        = 0;
+
+    memset(d->Y_L          , 0, sizeof d->Y_L           );
+    memset(d->Y_R          , 0, sizeof d->Y_R           );
+    memset(d->SCF_Index_L     , 0, sizeof d->SCF_Index_L      );
+    memset(d->SCF_Index_R     , 0, sizeof d->SCF_Index_R      );
+    memset(d->Res_L           , 0, sizeof d->Res_L            );
+    memset(d->Res_R           , 0, sizeof d->Res_R            );
+    memset(d->SCFI_L          , 0, sizeof d->SCFI_L           );
+    memset(d->SCFI_R          , 0, sizeof d->SCFI_R           );
+    memset(d->DSCF_Flag_L     , 0, sizeof d->DSCF_Flag_L      );
+    memset(d->DSCF_Flag_R     , 0, sizeof d->DSCF_Flag_R      );
+    memset(d->DSCF_Reference_L, 0, sizeof d->DSCF_Reference_L );
+    memset(d->DSCF_Reference_R, 0, sizeof d->DSCF_Reference_R );
+    memset(d->Q               , 0, sizeof d->Q                );
+    memset(d->MS_Flag         , 0, sizeof d->MS_Flag          );
+}
+
+static mpc_uint32_t
+mpc_decoder_decode_internal(mpc_decoder *d, MPC_SAMPLE_FORMAT *buffer) 
+{
+    mpc_uint32_t output_frame_length = MPC_FRAME_LENGTH;
+
+    mpc_uint32_t  FrameBitCnt = 0;
+
+    if (d->DecodedFrames >= d->OverallFrames) {
+        return (mpc_uint32_t)(-1);                           // end of file -> abort decoding
+    }
+
+    // read jump-info for validity check of frame
+    d->FwdJumpInfo  = mpc_decoder_bitstream_read(d, 20);
+
+    d->ActDecodePos = (d->Zaehler << 5) + d->pos;
+
+    // decode data and check for validity of frame
+    FrameBitCnt = mpc_decoder_bits_read(d);
+    switch (d->StreamVersion) {
+    case 0x04:
+    case 0x05:
+    case 0x06:
+        mpc_decoder_read_bitstream_sv6(d);
+        break;
+    case 0x07:
+    case 0x17:
+        mpc_decoder_read_bitstream_sv7(d);
+        break;
+    default:
+        return (mpc_uint32_t)(-1);
+    }
+    d->FrameWasValid = mpc_decoder_bits_read(d) - FrameBitCnt == d->FwdJumpInfo;
+
+    // synthesize signal
+    mpc_decoder_requantisierung(d, d->Max_Band);
+
+    //if ( d->EQ_activated && PluginSettings.EQbyMPC )
+    //    perform_EQ ();
+
+    mpc_decoder_synthese_filter_float(d, buffer);
+
+    d->DecodedFrames++;
+
+    // cut off first MPC_DECODER_SYNTH_DELAY zero-samples
+    if (d->DecodedFrames == d->OverallFrames  && d->StreamVersion >= 6) {        
+        // reconstruct exact filelength
+        mpc_int32_t  mod_block   = mpc_decoder_bitstream_read(d,  11);
+        mpc_int32_t  FilterDecay;
+
+        if (mod_block == 0) {
+            // Encoder bugfix
+            mod_block = 1152;                    
+        }
+        FilterDecay = (mod_block + MPC_DECODER_SYNTH_DELAY) % MPC_FRAME_LENGTH;
+
+        // additional FilterDecay samples are needed for decay of synthesis filter
+        if (MPC_DECODER_SYNTH_DELAY + mod_block >= MPC_FRAME_LENGTH) {
+
+            // **********************************************************************
+            // Rhoades 4/16/2002
+            // Commented out are blocks of code which cause gapless playback to fail.
+            // Temporary fix...
+            // **********************************************************************
+
+            if (!d->TrueGaplessPresent) {
+                mpc_decoder_reset_y(d);
+            } 
+            else {
+                //if ( MPC_FRAME_LENGTH != d->LastValidSamples ) {
+                mpc_decoder_bitstream_read(d, 20);
+                mpc_decoder_read_bitstream_sv7(d);
+                mpc_decoder_requantisierung(d, d->Max_Band);
+                //FilterDecay = d->LastValidSamples;
+                //}
+                //else {
+                //FilterDecay = 0;
+                //}
+            }
+
+            mpc_decoder_synthese_filter_float(d, buffer + 2304);
+
+            output_frame_length = MPC_FRAME_LENGTH + FilterDecay;
+        }
+        else {                              // there are only FilterDecay samples needed for this frame
+            output_frame_length = FilterDecay;
+        }
+    }
+
+    if (d->samples_to_skip) {
+        if (output_frame_length < d->samples_to_skip) {
+            d->samples_to_skip -= output_frame_length;
+            output_frame_length = 0;
+        }
+        else {
+            output_frame_length -= d->samples_to_skip;
+            memmove(
+                buffer, 
+                buffer + d->samples_to_skip * 2, 
+                output_frame_length * 2 * sizeof (MPC_SAMPLE_FORMAT));
+            d->samples_to_skip = 0;
+        }
+    }
+
+    return output_frame_length;
+}
+
+mpc_uint32_t mpc_decoder_decode(
+    mpc_decoder *d,
+    MPC_SAMPLE_FORMAT *buffer, 
+    mpc_uint32_t *vbr_update_acc, 
+    mpc_uint32_t *vbr_update_bits)
+{
+    for(;;)
+    {
+        //const mpc_int32_t MaxBrokenFrames = 0; // PluginSettings.MaxBrokenFrames
+
+        mpc_uint32_t RING = d->Zaehler;
+        mpc_int32_t vbr_ring = (RING << 5) + d->pos;
+
+        mpc_uint32_t valid_samples = mpc_decoder_decode_internal(d, buffer);
+
+        if (valid_samples == (mpc_uint32_t)(-1) ) {
+            return 0;
+        }
+
+        /**************** ERROR CONCEALMENT *****************/
+        if (d->FrameWasValid == 0 ) {
+            // error occurred in bitstream
+            return (mpc_uint32_t)(-1);
+        } 
+        else {
+            if (vbr_update_acc && vbr_update_bits) {
+                (*vbr_update_acc) ++;
+                vbr_ring = (d->Zaehler << 5) + d->pos - vbr_ring;
+                if (vbr_ring < 0) {
+                    vbr_ring += 524288;
+                }
+                (*vbr_update_bits) += vbr_ring;
+            }
+
+        }
+        mpc_decoder_update_buffer(d, RING);
+
+        if (valid_samples > 0) {
+            return valid_samples;
+        }
+    }
+}
+
+void
+mpc_decoder_requantisierung(mpc_decoder *d, const mpc_int32_t Last_Band) 
+{
+    mpc_int32_t     Band;
+    mpc_int32_t     n;
+    MPC_SAMPLE_FORMAT facL;
+    MPC_SAMPLE_FORMAT facR;
+    MPC_SAMPLE_FORMAT templ;
+    MPC_SAMPLE_FORMAT tempr;
+    MPC_SAMPLE_FORMAT* YL;
+    MPC_SAMPLE_FORMAT* YR;
+    mpc_int32_t*    L;
+    mpc_int32_t*    R;
+
+#ifdef MPC_FIXED_POINT
+#if MPC_FIXED_POINT_FRACTPART == 14
+#define MPC_MULTIPLY_SCF(CcVal, SCF_idx) \
+    MPC_MULTIPLY_EX(CcVal, d->SCF[SCF_idx], d->SCF_shift[SCF_idx])
+#else
+
+#error FIXME, Cc table is in 18.14 format
+
+#endif
+#else
+#define MPC_MULTIPLY_SCF(CcVal, SCF_idx) \
+    MPC_MULTIPLY(CcVal, d->SCF[SCF_idx])
+#endif
+    // requantization and scaling of subband-samples
+    for ( Band = 0; Band <= Last_Band; Band++ ) {   // setting pointers
+        YL = d->Y_L[0] + Band;
+        YR = d->Y_R[0] + Band;
+        L  = d->Q[Band].L;
+        R  = d->Q[Band].R;
+        /************************** MS-coded **************************/
+        if ( d->MS_Flag [Band] ) {
+            if ( d->Res_L [Band] ) {
+                if ( d->Res_R [Band] ) {    // M!=0, S!=0
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YL   = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++));
+                        *YR   = templ - tempr;
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YL   = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++));
+                        *YR   = templ - tempr;
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YL   = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++));
+                        *YR   = templ - tempr;
+                    }
+                } else {    // M!=0, S==0
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                    }
+                }
+            } else {
+                if (d->Res_R[Band])    // M==0, S!=0
+                {
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YR = - (*YL = MPC_MULTIPLY_FLOAT_INT(facR,*(R++)));
+                    }
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YR = - (*YL = MPC_MULTIPLY_FLOAT_INT(facR,*(R++)));
+                    }
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YR = - (*YL = MPC_MULTIPLY_FLOAT_INT(facR,*(R++)));
+                    }
+                } else {    // M==0, S==0
+                    for ( n = 0; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = 0;
+                    }
+                }
+            }
+        }
+        /************************** LR-coded **************************/
+        else {
+            if ( d->Res_L [Band] ) {
+                if ( d->Res_R [Band] ) {    // L!=0, R!=0
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
+                    for (n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
+                    for (; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
+                    for (; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                } else {     // L!=0, R==0
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = 0;
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = 0;
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = 0;
+                    }
+                }
+            }
+            else {
+                if ( d->Res_R [Band] ) {    // L==0, R!=0
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YL = 0;
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YL = 0;
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YL = 0;
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                } else {    // L==0, R==0
+                    for ( n = 0; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = 0;
+                    }
+                }
+            }
+        }
+    }
+}
+
+/****************************************** SV 6 ******************************************/
+void
+mpc_decoder_read_bitstream_sv6(mpc_decoder *d) 
+{
+    mpc_int32_t n,k;
+    mpc_int32_t Max_used_Band=0;
+    HuffmanTyp *Table;
+    const HuffmanTyp *x1;
+    const HuffmanTyp *x2;
+    mpc_int32_t *L;
+    mpc_int32_t *R;
+    mpc_int32_t *ResL = d->Res_L;
+    mpc_int32_t *ResR = d->Res_R;
+
+    /************************ HEADER **************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    for (n=0; n <= d->Max_Band; ++n, ++ResL, ++ResR)
+    {
+        if      (n<11)           Table = d->Region_A;
+        else if (n>=11 && n<=22) Table = d->Region_B;
+        else /*if (n>=23)*/      Table = d->Region_C;
+
+        *ResL = d->Q_res[n][mpc_decoder_huffman_decode(d, Table)];
+        if (d->MS_used) {
+            d->MS_Flag[n] = mpc_decoder_bitstream_read(d,  1);
+        }
+        *ResR = d->Q_res[n][mpc_decoder_huffman_decode(d, Table)];
+
+        // only perform the following procedure up to the maximum non-zero subband
+        if (*ResL || *ResR) Max_used_Band = n;
+    }
+
+    /************************* SCFI-Bundle *****************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    for (n=0; n<=Max_used_Band; ++n, ++ResL, ++ResR) {
+        if (*ResL) mpc_decoder_scfi_bundle_read(d, d->SCFI_Bundle, &(d->SCFI_L[n]), &(d->DSCF_Flag_L[n]));
+        if (*ResR) mpc_decoder_scfi_bundle_read(d, d->SCFI_Bundle, &(d->SCFI_R[n]), &(d->DSCF_Flag_R[n]));
+    }
+
+    /***************************** SCFI ********************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    L    = d->SCF_Index_L[0];
+    R    = d->SCF_Index_R[0];
+    for (n=0; n <= Max_used_Band; ++n, ++ResL, ++ResR, L+=3, R+=3)
+    {
+        if (*ResL)
+        {
+            /*********** DSCF ************/
+            if (d->DSCF_Flag_L[n]==1)
+            {
+                L[2] = d->DSCF_Reference_L[n];
+                switch (d->SCFI_L[n])
+                {
+                case 3:
+                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[1] = L[0];
+                    L[2] = L[1];
+                    break;
+                case 1:
+                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[1] = L[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[2] = L[1];
+                    break;
+                case 2:
+                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[1] = L[0];
+                    L[2] = L[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    break;
+                case 0:
+                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[1] = L[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[2] = L[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    break;
+                default:
+                    return;
+                    break;
+                }
+            }
+            /************ SCF ************/
+            else
+            {
+                switch (d->SCFI_L[n])
+                {
+                case 3:
+                    L[0] = mpc_decoder_bitstream_read(d,  6);
+                    L[1] = L[0];
+                    L[2] = L[1];
+                    break;
+                case 1:
+                    L[0] = mpc_decoder_bitstream_read(d,  6);
+                    L[1] = mpc_decoder_bitstream_read(d,  6);
+                    L[2] = L[1];
+                    break;
+                case 2:
+                    L[0] = mpc_decoder_bitstream_read(d,  6);
+                    L[1] = L[0];
+                    L[2] = mpc_decoder_bitstream_read(d,  6);
+                    break;
+                case 0:
+                    L[0] = mpc_decoder_bitstream_read(d,  6);
+                    L[1] = mpc_decoder_bitstream_read(d,  6);
+                    L[2] = mpc_decoder_bitstream_read(d,  6);
+                    break;
+                default:
+                    return;
+                    break;
+                }
+            }
+            // update Reference for DSCF
+            d->DSCF_Reference_L[n] = L[2];
+        }
+        if (*ResR)
+        {
+            R[2] = d->DSCF_Reference_R[n];
+            /*********** DSCF ************/
+            if (d->DSCF_Flag_R[n]==1)
+            {
+                switch (d->SCFI_R[n])
+                {
+                case 3:
+                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[1] = R[0];
+                    R[2] = R[1];
+                    break;
+                case 1:
+                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[1] = R[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[2] = R[1];
+                    break;
+                case 2:
+                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[1] = R[0];
+                    R[2] = R[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    break;
+                case 0:
+                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[1] = R[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[2] = R[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    break;
+                default:
+                    return;
+                    break;
+                }
+            }
+            /************ SCF ************/
+            else
+            {
+                switch (d->SCFI_R[n])
+                {
+                case 3:
+                    R[0] = mpc_decoder_bitstream_read(d, 6);
+                    R[1] = R[0];
+                    R[2] = R[1];
+                    break;
+                case 1:
+                    R[0] = mpc_decoder_bitstream_read(d, 6);
+                    R[1] = mpc_decoder_bitstream_read(d, 6);
+                    R[2] = R[1];
+                    break;
+                case 2:
+                    R[0] = mpc_decoder_bitstream_read(d, 6);
+                    R[1] = R[0];
+                    R[2] = mpc_decoder_bitstream_read(d, 6);
+                    break;
+                case 0:
+                    R[0] = mpc_decoder_bitstream_read(d, 6);
+                    R[1] = mpc_decoder_bitstream_read(d, 6);
+                    R[2] = mpc_decoder_bitstream_read(d, 6);
+                    break;
+                default:
+                    return;
+                    break;
+                }
+            }
+            // update Reference for DSCF
+            d->DSCF_Reference_R[n] = R[2];
+        }
+    }
+
+    /**************************** Samples ****************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    for (n=0; n <= Max_used_Band; ++n, ++ResL, ++ResR)
+    {
+        // setting pointers
+        x1 = d->SampleHuff[*ResL];
+        x2 = d->SampleHuff[*ResR];
+        L = d->Q[n].L;
+        R = d->Q[n].R;
+
+        if (x1!=NULL || x2!=NULL)
+            for (k=0; k<36; ++k)
+            {
+                if (x1 != NULL) *L++ = mpc_decoder_huffman_decode_fast(d,  x1);
+                if (x2 != NULL) *R++ = mpc_decoder_huffman_decode_fast(d,  x2);
+            }
+
+        if (*ResL>7 || *ResR>7)
+            for (k=0; k<36; ++k)
+            {
+                if (*ResL>7) *L++ = (mpc_int32_t)mpc_decoder_bitstream_read(d,  Res_bit[*ResL]) - Dc[*ResL];
+                if (*ResR>7) *R++ = (mpc_int32_t)mpc_decoder_bitstream_read(d,  Res_bit[*ResR]) - Dc[*ResR];
+            }
+    }
+}
+
+/****************************************** SV 7 ******************************************/
+void
+mpc_decoder_read_bitstream_sv7(mpc_decoder *d) 
+{
+    // these arrays hold decoding results for bundled quantizers (3- and 5-step)
+    /*static*/ mpc_int32_t idx30[] = { -1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1};
+    /*static*/ mpc_int32_t idx31[] = { -1,-1,-1, 0, 0, 0, 1, 1, 1,-1,-1,-1, 0, 0, 0, 1, 1, 1,-1,-1,-1, 0, 0, 0, 1, 1, 1};
+    /*static*/ mpc_int32_t idx32[] = { -1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1};
+    /*static*/ mpc_int32_t idx50[] = { -2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2};
+    /*static*/ mpc_int32_t idx51[] = { -2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2};
+
+    mpc_int32_t n,k;
+    mpc_int32_t Max_used_Band=0;
+    const HuffmanTyp *Table;
+    mpc_int32_t idx;
+    mpc_int32_t *L   ,*R;
+    mpc_int32_t *ResL,*ResR;
+    mpc_uint32_t tmp;
+
+    /***************************** Header *****************************/
+    ResL  = d->Res_L;
+    ResR  = d->Res_R;
+
+    // first subband
+    *ResL = mpc_decoder_bitstream_read(d, 4);
+    *ResR = mpc_decoder_bitstream_read(d, 4);
+    if (d->MS_used && !(*ResL==0 && *ResR==0)) {
+        d->MS_Flag[0] = mpc_decoder_bitstream_read(d, 1);
+    }
+
+    // consecutive subbands
+    ++ResL; ++ResR; // increase pointers
+    for (n=1; n <= d->Max_Band; ++n, ++ResL, ++ResR)
+    {
+        idx   = mpc_decoder_huffman_decode_fast(d, d->HuffHdr);
+        *ResL = (idx!=4) ? *(ResL-1) + idx : mpc_decoder_bitstream_read(d, 4);
+
+        idx   = mpc_decoder_huffman_decode_fast(d, d->HuffHdr);
+        *ResR = (idx!=4) ? *(ResR-1) + idx : mpc_decoder_bitstream_read(d, 4);
+
+        if (d->MS_used && !(*ResL==0 && *ResR==0)) {
+            d->MS_Flag[n] = mpc_decoder_bitstream_read(d, 1);
+        }
+
+        // only perform following procedures up to the maximum non-zero subband
+        if (*ResL!=0 || *ResR!=0) {
+            Max_used_Band = n;
+        }
+    }
+    /****************************** SCFI ******************************/
+    L     = d->SCFI_L;
+    R     = d->SCFI_R;
+    ResL  = d->Res_L;
+    ResR  = d->Res_R;
+    for (n=0; n <= Max_used_Band; ++n, ++L, ++R, ++ResL, ++ResR) {
+        if (*ResL) *L = mpc_decoder_huffman_decode_faster(d, d->HuffSCFI);
+        if (*ResR) *R = mpc_decoder_huffman_decode_faster(d, d->HuffSCFI);
+    }
+
+    /**************************** SCF/DSCF ****************************/
+    ResL  = d->Res_L;
+    ResR  = d->Res_R;
+    L     = d->SCF_Index_L[0];
+    R     = d->SCF_Index_R[0];
+    for (n=0; n<=Max_used_Band; ++n, ++ResL, ++ResR, L+=3, R+=3) {
+        if (*ResL)
+        {
+            L[2] = d->DSCF_Reference_L[n];
+            switch (d->SCFI_L[n])
+            {
+            case 1:
+                idx  = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
+                L[0] = (idx!=8) ? L[2] + idx : mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
+                L[1] = (idx!=8) ? L[0] + idx : mpc_decoder_bitstream_read(d, 6);
+                L[2] = L[1];
+                break;
+            case 3:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[0] = (idx!=8) ? L[2] + idx : mpc_decoder_bitstream_read(d, 6);
+                L[1] = L[0];
+                L[2] = L[1];
+                break;
+            case 2:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[0] = (idx!=8) ? L[2] + idx : mpc_decoder_bitstream_read(d, 6);
+                L[1] = L[0];
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[2] = (idx!=8) ? L[1] + idx : mpc_decoder_bitstream_read(d, 6);
+                break;
+            case 0:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[0] = (idx!=8) ? L[2] + idx : mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[1] = (idx!=8) ? L[0] + idx : mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[2] = (idx!=8) ? L[1] + idx : mpc_decoder_bitstream_read(d, 6);
+                break;
+            default:
+                return;
+                break;
+            }
+            // update Reference for DSCF
+            d->DSCF_Reference_L[n] = L[2];
+        }
+        if (*ResR)
+        {
+            R[2] = d->DSCF_Reference_R[n];
+            switch (d->SCFI_R[n])
+            {
+            case 1:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[0] = (idx!=8) ? R[2] + idx : mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[1] = (idx!=8) ? R[0] + idx : mpc_decoder_bitstream_read(d, 6);
+                R[2] = R[1];
+                break;
+            case 3:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[0] = (idx!=8) ? R[2] + idx : mpc_decoder_bitstream_read(d, 6);
+                R[1] = R[0];
+                R[2] = R[1];
+                break;
+            case 2:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[0] = (idx!=8) ? R[2] + idx : mpc_decoder_bitstream_read(d, 6);
+                R[1] = R[0];
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[2] = (idx!=8) ? R[1] + idx : mpc_decoder_bitstream_read(d, 6);
+                break;
+            case 0:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[0] = (idx!=8) ? R[2] + idx : mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[1] = (idx!=8) ? R[0] + idx : mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[2] = (idx!=8) ? R[1] + idx : mpc_decoder_bitstream_read(d, 6);
+                break;
+            default:
+                return;
+                break;
+            }
+            // update Reference for DSCF
+            d->DSCF_Reference_R[n] = R[2];
+        }
+    }
+    /***************************** Samples ****************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    L    = d->Q[0].L;
+    R    = d->Q[0].R;
+    for (n=0; n <= Max_used_Band; ++n, ++ResL, ++ResR, L+=36, R+=36)
+    {
+        /************** links **************/
+        switch (*ResL)
+        {
+        case  -2: case  -3: case  -4: case  -5: case  -6: case  -7: case  -8: case  -9:
+        case -10: case -11: case -12: case -13: case -14: case -15: case -16: case -17:
+            L += 36;
+            break;
+        case -1:
+            for (k=0; k<36; k++ ) {
+                tmp  = random_int(d);
+                *L++ = ((tmp >> 24) & 0xFF) + ((tmp >> 16) & 0xFF) + ((tmp >>  8) & 0xFF) + ((tmp >>  0) & 0xFF) - 510;
+            }
+            break;
+        case 0:
+            L += 36;// increase pointer
+            break;
+        case 1:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][1];
+            for (k=0; k<12; ++k)
+            {
+                idx = mpc_decoder_huffman_decode_fast(d,  Table);
+                *L++ = idx30[idx];
+                *L++ = idx31[idx];
+                *L++ = idx32[idx];
+            }
+            break;
+        case 2:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][2];
+            for (k=0; k<18; ++k)
+            {
+                idx = mpc_decoder_huffman_decode_fast(d,  Table);
+                *L++ = idx50[idx];
+                *L++ = idx51[idx];
+            }
+            break;
+        case 3:
+        case 4:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
+            for (k=0; k<36; ++k)
+                *L++ = mpc_decoder_huffman_decode_faster(d, Table);
+            break;
+        case 5:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
+            for (k=0; k<36; ++k)
+                *L++ = mpc_decoder_huffman_decode_fast(d, Table);
+            break;
+        case 6:
+        case 7:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
+            for (k=0; k<36; ++k)
+                *L++ = mpc_decoder_huffman_decode(d, Table);
+            break;
+        case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17:
+            tmp = Dc[*ResL];
+            for (k=0; k<36; ++k)
+                *L++ = (mpc_int32_t)mpc_decoder_bitstream_read(d, Res_bit[*ResL]) - tmp;
+            break;
+        default:
+            return;
+        }
+        /************** rechts **************/
+        switch (*ResR)
+        {
+        case  -2: case  -3: case  -4: case  -5: case  -6: case  -7: case  -8: case  -9:
+        case -10: case -11: case -12: case -13: case -14: case -15: case -16: case -17:
+            R += 36;
+            break;
+        case -1:
+                for (k=0; k<36; k++ ) {
+                    tmp  = random_int(d);
+                    *R++ = ((tmp >> 24) & 0xFF) + ((tmp >> 16) & 0xFF) + ((tmp >>  8) & 0xFF) + ((tmp >>  0) & 0xFF) - 510;
+                }
+                break;
+            case 0:
+                R += 36;// increase pointer
+                break;
+            case 1:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][1];
+                for (k=0; k<12; ++k)
+                {
+                    idx = mpc_decoder_huffman_decode_fast(d, Table);
+                    *R++ = idx30[idx];
+                    *R++ = idx31[idx];
+                    *R++ = idx32[idx];
+                }
+                break;
+            case 2:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][2];
+                for (k=0; k<18; ++k)
+                {
+                    idx = mpc_decoder_huffman_decode_fast(d, Table);
+                    *R++ = idx50[idx];
+                    *R++ = idx51[idx];
+                }
+                break;
+            case 3:
+            case 4:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
+                for (k=0; k<36; ++k)
+                    *R++ = mpc_decoder_huffman_decode_faster(d, Table);
+                break;
+            case 5:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
+                for (k=0; k<36; ++k)
+                    *R++ = mpc_decoder_huffman_decode_fast(d, Table);
+                break;
+            case 6:
+            case 7:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
+                for (k=0; k<36; ++k)
+                    *R++ = mpc_decoder_huffman_decode(d, Table);
+                break;
+            case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17:
+                tmp = Dc[*ResR];
+                for (k=0; k<36; ++k)
+                    *R++ = (mpc_int32_t)mpc_decoder_bitstream_read(d, Res_bit[*ResR]) - tmp;
+                break;
+            default:
+                return;
+        }
+    }
+}
+
+void mpc_decoder_setup(mpc_decoder *d, mpc_reader *r)
+{
+  d->r = r;
+
+  d->HuffQ[0][0] = 0;
+  d->HuffQ[1][0] = 0;
+  d->HuffQ[0][1] = d->HuffQ1[0];
+  d->HuffQ[1][1] = d->HuffQ1[1];
+  d->HuffQ[0][2] = d->HuffQ2[0];
+  d->HuffQ[1][2] = d->HuffQ2[1];
+  d->HuffQ[0][3] = d->HuffQ3[0];
+  d->HuffQ[1][3] = d->HuffQ3[1];
+  d->HuffQ[0][4] = d->HuffQ4[0];
+  d->HuffQ[1][4] = d->HuffQ4[1];
+  d->HuffQ[0][5] = d->HuffQ5[0];
+  d->HuffQ[1][5] = d->HuffQ5[1];
+  d->HuffQ[0][6] = d->HuffQ6[0];
+  d->HuffQ[1][6] = d->HuffQ6[1];
+  d->HuffQ[0][7] = d->HuffQ7[0];
+  d->HuffQ[1][7] = d->HuffQ7[1];
+
+  d->SampleHuff[0] = NULL;
+  d->SampleHuff[1] = d->Entropie_1;
+  d->SampleHuff[2] = d->Entropie_2;
+  d->SampleHuff[3] = d->Entropie_3;
+  d->SampleHuff[4] = d->Entropie_4;
+  d->SampleHuff[5] = d->Entropie_5;
+  d->SampleHuff[6] = d->Entropie_6;
+  d->SampleHuff[7] = d->Entropie_7;
+  d->SampleHuff[8] = NULL;
+  d->SampleHuff[9] = NULL;
+  d->SampleHuff[10] = NULL;
+  d->SampleHuff[11] = NULL;
+  d->SampleHuff[12] = NULL;
+  d->SampleHuff[13] = NULL;
+  d->SampleHuff[14] = NULL;
+  d->SampleHuff[15] = NULL;
+  d->SampleHuff[16] = NULL;
+  d->SampleHuff[17] = NULL;
+
+  d->EQ_activated = 0;
+  d->MPCHeaderPos = 0;
+  d->StreamVersion = 0;
+  d->MS_used = 0;
+  d->FwdJumpInfo = 0;
+  d->ActDecodePos = 0;
+  d->FrameWasValid = 0;
+  d->OverallFrames = 0;
+  d->DecodedFrames = 0;
+  d->LastValidSamples = 0;
+  d->TrueGaplessPresent = 0;
+  d->WordsRead = 0;
+  d->Max_Band = 0;
+  d->SampleRate = 0;
+//  clips = 0;
+  d->__r1 = 1;
+  d->__r2 = 1;
+
+  d->dword = 0;
+  d->pos = 0;
+  d->Zaehler = 0;
+  d->WordsRead = 0;
+  d->Max_Band = 0;
+
+  mpc_decoder_initialisiere_quantisierungstabellen(d, 1.0f);
+  mpc_decoder_init_huffman_sv6(d);
+  mpc_decoder_init_huffman_sv7(d);
+}
+
+static void mpc_decoder_set_streaminfo(mpc_decoder *d, mpc_streaminfo *si)
+{
+    mpc_decoder_reset_synthesis(d);
+    mpc_decoder_reset_globals(d);
+
+    d->StreamVersion      = si->stream_version;
+    d->MS_used            = si->ms;
+    d->Max_Band           = si->max_band;
+    d->OverallFrames      = si->frames;
+    d->MPCHeaderPos       = si->header_position;
+    d->LastValidSamples   = si->last_frame_samples;
+    d->TrueGaplessPresent = si->is_true_gapless;
+    d->SampleRate         = (mpc_int32_t)si->sample_freq;
+
+    d->samples_to_skip = MPC_DECODER_SYNTH_DELAY;
+}
+
+BOOL mpc_decoder_initialize(mpc_decoder *d, mpc_streaminfo *si) 
+{
+    mpc_decoder_set_streaminfo(d, si);
+
+    // AB: setting position to the beginning of the data-bitstream
+    switch (d->StreamVersion) {
+    case 0x04: f_seek(d, 4 + d->MPCHeaderPos); d->pos = 16; break;  // Geht auch über eine der Helperfunktionen
+    case 0x05:
+    case 0x06: f_seek(d, 8 + d->MPCHeaderPos); d->pos =  0; break;
+    case 0x07:
+    case 0x17: /*f_seek ( 24 + d->MPCHeaderPos );*/ d->pos =  8; break;
+    default: return FALSE;
+    }
+
+    // AB: fill buffer and initialize decoder
+    f_read_dword(d, d->Speicher, MEMSIZE );
+    d->dword = d->Speicher[d->Zaehler = 0];
+
+    return TRUE;
+}
+
+//---------------------------------------------------------------
+// will seek from the beginning of the file to the desired
+// position in ms (given by seek_needed)
+//---------------------------------------------------------------
+#if 0
+static void
+helper1(mpc_decoder *d, mpc_uint32_t bitpos) 
+{
+    f_seek(d, (bitpos >> 5) * 4 + d->MPCHeaderPos);
+    f_read_dword(d, d->Speicher, 2);
+    d->dword = d->Speicher[d->Zaehler = 0];
+    d->pos = bitpos & 31;
+}
+#endif
+
+static void
+helper2(mpc_decoder *d, mpc_uint32_t bitpos) 
+{
+    f_seek(d, (bitpos>>5) * 4 + d->MPCHeaderPos);
+    f_read_dword(d, d->Speicher, MEMSIZE);
+    d->dword = d->Speicher[d->Zaehler = 0];
+    d->pos = bitpos & 31;
+}
+
+#if 0
+static void
+helper3(mpc_decoder *d, mpc_uint32_t bitpos, mpc_uint32_t* buffoffs) 
+{
+    d->pos = bitpos & 31;
+    bitpos >>= 5;
+    if ((mpc_uint32_t)(bitpos - *buffoffs) >= MEMSIZE - 2) {
+        *buffoffs = bitpos;
+        f_seek(d, bitpos * 4L + d->MPCHeaderPos);
+        f_read_dword(d, d->Speicher, MEMSIZE );
+    }
+    d->dword = d->Speicher[d->Zaehler = bitpos - *buffoffs ];
+}
+#endif
+
+static mpc_uint32_t get_initial_fpos(mpc_decoder *d, mpc_uint32_t StreamVersion)
+{
+    mpc_uint32_t fpos = 0;
+    switch ( d->StreamVersion ) {                                                  // setting position to the beginning of the data-bitstream
+    case  0x04: fpos =  48; break;
+    case  0x05:
+    case  0x06: fpos =  64; break;
+    case  0x07:
+    case  0x17: fpos = 200; break;
+    }
+    return fpos;
+}
+
+BOOL mpc_decoder_seek_seconds(mpc_decoder *d, double seconds) 
+{
+    return mpc_decoder_seek_sample(d, (mpc_int64_t)(seconds * (double)d->SampleRate + 0.5));
+}
+
+BOOL mpc_decoder_seek_sample(mpc_decoder *d, mpc_int64_t destsample) 
+{
+    mpc_uint32_t fpos;
+    mpc_uint32_t fwd;
+
+    fwd = (mpc_uint32_t) (destsample / MPC_FRAME_LENGTH);
+    d->samples_to_skip = MPC_DECODER_SYNTH_DELAY + (mpc_uint32_t)(destsample % MPC_FRAME_LENGTH);
+
+    memset(d->Y_L          , 0, sizeof d->Y_L           );
+    memset(d->Y_R          , 0, sizeof d->Y_R           );
+    memset(d->SCF_Index_L     , 0, sizeof d->SCF_Index_L      );
+    memset(d->SCF_Index_R     , 0, sizeof d->SCF_Index_R      );
+    memset(d->Res_L           , 0, sizeof d->Res_L            );
+    memset(d->Res_R           , 0, sizeof d->Res_R            );
+    memset(d->SCFI_L          , 0, sizeof d->SCFI_L           );
+    memset(d->SCFI_R          , 0, sizeof d->SCFI_R           );
+    memset(d->DSCF_Flag_L     , 0, sizeof d->DSCF_Flag_L      );
+    memset(d->DSCF_Flag_R     , 0, sizeof d->DSCF_Flag_R      );
+    memset(d->DSCF_Reference_L, 0, sizeof d->DSCF_Reference_L );
+    memset(d->DSCF_Reference_R, 0, sizeof d->DSCF_Reference_R );
+    memset(d->Q               , 0, sizeof d->Q                );
+    memset(d->MS_Flag         , 0, sizeof d->MS_Flag          );
+
+    // resetting synthesis filter to avoid "clicks"
+    mpc_decoder_reset_synthesis(d);
+
+    // prevent from desired position out of allowed range
+    fwd = fwd < d->OverallFrames  ?  fwd  :  d->OverallFrames;
+
+    // reset number of decoded frames
+    d->DecodedFrames = 0;
+
+    fpos = get_initial_fpos(d, d->StreamVersion);
+    if (fpos == 0) {
+        return FALSE;
+    }
+
+    helper2(d, fpos);
+
+    // read the last 32 frames before the desired position to scan the scalefactors (artifactless jumping)
+    for ( ; d->DecodedFrames < fwd; d->DecodedFrames++ ) {
+        mpc_uint32_t   FrameBitCnt;
+        mpc_uint32_t   RING;
+        RING         = d->Zaehler;
+        d->FwdJumpInfo  = mpc_decoder_bitstream_read(d, 20);    // read jump-info
+        d->ActDecodePos = (d->Zaehler << 5) + d->pos;
+        FrameBitCnt  = mpc_decoder_bits_read(d);  // scanning the scalefactors and check for validity of frame
+        if (d->StreamVersion >= 7)  {
+            mpc_decoder_read_bitstream_sv7(d);
+        }
+        else {
+            mpc_decoder_read_bitstream_sv6(d);
+        }
+        if (mpc_decoder_bits_read(d) - FrameBitCnt != d->FwdJumpInfo ) {
+            // Box ("Bug in perform_jump");
+            return FALSE;
+        }
+        // update buffer
+        if ((RING ^ d->Zaehler) & MEMSIZE2) {
+            f_read_dword(d, d->Speicher + (RING & MEMSIZE2),  MEMSIZE2);
+        }
+    }
+
+    // LastBitsRead = BitsRead ();
+    // LastFrame = d->DecodedFrames;
+
+    return TRUE;
+}
+
+void mpc_decoder_update_buffer(mpc_decoder *d, mpc_uint32_t RING) 
+{
+    if ((RING ^ d->Zaehler) & MEMSIZE2 ) {
+        // update buffer
+        f_read_dword(d, d->Speicher + (RING & MEMSIZE2), MEMSIZE2);
+    }
+}
+
+
Index: /libmpcdec/tags/release-1.1/src/mpc_reader.c
===================================================================
--- /libmpcdec/tags/release-1.1/src/mpc_reader.c	(revision 30)
+++ /libmpcdec/tags/release-1.1/src/mpc_reader.c	(revision 30)
@@ -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.
+*/
+
+/// \file mpc_reader.c
+/// Contains implementations for simple file-based mpc_reader
+
+#include "musepack/musepack.h"
+
+/// mpc_reader callback implementations
+static mpc_int32_t
+read_impl(void *data, void *ptr, mpc_int32_t size)
+{
+    mpc_reader *d = (mpc_reader *) data;
+
+    return fread(ptr, 1, size, d->file);
+}
+
+static BOOL
+seek_impl(void *data, int offset)
+{
+    mpc_reader *d = (mpc_reader *) data;
+
+    return d->is_seekable ? !fseek(d->file, offset, SEEK_SET) : FALSE;
+}
+
+static mpc_int32_t
+tell_impl(void *data)
+{
+    mpc_reader *d = (mpc_reader *) data;
+
+    return ftell(d->file);
+}
+
+static mpc_int32_t
+get_size_impl(void *data)
+{
+    mpc_reader *d = (mpc_reader *) data;
+
+    return d->file_size;
+}
+
+static BOOL
+canseek_impl(void *data)
+{
+    mpc_reader *d = (mpc_reader *) data;
+
+    return d->is_seekable;
+}
+
+void
+mpc_reader_setup_file_reader(mpc_reader *reader, FILE *input)
+{
+    reader->seek = seek_impl;
+    reader->read = read_impl;
+    reader->tell = tell_impl;
+    reader->get_size = get_size_impl;
+    reader->canseek = canseek_impl;
+    reader->data = reader; // point back to ourselves
+
+    reader->file = input;
+    reader->is_seekable = TRUE;
+    fseek(reader->file, 0, SEEK_END);
+    reader->file_size = ftell(reader->file);
+    fseek(reader->file, 0, SEEK_SET);
+}
Index: /libmpcdec/tags/release-1.1/src/requant.c
===================================================================
--- /libmpcdec/tags/release-1.1/src/requant.c	(revision 30)
+++ /libmpcdec/tags/release-1.1/src/requant.c	(revision 30)
@@ -0,0 +1,152 @@
+/*
+  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.c
+/// Requantization function implementations.
+/// \todo document me
+
+#include "musepack/musepack.h"
+#include "musepack/internal.h"
+
+/* C O N S T A N T S */
+// bits per sample for chosen quantizer
+const mpc_uint32_t  Res_bit [18] = {
+    0,  0,  0,  0,  0,  0,  0,  0,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16
+};
+
+// coefficients for requantization
+// 65536/step bzw. 65536/(2*D+1)
+
+#define _(X) MAKE_MPC_SAMPLE_EX(X,14)
+
+const MPC_SAMPLE_FORMAT  __Cc [1 + 18] = {
+      _(111.285962475327f),                                        // 32768/2/255*sqrt(3)
+    _(65536.000000000000f), _(21845.333333333332f), _(13107.200000000001f), _(9362.285714285713f),
+    _(7281.777777777777f),  _(4369.066666666666f),  _(2114.064516129032f), _(1040.253968253968f),
+     _(516.031496062992f),  _(257.003921568627f),   _(128.250489236790f),   _(64.062561094819f),
+       _(32.015632633121f),    _(16.003907203907f),     _(8.000976681723f),    _(4.000244155527f),
+        _(2.000061037018f),     _(1.000015259021f)
+};
+
+#undef _
+
+// offset for requantization
+// 2*D+1 = steps of quantizer
+const mpc_int32_t  __Dc [1 + 18] = {
+      2,
+      0,     1,     2,     3,     4,     7,    15,    31,    63,
+    127,   255,   511,  1023,  2047,  4095,  8191, 16383, 32767
+};
+
+#ifdef MPC_FIXED_POINT
+static mpc_uint32_t find_shift(double fval)
+{
+	mpc_int64_t val = (mpc_int64_t)fval;
+	if (val<0) val = -val;
+	mpc_uint32_t ptr = 0;
+	while(val) {val>>=1;ptr++;}
+
+	return ptr > 31 ? 0 : 31 - ptr;
+}
+#endif
+
+/* F U N C T I O N S */
+
+#define SET_SCF(N,X) d->SCF[N] = MAKE_MPC_SAMPLE_EX(X,SCF_shift[N] = (unsigned char)find_shift(X));
+
+void
+mpc_decoder_scale_output(mpc_decoder *d, double factor) 
+{
+    mpc_int32_t     n;
+    double  f1;
+    double  f2;
+#ifndef MPC_FIXED_POINT
+	factor *= 1.0 / (double)(1<<(MPC_FIXED_POINT_SHIFT-1));
+#else
+	factor *= 1.0 / (double)(1<<(16 - MPC_FIXED_POINT_SHIFT));
+#endif
+    f1 = f2 = factor;
+
+    // handles +1.58...-98.41 dB, where's scf[n] / scf[n-1] = 1.20050805774840750476
+	
+	SET_SCF(1,factor);
+
+	f1 *=   0.83298066476582673961;
+	f2 *= 1/0.83298066476582673961;
+
+    for ( n = 1; n <= 128; n++ ) {
+		SET_SCF((unsigned char)(1+n),f1);
+		SET_SCF((unsigned char)(1-n),f2);
+        f1 *=   0.83298066476582673961;
+        f2 *= 1/0.83298066476582673961;
+    }
+}
+
+static void
+mpc_decoder_quantisierungsmodes(mpc_decoder *d) // conversion: index -> quantizer (bitstream reading)
+{                                               // conversion: quantizer -> index (bitstream writing)
+    mpc_int32_t  Band = 0;
+    mpc_int32_t  i;
+
+    do {
+        d->Q_bit [Band] = 4;
+        for ( i = 0; i < 16-1; i++ )
+            d->Q_res [Band] [i] = i;
+        d->Q_res [Band][i] = 17;
+        Band++;
+    } while ( Band < 11 );
+
+    do {
+        d->Q_bit [Band] = 3;
+        for ( i = 0; i < 8-1; i++ )
+            d->Q_res [Band] [i] = i;
+        d->Q_res [Band] [i] = 17;
+        Band++;
+    } while ( Band < 23 );
+
+    do {
+        d->Q_bit [Band] = 2;
+        for ( i = 0; i < 4-1; i++ )
+            d->Q_res [Band] [i] = i;
+        d->Q_res [Band] [i] = 17;
+        Band++;
+    } while ( Band < 32 );
+}
+
+void
+mpc_decoder_initialisiere_quantisierungstabellen(mpc_decoder *d, double scale_factor) 
+{
+    mpc_decoder_quantisierungsmodes(d);
+    mpc_decoder_scale_output(d, scale_factor);
+}
Index: /libmpcdec/tags/release-1.1/src/sample.cpp
===================================================================
--- /libmpcdec/tags/release-1.1/src/sample.cpp	(revision 30)
+++ /libmpcdec/tags/release-1.1/src/sample.cpp	(revision 30)
@@ -0,0 +1,328 @@
+/*
+  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.
+*/
+
+#include <stdio.h>
+#include <assert.h>
+#include <time.h>
+
+#include "musepack/musepack.h"
+
+/*
+  The data bundle we pass around with our reader to store file
+  position and size etc. 
+*/
+typedef struct reader_data_t {
+    FILE *file;
+    long size;
+    BOOL seekable;
+} reader_data;
+
+/*
+  Our implementations of the mpc_reader callback functions.
+*/
+mpc_int32_t
+read_impl(void *data, void *ptr, mpc_int32_t size)
+{
+    reader_data *d = (reader_data *) data;
+    return fread(ptr, 1, size, d->file);
+}
+
+BOOL
+seek_impl(void *data, mpc_int32_t offset)
+{
+    reader_data *d = (reader_data *) data;
+    return d->seekable ? !fseek(d->file, offset, SEEK_SET) : false;
+}
+
+mpc_int32_t
+tell_impl(void *data)
+{
+    reader_data *d = (reader_data *) data;
+    return ftell(d->file);
+}
+
+mpc_int32_t
+get_size_impl(void *data)
+{
+    reader_data *d = (reader_data *) data;
+    return d->size;
+}
+
+BOOL
+canseek_impl(void *data)
+{
+    reader_data *d = (reader_data *) data;
+    return d->seekable;
+}
+
+#define WFX_SIZE (2+2+4+4+2+2)
+
+#ifdef MPC_FIXED_POINT
+static int
+shift_signed(MPC_SAMPLE_FORMAT val, int shift)
+{
+    if (shift > 0)
+        val <<= shift;
+    else if (shift < 0)
+        val >>= -shift;
+    return (int)val;
+}
+#endif
+
+class WavWriter {
+  public:
+    WavWriter(FILE * p_output, unsigned p_nch, unsigned p_bps,
+              unsigned p_srate)
+    : m_file(p_output), m_nch(p_nch), m_bps(p_bps), m_srate(p_srate) {
+        assert(m_bps == 16 || m_bps == 24);
+
+        WriteRaw("RIFF", 4);
+        WriteDword(0);          //fix this in destructor
+
+        WriteRaw("WAVE", 4);
+        WriteRaw("fmt ", 4);
+        WriteDword(WFX_SIZE);
+
+        WriteWord(1);           //WAVE_FORMAT_PCM
+        WriteWord(m_nch);
+        WriteDword(m_srate);
+        WriteDword(m_srate * m_nch * (m_bps >> 3));
+        WriteWord(m_nch * (m_bps >> 3));
+        WriteWord(m_bps);
+        /*
+           WORD  wFormatTag; 
+           WORD  nChannels; 
+           DWORD nSamplesPerSec; 
+           DWORD nAvgBytesPerSec; 
+           WORD  nBlockAlign; 
+           WORD  wBitsPerSample; 
+         */
+        WriteRaw("data", 4);
+        WriteDword(0);          //fix this in destructor
+
+        m_data_bytes_written = 0;
+    } BOOL WriteSamples(const MPC_SAMPLE_FORMAT * p_buffer, unsigned p_size) {
+        unsigned n;
+        int clip_min = -1 << (m_bps - 1),
+            clip_max = (1 << (m_bps - 1)) - 1, float_scale = 1 << (m_bps - 1);
+        for (n = 0; n < p_size; n++) {
+            int val;
+#ifdef MPC_FIXED_POINT
+            val =
+                shift_signed(p_buffer[n],
+                             m_bps - MPC_FIXED_POINT_SCALE_SHIFT);
+#else
+            val = (int)(p_buffer[n] * float_scale);
+#endif
+            if (val < clip_min)
+                val = clip_min;
+            else if (val > clip_max)
+                val = clip_max;
+            if (!WriteInt(val, m_bps))
+                return false;
+        }
+        m_data_bytes_written += p_size * (m_bps >> 3);
+        return true;
+    }
+
+    ~WavWriter() {
+        if (m_data_bytes_written & 1) {
+            char blah = 0;
+            WriteRaw(&blah, 1);
+            m_data_bytes_written++;
+        }
+        Seek(4);
+        WriteDword((unsigned long)(m_data_bytes_written + 4 + 8 + WFX_SIZE +
+                                   8));
+        Seek(8 + 4 + 8 + WFX_SIZE + 4);
+        WriteDword(m_data_bytes_written);
+    }
+
+  private:
+
+    BOOL Seek(unsigned p_offset) {
+        return !fseek(m_file, p_offset, SEEK_SET);
+    }
+
+    BOOL WriteRaw(const void *p_buffer, unsigned p_bytes) {
+        return fwrite(p_buffer, 1, p_bytes, m_file) == p_bytes;
+    }
+
+    BOOL WriteDword(unsigned long p_val) {
+        return WriteInt(p_val, 32);
+    }
+    BOOL WriteWord(unsigned short p_val) {
+        return WriteInt(p_val, 16);
+    }
+
+    // write a little-endian number properly
+    BOOL WriteInt(unsigned int p_val, unsigned p_width_bits) {
+        unsigned char temp;
+        unsigned shift = 0;
+        assert((p_width_bits % 8) == 0);
+        do {
+            temp = (unsigned char)((p_val >> shift) & 0xFF);
+            if (!WriteRaw(&temp, 1))
+                return false;
+            shift += 8;
+        } while (shift < p_width_bits);
+        return true;
+    }
+
+    unsigned m_nch, m_bps, m_srate;
+    FILE *m_file;
+    unsigned m_data_bytes_written;
+};
+
+
+static void
+usage(const char *exename)
+{
+    printf
+        ("Usage: %s <infile.mpc> [<outfile.wav>]\nIf <outfile.wav> is not specified, decoder will run in benchmark mode.\n",
+         exename);
+}
+
+int
+main(int argc, char **argv)
+{
+    if (argc != 2 && argc != 3) {
+        if (argc > 0)
+            usage(argv[0]);
+        return 0;
+    }
+
+    FILE *input = fopen(argv[1], "rb");
+    FILE *output = 0;
+    if (input == 0) {
+        usage(argv[0]);
+        printf("Error opening input file: \"%s\"\n", argv[1]);
+        return 1;
+    }
+
+    if (argc == 3) {
+        output = fopen(argv[2], "wb");
+        if (output == 0) {
+            fclose(input);
+            usage(argv[0]);
+            printf("Error opening output file: \"%s\"\n", argv[2]);
+            return 1;
+        }
+    }
+
+    /* initialize our reader_data tag the reader will carry around with it */
+    reader_data data;
+    data.file = input;
+    data.seekable = true;
+    fseek(data.file, 0, SEEK_END);
+    data.size = ftell(data.file);
+    fseek(data.file, 0, SEEK_SET);
+
+    /* set up an mpc_reader linked to our function implementations */
+    mpc_decoder decoder;
+    mpc_reader reader;
+    reader.read = read_impl;
+    reader.seek = seek_impl;
+    reader.tell = tell_impl;
+    reader.get_size = get_size_impl;
+    reader.canseek = canseek_impl;
+    reader.data = &data;
+
+    /* read file's streaminfo data */
+    mpc_streaminfo info;
+    mpc_streaminfo_init(&info);
+    if (mpc_streaminfo_read(&info, &reader) != ERROR_CODE_OK) {
+        printf("Not a valid musepack file: \"%s\"\n", argv[1]);
+        return 1;
+    }
+
+    /* instantiate a decoder with our file reader */
+    mpc_decoder_setup(&decoder, &reader);
+    if (!mpc_decoder_initialize(&decoder, &info)) {
+        printf("Error initializing decoder.\n", argv[1]);
+        return 1;
+    }
+
+    /* decode the file */
+    printf("Decoding from:\n%s\nTo:\n%s\n", argv[1],
+           output ? argv[2] : "N/A");
+    WavWriter *wavwriter =
+        output ? new WavWriter(output, 2, 16, info.sample_freq) : 0;
+    MPC_SAMPLE_FORMAT sample_buffer[MPC_DECODER_BUFFER_LENGTH];
+    clock_t begin, end;
+    begin = clock();
+    unsigned total_samples = 0;
+    BOOL successful = FALSE;
+    for (;;) {
+        unsigned status = mpc_decoder_decode(&decoder, sample_buffer, 0, 0);
+        if (status == (unsigned)(-1)) {
+            //decode error
+            printf("Error decoding file.\n");
+            break;
+        }
+        else if (status == 0)   //EOF
+        {
+            successful = true;
+            break;
+        }
+        else                    //status>0
+        {
+            total_samples += status;
+            if (wavwriter) {
+                if (!wavwriter->
+                    WriteSamples(sample_buffer, status * /* stereo */ 2)) {
+                    printf("Write error.\n");
+                    break;
+                }
+            }
+        }
+    }
+
+    end = clock();
+
+    if (wavwriter) {
+        delete wavwriter;
+    }
+
+    if (successful) {
+        printf("\nFinished.\nTotal samples decoded: %u.\n", total_samples);
+        unsigned ms = (end - begin) * 1000 / CLOCKS_PER_SEC;
+        unsigned ratio =
+            (unsigned)((double)total_samples / (double)info.sample_freq /
+                       ((double)ms / 1000.0) * 100.0);
+        printf("Time: %u ms (%u.%02ux).\n", ms, ratio / 100, ratio % 100);
+    }
+
+    return 0;
+}
Index: /libmpcdec/tags/release-1.1/src/streaminfo.c
===================================================================
--- /libmpcdec/tags/release-1.1/src/streaminfo.c	(revision 30)
+++ /libmpcdec/tags/release-1.1/src/streaminfo.c	(revision 30)
@@ -0,0 +1,280 @@
+/*
+  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 streaminfo.c
+/// Implementation of streaminfo reading functions.
+
+#include "musepack/musepack.h"
+#include "musepack/internal.h"
+
+static const char *
+Stringify(mpc_uint32_t profile) // profile is 0...15, where 7...13 is used
+{
+    static const char na[] = "n.a.";
+    static const char *Names[] = {
+        na, "'Unstable/Experimental'", na, na,
+        na, "'quality 0'", "'quality 1'", "'Telephone'",
+        "'Thumb'", "'Radio'", "'Standard'", "'Xtreme'",
+        "'Insane'", "'BrainDead'", "'quality 9'", "'quality 10'"
+    };
+
+    return profile >= sizeof(Names) / sizeof(*Names) ? na : Names[profile];
+}
+
+void
+mpc_streaminfo_init(mpc_streaminfo * si)
+{
+    memset(si, 0, sizeof(mpc_streaminfo));
+}
+
+// read information from SV8 header
+// not yet implemented
+static mpc_int32_t
+streaminfo_read_header_sv8(mpc_streaminfo * si, mpc_reader * fp)
+{
+    return 0;
+}
+
+/// Reads streaminfo from SV7 header. 
+static mpc_int32_t
+streaminfo_read_header_sv7(mpc_streaminfo * si, mpc_uint32_t HeaderData[8])
+{
+    const mpc_int32_t samplefreqs[4] = { 44100, 48000, 37800, 32000 };
+
+    //mpc_uint32_t    HeaderData [8];
+    mpc_uint16_t Estimatedpeak_title = 0;
+
+    if (si->stream_version > 0x71) {
+        //        Update (si->stream_version);
+        return 0;
+    }
+
+    /*
+       if ( !fp->seek ( si->header_position ) )         // seek to header start
+       return ERROR_CODE_FILE;
+       if ( fp->read ( HeaderData, sizeof HeaderData) != sizeof HeaderData )
+       return ERROR_CODE_FILE;
+     */
+
+    si->bitrate = 0;
+    si->frames = HeaderData[1];
+    si->is = 0;
+    si->ms = (HeaderData[2] >> 30) & 0x0001;
+    si->max_band = (HeaderData[2] >> 24) & 0x003F;
+    si->block_size = 1;
+    si->profile = (HeaderData[2] << 8) >> 28;
+    si->profile_name = Stringify(si->profile);
+    si->sample_freq = samplefreqs[(HeaderData[2] >> 16) & 0x0003];
+    Estimatedpeak_title = (mpc_uint16_t) (HeaderData[2] & 0xFFFF);   // read the ReplayGain data
+    si->gain_title = (mpc_uint16_t) ((HeaderData[3] >> 16) & 0xFFFF);
+    si->peak_title = (mpc_uint16_t) (HeaderData[3] & 0xFFFF);
+    si->gain_album = (mpc_uint16_t) ((HeaderData[4] >> 16) & 0xFFFF);
+    si->peak_album = (mpc_uint16_t) (HeaderData[4] & 0xFFFF);
+    si->is_true_gapless = (HeaderData[5] >> 31) & 0x0001; // true gapless: used?
+    si->last_frame_samples = (HeaderData[5] >> 20) & 0x07FF;  // true gapless: valid samples for last frame
+    si->encoder_version = (HeaderData[6] >> 24) & 0x00FF;
+
+    if (si->encoder_version == 0) {
+        sprintf(si->encoder, "Buschmann 1.7.0...9, Klemm 0.90...1.05");
+    }
+    else {
+        switch (si->encoder_version % 10) {
+        case 0:
+            sprintf(si->encoder, "Release %u.%u", si->encoder_version / 100,
+                    si->encoder_version / 10 % 10);
+            break;
+        case 2:
+        case 4:
+        case 6:
+        case 8:
+            sprintf(si->encoder, "Beta %u.%02u", si->encoder_version / 100,
+                    si->encoder_version % 100);
+            break;
+        default:
+            sprintf(si->encoder, "--Alpha-- %u.%02u",
+                    si->encoder_version / 100, si->encoder_version % 100);
+            break;
+        }
+    }
+
+    //    if ( si->peak_title == 0 )                                      // there is no correct peak_title contained within header
+    //        si->peak_title = (mpc_uint16_t)(Estimatedpeak_title * 1.18);
+    //    if ( si->peak_album == 0 )
+    //        si->peak_album = si->peak_title;                          // no correct peak_album, use peak_title
+
+    //si->sample_freq    = 44100;                                     // AB: used by all files up to SV7
+    si->channels = 2;
+
+    return ERROR_CODE_OK;
+}
+
+// read information from SV4-SV6 header
+static mpc_int32_t
+streaminfo_read_header_sv6(mpc_streaminfo * si, mpc_uint32_t HeaderData[8])
+{
+    //mpc_uint32_t    HeaderData [8];
+
+    /*
+       if ( !fp->seek (  si->header_position ) )         // seek to header start
+       return ERROR_CODE_FILE;
+       if ( fp->read ( HeaderData, sizeof HeaderData ) != sizeof HeaderData )
+       return ERROR_CODE_FILE;
+     */
+
+    si->bitrate = (HeaderData[0] >> 23) & 0x01FF;   // read the file-header (SV6 and below)
+    si->is = (HeaderData[0] >> 22) & 0x0001;
+    si->ms = (HeaderData[0] >> 21) & 0x0001;
+    si->stream_version = (HeaderData[0] >> 11) & 0x03FF;
+    si->max_band = (HeaderData[0] >> 6) & 0x001F;
+    si->block_size = (HeaderData[0]) & 0x003F;
+    si->profile = 0;
+    si->profile_name = Stringify((mpc_uint32_t) (-1));
+    if (si->stream_version >= 5)
+        si->frames = HeaderData[1]; // 32 bit
+    else
+        si->frames = (HeaderData[1] >> 16); // 16 bit
+
+    si->gain_title = 0;          // not supported
+    si->peak_title = 0;
+    si->gain_album = 0;
+    si->peak_album = 0;
+
+    si->last_frame_samples = 0;
+    si->is_true_gapless = 0;
+
+    si->encoder_version = 0;
+    si->encoder[0] = '\0';
+
+    if (si->stream_version == 7)
+        return ERROR_CODE_SV7BETA;  // are there any unsupported parameters used?
+    if (si->bitrate != 0)
+        return ERROR_CODE_CBR;
+    if (si->is != 0)
+        return ERROR_CODE_IS;
+    if (si->block_size != 1)
+        return ERROR_CODE_BLOCKSIZE;
+
+    if (si->stream_version < 6) // Bugfix: last frame was invalid for up to SV5
+        si->frames -= 1;
+
+    si->sample_freq = 44100;     // AB: used by all files up to SV7
+    si->channels = 2;
+
+    if (si->stream_version < 4 || si->stream_version > 7)
+        return ERROR_CODE_INVALIDSV;
+
+    return ERROR_CODE_OK;
+}
+
+// reads file header and tags
+mpc_int32_t
+mpc_streaminfo_read(mpc_streaminfo * si, mpc_reader * r)
+{
+    mpc_uint32_t HeaderData[8];
+    mpc_int32_t Error = 0;
+
+    // get header position
+    if ((si->header_position = JumpID3v2(r)) < 0) {
+        return ERROR_CODE_FILE;
+    }
+    // seek to first byte of mpc data
+    if (!r->seek(r->data, si->header_position)) {
+        return ERROR_CODE_FILE;
+    }
+    if (r->read(r->data, HeaderData, 8 * 4) != 8 * 4) {
+        return ERROR_CODE_FILE;
+    }
+    if (!r->seek(r->data, si->header_position + 6 * 4)) {
+        return ERROR_CODE_FILE;
+    }
+
+    si->total_file_length = r->get_size(r->data);
+    si->tag_offset = si->total_file_length;
+    if (memcmp(HeaderData, "MP+", 3) == 0) {
+#ifndef MPC_LITTLE_ENDIAN
+        mpc_uint32_t ptr;
+        for (ptr = 0; ptr < 8; ptr++) {
+            HeaderData[ptr] = swap32(HeaderData[ptr]);
+        }
+#endif
+        si->stream_version = HeaderData[0] >> 24;
+
+        // stream version 8
+        if ((si->stream_version & 15) >= 8) {
+            Error = streaminfo_read_header_sv8(si, r);
+        }
+        // stream version 7
+        else if ((si->stream_version & 15) == 7) {
+            Error = streaminfo_read_header_sv7(si, HeaderData);
+        }
+    }
+    else {
+        // stream version 4-6
+        Error = streaminfo_read_header_sv6(si, HeaderData);
+    }
+
+    // estimation, exact value needs too much time
+    si->pcm_samples = 1152 * si->frames - 576;
+
+    if (si->pcm_samples > 0) {
+        si->average_bitrate =
+            (si->tag_offset -
+             si->header_position) * 8.0 * si->sample_freq / si->pcm_samples;
+    }
+    else {
+        si->average_bitrate = 0;
+    }
+
+    return Error;
+}
+
+double
+mpc_streaminfo_get_length(mpc_streaminfo * si)
+{
+    return (double)mpc_streaminfo_get_length_samples(si) /
+        (double)si->sample_freq;
+}
+
+mpc_int64_t
+mpc_streaminfo_get_length_samples(mpc_streaminfo * si)
+{
+    mpc_int64_t samples = (mpc_int64_t) si->frames * MPC_FRAME_LENGTH;
+    if (si->is_true_gapless) {
+        samples -= (MPC_FRAME_LENGTH - si->last_frame_samples);
+    }
+    else {
+        samples -= MPC_DECODER_SYNTH_DELAY;
+    }
+    return samples;
+}
Index: /libmpcdec/tags/release-1.1/src/synth_filter.c
===================================================================
--- /libmpcdec/tags/release-1.1/src/synth_filter.c	(revision 30)
+++ /libmpcdec/tags/release-1.1/src/synth_filter.c	(revision 30)
@@ -0,0 +1,442 @@
+/*
+  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 synth_filter.c
+/// Synthesis functions.
+/// \todo document me
+
+#include "musepack/musepack.h"
+#include "musepack/internal.h"
+
+typedef mpc_int32_t ptrdiff_t;
+
+/* C O N S T A N T S */
+#undef _
+
+#define MPC_FIXED_POINT_SYNTH_FIX 2
+
+#ifdef MPC_FIXED_POINT
+#define _(value)  MPC_MAKE_FRACT_CONST((double)value/(double)(0x40000))
+#else
+#define _(value)  MAKE_MPC_SAMPLE((double)value/(double)(0x10000))
+#endif
+
+
+static const MPC_SAMPLE_FORMAT  Di_opt [32] [16] = {
+    { _(  0), _( -29), _( 213), _( -459), _( 2037), _(-5153), _(  6574), _(-37489), _(75038), _(37489), _(6574), _( 5153), _(2037), _( 459), _(213), _(29) },
+    { _( -1), _( -31), _( 218), _( -519), _( 2000), _(-5517), _(  5959), _(-39336), _(74992), _(35640), _(7134), _( 4788), _(2063), _( 401), _(208), _(26) },
+    { _( -1), _( -35), _( 222), _( -581), _( 1952), _(-5879), _(  5288), _(-41176), _(74856), _(33791), _(7640), _( 4425), _(2080), _( 347), _(202), _(24) },
+    { _( -1), _( -38), _( 225), _( -645), _( 1893), _(-6237), _(  4561), _(-43006), _(74630), _(31947), _(8092), _( 4063), _(2087), _( 294), _(196), _(21) },
+    { _( -1), _( -41), _( 227), _( -711), _( 1822), _(-6589), _(  3776), _(-44821), _(74313), _(30112), _(8492), _( 3705), _(2085), _( 244), _(190), _(19) },
+    { _( -1), _( -45), _( 228), _( -779), _( 1739), _(-6935), _(  2935), _(-46617), _(73908), _(28289), _(8840), _( 3351), _(2075), _( 197), _(183), _(17) },
+    { _( -1), _( -49), _( 228), _( -848), _( 1644), _(-7271), _(  2037), _(-48390), _(73415), _(26482), _(9139), _( 3004), _(2057), _( 153), _(176), _(16) },
+    { _( -2), _( -53), _( 227), _( -919), _( 1535), _(-7597), _(  1082), _(-50137), _(72835), _(24694), _(9389), _( 2663), _(2032), _( 111), _(169), _(14) },
+    { _( -2), _( -58), _( 224), _( -991), _( 1414), _(-7910), _(    70), _(-51853), _(72169), _(22929), _(9592), _( 2330), _(2001), _(  72), _(161), _(13) },
+    { _( -2), _( -63), _( 221), _(-1064), _( 1280), _(-8209), _(  -998), _(-53534), _(71420), _(21189), _(9750), _( 2006), _(1962), _(  36), _(154), _(11) },
+    { _( -2), _( -68), _( 215), _(-1137), _( 1131), _(-8491), _( -2122), _(-55178), _(70590), _(19478), _(9863), _( 1692), _(1919), _(   2), _(147), _(10) },
+    { _( -3), _( -73), _( 208), _(-1210), _(  970), _(-8755), _( -3300), _(-56778), _(69679), _(17799), _(9935), _( 1388), _(1870), _( -29), _(139), _( 9) },
+    { _( -3), _( -79), _( 200), _(-1283), _(  794), _(-8998), _( -4533), _(-58333), _(68692), _(16155), _(9966), _( 1095), _(1817), _( -57), _(132), _( 8) },
+    { _( -4), _( -85), _( 189), _(-1356), _(  605), _(-9219), _( -5818), _(-59838), _(67629), _(14548), _(9959), _(  814), _(1759), _( -83), _(125), _( 7) },
+    { _( -4), _( -91), _( 177), _(-1428), _(  402), _(-9416), _( -7154), _(-61289), _(66494), _(12980), _(9916), _(  545), _(1698), _(-106), _(117), _( 7) },
+    { _( -5), _( -97), _( 163), _(-1498), _(  185), _(-9585), _( -8540), _(-62684), _(65290), _(11455), _(9838), _(  288), _(1634), _(-127), _(111), _( 6) },
+    { _( -5), _(-104), _( 146), _(-1567), _(  -45), _(-9727), _( -9975), _(-64019), _(64019), _( 9975), _(9727), _(   45), _(1567), _(-146), _(104), _( 5) },
+    { _( -6), _(-111), _( 127), _(-1634), _( -288), _(-9838), _(-11455), _(-65290), _(62684), _( 8540), _(9585), _( -185), _(1498), _(-163), _( 97), _( 5) },
+    { _( -7), _(-117), _( 106), _(-1698), _( -545), _(-9916), _(-12980), _(-66494), _(61289), _( 7154), _(9416), _( -402), _(1428), _(-177), _( 91), _( 4) },
+    { _( -7), _(-125), _(  83), _(-1759), _( -814), _(-9959), _(-14548), _(-67629), _(59838), _( 5818), _(9219), _( -605), _(1356), _(-189), _( 85), _( 4) },
+    { _( -8), _(-132), _(  57), _(-1817), _(-1095), _(-9966), _(-16155), _(-68692), _(58333), _( 4533), _(8998), _( -794), _(1283), _(-200), _( 79), _( 3) },
+    { _( -9), _(-139), _(  29), _(-1870), _(-1388), _(-9935), _(-17799), _(-69679), _(56778), _( 3300), _(8755), _( -970), _(1210), _(-208), _( 73), _( 3) },
+    { _(-10), _(-147), _(  -2), _(-1919), _(-1692), _(-9863), _(-19478), _(-70590), _(55178), _( 2122), _(8491), _(-1131), _(1137), _(-215), _( 68), _( 2) },
+    { _(-11), _(-154), _( -36), _(-1962), _(-2006), _(-9750), _(-21189), _(-71420), _(53534), _(  998), _(8209), _(-1280), _(1064), _(-221), _( 63), _( 2) },
+    { _(-13), _(-161), _( -72), _(-2001), _(-2330), _(-9592), _(-22929), _(-72169), _(51853), _(  -70), _(7910), _(-1414), _( 991), _(-224), _( 58), _( 2) },
+    { _(-14), _(-169), _(-111), _(-2032), _(-2663), _(-9389), _(-24694), _(-72835), _(50137), _(-1082), _(7597), _(-1535), _( 919), _(-227), _( 53), _( 2) },
+    { _(-16), _(-176), _(-153), _(-2057), _(-3004), _(-9139), _(-26482), _(-73415), _(48390), _(-2037), _(7271), _(-1644), _( 848), _(-228), _( 49), _( 1) },
+    { _(-17), _(-183), _(-197), _(-2075), _(-3351), _(-8840), _(-28289), _(-73908), _(46617), _(-2935), _(6935), _(-1739), _( 779), _(-228), _( 45), _( 1) },
+    { _(-19), _(-190), _(-244), _(-2085), _(-3705), _(-8492), _(-30112), _(-74313), _(44821), _(-3776), _(6589), _(-1822), _( 711), _(-227), _( 41), _( 1) },
+    { _(-21), _(-196), _(-294), _(-2087), _(-4063), _(-8092), _(-31947), _(-74630), _(43006), _(-4561), _(6237), _(-1893), _( 645), _(-225), _( 38), _( 1) },
+    { _(-24), _(-202), _(-347), _(-2080), _(-4425), _(-7640), _(-33791), _(-74856), _(41176), _(-5288), _(5879), _(-1952), _( 581), _(-222), _( 35), _( 1) },
+    { _(-26), _(-208), _(-401), _(-2063), _(-4788), _(-7134), _(-35640), _(-74992), _(39336), _(-5959), _(5517), _(-2000), _( 519), _(-218), _( 31), _( 1) }
+};
+
+#undef  _
+
+static void Calculate_New_V ( const MPC_SAMPLE_FORMAT * Sample, MPC_SAMPLE_FORMAT * V )
+{
+    // Calculating new V-buffer values for left channel
+    // calculate new V-values (ISO-11172-3, p. 39)
+    // based upon fast-MDCT algorithm by Byeong Gi Lee
+    /*static*/ MPC_SAMPLE_FORMAT A00, A01, A02, A03, A04, A05, A06, A07, A08, A09, A10, A11, A12, A13, A14, A15;
+    /*static*/ MPC_SAMPLE_FORMAT B00, B01, B02, B03, B04, B05, B06, B07, B08, B09, B10, B11, B12, B13, B14, B15;
+    MPC_SAMPLE_FORMAT tmp;
+
+    A00 = Sample[ 0] + Sample[31];
+    A01 = Sample[ 1] + Sample[30];
+    A02 = Sample[ 2] + Sample[29];
+    A03 = Sample[ 3] + Sample[28];
+    A04 = Sample[ 4] + Sample[27];
+    A05 = Sample[ 5] + Sample[26];
+    A06 = Sample[ 6] + Sample[25];
+    A07 = Sample[ 7] + Sample[24];
+    A08 = Sample[ 8] + Sample[23];
+    A09 = Sample[ 9] + Sample[22];
+    A10 = Sample[10] + Sample[21];
+    A11 = Sample[11] + Sample[20];
+    A12 = Sample[12] + Sample[19];
+    A13 = Sample[13] + Sample[18];
+    A14 = Sample[14] + Sample[17];
+    A15 = Sample[15] + Sample[16];
+
+    B00 = A00 + A15;
+    B01 = A01 + A14;
+    B02 = A02 + A13;
+    B03 = A03 + A12;
+    B04 = A04 + A11;
+    B05 = A05 + A10;
+    B06 = A06 + A09;
+    B07 = A07 + A08;;
+    B08 = MPC_SCALE_CONST((A00 - A15) , 0.5024192929f , 31);
+    B09 = MPC_SCALE_CONST((A01 - A14) , 0.5224986076f , 31);
+    B10 = MPC_SCALE_CONST((A02 - A13) , 0.5669440627f , 31);
+    B11 = MPC_SCALE_CONST((A03 - A12) , 0.6468217969f , 31);
+    B12 = MPC_SCALE_CONST((A04 - A11) , 0.7881546021f , 31);
+    B13 = MPC_SCALE_CONST((A05 - A10) , 1.0606776476f , 30);
+    B14 = MPC_SCALE_CONST((A06 - A09) , 1.7224471569f , 30);
+    B15 = MPC_SCALE_CONST((A07 - A08) , 5.1011486053f , 28);
+
+    A00 =  B00 + B07;
+    A01 =  B01 + B06;
+    A02 =  B02 + B05;
+    A03 =  B03 + B04;
+    A04 = MPC_SCALE_CONST((B00 - B07) , 0.5097956061f , 31);
+    A05 = MPC_SCALE_CONST((B01 - B06) , 0.6013448834f , 31);
+    A06 = MPC_SCALE_CONST((B02 - B05) , 0.8999761939f , 31);
+    A07 = MPC_SCALE_CONST((B03 - B04) , 2.5629155636f , 29);
+    A08 =  B08 + B15;
+    A09 =  B09 + B14;
+    A10 =  B10 + B13;
+    A11 =  B11 + B12;
+    A12 = MPC_SCALE_CONST((B08 - B15) , 0.5097956061f , 31);
+    A13 = MPC_SCALE_CONST((B09 - B14) , 0.6013448834f , 31);
+    A14 = MPC_SCALE_CONST((B10 - B13) , 0.8999761939f , 31);
+    A15 = MPC_SCALE_CONST((B11 - B12) , 2.5629155636f , 29);
+
+    B00 =  A00 + A03;
+    B01 =  A01 + A02;
+    B02 = MPC_MULTIPLY_FRACT_CONST_FIX((A00 - A03) , 0.5411961079f , 1);
+    B03 = MPC_MULTIPLY_FRACT_CONST_FIX((A01 - A02) , 1.3065630198f , 2);
+    B04 =  A04 + A07;
+    B05 =  A05 + A06;
+    B06 = MPC_MULTIPLY_FRACT_CONST_FIX((A04 - A07) , 0.5411961079f , 1);
+    B07 = MPC_MULTIPLY_FRACT_CONST_FIX((A05 - A06) , 1.3065630198f , 2);
+    B08 =  A08 + A11;
+    B09 =  A09 + A10;
+    B10 = MPC_MULTIPLY_FRACT_CONST_FIX((A08 - A11) , 0.5411961079f , 1);
+    B11 = MPC_MULTIPLY_FRACT_CONST_FIX((A09 - A10) , 1.3065630198f , 2);
+    B12 =  A12 + A15;
+    B13 =  A13 + A14;
+    B14 = MPC_MULTIPLY_FRACT_CONST_FIX((A12 - A15) , 0.5411961079f , 1);
+    B15 = MPC_MULTIPLY_FRACT_CONST_FIX((A13 - A14) , 1.3065630198f , 2);
+
+    A00 =  B00 + B01;
+    A01 = MPC_MULTIPLY_FRACT_CONST_FIX((B00 - B01) , 0.7071067691f , 1);
+    A02 =  B02 + B03;
+    A03 = MPC_MULTIPLY_FRACT_CONST_FIX((B02 - B03) , 0.7071067691f , 1);
+    A04 =  B04 + B05;
+    A05 = MPC_MULTIPLY_FRACT_CONST_FIX((B04 - B05) , 0.7071067691f , 1);
+    A06 =  B06 + B07;
+    A07 = MPC_MULTIPLY_FRACT_CONST_FIX((B06 - B07) , 0.7071067691f , 1);
+    A08 =  B08 + B09;
+    A09 = MPC_MULTIPLY_FRACT_CONST_FIX((B08 - B09) , 0.7071067691f , 1);
+    A10 =  B10 + B11;
+    A11 = MPC_MULTIPLY_FRACT_CONST_FIX((B10 - B11) , 0.7071067691f , 1);
+    A12 =  B12 + B13;
+    A13 = MPC_MULTIPLY_FRACT_CONST_FIX((B12 - B13) , 0.7071067691f , 1);
+    A14 =  B14 + B15;
+    A15 = MPC_MULTIPLY_FRACT_CONST_FIX((B14 - B15) , 0.7071067691f , 1);
+
+    V[48] = -A00;
+    V[ 0] =  A01;
+    V[40] = -A02 - (V[ 8] = A03);
+    V[36] = -((V[ 4] = A05 + (V[12] = A07)) + A06);
+    V[44] = - A04 - A06 - A07;
+    V[ 6] = (V[10] = A11 + (V[14] = A15)) + A13;
+    V[38] = (V[34] = -(V[ 2] = A09 + A13 + A15) - A14) + A09 - A10 - A11;
+    V[46] = (tmp = -(A12 + A14 + A15)) - A08;
+    V[42] = tmp - A10 - A11;
+
+    A00 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 0] - Sample[31]) , 0.5006030202f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A01 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 1] - Sample[30]) , 0.5054709315f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A02 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 2] - Sample[29]) , 0.5154473186f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A03 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 3] - Sample[28]) , 0.5310425758f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A04 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 4] - Sample[27]) , 0.5531039238f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A05 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 5] - Sample[26]) , 0.5829349756f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A06 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 6] - Sample[25]) , 0.6225041151f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A07 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 7] - Sample[24]) , 0.6748083234f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A08 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 8] - Sample[23]) , 0.7445362806f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A09 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 9] - Sample[22]) , 0.8393496275f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A10 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[10] - Sample[21]) , 0.9725682139f ,     MPC_FIXED_POINT_SYNTH_FIX);
+#if MPC_FIXED_POINT_SYNTH_FIX>=2
+    A11 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[11] - Sample[20]) , 1.1694399118f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A12 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[12] - Sample[19]) , 1.4841645956f ,     MPC_FIXED_POINT_SYNTH_FIX);
+#else
+    A11 = MPC_SCALE_CONST_SHR         ((Sample[11] - Sample[20]) , 1.1694399118f , 30, MPC_FIXED_POINT_SYNTH_FIX);
+    A12 = MPC_SCALE_CONST_SHR         ((Sample[12] - Sample[19]) , 1.4841645956f , 30, MPC_FIXED_POINT_SYNTH_FIX);
+#endif
+    A13 = MPC_SCALE_CONST_SHR         ((Sample[13] - Sample[18]) , 2.0577809811f , 29, MPC_FIXED_POINT_SYNTH_FIX);
+    A14 = MPC_SCALE_CONST_SHR         ((Sample[14] - Sample[17]) , 3.4076085091f , 29, MPC_FIXED_POINT_SYNTH_FIX);
+    A15 = MPC_SCALE_CONST_SHR         ((Sample[15] - Sample[16]) , 10.1900081635f, 27 ,MPC_FIXED_POINT_SYNTH_FIX);
+
+    B00 =  A00 + A15;
+    B01 =  A01 + A14;
+    B02 =  A02 + A13;
+    B03 =  A03 + A12;
+    B04 =  A04 + A11;
+    B05 =  A05 + A10;
+    B06 =  A06 + A09;
+    B07 =  A07 + A08;
+    B08 = MPC_SCALE_CONST((A00 - A15) , 0.5024192929f , 31);
+    B09 = MPC_SCALE_CONST((A01 - A14) , 0.5224986076f , 31);
+    B10 = MPC_SCALE_CONST((A02 - A13) , 0.5669440627f , 31);
+    B11 = MPC_SCALE_CONST((A03 - A12) , 0.6468217969f , 31);
+    B12 = MPC_SCALE_CONST((A04 - A11) , 0.7881546021f , 31);
+    B13 = MPC_SCALE_CONST((A05 - A10) , 1.0606776476f , 30);
+    B14 = MPC_SCALE_CONST((A06 - A09) , 1.7224471569f , 30);
+    B15 = MPC_SCALE_CONST((A07 - A08) , 5.1011486053f , 28);
+
+    A00 =  B00 + B07;
+    A01 =  B01 + B06;
+    A02 =  B02 + B05;
+    A03 =  B03 + B04;
+    A04 = MPC_SCALE_CONST((B00 - B07) , 0.5097956061f , 31);
+    A05 = MPC_SCALE_CONST((B01 - B06) , 0.6013448834f , 31);
+    A06 = MPC_SCALE_CONST((B02 - B05) , 0.8999761939f , 31);
+    A07 = MPC_SCALE_CONST((B03 - B04) , 2.5629155636f , 29);
+    A08 =  B08 + B15;
+    A09 =  B09 + B14;
+    A10 =  B10 + B13;
+    A11 =  B11 + B12;
+    A12 = MPC_SCALE_CONST((B08 - B15) , 0.5097956061f , 31);
+    A13 = MPC_SCALE_CONST((B09 - B14) , 0.6013448834f , 31);
+    A14 = MPC_SCALE_CONST((B10 - B13) , 0.8999761939f , 31);
+    A15 = MPC_SCALE_CONST((B11 - B12) , 2.5629155636f , 29);
+
+    B00 =  A00 + A03;
+    B01 =  A01 + A02;
+    B02 = MPC_SCALE_CONST((A00 - A03) , 0.5411961079f , 31);
+    B03 = MPC_SCALE_CONST((A01 - A02) , 1.3065630198f , 30);
+    B04 =  A04 + A07;
+    B05 =  A05 + A06;
+    B06 = MPC_SCALE_CONST((A04 - A07) , 0.5411961079f , 31);
+    B07 = MPC_SCALE_CONST((A05 - A06) , 1.3065630198f , 30);
+    B08 =  A08 + A11;
+    B09 =  A09 + A10;
+    B10 = MPC_SCALE_CONST((A08 - A11) , 0.5411961079f , 31);
+    B11 = MPC_SCALE_CONST((A09 - A10) , 1.3065630198f , 30);
+    B12 =  A12 + A15;
+    B13 =  A13 + A14;
+    B14 = MPC_SCALE_CONST((A12 - A15) , 0.5411961079f , 31);
+    B15 = MPC_SCALE_CONST((A13 - A14) , 1.3065630198f , 30);
+
+    A00 = MPC_SHL(B00 + B01, MPC_FIXED_POINT_SYNTH_FIX);
+    A01 = MPC_SCALE_CONST_SHL((B00 - B01) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A02 = MPC_SHL(B02 + B03, MPC_FIXED_POINT_SYNTH_FIX);
+    A03 = MPC_SCALE_CONST_SHL((B02 - B03) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A04 = MPC_SHL(B04 + B05, MPC_FIXED_POINT_SYNTH_FIX);
+    A05 = MPC_SCALE_CONST_SHL((B04 - B05) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A06 = MPC_SHL(B06 + B07, MPC_FIXED_POINT_SYNTH_FIX);
+    A07 = MPC_SCALE_CONST_SHL((B06 - B07) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A08 = MPC_SHL(B08 + B09, MPC_FIXED_POINT_SYNTH_FIX);
+    A09 = MPC_SCALE_CONST_SHL((B08 - B09) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A10 = MPC_SHL(B10 + B11, MPC_FIXED_POINT_SYNTH_FIX);
+    A11 = MPC_SCALE_CONST_SHL((B10 - B11) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A12 = MPC_SHL(B12 + B13, MPC_FIXED_POINT_SYNTH_FIX);
+    A13 = MPC_SCALE_CONST_SHL((B12 - B13) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A14 = MPC_SHL(B14 + B15, MPC_FIXED_POINT_SYNTH_FIX);
+    A15 = MPC_SCALE_CONST_SHL((B14 - B15) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+
+    // mehrfach verwendete Ausdrücke: A04+A06+A07, A09+A13+A15
+    V[ 5] = (V[11] = (V[13] = A07 + (V[15] = A15)) + A11) + A05 + A13;
+    V[ 7] = (V[ 9] = A03 + A11 + A15) + A13;
+    V[33] = -(V[ 1] = A01 + A09 + A13 + A15) - A14;
+    V[35] = -(V[ 3] = A05 + A07 + A09 + A13 + A15) - A06 - A14;
+    V[37] = (tmp = -(A10 + A11 + A13 + A14 + A15)) - A05 - A06 - A07;
+    V[39] = tmp - A02 - A03;                      // abhängig vom Befehl drüber
+    V[41] = (tmp += A13 - A12) - A02 - A03;       // abhängig vom Befehl 2 drüber
+    V[43] = tmp - A04 - A06 - A07;                // abhängig von Befehlen 1 und 3 drüber
+    V[47] = (tmp = -(A08 + A12 + A14 + A15)) - A00;
+    V[45] = tmp - A04 - A06 - A07;                // abhängig vom Befehl drüber
+
+    V[32] = -V[ 0];
+    V[31] = -V[ 1];
+    V[30] = -V[ 2];
+    V[29] = -V[ 3];
+    V[28] = -V[ 4];
+    V[27] = -V[ 5];
+    V[26] = -V[ 6];
+    V[25] = -V[ 7];
+    V[24] = -V[ 8];
+    V[23] = -V[ 9];
+    V[22] = -V[10];
+    V[21] = -V[11];
+    V[20] = -V[12];
+    V[19] = -V[13];
+    V[18] = -V[14];
+    V[17] = -V[15];
+
+    V[63] =  V[33];
+    V[62] =  V[34];
+    V[61] =  V[35];
+    V[60] =  V[36];
+    V[59] =  V[37];
+    V[58] =  V[38];
+    V[57] =  V[39];
+    V[56] =  V[40];
+    V[55] =  V[41];
+    V[54] =  V[42];
+    V[53] =  V[43];
+    V[52] =  V[44];
+    V[51] =  V[45];
+    V[50] =  V[46];
+    V[49] =  V[47];
+}
+
+static void Synthese_Filter_float_internal(MPC_SAMPLE_FORMAT * OutData,MPC_SAMPLE_FORMAT * V,const MPC_SAMPLE_FORMAT * Y)
+{
+    mpc_uint32_t n;
+    for ( n = 0; n < 36; n++, Y += 32 ) {
+        V -= 64;
+        Calculate_New_V ( Y, V );
+        {
+            MPC_SAMPLE_FORMAT * Data = OutData;
+            const MPC_SAMPLE_FORMAT *  D = (const MPC_SAMPLE_FORMAT *) &Di_opt;
+            mpc_int32_t           k;
+            //mpc_int32_t           tmp;
+
+            
+            
+            for ( k = 0; k < 32; k++, D += 16, V++ ) {
+                *Data = MPC_SHL(
+                    MPC_MULTIPLY_FRACT(V[  0],D[ 0]) + MPC_MULTIPLY_FRACT(V[ 96],D[ 1]) + MPC_MULTIPLY_FRACT(V[128],D[ 2]) + MPC_MULTIPLY_FRACT(V[224],D[ 3])
+                    + MPC_MULTIPLY_FRACT(V[256],D[ 4]) + MPC_MULTIPLY_FRACT(V[352],D[ 5]) + MPC_MULTIPLY_FRACT(V[384],D[ 6]) + MPC_MULTIPLY_FRACT(V[480],D[ 7])
+                    + MPC_MULTIPLY_FRACT(V[512],D[ 8]) + MPC_MULTIPLY_FRACT(V[608],D[ 9]) + MPC_MULTIPLY_FRACT(V[640],D[10]) + MPC_MULTIPLY_FRACT(V[736],D[11])
+                    + MPC_MULTIPLY_FRACT(V[768],D[12]) + MPC_MULTIPLY_FRACT(V[864],D[13]) + MPC_MULTIPLY_FRACT(V[896],D[14]) + MPC_MULTIPLY_FRACT(V[992],D[15])
+                    , 2);
+                
+                Data += 2;
+            }
+            V -= 32;//bleh
+            OutData+=64;
+        }
+    }
+}
+
+void
+mpc_decoder_synthese_filter_float(mpc_decoder *d, MPC_SAMPLE_FORMAT* OutData) 
+{
+    /********* left channel ********/
+    memmove(d->V_L + MPC_V_MEM, d->V_L, 960 * sizeof(MPC_SAMPLE_FORMAT) );
+
+    Synthese_Filter_float_internal(
+        OutData,
+        (MPC_SAMPLE_FORMAT *)(d->V_L + MPC_V_MEM),
+        (MPC_SAMPLE_FORMAT *)(d->Y_L [0]));
+
+    /******** right channel ********/
+    memmove(d->V_R + MPC_V_MEM, d->V_R, 960 * sizeof(MPC_SAMPLE_FORMAT) );
+
+    Synthese_Filter_float_internal(
+        OutData + 1,
+        (MPC_SAMPLE_FORMAT *)(d->V_R + MPC_V_MEM),
+        (MPC_SAMPLE_FORMAT *)(d->Y_R [0]));
+}
+
+/*******************************************/
+/*                                         */
+/*            dithered synthesis           */
+/*                                         */
+/*******************************************/
+
+static const unsigned char    Parity [256] = {  // parity
+    0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
+    1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
+    1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
+    0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
+    1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
+    0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
+    0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
+    1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0
+};
+
+/*
+ *  This is a simple random number generator with good quality for audio purposes.
+ *  It consists of two polycounters with opposite rotation direction and different
+ *  periods. The periods are coprime, so the total period is the product of both.
+ *
+ *     -------------------------------------------------------------------------------------------------
+ * +-> |31:30:29:28:27:26:25:24:23:22:21:20:19:18:17:16:15:14:13:12:11:10: 9: 8: 7: 6: 5: 4: 3: 2: 1: 0|
+ * |   -------------------------------------------------------------------------------------------------
+ * |                                                                          |  |  |  |     |        |
+ * |                                                                          +--+--+--+-XOR-+--------+
+ * |                                                                                      |
+ * +--------------------------------------------------------------------------------------+
+ *
+ *     -------------------------------------------------------------------------------------------------
+ *     |31:30:29:28:27:26:25:24:23:22:21:20:19:18:17:16:15:14:13:12:11:10: 9: 8: 7: 6: 5: 4: 3: 2: 1: 0| <-+
+ *     -------------------------------------------------------------------------------------------------   |
+ *       |  |           |  |                                                                               |
+ *       +--+----XOR----+--+                                                                               |
+ *                |                                                                                        |
+ *                +----------------------------------------------------------------------------------------+
+ *
+ *
+ *  The first has an period of 3*5*17*257*65537, the second of 7*47*73*178481,
+ *  which gives a period of 18.410.713.077.675.721.215. The result is the
+ *  XORed values of both generators.
+ */
+mpc_uint32_t
+random_int(mpc_decoder *d) 
+{
+#if 1
+    mpc_uint32_t  t1, t2, t3, t4;
+
+    t3   = t1 = d->__r1;   t4   = t2 = d->__r2;  // Parity calculation is done via table lookup, this is also available
+    t1  &= 0xF5;        t2 >>= 25;               // on CPUs without parity, can be implemented in C and avoid unpredictable
+    t1   = Parity [t1]; t2  &= 0x63;             // jumps and slow rotate through the carry flag operations.
+    t1 <<= 31;          t2   = Parity [t2];
+
+    return (d->__r1 = (t3 >> 1) | t1 ) ^ (d->__r2 = (t4 + t4) | t2 );
+#else
+    return (d->__r1 = (d->__r1 >> 1) | ((mpc_uint32_t)Parity [d->__r1 & 0xF5] << 31) ) ^
+        (d->__r2 = (d->__r2 << 1) |  (mpc_uint32_t)Parity [(d->__r2 >> 25) & 0x63] );
+#endif
+}
Index: /libmpcdec/tags/release-1.2.1/AUTHORS
===================================================================
--- /libmpcdec/tags/release-1.2.1/AUTHORS	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/AUTHORS	(revision 30)
@@ -0,0 +1,10 @@
+libmpcdec is the result of the work of many people:
+
+* Andree Buschmann and Frank Klemm
+  Original implementation and core development.
+
+* Peter Pawlowski and Benoit Amiaux
+  Portability and further optimizations.
+
+* Miles Egan
+  Port to pure C, documentation, and api refinements.
Index: /libmpcdec/tags/release-1.2.1/COPYING
===================================================================
--- /libmpcdec/tags/release-1.2.1/COPYING	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/COPYING	(revision 30)
@@ -0,0 +1,31 @@
+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.
Index: /libmpcdec/tags/release-1.2.1/ChangeLog
===================================================================
--- /libmpcdec/tags/release-1.2.1/ChangeLog	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/ChangeLog	(revision 30)
@@ -0,0 +1,29 @@
+1.2.1
+    * Warnings cleanup, patch by Tomas Salfischberger, Thom Johansen and
+    Daniel Stenberg (Rockbox)
+    * Mplayer interface, patch by Reimar Doffinger
+    * Unix EOF everywhere
+
+1.2
+    * 1.1.1 broke the API (BOOL type changed to mpc_bool_t). Version bumped to 1.2 to reflect the major change. Sorry to those who were caught by this error
+    * Fixed relative/absolute includes (#include "stuff.h" in /include/mpcdec, #include <mpcdec/stuff> in src/)
+    * Added msvc project files
+    * Changed mpc_reader_t structure, any specific data of the reader's
+    implementations should be hidden behind the (void*) data pointer. (example
+    in default implementation mpc_reader_file)
+    * Renamed to libmpcdec (to make room for libmpcenc)
+
+1.1.1
+    * fix for fixed-point mode bug
+
+1.1
+    * add compliance & cleanup patches from Michael Roitzsch of xine project 	
+    * switch to BSD license
+    * port to pure C
+    * add doxygen documentation
+    * revise API somewhat
+	
+1.0.3			
+    * autotools build process
+    * sample binary added
+    * floating-point mode by default
Index: /libmpcdec/tags/release-1.2.1/INSTALL
===================================================================
--- /libmpcdec/tags/release-1.2.1/INSTALL	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/INSTALL	(revision 30)
@@ -0,0 +1,3 @@
+How to install libmpcdec:
+"./configure [--prefix=/usr] && make" as a regular user
+"make install" as root
Index: /libmpcdec/tags/release-1.2.1/Makefile.am
===================================================================
--- /libmpcdec/tags/release-1.2.1/Makefile.am	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/Makefile.am	(revision 30)
@@ -0,0 +1,5 @@
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+
+SUBDIRS = src include
Index: /libmpcdec/tags/release-1.2.1/README
===================================================================
--- /libmpcdec/tags/release-1.2.1/README	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/README	(revision 30)
@@ -0,0 +1,6 @@
+Musepack Decoder Library:
+
+run "./configure [--prefix=/usr]; make"
+
+To create a sample app using the musepack decoder library in src/
+Check src/sample.cpp for more details.
Index: /libmpcdec/tags/release-1.2.1/autogen.sh
===================================================================
--- /libmpcdec/tags/release-1.2.1/autogen.sh	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/autogen.sh	(revision 30)
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+libtoolize --copy --force
+aclocal
+autoheader
+automake --gnu --add-missing --copy
+autoconf
Index: /libmpcdec/tags/release-1.2.1/configure.ac
===================================================================
--- /libmpcdec/tags/release-1.2.1/configure.ac	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/configure.ac	(revision 30)
@@ -0,0 +1,202 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(src/mpc_decoder.c)
+AC_CONFIG_AUX_DIR(config)
+AM_INIT_AUTOMAKE(libmpcdec,1.2.1)
+AM_CONFIG_HEADER(include/config.h)
+
+AM_PROG_LIBTOOL
+
+CFLAGS="$CFLAGS -O3 -fomit-frame-pointer -fPIC"
+
+AC_C_BIGENDIAN(,CFLAGS="$CFLAGS -DMPC_LITTLE_ENDIAN",)
+
+AC_HEADER_STDC
+AC_CHECK_HEADERS([inttypes.h string.h])
+
+AC_HEADER_STDBOOL
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_OFF_T
+AC_TYPE_SIZE_T
+AC_CHECK_TYPES([ptrdiff_t])
+
+AC_FUNC_MEMCMP
+AC_CHECK_FUNCS([memmove memset sqrt])
+
+AC_MSG_CHECKING(for int16_t)
+AC_CACHE_VAL(has_int16_t,
+[AC_TRY_RUN([
+int16_t foo;
+int main() {return 0;}
+],
+has_int16_t=yes,
+has_int16_t=no,
+has_int16_t=no
+)])
+AC_MSG_RESULT($has_int16_t)
+
+AC_MSG_CHECKING(for int32_t)
+AC_CACHE_VAL(has_int32_t,
+[AC_TRY_RUN([
+int32_t foo;
+int main() {return 0;}
+],
+has_int32_t=yes,
+has_int32_t=no,
+has_int32_t=no
+)])
+AC_MSG_RESULT($has_int32_t)
+
+AC_MSG_CHECKING(for uint32_t)
+AC_CACHE_VAL(has_uint32_t,
+[AC_TRY_RUN([
+uint32_t foo;
+int main() {return 0;}
+],
+has_uint32_t=yes,
+has_uint32_t=no,
+has_uint32_t=no
+)])
+AC_MSG_RESULT($has_uint32_t)
+
+AC_MSG_CHECKING(for uint16_t)
+AC_CACHE_VAL(has_uint16_t,
+[AC_TRY_RUN([
+uint16_t foo;
+int main() {return 0;}
+],
+has_uint16_t=yes,
+has_uint16_t=no,
+has_uint16_t=no
+)])
+AC_MSG_RESULT($has_uint16_t)
+
+AC_MSG_CHECKING(for u_int32_t)
+AC_CACHE_VAL(has_u_int32_t,
+[AC_TRY_RUN([
+u_int32_t foo;
+int main() {return 0;}
+],
+has_u_int32_t=yes,
+has_u_int32_t=no,
+has_u_int32_t=no
+)])
+AC_MSG_RESULT($has_u_int32_t)
+
+AC_MSG_CHECKING(for u_int16_t)
+AC_CACHE_VAL(has_u_int16_t,
+[AC_TRY_RUN([
+u_int16_t foo;
+int main() {return 0;}
+],
+has_u_int16_t=yes,
+has_u_int16_t=no,
+has_u_int16_t=no
+)])
+AC_MSG_RESULT($has_u_int16_t)
+
+AC_MSG_CHECKING(for int64_t)
+AC_CACHE_VAL(has_int64_t,
+[AC_TRY_RUN([
+int64_t foo;
+int main() {return 0;}
+],
+has_int64_t=yes,
+has_int64_t=no,
+has_int64_t=no
+)])
+AC_MSG_RESULT($has_int64_t)
+
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+
+
+if test x$has_int16_t = "xyes" ; then
+        SIZE16="int16_t"
+else
+        case 2 in
+                $ac_cv_sizeof_short) SIZE16="short";;
+                $ac_cv_sizeof_int) SIZE16="int";;
+        esac
+fi
+
+if test x$has_int32_t = "xyes" ; then
+        SIZE32="int32_t"
+else
+        case 4 in
+                $ac_cv_sizeof_short) SIZE32="short";;
+                $ac_cv_sizeof_int) SIZE32="int";;
+                $ac_cv_sizeof_long) SIZE32="long";;
+        esac
+fi
+
+if test x$has_uint32_t = "xyes" ; then
+        USIZE32="uint32_t"
+else
+        if test x$has_u_int32_t = "xyes" ; then
+                USIZE32="u_int32_t"
+        else
+                case 4 in
+                        $ac_cv_sizeof_short) USIZE32="unsigned short";;
+                        $ac_cv_sizeof_int) USIZE32="unsigned int";;
+                        $ac_cv_sizeof_long) USIZE32="unsigned long";;
+                esac
+        fi
+fi
+
+if test x$has_uint16_t = "xyes" ; then
+        USIZE16="uint16_t"
+else
+        if test x$has_u_int16_t = "xyes" ; then
+                USIZE16="u_int16_t"
+        else
+                case 2 in
+                        $ac_cv_sizeof_short) USIZE16="unsigned short";;
+                        $ac_cv_sizeof_int) USIZE16="unsigned int";;
+                        $ac_cv_sizeof_long) USIZE16="unsigned long";;
+                esac
+        fi
+fi
+
+if test x$has_int64_t = "xyes" ; then
+        SIZE64="int64_t"
+else
+case 8 in
+        $ac_cv_sizeof_int) SIZE64="int";;
+        $ac_cv_sizeof_long) SIZE64="long";;
+        $ac_cv_sizeof_long_long) SIZE64="long long";;
+esac
+fi
+
+if test -z "$SIZE16"; then
+        AC_MSG_ERROR(No 16 bit type found on this platform!)
+fi
+if test -z "$USIZE16"; then
+        AC_MSG_ERROR(No unsigned 16 bit type found on this platform!)
+fi
+if test -z "$SIZE32"; then
+        AC_MSG_ERROR(No 32 bit type found on this platform!)
+fi
+if test -z "$USIZE32"; then
+        AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
+fi
+if test -z "$SIZE64"; then
+        AC_MSG_WARN(No 64 bit type found on this platform!)
+fi
+
+dnl Make substitutions
+
+AC_SUBST(VERSION)
+AC_SUBST(LIBTOOL_DEPS)
+AC_SUBST(SIZE16)
+AC_SUBST(USIZE16)
+AC_SUBST(SIZE32)
+AC_SUBST(USIZE32)
+AC_SUBST(SIZE64)
+AC_SUBST(OPT)
+AC_SUBST(LIBS)
+
+AC_OUTPUT(Makefile src/Makefile include/Makefile include/mpcdec/config_types.h)
+AC_MSG_RESULT([=> libmpcdec $VERSION configured successfully])
Index: /libmpcdec/tags/release-1.2.1/docs/Doxyfile
===================================================================
--- /libmpcdec/tags/release-1.2.1/docs/Doxyfile	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/docs/Doxyfile	(revision 30)
@@ -0,0 +1,1161 @@
+# Doxyfile 1.3.9.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = libmpcdec
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 1.2
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = docs
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of source 
+# files, where putting all generated files in the same directory would otherwise 
+# cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, 
+# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, 
+# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, 
+# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, 
+# Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE        = English
+
+# This tag can be used to specify the encoding used in the generated output. 
+# The encoding is not always determined by the language that is chosen, 
+# but also whether or not the output is meant for Windows or non-Windows users. 
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES 
+# forces the Windows encoding (this is the default for the Windows binary), 
+# whereas setting the tag to NO uses a Unix-style encoding (the default for 
+# all platforms other than Windows).
+
+USE_WINDOWS_ENCODING   = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is used 
+# as the annotated text. Otherwise, the brief description is used as-is. If left 
+# blank, the following values are used ("$name" is automatically replaced with the 
+# name of the entity): "The $name class" "The $name widget" "The $name file" 
+# "is" "provides" "specifies" "contains" "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = 
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited 
+# members of a class in the documentation of that class as if those members were 
+# ordinary class members. Constructors, destructors and assignment operators of 
+# the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like the Qt-style comments (thus requiring an 
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF      = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member 
+# documentation.
+
+DETAILS_AT_TOP         = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = 
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources 
+# only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources 
+# only. Doxygen will then generate output that is more tailored for Java. 
+# For instance, namespaces will be presented as packages, qualified scopes 
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories 
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
+# in the documentation.
+
+SHOW_DIRECTORIES       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text.
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT                  = include src
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp 
+# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm
+
+FILE_PATTERNS          = 
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                = include/config.h
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories 
+# that are symbolic links (a Unix filesystem feature) are excluded from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories.
+
+EXCLUDE_PATTERNS       = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = 
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# ignored.
+
+INPUT_FILTER           = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis.  Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match.  The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
+# is applied to all files.
+
+FILTER_PATTERNS        = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default) 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        = docs/custom.css
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+
+PREDEFINED             = 
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line, have an all uppercase name, and do not end with a semicolon. Such 
+# function macros are typically used for boiler-plate code, and will confuse the 
+# parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or 
+# super classes. Setting the tag to NO turns the diagrams off. Note that this 
+# option is superseded by the HAVE_DOT option below. This is only a fallback. It is 
+# recommended to install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+
+UML_LOOK               = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
+# generate a call dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable call graphs for selected 
+# functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found on the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+
+MAX_DOT_GRAPH_WIDTH    = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT   = 1024
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
+# graphs generated by dot. A depth value of 3 means that only nodes reachable 
+# from the root by following a path via at most 3 edges will be shown. Nodes that 
+# lay further from the root node will be omitted. Note that setting this option to 
+# 1 or 2 may greatly reduce the computation time needed for large code bases. Also 
+# note that a graph may be further truncated if the graph's image dimensions are 
+# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). 
+# If 0 is used for the depth value (the default), the graph is not depth-constrained.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE           = NO
Index: /libmpcdec/tags/release-1.2.1/docs/custom.css
===================================================================
--- /libmpcdec/tags/release-1.2.1/docs/custom.css	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/docs/custom.css	(revision 30)
@@ -0,0 +1,212 @@
+BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
+	font-family: sans-serif;
+}
+h1 {
+	text-align: center;
+    text-transform: lowercase;
+    margin: 0.5em 0;
+}
+h2, h2 a { color: #f90; margin: 1em 0 0.25em 0; }
+h3, h3 a { color: #88f; margin: 1em 0 0.25em 0; }
+
+CAPTION { font-weight: bold }
+DIV.qindex {
+	width: 100%;
+	background-color: #eeeeff;
+	border: 1px solid #b0b0b0;
+	text-align: center;
+	margin: 2px;
+	padding: 2px;
+	line-height: 140%;
+}
+DIV.nav {
+	text-align: center;
+    padding: 0.25em 0;
+}
+A.qindex {
+    text-decoration: none;
+    font-weight: bold;
+    color: #1A419D;
+    text-transform: lowercase;
+}
+A.qindex:visited {
+    text-decoration: none;
+    font-weight: bold;
+    color: #1A419D
+}
+A.qindex:hover {
+	text-decoration: none;
+	background-color: #ddddff;
+}
+A.qindexHL {
+	text-decoration: none;
+	font-weight: bold;
+	background-color: #6666cc;
+	color: #ffffff;
+	border: 1px double #9295C2;
+    text-transform: lowercase;
+}
+A.qindexHL:hover {
+	text-decoration: none;
+	background-color: #6666cc;
+	color: #ffffff;
+}
+A.qindex, A.qindexHL { padding: 0.1em 0.5em; }
+A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff }
+A.el { text-decoration: none; font-weight: bold; color: #d66; font-style: italic }
+A.elRef { font-weight: bold }
+A.code:link { text-decoration: none; font-weight: normal; color: #0000FF}
+A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF}
+A.codeRef:link { font-weight: normal; color: #0000FF}
+A.codeRef:visited { font-weight: normal; color: #0000FF}
+A:hover { text-decoration: none; background-color: #f2f2ff }
+DL.el { margin-left: -1cm }
+.fragment {
+       font-family: monospace
+}
+PRE.fragment {
+	border: 1px solid #CCCCCC;
+	background-color: #f5f5f5;
+	margin-top: 4px;
+	margin-bottom: 4px;
+	margin-left: 2px;
+	margin-right: 8px;
+	padding-left: 6px;
+	padding-right: 6px;
+	padding-top: 4px;
+	padding-bottom: 4px;
+}
+hr { display: none }
+DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
+TD.md { font-weight: bold; }
+TD.mdname1, TD.mdname { color: #088; font-weight: bold; }
+TABLE[cellspacing="5"] { margin-left: 2em; }
+TABLE[cellspacing="5"] dl em { color: #088; font-weight: bold; }
+DIV.groupHeader {
+       margin-left: 16px;
+       margin-top: 12px;
+       margin-bottom: 6px;
+       font-weight: bold;
+}
+DIV.groupText { margin-left: 16px; font-style: italic; font-size: 14px }
+BODY {
+	background: white;
+	color: black;
+	margin-right: 20px;
+	margin-left: 20px;
+}
+TD.indexkey, TD.indexvalue {
+    padding: 0.1em 1em 0.1em 0.1em;
+}
+TD.indexkey {
+	font-weight: bold;
+}
+TD.indexvalue {
+	font-style: italic;
+}
+TR.memlist {
+   background-color: #f0f0f0; 
+}
+P.formulaDsp { text-align: center; }
+IMG.formulaDsp { }
+IMG.formulaInl { vertical-align: middle; }
+SPAN.keyword       { color: #008000 }
+SPAN.keywordtype   { color: #604020 }
+SPAN.keywordflow   { color: #e08000 }
+SPAN.comment       { color: #800000 }
+SPAN.preprocessor  { color: #806020 }
+SPAN.stringliteral { color: #002080 }
+SPAN.charliteral   { color: #008080 }
+.mdTable {
+}
+.mdRow {
+}
+.mdescLeft, .mdescRight {
+    font-style: italic;
+    font-size: 80%;
+}
+.mdescRight {
+}
+.memItemLeft {
+    font-style: italic;
+}
+.memItemLeft, .memItemRight {
+    font-size: 80%;
+}
+.memItemRight {
+}
+.memTemplItemLeft {
+	padding: 1px 0px 0px 8px;
+	margin: 4px;
+	border-top-width: 1px;
+	border-right-width: 1px;
+	border-bottom-width: 1px;
+	border-left-width: 1px;
+	border-top-color: #E0E0E0;
+	border-right-color: #E0E0E0;
+	border-bottom-color: #E0E0E0;
+	border-left-color: #E0E0E0;
+	border-top-style: none;
+	border-right-style: none;
+	border-bottom-style: none;
+	border-left-style: none;
+	background-color: #FAFAFA;
+	font-size: 12px;
+}
+.memTemplItemRight {
+	padding: 1px 8px 0px 8px;
+	margin: 4px;
+	border-top-width: 1px;
+	border-right-width: 1px;
+	border-bottom-width: 1px;
+	border-left-width: 1px;
+	border-top-color: #E0E0E0;
+	border-right-color: #E0E0E0;
+	border-bottom-color: #E0E0E0;
+	border-left-color: #E0E0E0;
+	border-top-style: none;
+	border-right-style: none;
+	border-bottom-style: none;
+	border-left-style: none;
+	background-color: #FAFAFA;
+	font-size: 13px;
+}
+.memTemplParams {
+	padding: 1px 0px 0px 8px;
+	margin: 4px;
+	border-top-width: 1px;
+	border-right-width: 1px;
+	border-bottom-width: 1px;
+	border-left-width: 1px;
+	border-top-color: #E0E0E0;
+	border-right-color: #E0E0E0;
+	border-bottom-color: #E0E0E0;
+	border-left-color: #E0E0E0;
+	border-top-style: solid;
+	border-right-style: none;
+	border-bottom-style: none;
+	border-left-style: none;
+       color: #606060;
+	background-color: #FAFAFA;
+	font-size: 12px;
+}
+.search     { color: #003399;
+              font-weight: bold;
+}
+FORM.search {
+              margin-bottom: 0px;
+              margin-top: 0px;
+}
+INPUT.search { font-size: 75%;
+               color: #000080;
+               font-weight: normal;
+               background-color: #eeeeff;
+}
+TD.tiny      { font-size: 75%;
+}
+a {
+	color: #252E78;
+}
+a:visited {
+	color: #3D2185;
+}
Index: /libmpcdec/tags/release-1.2.1/include/Makefile.am
===================================================================
--- /libmpcdec/tags/release-1.2.1/include/Makefile.am	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/include/Makefile.am	(revision 30)
@@ -0,0 +1,13 @@
+## 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/tags/release-1.2.1/include/config.h.in
===================================================================
--- /libmpcdec/tags/release-1.2.1/include/config.h.in	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/include/config.h.in	(revision 30)
@@ -0,0 +1,104 @@
+/* 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/tags/release-1.2.1/include/mainpage.h
===================================================================
--- /libmpcdec/tags/release-1.2.1/include/mainpage.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/include/mainpage.h	(revision 30)
@@ -0,0 +1,38 @@
+/**
+   \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/tags/release-1.2.1/include/mpcdec/config_types.h.in
===================================================================
--- /libmpcdec/tags/release-1.2.1/include/mpcdec/config_types.h.in	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/include/mpcdec/config_types.h.in	(revision 30)
@@ -0,0 +1,48 @@
+/*
+  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/tags/release-1.2.1/include/mpcdec/config_win32.h
===================================================================
--- /libmpcdec/tags/release-1.2.1/include/mpcdec/config_win32.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/include/mpcdec/config_win32.h	(revision 30)
@@ -0,0 +1,48 @@
+/*
+  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 __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;
+
+#endif // __MUSEPACK_CONFIG_WIN32_H__
Index: /libmpcdec/tags/release-1.2.1/include/mpcdec/decoder.h
===================================================================
--- /libmpcdec/tags/release-1.2.1/include/mpcdec/decoder.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/include/mpcdec/decoder.h	(revision 30)
@@ -0,0 +1,148 @@
+/*
+  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"
+
+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; /// actually 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  FwdJumpInfo;
+    mpc_uint32_t  ActDecodePos;
+    mpc_uint32_t  FrameWasValid;
+
+    mpc_uint32_t  DecodedFrames;
+    mpc_uint32_t  OverallFrames;
+    mpc_int32_t   SampleRate;                 // Sample frequency
+
+    mpc_uint32_t  StreamVersion;              // version of bitstream
+    mpc_uint32_t  MS_used;                    // MS-coding used ?
+    mpc_int32_t   Max_Band;
+    mpc_uint32_t  MPCHeaderPos;               // AB: needed to support ID3v2
+    mpc_uint32_t  LastValidSamples;
+    mpc_uint32_t  TrueGaplessPresent;
+
+    mpc_uint32_t  EQ_activated;
+
+    mpc_uint32_t  WordsRead;                  // counts amount of decoded dwords
+
+    // randomizer state variables
+    mpc_uint32_t  __r1; 
+    mpc_uint32_t  __r2; 
+
+    mpc_uint32_t  Q_bit [32];     
+    mpc_uint32_t  Q_res [32][16];
+
+    // huffman table stuff
+    HuffmanTyp    HuffHdr  [10];
+    HuffmanTyp    HuffSCFI [ 4];
+    HuffmanTyp    HuffDSCF [16];
+    HuffmanTyp*   HuffQ [2] [8];
+
+    HuffmanTyp    HuffQ1 [2] [3*3*3];
+    HuffmanTyp    HuffQ2 [2] [5*5];
+    HuffmanTyp    HuffQ3 [2] [ 7];
+    HuffmanTyp    HuffQ4 [2] [ 9];
+    HuffmanTyp    HuffQ5 [2] [15];
+    HuffmanTyp    HuffQ6 [2] [31];
+    HuffmanTyp    HuffQ7 [2] [63];
+    const HuffmanTyp* SampleHuff [18];
+    HuffmanTyp    SCFI_Bundle   [ 8];
+    HuffmanTyp    DSCF_Entropie [13];
+    HuffmanTyp    Region_A [16];
+    HuffmanTyp    Region_B [ 8];
+    HuffmanTyp    Region_C [ 4];
+
+    HuffmanTyp    Entropie_1 [ 3];
+    HuffmanTyp    Entropie_2 [ 5];
+    HuffmanTyp    Entropie_3 [ 7];
+    HuffmanTyp    Entropie_4 [ 9];
+    HuffmanTyp    Entropie_5 [15];
+    HuffmanTyp    Entropie_6 [31];
+    HuffmanTyp    Entropie_7 [63];
+
+    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_int32_t   DSCF_Flag_L [32];
+    mpc_int32_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_int32_t   DSCF_Reference_L [32];
+    mpc_int32_t   DSCF_Reference_R [32];      // holds last frames SCF
+    mpc_int32_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/tags/release-1.2.1/include/mpcdec/huffman.h
===================================================================
--- /libmpcdec/tags/release-1.2.1/include/mpcdec/huffman.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/include/mpcdec/huffman.h	(revision 30)
@@ -0,0 +1,80 @@
+/*
+  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_uint32_t  Length;
+    mpc_int32_t   Value;
+} HuffmanTyp;
+
+//! \brief Sorts huffman-tables by codeword.
+//!
+//! offset resulting value.
+//! \param elements
+//! \param Table table to sort
+//! \param offset offset of resulting sort
+void
+mpc_decoder_resort_huff_tables(
+    const mpc_uint32_t elements, HuffmanTyp *Table, const mpc_int32_t offset);
+
+/// Initializes sv6 huffman decoding structures.
+void mpc_decoder_init_huffman_sv6(struct mpc_decoder_t *d);
+
+/// Initializes sv6 huffman decoding tables.
+void mpc_decoder_init_huffman_sv6_tables(struct mpc_decoder_t *d);
+
+/// Initializes sv7 huffman decoding structures.
+void mpc_decoder_init_huffman_sv7(struct mpc_decoder_t *d);
+
+/// Initializes sv7 huffman decoding tables.
+void mpc_decoder_init_huffman_sv7_tables(struct mpc_decoder_t *d);
+
+#endif // _mpcdec_huffman_h_
Index: /libmpcdec/tags/release-1.2.1/include/mpcdec/internal.h
===================================================================
--- /libmpcdec/tags/release-1.2.1/include/mpcdec/internal.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/include/mpcdec/internal.h	(revision 30)
@@ -0,0 +1,65 @@
+/*
+  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 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/tags/release-1.2.1/include/mpcdec/math.h
===================================================================
--- /libmpcdec/tags/release-1.2.1/include/mpcdec/math.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/include/mpcdec/math.h	(revision 30)
@@ -0,0 +1,144 @@
+/*
+  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/tags/release-1.2.1/include/mpcdec/mpcdec.h
===================================================================
--- /libmpcdec/tags/release-1.2.1/include/mpcdec/mpcdec.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/include/mpcdec/mpcdec.h	(revision 30)
@@ -0,0 +1,140 @@
+/*
+  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 mpcdec.h
+/// Top level include file for libmpcdec.
+
+#ifndef _mpcdec_h_
+#define _mpcdec_h_
+
+#ifdef __cplusplus
+extern "C" {
+#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);
+
+/// 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);
+
+/// 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);
+
+void mpc_decoder_set_streaminfo(mpc_decoder *d, 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);
+
+/// Actually reads data from previously initialized stream.  Call
+/// this iteratively to decode the mpc stream.
+/// \param buffer destination buffer for decoded samples
+/// \param vbr_update_acc \todo document me
+/// \param vbr_update_bits \todo document me
+/// \return -1 if an error is encountered
+/// \return 0 if the stream has been completely decoded successfully and there are no more samples
+/// \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_SAMPLE_FORMAT *buffer, 
+    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_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);
+
+/// Seeks to specified position in seconds in the source stream.
+mpc_bool_t mpc_decoder_seek_seconds(mpc_decoder *d, double seconds);
+
+#ifdef __cplusplus
+}
+#endif // __cplusplus
+
+#endif // _mpcdec_h_
Index: /libmpcdec/tags/release-1.2.1/include/mpcdec/reader.h
===================================================================
--- /libmpcdec/tags/release-1.2.1/include/mpcdec/reader.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/include/mpcdec/reader.h	(revision 30)
@@ -0,0 +1,82 @@
+/*
+  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 reader.h
+
+#ifndef _mpcdec_reader_h_
+#define _mpcdec_reader_h_
+
+/// \brief Stream reader interface structure.
+///
+/// This is the structure you must supply to the musepack decoding library
+/// to feed it with raw data.  Implement the five member functions to provide
+/// a functional reader.
+typedef 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);
+
+    /// Seeks to byte position offset.
+	mpc_bool_t (*seek)(void *t, mpc_int32_t offset);
+
+    /// Returns the current byte offset in the stream.
+	mpc_int32_t (*tell)(void *t);
+
+    /// Returns the total length of the source stream, in bytes.
+	mpc_int32_t (*get_size)(void *t);
+
+    /// True if the stream is a seekable stream.
+	mpc_bool_t (*canseek)(void *t);
+
+    /// 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);
+
+#endif // _mpcdec_reader_h_
Index: /libmpcdec/tags/release-1.2.1/include/mpcdec/requant.h
===================================================================
--- /libmpcdec/tags/release-1.2.1/include/mpcdec/requant.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/include/mpcdec/requant.h	(revision 30)
@@ -0,0 +1,51 @@
+/*
+  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/tags/release-1.2.1/include/mpcdec/streaminfo.h
===================================================================
--- /libmpcdec/tags/release-1.2.1/include/mpcdec/streaminfo.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/include/mpcdec/streaminfo.h	(revision 30)
@@ -0,0 +1,86 @@
+/*
+  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 streaminfo.h
+
+#ifndef _mpcdec_streaminfo_h_
+#define _mpcdec_streaminfo_h_
+
+typedef mpc_int32_t mpc_streaminfo_off_t;
+
+/// \brief mpc stream properties structure
+///
+/// Structure containing all the properties of an mpc stream.  Populated
+/// by the streaminfo_read function.
+typedef struct mpc_streaminfo {
+    /// @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
+    //@}
+
+    /// @name replaygain related fields
+    //@{
+    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
+    //@{
+    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_streaminfo_off_t tag_offset;         ///< offset to file tags
+    mpc_streaminfo_off_t total_file_length;  ///< total length of underlying file
+    //@}
+} mpc_streaminfo;
+
+#endif // _mpcdec_streaminfo_h_
Index: /libmpcdec/tags/release-1.2.1/src/Makefile.am
===================================================================
--- /libmpcdec/tags/release-1.2.1/src/Makefile.am	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/src/Makefile.am	(revision 30)
@@ -0,0 +1,21 @@
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+
+lib_LTLIBRARIES = libmpcdec.la
+
+libmpcdec_la_SOURCES = \
+	huffsv46.c \
+	huffsv7.c \
+	idtag.c \
+	mpc_decoder.c \
+	mpc_reader.c \
+	requant.c \
+	streaminfo.c \
+	synth_filter.c
+libmpcdec_la_LDFLAGS = -no-undefined -version-info 4:0:1
+
+noinst_PROGRAMS = sample
+sample_SOURCES = sample.cpp
+sample_LDADD = libmpcdec.la
+
Index: /libmpcdec/tags/release-1.2.1/src/huffsv46.c
===================================================================
--- /libmpcdec/tags/release-1.2.1/src/huffsv46.c	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/src/huffsv46.c	(revision 30)
@@ -0,0 +1,268 @@
+/*
+  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 huffsv46.c
+/// Implementations of huffman decoding for streamversions < 7.
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/requant.h>
+#include <mpcdec/huffman.h>
+
+void
+mpc_decoder_init_huffman_sv6(mpc_decoder *d) 
+{
+    mpc_decoder_init_huffman_sv6_tables(d);
+    mpc_decoder_resort_huff_tables(16, d->Region_A      , 0);
+    mpc_decoder_resort_huff_tables( 8, d->Region_B      , 0);
+    mpc_decoder_resort_huff_tables( 4, d->Region_C      , 0);
+    mpc_decoder_resort_huff_tables( 8, d->SCFI_Bundle   , 0);
+    mpc_decoder_resort_huff_tables(13, d->DSCF_Entropie , 6);
+    mpc_decoder_resort_huff_tables( 3, d->Entropie_1    , Dc[1]);
+    mpc_decoder_resort_huff_tables( 5, d->Entropie_2    , Dc[2]);
+    mpc_decoder_resort_huff_tables( 7, d->Entropie_3    , Dc[3]);
+    mpc_decoder_resort_huff_tables( 9, d->Entropie_4    , Dc[4]);
+    mpc_decoder_resort_huff_tables(15, d->Entropie_5    , Dc[5]);
+    mpc_decoder_resort_huff_tables(31, d->Entropie_6    , Dc[6]);
+    mpc_decoder_resort_huff_tables(63, d->Entropie_7    , Dc[7]);
+}
+
+void 
+mpc_decoder_init_huffman_sv6_tables(mpc_decoder *d) 
+{
+    // SCFI-bundle
+    d->SCFI_Bundle[7].Code=  1; d->SCFI_Bundle[7].Length= 1;
+    d->SCFI_Bundle[3].Code=  1; d->SCFI_Bundle[3].Length= 2;
+    d->SCFI_Bundle[5].Code=  0; d->SCFI_Bundle[5].Length= 3;
+    d->SCFI_Bundle[1].Code=  7; d->SCFI_Bundle[1].Length= 5;
+    d->SCFI_Bundle[2].Code=  6; d->SCFI_Bundle[2].Length= 5;
+    d->SCFI_Bundle[4].Code=  4; d->SCFI_Bundle[4].Length= 5;
+    d->SCFI_Bundle[0].Code= 11; d->SCFI_Bundle[0].Length= 6;
+    d->SCFI_Bundle[6].Code= 10; d->SCFI_Bundle[6].Length= 6;
+
+    // region A (subbands  0..10)
+    d->Region_A[ 1].Code=    1; d->Region_A[ 1].Length=  1;
+    d->Region_A[ 2].Code=    0; d->Region_A[ 2].Length=  2;
+    d->Region_A[ 0].Code=    2; d->Region_A[ 0].Length=  3;
+    d->Region_A[ 3].Code=   15; d->Region_A[ 3].Length=  5;
+    d->Region_A[ 5].Code=   13; d->Region_A[ 5].Length=  5;
+    d->Region_A[ 6].Code=   12; d->Region_A[ 6].Length=  5;
+    d->Region_A[ 4].Code=   29; d->Region_A[ 4].Length=  6;
+    d->Region_A[ 7].Code=   57; d->Region_A[ 7].Length=  7;
+    d->Region_A[ 8].Code=  113; d->Region_A[ 8].Length=  8;
+    d->Region_A[ 9].Code=  225; d->Region_A[ 9].Length=  9;
+    d->Region_A[10].Code=  449; d->Region_A[10].Length= 10;
+    d->Region_A[11].Code=  897; d->Region_A[11].Length= 11;
+    d->Region_A[12].Code= 1793; d->Region_A[12].Length= 12;
+    d->Region_A[13].Code= 3585; d->Region_A[13].Length= 13;
+    d->Region_A[14].Code= 7169; d->Region_A[14].Length= 14;
+    d->Region_A[15].Code= 7168; d->Region_A[15].Length= 14;
+
+    // region B (subbands 11..22)
+    d->Region_B[1].Code= 1; d->Region_B[1].Length= 1;
+    d->Region_B[0].Code= 1; d->Region_B[0].Length= 2;
+    d->Region_B[2].Code= 1; d->Region_B[2].Length= 3;
+    d->Region_B[3].Code= 1; d->Region_B[3].Length= 4;
+    d->Region_B[4].Code= 1; d->Region_B[4].Length= 5;
+    d->Region_B[5].Code= 1; d->Region_B[5].Length= 6;
+    d->Region_B[6].Code= 1; d->Region_B[6].Length= 7;
+    d->Region_B[7].Code= 0; d->Region_B[7].Length= 7;
+
+    // region C (subbands 23..31)
+    d->Region_C[0].Code= 1; d->Region_C[0].Length= 1;
+    d->Region_C[1].Code= 1; d->Region_C[1].Length= 2;
+    d->Region_C[2].Code= 1; d->Region_C[2].Length= 3;
+    d->Region_C[3].Code= 0; d->Region_C[3].Length= 3;
+
+    // DSCF
+    d->DSCF_Entropie[ 6].Code=  0; d->DSCF_Entropie[ 6].Length= 2;
+    d->DSCF_Entropie[ 7].Code=  7; d->DSCF_Entropie[ 7].Length= 3;
+    d->DSCF_Entropie[ 5].Code=  4; d->DSCF_Entropie[ 5].Length= 3;
+    d->DSCF_Entropie[ 8].Code=  3; d->DSCF_Entropie[ 8].Length= 3;
+    d->DSCF_Entropie[ 9].Code= 13; d->DSCF_Entropie[ 9].Length= 4;
+    d->DSCF_Entropie[ 4].Code= 11; d->DSCF_Entropie[ 4].Length= 4;
+    d->DSCF_Entropie[10].Code= 10; d->DSCF_Entropie[10].Length= 4;
+    d->DSCF_Entropie[ 2].Code=  4; d->DSCF_Entropie[ 2].Length= 4;
+    d->DSCF_Entropie[11].Code= 25; d->DSCF_Entropie[11].Length= 5;
+    d->DSCF_Entropie[ 3].Code= 24; d->DSCF_Entropie[ 3].Length= 5;
+    d->DSCF_Entropie[ 1].Code= 11; d->DSCF_Entropie[ 1].Length= 5;
+    d->DSCF_Entropie[12].Code= 21; d->DSCF_Entropie[12].Length= 6;
+    d->DSCF_Entropie[ 0].Code= 20; d->DSCF_Entropie[ 0].Length= 6;
+
+    // first quantizer
+    d->Entropie_1[1].Code= 1; d->Entropie_1[1].Length= 1;
+    d->Entropie_1[0].Code= 1; d->Entropie_1[0].Length= 2;
+    d->Entropie_1[2].Code= 0; d->Entropie_1[2].Length= 2;
+
+    // second quantizer
+    d->Entropie_2[2].Code=  3; d->Entropie_2[2].Length= 2;
+    d->Entropie_2[3].Code=  1; d->Entropie_2[3].Length= 2;
+    d->Entropie_2[1].Code=  0; d->Entropie_2[1].Length= 2;
+    d->Entropie_2[4].Code=  5; d->Entropie_2[4].Length= 3;
+    d->Entropie_2[0].Code=  4; d->Entropie_2[0].Length= 3;
+
+    // third quantizer
+    d->Entropie_3[3].Code=  3; d->Entropie_3[3].Length= 2;
+    d->Entropie_3[2].Code=  1; d->Entropie_3[2].Length= 2;
+    d->Entropie_3[4].Code=  0; d->Entropie_3[4].Length= 2;
+    d->Entropie_3[1].Code=  5; d->Entropie_3[1].Length= 3;
+    d->Entropie_3[5].Code=  9; d->Entropie_3[5].Length= 4;
+    d->Entropie_3[0].Code= 17; d->Entropie_3[0].Length= 5;
+    d->Entropie_3[6].Code= 16; d->Entropie_3[6].Length= 5;
+
+    // forth quantizer
+    d->Entropie_4[4].Code=  0; d->Entropie_4[4].Length= 2;
+    d->Entropie_4[5].Code=  6; d->Entropie_4[5].Length= 3;
+    d->Entropie_4[3].Code=  5; d->Entropie_4[3].Length= 3;
+    d->Entropie_4[6].Code=  4; d->Entropie_4[6].Length= 3;
+    d->Entropie_4[2].Code=  3; d->Entropie_4[2].Length= 3;
+    d->Entropie_4[7].Code= 15; d->Entropie_4[7].Length= 4;
+    d->Entropie_4[1].Code= 14; d->Entropie_4[1].Length= 4;
+    d->Entropie_4[0].Code=  5; d->Entropie_4[0].Length= 4;
+    d->Entropie_4[8].Code=  4; d->Entropie_4[8].Length= 4;
+
+    // fifth quantizer
+    d->Entropie_5[7 ].Code=  4; d->Entropie_5[7 ].Length= 3;
+    d->Entropie_5[8 ].Code=  3; d->Entropie_5[8 ].Length= 3;
+    d->Entropie_5[6 ].Code=  2; d->Entropie_5[6 ].Length= 3;
+    d->Entropie_5[9 ].Code=  0; d->Entropie_5[9 ].Length= 3;
+    d->Entropie_5[5 ].Code= 15; d->Entropie_5[5 ].Length= 4;
+    d->Entropie_5[4 ].Code= 13; d->Entropie_5[4 ].Length= 4;
+    d->Entropie_5[10].Code= 12; d->Entropie_5[10].Length= 4;
+    d->Entropie_5[11].Code= 10; d->Entropie_5[11].Length= 4;
+    d->Entropie_5[3 ].Code=  3; d->Entropie_5[3 ].Length= 4;
+    d->Entropie_5[12].Code=  2; d->Entropie_5[12].Length= 4;
+    d->Entropie_5[2 ].Code= 29; d->Entropie_5[2 ].Length= 5;
+    d->Entropie_5[1 ].Code= 23; d->Entropie_5[1 ].Length= 5;
+    d->Entropie_5[13].Code= 22; d->Entropie_5[13].Length= 5;
+    d->Entropie_5[0 ].Code= 57; d->Entropie_5[0 ].Length= 6;
+    d->Entropie_5[14].Code= 56; d->Entropie_5[14].Length= 6;
+
+    // sixth quantizer
+    d->Entropie_6[15].Code=  9; d->Entropie_6[15].Length= 4;
+    d->Entropie_6[16].Code=  8; d->Entropie_6[16].Length= 4;
+    d->Entropie_6[14].Code=  7; d->Entropie_6[14].Length= 4;
+    d->Entropie_6[18].Code=  6; d->Entropie_6[18].Length= 4;
+    d->Entropie_6[17].Code=  5; d->Entropie_6[17].Length= 4;
+    d->Entropie_6[12].Code=  3; d->Entropie_6[12].Length= 4;
+    d->Entropie_6[13].Code=  2; d->Entropie_6[13].Length= 4;
+    d->Entropie_6[19].Code=  0; d->Entropie_6[19].Length= 4;
+    d->Entropie_6[11].Code= 31; d->Entropie_6[11].Length= 5;
+    d->Entropie_6[20].Code= 30; d->Entropie_6[20].Length= 5;
+    d->Entropie_6[10].Code= 29; d->Entropie_6[10].Length= 5;
+    d->Entropie_6[9 ].Code= 27; d->Entropie_6[9 ].Length= 5;
+    d->Entropie_6[21].Code= 26; d->Entropie_6[21].Length= 5;
+    d->Entropie_6[22].Code= 25; d->Entropie_6[22].Length= 5;
+    d->Entropie_6[8 ].Code= 24; d->Entropie_6[8 ].Length= 5;
+    d->Entropie_6[7 ].Code= 23; d->Entropie_6[7 ].Length= 5;
+    d->Entropie_6[23].Code= 21; d->Entropie_6[23].Length= 5;
+    d->Entropie_6[6 ].Code=  9; d->Entropie_6[6 ].Length= 5;
+    d->Entropie_6[24].Code=  3; d->Entropie_6[24].Length= 5;
+    d->Entropie_6[25].Code= 57; d->Entropie_6[25].Length= 6;
+    d->Entropie_6[5 ].Code= 56; d->Entropie_6[5 ].Length= 6;
+    d->Entropie_6[4 ].Code= 45; d->Entropie_6[4 ].Length= 6;
+    d->Entropie_6[26].Code= 41; d->Entropie_6[26].Length= 6;
+    d->Entropie_6[2 ].Code= 40; d->Entropie_6[2 ].Length= 6;
+    d->Entropie_6[27].Code= 17; d->Entropie_6[27].Length= 6;
+    d->Entropie_6[28].Code= 16; d->Entropie_6[28].Length= 6;
+    d->Entropie_6[3 ].Code=  5; d->Entropie_6[3 ].Length= 6;
+    d->Entropie_6[29].Code= 89; d->Entropie_6[29].Length= 7;
+    d->Entropie_6[1 ].Code= 88; d->Entropie_6[1 ].Length= 7;
+    d->Entropie_6[30].Code=  9; d->Entropie_6[30].Length= 7;
+    d->Entropie_6[0 ].Code=  8; d->Entropie_6[0 ].Length= 7;
+
+    // seventh quantizer
+    d->Entropie_7[25].Code=   0; d->Entropie_7[25].Length= 5;
+    d->Entropie_7[37].Code=   1; d->Entropie_7[37].Length= 5;
+    d->Entropie_7[62].Code=  16; d->Entropie_7[62].Length= 8;
+    d->Entropie_7[ 0].Code=  17; d->Entropie_7[ 0].Length= 8;
+    d->Entropie_7[ 3].Code=   9; d->Entropie_7[ 3].Length= 7;
+    d->Entropie_7[ 5].Code=  10; d->Entropie_7[ 5].Length= 7;
+    d->Entropie_7[ 6].Code=  11; d->Entropie_7[ 6].Length= 7;
+    d->Entropie_7[38].Code=   3; d->Entropie_7[38].Length= 5;
+    d->Entropie_7[35].Code=   4; d->Entropie_7[35].Length= 5;
+    d->Entropie_7[33].Code=   5; d->Entropie_7[33].Length= 5;
+    d->Entropie_7[24].Code=   6; d->Entropie_7[24].Length= 5;
+    d->Entropie_7[27].Code=   7; d->Entropie_7[27].Length= 5;
+    d->Entropie_7[26].Code=   8; d->Entropie_7[26].Length= 5;
+    d->Entropie_7[12].Code=  18; d->Entropie_7[12].Length= 6;
+    d->Entropie_7[50].Code=  19; d->Entropie_7[50].Length= 6;
+    d->Entropie_7[29].Code=  10; d->Entropie_7[29].Length= 5;
+    d->Entropie_7[31].Code=  11; d->Entropie_7[31].Length= 5;
+    d->Entropie_7[36].Code=  12; d->Entropie_7[36].Length= 5;
+    d->Entropie_7[34].Code=  13; d->Entropie_7[34].Length= 5;
+    d->Entropie_7[28].Code=  14; d->Entropie_7[28].Length= 5;
+    d->Entropie_7[49].Code=  30; d->Entropie_7[49].Length= 6;
+    d->Entropie_7[56].Code=  62; d->Entropie_7[56].Length= 7;
+    d->Entropie_7[ 7].Code=  63; d->Entropie_7[ 7].Length= 7;
+    d->Entropie_7[32].Code=  16; d->Entropie_7[32].Length= 5;
+    d->Entropie_7[30].Code=  17; d->Entropie_7[30].Length= 5;
+    d->Entropie_7[13].Code=  36; d->Entropie_7[13].Length= 6;
+    d->Entropie_7[55].Code=  74; d->Entropie_7[55].Length= 7;
+    d->Entropie_7[61].Code= 150; d->Entropie_7[61].Length= 8;
+    d->Entropie_7[ 1].Code= 151; d->Entropie_7[ 1].Length= 8;
+    d->Entropie_7[14].Code=  38; d->Entropie_7[14].Length= 6;
+    d->Entropie_7[48].Code=  39; d->Entropie_7[48].Length= 6;
+    d->Entropie_7[ 4].Code=  80; d->Entropie_7[ 4].Length= 7;
+    d->Entropie_7[58].Code=  81; d->Entropie_7[58].Length= 7;
+    d->Entropie_7[47].Code=  41; d->Entropie_7[47].Length= 6;
+    d->Entropie_7[15].Code=  42; d->Entropie_7[15].Length= 6;
+    d->Entropie_7[16].Code=  43; d->Entropie_7[16].Length= 6;
+    d->Entropie_7[54].Code=  88; d->Entropie_7[54].Length= 7;
+    d->Entropie_7[ 8].Code=  89; d->Entropie_7[ 8].Length= 7;
+    d->Entropie_7[17].Code=  45; d->Entropie_7[17].Length= 6;
+    d->Entropie_7[46].Code=  46; d->Entropie_7[46].Length= 6;
+    d->Entropie_7[45].Code=  47; d->Entropie_7[45].Length= 6;
+    d->Entropie_7[53].Code=  96; d->Entropie_7[53].Length= 7;
+    d->Entropie_7[ 9].Code=  97; d->Entropie_7[ 9].Length= 7;
+    d->Entropie_7[43].Code=  49; d->Entropie_7[43].Length= 6;
+    d->Entropie_7[19].Code=  50; d->Entropie_7[19].Length= 6;
+    d->Entropie_7[18].Code=  51; d->Entropie_7[18].Length= 6;
+    d->Entropie_7[44].Code=  52; d->Entropie_7[44].Length= 6;
+    d->Entropie_7[ 2].Code= 212; d->Entropie_7[ 2].Length= 8;
+    d->Entropie_7[60].Code= 213; d->Entropie_7[60].Length= 8;
+    d->Entropie_7[10].Code= 107; d->Entropie_7[10].Length= 7;
+    d->Entropie_7[42].Code=  54; d->Entropie_7[42].Length= 6;
+    d->Entropie_7[41].Code=  55; d->Entropie_7[41].Length= 6;
+    d->Entropie_7[20].Code=  56; d->Entropie_7[20].Length= 6;
+    d->Entropie_7[21].Code=  57; d->Entropie_7[21].Length= 6;
+    d->Entropie_7[52].Code= 116; d->Entropie_7[52].Length= 7;
+    d->Entropie_7[51].Code= 117; d->Entropie_7[51].Length= 7;
+    d->Entropie_7[40].Code=  59; d->Entropie_7[40].Length= 6;
+    d->Entropie_7[22].Code=  60; d->Entropie_7[22].Length= 6;
+    d->Entropie_7[23].Code=  61; d->Entropie_7[23].Length= 6;
+    d->Entropie_7[39].Code=  62; d->Entropie_7[39].Length= 6;
+    d->Entropie_7[11].Code= 126; d->Entropie_7[11].Length= 7;
+    d->Entropie_7[57].Code= 254; d->Entropie_7[57].Length= 8;
+    d->Entropie_7[59].Code= 255; d->Entropie_7[59].Length= 8;
+}
Index: /libmpcdec/tags/release-1.2.1/src/huffsv7.c
===================================================================
--- /libmpcdec/tags/release-1.2.1/src/huffsv7.c	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/src/huffsv7.c	(revision 30)
@@ -0,0 +1,500 @@
+/*
+  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 huffsv7.c
+/// Implementations of sv7 huffman decoding functions.
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/huffman.h>
+#include <mpcdec/requant.h>
+
+void
+mpc_decoder_init_huffman_sv7(mpc_decoder *d) 
+{
+    mpc_decoder_init_huffman_sv7_tables(d);
+    mpc_decoder_resort_huff_tables(10, &(d->HuffHdr[0])   , 5);
+    mpc_decoder_resort_huff_tables( 4, &(d->HuffSCFI[0])  , 0);
+    mpc_decoder_resort_huff_tables(16, &(d->HuffDSCF[0])  , 7);
+    mpc_decoder_resort_huff_tables(27, &(d->HuffQ1[0][0]) , 0);
+    mpc_decoder_resort_huff_tables(27, &(d->HuffQ1[1][0]) , 0);
+    mpc_decoder_resort_huff_tables(25, &(d->HuffQ2[0][0]) , 0);
+    mpc_decoder_resort_huff_tables(25, &(d->HuffQ2[1][0]) , 0);
+    mpc_decoder_resort_huff_tables( 7, &(d->HuffQ3[0][0]) , Dc[3]);
+    mpc_decoder_resort_huff_tables( 7, &(d->HuffQ3[1][0]) , Dc[3]);
+    mpc_decoder_resort_huff_tables( 9, &(d->HuffQ4[0][0]) , Dc[4]);
+    mpc_decoder_resort_huff_tables( 9, &(d->HuffQ4[1][0]) , Dc[4]);
+    mpc_decoder_resort_huff_tables(15, &(d->HuffQ5[0][0]) , Dc[5]);
+    mpc_decoder_resort_huff_tables(15, &(d->HuffQ5[1][0]) , Dc[5]);
+    mpc_decoder_resort_huff_tables(31, &(d->HuffQ6[0][0]) , Dc[6]);
+    mpc_decoder_resort_huff_tables(31, &(d->HuffQ6[1][0]) , Dc[6]);
+    mpc_decoder_resort_huff_tables(63, &(d->HuffQ7[0][0]) , Dc[7]);
+    mpc_decoder_resort_huff_tables(63, &(d->HuffQ7[1][0]) , Dc[7]);
+}
+
+void 
+mpc_decoder_init_huffman_sv7_tables(mpc_decoder *d) 
+{
+    /***************************** SCFI *******************************/
+    d->HuffSCFI[0].Code = 2; d->HuffSCFI[0].Length = 3;
+    d->HuffSCFI[1].Code = 1; d->HuffSCFI[1].Length = 1;
+    d->HuffSCFI[2].Code = 3; d->HuffSCFI[2].Length = 3;
+    d->HuffSCFI[3].Code = 0; d->HuffSCFI[3].Length = 2;
+
+    /***************************** DSCF *******************************/
+    d->HuffDSCF[ 0].Code = 32; d->HuffDSCF[ 0].Length = 6;
+    d->HuffDSCF[ 1].Code =  4; d->HuffDSCF[ 1].Length = 5;
+    d->HuffDSCF[ 2].Code = 17; d->HuffDSCF[ 2].Length = 5;
+    d->HuffDSCF[ 3].Code = 30; d->HuffDSCF[ 3].Length = 5;
+    d->HuffDSCF[ 4].Code = 13; d->HuffDSCF[ 4].Length = 4;
+    d->HuffDSCF[ 5].Code =  0; d->HuffDSCF[ 5].Length = 3;
+    d->HuffDSCF[ 6].Code =  3; d->HuffDSCF[ 6].Length = 3;
+    d->HuffDSCF[ 7].Code =  9; d->HuffDSCF[ 7].Length = 4;
+    d->HuffDSCF[ 8].Code =  5; d->HuffDSCF[ 8].Length = 3;
+    d->HuffDSCF[ 9].Code =  2; d->HuffDSCF[ 9].Length = 3;
+    d->HuffDSCF[10].Code = 14; d->HuffDSCF[10].Length = 4;
+    d->HuffDSCF[11].Code =  3; d->HuffDSCF[11].Length = 4;
+    d->HuffDSCF[12].Code = 31; d->HuffDSCF[12].Length = 5;
+    d->HuffDSCF[13].Code =  5; d->HuffDSCF[13].Length = 5;
+    d->HuffDSCF[14].Code = 33; d->HuffDSCF[14].Length = 6;
+    d->HuffDSCF[15].Code = 12; d->HuffDSCF[15].Length = 4;
+
+    /************************* frame-header ***************************/
+    /***************** differential quantizer indizes *****************/
+    d->HuffHdr[0].Code =  92; d->HuffHdr[0].Length = 8;
+    d->HuffHdr[1].Code =  47; d->HuffHdr[1].Length = 7;
+    d->HuffHdr[2].Code =  10; d->HuffHdr[2].Length = 5;
+    d->HuffHdr[3].Code =   4; d->HuffHdr[3].Length = 4;
+    d->HuffHdr[4].Code =   0; d->HuffHdr[4].Length = 2;
+    d->HuffHdr[5].Code =   1; d->HuffHdr[5].Length = 1;
+    d->HuffHdr[6].Code =   3; d->HuffHdr[6].Length = 3;
+    d->HuffHdr[7].Code =  22; d->HuffHdr[7].Length = 6;
+    d->HuffHdr[8].Code = 187; d->HuffHdr[8].Length = 9;
+    d->HuffHdr[9].Code = 186; d->HuffHdr[9].Length = 9;
+
+    /********************** 3-step quantizer **************************/
+    /********************* 3 bundled samples **************************/
+    //less shaped, book 0
+    d->HuffQ1[0][ 0].Code = 54; d->HuffQ1[0][ 0].Length = 6;
+    d->HuffQ1[0][ 1].Code =  9; d->HuffQ1[0][ 1].Length = 5;
+    d->HuffQ1[0][ 2].Code = 32; d->HuffQ1[0][ 2].Length = 6;
+    d->HuffQ1[0][ 3].Code =  5; d->HuffQ1[0][ 3].Length = 5;
+    d->HuffQ1[0][ 4].Code = 10; d->HuffQ1[0][ 4].Length = 4;
+    d->HuffQ1[0][ 5].Code =  7; d->HuffQ1[0][ 5].Length = 5;
+    d->HuffQ1[0][ 6].Code = 52; d->HuffQ1[0][ 6].Length = 6;
+    d->HuffQ1[0][ 7].Code =  0; d->HuffQ1[0][ 7].Length = 5;
+    d->HuffQ1[0][ 8].Code = 35; d->HuffQ1[0][ 8].Length = 6;
+    d->HuffQ1[0][ 9].Code = 10; d->HuffQ1[0][ 9].Length = 5;
+    d->HuffQ1[0][10].Code =  6; d->HuffQ1[0][10].Length = 4;
+    d->HuffQ1[0][11].Code =  4; d->HuffQ1[0][11].Length = 5;
+    d->HuffQ1[0][12].Code = 11; d->HuffQ1[0][12].Length = 4;
+    d->HuffQ1[0][13].Code =  7; d->HuffQ1[0][13].Length = 3;
+    d->HuffQ1[0][14].Code = 12; d->HuffQ1[0][14].Length = 4;
+    d->HuffQ1[0][15].Code =  3; d->HuffQ1[0][15].Length = 5;
+    d->HuffQ1[0][16].Code =  7; d->HuffQ1[0][16].Length = 4;
+    d->HuffQ1[0][17].Code = 11; d->HuffQ1[0][17].Length = 5;
+    d->HuffQ1[0][18].Code = 34; d->HuffQ1[0][18].Length = 6;
+    d->HuffQ1[0][19].Code =  1; d->HuffQ1[0][19].Length = 5;
+    d->HuffQ1[0][20].Code = 53; d->HuffQ1[0][20].Length = 6;
+    d->HuffQ1[0][21].Code =  6; d->HuffQ1[0][21].Length = 5;
+    d->HuffQ1[0][22].Code =  9; d->HuffQ1[0][22].Length = 4;
+    d->HuffQ1[0][23].Code =  2; d->HuffQ1[0][23].Length = 5;
+    d->HuffQ1[0][24].Code = 33; d->HuffQ1[0][24].Length = 6;
+    d->HuffQ1[0][25].Code =  8; d->HuffQ1[0][25].Length = 5;
+    d->HuffQ1[0][26].Code = 55; d->HuffQ1[0][26].Length = 6;
+
+    //more shaped, book 1
+    d->HuffQ1[1][ 0].Code = 103; d->HuffQ1[1][ 0].Length = 8;
+    d->HuffQ1[1][ 1].Code =  62; d->HuffQ1[1][ 1].Length = 7;
+    d->HuffQ1[1][ 2].Code = 225; d->HuffQ1[1][ 2].Length = 9;
+    d->HuffQ1[1][ 3].Code =  55; d->HuffQ1[1][ 3].Length = 7;
+    d->HuffQ1[1][ 4].Code =   3; d->HuffQ1[1][ 4].Length = 4;
+    d->HuffQ1[1][ 5].Code =  52; d->HuffQ1[1][ 5].Length = 7;
+    d->HuffQ1[1][ 6].Code = 101; d->HuffQ1[1][ 6].Length = 8;
+    d->HuffQ1[1][ 7].Code =  60; d->HuffQ1[1][ 7].Length = 7;
+    d->HuffQ1[1][ 8].Code = 227; d->HuffQ1[1][ 8].Length = 9;
+    d->HuffQ1[1][ 9].Code =  24; d->HuffQ1[1][ 9].Length = 6;
+    d->HuffQ1[1][10].Code =   0; d->HuffQ1[1][10].Length = 4;
+    d->HuffQ1[1][11].Code =  61; d->HuffQ1[1][11].Length = 7;
+    d->HuffQ1[1][12].Code =   4; d->HuffQ1[1][12].Length = 4;
+    d->HuffQ1[1][13].Code =   1; d->HuffQ1[1][13].Length = 1;
+    d->HuffQ1[1][14].Code =   5; d->HuffQ1[1][14].Length = 4;
+    d->HuffQ1[1][15].Code =  63; d->HuffQ1[1][15].Length = 7;
+    d->HuffQ1[1][16].Code =   1; d->HuffQ1[1][16].Length = 4;
+    d->HuffQ1[1][17].Code =  59; d->HuffQ1[1][17].Length = 7;
+    d->HuffQ1[1][18].Code = 226; d->HuffQ1[1][18].Length = 9;
+    d->HuffQ1[1][19].Code =  57; d->HuffQ1[1][19].Length = 7;
+    d->HuffQ1[1][20].Code = 100; d->HuffQ1[1][20].Length = 8;
+    d->HuffQ1[1][21].Code =  53; d->HuffQ1[1][21].Length = 7;
+    d->HuffQ1[1][22].Code =   2; d->HuffQ1[1][22].Length = 4;
+    d->HuffQ1[1][23].Code =  54; d->HuffQ1[1][23].Length = 7;
+    d->HuffQ1[1][24].Code = 224; d->HuffQ1[1][24].Length = 9;
+    d->HuffQ1[1][25].Code =  58; d->HuffQ1[1][25].Length = 7;
+    d->HuffQ1[1][26].Code = 102; d->HuffQ1[1][26].Length = 8;
+
+    /********************** 5-step quantizer **************************/
+    /********************* 2 bundled samples **************************/
+    //less shaped, book 0
+    d->HuffQ2[0][ 0].Code =  89; d->HuffQ2[0][ 0].Length = 7;
+    d->HuffQ2[0][ 1].Code =  47; d->HuffQ2[0][ 1].Length = 6;
+    d->HuffQ2[0][ 2].Code =  15; d->HuffQ2[0][ 2].Length = 5;
+    d->HuffQ2[0][ 3].Code =   0; d->HuffQ2[0][ 3].Length = 5;
+    d->HuffQ2[0][ 4].Code =  91; d->HuffQ2[0][ 4].Length = 7;
+    d->HuffQ2[0][ 5].Code =   4; d->HuffQ2[0][ 5].Length = 5;
+    d->HuffQ2[0][ 6].Code =   6; d->HuffQ2[0][ 6].Length = 4;
+    d->HuffQ2[0][ 7].Code =  13; d->HuffQ2[0][ 7].Length = 4;
+    d->HuffQ2[0][ 8].Code =   4; d->HuffQ2[0][ 8].Length = 4;
+    d->HuffQ2[0][ 9].Code =   5; d->HuffQ2[0][ 9].Length = 5;
+    d->HuffQ2[0][10].Code =  20; d->HuffQ2[0][10].Length = 5;
+    d->HuffQ2[0][11].Code =  12; d->HuffQ2[0][11].Length = 4;
+    d->HuffQ2[0][12].Code =   4; d->HuffQ2[0][12].Length = 3;
+    d->HuffQ2[0][13].Code =  15; d->HuffQ2[0][13].Length = 4;
+    d->HuffQ2[0][14].Code =  14; d->HuffQ2[0][14].Length = 5;
+    d->HuffQ2[0][15].Code =   3; d->HuffQ2[0][15].Length = 5;
+    d->HuffQ2[0][16].Code =   3; d->HuffQ2[0][16].Length = 4;
+    d->HuffQ2[0][17].Code =  14; d->HuffQ2[0][17].Length = 4;
+    d->HuffQ2[0][18].Code =   5; d->HuffQ2[0][18].Length = 4;
+    d->HuffQ2[0][19].Code =   1; d->HuffQ2[0][19].Length = 5;
+    d->HuffQ2[0][20].Code =  90; d->HuffQ2[0][20].Length = 7;
+    d->HuffQ2[0][21].Code =   2; d->HuffQ2[0][21].Length = 5;
+    d->HuffQ2[0][22].Code =  21; d->HuffQ2[0][22].Length = 5;
+    d->HuffQ2[0][23].Code =  46; d->HuffQ2[0][23].Length = 6;
+    d->HuffQ2[0][24].Code =  88; d->HuffQ2[0][24].Length = 7;
+
+    //more shaped, book 1
+    d->HuffQ2[1][ 0].Code =  921; d->HuffQ2[1][ 0].Length = 10;
+    d->HuffQ2[1][ 1].Code =  113; d->HuffQ2[1][ 1].Length =  7;
+    d->HuffQ2[1][ 2].Code =   51; d->HuffQ2[1][ 2].Length =  6;
+    d->HuffQ2[1][ 3].Code =  231; d->HuffQ2[1][ 3].Length =  8;
+    d->HuffQ2[1][ 4].Code =  922; d->HuffQ2[1][ 4].Length = 10;
+    d->HuffQ2[1][ 5].Code =  104; d->HuffQ2[1][ 5].Length =  7;
+    d->HuffQ2[1][ 6].Code =   30; d->HuffQ2[1][ 6].Length =  5;
+    d->HuffQ2[1][ 7].Code =    0; d->HuffQ2[1][ 7].Length =  3;
+    d->HuffQ2[1][ 8].Code =   29; d->HuffQ2[1][ 8].Length =  5;
+    d->HuffQ2[1][ 9].Code =  105; d->HuffQ2[1][ 9].Length =  7;
+    d->HuffQ2[1][10].Code =   50; d->HuffQ2[1][10].Length =  6;
+    d->HuffQ2[1][11].Code =    1; d->HuffQ2[1][11].Length =  3;
+    d->HuffQ2[1][12].Code =    2; d->HuffQ2[1][12].Length =  2;
+    d->HuffQ2[1][13].Code =    3; d->HuffQ2[1][13].Length =  3;
+    d->HuffQ2[1][14].Code =   49; d->HuffQ2[1][14].Length =  6;
+    d->HuffQ2[1][15].Code =  107; d->HuffQ2[1][15].Length =  7;
+    d->HuffQ2[1][16].Code =   27; d->HuffQ2[1][16].Length =  5;
+    d->HuffQ2[1][17].Code =    2; d->HuffQ2[1][17].Length =  3;
+    d->HuffQ2[1][18].Code =   31; d->HuffQ2[1][18].Length =  5;
+    d->HuffQ2[1][19].Code =  112; d->HuffQ2[1][19].Length =  7;
+    d->HuffQ2[1][20].Code =  920; d->HuffQ2[1][20].Length = 10;
+    d->HuffQ2[1][21].Code =  106; d->HuffQ2[1][21].Length =  7;
+    d->HuffQ2[1][22].Code =   48; d->HuffQ2[1][22].Length =  6;
+    d->HuffQ2[1][23].Code =  114; d->HuffQ2[1][23].Length =  7;
+    d->HuffQ2[1][24].Code =  923; d->HuffQ2[1][24].Length = 10;
+
+    /********************** 7-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ3[0][0].Code = 12; d->HuffQ3[0][0].Length = 4;
+    d->HuffQ3[0][1].Code =  4; d->HuffQ3[0][1].Length = 3;
+    d->HuffQ3[0][2].Code =  0; d->HuffQ3[0][2].Length = 2;
+    d->HuffQ3[0][3].Code =  1; d->HuffQ3[0][3].Length = 2;
+    d->HuffQ3[0][4].Code =  7; d->HuffQ3[0][4].Length = 3;
+    d->HuffQ3[0][5].Code =  5; d->HuffQ3[0][5].Length = 3;
+    d->HuffQ3[0][6].Code = 13; d->HuffQ3[0][6].Length = 4;
+
+    //more shaped, book 1
+    d->HuffQ3[1][0].Code = 4; d->HuffQ3[1][0].Length = 5;
+    d->HuffQ3[1][1].Code = 3; d->HuffQ3[1][1].Length = 4;
+    d->HuffQ3[1][2].Code = 2; d->HuffQ3[1][2].Length = 2;
+    d->HuffQ3[1][3].Code = 3; d->HuffQ3[1][3].Length = 2;
+    d->HuffQ3[1][4].Code = 1; d->HuffQ3[1][4].Length = 2;
+    d->HuffQ3[1][5].Code = 0; d->HuffQ3[1][5].Length = 3;
+    d->HuffQ3[1][6].Code = 5; d->HuffQ3[1][6].Length = 5;
+
+    /********************** 9-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ4[0][0].Code = 5; d->HuffQ4[0][0].Length = 4;
+    d->HuffQ4[0][1].Code = 0; d->HuffQ4[0][1].Length = 3;
+    d->HuffQ4[0][2].Code = 4; d->HuffQ4[0][2].Length = 3;
+    d->HuffQ4[0][3].Code = 6; d->HuffQ4[0][3].Length = 3;
+    d->HuffQ4[0][4].Code = 7; d->HuffQ4[0][4].Length = 3;
+    d->HuffQ4[0][5].Code = 5; d->HuffQ4[0][5].Length = 3;
+    d->HuffQ4[0][6].Code = 3; d->HuffQ4[0][6].Length = 3;
+    d->HuffQ4[0][7].Code = 1; d->HuffQ4[0][7].Length = 3;
+    d->HuffQ4[0][8].Code = 4; d->HuffQ4[0][8].Length = 4;
+
+    //more shaped, book 1
+    d->HuffQ4[1][0].Code =  9; d->HuffQ4[1][0].Length = 5;
+    d->HuffQ4[1][1].Code = 12; d->HuffQ4[1][1].Length = 4;
+    d->HuffQ4[1][2].Code =  3; d->HuffQ4[1][2].Length = 3;
+    d->HuffQ4[1][3].Code =  0; d->HuffQ4[1][3].Length = 2;
+    d->HuffQ4[1][4].Code =  2; d->HuffQ4[1][4].Length = 2;
+    d->HuffQ4[1][5].Code =  7; d->HuffQ4[1][5].Length = 3;
+    d->HuffQ4[1][6].Code = 13; d->HuffQ4[1][6].Length = 4;
+    d->HuffQ4[1][7].Code =  5; d->HuffQ4[1][7].Length = 4;
+    d->HuffQ4[1][8].Code =  8; d->HuffQ4[1][8].Length = 5;
+
+    /********************* 15-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ5[0][ 0].Code = 57; d->HuffQ5[0][ 0].Length = 6;
+    d->HuffQ5[0][ 1].Code = 23; d->HuffQ5[0][ 1].Length = 5;
+    d->HuffQ5[0][ 2].Code =  8; d->HuffQ5[0][ 2].Length = 4;
+    d->HuffQ5[0][ 3].Code = 10; d->HuffQ5[0][ 3].Length = 4;
+    d->HuffQ5[0][ 4].Code = 13; d->HuffQ5[0][ 4].Length = 4;
+    d->HuffQ5[0][ 5].Code =  0; d->HuffQ5[0][ 5].Length = 3;
+    d->HuffQ5[0][ 6].Code =  2; d->HuffQ5[0][ 6].Length = 3;
+    d->HuffQ5[0][ 7].Code =  3; d->HuffQ5[0][ 7].Length = 3;
+    d->HuffQ5[0][ 8].Code =  1; d->HuffQ5[0][ 8].Length = 3;
+    d->HuffQ5[0][ 9].Code = 15; d->HuffQ5[0][ 9].Length = 4;
+    d->HuffQ5[0][10].Code = 12; d->HuffQ5[0][10].Length = 4;
+    d->HuffQ5[0][11].Code =  9; d->HuffQ5[0][11].Length = 4;
+    d->HuffQ5[0][12].Code = 29; d->HuffQ5[0][12].Length = 5;
+    d->HuffQ5[0][13].Code = 22; d->HuffQ5[0][13].Length = 5;
+    d->HuffQ5[0][14].Code = 56; d->HuffQ5[0][14].Length = 6;
+
+    //more shaped, book 1
+    d->HuffQ5[1][ 0].Code = 229; d->HuffQ5[1][ 0].Length = 8;
+    d->HuffQ5[1][ 1].Code =  56; d->HuffQ5[1][ 1].Length = 6;
+    d->HuffQ5[1][ 2].Code =   7; d->HuffQ5[1][ 2].Length = 5;
+    d->HuffQ5[1][ 3].Code =   2; d->HuffQ5[1][ 3].Length = 4;
+    d->HuffQ5[1][ 4].Code =   0; d->HuffQ5[1][ 4].Length = 3;
+    d->HuffQ5[1][ 5].Code =   3; d->HuffQ5[1][ 5].Length = 3;
+    d->HuffQ5[1][ 6].Code =   5; d->HuffQ5[1][ 6].Length = 3;
+    d->HuffQ5[1][ 7].Code =   6; d->HuffQ5[1][ 7].Length = 3;
+    d->HuffQ5[1][ 8].Code =   4; d->HuffQ5[1][ 8].Length = 3;
+    d->HuffQ5[1][ 9].Code =   2; d->HuffQ5[1][ 9].Length = 3;
+    d->HuffQ5[1][10].Code =  15; d->HuffQ5[1][10].Length = 4;
+    d->HuffQ5[1][11].Code =  29; d->HuffQ5[1][11].Length = 5;
+    d->HuffQ5[1][12].Code =   6; d->HuffQ5[1][12].Length = 5;
+    d->HuffQ5[1][13].Code = 115; d->HuffQ5[1][13].Length = 7;
+    d->HuffQ5[1][14].Code = 228; d->HuffQ5[1][14].Length = 8;
+
+    /********************* 31-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ6[0][ 0].Code =  65; d->HuffQ6[0][ 0].Length = 7;
+    d->HuffQ6[0][ 1].Code =   6; d->HuffQ6[0][ 1].Length = 6;
+    d->HuffQ6[0][ 2].Code =  44; d->HuffQ6[0][ 2].Length = 6;
+    d->HuffQ6[0][ 3].Code =  45; d->HuffQ6[0][ 3].Length = 6;
+    d->HuffQ6[0][ 4].Code =  59; d->HuffQ6[0][ 4].Length = 6;
+    d->HuffQ6[0][ 5].Code =  13; d->HuffQ6[0][ 5].Length = 5;
+    d->HuffQ6[0][ 6].Code =  17; d->HuffQ6[0][ 6].Length = 5;
+    d->HuffQ6[0][ 7].Code =  19; d->HuffQ6[0][ 7].Length = 5;
+    d->HuffQ6[0][ 8].Code =  23; d->HuffQ6[0][ 8].Length = 5;
+    d->HuffQ6[0][ 9].Code =  21; d->HuffQ6[0][ 9].Length = 5;
+    d->HuffQ6[0][10].Code =  26; d->HuffQ6[0][10].Length = 5;
+    d->HuffQ6[0][11].Code =  30; d->HuffQ6[0][11].Length = 5;
+    d->HuffQ6[0][12].Code =   0; d->HuffQ6[0][12].Length = 4;
+    d->HuffQ6[0][13].Code =   2; d->HuffQ6[0][13].Length = 4;
+    d->HuffQ6[0][14].Code =   5; d->HuffQ6[0][14].Length = 4;
+    d->HuffQ6[0][15].Code =   7; d->HuffQ6[0][15].Length = 4;
+    d->HuffQ6[0][16].Code =   3; d->HuffQ6[0][16].Length = 4;
+    d->HuffQ6[0][17].Code =   4; d->HuffQ6[0][17].Length = 4;
+    d->HuffQ6[0][18].Code =  31; d->HuffQ6[0][18].Length = 5;
+    d->HuffQ6[0][19].Code =  28; d->HuffQ6[0][19].Length = 5;
+    d->HuffQ6[0][20].Code =  25; d->HuffQ6[0][20].Length = 5;
+    d->HuffQ6[0][21].Code =  27; d->HuffQ6[0][21].Length = 5;
+    d->HuffQ6[0][22].Code =  24; d->HuffQ6[0][22].Length = 5;
+    d->HuffQ6[0][23].Code =  20; d->HuffQ6[0][23].Length = 5;
+    d->HuffQ6[0][24].Code =  18; d->HuffQ6[0][24].Length = 5;
+    d->HuffQ6[0][25].Code =  12; d->HuffQ6[0][25].Length = 5;
+    d->HuffQ6[0][26].Code =   2; d->HuffQ6[0][26].Length = 5;
+    d->HuffQ6[0][27].Code =  58; d->HuffQ6[0][27].Length = 6;
+    d->HuffQ6[0][28].Code =  33; d->HuffQ6[0][28].Length = 6;
+    d->HuffQ6[0][29].Code =   7; d->HuffQ6[0][29].Length = 6;
+    d->HuffQ6[0][30].Code =  64; d->HuffQ6[0][30].Length = 7;
+
+    //more shaped, book 1
+    d->HuffQ6[1][ 0].Code = 6472; d->HuffQ6[1][ 0].Length = 13;
+    d->HuffQ6[1][ 1].Code = 6474; d->HuffQ6[1][ 1].Length = 13;
+    d->HuffQ6[1][ 2].Code =  808; d->HuffQ6[1][ 2].Length = 10;
+    d->HuffQ6[1][ 3].Code =  405; d->HuffQ6[1][ 3].Length =  9;
+    d->HuffQ6[1][ 4].Code =  203; d->HuffQ6[1][ 4].Length =  8;
+    d->HuffQ6[1][ 5].Code =  102; d->HuffQ6[1][ 5].Length =  7;
+    d->HuffQ6[1][ 6].Code =   49; d->HuffQ6[1][ 6].Length =  6;
+    d->HuffQ6[1][ 7].Code =    9; d->HuffQ6[1][ 7].Length =  5;
+    d->HuffQ6[1][ 8].Code =   15; d->HuffQ6[1][ 8].Length =  5;
+    d->HuffQ6[1][ 9].Code =   31; d->HuffQ6[1][ 9].Length =  5;
+    d->HuffQ6[1][10].Code =    2; d->HuffQ6[1][10].Length =  4;
+    d->HuffQ6[1][11].Code =    6; d->HuffQ6[1][11].Length =  4;
+    d->HuffQ6[1][12].Code =    8; d->HuffQ6[1][12].Length =  4;
+    d->HuffQ6[1][13].Code =   11; d->HuffQ6[1][13].Length =  4;
+    d->HuffQ6[1][14].Code =   13; d->HuffQ6[1][14].Length =  4;
+    d->HuffQ6[1][15].Code =    0; d->HuffQ6[1][15].Length =  3;
+    d->HuffQ6[1][16].Code =   14; d->HuffQ6[1][16].Length =  4;
+    d->HuffQ6[1][17].Code =   10; d->HuffQ6[1][17].Length =  4;
+    d->HuffQ6[1][18].Code =    9; d->HuffQ6[1][18].Length =  4;
+    d->HuffQ6[1][19].Code =    5; d->HuffQ6[1][19].Length =  4;
+    d->HuffQ6[1][20].Code =    3; d->HuffQ6[1][20].Length =  4;
+    d->HuffQ6[1][21].Code =   30; d->HuffQ6[1][21].Length =  5;
+    d->HuffQ6[1][22].Code =   14; d->HuffQ6[1][22].Length =  5;
+    d->HuffQ6[1][23].Code =    8; d->HuffQ6[1][23].Length =  5;
+    d->HuffQ6[1][24].Code =   48; d->HuffQ6[1][24].Length =  6;
+    d->HuffQ6[1][25].Code =  103; d->HuffQ6[1][25].Length =  7;
+    d->HuffQ6[1][26].Code =  201; d->HuffQ6[1][26].Length =  8;
+    d->HuffQ6[1][27].Code =  200; d->HuffQ6[1][27].Length =  8;
+    d->HuffQ6[1][28].Code = 1619; d->HuffQ6[1][28].Length = 11;
+    d->HuffQ6[1][29].Code = 6473; d->HuffQ6[1][29].Length = 13;
+    d->HuffQ6[1][30].Code = 6475; d->HuffQ6[1][30].Length = 13;
+
+    /********************* 63-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ7[0][ 0].Code = 103; d->HuffQ7[0][ 0].Length = 8;    /* 0.003338  -          01100111  */
+    d->HuffQ7[0][ 1].Code = 153; d->HuffQ7[0][ 1].Length = 8;    /* 0.003766  -          10011001  */
+    d->HuffQ7[0][ 2].Code = 181; d->HuffQ7[0][ 2].Length = 8;    /* 0.004715  -          10110101  */
+    d->HuffQ7[0][ 3].Code = 233; d->HuffQ7[0][ 3].Length = 8;    /* 0.005528  -          11101001  */
+    d->HuffQ7[0][ 4].Code =  64; d->HuffQ7[0][ 4].Length = 7;    /* 0.006677  -           1000000  */
+    d->HuffQ7[0][ 5].Code =  65; d->HuffQ7[0][ 5].Length = 7;    /* 0.007041  -           1000001  */
+    d->HuffQ7[0][ 6].Code =  77; d->HuffQ7[0][ 6].Length = 7;    /* 0.007733  -           1001101  */
+    d->HuffQ7[0][ 7].Code =  81; d->HuffQ7[0][ 7].Length = 7;    /* 0.008296  -           1010001  */
+    d->HuffQ7[0][ 8].Code =  91; d->HuffQ7[0][ 8].Length = 7;    /* 0.009295  -           1011011  */
+    d->HuffQ7[0][ 9].Code = 113; d->HuffQ7[0][ 9].Length = 7;    /* 0.010814  -           1110001  */
+    d->HuffQ7[0][10].Code = 112; d->HuffQ7[0][10].Length = 7;    /* 0.010807  -           1110000  */
+    d->HuffQ7[0][11].Code =  24; d->HuffQ7[0][11].Length = 6;    /* 0.012748  -            011000  */
+    d->HuffQ7[0][12].Code =  29; d->HuffQ7[0][12].Length = 6;    /* 0.013390  -            011101  */
+    d->HuffQ7[0][13].Code =  35; d->HuffQ7[0][13].Length = 6;    /* 0.014224  -            100011  */
+    d->HuffQ7[0][14].Code =  37; d->HuffQ7[0][14].Length = 6;    /* 0.015201  -            100101  */
+    d->HuffQ7[0][15].Code =  41; d->HuffQ7[0][15].Length = 6;    /* 0.016642  -            101001  */
+    d->HuffQ7[0][16].Code =  44; d->HuffQ7[0][16].Length = 6;    /* 0.017292  -            101100  */
+    d->HuffQ7[0][17].Code =  46; d->HuffQ7[0][17].Length = 6;    /* 0.018647  -            101110  */
+    d->HuffQ7[0][18].Code =  51; d->HuffQ7[0][18].Length = 6;    /* 0.020473  -            110011  */
+    d->HuffQ7[0][19].Code =  49; d->HuffQ7[0][19].Length = 6;    /* 0.020152  -            110001  */
+    d->HuffQ7[0][20].Code =  54; d->HuffQ7[0][20].Length = 6;    /* 0.021315  -            110110  */
+    d->HuffQ7[0][21].Code =  55; d->HuffQ7[0][21].Length = 6;    /* 0.021358  -            110111  */
+    d->HuffQ7[0][22].Code =  57; d->HuffQ7[0][22].Length = 6;    /* 0.021700  -            111001  */
+    d->HuffQ7[0][23].Code =  60; d->HuffQ7[0][23].Length = 6;    /* 0.022449  -            111100  */
+    d->HuffQ7[0][24].Code =   0; d->HuffQ7[0][24].Length = 5;    /* 0.023063  -             00000  */
+    d->HuffQ7[0][25].Code =   2; d->HuffQ7[0][25].Length = 5;    /* 0.023854  -             00010  */
+    d->HuffQ7[0][26].Code =  10; d->HuffQ7[0][26].Length = 5;    /* 0.025481  -             01010  */
+    d->HuffQ7[0][27].Code =   5; d->HuffQ7[0][27].Length = 5;    /* 0.024867  -             00101  */
+    d->HuffQ7[0][28].Code =   9; d->HuffQ7[0][28].Length = 5;    /* 0.025352  -             01001  */
+    d->HuffQ7[0][29].Code =   6; d->HuffQ7[0][29].Length = 5;    /* 0.025074  -             00110  */
+    d->HuffQ7[0][30].Code =  13; d->HuffQ7[0][30].Length = 5;    /* 0.025745  -             01101  */
+    d->HuffQ7[0][31].Code =   7; d->HuffQ7[0][31].Length = 5;    /* 0.025195  -             00111  */
+    d->HuffQ7[0][32].Code =  11; d->HuffQ7[0][32].Length = 5;    /* 0.025502  -             01011  */
+    d->HuffQ7[0][33].Code =  15; d->HuffQ7[0][33].Length = 5;    /* 0.026251  -             01111  */
+    d->HuffQ7[0][34].Code =   8; d->HuffQ7[0][34].Length = 5;    /* 0.025260  -             01000  */
+    d->HuffQ7[0][35].Code =   4; d->HuffQ7[0][35].Length = 5;    /* 0.024418  -             00100  */
+    d->HuffQ7[0][36].Code =   3; d->HuffQ7[0][36].Length = 5;    /* 0.023983  -             00011  */
+    d->HuffQ7[0][37].Code =   1; d->HuffQ7[0][37].Length = 5;    /* 0.023697  -             00001  */
+    d->HuffQ7[0][38].Code =  63; d->HuffQ7[0][38].Length = 6;    /* 0.023041  -            111111  */
+    d->HuffQ7[0][39].Code =  62; d->HuffQ7[0][39].Length = 6;    /* 0.022656  -            111110  */
+    d->HuffQ7[0][40].Code =  61; d->HuffQ7[0][40].Length = 6;    /* 0.022549  -            111101  */
+    d->HuffQ7[0][41].Code =  53; d->HuffQ7[0][41].Length = 6;    /* 0.021151  -            110101  */
+    d->HuffQ7[0][42].Code =  59; d->HuffQ7[0][42].Length = 6;    /* 0.022042  -            111011  */
+    d->HuffQ7[0][43].Code =  52; d->HuffQ7[0][43].Length = 6;    /* 0.020837  -            110100  */
+    d->HuffQ7[0][44].Code =  48; d->HuffQ7[0][44].Length = 6;    /* 0.019446  -            110000  */
+    d->HuffQ7[0][45].Code =  47; d->HuffQ7[0][45].Length = 6;    /* 0.019189  -            101111  */
+    d->HuffQ7[0][46].Code =  43; d->HuffQ7[0][46].Length = 6;    /* 0.017177  -            101011  */
+    d->HuffQ7[0][47].Code =  42; d->HuffQ7[0][47].Length = 6;    /* 0.017035  -            101010  */
+    d->HuffQ7[0][48].Code =  39; d->HuffQ7[0][48].Length = 6;    /* 0.015287  -            100111  */
+    d->HuffQ7[0][49].Code =  36; d->HuffQ7[0][49].Length = 6;    /* 0.014559  -            100100  */
+    d->HuffQ7[0][50].Code =  33; d->HuffQ7[0][50].Length = 6;    /* 0.014117  -            100001  */
+    d->HuffQ7[0][51].Code =  28; d->HuffQ7[0][51].Length = 6;    /* 0.012776  -            011100  */
+    d->HuffQ7[0][52].Code = 117; d->HuffQ7[0][52].Length = 7;    /* 0.011107  -           1110101  */
+    d->HuffQ7[0][53].Code = 101; d->HuffQ7[0][53].Length = 7;    /* 0.010636  -           1100101  */
+    d->HuffQ7[0][54].Code = 100; d->HuffQ7[0][54].Length = 7;    /* 0.009751  -           1100100  */
+    d->HuffQ7[0][55].Code =  80; d->HuffQ7[0][55].Length = 7;    /* 0.008132  -           1010000  */
+    d->HuffQ7[0][56].Code =  69; d->HuffQ7[0][56].Length = 7;    /* 0.007091  -           1000101  */
+    d->HuffQ7[0][57].Code =  68; d->HuffQ7[0][57].Length = 7;    /* 0.007084  -           1000100  */
+    d->HuffQ7[0][58].Code =  50; d->HuffQ7[0][58].Length = 7;    /* 0.006277  -           0110010  */
+    d->HuffQ7[0][59].Code = 232; d->HuffQ7[0][59].Length = 8;    /* 0.005386  -          11101000  */
+    d->HuffQ7[0][60].Code = 180; d->HuffQ7[0][60].Length = 8;    /* 0.004408  -          10110100  */
+    d->HuffQ7[0][61].Code = 152; d->HuffQ7[0][61].Length = 8;    /* 0.003759  -          10011000  */
+    d->HuffQ7[0][62].Code = 102; d->HuffQ7[0][62].Length = 8;    /* 0.003160  -          01100110  */
+
+    //more shaped, book 1
+    d->HuffQ7[1][ 0].Code = 14244; d->HuffQ7[1][ 0].Length = 14;    /* 0.000059  -        11011110100100  */
+    d->HuffQ7[1][ 1].Code = 14253; d->HuffQ7[1][ 1].Length = 14;    /* 0.000098  -        11011110101101  */
+    d->HuffQ7[1][ 2].Code = 14246; d->HuffQ7[1][ 2].Length = 14;    /* 0.000078  -        11011110100110  */
+    d->HuffQ7[1][ 3].Code = 14254; d->HuffQ7[1][ 3].Length = 14;    /* 0.000111  -        11011110101110  */
+    d->HuffQ7[1][ 4].Code =  3562; d->HuffQ7[1][ 4].Length = 12;    /* 0.000320  -          110111101010  */
+    d->HuffQ7[1][ 5].Code =   752; d->HuffQ7[1][ 5].Length = 10;    /* 0.000920  -            1011110000  */
+    d->HuffQ7[1][ 6].Code =   753; d->HuffQ7[1][ 6].Length = 10;    /* 0.001057  -            1011110001  */
+    d->HuffQ7[1][ 7].Code =   160; d->HuffQ7[1][ 7].Length =  9;    /* 0.001403  -             010100000  */
+    d->HuffQ7[1][ 8].Code =   162; d->HuffQ7[1][ 8].Length =  9;    /* 0.001579  -             010100010  */
+    d->HuffQ7[1][ 9].Code =   444; d->HuffQ7[1][ 9].Length =  9;    /* 0.002486  -             110111100  */
+    d->HuffQ7[1][10].Code =   122; d->HuffQ7[1][10].Length =  8;    /* 0.003772  -              01111010  */
+    d->HuffQ7[1][11].Code =   223; d->HuffQ7[1][11].Length =  8;    /* 0.005710  -              11011111  */
+    d->HuffQ7[1][12].Code =    60; d->HuffQ7[1][12].Length =  7;    /* 0.006858  -               0111100  */
+    d->HuffQ7[1][13].Code =    73; d->HuffQ7[1][13].Length =  7;    /* 0.008033  -               1001001  */
+    d->HuffQ7[1][14].Code =   110; d->HuffQ7[1][14].Length =  7;    /* 0.009827  -               1101110  */
+    d->HuffQ7[1][15].Code =    14; d->HuffQ7[1][15].Length =  6;    /* 0.012601  -                001110  */
+    d->HuffQ7[1][16].Code =    24; d->HuffQ7[1][16].Length =  6;    /* 0.013194  -                011000  */
+    d->HuffQ7[1][17].Code =    25; d->HuffQ7[1][17].Length =  6;    /* 0.013938  -                011001  */
+    d->HuffQ7[1][18].Code =    34; d->HuffQ7[1][18].Length =  6;    /* 0.015693  -                100010  */
+    d->HuffQ7[1][19].Code =    37; d->HuffQ7[1][19].Length =  6;    /* 0.017846  -                100101  */
+    d->HuffQ7[1][20].Code =    54; d->HuffQ7[1][20].Length =  6;    /* 0.020078  -                110110  */
+    d->HuffQ7[1][21].Code =     3; d->HuffQ7[1][21].Length =  5;    /* 0.022975  -                 00011  */
+    d->HuffQ7[1][22].Code =     9; d->HuffQ7[1][22].Length =  5;    /* 0.025631  -                 01001  */
+    d->HuffQ7[1][23].Code =    11; d->HuffQ7[1][23].Length =  5;    /* 0.027021  -                 01011  */
+    d->HuffQ7[1][24].Code =    16; d->HuffQ7[1][24].Length =  5;    /* 0.031465  -                 10000  */
+    d->HuffQ7[1][25].Code =    19; d->HuffQ7[1][25].Length =  5;    /* 0.034244  -                 10011  */
+    d->HuffQ7[1][26].Code =    21; d->HuffQ7[1][26].Length =  5;    /* 0.035921  -                 10101  */
+    d->HuffQ7[1][27].Code =    24; d->HuffQ7[1][27].Length =  5;    /* 0.037938  -                 11000  */
+    d->HuffQ7[1][28].Code =    26; d->HuffQ7[1][28].Length =  5;    /* 0.039595  -                 11010  */
+    d->HuffQ7[1][29].Code =    29; d->HuffQ7[1][29].Length =  5;    /* 0.041546  -                 11101  */
+    d->HuffQ7[1][30].Code =    31; d->HuffQ7[1][30].Length =  5;    /* 0.042623  -                 11111  */
+    d->HuffQ7[1][31].Code =     2; d->HuffQ7[1][31].Length =  4;    /* 0.045180  -                  0010  */
+    d->HuffQ7[1][32].Code =     0; d->HuffQ7[1][32].Length =  4;    /* 0.043151  -                  0000  */
+    d->HuffQ7[1][33].Code =    30; d->HuffQ7[1][33].Length =  5;    /* 0.042538  -                 11110  */
+    d->HuffQ7[1][34].Code =    28; d->HuffQ7[1][34].Length =  5;    /* 0.041422  -                 11100  */
+    d->HuffQ7[1][35].Code =    25; d->HuffQ7[1][35].Length =  5;    /* 0.039145  -                 11001  */
+    d->HuffQ7[1][36].Code =    22; d->HuffQ7[1][36].Length =  5;    /* 0.036691  -                 10110  */
+    d->HuffQ7[1][37].Code =    20; d->HuffQ7[1][37].Length =  5;    /* 0.034955  -                 10100  */
+    d->HuffQ7[1][38].Code =    14; d->HuffQ7[1][38].Length =  5;    /* 0.029155  -                 01110  */
+    d->HuffQ7[1][39].Code =    13; d->HuffQ7[1][39].Length =  5;    /* 0.027921  -                 01101  */
+    d->HuffQ7[1][40].Code =     8; d->HuffQ7[1][40].Length =  5;    /* 0.025553  -                 01000  */
+    d->HuffQ7[1][41].Code =     6; d->HuffQ7[1][41].Length =  5;    /* 0.023093  -                 00110  */
+    d->HuffQ7[1][42].Code =     2; d->HuffQ7[1][42].Length =  5;    /* 0.021200  -                 00010  */
+    d->HuffQ7[1][43].Code =    46; d->HuffQ7[1][43].Length =  6;    /* 0.018134  -                101110  */
+    d->HuffQ7[1][44].Code =    35; d->HuffQ7[1][44].Length =  6;    /* 0.015824  -                100011  */
+    d->HuffQ7[1][45].Code =    31; d->HuffQ7[1][45].Length =  6;    /* 0.014701  -                011111  */
+    d->HuffQ7[1][46].Code =    21; d->HuffQ7[1][46].Length =  6;    /* 0.013187  -                010101  */
+    d->HuffQ7[1][47].Code =    15; d->HuffQ7[1][47].Length =  6;    /* 0.012776  -                001111  */
+    d->HuffQ7[1][48].Code =    95; d->HuffQ7[1][48].Length =  7;    /* 0.009664  -               1011111  */
+    d->HuffQ7[1][49].Code =    72; d->HuffQ7[1][49].Length =  7;    /* 0.007922  -               1001000  */
+    d->HuffQ7[1][50].Code =    41; d->HuffQ7[1][50].Length =  7;    /* 0.006838  -               0101001  */
+    d->HuffQ7[1][51].Code =   189; d->HuffQ7[1][51].Length =  8;    /* 0.005024  -              10111101  */
+    d->HuffQ7[1][52].Code =   123; d->HuffQ7[1][52].Length =  8;    /* 0.003830  -              01111011  */
+    d->HuffQ7[1][53].Code =   377; d->HuffQ7[1][53].Length =  9;    /* 0.002232  -             101111001  */
+    d->HuffQ7[1][54].Code =   161; d->HuffQ7[1][54].Length =  9;    /* 0.001566  -             010100001  */
+    d->HuffQ7[1][55].Code =   891; d->HuffQ7[1][55].Length = 10;    /* 0.001383  -            1101111011  */
+    d->HuffQ7[1][56].Code =   327; d->HuffQ7[1][56].Length = 10;    /* 0.000900  -            0101000111  */
+    d->HuffQ7[1][57].Code =   326; d->HuffQ7[1][57].Length = 10;    /* 0.000790  -            0101000110  */
+    d->HuffQ7[1][58].Code =  3560; d->HuffQ7[1][58].Length = 12;    /* 0.000254  -          110111101000  */
+    d->HuffQ7[1][59].Code = 14255; d->HuffQ7[1][59].Length = 14;    /* 0.000117  -        11011110101111  */
+    d->HuffQ7[1][60].Code = 14247; d->HuffQ7[1][60].Length = 14;    /* 0.000085  -        11011110100111  */
+    d->HuffQ7[1][61].Code = 14252; d->HuffQ7[1][61].Length = 14;    /* 0.000085  -        11011110101100  */
+    d->HuffQ7[1][62].Code = 14245; d->HuffQ7[1][62].Length = 14;    /* 0.000065  -        11011110100101  */
+}
Index: /libmpcdec/tags/release-1.2.1/src/idtag.c
===================================================================
--- /libmpcdec/tags/release-1.2.1/src/idtag.c	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/src/idtag.c	(revision 30)
@@ -0,0 +1,83 @@
+/*
+  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 idtag.c
+/// Rudimentary id3tag handling routines, just enough to skip id3v2 tags,
+/// if present.
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/internal.h>
+
+mpc_int32_t
+JumpID3v2 (mpc_reader* r) {
+    unsigned char  tmp [10];
+    mpc_uint32_t   Unsynchronisation;   // ID3v2.4-flag
+    mpc_uint32_t   ExtHeaderPresent;    // ID3v2.4-flag
+    mpc_uint32_t   ExperimentalFlag;    // ID3v2.4-flag
+    mpc_uint32_t   FooterPresent;       // ID3v2.4-flag
+    mpc_int32_t    ret;
+
+    // seek to first byte of mpc data
+    if (!r->seek (r->data, 0)) {
+        return 0;  
+    }
+    
+    r->read(r->data, tmp, sizeof(tmp));
+
+    // check id3-tag
+    if ( 0 != memcmp ( tmp, "ID3", 3) )
+        return 0;
+
+    // read flags
+    Unsynchronisation = tmp[5] & 0x80;
+    ExtHeaderPresent  = tmp[5] & 0x40;
+    ExperimentalFlag  = tmp[5] & 0x20;
+    FooterPresent     = tmp[5] & 0x10;
+
+    if ( tmp[5] & 0x0F )
+        return -1;              // not (yet???) allowed
+    if ( (tmp[6] | tmp[7] | tmp[8] | tmp[9]) & 0x80 )
+        return -1;              // not allowed
+
+    // read HeaderSize (syncsave: 4 * $0xxxxxxx = 28 significant bits)
+    ret  = tmp[6] << 21;
+    ret += tmp[7] << 14;
+    ret += tmp[8] <<  7;
+    ret += tmp[9]      ;
+    ret += 10;
+    if ( FooterPresent )
+        ret += 10;
+
+    return ret;
+}
Index: /libmpcdec/tags/release-1.2.1/src/mpc_decoder.c
===================================================================
--- /libmpcdec/tags/release-1.2.1/src/mpc_decoder.c	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/src/mpc_decoder.c	(revision 30)
@@ -0,0 +1,1381 @@
+/*
+  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 mpc_decoder.c
+/// Core decoding routines and logic.
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/internal.h>
+#include <mpcdec/requant.h>
+#include <mpcdec/huffman.h>
+
+//------------------------------------------------------------------------------
+// types
+//------------------------------------------------------------------------------
+enum
+    {
+        EQ_TAP = 13,                        // length of FIR filter for EQ
+        DELAY = ((EQ_TAP + 1) / 2),         // delay of FIR
+        FIR_BANDS = 4,                      // number of subbands to be FIR filtered
+        MEMSIZE = MPC_DECODER_MEMSIZE,      // overall buffer size
+        MEMSIZE2 = (MEMSIZE/2),             // size of one buffer
+        MEMMASK = (MEMSIZE-1)
+    };
+
+//------------------------------------------------------------------------------
+// forward declarations
+//------------------------------------------------------------------------------
+void mpc_decoder_init_huffman_sv6(mpc_decoder *d);
+void mpc_decoder_init_huffman_sv7(mpc_decoder *d);
+void mpc_decoder_read_bitstream_sv6(mpc_decoder *d);
+void mpc_decoder_read_bitstream_sv7(mpc_decoder *d);
+void mpc_decoder_update_buffer(mpc_decoder *d, mpc_uint32_t RING);
+mpc_bool_t mpc_decoder_seek_sample(mpc_decoder *d, mpc_int64_t destsample);
+void mpc_decoder_requantisierung(mpc_decoder *d, const mpc_int32_t Last_Band);
+
+//------------------------------------------------------------------------------
+// utility functions
+//------------------------------------------------------------------------------
+static mpc_int32_t f_read(mpc_decoder *d, void *ptr, size_t size) 
+{ 
+    return d->r->read(d->r->data, ptr, size); 
+};
+
+static mpc_bool_t f_seek(mpc_decoder *d, mpc_int32_t offset) 
+{ 
+    return d->r->seek(d->r->data, offset); 
+};
+
+static mpc_int32_t f_read_dword(mpc_decoder *d, mpc_uint32_t * ptr, mpc_uint32_t count) 
+{
+    count = f_read(d, ptr, count << 2) >> 2;
+#ifndef MPC_LITTLE_ENDIAN
+    mpc_uint32_t n;
+    for(n = 0; n< count; n++) {
+        ptr[n] = swap32(ptr[n]);
+    }
+#endif
+    return count;
+}
+
+//------------------------------------------------------------------------------
+// huffman & bitstream functions
+//------------------------------------------------------------------------------
+static const mpc_uint32_t mask [33] = {
+    0x00000000, 0x00000001, 0x00000003, 0x00000007,
+    0x0000000F, 0x0000001F, 0x0000003F, 0x0000007F,
+    0x000000FF, 0x000001FF, 0x000003FF, 0x000007FF,
+    0x00000FFF, 0x00001FFF, 0x00003FFF, 0x00007FFF,
+    0x0000FFFF, 0x0001FFFF, 0x0003FFFF, 0x0007FFFF,
+    0x000FFFFF, 0x001FFFFF, 0x003FFFFF, 0x007FFFFF,
+    0x00FFFFFF, 0x01FFFFFF, 0x03FFFFFF, 0x07FFFFFF,
+    0x0FFFFFFF, 0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF,
+    0xFFFFFFFF
+};
+
+/* F U N C T I O N S */
+
+// resets bitstream decoding
+static void
+mpc_decoder_reset_bitstream_decode(mpc_decoder *d) 
+{
+    d->dword = 0;
+    d->pos = 0;
+    d->Zaehler = 0;
+    d->WordsRead = 0;
+}
+
+// reports the number of read bits
+static mpc_uint32_t
+mpc_decoder_bits_read(mpc_decoder *d) 
+{
+    return 32 * d->WordsRead + d->pos;
+}
+
+// read desired number of bits out of the bitstream
+static mpc_uint32_t
+mpc_decoder_bitstream_read(mpc_decoder *d, const mpc_uint32_t bits) 
+{
+    mpc_uint32_t out = d->dword;
+
+    d->pos += bits;
+
+    if (d->pos < 32) {
+        out >>= (32 - d->pos);
+    }
+    else {
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
+        d->pos -= 32;
+        if (d->pos) {
+            out <<= d->pos;
+            out |= d->dword >> (32 - d->pos);
+        }
+        ++(d->WordsRead);
+    }
+
+    return out & mask[bits];
+}
+
+// decode SCFI-bundle (sv4,5,6)
+static void
+mpc_decoder_scfi_bundle_read(
+    mpc_decoder *d,
+    HuffmanTyp* Table, mpc_int32_t* SCFI, mpc_int32_t* DSCF) 
+{
+    // load preview and decode
+    mpc_uint32_t code  = d->dword << d->pos;
+    if (d->pos > 26) {
+        code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
+    }
+    while (code < Table->Code) {
+        Table++;
+    }
+
+    // set the new position within bitstream without performing a dummy-read
+    if ((d->pos += Table->Length) >= 32) {
+        d->pos -= 32;
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler+1) & MEMMASK];
+        ++(d->WordsRead);
+    }
+
+    *SCFI = Table->Value >> 1;
+    *DSCF = Table->Value &  1;
+}
+
+static int
+mpc_decoder_huffman_typ_cmpfn(const void* p1, const void* p2)
+{
+    if (((HuffmanTyp*) p1)->Code < ((HuffmanTyp*) p2)->Code ) return +1;
+    if (((HuffmanTyp*) p1)->Code > ((HuffmanTyp*) p2)->Code ) return -1;
+    return 0;
+}
+
+// sort huffman-tables by codeword
+// offset resulting value
+void
+mpc_decoder_resort_huff_tables(
+    const mpc_uint32_t elements, HuffmanTyp* Table, const mpc_int32_t offset ) 
+{
+    mpc_uint32_t  i;
+
+    for ( i = 0; i < elements; i++ ) {
+        Table[i].Code <<= 32 - Table[i].Length;
+        Table[i].Value  =  i - offset;
+    }
+    qsort(Table, elements, sizeof(*Table), mpc_decoder_huffman_typ_cmpfn);
+}
+
+// basic huffman decoding routine
+// works with maximum lengths up to 14
+static mpc_int32_t
+mpc_decoder_huffman_decode(mpc_decoder *d, const HuffmanTyp *Table) 
+{
+    // load preview and decode
+    mpc_uint32_t code = d->dword << d->pos;
+    if (d->pos > 18) {
+        code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
+    }
+    while (code < Table->Code) {
+        Table++;
+    }
+
+    // set the new position within bitstream without performing a dummy-read
+    if ((d->pos += Table->Length) >= 32) {
+        d->pos -= 32;
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
+        ++(d->WordsRead);
+    }
+
+    return Table->Value;
+}
+
+// faster huffman through previewing less bits
+// works with maximum lengths up to 10
+static mpc_int32_t
+mpc_decoder_huffman_decode_fast(mpc_decoder *d, const HuffmanTyp* Table)
+{
+    // load preview and decode
+    mpc_uint32_t code  = d->dword << d->pos;
+    if (d->pos > 22) {
+        code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
+    }
+    while (code < Table->Code) {
+        Table++;
+    }
+
+    // set the new position within bitstream without performing a dummy-read
+    if ((d->pos += Table->Length) >= 32) {
+        d->pos -= 32;
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
+        ++(d->WordsRead);
+    }
+
+    return Table->Value;
+}
+
+// even faster huffman through previewing even less bits
+// works with maximum lengths up to 5
+static mpc_int32_t
+mpc_decoder_huffman_decode_faster(mpc_decoder *d, const HuffmanTyp* Table)
+{
+    // load preview and decode
+    mpc_uint32_t code  = d->dword << d->pos;
+    if (d->pos > 27) {
+        code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
+    }
+    while (code < Table->Code) {
+        Table++;
+    }
+
+    // set the new position within bitstream without performing a dummy-read
+    if ((d->pos += Table->Length) >= 32) {
+        d->pos -= 32;
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
+        ++(d->WordsRead);
+    }
+
+    return Table->Value;
+}
+
+static void
+mpc_decoder_reset_v(mpc_decoder *d) 
+{
+    memset(d->V_L, 0, sizeof d->V_L);
+    memset(d->V_R, 0, sizeof d->V_R);
+}
+
+static void
+mpc_decoder_reset_synthesis(mpc_decoder *d) 
+{
+    mpc_decoder_reset_v(d);
+}
+
+static void
+mpc_decoder_reset_y(mpc_decoder *d) 
+{
+    memset(d->Y_L, 0, sizeof d->Y_L);
+    memset(d->Y_R, 0, sizeof d->Y_R);
+}
+
+static void
+mpc_decoder_reset_globals(mpc_decoder *d) 
+{
+    mpc_decoder_reset_bitstream_decode(d);
+
+    d->DecodedFrames  = 0;
+    d->StreamVersion  = 0;
+    d->MS_used        = 0;
+
+    memset(d->Y_L          , 0, sizeof d->Y_L           );
+    memset(d->Y_R          , 0, sizeof d->Y_R           );
+    memset(d->SCF_Index_L     , 0, sizeof d->SCF_Index_L      );
+    memset(d->SCF_Index_R     , 0, sizeof d->SCF_Index_R      );
+    memset(d->Res_L           , 0, sizeof d->Res_L            );
+    memset(d->Res_R           , 0, sizeof d->Res_R            );
+    memset(d->SCFI_L          , 0, sizeof d->SCFI_L           );
+    memset(d->SCFI_R          , 0, sizeof d->SCFI_R           );
+    memset(d->DSCF_Flag_L     , 0, sizeof d->DSCF_Flag_L      );
+    memset(d->DSCF_Flag_R     , 0, sizeof d->DSCF_Flag_R      );
+    memset(d->DSCF_Reference_L, 0, sizeof d->DSCF_Reference_L );
+    memset(d->DSCF_Reference_R, 0, sizeof d->DSCF_Reference_R );
+    memset(d->Q               , 0, sizeof d->Q                );
+    memset(d->MS_Flag         , 0, sizeof d->MS_Flag          );
+}
+
+mpc_uint32_t
+mpc_decoder_decode_frame(mpc_decoder *d, mpc_uint32_t *in_buffer,
+                         mpc_uint32_t in_len, MPC_SAMPLE_FORMAT *out_buffer)
+{
+  unsigned int i;
+  mpc_decoder_reset_bitstream_decode(d);
+  if (in_len > sizeof(d->Speicher)) in_len = sizeof(d->Speicher);
+  memcpy(d->Speicher, in_buffer, in_len);
+#ifdef MPC_LITTLE_ENDIAN
+  for (i = 0; i < (in_len + 3) / 4; i++)
+    d->Speicher[i] = swap32(d->Speicher[i]);
+#endif
+  d->dword = d->Speicher[0];
+  switch (d->StreamVersion) {
+    case 0x04:
+    case 0x05:
+    case 0x06:
+        mpc_decoder_read_bitstream_sv6(d);
+        break;
+    case 0x07:
+    case 0x17:
+        mpc_decoder_read_bitstream_sv7(d);
+        break;
+    default:
+        return (mpc_uint32_t)(-1);
+  }
+  mpc_decoder_requantisierung(d, d->Max_Band);
+  mpc_decoder_synthese_filter_float(d, out_buffer);
+  return mpc_decoder_bits_read(d);
+}
+
+static mpc_uint32_t
+mpc_decoder_decode_internal(mpc_decoder *d, MPC_SAMPLE_FORMAT *buffer) 
+{
+    mpc_uint32_t output_frame_length = MPC_FRAME_LENGTH;
+
+    mpc_uint32_t  FrameBitCnt = 0;
+
+    if (d->DecodedFrames >= d->OverallFrames) {
+        return (mpc_uint32_t)(-1);                           // end of file -> abort decoding
+    }
+
+    // read jump-info for validity check of frame
+    d->FwdJumpInfo  = mpc_decoder_bitstream_read(d, 20);
+
+    d->ActDecodePos = (d->Zaehler << 5) + d->pos;
+
+    // decode data and check for validity of frame
+    FrameBitCnt = mpc_decoder_bits_read(d);
+    switch (d->StreamVersion) {
+    case 0x04:
+    case 0x05:
+    case 0x06:
+        mpc_decoder_read_bitstream_sv6(d);
+        break;
+    case 0x07:
+    case 0x17:
+        mpc_decoder_read_bitstream_sv7(d);
+        break;
+    default:
+        return (mpc_uint32_t)(-1);
+    }
+    d->FrameWasValid = mpc_decoder_bits_read(d) - FrameBitCnt == d->FwdJumpInfo;
+
+    // synthesize signal
+    mpc_decoder_requantisierung(d, d->Max_Band);
+
+    //if ( d->EQ_activated && PluginSettings.EQbyMPC )
+    //    perform_EQ ();
+
+    mpc_decoder_synthese_filter_float(d, buffer);
+
+    d->DecodedFrames++;
+
+    // cut off first MPC_DECODER_SYNTH_DELAY zero-samples
+    if (d->DecodedFrames == d->OverallFrames  && d->StreamVersion >= 6) {        
+        // reconstruct exact filelength
+        mpc_int32_t  mod_block   = mpc_decoder_bitstream_read(d,  11);
+        mpc_int32_t  FilterDecay;
+
+        if (mod_block == 0) {
+            // Encoder bugfix
+            mod_block = 1152;                    
+        }
+        FilterDecay = (mod_block + MPC_DECODER_SYNTH_DELAY) % MPC_FRAME_LENGTH;
+
+        // additional FilterDecay samples are needed for decay of synthesis filter
+        if (MPC_DECODER_SYNTH_DELAY + mod_block >= MPC_FRAME_LENGTH) {
+
+            // **********************************************************************
+            // Rhoades 4/16/2002
+            // Commented out are blocks of code which cause gapless playback to fail.
+            // Temporary fix...
+            // **********************************************************************
+
+            if (!d->TrueGaplessPresent) {
+                mpc_decoder_reset_y(d);
+            } 
+            else {
+                //if ( MPC_FRAME_LENGTH != d->LastValidSamples ) {
+                mpc_decoder_bitstream_read(d, 20);
+                mpc_decoder_read_bitstream_sv7(d);
+                mpc_decoder_requantisierung(d, d->Max_Band);
+                //FilterDecay = d->LastValidSamples;
+                //}
+                //else {
+                //FilterDecay = 0;
+                //}
+            }
+
+            mpc_decoder_synthese_filter_float(d, buffer + 2304);
+
+            output_frame_length = MPC_FRAME_LENGTH + FilterDecay;
+        }
+        else {                              // there are only FilterDecay samples needed for this frame
+            output_frame_length = FilterDecay;
+        }
+    }
+
+    if (d->samples_to_skip) {
+        if (output_frame_length < d->samples_to_skip) {
+            d->samples_to_skip -= output_frame_length;
+            output_frame_length = 0;
+        }
+        else {
+            output_frame_length -= d->samples_to_skip;
+            memmove(
+                buffer, 
+                buffer + d->samples_to_skip * 2, 
+                output_frame_length * 2 * sizeof (MPC_SAMPLE_FORMAT));
+            d->samples_to_skip = 0;
+        }
+    }
+
+    return output_frame_length;
+}
+
+mpc_uint32_t mpc_decoder_decode(
+    mpc_decoder *d,
+    MPC_SAMPLE_FORMAT *buffer, 
+    mpc_uint32_t *vbr_update_acc, 
+    mpc_uint32_t *vbr_update_bits)
+{
+    for(;;)
+    {
+        //const mpc_int32_t MaxBrokenFrames = 0; // PluginSettings.MaxBrokenFrames
+
+        mpc_uint32_t RING = d->Zaehler;
+        mpc_int32_t vbr_ring = (RING << 5) + d->pos;
+
+        mpc_uint32_t valid_samples = mpc_decoder_decode_internal(d, buffer);
+
+        if (valid_samples == (mpc_uint32_t)(-1) ) {
+            return 0;
+        }
+
+        /**************** ERROR CONCEALMENT *****************/
+        if (d->FrameWasValid == 0 ) {
+            // error occurred in bitstream
+            return (mpc_uint32_t)(-1);
+        } 
+        else {
+            if (vbr_update_acc && vbr_update_bits) {
+                (*vbr_update_acc) ++;
+                vbr_ring = (d->Zaehler << 5) + d->pos - vbr_ring;
+                if (vbr_ring < 0) {
+                    vbr_ring += 524288;
+                }
+                (*vbr_update_bits) += vbr_ring;
+            }
+
+        }
+        mpc_decoder_update_buffer(d, RING);
+
+        if (valid_samples > 0) {
+            return valid_samples;
+        }
+    }
+}
+
+void
+mpc_decoder_requantisierung(mpc_decoder *d, const mpc_int32_t Last_Band) 
+{
+    mpc_int32_t     Band;
+    mpc_int32_t     n;
+    MPC_SAMPLE_FORMAT facL;
+    MPC_SAMPLE_FORMAT facR;
+    MPC_SAMPLE_FORMAT templ;
+    MPC_SAMPLE_FORMAT tempr;
+    MPC_SAMPLE_FORMAT* YL;
+    MPC_SAMPLE_FORMAT* YR;
+    mpc_int32_t*    L;
+    mpc_int32_t*    R;
+
+#ifdef MPC_FIXED_POINT
+#if MPC_FIXED_POINT_FRACTPART == 14
+#define MPC_MULTIPLY_SCF(CcVal, SCF_idx) \
+    MPC_MULTIPLY_EX(CcVal, d->SCF[SCF_idx], d->SCF_shift[SCF_idx])
+#else
+
+#error FIXME, Cc table is in 18.14 format
+
+#endif
+#else
+#define MPC_MULTIPLY_SCF(CcVal, SCF_idx) \
+    MPC_MULTIPLY(CcVal, d->SCF[SCF_idx])
+#endif
+    // requantization and scaling of subband-samples
+    for ( Band = 0; Band <= Last_Band; Band++ ) {   // setting pointers
+        YL = d->Y_L[0] + Band;
+        YR = d->Y_R[0] + Band;
+        L  = d->Q[Band].L;
+        R  = d->Q[Band].R;
+        /************************** MS-coded **************************/
+        if ( d->MS_Flag [Band] ) {
+            if ( d->Res_L [Band] ) {
+                if ( d->Res_R [Band] ) {    // M!=0, S!=0
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YL   = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++));
+                        *YR   = templ - tempr;
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YL   = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++));
+                        *YR   = templ - tempr;
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YL   = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++));
+                        *YR   = templ - tempr;
+                    }
+                } else {    // M!=0, S==0
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                    }
+                }
+            } else {
+                if (d->Res_R[Band])    // M==0, S!=0
+                {
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YR = - (*YL = MPC_MULTIPLY_FLOAT_INT(facR,*(R++)));
+                    }
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YR = - (*YL = MPC_MULTIPLY_FLOAT_INT(facR,*(R++)));
+                    }
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YR = - (*YL = MPC_MULTIPLY_FLOAT_INT(facR,*(R++)));
+                    }
+                } else {    // M==0, S==0
+                    for ( n = 0; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = 0;
+                    }
+                }
+            }
+        }
+        /************************** LR-coded **************************/
+        else {
+            if ( d->Res_L [Band] ) {
+                if ( d->Res_R [Band] ) {    // L!=0, R!=0
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
+                    for (n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
+                    for (; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
+                    for (; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                } else {     // L!=0, R==0
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = 0;
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = 0;
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = 0;
+                    }
+                }
+            }
+            else {
+                if ( d->Res_R [Band] ) {    // L==0, R!=0
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YL = 0;
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YL = 0;
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YL = 0;
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                } else {    // L==0, R==0
+                    for ( n = 0; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = 0;
+                    }
+                }
+            }
+        }
+    }
+}
+
+/****************************************** SV 6 ******************************************/
+void
+mpc_decoder_read_bitstream_sv6(mpc_decoder *d) 
+{
+    mpc_int32_t n,k;
+    mpc_int32_t Max_used_Band=0;
+    HuffmanTyp *Table;
+    const HuffmanTyp *x1;
+    const HuffmanTyp *x2;
+    mpc_int32_t *L;
+    mpc_int32_t *R;
+    mpc_int32_t *ResL = d->Res_L;
+    mpc_int32_t *ResR = d->Res_R;
+
+    /************************ HEADER **************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    for (n=0; n <= d->Max_Band; ++n, ++ResL, ++ResR)
+    {
+        if      (n<11)           Table = d->Region_A;
+        else if (n>=11 && n<=22) Table = d->Region_B;
+        else /*if (n>=23)*/      Table = d->Region_C;
+
+        *ResL = d->Q_res[n][mpc_decoder_huffman_decode(d, Table)];
+        if (d->MS_used) {
+            d->MS_Flag[n] = mpc_decoder_bitstream_read(d,  1);
+        }
+        *ResR = d->Q_res[n][mpc_decoder_huffman_decode(d, Table)];
+
+        // only perform the following procedure up to the maximum non-zero subband
+        if (*ResL || *ResR) Max_used_Band = n;
+    }
+
+    /************************* SCFI-Bundle *****************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    for (n=0; n<=Max_used_Band; ++n, ++ResL, ++ResR) {
+        if (*ResL) mpc_decoder_scfi_bundle_read(d, d->SCFI_Bundle, &(d->SCFI_L[n]), &(d->DSCF_Flag_L[n]));
+        if (*ResR) mpc_decoder_scfi_bundle_read(d, d->SCFI_Bundle, &(d->SCFI_R[n]), &(d->DSCF_Flag_R[n]));
+    }
+
+    /***************************** SCFI ********************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    L    = d->SCF_Index_L[0];
+    R    = d->SCF_Index_R[0];
+    for (n=0; n <= Max_used_Band; ++n, ++ResL, ++ResR, L+=3, R+=3)
+    {
+        if (*ResL)
+        {
+            /*********** DSCF ************/
+            if (d->DSCF_Flag_L[n]==1)
+            {
+                L[2] = d->DSCF_Reference_L[n];
+                switch (d->SCFI_L[n])
+                {
+                case 3:
+                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[1] = L[0];
+                    L[2] = L[1];
+                    break;
+                case 1:
+                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[1] = L[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[2] = L[1];
+                    break;
+                case 2:
+                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[1] = L[0];
+                    L[2] = L[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    break;
+                case 0:
+                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[1] = L[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[2] = L[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    break;
+                default:
+                    return;
+                    break;
+                }
+            }
+            /************ SCF ************/
+            else
+            {
+                switch (d->SCFI_L[n])
+                {
+                case 3:
+                    L[0] = mpc_decoder_bitstream_read(d,  6);
+                    L[1] = L[0];
+                    L[2] = L[1];
+                    break;
+                case 1:
+                    L[0] = mpc_decoder_bitstream_read(d,  6);
+                    L[1] = mpc_decoder_bitstream_read(d,  6);
+                    L[2] = L[1];
+                    break;
+                case 2:
+                    L[0] = mpc_decoder_bitstream_read(d,  6);
+                    L[1] = L[0];
+                    L[2] = mpc_decoder_bitstream_read(d,  6);
+                    break;
+                case 0:
+                    L[0] = mpc_decoder_bitstream_read(d,  6);
+                    L[1] = mpc_decoder_bitstream_read(d,  6);
+                    L[2] = mpc_decoder_bitstream_read(d,  6);
+                    break;
+                default:
+                    return;
+                    break;
+                }
+            }
+            // update Reference for DSCF
+            d->DSCF_Reference_L[n] = L[2];
+        }
+        if (*ResR)
+        {
+            R[2] = d->DSCF_Reference_R[n];
+            /*********** DSCF ************/
+            if (d->DSCF_Flag_R[n]==1)
+            {
+                switch (d->SCFI_R[n])
+                {
+                case 3:
+                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[1] = R[0];
+                    R[2] = R[1];
+                    break;
+                case 1:
+                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[1] = R[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[2] = R[1];
+                    break;
+                case 2:
+                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[1] = R[0];
+                    R[2] = R[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    break;
+                case 0:
+                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[1] = R[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[2] = R[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    break;
+                default:
+                    return;
+                    break;
+                }
+            }
+            /************ SCF ************/
+            else
+            {
+                switch (d->SCFI_R[n])
+                {
+                case 3:
+                    R[0] = mpc_decoder_bitstream_read(d, 6);
+                    R[1] = R[0];
+                    R[2] = R[1];
+                    break;
+                case 1:
+                    R[0] = mpc_decoder_bitstream_read(d, 6);
+                    R[1] = mpc_decoder_bitstream_read(d, 6);
+                    R[2] = R[1];
+                    break;
+                case 2:
+                    R[0] = mpc_decoder_bitstream_read(d, 6);
+                    R[1] = R[0];
+                    R[2] = mpc_decoder_bitstream_read(d, 6);
+                    break;
+                case 0:
+                    R[0] = mpc_decoder_bitstream_read(d, 6);
+                    R[1] = mpc_decoder_bitstream_read(d, 6);
+                    R[2] = mpc_decoder_bitstream_read(d, 6);
+                    break;
+                default:
+                    return;
+                    break;
+                }
+            }
+            // update Reference for DSCF
+            d->DSCF_Reference_R[n] = R[2];
+        }
+    }
+
+    /**************************** Samples ****************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    for (n=0; n <= Max_used_Band; ++n, ++ResL, ++ResR)
+    {
+        // setting pointers
+        x1 = d->SampleHuff[*ResL];
+        x2 = d->SampleHuff[*ResR];
+        L = d->Q[n].L;
+        R = d->Q[n].R;
+
+        if (x1!=NULL || x2!=NULL)
+            for (k=0; k<36; ++k)
+            {
+                if (x1 != NULL) *L++ = mpc_decoder_huffman_decode_fast(d,  x1);
+                if (x2 != NULL) *R++ = mpc_decoder_huffman_decode_fast(d,  x2);
+            }
+
+        if (*ResL>7 || *ResR>7)
+            for (k=0; k<36; ++k)
+            {
+                if (*ResL>7) *L++ = (mpc_int32_t)mpc_decoder_bitstream_read(d,  Res_bit[*ResL]) - Dc[*ResL];
+                if (*ResR>7) *R++ = (mpc_int32_t)mpc_decoder_bitstream_read(d,  Res_bit[*ResR]) - Dc[*ResR];
+            }
+    }
+}
+
+/****************************************** SV 7 ******************************************/
+void
+mpc_decoder_read_bitstream_sv7(mpc_decoder *d) 
+{
+    // these arrays hold decoding results for bundled quantizers (3- and 5-step)
+    /*static*/ mpc_int32_t idx30[] = { -1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1};
+    /*static*/ mpc_int32_t idx31[] = { -1,-1,-1, 0, 0, 0, 1, 1, 1,-1,-1,-1, 0, 0, 0, 1, 1, 1,-1,-1,-1, 0, 0, 0, 1, 1, 1};
+    /*static*/ mpc_int32_t idx32[] = { -1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1};
+    /*static*/ mpc_int32_t idx50[] = { -2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2};
+    /*static*/ mpc_int32_t idx51[] = { -2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2};
+
+    mpc_int32_t n,k;
+    mpc_int32_t Max_used_Band=0;
+    const HuffmanTyp *Table;
+    mpc_int32_t idx;
+    mpc_int32_t *L   ,*R;
+    mpc_int32_t *ResL,*ResR;
+    mpc_uint32_t tmp;
+
+    /***************************** Header *****************************/
+    ResL  = d->Res_L;
+    ResR  = d->Res_R;
+
+    // first subband
+    *ResL = mpc_decoder_bitstream_read(d, 4);
+    *ResR = mpc_decoder_bitstream_read(d, 4);
+    if (d->MS_used && !(*ResL==0 && *ResR==0)) {
+        d->MS_Flag[0] = mpc_decoder_bitstream_read(d, 1);
+    }
+
+    // consecutive subbands
+    ++ResL; ++ResR; // increase pointers
+    for (n=1; n <= d->Max_Band; ++n, ++ResL, ++ResR)
+    {
+        idx   = mpc_decoder_huffman_decode_fast(d, d->HuffHdr);
+        *ResL = (idx!=4) ? *(ResL-1) + idx : (int) mpc_decoder_bitstream_read(d, 4);
+
+        idx   = mpc_decoder_huffman_decode_fast(d, d->HuffHdr);
+        *ResR = (idx!=4) ? *(ResR-1) + idx : (int) mpc_decoder_bitstream_read(d, 4);
+
+        if (d->MS_used && !(*ResL==0 && *ResR==0)) {
+            d->MS_Flag[n] = mpc_decoder_bitstream_read(d, 1);
+        }
+
+        // only perform following procedures up to the maximum non-zero subband
+        if (*ResL!=0 || *ResR!=0) {
+            Max_used_Band = n;
+        }
+    }
+    /****************************** SCFI ******************************/
+    L     = d->SCFI_L;
+    R     = d->SCFI_R;
+    ResL  = d->Res_L;
+    ResR  = d->Res_R;
+    for (n=0; n <= Max_used_Band; ++n, ++L, ++R, ++ResL, ++ResR) {
+        if (*ResL) *L = mpc_decoder_huffman_decode_faster(d, d->HuffSCFI);
+        if (*ResR) *R = mpc_decoder_huffman_decode_faster(d, d->HuffSCFI);
+    }
+
+    /**************************** SCF/DSCF ****************************/
+    ResL  = d->Res_L;
+    ResR  = d->Res_R;
+    L     = d->SCF_Index_L[0];
+    R     = d->SCF_Index_R[0];
+    for (n=0; n<=Max_used_Band; ++n, ++ResL, ++ResR, L+=3, R+=3) {
+        if (*ResL)
+        {
+            L[2] = d->DSCF_Reference_L[n];
+            switch (d->SCFI_L[n])
+            {
+            case 1:
+                idx  = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
+                L[0] = (idx!=8) ? L[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
+                L[1] = (idx!=8) ? L[0] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                L[2] = L[1];
+                break;
+            case 3:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[0] = (idx!=8) ? L[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                L[1] = L[0];
+                L[2] = L[1];
+                break;
+            case 2:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[0] = (idx!=8) ? L[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                L[1] = L[0];
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[2] = (idx!=8) ? L[1] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                break;
+            case 0:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[0] = (idx!=8) ? L[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[1] = (idx!=8) ? L[0] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[2] = (idx!=8) ? L[1] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                break;
+            default:
+                return;
+                break;
+            }
+            // update Reference for DSCF
+            d->DSCF_Reference_L[n] = L[2];
+        }
+        if (*ResR)
+        {
+            R[2] = d->DSCF_Reference_R[n];
+            switch (d->SCFI_R[n])
+            {
+            case 1:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[0] = (idx!=8) ? R[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[1] = (idx!=8) ? R[0] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                R[2] = R[1];
+                break;
+            case 3:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[0] = (idx!=8) ? R[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                R[1] = R[0];
+                R[2] = R[1];
+                break;
+            case 2:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[0] = (idx!=8) ? R[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                R[1] = R[0];
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[2] = (idx!=8) ? R[1] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                break;
+            case 0:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[0] = (idx!=8) ? R[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[1] = (idx!=8) ? R[0] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[2] = (idx!=8) ? R[1] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                break;
+            default:
+                return;
+                break;
+            }
+            // update Reference for DSCF
+            d->DSCF_Reference_R[n] = R[2];
+        }
+    }
+    /***************************** Samples ****************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    L    = d->Q[0].L;
+    R    = d->Q[0].R;
+    for (n=0; n <= Max_used_Band; ++n, ++ResL, ++ResR, L+=36, R+=36)
+    {
+        /************** links **************/
+        switch (*ResL)
+        {
+        case  -2: case  -3: case  -4: case  -5: case  -6: case  -7: case  -8: case  -9:
+        case -10: case -11: case -12: case -13: case -14: case -15: case -16: case -17:
+            L += 36;
+            break;
+        case -1:
+            for (k=0; k<36; k++ ) {
+                tmp  = mpc_random_int(d);
+                *L++ = ((tmp >> 24) & 0xFF) + ((tmp >> 16) & 0xFF) + ((tmp >>  8) & 0xFF) + ((tmp >>  0) & 0xFF) - 510;
+            }
+            break;
+        case 0:
+            L += 36;// increase pointer
+            break;
+        case 1:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][1];
+            for (k=0; k<12; ++k)
+            {
+                idx = mpc_decoder_huffman_decode_fast(d,  Table);
+                *L++ = idx30[idx];
+                *L++ = idx31[idx];
+                *L++ = idx32[idx];
+            }
+            break;
+        case 2:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][2];
+            for (k=0; k<18; ++k)
+            {
+                idx = mpc_decoder_huffman_decode_fast(d,  Table);
+                *L++ = idx50[idx];
+                *L++ = idx51[idx];
+            }
+            break;
+        case 3:
+        case 4:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
+            for (k=0; k<36; ++k)
+                *L++ = mpc_decoder_huffman_decode_faster(d, Table);
+            break;
+        case 5:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
+            for (k=0; k<36; ++k)
+                *L++ = mpc_decoder_huffman_decode_fast(d, Table);
+            break;
+        case 6:
+        case 7:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
+            for (k=0; k<36; ++k)
+                *L++ = mpc_decoder_huffman_decode(d, Table);
+            break;
+        case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17:
+            tmp = Dc[*ResL];
+            for (k=0; k<36; ++k)
+                *L++ = (mpc_int32_t)mpc_decoder_bitstream_read(d, Res_bit[*ResL]) - tmp;
+            break;
+        default:
+            return;
+        }
+        /************** rechts **************/
+        switch (*ResR)
+        {
+        case  -2: case  -3: case  -4: case  -5: case  -6: case  -7: case  -8: case  -9:
+        case -10: case -11: case -12: case -13: case -14: case -15: case -16: case -17:
+            R += 36;
+            break;
+        case -1:
+                for (k=0; k<36; k++ ) {
+                    tmp  = mpc_random_int(d);
+                    *R++ = ((tmp >> 24) & 0xFF) + ((tmp >> 16) & 0xFF) + ((tmp >>  8) & 0xFF) + ((tmp >>  0) & 0xFF) - 510;
+                }
+                break;
+            case 0:
+                R += 36;// increase pointer
+                break;
+            case 1:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][1];
+                for (k=0; k<12; ++k)
+                {
+                    idx = mpc_decoder_huffman_decode_fast(d, Table);
+                    *R++ = idx30[idx];
+                    *R++ = idx31[idx];
+                    *R++ = idx32[idx];
+                }
+                break;
+            case 2:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][2];
+                for (k=0; k<18; ++k)
+                {
+                    idx = mpc_decoder_huffman_decode_fast(d, Table);
+                    *R++ = idx50[idx];
+                    *R++ = idx51[idx];
+                }
+                break;
+            case 3:
+            case 4:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
+                for (k=0; k<36; ++k)
+                    *R++ = mpc_decoder_huffman_decode_faster(d, Table);
+                break;
+            case 5:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
+                for (k=0; k<36; ++k)
+                    *R++ = mpc_decoder_huffman_decode_fast(d, Table);
+                break;
+            case 6:
+            case 7:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
+                for (k=0; k<36; ++k)
+                    *R++ = mpc_decoder_huffman_decode(d, Table);
+                break;
+            case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17:
+                tmp = Dc[*ResR];
+                for (k=0; k<36; ++k)
+                    *R++ = (mpc_int32_t)mpc_decoder_bitstream_read(d, Res_bit[*ResR]) - tmp;
+                break;
+            default:
+                return;
+        }
+    }
+}
+
+void mpc_decoder_setup(mpc_decoder *d, mpc_reader *r)
+{
+  d->r = r;
+
+  d->HuffQ[0][0] = 0;
+  d->HuffQ[1][0] = 0;
+  d->HuffQ[0][1] = d->HuffQ1[0];
+  d->HuffQ[1][1] = d->HuffQ1[1];
+  d->HuffQ[0][2] = d->HuffQ2[0];
+  d->HuffQ[1][2] = d->HuffQ2[1];
+  d->HuffQ[0][3] = d->HuffQ3[0];
+  d->HuffQ[1][3] = d->HuffQ3[1];
+  d->HuffQ[0][4] = d->HuffQ4[0];
+  d->HuffQ[1][4] = d->HuffQ4[1];
+  d->HuffQ[0][5] = d->HuffQ5[0];
+  d->HuffQ[1][5] = d->HuffQ5[1];
+  d->HuffQ[0][6] = d->HuffQ6[0];
+  d->HuffQ[1][6] = d->HuffQ6[1];
+  d->HuffQ[0][7] = d->HuffQ7[0];
+  d->HuffQ[1][7] = d->HuffQ7[1];
+
+  d->SampleHuff[0] = NULL;
+  d->SampleHuff[1] = d->Entropie_1;
+  d->SampleHuff[2] = d->Entropie_2;
+  d->SampleHuff[3] = d->Entropie_3;
+  d->SampleHuff[4] = d->Entropie_4;
+  d->SampleHuff[5] = d->Entropie_5;
+  d->SampleHuff[6] = d->Entropie_6;
+  d->SampleHuff[7] = d->Entropie_7;
+  d->SampleHuff[8] = NULL;
+  d->SampleHuff[9] = NULL;
+  d->SampleHuff[10] = NULL;
+  d->SampleHuff[11] = NULL;
+  d->SampleHuff[12] = NULL;
+  d->SampleHuff[13] = NULL;
+  d->SampleHuff[14] = NULL;
+  d->SampleHuff[15] = NULL;
+  d->SampleHuff[16] = NULL;
+  d->SampleHuff[17] = NULL;
+
+  d->EQ_activated = 0;
+  d->MPCHeaderPos = 0;
+  d->StreamVersion = 0;
+  d->MS_used = 0;
+  d->FwdJumpInfo = 0;
+  d->ActDecodePos = 0;
+  d->FrameWasValid = 0;
+  d->OverallFrames = 0;
+  d->DecodedFrames = 0;
+  d->LastValidSamples = 0;
+  d->TrueGaplessPresent = 0;
+  d->WordsRead = 0;
+  d->Max_Band = 0;
+  d->SampleRate = 0;
+//  clips = 0;
+  d->__r1 = 1;
+  d->__r2 = 1;
+
+  d->dword = 0;
+  d->pos = 0;
+  d->Zaehler = 0;
+  d->WordsRead = 0;
+  d->Max_Band = 0;
+
+  mpc_decoder_initialisiere_quantisierungstabellen(d, 1.0f);
+  mpc_decoder_init_huffman_sv6(d);
+  mpc_decoder_init_huffman_sv7(d);
+}
+
+void mpc_decoder_set_streaminfo(mpc_decoder *d, mpc_streaminfo *si)
+{
+    mpc_decoder_reset_synthesis(d);
+    mpc_decoder_reset_globals(d);
+
+    d->StreamVersion      = si->stream_version;
+    d->MS_used            = si->ms;
+    d->Max_Band           = si->max_band;
+    d->OverallFrames      = si->frames;
+    d->MPCHeaderPos       = si->header_position;
+    d->LastValidSamples   = si->last_frame_samples;
+    d->TrueGaplessPresent = si->is_true_gapless;
+    d->SampleRate         = (mpc_int32_t)si->sample_freq;
+
+    d->samples_to_skip = MPC_DECODER_SYNTH_DELAY;
+}
+
+mpc_bool_t mpc_decoder_initialize(mpc_decoder *d, mpc_streaminfo *si) 
+{
+    mpc_decoder_set_streaminfo(d, si);
+
+    // AB: setting position to the beginning of the data-bitstream
+    switch (d->StreamVersion) {
+    case 0x04: f_seek(d, 4 + d->MPCHeaderPos); d->pos = 16; break;  // Geht auch über eine der Helperfunktionen
+    case 0x05:
+    case 0x06: f_seek(d, 8 + d->MPCHeaderPos); d->pos =  0; break;
+    case 0x07:
+    case 0x17: /*f_seek ( 24 + d->MPCHeaderPos );*/ d->pos =  8; break;
+    default: return FALSE;
+    }
+
+    // AB: fill buffer and initialize decoder
+    f_read_dword(d, d->Speicher, MEMSIZE );
+    d->dword = d->Speicher[d->Zaehler = 0];
+
+    return TRUE;
+}
+
+//---------------------------------------------------------------
+// will seek from the beginning of the file to the desired
+// position in ms (given by seek_needed)
+//---------------------------------------------------------------
+#if 0
+static void
+helper1(mpc_decoder *d, mpc_uint32_t bitpos) 
+{
+    f_seek(d, (bitpos >> 5) * 4 + d->MPCHeaderPos);
+    f_read_dword(d, d->Speicher, 2);
+    d->dword = d->Speicher[d->Zaehler = 0];
+    d->pos = bitpos & 31;
+}
+#endif
+
+static void
+helper2(mpc_decoder *d, mpc_uint32_t bitpos) 
+{
+    f_seek(d, (bitpos>>5) * 4 + d->MPCHeaderPos);
+    f_read_dword(d, d->Speicher, MEMSIZE);
+    d->dword = d->Speicher[d->Zaehler = 0];
+    d->pos = bitpos & 31;
+}
+
+#if 0
+static void
+helper3(mpc_decoder *d, mpc_uint32_t bitpos, mpc_uint32_t* buffoffs) 
+{
+    d->pos = bitpos & 31;
+    bitpos >>= 5;
+    if ((mpc_uint32_t)(bitpos - *buffoffs) >= MEMSIZE - 2) {
+        *buffoffs = bitpos;
+        f_seek(d, bitpos * 4L + d->MPCHeaderPos);
+        f_read_dword(d, d->Speicher, MEMSIZE );
+    }
+    d->dword = d->Speicher[d->Zaehler = bitpos - *buffoffs ];
+}
+#endif
+
+static mpc_uint32_t get_initial_fpos(mpc_decoder *d, mpc_uint32_t StreamVersion)
+{
+    mpc_uint32_t fpos = 0;
+    (void) StreamVersion;
+    switch ( d->StreamVersion ) {                                                  // setting position to the beginning of the data-bitstream
+    case  0x04: fpos =  48; break;
+    case  0x05:
+    case  0x06: fpos =  64; break;
+    case  0x07:
+    case  0x17: fpos = 200; break;
+    }
+    return fpos;
+}
+
+mpc_bool_t mpc_decoder_seek_seconds(mpc_decoder *d, double seconds) 
+{
+    return mpc_decoder_seek_sample(d, (mpc_int64_t)(seconds * (double)d->SampleRate + 0.5));
+}
+
+mpc_bool_t mpc_decoder_seek_sample(mpc_decoder *d, mpc_int64_t destsample) 
+{
+    mpc_uint32_t fpos;
+    mpc_uint32_t fwd;
+
+    fwd = (mpc_uint32_t) (destsample / MPC_FRAME_LENGTH);
+    d->samples_to_skip = MPC_DECODER_SYNTH_DELAY + (mpc_uint32_t)(destsample % MPC_FRAME_LENGTH);
+
+    memset(d->Y_L          , 0, sizeof d->Y_L           );
+    memset(d->Y_R          , 0, sizeof d->Y_R           );
+    memset(d->SCF_Index_L     , 0, sizeof d->SCF_Index_L      );
+    memset(d->SCF_Index_R     , 0, sizeof d->SCF_Index_R      );
+    memset(d->Res_L           , 0, sizeof d->Res_L            );
+    memset(d->Res_R           , 0, sizeof d->Res_R            );
+    memset(d->SCFI_L          , 0, sizeof d->SCFI_L           );
+    memset(d->SCFI_R          , 0, sizeof d->SCFI_R           );
+    memset(d->DSCF_Flag_L     , 0, sizeof d->DSCF_Flag_L      );
+    memset(d->DSCF_Flag_R     , 0, sizeof d->DSCF_Flag_R      );
+    memset(d->DSCF_Reference_L, 0, sizeof d->DSCF_Reference_L );
+    memset(d->DSCF_Reference_R, 0, sizeof d->DSCF_Reference_R );
+    memset(d->Q               , 0, sizeof d->Q                );
+    memset(d->MS_Flag         , 0, sizeof d->MS_Flag          );
+
+    // resetting synthesis filter to avoid "clicks"
+    mpc_decoder_reset_synthesis(d);
+
+    // prevent from desired position out of allowed range
+    fwd = fwd < d->OverallFrames  ?  fwd  :  d->OverallFrames;
+
+    // reset number of decoded frames
+    d->DecodedFrames = 0;
+
+    fpos = get_initial_fpos(d, d->StreamVersion);
+    if (fpos == 0) {
+        return FALSE;
+    }
+
+    helper2(d, fpos);
+
+    // read the last 32 frames before the desired position to scan the scalefactors (artifactless jumping)
+    for ( ; d->DecodedFrames < fwd; d->DecodedFrames++ ) {
+        mpc_uint32_t   FrameBitCnt;
+        mpc_uint32_t   RING;
+        RING         = d->Zaehler;
+        d->FwdJumpInfo  = mpc_decoder_bitstream_read(d, 20);    // read jump-info
+        d->ActDecodePos = (d->Zaehler << 5) + d->pos;
+        FrameBitCnt  = mpc_decoder_bits_read(d);  // scanning the scalefactors and check for validity of frame
+        if (d->StreamVersion >= 7)  {
+            mpc_decoder_read_bitstream_sv7(d);
+        }
+        else {
+            mpc_decoder_read_bitstream_sv6(d);
+        }
+        if (mpc_decoder_bits_read(d) - FrameBitCnt != d->FwdJumpInfo ) {
+            // Box ("Bug in perform_jump");
+            return FALSE;
+        }
+        // update buffer
+        if ((RING ^ d->Zaehler) & MEMSIZE2) {
+            f_read_dword(d, d->Speicher + (RING & MEMSIZE2),  MEMSIZE2);
+        }
+    }
+
+    // LastBitsRead = BitsRead ();
+    // LastFrame = d->DecodedFrames;
+
+    return TRUE;
+}
+
+void mpc_decoder_update_buffer(mpc_decoder *d, mpc_uint32_t RING) 
+{
+    if ((RING ^ d->Zaehler) & MEMSIZE2 ) {
+        // update buffer
+        f_read_dword(d, d->Speicher + (RING & MEMSIZE2), MEMSIZE2);
+    }
+}
+
+
Index: /libmpcdec/tags/release-1.2.1/src/mpc_reader.c
===================================================================
--- /libmpcdec/tags/release-1.2.1/src/mpc_reader.c	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/src/mpc_reader.c	(revision 30)
@@ -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.
+*/
+
+/// \file mpc_reader.c
+/// Contains implementations for simple file-based mpc_reader
+
+#include <mpcdec/mpcdec.h>
+
+/// mpc_reader callback implementations
+static mpc_int32_t
+read_impl(void *data, void *ptr, mpc_int32_t size)
+{
+    mpc_reader_file *d = (mpc_reader_file *) data;
+
+    return fread(ptr, 1, size, d->file);
+}
+
+static mpc_bool_t
+seek_impl(void *data, mpc_int32_t offset)
+{
+    mpc_reader_file *d = (mpc_reader_file *) data;
+
+    return d->is_seekable ? !fseek(d->file, offset, SEEK_SET) : FALSE;
+}
+
+static mpc_int32_t
+tell_impl(void *data)
+{
+    mpc_reader_file *d = (mpc_reader_file *) data;
+
+    return ftell(d->file);
+}
+
+static mpc_int32_t
+get_size_impl(void *data)
+{
+    mpc_reader_file *d = (mpc_reader_file *) data;
+
+    return d->file_size;
+}
+
+static mpc_bool_t
+canseek_impl(void *data)
+{
+    mpc_reader_file *d = (mpc_reader_file *) data;
+
+    return d->is_seekable;
+}
+
+void
+mpc_reader_setup_file_reader(mpc_reader_file *p_reader, FILE *input)
+{
+    p_reader->reader.seek = seek_impl;
+    p_reader->reader.read = read_impl;
+    p_reader->reader.tell = tell_impl;
+    p_reader->reader.get_size = get_size_impl;
+    p_reader->reader.canseek = canseek_impl;
+    p_reader->reader.data = p_reader; // point back to ourselves
+
+    p_reader->file = input;
+    p_reader->is_seekable = TRUE;
+    fseek(input, 0, SEEK_END);
+    p_reader->file_size = ftell(input);
+    fseek(input, 0, SEEK_SET);
+}
Index: /libmpcdec/tags/release-1.2.1/src/requant.c
===================================================================
--- /libmpcdec/tags/release-1.2.1/src/requant.c	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/src/requant.c	(revision 30)
@@ -0,0 +1,152 @@
+/*
+  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.c
+/// Requantization function implementations.
+/// \todo document me
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/internal.h>
+
+/* C O N S T A N T S */
+// bits per sample for chosen quantizer
+const mpc_uint32_t  Res_bit [18] = {
+    0,  0,  0,  0,  0,  0,  0,  0,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16
+};
+
+// coefficients for requantization
+// 65536/step bzw. 65536/(2*D+1)
+
+#define _(X) MAKE_MPC_SAMPLE_EX(X,14)
+
+const MPC_SAMPLE_FORMAT  __Cc [1 + 18] = {
+      _(111.285962475327f),                                        // 32768/2/255*sqrt(3)
+    _(65536.000000000000f), _(21845.333333333332f), _(13107.200000000001f), _(9362.285714285713f),
+    _(7281.777777777777f),  _(4369.066666666666f),  _(2114.064516129032f), _(1040.253968253968f),
+     _(516.031496062992f),  _(257.003921568627f),   _(128.250489236790f),   _(64.062561094819f),
+       _(32.015632633121f),    _(16.003907203907f),     _(8.000976681723f),    _(4.000244155527f),
+        _(2.000061037018f),     _(1.000015259021f)
+};
+
+#undef _
+
+// offset for requantization
+// 2*D+1 = steps of quantizer
+const mpc_int32_t  __Dc [1 + 18] = {
+      2,
+      0,     1,     2,     3,     4,     7,    15,    31,    63,
+    127,   255,   511,  1023,  2047,  4095,  8191, 16383, 32767
+};
+
+#ifdef MPC_FIXED_POINT
+static mpc_uint32_t find_shift(double fval)
+{
+	mpc_int64_t val = (mpc_int64_t)fval;
+	if (val<0) val = -val;
+	mpc_uint32_t ptr = 0;
+	while(val) {val>>=1;ptr++;}
+
+	return ptr > 31 ? 0 : 31 - ptr;
+}
+#endif
+
+/* F U N C T I O N S */
+
+#define SET_SCF(N,X) d->SCF[N] = MAKE_MPC_SAMPLE_EX(X,d->SCF_shift[N] = (unsigned char)find_shift(X));
+
+void
+mpc_decoder_scale_output(mpc_decoder *d, double factor) 
+{
+    mpc_int32_t     n;
+    double  f1;
+    double  f2;
+#ifndef MPC_FIXED_POINT
+	factor *= 1.0 / (double)(1<<(MPC_FIXED_POINT_SHIFT-1));
+#else
+	factor *= 1.0 / (double)(1<<(16 - MPC_FIXED_POINT_SHIFT));
+#endif
+    f1 = f2 = factor;
+
+    // handles +1.58...-98.41 dB, where's scf[n] / scf[n-1] = 1.20050805774840750476
+	
+	SET_SCF(1,factor);
+
+	f1 *=   0.83298066476582673961;
+	f2 *= 1/0.83298066476582673961;
+
+    for ( n = 1; n <= 128; n++ ) {
+		SET_SCF((unsigned char)(1+n),f1);
+		SET_SCF((unsigned char)(1-n),f2);
+        f1 *=   0.83298066476582673961;
+        f2 *= 1/0.83298066476582673961;
+    }
+}
+
+static void
+mpc_decoder_quantisierungsmodes(mpc_decoder *d) // conversion: index -> quantizer (bitstream reading)
+{                                               // conversion: quantizer -> index (bitstream writing)
+    mpc_int32_t  Band = 0;
+    mpc_int32_t  i;
+
+    do {
+        d->Q_bit [Band] = 4;
+        for ( i = 0; i < 16-1; i++ )
+            d->Q_res [Band] [i] = i;
+        d->Q_res [Band][i] = 17;
+        Band++;
+    } while ( Band < 11 );
+
+    do {
+        d->Q_bit [Band] = 3;
+        for ( i = 0; i < 8-1; i++ )
+            d->Q_res [Band] [i] = i;
+        d->Q_res [Band] [i] = 17;
+        Band++;
+    } while ( Band < 23 );
+
+    do {
+        d->Q_bit [Band] = 2;
+        for ( i = 0; i < 4-1; i++ )
+            d->Q_res [Band] [i] = i;
+        d->Q_res [Band] [i] = 17;
+        Band++;
+    } while ( Band < 32 );
+}
+
+void
+mpc_decoder_initialisiere_quantisierungstabellen(mpc_decoder *d, double scale_factor) 
+{
+    mpc_decoder_quantisierungsmodes(d);
+    mpc_decoder_scale_output(d, scale_factor);
+}
Index: /libmpcdec/tags/release-1.2.1/src/sample.cpp
===================================================================
--- /libmpcdec/tags/release-1.2.1/src/sample.cpp	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/src/sample.cpp	(revision 30)
@@ -0,0 +1,328 @@
+/*
+  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.
+*/
+
+#include <stdio.h>
+#include <assert.h>
+#include <time.h>
+
+#include <mpcdec/mpcdec.h>
+
+/*
+  The data bundle we pass around with our reader to store file
+  position and size etc. 
+*/
+typedef struct reader_data_t {
+    FILE *file;
+    long size;
+    mpc_bool_t seekable;
+} reader_data;
+
+/*
+  Our implementations of the mpc_reader callback functions.
+*/
+mpc_int32_t
+read_impl(void *data, void *ptr, mpc_int32_t size)
+{
+    reader_data *d = (reader_data *) data;
+    return fread(ptr, 1, size, d->file);
+}
+
+mpc_bool_t
+seek_impl(void *data, mpc_int32_t offset)
+{
+    reader_data *d = (reader_data *) data;
+    return d->seekable ? !fseek(d->file, offset, SEEK_SET) : false;
+}
+
+mpc_int32_t
+tell_impl(void *data)
+{
+    reader_data *d = (reader_data *) data;
+    return ftell(d->file);
+}
+
+mpc_int32_t
+get_size_impl(void *data)
+{
+    reader_data *d = (reader_data *) data;
+    return d->size;
+}
+
+mpc_bool_t
+canseek_impl(void *data)
+{
+    reader_data *d = (reader_data *) data;
+    return d->seekable;
+}
+
+#define WFX_SIZE (2+2+4+4+2+2)
+
+#ifdef MPC_FIXED_POINT
+static int
+shift_signed(MPC_SAMPLE_FORMAT val, int shift)
+{
+    if (shift > 0)
+        val <<= shift;
+    else if (shift < 0)
+        val >>= -shift;
+    return (int)val;
+}
+#endif
+
+class WavWriter {
+  public:
+    WavWriter(FILE * p_output, unsigned p_nch, unsigned p_bps,
+              unsigned p_srate)
+    : m_file(p_output), m_nch(p_nch), m_bps(p_bps), m_srate(p_srate) {
+        assert(m_bps == 16 || m_bps == 24);
+
+        WriteRaw("RIFF", 4);
+        WriteDword(0);          //fix this in destructor
+
+        WriteRaw("WAVE", 4);
+        WriteRaw("fmt ", 4);
+        WriteDword(WFX_SIZE);
+
+        WriteWord(1);           //WAVE_FORMAT_PCM
+        WriteWord(m_nch);
+        WriteDword(m_srate);
+        WriteDword(m_srate * m_nch * (m_bps >> 3));
+        WriteWord(m_nch * (m_bps >> 3));
+        WriteWord(m_bps);
+        /*
+           WORD  wFormatTag; 
+           WORD  nChannels; 
+           DWORD nSamplesPerSec; 
+           DWORD nAvgBytesPerSec; 
+           WORD  nBlockAlign; 
+           WORD  wBitsPerSample; 
+         */
+        WriteRaw("data", 4);
+        WriteDword(0);          //fix this in destructor
+
+        m_data_bytes_written = 0;
+    } mpc_bool_t WriteSamples(const MPC_SAMPLE_FORMAT * p_buffer, unsigned p_size) {
+        unsigned n;
+        int clip_min = -1 << (m_bps - 1),
+            clip_max = (1 << (m_bps - 1)) - 1, float_scale = 1 << (m_bps - 1);
+        for (n = 0; n < p_size; n++) {
+            int val;
+#ifdef MPC_FIXED_POINT
+            val =
+                shift_signed(p_buffer[n],
+                             m_bps - MPC_FIXED_POINT_SCALE_SHIFT);
+#else
+            val = (int)(p_buffer[n] * float_scale);
+#endif
+            if (val < clip_min)
+                val = clip_min;
+            else if (val > clip_max)
+                val = clip_max;
+            if (!WriteInt(val, m_bps))
+                return false;
+        }
+        m_data_bytes_written += p_size * (m_bps >> 3);
+        return true;
+    }
+
+    ~WavWriter() {
+        if (m_data_bytes_written & 1) {
+            char blah = 0;
+            WriteRaw(&blah, 1);
+            m_data_bytes_written++;
+        }
+        Seek(4);
+        WriteDword((unsigned long)(m_data_bytes_written + 4 + 8 + WFX_SIZE +
+                                   8));
+        Seek(8 + 4 + 8 + WFX_SIZE + 4);
+        WriteDword(m_data_bytes_written);
+    }
+
+  private:
+
+    mpc_bool_t Seek(unsigned p_offset) {
+        return !fseek(m_file, p_offset, SEEK_SET);
+    }
+
+    mpc_bool_t WriteRaw(const void *p_buffer, unsigned p_bytes) {
+        return fwrite(p_buffer, 1, p_bytes, m_file) == p_bytes;
+    }
+
+    mpc_bool_t WriteDword(unsigned long p_val) {
+        return WriteInt(p_val, 32);
+    }
+    mpc_bool_t WriteWord(unsigned short p_val) {
+        return WriteInt(p_val, 16);
+    }
+
+    // write a little-endian number properly
+    mpc_bool_t WriteInt(unsigned int p_val, unsigned p_width_bits) {
+        unsigned char temp;
+        unsigned shift = 0;
+        assert((p_width_bits % 8) == 0);
+        do {
+            temp = (unsigned char)((p_val >> shift) & 0xFF);
+            if (!WriteRaw(&temp, 1))
+                return false;
+            shift += 8;
+        } while (shift < p_width_bits);
+        return true;
+    }
+
+    unsigned m_nch, m_bps, m_srate;
+    FILE *m_file;
+    unsigned m_data_bytes_written;
+};
+
+
+static void
+usage(const char *exename)
+{
+    printf
+        ("Usage: %s <infile.mpc> [<outfile.wav>]\nIf <outfile.wav> is not specified, decoder will run in benchmark mode.\n",
+         exename);
+}
+
+int
+main(int argc, char **argv)
+{
+    if (argc != 2 && argc != 3) {
+        if (argc > 0)
+            usage(argv[0]);
+        return 0;
+    }
+
+    FILE *input = fopen(argv[1], "rb");
+    FILE *output = 0;
+    if (input == 0) {
+        usage(argv[0]);
+        printf("Error opening input file: \"%s\"\n", argv[1]);
+        return 1;
+    }
+
+    if (argc == 3) {
+        output = fopen(argv[2], "wb");
+        if (output == 0) {
+            fclose(input);
+            usage(argv[0]);
+            printf("Error opening output file: \"%s\"\n", argv[2]);
+            return 1;
+        }
+    }
+
+    /* initialize our reader_data tag the reader will carry around with it */
+    reader_data data;
+    data.file = input;
+    data.seekable = true;
+    fseek(data.file, 0, SEEK_END);
+    data.size = ftell(data.file);
+    fseek(data.file, 0, SEEK_SET);
+
+    /* set up an mpc_reader linked to our function implementations */
+    mpc_decoder decoder;
+    mpc_reader reader;
+    reader.read = read_impl;
+    reader.seek = seek_impl;
+    reader.tell = tell_impl;
+    reader.get_size = get_size_impl;
+    reader.canseek = canseek_impl;
+    reader.data = &data;
+
+    /* read file's streaminfo data */
+    mpc_streaminfo info;
+    mpc_streaminfo_init(&info);
+    if (mpc_streaminfo_read(&info, &reader) != ERROR_CODE_OK) {
+        printf("Not a valid musepack file: \"%s\"\n", argv[1]);
+        return 1;
+    }
+
+    /* instantiate a decoder with our file reader */
+    mpc_decoder_setup(&decoder, &reader);
+    if (!mpc_decoder_initialize(&decoder, &info)) {
+        printf("Error initializing decoder.\n", argv[1]);
+        return 1;
+    }
+
+    /* decode the file */
+    printf("Decoding from:\n%s\nTo:\n%s\n", argv[1],
+           output ? argv[2] : "N/A");
+    WavWriter *wavwriter =
+        output ? new WavWriter(output, 2, 16, info.sample_freq) : 0;
+    MPC_SAMPLE_FORMAT sample_buffer[MPC_DECODER_BUFFER_LENGTH];
+    clock_t begin, end;
+    begin = clock();
+    unsigned total_samples = 0;
+    mpc_bool_t successful = FALSE;
+    for (;;) {
+        unsigned status = mpc_decoder_decode(&decoder, sample_buffer, 0, 0);
+        if (status == (unsigned)(-1)) {
+            //decode error
+            printf("Error decoding file.\n");
+            break;
+        }
+        else if (status == 0)   //EOF
+        {
+            successful = true;
+            break;
+        }
+        else                    //status>0
+        {
+            total_samples += status;
+            if (wavwriter) {
+                if (!wavwriter->
+                    WriteSamples(sample_buffer, status * /* stereo */ 2)) {
+                    printf("Write error.\n");
+                    break;
+                }
+            }
+        }
+    }
+
+    end = clock();
+
+    if (wavwriter) {
+        delete wavwriter;
+    }
+
+    if (successful) {
+        printf("\nFinished.\nTotal samples decoded: %u.\n", total_samples);
+        unsigned ms = (end - begin) * 1000 / CLOCKS_PER_SEC;
+        unsigned ratio =
+            (unsigned)((double)total_samples / (double)info.sample_freq /
+                       ((double)ms / 1000.0) * 100.0);
+        printf("Time: %u ms (%u.%02ux).\n", ms, ratio / 100, ratio % 100);
+    }
+
+    return 0;
+}
Index: /libmpcdec/tags/release-1.2.1/src/streaminfo.c
===================================================================
--- /libmpcdec/tags/release-1.2.1/src/streaminfo.c	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/src/streaminfo.c	(revision 30)
@@ -0,0 +1,282 @@
+/*
+  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 streaminfo.c
+/// Implementation of streaminfo reading functions.
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/internal.h>
+
+static const char *
+Stringify(mpc_uint32_t profile) // profile is 0...15, where 7...13 is used
+{
+    static const char na[] = "n.a.";
+    static const char *Names[] = {
+        na, "'Unstable/Experimental'", na, na,
+        na, "'quality 0'", "'quality 1'", "'Telephone'",
+        "'Thumb'", "'Radio'", "'Standard'", "'Xtreme'",
+        "'Insane'", "'BrainDead'", "'quality 9'", "'quality 10'"
+    };
+
+    return profile >= sizeof(Names) / sizeof(*Names) ? na : Names[profile];
+}
+
+void
+mpc_streaminfo_init(mpc_streaminfo * si)
+{
+    memset(si, 0, sizeof(mpc_streaminfo));
+}
+
+// read information from SV8 header
+// not yet implemented
+static mpc_int32_t
+streaminfo_read_header_sv8(mpc_streaminfo * si, mpc_reader * fp)
+{
+    (void) si;
+    (void) fp;
+    return 0;
+}
+
+/// Reads streaminfo from SV7 header. 
+static mpc_int32_t
+streaminfo_read_header_sv7(mpc_streaminfo * si, mpc_uint32_t HeaderData[8])
+{
+    const mpc_int32_t samplefreqs[4] = { 44100, 48000, 37800, 32000 };
+
+    //mpc_uint32_t    HeaderData [8];
+    mpc_uint16_t Estimatedpeak_title = 0;
+
+    if (si->stream_version > 0x71) {
+        //        Update (si->stream_version);
+        return 0;
+    }
+
+    /*
+       if ( !fp->seek ( si->header_position ) )         // seek to header start
+       return ERROR_CODE_FILE;
+       if ( fp->read ( HeaderData, sizeof HeaderData) != sizeof HeaderData )
+       return ERROR_CODE_FILE;
+     */
+
+    si->bitrate = 0;
+    si->frames = HeaderData[1];
+    si->is = 0;
+    si->ms = (HeaderData[2] >> 30) & 0x0001;
+    si->max_band = (HeaderData[2] >> 24) & 0x003F;
+    si->block_size = 1;
+    si->profile = (HeaderData[2] << 8) >> 28;
+    si->profile_name = Stringify(si->profile);
+    si->sample_freq = samplefreqs[(HeaderData[2] >> 16) & 0x0003];
+    Estimatedpeak_title = (mpc_uint16_t) (HeaderData[2] & 0xFFFF);   // read the ReplayGain data
+    si->gain_title = (mpc_uint16_t) ((HeaderData[3] >> 16) & 0xFFFF);
+    si->peak_title = (mpc_uint16_t) (HeaderData[3] & 0xFFFF);
+    si->gain_album = (mpc_uint16_t) ((HeaderData[4] >> 16) & 0xFFFF);
+    si->peak_album = (mpc_uint16_t) (HeaderData[4] & 0xFFFF);
+    si->is_true_gapless = (HeaderData[5] >> 31) & 0x0001; // true gapless: used?
+    si->last_frame_samples = (HeaderData[5] >> 20) & 0x07FF;  // true gapless: valid samples for last frame
+    si->encoder_version = (HeaderData[6] >> 24) & 0x00FF;
+
+    if (si->encoder_version == 0) {
+        sprintf(si->encoder, "Buschmann 1.7.0...9, Klemm 0.90...1.05");
+    }
+    else {
+        switch (si->encoder_version % 10) {
+        case 0:
+            sprintf(si->encoder, "Release %u.%u", si->encoder_version / 100,
+                    si->encoder_version / 10 % 10);
+            break;
+        case 2:
+        case 4:
+        case 6:
+        case 8:
+            sprintf(si->encoder, "Beta %u.%02u", si->encoder_version / 100,
+                    si->encoder_version % 100);
+            break;
+        default:
+            sprintf(si->encoder, "--Alpha-- %u.%02u",
+                    si->encoder_version / 100, si->encoder_version % 100);
+            break;
+        }
+    }
+
+    //    if ( si->peak_title == 0 )                                      // there is no correct peak_title contained within header
+    //        si->peak_title = (mpc_uint16_t)(Estimatedpeak_title * 1.18);
+    //    if ( si->peak_album == 0 )
+    //        si->peak_album = si->peak_title;                          // no correct peak_album, use peak_title
+
+    //si->sample_freq    = 44100;                                     // AB: used by all files up to SV7
+    si->channels = 2;
+
+    return ERROR_CODE_OK;
+}
+
+// read information from SV4-SV6 header
+static mpc_int32_t
+streaminfo_read_header_sv6(mpc_streaminfo * si, mpc_uint32_t HeaderData[8])
+{
+    //mpc_uint32_t    HeaderData [8];
+
+    /*
+       if ( !fp->seek (  si->header_position ) )         // seek to header start
+       return ERROR_CODE_FILE;
+       if ( fp->read ( HeaderData, sizeof HeaderData ) != sizeof HeaderData )
+       return ERROR_CODE_FILE;
+     */
+
+    si->bitrate = (HeaderData[0] >> 23) & 0x01FF;   // read the file-header (SV6 and below)
+    si->is = (HeaderData[0] >> 22) & 0x0001;
+    si->ms = (HeaderData[0] >> 21) & 0x0001;
+    si->stream_version = (HeaderData[0] >> 11) & 0x03FF;
+    si->max_band = (HeaderData[0] >> 6) & 0x001F;
+    si->block_size = (HeaderData[0]) & 0x003F;
+    si->profile = 0;
+    si->profile_name = Stringify((mpc_uint32_t) (-1));
+    if (si->stream_version >= 5)
+        si->frames = HeaderData[1]; // 32 bit
+    else
+        si->frames = (HeaderData[1] >> 16); // 16 bit
+
+    si->gain_title = 0;          // not supported
+    si->peak_title = 0;
+    si->gain_album = 0;
+    si->peak_album = 0;
+
+    si->last_frame_samples = 0;
+    si->is_true_gapless = 0;
+
+    si->encoder_version = 0;
+    si->encoder[0] = '\0';
+
+    if (si->stream_version == 7)
+        return ERROR_CODE_SV7BETA;  // are there any unsupported parameters used?
+    if (si->bitrate != 0)
+        return ERROR_CODE_CBR;
+    if (si->is != 0)
+        return ERROR_CODE_IS;
+    if (si->block_size != 1)
+        return ERROR_CODE_BLOCKSIZE;
+
+    if (si->stream_version < 6) // Bugfix: last frame was invalid for up to SV5
+        si->frames -= 1;
+
+    si->sample_freq = 44100;     // AB: used by all files up to SV7
+    si->channels = 2;
+
+    if (si->stream_version < 4 || si->stream_version > 7)
+        return ERROR_CODE_INVALIDSV;
+
+    return ERROR_CODE_OK;
+}
+
+// reads file header and tags
+mpc_int32_t
+mpc_streaminfo_read(mpc_streaminfo * si, mpc_reader * r)
+{
+    mpc_uint32_t HeaderData[8];
+    mpc_int32_t Error = 0;
+
+    // get header position
+    if ((si->header_position = JumpID3v2(r)) < 0) {
+        return ERROR_CODE_FILE;
+    }
+    // seek to first byte of mpc data
+    if (!r->seek(r->data, si->header_position)) {
+        return ERROR_CODE_FILE;
+    }
+    if (r->read(r->data, HeaderData, 8 * 4) != 8 * 4) {
+        return ERROR_CODE_FILE;
+    }
+    if (!r->seek(r->data, si->header_position + 6 * 4)) {
+        return ERROR_CODE_FILE;
+    }
+
+    si->total_file_length = r->get_size(r->data);
+    si->tag_offset = si->total_file_length;
+    if (memcmp(HeaderData, "MP+", 3) == 0) {
+#ifndef MPC_LITTLE_ENDIAN
+        mpc_uint32_t ptr;
+        for (ptr = 0; ptr < 8; ptr++) {
+            HeaderData[ptr] = swap32(HeaderData[ptr]);
+        }
+#endif
+        si->stream_version = HeaderData[0] >> 24;
+
+        // stream version 8
+        if ((si->stream_version & 15) >= 8) {
+            Error = streaminfo_read_header_sv8(si, r);
+        }
+        // stream version 7
+        else if ((si->stream_version & 15) == 7) {
+            Error = streaminfo_read_header_sv7(si, HeaderData);
+        }
+    }
+    else {
+        // stream version 4-6
+        Error = streaminfo_read_header_sv6(si, HeaderData);
+    }
+
+    // estimation, exact value needs too much time
+    si->pcm_samples = 1152 * si->frames - 576;
+
+    if (si->pcm_samples > 0) {
+        si->average_bitrate =
+            (si->tag_offset -
+             si->header_position) * 8.0 * si->sample_freq / si->pcm_samples;
+    }
+    else {
+        si->average_bitrate = 0;
+    }
+
+    return Error;
+}
+
+double
+mpc_streaminfo_get_length(mpc_streaminfo * si)
+{
+    return (double)mpc_streaminfo_get_length_samples(si) /
+        (double)si->sample_freq;
+}
+
+mpc_int64_t
+mpc_streaminfo_get_length_samples(mpc_streaminfo * si)
+{
+    mpc_int64_t samples = (mpc_int64_t) si->frames * MPC_FRAME_LENGTH;
+    if (si->is_true_gapless) {
+        samples -= (MPC_FRAME_LENGTH - si->last_frame_samples);
+    }
+    else {
+        samples -= MPC_DECODER_SYNTH_DELAY;
+    }
+    return samples;
+}
Index: /libmpcdec/tags/release-1.2.1/src/synth_filter.c
===================================================================
--- /libmpcdec/tags/release-1.2.1/src/synth_filter.c	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/src/synth_filter.c	(revision 30)
@@ -0,0 +1,442 @@
+/*
+  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 synth_filter.c
+/// Synthesis functions.
+/// \todo document me
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/internal.h>
+
+typedef mpc_int32_t ptrdiff_t;
+
+/* C O N S T A N T S */
+#undef _
+
+#define MPC_FIXED_POINT_SYNTH_FIX 2
+
+#ifdef MPC_FIXED_POINT
+#define _(value)  MPC_MAKE_FRACT_CONST((double)value/(double)(0x40000))
+#else
+#define _(value)  MAKE_MPC_SAMPLE((double)value/(double)(0x10000))
+#endif
+
+
+static const MPC_SAMPLE_FORMAT  Di_opt [32] [16] = {
+    { _(  0), _( -29), _( 213), _( -459), _( 2037), _(-5153), _(  6574), _(-37489), _(75038), _(37489), _(6574), _( 5153), _(2037), _( 459), _(213), _(29) },
+    { _( -1), _( -31), _( 218), _( -519), _( 2000), _(-5517), _(  5959), _(-39336), _(74992), _(35640), _(7134), _( 4788), _(2063), _( 401), _(208), _(26) },
+    { _( -1), _( -35), _( 222), _( -581), _( 1952), _(-5879), _(  5288), _(-41176), _(74856), _(33791), _(7640), _( 4425), _(2080), _( 347), _(202), _(24) },
+    { _( -1), _( -38), _( 225), _( -645), _( 1893), _(-6237), _(  4561), _(-43006), _(74630), _(31947), _(8092), _( 4063), _(2087), _( 294), _(196), _(21) },
+    { _( -1), _( -41), _( 227), _( -711), _( 1822), _(-6589), _(  3776), _(-44821), _(74313), _(30112), _(8492), _( 3705), _(2085), _( 244), _(190), _(19) },
+    { _( -1), _( -45), _( 228), _( -779), _( 1739), _(-6935), _(  2935), _(-46617), _(73908), _(28289), _(8840), _( 3351), _(2075), _( 197), _(183), _(17) },
+    { _( -1), _( -49), _( 228), _( -848), _( 1644), _(-7271), _(  2037), _(-48390), _(73415), _(26482), _(9139), _( 3004), _(2057), _( 153), _(176), _(16) },
+    { _( -2), _( -53), _( 227), _( -919), _( 1535), _(-7597), _(  1082), _(-50137), _(72835), _(24694), _(9389), _( 2663), _(2032), _( 111), _(169), _(14) },
+    { _( -2), _( -58), _( 224), _( -991), _( 1414), _(-7910), _(    70), _(-51853), _(72169), _(22929), _(9592), _( 2330), _(2001), _(  72), _(161), _(13) },
+    { _( -2), _( -63), _( 221), _(-1064), _( 1280), _(-8209), _(  -998), _(-53534), _(71420), _(21189), _(9750), _( 2006), _(1962), _(  36), _(154), _(11) },
+    { _( -2), _( -68), _( 215), _(-1137), _( 1131), _(-8491), _( -2122), _(-55178), _(70590), _(19478), _(9863), _( 1692), _(1919), _(   2), _(147), _(10) },
+    { _( -3), _( -73), _( 208), _(-1210), _(  970), _(-8755), _( -3300), _(-56778), _(69679), _(17799), _(9935), _( 1388), _(1870), _( -29), _(139), _( 9) },
+    { _( -3), _( -79), _( 200), _(-1283), _(  794), _(-8998), _( -4533), _(-58333), _(68692), _(16155), _(9966), _( 1095), _(1817), _( -57), _(132), _( 8) },
+    { _( -4), _( -85), _( 189), _(-1356), _(  605), _(-9219), _( -5818), _(-59838), _(67629), _(14548), _(9959), _(  814), _(1759), _( -83), _(125), _( 7) },
+    { _( -4), _( -91), _( 177), _(-1428), _(  402), _(-9416), _( -7154), _(-61289), _(66494), _(12980), _(9916), _(  545), _(1698), _(-106), _(117), _( 7) },
+    { _( -5), _( -97), _( 163), _(-1498), _(  185), _(-9585), _( -8540), _(-62684), _(65290), _(11455), _(9838), _(  288), _(1634), _(-127), _(111), _( 6) },
+    { _( -5), _(-104), _( 146), _(-1567), _(  -45), _(-9727), _( -9975), _(-64019), _(64019), _( 9975), _(9727), _(   45), _(1567), _(-146), _(104), _( 5) },
+    { _( -6), _(-111), _( 127), _(-1634), _( -288), _(-9838), _(-11455), _(-65290), _(62684), _( 8540), _(9585), _( -185), _(1498), _(-163), _( 97), _( 5) },
+    { _( -7), _(-117), _( 106), _(-1698), _( -545), _(-9916), _(-12980), _(-66494), _(61289), _( 7154), _(9416), _( -402), _(1428), _(-177), _( 91), _( 4) },
+    { _( -7), _(-125), _(  83), _(-1759), _( -814), _(-9959), _(-14548), _(-67629), _(59838), _( 5818), _(9219), _( -605), _(1356), _(-189), _( 85), _( 4) },
+    { _( -8), _(-132), _(  57), _(-1817), _(-1095), _(-9966), _(-16155), _(-68692), _(58333), _( 4533), _(8998), _( -794), _(1283), _(-200), _( 79), _( 3) },
+    { _( -9), _(-139), _(  29), _(-1870), _(-1388), _(-9935), _(-17799), _(-69679), _(56778), _( 3300), _(8755), _( -970), _(1210), _(-208), _( 73), _( 3) },
+    { _(-10), _(-147), _(  -2), _(-1919), _(-1692), _(-9863), _(-19478), _(-70590), _(55178), _( 2122), _(8491), _(-1131), _(1137), _(-215), _( 68), _( 2) },
+    { _(-11), _(-154), _( -36), _(-1962), _(-2006), _(-9750), _(-21189), _(-71420), _(53534), _(  998), _(8209), _(-1280), _(1064), _(-221), _( 63), _( 2) },
+    { _(-13), _(-161), _( -72), _(-2001), _(-2330), _(-9592), _(-22929), _(-72169), _(51853), _(  -70), _(7910), _(-1414), _( 991), _(-224), _( 58), _( 2) },
+    { _(-14), _(-169), _(-111), _(-2032), _(-2663), _(-9389), _(-24694), _(-72835), _(50137), _(-1082), _(7597), _(-1535), _( 919), _(-227), _( 53), _( 2) },
+    { _(-16), _(-176), _(-153), _(-2057), _(-3004), _(-9139), _(-26482), _(-73415), _(48390), _(-2037), _(7271), _(-1644), _( 848), _(-228), _( 49), _( 1) },
+    { _(-17), _(-183), _(-197), _(-2075), _(-3351), _(-8840), _(-28289), _(-73908), _(46617), _(-2935), _(6935), _(-1739), _( 779), _(-228), _( 45), _( 1) },
+    { _(-19), _(-190), _(-244), _(-2085), _(-3705), _(-8492), _(-30112), _(-74313), _(44821), _(-3776), _(6589), _(-1822), _( 711), _(-227), _( 41), _( 1) },
+    { _(-21), _(-196), _(-294), _(-2087), _(-4063), _(-8092), _(-31947), _(-74630), _(43006), _(-4561), _(6237), _(-1893), _( 645), _(-225), _( 38), _( 1) },
+    { _(-24), _(-202), _(-347), _(-2080), _(-4425), _(-7640), _(-33791), _(-74856), _(41176), _(-5288), _(5879), _(-1952), _( 581), _(-222), _( 35), _( 1) },
+    { _(-26), _(-208), _(-401), _(-2063), _(-4788), _(-7134), _(-35640), _(-74992), _(39336), _(-5959), _(5517), _(-2000), _( 519), _(-218), _( 31), _( 1) }
+};
+
+#undef  _
+
+static void Calculate_New_V ( const MPC_SAMPLE_FORMAT * Sample, MPC_SAMPLE_FORMAT * V )
+{
+    // Calculating new V-buffer values for left channel
+    // calculate new V-values (ISO-11172-3, p. 39)
+    // based upon fast-MDCT algorithm by Byeong Gi Lee
+    /*static*/ MPC_SAMPLE_FORMAT A00, A01, A02, A03, A04, A05, A06, A07, A08, A09, A10, A11, A12, A13, A14, A15;
+    /*static*/ MPC_SAMPLE_FORMAT B00, B01, B02, B03, B04, B05, B06, B07, B08, B09, B10, B11, B12, B13, B14, B15;
+    MPC_SAMPLE_FORMAT tmp;
+
+    A00 = Sample[ 0] + Sample[31];
+    A01 = Sample[ 1] + Sample[30];
+    A02 = Sample[ 2] + Sample[29];
+    A03 = Sample[ 3] + Sample[28];
+    A04 = Sample[ 4] + Sample[27];
+    A05 = Sample[ 5] + Sample[26];
+    A06 = Sample[ 6] + Sample[25];
+    A07 = Sample[ 7] + Sample[24];
+    A08 = Sample[ 8] + Sample[23];
+    A09 = Sample[ 9] + Sample[22];
+    A10 = Sample[10] + Sample[21];
+    A11 = Sample[11] + Sample[20];
+    A12 = Sample[12] + Sample[19];
+    A13 = Sample[13] + Sample[18];
+    A14 = Sample[14] + Sample[17];
+    A15 = Sample[15] + Sample[16];
+
+    B00 = A00 + A15;
+    B01 = A01 + A14;
+    B02 = A02 + A13;
+    B03 = A03 + A12;
+    B04 = A04 + A11;
+    B05 = A05 + A10;
+    B06 = A06 + A09;
+    B07 = A07 + A08;;
+    B08 = MPC_SCALE_CONST((A00 - A15) , 0.5024192929f , 31);
+    B09 = MPC_SCALE_CONST((A01 - A14) , 0.5224986076f , 31);
+    B10 = MPC_SCALE_CONST((A02 - A13) , 0.5669440627f , 31);
+    B11 = MPC_SCALE_CONST((A03 - A12) , 0.6468217969f , 31);
+    B12 = MPC_SCALE_CONST((A04 - A11) , 0.7881546021f , 31);
+    B13 = MPC_SCALE_CONST((A05 - A10) , 1.0606776476f , 30);
+    B14 = MPC_SCALE_CONST((A06 - A09) , 1.7224471569f , 30);
+    B15 = MPC_SCALE_CONST((A07 - A08) , 5.1011486053f , 28);
+
+    A00 =  B00 + B07;
+    A01 =  B01 + B06;
+    A02 =  B02 + B05;
+    A03 =  B03 + B04;
+    A04 = MPC_SCALE_CONST((B00 - B07) , 0.5097956061f , 31);
+    A05 = MPC_SCALE_CONST((B01 - B06) , 0.6013448834f , 31);
+    A06 = MPC_SCALE_CONST((B02 - B05) , 0.8999761939f , 31);
+    A07 = MPC_SCALE_CONST((B03 - B04) , 2.5629155636f , 29);
+    A08 =  B08 + B15;
+    A09 =  B09 + B14;
+    A10 =  B10 + B13;
+    A11 =  B11 + B12;
+    A12 = MPC_SCALE_CONST((B08 - B15) , 0.5097956061f , 31);
+    A13 = MPC_SCALE_CONST((B09 - B14) , 0.6013448834f , 31);
+    A14 = MPC_SCALE_CONST((B10 - B13) , 0.8999761939f , 31);
+    A15 = MPC_SCALE_CONST((B11 - B12) , 2.5629155636f , 29);
+
+    B00 =  A00 + A03;
+    B01 =  A01 + A02;
+    B02 = MPC_MULTIPLY_FRACT_CONST_FIX((A00 - A03) , 0.5411961079f , 1);
+    B03 = MPC_MULTIPLY_FRACT_CONST_FIX((A01 - A02) , 1.3065630198f , 2);
+    B04 =  A04 + A07;
+    B05 =  A05 + A06;
+    B06 = MPC_MULTIPLY_FRACT_CONST_FIX((A04 - A07) , 0.5411961079f , 1);
+    B07 = MPC_MULTIPLY_FRACT_CONST_FIX((A05 - A06) , 1.3065630198f , 2);
+    B08 =  A08 + A11;
+    B09 =  A09 + A10;
+    B10 = MPC_MULTIPLY_FRACT_CONST_FIX((A08 - A11) , 0.5411961079f , 1);
+    B11 = MPC_MULTIPLY_FRACT_CONST_FIX((A09 - A10) , 1.3065630198f , 2);
+    B12 =  A12 + A15;
+    B13 =  A13 + A14;
+    B14 = MPC_MULTIPLY_FRACT_CONST_FIX((A12 - A15) , 0.5411961079f , 1);
+    B15 = MPC_MULTIPLY_FRACT_CONST_FIX((A13 - A14) , 1.3065630198f , 2);
+
+    A00 =  B00 + B01;
+    A01 = MPC_MULTIPLY_FRACT_CONST_FIX((B00 - B01) , 0.7071067691f , 1);
+    A02 =  B02 + B03;
+    A03 = MPC_MULTIPLY_FRACT_CONST_FIX((B02 - B03) , 0.7071067691f , 1);
+    A04 =  B04 + B05;
+    A05 = MPC_MULTIPLY_FRACT_CONST_FIX((B04 - B05) , 0.7071067691f , 1);
+    A06 =  B06 + B07;
+    A07 = MPC_MULTIPLY_FRACT_CONST_FIX((B06 - B07) , 0.7071067691f , 1);
+    A08 =  B08 + B09;
+    A09 = MPC_MULTIPLY_FRACT_CONST_FIX((B08 - B09) , 0.7071067691f , 1);
+    A10 =  B10 + B11;
+    A11 = MPC_MULTIPLY_FRACT_CONST_FIX((B10 - B11) , 0.7071067691f , 1);
+    A12 =  B12 + B13;
+    A13 = MPC_MULTIPLY_FRACT_CONST_FIX((B12 - B13) , 0.7071067691f , 1);
+    A14 =  B14 + B15;
+    A15 = MPC_MULTIPLY_FRACT_CONST_FIX((B14 - B15) , 0.7071067691f , 1);
+
+    V[48] = -A00;
+    V[ 0] =  A01;
+    V[40] = -A02 - (V[ 8] = A03);
+    V[36] = -((V[ 4] = A05 + (V[12] = A07)) + A06);
+    V[44] = - A04 - A06 - A07;
+    V[ 6] = (V[10] = A11 + (V[14] = A15)) + A13;
+    V[38] = (V[34] = -(V[ 2] = A09 + A13 + A15) - A14) + A09 - A10 - A11;
+    V[46] = (tmp = -(A12 + A14 + A15)) - A08;
+    V[42] = tmp - A10 - A11;
+
+    A00 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 0] - Sample[31]) , 0.5006030202f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A01 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 1] - Sample[30]) , 0.5054709315f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A02 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 2] - Sample[29]) , 0.5154473186f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A03 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 3] - Sample[28]) , 0.5310425758f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A04 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 4] - Sample[27]) , 0.5531039238f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A05 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 5] - Sample[26]) , 0.5829349756f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A06 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 6] - Sample[25]) , 0.6225041151f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A07 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 7] - Sample[24]) , 0.6748083234f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A08 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 8] - Sample[23]) , 0.7445362806f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A09 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 9] - Sample[22]) , 0.8393496275f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A10 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[10] - Sample[21]) , 0.9725682139f ,     MPC_FIXED_POINT_SYNTH_FIX);
+#if MPC_FIXED_POINT_SYNTH_FIX>=2
+    A11 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[11] - Sample[20]) , 1.1694399118f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A12 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[12] - Sample[19]) , 1.4841645956f ,     MPC_FIXED_POINT_SYNTH_FIX);
+#else
+    A11 = MPC_SCALE_CONST_SHR         ((Sample[11] - Sample[20]) , 1.1694399118f , 30, MPC_FIXED_POINT_SYNTH_FIX);
+    A12 = MPC_SCALE_CONST_SHR         ((Sample[12] - Sample[19]) , 1.4841645956f , 30, MPC_FIXED_POINT_SYNTH_FIX);
+#endif
+    A13 = MPC_SCALE_CONST_SHR         ((Sample[13] - Sample[18]) , 2.0577809811f , 29, MPC_FIXED_POINT_SYNTH_FIX);
+    A14 = MPC_SCALE_CONST_SHR         ((Sample[14] - Sample[17]) , 3.4076085091f , 29, MPC_FIXED_POINT_SYNTH_FIX);
+    A15 = MPC_SCALE_CONST_SHR         ((Sample[15] - Sample[16]) , 10.1900081635f, 27 ,MPC_FIXED_POINT_SYNTH_FIX);
+
+    B00 =  A00 + A15;
+    B01 =  A01 + A14;
+    B02 =  A02 + A13;
+    B03 =  A03 + A12;
+    B04 =  A04 + A11;
+    B05 =  A05 + A10;
+    B06 =  A06 + A09;
+    B07 =  A07 + A08;
+    B08 = MPC_SCALE_CONST((A00 - A15) , 0.5024192929f , 31);
+    B09 = MPC_SCALE_CONST((A01 - A14) , 0.5224986076f , 31);
+    B10 = MPC_SCALE_CONST((A02 - A13) , 0.5669440627f , 31);
+    B11 = MPC_SCALE_CONST((A03 - A12) , 0.6468217969f , 31);
+    B12 = MPC_SCALE_CONST((A04 - A11) , 0.7881546021f , 31);
+    B13 = MPC_SCALE_CONST((A05 - A10) , 1.0606776476f , 30);
+    B14 = MPC_SCALE_CONST((A06 - A09) , 1.7224471569f , 30);
+    B15 = MPC_SCALE_CONST((A07 - A08) , 5.1011486053f , 28);
+
+    A00 =  B00 + B07;
+    A01 =  B01 + B06;
+    A02 =  B02 + B05;
+    A03 =  B03 + B04;
+    A04 = MPC_SCALE_CONST((B00 - B07) , 0.5097956061f , 31);
+    A05 = MPC_SCALE_CONST((B01 - B06) , 0.6013448834f , 31);
+    A06 = MPC_SCALE_CONST((B02 - B05) , 0.8999761939f , 31);
+    A07 = MPC_SCALE_CONST((B03 - B04) , 2.5629155636f , 29);
+    A08 =  B08 + B15;
+    A09 =  B09 + B14;
+    A10 =  B10 + B13;
+    A11 =  B11 + B12;
+    A12 = MPC_SCALE_CONST((B08 - B15) , 0.5097956061f , 31);
+    A13 = MPC_SCALE_CONST((B09 - B14) , 0.6013448834f , 31);
+    A14 = MPC_SCALE_CONST((B10 - B13) , 0.8999761939f , 31);
+    A15 = MPC_SCALE_CONST((B11 - B12) , 2.5629155636f , 29);
+
+    B00 =  A00 + A03;
+    B01 =  A01 + A02;
+    B02 = MPC_SCALE_CONST((A00 - A03) , 0.5411961079f , 31);
+    B03 = MPC_SCALE_CONST((A01 - A02) , 1.3065630198f , 30);
+    B04 =  A04 + A07;
+    B05 =  A05 + A06;
+    B06 = MPC_SCALE_CONST((A04 - A07) , 0.5411961079f , 31);
+    B07 = MPC_SCALE_CONST((A05 - A06) , 1.3065630198f , 30);
+    B08 =  A08 + A11;
+    B09 =  A09 + A10;
+    B10 = MPC_SCALE_CONST((A08 - A11) , 0.5411961079f , 31);
+    B11 = MPC_SCALE_CONST((A09 - A10) , 1.3065630198f , 30);
+    B12 =  A12 + A15;
+    B13 =  A13 + A14;
+    B14 = MPC_SCALE_CONST((A12 - A15) , 0.5411961079f , 31);
+    B15 = MPC_SCALE_CONST((A13 - A14) , 1.3065630198f , 30);
+
+    A00 = MPC_SHL(B00 + B01, MPC_FIXED_POINT_SYNTH_FIX);
+    A01 = MPC_SCALE_CONST_SHL((B00 - B01) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A02 = MPC_SHL(B02 + B03, MPC_FIXED_POINT_SYNTH_FIX);
+    A03 = MPC_SCALE_CONST_SHL((B02 - B03) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A04 = MPC_SHL(B04 + B05, MPC_FIXED_POINT_SYNTH_FIX);
+    A05 = MPC_SCALE_CONST_SHL((B04 - B05) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A06 = MPC_SHL(B06 + B07, MPC_FIXED_POINT_SYNTH_FIX);
+    A07 = MPC_SCALE_CONST_SHL((B06 - B07) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A08 = MPC_SHL(B08 + B09, MPC_FIXED_POINT_SYNTH_FIX);
+    A09 = MPC_SCALE_CONST_SHL((B08 - B09) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A10 = MPC_SHL(B10 + B11, MPC_FIXED_POINT_SYNTH_FIX);
+    A11 = MPC_SCALE_CONST_SHL((B10 - B11) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A12 = MPC_SHL(B12 + B13, MPC_FIXED_POINT_SYNTH_FIX);
+    A13 = MPC_SCALE_CONST_SHL((B12 - B13) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A14 = MPC_SHL(B14 + B15, MPC_FIXED_POINT_SYNTH_FIX);
+    A15 = MPC_SCALE_CONST_SHL((B14 - B15) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+
+    // mehrfach verwendete Ausdrücke: A04+A06+A07, A09+A13+A15
+    V[ 5] = (V[11] = (V[13] = A07 + (V[15] = A15)) + A11) + A05 + A13;
+    V[ 7] = (V[ 9] = A03 + A11 + A15) + A13;
+    V[33] = -(V[ 1] = A01 + A09 + A13 + A15) - A14;
+    V[35] = -(V[ 3] = A05 + A07 + A09 + A13 + A15) - A06 - A14;
+    V[37] = (tmp = -(A10 + A11 + A13 + A14 + A15)) - A05 - A06 - A07;
+    V[39] = tmp - A02 - A03;                      // abhängig vom Befehl drüber
+    V[41] = (tmp += A13 - A12) - A02 - A03;       // abhängig vom Befehl 2 drüber
+    V[43] = tmp - A04 - A06 - A07;                // abhängig von Befehlen 1 und 3 drüber
+    V[47] = (tmp = -(A08 + A12 + A14 + A15)) - A00;
+    V[45] = tmp - A04 - A06 - A07;                // abhängig vom Befehl drüber
+
+    V[32] = -V[ 0];
+    V[31] = -V[ 1];
+    V[30] = -V[ 2];
+    V[29] = -V[ 3];
+    V[28] = -V[ 4];
+    V[27] = -V[ 5];
+    V[26] = -V[ 6];
+    V[25] = -V[ 7];
+    V[24] = -V[ 8];
+    V[23] = -V[ 9];
+    V[22] = -V[10];
+    V[21] = -V[11];
+    V[20] = -V[12];
+    V[19] = -V[13];
+    V[18] = -V[14];
+    V[17] = -V[15];
+
+    V[63] =  V[33];
+    V[62] =  V[34];
+    V[61] =  V[35];
+    V[60] =  V[36];
+    V[59] =  V[37];
+    V[58] =  V[38];
+    V[57] =  V[39];
+    V[56] =  V[40];
+    V[55] =  V[41];
+    V[54] =  V[42];
+    V[53] =  V[43];
+    V[52] =  V[44];
+    V[51] =  V[45];
+    V[50] =  V[46];
+    V[49] =  V[47];
+}
+
+static void Synthese_Filter_float_internal(MPC_SAMPLE_FORMAT * OutData,MPC_SAMPLE_FORMAT * V,const MPC_SAMPLE_FORMAT * Y)
+{
+    mpc_uint32_t n;
+    for ( n = 0; n < 36; n++, Y += 32 ) {
+        V -= 64;
+        Calculate_New_V ( Y, V );
+        {
+            MPC_SAMPLE_FORMAT * Data = OutData;
+            const MPC_SAMPLE_FORMAT *  D = (const MPC_SAMPLE_FORMAT *) &Di_opt;
+            mpc_int32_t           k;
+            //mpc_int32_t           tmp;
+
+            
+            
+            for ( k = 0; k < 32; k++, D += 16, V++ ) {
+                *Data = MPC_SHL(
+                    MPC_MULTIPLY_FRACT(V[  0],D[ 0]) + MPC_MULTIPLY_FRACT(V[ 96],D[ 1]) + MPC_MULTIPLY_FRACT(V[128],D[ 2]) + MPC_MULTIPLY_FRACT(V[224],D[ 3])
+                    + MPC_MULTIPLY_FRACT(V[256],D[ 4]) + MPC_MULTIPLY_FRACT(V[352],D[ 5]) + MPC_MULTIPLY_FRACT(V[384],D[ 6]) + MPC_MULTIPLY_FRACT(V[480],D[ 7])
+                    + MPC_MULTIPLY_FRACT(V[512],D[ 8]) + MPC_MULTIPLY_FRACT(V[608],D[ 9]) + MPC_MULTIPLY_FRACT(V[640],D[10]) + MPC_MULTIPLY_FRACT(V[736],D[11])
+                    + MPC_MULTIPLY_FRACT(V[768],D[12]) + MPC_MULTIPLY_FRACT(V[864],D[13]) + MPC_MULTIPLY_FRACT(V[896],D[14]) + MPC_MULTIPLY_FRACT(V[992],D[15])
+                    , 2);
+                
+                Data += 2;
+            }
+            V -= 32;//bleh
+            OutData+=64;
+        }
+    }
+}
+
+void
+mpc_decoder_synthese_filter_float(mpc_decoder *d, MPC_SAMPLE_FORMAT* OutData) 
+{
+    /********* left channel ********/
+    memmove(d->V_L + MPC_V_MEM, d->V_L, 960 * sizeof(MPC_SAMPLE_FORMAT) );
+
+    Synthese_Filter_float_internal(
+        OutData,
+        (MPC_SAMPLE_FORMAT *)(d->V_L + MPC_V_MEM),
+        (MPC_SAMPLE_FORMAT *)(d->Y_L [0]));
+
+    /******** right channel ********/
+    memmove(d->V_R + MPC_V_MEM, d->V_R, 960 * sizeof(MPC_SAMPLE_FORMAT) );
+
+    Synthese_Filter_float_internal(
+        OutData + 1,
+        (MPC_SAMPLE_FORMAT *)(d->V_R + MPC_V_MEM),
+        (MPC_SAMPLE_FORMAT *)(d->Y_R [0]));
+}
+
+/*******************************************/
+/*                                         */
+/*            dithered synthesis           */
+/*                                         */
+/*******************************************/
+
+static const unsigned char    Parity [256] = {  // parity
+    0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
+    1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
+    1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
+    0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
+    1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
+    0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
+    0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
+    1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0
+};
+
+/*
+ *  This is a simple random number generator with good quality for audio purposes.
+ *  It consists of two polycounters with opposite rotation direction and different
+ *  periods. The periods are coprime, so the total period is the product of both.
+ *
+ *     -------------------------------------------------------------------------------------------------
+ * +-> |31:30:29:28:27:26:25:24:23:22:21:20:19:18:17:16:15:14:13:12:11:10: 9: 8: 7: 6: 5: 4: 3: 2: 1: 0|
+ * |   -------------------------------------------------------------------------------------------------
+ * |                                                                          |  |  |  |     |        |
+ * |                                                                          +--+--+--+-XOR-+--------+
+ * |                                                                                      |
+ * +--------------------------------------------------------------------------------------+
+ *
+ *     -------------------------------------------------------------------------------------------------
+ *     |31:30:29:28:27:26:25:24:23:22:21:20:19:18:17:16:15:14:13:12:11:10: 9: 8: 7: 6: 5: 4: 3: 2: 1: 0| <-+
+ *     -------------------------------------------------------------------------------------------------   |
+ *       |  |           |  |                                                                               |
+ *       +--+----XOR----+--+                                                                               |
+ *                |                                                                                        |
+ *                +----------------------------------------------------------------------------------------+
+ *
+ *
+ *  The first has an period of 3*5*17*257*65537, the second of 7*47*73*178481,
+ *  which gives a period of 18.410.713.077.675.721.215. The result is the
+ *  XORed values of both generators.
+ */
+mpc_uint32_t
+mpc_random_int(mpc_decoder *d) 
+{
+#if 1
+    mpc_uint32_t  t1, t2, t3, t4;
+
+    t3   = t1 = d->__r1;   t4   = t2 = d->__r2;  // Parity calculation is done via table lookup, this is also available
+    t1  &= 0xF5;        t2 >>= 25;               // on CPUs without parity, can be implemented in C and avoid unpredictable
+    t1   = Parity [t1]; t2  &= 0x63;             // jumps and slow rotate through the carry flag operations.
+    t1 <<= 31;          t2   = Parity [t2];
+
+    return (d->__r1 = (t3 >> 1) | t1 ) ^ (d->__r2 = (t4 + t4) | t2 );
+#else
+    return (d->__r1 = (d->__r1 >> 1) | ((mpc_uint32_t)Parity [d->__r1 & 0xF5] << 31) ) ^
+        (d->__r2 = (d->__r2 << 1) |  (mpc_uint32_t)Parity [(d->__r2 >> 25) & 0x63] );
+#endif
+}
Index: /libmpcdec/tags/release-1.2.1/win32/libmpcdec.dsp
===================================================================
--- /libmpcdec/tags/release-1.2.1/win32/libmpcdec.dsp	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/win32/libmpcdec.dsp	(revision 30)
@@ -0,0 +1,233 @@
+# Microsoft Developer Studio Project File - Name="libmpcdec" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=libmpcdec - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "libmpcdec.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "libmpcdec.mak" CFG="libmpcdec - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "libmpcdec - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "libmpcdec - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=xicl6.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "LibRelease"
+# PROP Intermediate_Dir "LibRelease"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /W3 /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "MPC_LITTLE_ENDIAN" /FR /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=xilink6.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "LibDebug"
+# PROP Intermediate_Dir "LibDebug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "MPC_LITTLE_ENDIAN" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=xilink6.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ENDIF 
+
+# Begin Target
+
+# Name "libmpcdec - Win32 Release"
+# Name "libmpcdec - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\src\huffsv46.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\huffsv7.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\idtag.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\mpc_decoder.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\mpc_reader.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\requant.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\streaminfo.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\synth_filter.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\include\mpcdec\config_win32.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\decoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\huffman.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\internal.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\math.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\mpcdec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\reader.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\requant.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\streaminfo.h
+# End Source File
+# End Group
+# End Target
+# End Project
Index: /libmpcdec/tags/release-1.2.1/win32/libmpcdec.dsw
===================================================================
--- /libmpcdec/tags/release-1.2.1/win32/libmpcdec.dsw	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/win32/libmpcdec.dsw	(revision 30)
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "libmpcdec"=".\libmpcdec.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
Index: /libmpcdec/tags/release-1.2.1/win32/sample.dsp
===================================================================
--- /libmpcdec/tags/release-1.2.1/win32/sample.dsp	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/win32/sample.dsp	(revision 30)
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="sample" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=sample - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "sample.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "sample.mak" CFG="sample - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "sample - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "sample - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=xicl6.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "sample - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "sample___Win32_Release"
+# PROP BASE Intermediate_Dir "sample___Win32_Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "SampleRelease"
+# PROP Intermediate_Dir "SampleRelease"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmpcdec.lib /nologo /subsystem:console /machine:I386 /libpath:"libRelease"
+
+!ELSEIF  "$(CFG)" == "sample - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "sample___Win32_Debug"
+# PROP BASE Intermediate_Dir "sample___Win32_Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "SampleDebug"
+# PROP Intermediate_Dir "SampleDebug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "MPC_LITTLE_ENDIAN" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmpcdec.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"libDebug"
+# SUBTRACT LINK32 /nodefaultlib
+
+!ENDIF 
+
+# Begin Target
+
+# Name "sample - Win32 Release"
+# Name "sample - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\src\sample.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
Index: /libmpcdec/tags/release-1.2.1/win32/sample.dsw
===================================================================
--- /libmpcdec/tags/release-1.2.1/win32/sample.dsw	(revision 30)
+++ /libmpcdec/tags/release-1.2.1/win32/sample.dsw	(revision 30)
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "sample"=".\sample.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
Index: /libmpcdec/tags/release-1.2.2/AUTHORS
===================================================================
--- /libmpcdec/tags/release-1.2.2/AUTHORS	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/AUTHORS	(revision 30)
@@ -0,0 +1,10 @@
+libmpcdec is the result of the work of many people:
+
+* Andree Buschmann and Frank Klemm
+  Original implementation and core development.
+
+* Peter Pawlowski and Benoit Amiaux
+  Portability and further optimizations.
+
+* Miles Egan
+  Port to pure C, documentation, and api refinements.
Index: /libmpcdec/tags/release-1.2.2/COPYING
===================================================================
--- /libmpcdec/tags/release-1.2.2/COPYING	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/COPYING	(revision 30)
@@ -0,0 +1,31 @@
+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.
Index: /libmpcdec/tags/release-1.2.2/ChangeLog
===================================================================
--- /libmpcdec/tags/release-1.2.2/ChangeLog	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/ChangeLog	(revision 30)
@@ -0,0 +1,33 @@
+1.2.2
+    * Fixed compilation under OpenBSD
+    * Unix EOF again
+
+1.2.1
+    * Warnings cleanup, patch by Tomas Salfischberger, Thom Johansen and
+    Daniel Stenberg (Rockbox)
+    * Mplayer interface, patch by Reimar Doffinger
+    * Unix EOF everywhere
+
+1.2
+    * 1.1.1 broke the API (BOOL type changed to mpc_bool_t). Version bumped to 1.2 to reflect the major change. Sorry to those who were caught by this error
+    * Fixed relative/absolute includes (#include "stuff.h" in /include/mpcdec, #include <mpcdec/stuff> in src/)
+    * Added msvc project files
+    * Changed mpc_reader_t structure, any specific data of the reader's
+    implementations should be hidden behind the (void*) data pointer. (example
+    in default implementation mpc_reader_file)
+    * Renamed to libmpcdec (to make room for libmpcenc)
+
+1.1.1
+    * fix for fixed-point mode bug
+
+1.1
+    * add compliance & cleanup patches from Michael Roitzsch of xine project 	
+    * switch to BSD license
+    * port to pure C
+    * add doxygen documentation
+    * revise API somewhat
+	
+1.0.3			
+    * autotools build process
+    * sample binary added
+    * floating-point mode by default
Index: /libmpcdec/tags/release-1.2.2/INSTALL
===================================================================
--- /libmpcdec/tags/release-1.2.2/INSTALL	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/INSTALL	(revision 30)
@@ -0,0 +1,3 @@
+How to install libmpcdec:
+"./configure [--prefix=/usr] && make" as a regular user
+"make install" as root
Index: /libmpcdec/tags/release-1.2.2/Makefile.am
===================================================================
--- /libmpcdec/tags/release-1.2.2/Makefile.am	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/Makefile.am	(revision 30)
@@ -0,0 +1,5 @@
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+
+SUBDIRS = src include
Index: /libmpcdec/tags/release-1.2.2/README
===================================================================
--- /libmpcdec/tags/release-1.2.2/README	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/README	(revision 30)
@@ -0,0 +1,6 @@
+Musepack Decoder Library:
+
+run "./configure [--prefix=/usr]; make"
+
+To create a sample app using the musepack decoder library in src/
+Check src/sample.cpp for more details.
Index: /libmpcdec/tags/release-1.2.2/autogen.sh
===================================================================
--- /libmpcdec/tags/release-1.2.2/autogen.sh	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/autogen.sh	(revision 30)
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+libtoolize --copy --force
+aclocal
+autoheader
+automake --gnu --add-missing --copy
+autoconf
Index: /libmpcdec/tags/release-1.2.2/configure.ac
===================================================================
--- /libmpcdec/tags/release-1.2.2/configure.ac	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/configure.ac	(revision 30)
@@ -0,0 +1,202 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(src/mpc_decoder.c)
+AC_CONFIG_AUX_DIR(config)
+AM_INIT_AUTOMAKE(libmpcdec,1.2.2)
+AM_CONFIG_HEADER(include/config.h)
+
+AM_PROG_LIBTOOL
+
+CFLAGS="$CFLAGS -O3 -fomit-frame-pointer -fPIC"
+
+AC_C_BIGENDIAN(,CFLAGS="$CFLAGS -DMPC_LITTLE_ENDIAN",)
+
+AC_HEADER_STDC
+AC_CHECK_HEADERS([inttypes.h string.h])
+
+AC_HEADER_STDBOOL
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_OFF_T
+AC_TYPE_SIZE_T
+AC_CHECK_TYPES([ptrdiff_t])
+
+AC_FUNC_MEMCMP
+AC_CHECK_FUNCS([memmove memset sqrt])
+
+AC_MSG_CHECKING(for int16_t)
+AC_CACHE_VAL(has_int16_t,
+[AC_TRY_RUN([
+int16_t foo;
+int main() {return 0;}
+],
+has_int16_t=yes,
+has_int16_t=no,
+has_int16_t=no
+)])
+AC_MSG_RESULT($has_int16_t)
+
+AC_MSG_CHECKING(for int32_t)
+AC_CACHE_VAL(has_int32_t,
+[AC_TRY_RUN([
+int32_t foo;
+int main() {return 0;}
+],
+has_int32_t=yes,
+has_int32_t=no,
+has_int32_t=no
+)])
+AC_MSG_RESULT($has_int32_t)
+
+AC_MSG_CHECKING(for uint32_t)
+AC_CACHE_VAL(has_uint32_t,
+[AC_TRY_RUN([
+uint32_t foo;
+int main() {return 0;}
+],
+has_uint32_t=yes,
+has_uint32_t=no,
+has_uint32_t=no
+)])
+AC_MSG_RESULT($has_uint32_t)
+
+AC_MSG_CHECKING(for uint16_t)
+AC_CACHE_VAL(has_uint16_t,
+[AC_TRY_RUN([
+uint16_t foo;
+int main() {return 0;}
+],
+has_uint16_t=yes,
+has_uint16_t=no,
+has_uint16_t=no
+)])
+AC_MSG_RESULT($has_uint16_t)
+
+AC_MSG_CHECKING(for u_int32_t)
+AC_CACHE_VAL(has_u_int32_t,
+[AC_TRY_RUN([
+u_int32_t foo;
+int main() {return 0;}
+],
+has_u_int32_t=yes,
+has_u_int32_t=no,
+has_u_int32_t=no
+)])
+AC_MSG_RESULT($has_u_int32_t)
+
+AC_MSG_CHECKING(for u_int16_t)
+AC_CACHE_VAL(has_u_int16_t,
+[AC_TRY_RUN([
+u_int16_t foo;
+int main() {return 0;}
+],
+has_u_int16_t=yes,
+has_u_int16_t=no,
+has_u_int16_t=no
+)])
+AC_MSG_RESULT($has_u_int16_t)
+
+AC_MSG_CHECKING(for int64_t)
+AC_CACHE_VAL(has_int64_t,
+[AC_TRY_RUN([
+int64_t foo;
+int main() {return 0;}
+],
+has_int64_t=yes,
+has_int64_t=no,
+has_int64_t=no
+)])
+AC_MSG_RESULT($has_int64_t)
+
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+
+
+if test x$has_int16_t = "xyes" ; then
+        SIZE16="int16_t"
+else
+        case 2 in
+                $ac_cv_sizeof_short) SIZE16="short";;
+                $ac_cv_sizeof_int) SIZE16="int";;
+        esac
+fi
+
+if test x$has_int32_t = "xyes" ; then
+        SIZE32="int32_t"
+else
+        case 4 in
+                $ac_cv_sizeof_short) SIZE32="short";;
+                $ac_cv_sizeof_int) SIZE32="int";;
+                $ac_cv_sizeof_long) SIZE32="long";;
+        esac
+fi
+
+if test x$has_uint32_t = "xyes" ; then
+        USIZE32="uint32_t"
+else
+        if test x$has_u_int32_t = "xyes" ; then
+                USIZE32="u_int32_t"
+        else
+                case 4 in
+                        $ac_cv_sizeof_short) USIZE32="unsigned short";;
+                        $ac_cv_sizeof_int) USIZE32="unsigned int";;
+                        $ac_cv_sizeof_long) USIZE32="unsigned long";;
+                esac
+        fi
+fi
+
+if test x$has_uint16_t = "xyes" ; then
+        USIZE16="uint16_t"
+else
+        if test x$has_u_int16_t = "xyes" ; then
+                USIZE16="u_int16_t"
+        else
+                case 2 in
+                        $ac_cv_sizeof_short) USIZE16="unsigned short";;
+                        $ac_cv_sizeof_int) USIZE16="unsigned int";;
+                        $ac_cv_sizeof_long) USIZE16="unsigned long";;
+                esac
+        fi
+fi
+
+if test x$has_int64_t = "xyes" ; then
+        SIZE64="int64_t"
+else
+case 8 in
+        $ac_cv_sizeof_int) SIZE64="int";;
+        $ac_cv_sizeof_long) SIZE64="long";;
+        $ac_cv_sizeof_long_long) SIZE64="long long";;
+esac
+fi
+
+if test -z "$SIZE16"; then
+        AC_MSG_ERROR(No 16 bit type found on this platform!)
+fi
+if test -z "$USIZE16"; then
+        AC_MSG_ERROR(No unsigned 16 bit type found on this platform!)
+fi
+if test -z "$SIZE32"; then
+        AC_MSG_ERROR(No 32 bit type found on this platform!)
+fi
+if test -z "$USIZE32"; then
+        AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
+fi
+if test -z "$SIZE64"; then
+        AC_MSG_WARN(No 64 bit type found on this platform!)
+fi
+
+dnl Make substitutions
+
+AC_SUBST(VERSION)
+AC_SUBST(LIBTOOL_DEPS)
+AC_SUBST(SIZE16)
+AC_SUBST(USIZE16)
+AC_SUBST(SIZE32)
+AC_SUBST(USIZE32)
+AC_SUBST(SIZE64)
+AC_SUBST(OPT)
+AC_SUBST(LIBS)
+
+AC_OUTPUT(Makefile src/Makefile include/Makefile include/mpcdec/config_types.h)
+AC_MSG_RESULT([=> libmpcdec $VERSION configured successfully])
Index: /libmpcdec/tags/release-1.2.2/docs/Doxyfile
===================================================================
--- /libmpcdec/tags/release-1.2.2/docs/Doxyfile	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/docs/Doxyfile	(revision 30)
@@ -0,0 +1,1161 @@
+# Doxyfile 1.3.9.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = libmpcdec
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 1.2.2
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = docs
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of source 
+# files, where putting all generated files in the same directory would otherwise 
+# cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, 
+# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, 
+# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, 
+# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, 
+# Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE        = English
+
+# This tag can be used to specify the encoding used in the generated output. 
+# The encoding is not always determined by the language that is chosen, 
+# but also whether or not the output is meant for Windows or non-Windows users. 
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES 
+# forces the Windows encoding (this is the default for the Windows binary), 
+# whereas setting the tag to NO uses a Unix-style encoding (the default for 
+# all platforms other than Windows).
+
+USE_WINDOWS_ENCODING   = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is used 
+# as the annotated text. Otherwise, the brief description is used as-is. If left 
+# blank, the following values are used ("$name" is automatically replaced with the 
+# name of the entity): "The $name class" "The $name widget" "The $name file" 
+# "is" "provides" "specifies" "contains" "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = 
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited 
+# members of a class in the documentation of that class as if those members were 
+# ordinary class members. Constructors, destructors and assignment operators of 
+# the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like the Qt-style comments (thus requiring an 
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF      = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member 
+# documentation.
+
+DETAILS_AT_TOP         = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = 
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources 
+# only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources 
+# only. Doxygen will then generate output that is more tailored for Java. 
+# For instance, namespaces will be presented as packages, qualified scopes 
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories 
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
+# in the documentation.
+
+SHOW_DIRECTORIES       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text.
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT                  = include src
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp 
+# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm
+
+FILE_PATTERNS          = 
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                = include/config.h
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories 
+# that are symbolic links (a Unix filesystem feature) are excluded from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories.
+
+EXCLUDE_PATTERNS       = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = 
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# ignored.
+
+INPUT_FILTER           = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis.  Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match.  The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
+# is applied to all files.
+
+FILTER_PATTERNS        = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default) 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        = docs/custom.css
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+
+PREDEFINED             = 
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line, have an all uppercase name, and do not end with a semicolon. Such 
+# function macros are typically used for boiler-plate code, and will confuse the 
+# parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or 
+# super classes. Setting the tag to NO turns the diagrams off. Note that this 
+# option is superseded by the HAVE_DOT option below. This is only a fallback. It is 
+# recommended to install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+
+UML_LOOK               = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
+# generate a call dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable call graphs for selected 
+# functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found on the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+
+MAX_DOT_GRAPH_WIDTH    = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT   = 1024
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
+# graphs generated by dot. A depth value of 3 means that only nodes reachable 
+# from the root by following a path via at most 3 edges will be shown. Nodes that 
+# lay further from the root node will be omitted. Note that setting this option to 
+# 1 or 2 may greatly reduce the computation time needed for large code bases. Also 
+# note that a graph may be further truncated if the graph's image dimensions are 
+# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). 
+# If 0 is used for the depth value (the default), the graph is not depth-constrained.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE           = NO
Index: /libmpcdec/tags/release-1.2.2/docs/custom.css
===================================================================
--- /libmpcdec/tags/release-1.2.2/docs/custom.css	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/docs/custom.css	(revision 30)
@@ -0,0 +1,212 @@
+BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
+	font-family: sans-serif;
+}
+h1 {
+	text-align: center;
+    text-transform: lowercase;
+    margin: 0.5em 0;
+}
+h2, h2 a { color: #f90; margin: 1em 0 0.25em 0; }
+h3, h3 a { color: #88f; margin: 1em 0 0.25em 0; }
+
+CAPTION { font-weight: bold }
+DIV.qindex {
+	width: 100%;
+	background-color: #eeeeff;
+	border: 1px solid #b0b0b0;
+	text-align: center;
+	margin: 2px;
+	padding: 2px;
+	line-height: 140%;
+}
+DIV.nav {
+	text-align: center;
+    padding: 0.25em 0;
+}
+A.qindex {
+    text-decoration: none;
+    font-weight: bold;
+    color: #1A419D;
+    text-transform: lowercase;
+}
+A.qindex:visited {
+    text-decoration: none;
+    font-weight: bold;
+    color: #1A419D
+}
+A.qindex:hover {
+	text-decoration: none;
+	background-color: #ddddff;
+}
+A.qindexHL {
+	text-decoration: none;
+	font-weight: bold;
+	background-color: #6666cc;
+	color: #ffffff;
+	border: 1px double #9295C2;
+    text-transform: lowercase;
+}
+A.qindexHL:hover {
+	text-decoration: none;
+	background-color: #6666cc;
+	color: #ffffff;
+}
+A.qindex, A.qindexHL { padding: 0.1em 0.5em; }
+A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff }
+A.el { text-decoration: none; font-weight: bold; color: #d66; font-style: italic }
+A.elRef { font-weight: bold }
+A.code:link { text-decoration: none; font-weight: normal; color: #0000FF}
+A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF}
+A.codeRef:link { font-weight: normal; color: #0000FF}
+A.codeRef:visited { font-weight: normal; color: #0000FF}
+A:hover { text-decoration: none; background-color: #f2f2ff }
+DL.el { margin-left: -1cm }
+.fragment {
+       font-family: monospace
+}
+PRE.fragment {
+	border: 1px solid #CCCCCC;
+	background-color: #f5f5f5;
+	margin-top: 4px;
+	margin-bottom: 4px;
+	margin-left: 2px;
+	margin-right: 8px;
+	padding-left: 6px;
+	padding-right: 6px;
+	padding-top: 4px;
+	padding-bottom: 4px;
+}
+hr { display: none }
+DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
+TD.md { font-weight: bold; }
+TD.mdname1, TD.mdname { color: #088; font-weight: bold; }
+TABLE[cellspacing="5"] { margin-left: 2em; }
+TABLE[cellspacing="5"] dl em { color: #088; font-weight: bold; }
+DIV.groupHeader {
+       margin-left: 16px;
+       margin-top: 12px;
+       margin-bottom: 6px;
+       font-weight: bold;
+}
+DIV.groupText { margin-left: 16px; font-style: italic; font-size: 14px }
+BODY {
+	background: white;
+	color: black;
+	margin-right: 20px;
+	margin-left: 20px;
+}
+TD.indexkey, TD.indexvalue {
+    padding: 0.1em 1em 0.1em 0.1em;
+}
+TD.indexkey {
+	font-weight: bold;
+}
+TD.indexvalue {
+	font-style: italic;
+}
+TR.memlist {
+   background-color: #f0f0f0; 
+}
+P.formulaDsp { text-align: center; }
+IMG.formulaDsp { }
+IMG.formulaInl { vertical-align: middle; }
+SPAN.keyword       { color: #008000 }
+SPAN.keywordtype   { color: #604020 }
+SPAN.keywordflow   { color: #e08000 }
+SPAN.comment       { color: #800000 }
+SPAN.preprocessor  { color: #806020 }
+SPAN.stringliteral { color: #002080 }
+SPAN.charliteral   { color: #008080 }
+.mdTable {
+}
+.mdRow {
+}
+.mdescLeft, .mdescRight {
+    font-style: italic;
+    font-size: 80%;
+}
+.mdescRight {
+}
+.memItemLeft {
+    font-style: italic;
+}
+.memItemLeft, .memItemRight {
+    font-size: 80%;
+}
+.memItemRight {
+}
+.memTemplItemLeft {
+	padding: 1px 0px 0px 8px;
+	margin: 4px;
+	border-top-width: 1px;
+	border-right-width: 1px;
+	border-bottom-width: 1px;
+	border-left-width: 1px;
+	border-top-color: #E0E0E0;
+	border-right-color: #E0E0E0;
+	border-bottom-color: #E0E0E0;
+	border-left-color: #E0E0E0;
+	border-top-style: none;
+	border-right-style: none;
+	border-bottom-style: none;
+	border-left-style: none;
+	background-color: #FAFAFA;
+	font-size: 12px;
+}
+.memTemplItemRight {
+	padding: 1px 8px 0px 8px;
+	margin: 4px;
+	border-top-width: 1px;
+	border-right-width: 1px;
+	border-bottom-width: 1px;
+	border-left-width: 1px;
+	border-top-color: #E0E0E0;
+	border-right-color: #E0E0E0;
+	border-bottom-color: #E0E0E0;
+	border-left-color: #E0E0E0;
+	border-top-style: none;
+	border-right-style: none;
+	border-bottom-style: none;
+	border-left-style: none;
+	background-color: #FAFAFA;
+	font-size: 13px;
+}
+.memTemplParams {
+	padding: 1px 0px 0px 8px;
+	margin: 4px;
+	border-top-width: 1px;
+	border-right-width: 1px;
+	border-bottom-width: 1px;
+	border-left-width: 1px;
+	border-top-color: #E0E0E0;
+	border-right-color: #E0E0E0;
+	border-bottom-color: #E0E0E0;
+	border-left-color: #E0E0E0;
+	border-top-style: solid;
+	border-right-style: none;
+	border-bottom-style: none;
+	border-left-style: none;
+       color: #606060;
+	background-color: #FAFAFA;
+	font-size: 12px;
+}
+.search     { color: #003399;
+              font-weight: bold;
+}
+FORM.search {
+              margin-bottom: 0px;
+              margin-top: 0px;
+}
+INPUT.search { font-size: 75%;
+               color: #000080;
+               font-weight: normal;
+               background-color: #eeeeff;
+}
+TD.tiny      { font-size: 75%;
+}
+a {
+	color: #252E78;
+}
+a:visited {
+	color: #3D2185;
+}
Index: /libmpcdec/tags/release-1.2.2/include/Makefile.am
===================================================================
--- /libmpcdec/tags/release-1.2.2/include/Makefile.am	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/include/Makefile.am	(revision 30)
@@ -0,0 +1,13 @@
+## 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/tags/release-1.2.2/include/config.h.in
===================================================================
--- /libmpcdec/tags/release-1.2.2/include/config.h.in	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/include/config.h.in	(revision 30)
@@ -0,0 +1,104 @@
+/* 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/tags/release-1.2.2/include/mainpage.h
===================================================================
--- /libmpcdec/tags/release-1.2.2/include/mainpage.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/include/mainpage.h	(revision 30)
@@ -0,0 +1,38 @@
+/**
+   \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/tags/release-1.2.2/include/mpcdec/config_types.h.in
===================================================================
--- /libmpcdec/tags/release-1.2.2/include/mpcdec/config_types.h.in	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/include/mpcdec/config_types.h.in	(revision 30)
@@ -0,0 +1,48 @@
+/*
+  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/tags/release-1.2.2/include/mpcdec/config_win32.h
===================================================================
--- /libmpcdec/tags/release-1.2.2/include/mpcdec/config_win32.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/include/mpcdec/config_win32.h	(revision 30)
@@ -0,0 +1,48 @@
+/*
+  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 __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;
+
+#endif // __MUSEPACK_CONFIG_WIN32_H__
Index: /libmpcdec/tags/release-1.2.2/include/mpcdec/decoder.h
===================================================================
--- /libmpcdec/tags/release-1.2.2/include/mpcdec/decoder.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/include/mpcdec/decoder.h	(revision 30)
@@ -0,0 +1,148 @@
+/*
+  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"
+
+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; /// actually 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  FwdJumpInfo;
+    mpc_uint32_t  ActDecodePos;
+    mpc_uint32_t  FrameWasValid;
+
+    mpc_uint32_t  DecodedFrames;
+    mpc_uint32_t  OverallFrames;
+    mpc_int32_t   SampleRate;                 // Sample frequency
+
+    mpc_uint32_t  StreamVersion;              // version of bitstream
+    mpc_uint32_t  MS_used;                    // MS-coding used ?
+    mpc_int32_t   Max_Band;
+    mpc_uint32_t  MPCHeaderPos;               // AB: needed to support ID3v2
+    mpc_uint32_t  LastValidSamples;
+    mpc_uint32_t  TrueGaplessPresent;
+
+    mpc_uint32_t  EQ_activated;
+
+    mpc_uint32_t  WordsRead;                  // counts amount of decoded dwords
+
+    // randomizer state variables
+    mpc_uint32_t  __r1; 
+    mpc_uint32_t  __r2; 
+
+    mpc_uint32_t  Q_bit [32];     
+    mpc_uint32_t  Q_res [32][16];
+
+    // huffman table stuff
+    HuffmanTyp    HuffHdr  [10];
+    HuffmanTyp    HuffSCFI [ 4];
+    HuffmanTyp    HuffDSCF [16];
+    HuffmanTyp*   HuffQ [2] [8];
+
+    HuffmanTyp    HuffQ1 [2] [3*3*3];
+    HuffmanTyp    HuffQ2 [2] [5*5];
+    HuffmanTyp    HuffQ3 [2] [ 7];
+    HuffmanTyp    HuffQ4 [2] [ 9];
+    HuffmanTyp    HuffQ5 [2] [15];
+    HuffmanTyp    HuffQ6 [2] [31];
+    HuffmanTyp    HuffQ7 [2] [63];
+    const HuffmanTyp* SampleHuff [18];
+    HuffmanTyp    SCFI_Bundle   [ 8];
+    HuffmanTyp    DSCF_Entropie [13];
+    HuffmanTyp    Region_A [16];
+    HuffmanTyp    Region_B [ 8];
+    HuffmanTyp    Region_C [ 4];
+
+    HuffmanTyp    Entropie_1 [ 3];
+    HuffmanTyp    Entropie_2 [ 5];
+    HuffmanTyp    Entropie_3 [ 7];
+    HuffmanTyp    Entropie_4 [ 9];
+    HuffmanTyp    Entropie_5 [15];
+    HuffmanTyp    Entropie_6 [31];
+    HuffmanTyp    Entropie_7 [63];
+
+    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_int32_t   DSCF_Flag_L [32];
+    mpc_int32_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_int32_t   DSCF_Reference_L [32];
+    mpc_int32_t   DSCF_Reference_R [32];      // holds last frames SCF
+    mpc_int32_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/tags/release-1.2.2/include/mpcdec/huffman.h
===================================================================
--- /libmpcdec/tags/release-1.2.2/include/mpcdec/huffman.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/include/mpcdec/huffman.h	(revision 30)
@@ -0,0 +1,80 @@
+/*
+  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_uint32_t  Length;
+    mpc_int32_t   Value;
+} HuffmanTyp;
+
+//! \brief Sorts huffman-tables by codeword.
+//!
+//! offset resulting value.
+//! \param elements
+//! \param Table table to sort
+//! \param offset offset of resulting sort
+void
+mpc_decoder_resort_huff_tables(
+    const mpc_uint32_t elements, HuffmanTyp *Table, const mpc_int32_t offset);
+
+/// Initializes sv6 huffman decoding structures.
+void mpc_decoder_init_huffman_sv6(struct mpc_decoder_t *d);
+
+/// Initializes sv6 huffman decoding tables.
+void mpc_decoder_init_huffman_sv6_tables(struct mpc_decoder_t *d);
+
+/// Initializes sv7 huffman decoding structures.
+void mpc_decoder_init_huffman_sv7(struct mpc_decoder_t *d);
+
+/// Initializes sv7 huffman decoding tables.
+void mpc_decoder_init_huffman_sv7_tables(struct mpc_decoder_t *d);
+
+#endif // _mpcdec_huffman_h_
Index: /libmpcdec/tags/release-1.2.2/include/mpcdec/internal.h
===================================================================
--- /libmpcdec/tags/release-1.2.2/include/mpcdec/internal.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/include/mpcdec/internal.h	(revision 30)
@@ -0,0 +1,65 @@
+/*
+  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/tags/release-1.2.2/include/mpcdec/math.h
===================================================================
--- /libmpcdec/tags/release-1.2.2/include/mpcdec/math.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/include/mpcdec/math.h	(revision 30)
@@ -0,0 +1,144 @@
+/*
+  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/tags/release-1.2.2/include/mpcdec/mpcdec.h
===================================================================
--- /libmpcdec/tags/release-1.2.2/include/mpcdec/mpcdec.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/include/mpcdec/mpcdec.h	(revision 30)
@@ -0,0 +1,140 @@
+/*
+  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 mpcdec.h
+/// Top level include file for libmpcdec.
+
+#ifndef _mpcdec_h_
+#define _mpcdec_h_
+
+#ifdef __cplusplus
+extern "C" {
+#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);
+
+/// 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);
+
+/// 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);
+
+void mpc_decoder_set_streaminfo(mpc_decoder *d, 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);
+
+/// Actually reads data from previously initialized stream.  Call
+/// this iteratively to decode the mpc stream.
+/// \param buffer destination buffer for decoded samples
+/// \param vbr_update_acc \todo document me
+/// \param vbr_update_bits \todo document me
+/// \return -1 if an error is encountered
+/// \return 0 if the stream has been completely decoded successfully and there are no more samples
+/// \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_SAMPLE_FORMAT *buffer, 
+    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_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);
+
+/// Seeks to specified position in seconds in the source stream.
+mpc_bool_t mpc_decoder_seek_seconds(mpc_decoder *d, double seconds);
+
+#ifdef __cplusplus
+}
+#endif // __cplusplus
+
+#endif // _mpcdec_h_
Index: /libmpcdec/tags/release-1.2.2/include/mpcdec/reader.h
===================================================================
--- /libmpcdec/tags/release-1.2.2/include/mpcdec/reader.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/include/mpcdec/reader.h	(revision 30)
@@ -0,0 +1,82 @@
+/*
+  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 reader.h
+
+#ifndef _mpcdec_reader_h_
+#define _mpcdec_reader_h_
+
+/// \brief Stream reader interface structure.
+///
+/// This is the structure you must supply to the musepack decoding library
+/// to feed it with raw data.  Implement the five member functions to provide
+/// a functional reader.
+typedef 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);
+
+    /// Seeks to byte position offset.
+	mpc_bool_t (*seek)(void *t, mpc_int32_t offset);
+
+    /// Returns the current byte offset in the stream.
+	mpc_int32_t (*tell)(void *t);
+
+    /// Returns the total length of the source stream, in bytes.
+	mpc_int32_t (*get_size)(void *t);
+
+    /// True if the stream is a seekable stream.
+	mpc_bool_t (*canseek)(void *t);
+
+    /// 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);
+
+#endif // _mpcdec_reader_h_
Index: /libmpcdec/tags/release-1.2.2/include/mpcdec/requant.h
===================================================================
--- /libmpcdec/tags/release-1.2.2/include/mpcdec/requant.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/include/mpcdec/requant.h	(revision 30)
@@ -0,0 +1,51 @@
+/*
+  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/tags/release-1.2.2/include/mpcdec/streaminfo.h
===================================================================
--- /libmpcdec/tags/release-1.2.2/include/mpcdec/streaminfo.h	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/include/mpcdec/streaminfo.h	(revision 30)
@@ -0,0 +1,86 @@
+/*
+  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 streaminfo.h
+
+#ifndef _mpcdec_streaminfo_h_
+#define _mpcdec_streaminfo_h_
+
+typedef mpc_int32_t mpc_streaminfo_off_t;
+
+/// \brief mpc stream properties structure
+///
+/// Structure containing all the properties of an mpc stream.  Populated
+/// by the streaminfo_read function.
+typedef struct mpc_streaminfo {
+    /// @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
+    //@}
+
+    /// @name replaygain related fields
+    //@{
+    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
+    //@{
+    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_streaminfo_off_t tag_offset;         ///< offset to file tags
+    mpc_streaminfo_off_t total_file_length;  ///< total length of underlying file
+    //@}
+} mpc_streaminfo;
+
+#endif // _mpcdec_streaminfo_h_
Index: /libmpcdec/tags/release-1.2.2/src/Makefile.am
===================================================================
--- /libmpcdec/tags/release-1.2.2/src/Makefile.am	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/src/Makefile.am	(revision 30)
@@ -0,0 +1,21 @@
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+
+lib_LTLIBRARIES = libmpcdec.la
+
+libmpcdec_la_SOURCES = \
+	huffsv46.c \
+	huffsv7.c \
+	idtag.c \
+	mpc_decoder.c \
+	mpc_reader.c \
+	requant.c \
+	streaminfo.c \
+	synth_filter.c
+libmpcdec_la_LDFLAGS = -no-undefined -version-info 4:1:1
+
+noinst_PROGRAMS = sample
+sample_SOURCES = sample.cpp
+sample_LDADD = libmpcdec.la
+
Index: /libmpcdec/tags/release-1.2.2/src/huffsv46.c
===================================================================
--- /libmpcdec/tags/release-1.2.2/src/huffsv46.c	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/src/huffsv46.c	(revision 30)
@@ -0,0 +1,268 @@
+/*
+  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 huffsv46.c
+/// Implementations of huffman decoding for streamversions < 7.
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/requant.h>
+#include <mpcdec/huffman.h>
+
+void
+mpc_decoder_init_huffman_sv6(mpc_decoder *d) 
+{
+    mpc_decoder_init_huffman_sv6_tables(d);
+    mpc_decoder_resort_huff_tables(16, d->Region_A      , 0);
+    mpc_decoder_resort_huff_tables( 8, d->Region_B      , 0);
+    mpc_decoder_resort_huff_tables( 4, d->Region_C      , 0);
+    mpc_decoder_resort_huff_tables( 8, d->SCFI_Bundle   , 0);
+    mpc_decoder_resort_huff_tables(13, d->DSCF_Entropie , 6);
+    mpc_decoder_resort_huff_tables( 3, d->Entropie_1    , Dc[1]);
+    mpc_decoder_resort_huff_tables( 5, d->Entropie_2    , Dc[2]);
+    mpc_decoder_resort_huff_tables( 7, d->Entropie_3    , Dc[3]);
+    mpc_decoder_resort_huff_tables( 9, d->Entropie_4    , Dc[4]);
+    mpc_decoder_resort_huff_tables(15, d->Entropie_5    , Dc[5]);
+    mpc_decoder_resort_huff_tables(31, d->Entropie_6    , Dc[6]);
+    mpc_decoder_resort_huff_tables(63, d->Entropie_7    , Dc[7]);
+}
+
+void 
+mpc_decoder_init_huffman_sv6_tables(mpc_decoder *d) 
+{
+    // SCFI-bundle
+    d->SCFI_Bundle[7].Code=  1; d->SCFI_Bundle[7].Length= 1;
+    d->SCFI_Bundle[3].Code=  1; d->SCFI_Bundle[3].Length= 2;
+    d->SCFI_Bundle[5].Code=  0; d->SCFI_Bundle[5].Length= 3;
+    d->SCFI_Bundle[1].Code=  7; d->SCFI_Bundle[1].Length= 5;
+    d->SCFI_Bundle[2].Code=  6; d->SCFI_Bundle[2].Length= 5;
+    d->SCFI_Bundle[4].Code=  4; d->SCFI_Bundle[4].Length= 5;
+    d->SCFI_Bundle[0].Code= 11; d->SCFI_Bundle[0].Length= 6;
+    d->SCFI_Bundle[6].Code= 10; d->SCFI_Bundle[6].Length= 6;
+
+    // region A (subbands  0..10)
+    d->Region_A[ 1].Code=    1; d->Region_A[ 1].Length=  1;
+    d->Region_A[ 2].Code=    0; d->Region_A[ 2].Length=  2;
+    d->Region_A[ 0].Code=    2; d->Region_A[ 0].Length=  3;
+    d->Region_A[ 3].Code=   15; d->Region_A[ 3].Length=  5;
+    d->Region_A[ 5].Code=   13; d->Region_A[ 5].Length=  5;
+    d->Region_A[ 6].Code=   12; d->Region_A[ 6].Length=  5;
+    d->Region_A[ 4].Code=   29; d->Region_A[ 4].Length=  6;
+    d->Region_A[ 7].Code=   57; d->Region_A[ 7].Length=  7;
+    d->Region_A[ 8].Code=  113; d->Region_A[ 8].Length=  8;
+    d->Region_A[ 9].Code=  225; d->Region_A[ 9].Length=  9;
+    d->Region_A[10].Code=  449; d->Region_A[10].Length= 10;
+    d->Region_A[11].Code=  897; d->Region_A[11].Length= 11;
+    d->Region_A[12].Code= 1793; d->Region_A[12].Length= 12;
+    d->Region_A[13].Code= 3585; d->Region_A[13].Length= 13;
+    d->Region_A[14].Code= 7169; d->Region_A[14].Length= 14;
+    d->Region_A[15].Code= 7168; d->Region_A[15].Length= 14;
+
+    // region B (subbands 11..22)
+    d->Region_B[1].Code= 1; d->Region_B[1].Length= 1;
+    d->Region_B[0].Code= 1; d->Region_B[0].Length= 2;
+    d->Region_B[2].Code= 1; d->Region_B[2].Length= 3;
+    d->Region_B[3].Code= 1; d->Region_B[3].Length= 4;
+    d->Region_B[4].Code= 1; d->Region_B[4].Length= 5;
+    d->Region_B[5].Code= 1; d->Region_B[5].Length= 6;
+    d->Region_B[6].Code= 1; d->Region_B[6].Length= 7;
+    d->Region_B[7].Code= 0; d->Region_B[7].Length= 7;
+
+    // region C (subbands 23..31)
+    d->Region_C[0].Code= 1; d->Region_C[0].Length= 1;
+    d->Region_C[1].Code= 1; d->Region_C[1].Length= 2;
+    d->Region_C[2].Code= 1; d->Region_C[2].Length= 3;
+    d->Region_C[3].Code= 0; d->Region_C[3].Length= 3;
+
+    // DSCF
+    d->DSCF_Entropie[ 6].Code=  0; d->DSCF_Entropie[ 6].Length= 2;
+    d->DSCF_Entropie[ 7].Code=  7; d->DSCF_Entropie[ 7].Length= 3;
+    d->DSCF_Entropie[ 5].Code=  4; d->DSCF_Entropie[ 5].Length= 3;
+    d->DSCF_Entropie[ 8].Code=  3; d->DSCF_Entropie[ 8].Length= 3;
+    d->DSCF_Entropie[ 9].Code= 13; d->DSCF_Entropie[ 9].Length= 4;
+    d->DSCF_Entropie[ 4].Code= 11; d->DSCF_Entropie[ 4].Length= 4;
+    d->DSCF_Entropie[10].Code= 10; d->DSCF_Entropie[10].Length= 4;
+    d->DSCF_Entropie[ 2].Code=  4; d->DSCF_Entropie[ 2].Length= 4;
+    d->DSCF_Entropie[11].Code= 25; d->DSCF_Entropie[11].Length= 5;
+    d->DSCF_Entropie[ 3].Code= 24; d->DSCF_Entropie[ 3].Length= 5;
+    d->DSCF_Entropie[ 1].Code= 11; d->DSCF_Entropie[ 1].Length= 5;
+    d->DSCF_Entropie[12].Code= 21; d->DSCF_Entropie[12].Length= 6;
+    d->DSCF_Entropie[ 0].Code= 20; d->DSCF_Entropie[ 0].Length= 6;
+
+    // first quantizer
+    d->Entropie_1[1].Code= 1; d->Entropie_1[1].Length= 1;
+    d->Entropie_1[0].Code= 1; d->Entropie_1[0].Length= 2;
+    d->Entropie_1[2].Code= 0; d->Entropie_1[2].Length= 2;
+
+    // second quantizer
+    d->Entropie_2[2].Code=  3; d->Entropie_2[2].Length= 2;
+    d->Entropie_2[3].Code=  1; d->Entropie_2[3].Length= 2;
+    d->Entropie_2[1].Code=  0; d->Entropie_2[1].Length= 2;
+    d->Entropie_2[4].Code=  5; d->Entropie_2[4].Length= 3;
+    d->Entropie_2[0].Code=  4; d->Entropie_2[0].Length= 3;
+
+    // third quantizer
+    d->Entropie_3[3].Code=  3; d->Entropie_3[3].Length= 2;
+    d->Entropie_3[2].Code=  1; d->Entropie_3[2].Length= 2;
+    d->Entropie_3[4].Code=  0; d->Entropie_3[4].Length= 2;
+    d->Entropie_3[1].Code=  5; d->Entropie_3[1].Length= 3;
+    d->Entropie_3[5].Code=  9; d->Entropie_3[5].Length= 4;
+    d->Entropie_3[0].Code= 17; d->Entropie_3[0].Length= 5;
+    d->Entropie_3[6].Code= 16; d->Entropie_3[6].Length= 5;
+
+    // forth quantizer
+    d->Entropie_4[4].Code=  0; d->Entropie_4[4].Length= 2;
+    d->Entropie_4[5].Code=  6; d->Entropie_4[5].Length= 3;
+    d->Entropie_4[3].Code=  5; d->Entropie_4[3].Length= 3;
+    d->Entropie_4[6].Code=  4; d->Entropie_4[6].Length= 3;
+    d->Entropie_4[2].Code=  3; d->Entropie_4[2].Length= 3;
+    d->Entropie_4[7].Code= 15; d->Entropie_4[7].Length= 4;
+    d->Entropie_4[1].Code= 14; d->Entropie_4[1].Length= 4;
+    d->Entropie_4[0].Code=  5; d->Entropie_4[0].Length= 4;
+    d->Entropie_4[8].Code=  4; d->Entropie_4[8].Length= 4;
+
+    // fifth quantizer
+    d->Entropie_5[7 ].Code=  4; d->Entropie_5[7 ].Length= 3;
+    d->Entropie_5[8 ].Code=  3; d->Entropie_5[8 ].Length= 3;
+    d->Entropie_5[6 ].Code=  2; d->Entropie_5[6 ].Length= 3;
+    d->Entropie_5[9 ].Code=  0; d->Entropie_5[9 ].Length= 3;
+    d->Entropie_5[5 ].Code= 15; d->Entropie_5[5 ].Length= 4;
+    d->Entropie_5[4 ].Code= 13; d->Entropie_5[4 ].Length= 4;
+    d->Entropie_5[10].Code= 12; d->Entropie_5[10].Length= 4;
+    d->Entropie_5[11].Code= 10; d->Entropie_5[11].Length= 4;
+    d->Entropie_5[3 ].Code=  3; d->Entropie_5[3 ].Length= 4;
+    d->Entropie_5[12].Code=  2; d->Entropie_5[12].Length= 4;
+    d->Entropie_5[2 ].Code= 29; d->Entropie_5[2 ].Length= 5;
+    d->Entropie_5[1 ].Code= 23; d->Entropie_5[1 ].Length= 5;
+    d->Entropie_5[13].Code= 22; d->Entropie_5[13].Length= 5;
+    d->Entropie_5[0 ].Code= 57; d->Entropie_5[0 ].Length= 6;
+    d->Entropie_5[14].Code= 56; d->Entropie_5[14].Length= 6;
+
+    // sixth quantizer
+    d->Entropie_6[15].Code=  9; d->Entropie_6[15].Length= 4;
+    d->Entropie_6[16].Code=  8; d->Entropie_6[16].Length= 4;
+    d->Entropie_6[14].Code=  7; d->Entropie_6[14].Length= 4;
+    d->Entropie_6[18].Code=  6; d->Entropie_6[18].Length= 4;
+    d->Entropie_6[17].Code=  5; d->Entropie_6[17].Length= 4;
+    d->Entropie_6[12].Code=  3; d->Entropie_6[12].Length= 4;
+    d->Entropie_6[13].Code=  2; d->Entropie_6[13].Length= 4;
+    d->Entropie_6[19].Code=  0; d->Entropie_6[19].Length= 4;
+    d->Entropie_6[11].Code= 31; d->Entropie_6[11].Length= 5;
+    d->Entropie_6[20].Code= 30; d->Entropie_6[20].Length= 5;
+    d->Entropie_6[10].Code= 29; d->Entropie_6[10].Length= 5;
+    d->Entropie_6[9 ].Code= 27; d->Entropie_6[9 ].Length= 5;
+    d->Entropie_6[21].Code= 26; d->Entropie_6[21].Length= 5;
+    d->Entropie_6[22].Code= 25; d->Entropie_6[22].Length= 5;
+    d->Entropie_6[8 ].Code= 24; d->Entropie_6[8 ].Length= 5;
+    d->Entropie_6[7 ].Code= 23; d->Entropie_6[7 ].Length= 5;
+    d->Entropie_6[23].Code= 21; d->Entropie_6[23].Length= 5;
+    d->Entropie_6[6 ].Code=  9; d->Entropie_6[6 ].Length= 5;
+    d->Entropie_6[24].Code=  3; d->Entropie_6[24].Length= 5;
+    d->Entropie_6[25].Code= 57; d->Entropie_6[25].Length= 6;
+    d->Entropie_6[5 ].Code= 56; d->Entropie_6[5 ].Length= 6;
+    d->Entropie_6[4 ].Code= 45; d->Entropie_6[4 ].Length= 6;
+    d->Entropie_6[26].Code= 41; d->Entropie_6[26].Length= 6;
+    d->Entropie_6[2 ].Code= 40; d->Entropie_6[2 ].Length= 6;
+    d->Entropie_6[27].Code= 17; d->Entropie_6[27].Length= 6;
+    d->Entropie_6[28].Code= 16; d->Entropie_6[28].Length= 6;
+    d->Entropie_6[3 ].Code=  5; d->Entropie_6[3 ].Length= 6;
+    d->Entropie_6[29].Code= 89; d->Entropie_6[29].Length= 7;
+    d->Entropie_6[1 ].Code= 88; d->Entropie_6[1 ].Length= 7;
+    d->Entropie_6[30].Code=  9; d->Entropie_6[30].Length= 7;
+    d->Entropie_6[0 ].Code=  8; d->Entropie_6[0 ].Length= 7;
+
+    // seventh quantizer
+    d->Entropie_7[25].Code=   0; d->Entropie_7[25].Length= 5;
+    d->Entropie_7[37].Code=   1; d->Entropie_7[37].Length= 5;
+    d->Entropie_7[62].Code=  16; d->Entropie_7[62].Length= 8;
+    d->Entropie_7[ 0].Code=  17; d->Entropie_7[ 0].Length= 8;
+    d->Entropie_7[ 3].Code=   9; d->Entropie_7[ 3].Length= 7;
+    d->Entropie_7[ 5].Code=  10; d->Entropie_7[ 5].Length= 7;
+    d->Entropie_7[ 6].Code=  11; d->Entropie_7[ 6].Length= 7;
+    d->Entropie_7[38].Code=   3; d->Entropie_7[38].Length= 5;
+    d->Entropie_7[35].Code=   4; d->Entropie_7[35].Length= 5;
+    d->Entropie_7[33].Code=   5; d->Entropie_7[33].Length= 5;
+    d->Entropie_7[24].Code=   6; d->Entropie_7[24].Length= 5;
+    d->Entropie_7[27].Code=   7; d->Entropie_7[27].Length= 5;
+    d->Entropie_7[26].Code=   8; d->Entropie_7[26].Length= 5;
+    d->Entropie_7[12].Code=  18; d->Entropie_7[12].Length= 6;
+    d->Entropie_7[50].Code=  19; d->Entropie_7[50].Length= 6;
+    d->Entropie_7[29].Code=  10; d->Entropie_7[29].Length= 5;
+    d->Entropie_7[31].Code=  11; d->Entropie_7[31].Length= 5;
+    d->Entropie_7[36].Code=  12; d->Entropie_7[36].Length= 5;
+    d->Entropie_7[34].Code=  13; d->Entropie_7[34].Length= 5;
+    d->Entropie_7[28].Code=  14; d->Entropie_7[28].Length= 5;
+    d->Entropie_7[49].Code=  30; d->Entropie_7[49].Length= 6;
+    d->Entropie_7[56].Code=  62; d->Entropie_7[56].Length= 7;
+    d->Entropie_7[ 7].Code=  63; d->Entropie_7[ 7].Length= 7;
+    d->Entropie_7[32].Code=  16; d->Entropie_7[32].Length= 5;
+    d->Entropie_7[30].Code=  17; d->Entropie_7[30].Length= 5;
+    d->Entropie_7[13].Code=  36; d->Entropie_7[13].Length= 6;
+    d->Entropie_7[55].Code=  74; d->Entropie_7[55].Length= 7;
+    d->Entropie_7[61].Code= 150; d->Entropie_7[61].Length= 8;
+    d->Entropie_7[ 1].Code= 151; d->Entropie_7[ 1].Length= 8;
+    d->Entropie_7[14].Code=  38; d->Entropie_7[14].Length= 6;
+    d->Entropie_7[48].Code=  39; d->Entropie_7[48].Length= 6;
+    d->Entropie_7[ 4].Code=  80; d->Entropie_7[ 4].Length= 7;
+    d->Entropie_7[58].Code=  81; d->Entropie_7[58].Length= 7;
+    d->Entropie_7[47].Code=  41; d->Entropie_7[47].Length= 6;
+    d->Entropie_7[15].Code=  42; d->Entropie_7[15].Length= 6;
+    d->Entropie_7[16].Code=  43; d->Entropie_7[16].Length= 6;
+    d->Entropie_7[54].Code=  88; d->Entropie_7[54].Length= 7;
+    d->Entropie_7[ 8].Code=  89; d->Entropie_7[ 8].Length= 7;
+    d->Entropie_7[17].Code=  45; d->Entropie_7[17].Length= 6;
+    d->Entropie_7[46].Code=  46; d->Entropie_7[46].Length= 6;
+    d->Entropie_7[45].Code=  47; d->Entropie_7[45].Length= 6;
+    d->Entropie_7[53].Code=  96; d->Entropie_7[53].Length= 7;
+    d->Entropie_7[ 9].Code=  97; d->Entropie_7[ 9].Length= 7;
+    d->Entropie_7[43].Code=  49; d->Entropie_7[43].Length= 6;
+    d->Entropie_7[19].Code=  50; d->Entropie_7[19].Length= 6;
+    d->Entropie_7[18].Code=  51; d->Entropie_7[18].Length= 6;
+    d->Entropie_7[44].Code=  52; d->Entropie_7[44].Length= 6;
+    d->Entropie_7[ 2].Code= 212; d->Entropie_7[ 2].Length= 8;
+    d->Entropie_7[60].Code= 213; d->Entropie_7[60].Length= 8;
+    d->Entropie_7[10].Code= 107; d->Entropie_7[10].Length= 7;
+    d->Entropie_7[42].Code=  54; d->Entropie_7[42].Length= 6;
+    d->Entropie_7[41].Code=  55; d->Entropie_7[41].Length= 6;
+    d->Entropie_7[20].Code=  56; d->Entropie_7[20].Length= 6;
+    d->Entropie_7[21].Code=  57; d->Entropie_7[21].Length= 6;
+    d->Entropie_7[52].Code= 116; d->Entropie_7[52].Length= 7;
+    d->Entropie_7[51].Code= 117; d->Entropie_7[51].Length= 7;
+    d->Entropie_7[40].Code=  59; d->Entropie_7[40].Length= 6;
+    d->Entropie_7[22].Code=  60; d->Entropie_7[22].Length= 6;
+    d->Entropie_7[23].Code=  61; d->Entropie_7[23].Length= 6;
+    d->Entropie_7[39].Code=  62; d->Entropie_7[39].Length= 6;
+    d->Entropie_7[11].Code= 126; d->Entropie_7[11].Length= 7;
+    d->Entropie_7[57].Code= 254; d->Entropie_7[57].Length= 8;
+    d->Entropie_7[59].Code= 255; d->Entropie_7[59].Length= 8;
+}
Index: /libmpcdec/tags/release-1.2.2/src/huffsv7.c
===================================================================
--- /libmpcdec/tags/release-1.2.2/src/huffsv7.c	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/src/huffsv7.c	(revision 30)
@@ -0,0 +1,500 @@
+/*
+  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 huffsv7.c
+/// Implementations of sv7 huffman decoding functions.
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/huffman.h>
+#include <mpcdec/requant.h>
+
+void
+mpc_decoder_init_huffman_sv7(mpc_decoder *d) 
+{
+    mpc_decoder_init_huffman_sv7_tables(d);
+    mpc_decoder_resort_huff_tables(10, &(d->HuffHdr[0])   , 5);
+    mpc_decoder_resort_huff_tables( 4, &(d->HuffSCFI[0])  , 0);
+    mpc_decoder_resort_huff_tables(16, &(d->HuffDSCF[0])  , 7);
+    mpc_decoder_resort_huff_tables(27, &(d->HuffQ1[0][0]) , 0);
+    mpc_decoder_resort_huff_tables(27, &(d->HuffQ1[1][0]) , 0);
+    mpc_decoder_resort_huff_tables(25, &(d->HuffQ2[0][0]) , 0);
+    mpc_decoder_resort_huff_tables(25, &(d->HuffQ2[1][0]) , 0);
+    mpc_decoder_resort_huff_tables( 7, &(d->HuffQ3[0][0]) , Dc[3]);
+    mpc_decoder_resort_huff_tables( 7, &(d->HuffQ3[1][0]) , Dc[3]);
+    mpc_decoder_resort_huff_tables( 9, &(d->HuffQ4[0][0]) , Dc[4]);
+    mpc_decoder_resort_huff_tables( 9, &(d->HuffQ4[1][0]) , Dc[4]);
+    mpc_decoder_resort_huff_tables(15, &(d->HuffQ5[0][0]) , Dc[5]);
+    mpc_decoder_resort_huff_tables(15, &(d->HuffQ5[1][0]) , Dc[5]);
+    mpc_decoder_resort_huff_tables(31, &(d->HuffQ6[0][0]) , Dc[6]);
+    mpc_decoder_resort_huff_tables(31, &(d->HuffQ6[1][0]) , Dc[6]);
+    mpc_decoder_resort_huff_tables(63, &(d->HuffQ7[0][0]) , Dc[7]);
+    mpc_decoder_resort_huff_tables(63, &(d->HuffQ7[1][0]) , Dc[7]);
+}
+
+void 
+mpc_decoder_init_huffman_sv7_tables(mpc_decoder *d) 
+{
+    /***************************** SCFI *******************************/
+    d->HuffSCFI[0].Code = 2; d->HuffSCFI[0].Length = 3;
+    d->HuffSCFI[1].Code = 1; d->HuffSCFI[1].Length = 1;
+    d->HuffSCFI[2].Code = 3; d->HuffSCFI[2].Length = 3;
+    d->HuffSCFI[3].Code = 0; d->HuffSCFI[3].Length = 2;
+
+    /***************************** DSCF *******************************/
+    d->HuffDSCF[ 0].Code = 32; d->HuffDSCF[ 0].Length = 6;
+    d->HuffDSCF[ 1].Code =  4; d->HuffDSCF[ 1].Length = 5;
+    d->HuffDSCF[ 2].Code = 17; d->HuffDSCF[ 2].Length = 5;
+    d->HuffDSCF[ 3].Code = 30; d->HuffDSCF[ 3].Length = 5;
+    d->HuffDSCF[ 4].Code = 13; d->HuffDSCF[ 4].Length = 4;
+    d->HuffDSCF[ 5].Code =  0; d->HuffDSCF[ 5].Length = 3;
+    d->HuffDSCF[ 6].Code =  3; d->HuffDSCF[ 6].Length = 3;
+    d->HuffDSCF[ 7].Code =  9; d->HuffDSCF[ 7].Length = 4;
+    d->HuffDSCF[ 8].Code =  5; d->HuffDSCF[ 8].Length = 3;
+    d->HuffDSCF[ 9].Code =  2; d->HuffDSCF[ 9].Length = 3;
+    d->HuffDSCF[10].Code = 14; d->HuffDSCF[10].Length = 4;
+    d->HuffDSCF[11].Code =  3; d->HuffDSCF[11].Length = 4;
+    d->HuffDSCF[12].Code = 31; d->HuffDSCF[12].Length = 5;
+    d->HuffDSCF[13].Code =  5; d->HuffDSCF[13].Length = 5;
+    d->HuffDSCF[14].Code = 33; d->HuffDSCF[14].Length = 6;
+    d->HuffDSCF[15].Code = 12; d->HuffDSCF[15].Length = 4;
+
+    /************************* frame-header ***************************/
+    /***************** differential quantizer indizes *****************/
+    d->HuffHdr[0].Code =  92; d->HuffHdr[0].Length = 8;
+    d->HuffHdr[1].Code =  47; d->HuffHdr[1].Length = 7;
+    d->HuffHdr[2].Code =  10; d->HuffHdr[2].Length = 5;
+    d->HuffHdr[3].Code =   4; d->HuffHdr[3].Length = 4;
+    d->HuffHdr[4].Code =   0; d->HuffHdr[4].Length = 2;
+    d->HuffHdr[5].Code =   1; d->HuffHdr[5].Length = 1;
+    d->HuffHdr[6].Code =   3; d->HuffHdr[6].Length = 3;
+    d->HuffHdr[7].Code =  22; d->HuffHdr[7].Length = 6;
+    d->HuffHdr[8].Code = 187; d->HuffHdr[8].Length = 9;
+    d->HuffHdr[9].Code = 186; d->HuffHdr[9].Length = 9;
+
+    /********************** 3-step quantizer **************************/
+    /********************* 3 bundled samples **************************/
+    //less shaped, book 0
+    d->HuffQ1[0][ 0].Code = 54; d->HuffQ1[0][ 0].Length = 6;
+    d->HuffQ1[0][ 1].Code =  9; d->HuffQ1[0][ 1].Length = 5;
+    d->HuffQ1[0][ 2].Code = 32; d->HuffQ1[0][ 2].Length = 6;
+    d->HuffQ1[0][ 3].Code =  5; d->HuffQ1[0][ 3].Length = 5;
+    d->HuffQ1[0][ 4].Code = 10; d->HuffQ1[0][ 4].Length = 4;
+    d->HuffQ1[0][ 5].Code =  7; d->HuffQ1[0][ 5].Length = 5;
+    d->HuffQ1[0][ 6].Code = 52; d->HuffQ1[0][ 6].Length = 6;
+    d->HuffQ1[0][ 7].Code =  0; d->HuffQ1[0][ 7].Length = 5;
+    d->HuffQ1[0][ 8].Code = 35; d->HuffQ1[0][ 8].Length = 6;
+    d->HuffQ1[0][ 9].Code = 10; d->HuffQ1[0][ 9].Length = 5;
+    d->HuffQ1[0][10].Code =  6; d->HuffQ1[0][10].Length = 4;
+    d->HuffQ1[0][11].Code =  4; d->HuffQ1[0][11].Length = 5;
+    d->HuffQ1[0][12].Code = 11; d->HuffQ1[0][12].Length = 4;
+    d->HuffQ1[0][13].Code =  7; d->HuffQ1[0][13].Length = 3;
+    d->HuffQ1[0][14].Code = 12; d->HuffQ1[0][14].Length = 4;
+    d->HuffQ1[0][15].Code =  3; d->HuffQ1[0][15].Length = 5;
+    d->HuffQ1[0][16].Code =  7; d->HuffQ1[0][16].Length = 4;
+    d->HuffQ1[0][17].Code = 11; d->HuffQ1[0][17].Length = 5;
+    d->HuffQ1[0][18].Code = 34; d->HuffQ1[0][18].Length = 6;
+    d->HuffQ1[0][19].Code =  1; d->HuffQ1[0][19].Length = 5;
+    d->HuffQ1[0][20].Code = 53; d->HuffQ1[0][20].Length = 6;
+    d->HuffQ1[0][21].Code =  6; d->HuffQ1[0][21].Length = 5;
+    d->HuffQ1[0][22].Code =  9; d->HuffQ1[0][22].Length = 4;
+    d->HuffQ1[0][23].Code =  2; d->HuffQ1[0][23].Length = 5;
+    d->HuffQ1[0][24].Code = 33; d->HuffQ1[0][24].Length = 6;
+    d->HuffQ1[0][25].Code =  8; d->HuffQ1[0][25].Length = 5;
+    d->HuffQ1[0][26].Code = 55; d->HuffQ1[0][26].Length = 6;
+
+    //more shaped, book 1
+    d->HuffQ1[1][ 0].Code = 103; d->HuffQ1[1][ 0].Length = 8;
+    d->HuffQ1[1][ 1].Code =  62; d->HuffQ1[1][ 1].Length = 7;
+    d->HuffQ1[1][ 2].Code = 225; d->HuffQ1[1][ 2].Length = 9;
+    d->HuffQ1[1][ 3].Code =  55; d->HuffQ1[1][ 3].Length = 7;
+    d->HuffQ1[1][ 4].Code =   3; d->HuffQ1[1][ 4].Length = 4;
+    d->HuffQ1[1][ 5].Code =  52; d->HuffQ1[1][ 5].Length = 7;
+    d->HuffQ1[1][ 6].Code = 101; d->HuffQ1[1][ 6].Length = 8;
+    d->HuffQ1[1][ 7].Code =  60; d->HuffQ1[1][ 7].Length = 7;
+    d->HuffQ1[1][ 8].Code = 227; d->HuffQ1[1][ 8].Length = 9;
+    d->HuffQ1[1][ 9].Code =  24; d->HuffQ1[1][ 9].Length = 6;
+    d->HuffQ1[1][10].Code =   0; d->HuffQ1[1][10].Length = 4;
+    d->HuffQ1[1][11].Code =  61; d->HuffQ1[1][11].Length = 7;
+    d->HuffQ1[1][12].Code =   4; d->HuffQ1[1][12].Length = 4;
+    d->HuffQ1[1][13].Code =   1; d->HuffQ1[1][13].Length = 1;
+    d->HuffQ1[1][14].Code =   5; d->HuffQ1[1][14].Length = 4;
+    d->HuffQ1[1][15].Code =  63; d->HuffQ1[1][15].Length = 7;
+    d->HuffQ1[1][16].Code =   1; d->HuffQ1[1][16].Length = 4;
+    d->HuffQ1[1][17].Code =  59; d->HuffQ1[1][17].Length = 7;
+    d->HuffQ1[1][18].Code = 226; d->HuffQ1[1][18].Length = 9;
+    d->HuffQ1[1][19].Code =  57; d->HuffQ1[1][19].Length = 7;
+    d->HuffQ1[1][20].Code = 100; d->HuffQ1[1][20].Length = 8;
+    d->HuffQ1[1][21].Code =  53; d->HuffQ1[1][21].Length = 7;
+    d->HuffQ1[1][22].Code =   2; d->HuffQ1[1][22].Length = 4;
+    d->HuffQ1[1][23].Code =  54; d->HuffQ1[1][23].Length = 7;
+    d->HuffQ1[1][24].Code = 224; d->HuffQ1[1][24].Length = 9;
+    d->HuffQ1[1][25].Code =  58; d->HuffQ1[1][25].Length = 7;
+    d->HuffQ1[1][26].Code = 102; d->HuffQ1[1][26].Length = 8;
+
+    /********************** 5-step quantizer **************************/
+    /********************* 2 bundled samples **************************/
+    //less shaped, book 0
+    d->HuffQ2[0][ 0].Code =  89; d->HuffQ2[0][ 0].Length = 7;
+    d->HuffQ2[0][ 1].Code =  47; d->HuffQ2[0][ 1].Length = 6;
+    d->HuffQ2[0][ 2].Code =  15; d->HuffQ2[0][ 2].Length = 5;
+    d->HuffQ2[0][ 3].Code =   0; d->HuffQ2[0][ 3].Length = 5;
+    d->HuffQ2[0][ 4].Code =  91; d->HuffQ2[0][ 4].Length = 7;
+    d->HuffQ2[0][ 5].Code =   4; d->HuffQ2[0][ 5].Length = 5;
+    d->HuffQ2[0][ 6].Code =   6; d->HuffQ2[0][ 6].Length = 4;
+    d->HuffQ2[0][ 7].Code =  13; d->HuffQ2[0][ 7].Length = 4;
+    d->HuffQ2[0][ 8].Code =   4; d->HuffQ2[0][ 8].Length = 4;
+    d->HuffQ2[0][ 9].Code =   5; d->HuffQ2[0][ 9].Length = 5;
+    d->HuffQ2[0][10].Code =  20; d->HuffQ2[0][10].Length = 5;
+    d->HuffQ2[0][11].Code =  12; d->HuffQ2[0][11].Length = 4;
+    d->HuffQ2[0][12].Code =   4; d->HuffQ2[0][12].Length = 3;
+    d->HuffQ2[0][13].Code =  15; d->HuffQ2[0][13].Length = 4;
+    d->HuffQ2[0][14].Code =  14; d->HuffQ2[0][14].Length = 5;
+    d->HuffQ2[0][15].Code =   3; d->HuffQ2[0][15].Length = 5;
+    d->HuffQ2[0][16].Code =   3; d->HuffQ2[0][16].Length = 4;
+    d->HuffQ2[0][17].Code =  14; d->HuffQ2[0][17].Length = 4;
+    d->HuffQ2[0][18].Code =   5; d->HuffQ2[0][18].Length = 4;
+    d->HuffQ2[0][19].Code =   1; d->HuffQ2[0][19].Length = 5;
+    d->HuffQ2[0][20].Code =  90; d->HuffQ2[0][20].Length = 7;
+    d->HuffQ2[0][21].Code =   2; d->HuffQ2[0][21].Length = 5;
+    d->HuffQ2[0][22].Code =  21; d->HuffQ2[0][22].Length = 5;
+    d->HuffQ2[0][23].Code =  46; d->HuffQ2[0][23].Length = 6;
+    d->HuffQ2[0][24].Code =  88; d->HuffQ2[0][24].Length = 7;
+
+    //more shaped, book 1
+    d->HuffQ2[1][ 0].Code =  921; d->HuffQ2[1][ 0].Length = 10;
+    d->HuffQ2[1][ 1].Code =  113; d->HuffQ2[1][ 1].Length =  7;
+    d->HuffQ2[1][ 2].Code =   51; d->HuffQ2[1][ 2].Length =  6;
+    d->HuffQ2[1][ 3].Code =  231; d->HuffQ2[1][ 3].Length =  8;
+    d->HuffQ2[1][ 4].Code =  922; d->HuffQ2[1][ 4].Length = 10;
+    d->HuffQ2[1][ 5].Code =  104; d->HuffQ2[1][ 5].Length =  7;
+    d->HuffQ2[1][ 6].Code =   30; d->HuffQ2[1][ 6].Length =  5;
+    d->HuffQ2[1][ 7].Code =    0; d->HuffQ2[1][ 7].Length =  3;
+    d->HuffQ2[1][ 8].Code =   29; d->HuffQ2[1][ 8].Length =  5;
+    d->HuffQ2[1][ 9].Code =  105; d->HuffQ2[1][ 9].Length =  7;
+    d->HuffQ2[1][10].Code =   50; d->HuffQ2[1][10].Length =  6;
+    d->HuffQ2[1][11].Code =    1; d->HuffQ2[1][11].Length =  3;
+    d->HuffQ2[1][12].Code =    2; d->HuffQ2[1][12].Length =  2;
+    d->HuffQ2[1][13].Code =    3; d->HuffQ2[1][13].Length =  3;
+    d->HuffQ2[1][14].Code =   49; d->HuffQ2[1][14].Length =  6;
+    d->HuffQ2[1][15].Code =  107; d->HuffQ2[1][15].Length =  7;
+    d->HuffQ2[1][16].Code =   27; d->HuffQ2[1][16].Length =  5;
+    d->HuffQ2[1][17].Code =    2; d->HuffQ2[1][17].Length =  3;
+    d->HuffQ2[1][18].Code =   31; d->HuffQ2[1][18].Length =  5;
+    d->HuffQ2[1][19].Code =  112; d->HuffQ2[1][19].Length =  7;
+    d->HuffQ2[1][20].Code =  920; d->HuffQ2[1][20].Length = 10;
+    d->HuffQ2[1][21].Code =  106; d->HuffQ2[1][21].Length =  7;
+    d->HuffQ2[1][22].Code =   48; d->HuffQ2[1][22].Length =  6;
+    d->HuffQ2[1][23].Code =  114; d->HuffQ2[1][23].Length =  7;
+    d->HuffQ2[1][24].Code =  923; d->HuffQ2[1][24].Length = 10;
+
+    /********************** 7-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ3[0][0].Code = 12; d->HuffQ3[0][0].Length = 4;
+    d->HuffQ3[0][1].Code =  4; d->HuffQ3[0][1].Length = 3;
+    d->HuffQ3[0][2].Code =  0; d->HuffQ3[0][2].Length = 2;
+    d->HuffQ3[0][3].Code =  1; d->HuffQ3[0][3].Length = 2;
+    d->HuffQ3[0][4].Code =  7; d->HuffQ3[0][4].Length = 3;
+    d->HuffQ3[0][5].Code =  5; d->HuffQ3[0][5].Length = 3;
+    d->HuffQ3[0][6].Code = 13; d->HuffQ3[0][6].Length = 4;
+
+    //more shaped, book 1
+    d->HuffQ3[1][0].Code = 4; d->HuffQ3[1][0].Length = 5;
+    d->HuffQ3[1][1].Code = 3; d->HuffQ3[1][1].Length = 4;
+    d->HuffQ3[1][2].Code = 2; d->HuffQ3[1][2].Length = 2;
+    d->HuffQ3[1][3].Code = 3; d->HuffQ3[1][3].Length = 2;
+    d->HuffQ3[1][4].Code = 1; d->HuffQ3[1][4].Length = 2;
+    d->HuffQ3[1][5].Code = 0; d->HuffQ3[1][5].Length = 3;
+    d->HuffQ3[1][6].Code = 5; d->HuffQ3[1][6].Length = 5;
+
+    /********************** 9-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ4[0][0].Code = 5; d->HuffQ4[0][0].Length = 4;
+    d->HuffQ4[0][1].Code = 0; d->HuffQ4[0][1].Length = 3;
+    d->HuffQ4[0][2].Code = 4; d->HuffQ4[0][2].Length = 3;
+    d->HuffQ4[0][3].Code = 6; d->HuffQ4[0][3].Length = 3;
+    d->HuffQ4[0][4].Code = 7; d->HuffQ4[0][4].Length = 3;
+    d->HuffQ4[0][5].Code = 5; d->HuffQ4[0][5].Length = 3;
+    d->HuffQ4[0][6].Code = 3; d->HuffQ4[0][6].Length = 3;
+    d->HuffQ4[0][7].Code = 1; d->HuffQ4[0][7].Length = 3;
+    d->HuffQ4[0][8].Code = 4; d->HuffQ4[0][8].Length = 4;
+
+    //more shaped, book 1
+    d->HuffQ4[1][0].Code =  9; d->HuffQ4[1][0].Length = 5;
+    d->HuffQ4[1][1].Code = 12; d->HuffQ4[1][1].Length = 4;
+    d->HuffQ4[1][2].Code =  3; d->HuffQ4[1][2].Length = 3;
+    d->HuffQ4[1][3].Code =  0; d->HuffQ4[1][3].Length = 2;
+    d->HuffQ4[1][4].Code =  2; d->HuffQ4[1][4].Length = 2;
+    d->HuffQ4[1][5].Code =  7; d->HuffQ4[1][5].Length = 3;
+    d->HuffQ4[1][6].Code = 13; d->HuffQ4[1][6].Length = 4;
+    d->HuffQ4[1][7].Code =  5; d->HuffQ4[1][7].Length = 4;
+    d->HuffQ4[1][8].Code =  8; d->HuffQ4[1][8].Length = 5;
+
+    /********************* 15-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ5[0][ 0].Code = 57; d->HuffQ5[0][ 0].Length = 6;
+    d->HuffQ5[0][ 1].Code = 23; d->HuffQ5[0][ 1].Length = 5;
+    d->HuffQ5[0][ 2].Code =  8; d->HuffQ5[0][ 2].Length = 4;
+    d->HuffQ5[0][ 3].Code = 10; d->HuffQ5[0][ 3].Length = 4;
+    d->HuffQ5[0][ 4].Code = 13; d->HuffQ5[0][ 4].Length = 4;
+    d->HuffQ5[0][ 5].Code =  0; d->HuffQ5[0][ 5].Length = 3;
+    d->HuffQ5[0][ 6].Code =  2; d->HuffQ5[0][ 6].Length = 3;
+    d->HuffQ5[0][ 7].Code =  3; d->HuffQ5[0][ 7].Length = 3;
+    d->HuffQ5[0][ 8].Code =  1; d->HuffQ5[0][ 8].Length = 3;
+    d->HuffQ5[0][ 9].Code = 15; d->HuffQ5[0][ 9].Length = 4;
+    d->HuffQ5[0][10].Code = 12; d->HuffQ5[0][10].Length = 4;
+    d->HuffQ5[0][11].Code =  9; d->HuffQ5[0][11].Length = 4;
+    d->HuffQ5[0][12].Code = 29; d->HuffQ5[0][12].Length = 5;
+    d->HuffQ5[0][13].Code = 22; d->HuffQ5[0][13].Length = 5;
+    d->HuffQ5[0][14].Code = 56; d->HuffQ5[0][14].Length = 6;
+
+    //more shaped, book 1
+    d->HuffQ5[1][ 0].Code = 229; d->HuffQ5[1][ 0].Length = 8;
+    d->HuffQ5[1][ 1].Code =  56; d->HuffQ5[1][ 1].Length = 6;
+    d->HuffQ5[1][ 2].Code =   7; d->HuffQ5[1][ 2].Length = 5;
+    d->HuffQ5[1][ 3].Code =   2; d->HuffQ5[1][ 3].Length = 4;
+    d->HuffQ5[1][ 4].Code =   0; d->HuffQ5[1][ 4].Length = 3;
+    d->HuffQ5[1][ 5].Code =   3; d->HuffQ5[1][ 5].Length = 3;
+    d->HuffQ5[1][ 6].Code =   5; d->HuffQ5[1][ 6].Length = 3;
+    d->HuffQ5[1][ 7].Code =   6; d->HuffQ5[1][ 7].Length = 3;
+    d->HuffQ5[1][ 8].Code =   4; d->HuffQ5[1][ 8].Length = 3;
+    d->HuffQ5[1][ 9].Code =   2; d->HuffQ5[1][ 9].Length = 3;
+    d->HuffQ5[1][10].Code =  15; d->HuffQ5[1][10].Length = 4;
+    d->HuffQ5[1][11].Code =  29; d->HuffQ5[1][11].Length = 5;
+    d->HuffQ5[1][12].Code =   6; d->HuffQ5[1][12].Length = 5;
+    d->HuffQ5[1][13].Code = 115; d->HuffQ5[1][13].Length = 7;
+    d->HuffQ5[1][14].Code = 228; d->HuffQ5[1][14].Length = 8;
+
+    /********************* 31-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ6[0][ 0].Code =  65; d->HuffQ6[0][ 0].Length = 7;
+    d->HuffQ6[0][ 1].Code =   6; d->HuffQ6[0][ 1].Length = 6;
+    d->HuffQ6[0][ 2].Code =  44; d->HuffQ6[0][ 2].Length = 6;
+    d->HuffQ6[0][ 3].Code =  45; d->HuffQ6[0][ 3].Length = 6;
+    d->HuffQ6[0][ 4].Code =  59; d->HuffQ6[0][ 4].Length = 6;
+    d->HuffQ6[0][ 5].Code =  13; d->HuffQ6[0][ 5].Length = 5;
+    d->HuffQ6[0][ 6].Code =  17; d->HuffQ6[0][ 6].Length = 5;
+    d->HuffQ6[0][ 7].Code =  19; d->HuffQ6[0][ 7].Length = 5;
+    d->HuffQ6[0][ 8].Code =  23; d->HuffQ6[0][ 8].Length = 5;
+    d->HuffQ6[0][ 9].Code =  21; d->HuffQ6[0][ 9].Length = 5;
+    d->HuffQ6[0][10].Code =  26; d->HuffQ6[0][10].Length = 5;
+    d->HuffQ6[0][11].Code =  30; d->HuffQ6[0][11].Length = 5;
+    d->HuffQ6[0][12].Code =   0; d->HuffQ6[0][12].Length = 4;
+    d->HuffQ6[0][13].Code =   2; d->HuffQ6[0][13].Length = 4;
+    d->HuffQ6[0][14].Code =   5; d->HuffQ6[0][14].Length = 4;
+    d->HuffQ6[0][15].Code =   7; d->HuffQ6[0][15].Length = 4;
+    d->HuffQ6[0][16].Code =   3; d->HuffQ6[0][16].Length = 4;
+    d->HuffQ6[0][17].Code =   4; d->HuffQ6[0][17].Length = 4;
+    d->HuffQ6[0][18].Code =  31; d->HuffQ6[0][18].Length = 5;
+    d->HuffQ6[0][19].Code =  28; d->HuffQ6[0][19].Length = 5;
+    d->HuffQ6[0][20].Code =  25; d->HuffQ6[0][20].Length = 5;
+    d->HuffQ6[0][21].Code =  27; d->HuffQ6[0][21].Length = 5;
+    d->HuffQ6[0][22].Code =  24; d->HuffQ6[0][22].Length = 5;
+    d->HuffQ6[0][23].Code =  20; d->HuffQ6[0][23].Length = 5;
+    d->HuffQ6[0][24].Code =  18; d->HuffQ6[0][24].Length = 5;
+    d->HuffQ6[0][25].Code =  12; d->HuffQ6[0][25].Length = 5;
+    d->HuffQ6[0][26].Code =   2; d->HuffQ6[0][26].Length = 5;
+    d->HuffQ6[0][27].Code =  58; d->HuffQ6[0][27].Length = 6;
+    d->HuffQ6[0][28].Code =  33; d->HuffQ6[0][28].Length = 6;
+    d->HuffQ6[0][29].Code =   7; d->HuffQ6[0][29].Length = 6;
+    d->HuffQ6[0][30].Code =  64; d->HuffQ6[0][30].Length = 7;
+
+    //more shaped, book 1
+    d->HuffQ6[1][ 0].Code = 6472; d->HuffQ6[1][ 0].Length = 13;
+    d->HuffQ6[1][ 1].Code = 6474; d->HuffQ6[1][ 1].Length = 13;
+    d->HuffQ6[1][ 2].Code =  808; d->HuffQ6[1][ 2].Length = 10;
+    d->HuffQ6[1][ 3].Code =  405; d->HuffQ6[1][ 3].Length =  9;
+    d->HuffQ6[1][ 4].Code =  203; d->HuffQ6[1][ 4].Length =  8;
+    d->HuffQ6[1][ 5].Code =  102; d->HuffQ6[1][ 5].Length =  7;
+    d->HuffQ6[1][ 6].Code =   49; d->HuffQ6[1][ 6].Length =  6;
+    d->HuffQ6[1][ 7].Code =    9; d->HuffQ6[1][ 7].Length =  5;
+    d->HuffQ6[1][ 8].Code =   15; d->HuffQ6[1][ 8].Length =  5;
+    d->HuffQ6[1][ 9].Code =   31; d->HuffQ6[1][ 9].Length =  5;
+    d->HuffQ6[1][10].Code =    2; d->HuffQ6[1][10].Length =  4;
+    d->HuffQ6[1][11].Code =    6; d->HuffQ6[1][11].Length =  4;
+    d->HuffQ6[1][12].Code =    8; d->HuffQ6[1][12].Length =  4;
+    d->HuffQ6[1][13].Code =   11; d->HuffQ6[1][13].Length =  4;
+    d->HuffQ6[1][14].Code =   13; d->HuffQ6[1][14].Length =  4;
+    d->HuffQ6[1][15].Code =    0; d->HuffQ6[1][15].Length =  3;
+    d->HuffQ6[1][16].Code =   14; d->HuffQ6[1][16].Length =  4;
+    d->HuffQ6[1][17].Code =   10; d->HuffQ6[1][17].Length =  4;
+    d->HuffQ6[1][18].Code =    9; d->HuffQ6[1][18].Length =  4;
+    d->HuffQ6[1][19].Code =    5; d->HuffQ6[1][19].Length =  4;
+    d->HuffQ6[1][20].Code =    3; d->HuffQ6[1][20].Length =  4;
+    d->HuffQ6[1][21].Code =   30; d->HuffQ6[1][21].Length =  5;
+    d->HuffQ6[1][22].Code =   14; d->HuffQ6[1][22].Length =  5;
+    d->HuffQ6[1][23].Code =    8; d->HuffQ6[1][23].Length =  5;
+    d->HuffQ6[1][24].Code =   48; d->HuffQ6[1][24].Length =  6;
+    d->HuffQ6[1][25].Code =  103; d->HuffQ6[1][25].Length =  7;
+    d->HuffQ6[1][26].Code =  201; d->HuffQ6[1][26].Length =  8;
+    d->HuffQ6[1][27].Code =  200; d->HuffQ6[1][27].Length =  8;
+    d->HuffQ6[1][28].Code = 1619; d->HuffQ6[1][28].Length = 11;
+    d->HuffQ6[1][29].Code = 6473; d->HuffQ6[1][29].Length = 13;
+    d->HuffQ6[1][30].Code = 6475; d->HuffQ6[1][30].Length = 13;
+
+    /********************* 63-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ7[0][ 0].Code = 103; d->HuffQ7[0][ 0].Length = 8;    /* 0.003338  -          01100111  */
+    d->HuffQ7[0][ 1].Code = 153; d->HuffQ7[0][ 1].Length = 8;    /* 0.003766  -          10011001  */
+    d->HuffQ7[0][ 2].Code = 181; d->HuffQ7[0][ 2].Length = 8;    /* 0.004715  -          10110101  */
+    d->HuffQ7[0][ 3].Code = 233; d->HuffQ7[0][ 3].Length = 8;    /* 0.005528  -          11101001  */
+    d->HuffQ7[0][ 4].Code =  64; d->HuffQ7[0][ 4].Length = 7;    /* 0.006677  -           1000000  */
+    d->HuffQ7[0][ 5].Code =  65; d->HuffQ7[0][ 5].Length = 7;    /* 0.007041  -           1000001  */
+    d->HuffQ7[0][ 6].Code =  77; d->HuffQ7[0][ 6].Length = 7;    /* 0.007733  -           1001101  */
+    d->HuffQ7[0][ 7].Code =  81; d->HuffQ7[0][ 7].Length = 7;    /* 0.008296  -           1010001  */
+    d->HuffQ7[0][ 8].Code =  91; d->HuffQ7[0][ 8].Length = 7;    /* 0.009295  -           1011011  */
+    d->HuffQ7[0][ 9].Code = 113; d->HuffQ7[0][ 9].Length = 7;    /* 0.010814  -           1110001  */
+    d->HuffQ7[0][10].Code = 112; d->HuffQ7[0][10].Length = 7;    /* 0.010807  -           1110000  */
+    d->HuffQ7[0][11].Code =  24; d->HuffQ7[0][11].Length = 6;    /* 0.012748  -            011000  */
+    d->HuffQ7[0][12].Code =  29; d->HuffQ7[0][12].Length = 6;    /* 0.013390  -            011101  */
+    d->HuffQ7[0][13].Code =  35; d->HuffQ7[0][13].Length = 6;    /* 0.014224  -            100011  */
+    d->HuffQ7[0][14].Code =  37; d->HuffQ7[0][14].Length = 6;    /* 0.015201  -            100101  */
+    d->HuffQ7[0][15].Code =  41; d->HuffQ7[0][15].Length = 6;    /* 0.016642  -            101001  */
+    d->HuffQ7[0][16].Code =  44; d->HuffQ7[0][16].Length = 6;    /* 0.017292  -            101100  */
+    d->HuffQ7[0][17].Code =  46; d->HuffQ7[0][17].Length = 6;    /* 0.018647  -            101110  */
+    d->HuffQ7[0][18].Code =  51; d->HuffQ7[0][18].Length = 6;    /* 0.020473  -            110011  */
+    d->HuffQ7[0][19].Code =  49; d->HuffQ7[0][19].Length = 6;    /* 0.020152  -            110001  */
+    d->HuffQ7[0][20].Code =  54; d->HuffQ7[0][20].Length = 6;    /* 0.021315  -            110110  */
+    d->HuffQ7[0][21].Code =  55; d->HuffQ7[0][21].Length = 6;    /* 0.021358  -            110111  */
+    d->HuffQ7[0][22].Code =  57; d->HuffQ7[0][22].Length = 6;    /* 0.021700  -            111001  */
+    d->HuffQ7[0][23].Code =  60; d->HuffQ7[0][23].Length = 6;    /* 0.022449  -            111100  */
+    d->HuffQ7[0][24].Code =   0; d->HuffQ7[0][24].Length = 5;    /* 0.023063  -             00000  */
+    d->HuffQ7[0][25].Code =   2; d->HuffQ7[0][25].Length = 5;    /* 0.023854  -             00010  */
+    d->HuffQ7[0][26].Code =  10; d->HuffQ7[0][26].Length = 5;    /* 0.025481  -             01010  */
+    d->HuffQ7[0][27].Code =   5; d->HuffQ7[0][27].Length = 5;    /* 0.024867  -             00101  */
+    d->HuffQ7[0][28].Code =   9; d->HuffQ7[0][28].Length = 5;    /* 0.025352  -             01001  */
+    d->HuffQ7[0][29].Code =   6; d->HuffQ7[0][29].Length = 5;    /* 0.025074  -             00110  */
+    d->HuffQ7[0][30].Code =  13; d->HuffQ7[0][30].Length = 5;    /* 0.025745  -             01101  */
+    d->HuffQ7[0][31].Code =   7; d->HuffQ7[0][31].Length = 5;    /* 0.025195  -             00111  */
+    d->HuffQ7[0][32].Code =  11; d->HuffQ7[0][32].Length = 5;    /* 0.025502  -             01011  */
+    d->HuffQ7[0][33].Code =  15; d->HuffQ7[0][33].Length = 5;    /* 0.026251  -             01111  */
+    d->HuffQ7[0][34].Code =   8; d->HuffQ7[0][34].Length = 5;    /* 0.025260  -             01000  */
+    d->HuffQ7[0][35].Code =   4; d->HuffQ7[0][35].Length = 5;    /* 0.024418  -             00100  */
+    d->HuffQ7[0][36].Code =   3; d->HuffQ7[0][36].Length = 5;    /* 0.023983  -             00011  */
+    d->HuffQ7[0][37].Code =   1; d->HuffQ7[0][37].Length = 5;    /* 0.023697  -             00001  */
+    d->HuffQ7[0][38].Code =  63; d->HuffQ7[0][38].Length = 6;    /* 0.023041  -            111111  */
+    d->HuffQ7[0][39].Code =  62; d->HuffQ7[0][39].Length = 6;    /* 0.022656  -            111110  */
+    d->HuffQ7[0][40].Code =  61; d->HuffQ7[0][40].Length = 6;    /* 0.022549  -            111101  */
+    d->HuffQ7[0][41].Code =  53; d->HuffQ7[0][41].Length = 6;    /* 0.021151  -            110101  */
+    d->HuffQ7[0][42].Code =  59; d->HuffQ7[0][42].Length = 6;    /* 0.022042  -            111011  */
+    d->HuffQ7[0][43].Code =  52; d->HuffQ7[0][43].Length = 6;    /* 0.020837  -            110100  */
+    d->HuffQ7[0][44].Code =  48; d->HuffQ7[0][44].Length = 6;    /* 0.019446  -            110000  */
+    d->HuffQ7[0][45].Code =  47; d->HuffQ7[0][45].Length = 6;    /* 0.019189  -            101111  */
+    d->HuffQ7[0][46].Code =  43; d->HuffQ7[0][46].Length = 6;    /* 0.017177  -            101011  */
+    d->HuffQ7[0][47].Code =  42; d->HuffQ7[0][47].Length = 6;    /* 0.017035  -            101010  */
+    d->HuffQ7[0][48].Code =  39; d->HuffQ7[0][48].Length = 6;    /* 0.015287  -            100111  */
+    d->HuffQ7[0][49].Code =  36; d->HuffQ7[0][49].Length = 6;    /* 0.014559  -            100100  */
+    d->HuffQ7[0][50].Code =  33; d->HuffQ7[0][50].Length = 6;    /* 0.014117  -            100001  */
+    d->HuffQ7[0][51].Code =  28; d->HuffQ7[0][51].Length = 6;    /* 0.012776  -            011100  */
+    d->HuffQ7[0][52].Code = 117; d->HuffQ7[0][52].Length = 7;    /* 0.011107  -           1110101  */
+    d->HuffQ7[0][53].Code = 101; d->HuffQ7[0][53].Length = 7;    /* 0.010636  -           1100101  */
+    d->HuffQ7[0][54].Code = 100; d->HuffQ7[0][54].Length = 7;    /* 0.009751  -           1100100  */
+    d->HuffQ7[0][55].Code =  80; d->HuffQ7[0][55].Length = 7;    /* 0.008132  -           1010000  */
+    d->HuffQ7[0][56].Code =  69; d->HuffQ7[0][56].Length = 7;    /* 0.007091  -           1000101  */
+    d->HuffQ7[0][57].Code =  68; d->HuffQ7[0][57].Length = 7;    /* 0.007084  -           1000100  */
+    d->HuffQ7[0][58].Code =  50; d->HuffQ7[0][58].Length = 7;    /* 0.006277  -           0110010  */
+    d->HuffQ7[0][59].Code = 232; d->HuffQ7[0][59].Length = 8;    /* 0.005386  -          11101000  */
+    d->HuffQ7[0][60].Code = 180; d->HuffQ7[0][60].Length = 8;    /* 0.004408  -          10110100  */
+    d->HuffQ7[0][61].Code = 152; d->HuffQ7[0][61].Length = 8;    /* 0.003759  -          10011000  */
+    d->HuffQ7[0][62].Code = 102; d->HuffQ7[0][62].Length = 8;    /* 0.003160  -          01100110  */
+
+    //more shaped, book 1
+    d->HuffQ7[1][ 0].Code = 14244; d->HuffQ7[1][ 0].Length = 14;    /* 0.000059  -        11011110100100  */
+    d->HuffQ7[1][ 1].Code = 14253; d->HuffQ7[1][ 1].Length = 14;    /* 0.000098  -        11011110101101  */
+    d->HuffQ7[1][ 2].Code = 14246; d->HuffQ7[1][ 2].Length = 14;    /* 0.000078  -        11011110100110  */
+    d->HuffQ7[1][ 3].Code = 14254; d->HuffQ7[1][ 3].Length = 14;    /* 0.000111  -        11011110101110  */
+    d->HuffQ7[1][ 4].Code =  3562; d->HuffQ7[1][ 4].Length = 12;    /* 0.000320  -          110111101010  */
+    d->HuffQ7[1][ 5].Code =   752; d->HuffQ7[1][ 5].Length = 10;    /* 0.000920  -            1011110000  */
+    d->HuffQ7[1][ 6].Code =   753; d->HuffQ7[1][ 6].Length = 10;    /* 0.001057  -            1011110001  */
+    d->HuffQ7[1][ 7].Code =   160; d->HuffQ7[1][ 7].Length =  9;    /* 0.001403  -             010100000  */
+    d->HuffQ7[1][ 8].Code =   162; d->HuffQ7[1][ 8].Length =  9;    /* 0.001579  -             010100010  */
+    d->HuffQ7[1][ 9].Code =   444; d->HuffQ7[1][ 9].Length =  9;    /* 0.002486  -             110111100  */
+    d->HuffQ7[1][10].Code =   122; d->HuffQ7[1][10].Length =  8;    /* 0.003772  -              01111010  */
+    d->HuffQ7[1][11].Code =   223; d->HuffQ7[1][11].Length =  8;    /* 0.005710  -              11011111  */
+    d->HuffQ7[1][12].Code =    60; d->HuffQ7[1][12].Length =  7;    /* 0.006858  -               0111100  */
+    d->HuffQ7[1][13].Code =    73; d->HuffQ7[1][13].Length =  7;    /* 0.008033  -               1001001  */
+    d->HuffQ7[1][14].Code =   110; d->HuffQ7[1][14].Length =  7;    /* 0.009827  -               1101110  */
+    d->HuffQ7[1][15].Code =    14; d->HuffQ7[1][15].Length =  6;    /* 0.012601  -                001110  */
+    d->HuffQ7[1][16].Code =    24; d->HuffQ7[1][16].Length =  6;    /* 0.013194  -                011000  */
+    d->HuffQ7[1][17].Code =    25; d->HuffQ7[1][17].Length =  6;    /* 0.013938  -                011001  */
+    d->HuffQ7[1][18].Code =    34; d->HuffQ7[1][18].Length =  6;    /* 0.015693  -                100010  */
+    d->HuffQ7[1][19].Code =    37; d->HuffQ7[1][19].Length =  6;    /* 0.017846  -                100101  */
+    d->HuffQ7[1][20].Code =    54; d->HuffQ7[1][20].Length =  6;    /* 0.020078  -                110110  */
+    d->HuffQ7[1][21].Code =     3; d->HuffQ7[1][21].Length =  5;    /* 0.022975  -                 00011  */
+    d->HuffQ7[1][22].Code =     9; d->HuffQ7[1][22].Length =  5;    /* 0.025631  -                 01001  */
+    d->HuffQ7[1][23].Code =    11; d->HuffQ7[1][23].Length =  5;    /* 0.027021  -                 01011  */
+    d->HuffQ7[1][24].Code =    16; d->HuffQ7[1][24].Length =  5;    /* 0.031465  -                 10000  */
+    d->HuffQ7[1][25].Code =    19; d->HuffQ7[1][25].Length =  5;    /* 0.034244  -                 10011  */
+    d->HuffQ7[1][26].Code =    21; d->HuffQ7[1][26].Length =  5;    /* 0.035921  -                 10101  */
+    d->HuffQ7[1][27].Code =    24; d->HuffQ7[1][27].Length =  5;    /* 0.037938  -                 11000  */
+    d->HuffQ7[1][28].Code =    26; d->HuffQ7[1][28].Length =  5;    /* 0.039595  -                 11010  */
+    d->HuffQ7[1][29].Code =    29; d->HuffQ7[1][29].Length =  5;    /* 0.041546  -                 11101  */
+    d->HuffQ7[1][30].Code =    31; d->HuffQ7[1][30].Length =  5;    /* 0.042623  -                 11111  */
+    d->HuffQ7[1][31].Code =     2; d->HuffQ7[1][31].Length =  4;    /* 0.045180  -                  0010  */
+    d->HuffQ7[1][32].Code =     0; d->HuffQ7[1][32].Length =  4;    /* 0.043151  -                  0000  */
+    d->HuffQ7[1][33].Code =    30; d->HuffQ7[1][33].Length =  5;    /* 0.042538  -                 11110  */
+    d->HuffQ7[1][34].Code =    28; d->HuffQ7[1][34].Length =  5;    /* 0.041422  -                 11100  */
+    d->HuffQ7[1][35].Code =    25; d->HuffQ7[1][35].Length =  5;    /* 0.039145  -                 11001  */
+    d->HuffQ7[1][36].Code =    22; d->HuffQ7[1][36].Length =  5;    /* 0.036691  -                 10110  */
+    d->HuffQ7[1][37].Code =    20; d->HuffQ7[1][37].Length =  5;    /* 0.034955  -                 10100  */
+    d->HuffQ7[1][38].Code =    14; d->HuffQ7[1][38].Length =  5;    /* 0.029155  -                 01110  */
+    d->HuffQ7[1][39].Code =    13; d->HuffQ7[1][39].Length =  5;    /* 0.027921  -                 01101  */
+    d->HuffQ7[1][40].Code =     8; d->HuffQ7[1][40].Length =  5;    /* 0.025553  -                 01000  */
+    d->HuffQ7[1][41].Code =     6; d->HuffQ7[1][41].Length =  5;    /* 0.023093  -                 00110  */
+    d->HuffQ7[1][42].Code =     2; d->HuffQ7[1][42].Length =  5;    /* 0.021200  -                 00010  */
+    d->HuffQ7[1][43].Code =    46; d->HuffQ7[1][43].Length =  6;    /* 0.018134  -                101110  */
+    d->HuffQ7[1][44].Code =    35; d->HuffQ7[1][44].Length =  6;    /* 0.015824  -                100011  */
+    d->HuffQ7[1][45].Code =    31; d->HuffQ7[1][45].Length =  6;    /* 0.014701  -                011111  */
+    d->HuffQ7[1][46].Code =    21; d->HuffQ7[1][46].Length =  6;    /* 0.013187  -                010101  */
+    d->HuffQ7[1][47].Code =    15; d->HuffQ7[1][47].Length =  6;    /* 0.012776  -                001111  */
+    d->HuffQ7[1][48].Code =    95; d->HuffQ7[1][48].Length =  7;    /* 0.009664  -               1011111  */
+    d->HuffQ7[1][49].Code =    72; d->HuffQ7[1][49].Length =  7;    /* 0.007922  -               1001000  */
+    d->HuffQ7[1][50].Code =    41; d->HuffQ7[1][50].Length =  7;    /* 0.006838  -               0101001  */
+    d->HuffQ7[1][51].Code =   189; d->HuffQ7[1][51].Length =  8;    /* 0.005024  -              10111101  */
+    d->HuffQ7[1][52].Code =   123; d->HuffQ7[1][52].Length =  8;    /* 0.003830  -              01111011  */
+    d->HuffQ7[1][53].Code =   377; d->HuffQ7[1][53].Length =  9;    /* 0.002232  -             101111001  */
+    d->HuffQ7[1][54].Code =   161; d->HuffQ7[1][54].Length =  9;    /* 0.001566  -             010100001  */
+    d->HuffQ7[1][55].Code =   891; d->HuffQ7[1][55].Length = 10;    /* 0.001383  -            1101111011  */
+    d->HuffQ7[1][56].Code =   327; d->HuffQ7[1][56].Length = 10;    /* 0.000900  -            0101000111  */
+    d->HuffQ7[1][57].Code =   326; d->HuffQ7[1][57].Length = 10;    /* 0.000790  -            0101000110  */
+    d->HuffQ7[1][58].Code =  3560; d->HuffQ7[1][58].Length = 12;    /* 0.000254  -          110111101000  */
+    d->HuffQ7[1][59].Code = 14255; d->HuffQ7[1][59].Length = 14;    /* 0.000117  -        11011110101111  */
+    d->HuffQ7[1][60].Code = 14247; d->HuffQ7[1][60].Length = 14;    /* 0.000085  -        11011110100111  */
+    d->HuffQ7[1][61].Code = 14252; d->HuffQ7[1][61].Length = 14;    /* 0.000085  -        11011110101100  */
+    d->HuffQ7[1][62].Code = 14245; d->HuffQ7[1][62].Length = 14;    /* 0.000065  -        11011110100101  */
+}
Index: /libmpcdec/tags/release-1.2.2/src/idtag.c
===================================================================
--- /libmpcdec/tags/release-1.2.2/src/idtag.c	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/src/idtag.c	(revision 30)
@@ -0,0 +1,83 @@
+/*
+  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 idtag.c
+/// Rudimentary id3tag handling routines, just enough to skip id3v2 tags,
+/// if present.
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/internal.h>
+
+mpc_int32_t
+JumpID3v2 (mpc_reader* r) {
+    unsigned char  tmp [10];
+    mpc_uint32_t   Unsynchronisation;   // ID3v2.4-flag
+    mpc_uint32_t   ExtHeaderPresent;    // ID3v2.4-flag
+    mpc_uint32_t   ExperimentalFlag;    // ID3v2.4-flag
+    mpc_uint32_t   FooterPresent;       // ID3v2.4-flag
+    mpc_int32_t    ret;
+
+    // seek to first byte of mpc data
+    if (!r->seek (r->data, 0)) {
+        return 0;  
+    }
+    
+    r->read(r->data, tmp, sizeof(tmp));
+
+    // check id3-tag
+    if ( 0 != memcmp ( tmp, "ID3", 3) )
+        return 0;
+
+    // read flags
+    Unsynchronisation = tmp[5] & 0x80;
+    ExtHeaderPresent  = tmp[5] & 0x40;
+    ExperimentalFlag  = tmp[5] & 0x20;
+    FooterPresent     = tmp[5] & 0x10;
+
+    if ( tmp[5] & 0x0F )
+        return -1;              // not (yet???) allowed
+    if ( (tmp[6] | tmp[7] | tmp[8] | tmp[9]) & 0x80 )
+        return -1;              // not allowed
+
+    // read HeaderSize (syncsave: 4 * $0xxxxxxx = 28 significant bits)
+    ret  = tmp[6] << 21;
+    ret += tmp[7] << 14;
+    ret += tmp[8] <<  7;
+    ret += tmp[9]      ;
+    ret += 10;
+    if ( FooterPresent )
+        ret += 10;
+
+    return ret;
+}
Index: /libmpcdec/tags/release-1.2.2/src/mpc_decoder.c
===================================================================
--- /libmpcdec/tags/release-1.2.2/src/mpc_decoder.c	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/src/mpc_decoder.c	(revision 30)
@@ -0,0 +1,1381 @@
+/*
+  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 mpc_decoder.c
+/// Core decoding routines and logic.
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/internal.h>
+#include <mpcdec/requant.h>
+#include <mpcdec/huffman.h>
+
+//------------------------------------------------------------------------------
+// types
+//------------------------------------------------------------------------------
+enum
+    {
+        EQ_TAP = 13,                        // length of FIR filter for EQ
+        DELAY = ((EQ_TAP + 1) / 2),         // delay of FIR
+        FIR_BANDS = 4,                      // number of subbands to be FIR filtered
+        MEMSIZE = MPC_DECODER_MEMSIZE,      // overall buffer size
+        MEMSIZE2 = (MEMSIZE/2),             // size of one buffer
+        MEMMASK = (MEMSIZE-1)
+    };
+
+//------------------------------------------------------------------------------
+// forward declarations
+//------------------------------------------------------------------------------
+void mpc_decoder_init_huffman_sv6(mpc_decoder *d);
+void mpc_decoder_init_huffman_sv7(mpc_decoder *d);
+void mpc_decoder_read_bitstream_sv6(mpc_decoder *d);
+void mpc_decoder_read_bitstream_sv7(mpc_decoder *d);
+void mpc_decoder_update_buffer(mpc_decoder *d, mpc_uint32_t RING);
+mpc_bool_t mpc_decoder_seek_sample(mpc_decoder *d, mpc_int64_t destsample);
+void mpc_decoder_requantisierung(mpc_decoder *d, const mpc_int32_t Last_Band);
+
+//------------------------------------------------------------------------------
+// utility functions
+//------------------------------------------------------------------------------
+static mpc_int32_t f_read(mpc_decoder *d, void *ptr, size_t size) 
+{ 
+    return d->r->read(d->r->data, ptr, size); 
+};
+
+static mpc_bool_t f_seek(mpc_decoder *d, mpc_int32_t offset) 
+{ 
+    return d->r->seek(d->r->data, offset); 
+};
+
+static mpc_int32_t f_read_dword(mpc_decoder *d, mpc_uint32_t * ptr, mpc_uint32_t count) 
+{
+    count = f_read(d, ptr, count << 2) >> 2;
+#ifndef MPC_LITTLE_ENDIAN
+    mpc_uint32_t n;
+    for(n = 0; n< count; n++) {
+        ptr[n] = mpc_swap32(ptr[n]);
+    }
+#endif
+    return count;
+}
+
+//------------------------------------------------------------------------------
+// huffman & bitstream functions
+//------------------------------------------------------------------------------
+static const mpc_uint32_t mask [33] = {
+    0x00000000, 0x00000001, 0x00000003, 0x00000007,
+    0x0000000F, 0x0000001F, 0x0000003F, 0x0000007F,
+    0x000000FF, 0x000001FF, 0x000003FF, 0x000007FF,
+    0x00000FFF, 0x00001FFF, 0x00003FFF, 0x00007FFF,
+    0x0000FFFF, 0x0001FFFF, 0x0003FFFF, 0x0007FFFF,
+    0x000FFFFF, 0x001FFFFF, 0x003FFFFF, 0x007FFFFF,
+    0x00FFFFFF, 0x01FFFFFF, 0x03FFFFFF, 0x07FFFFFF,
+    0x0FFFFFFF, 0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF,
+    0xFFFFFFFF
+};
+
+/* F U N C T I O N S */
+
+// resets bitstream decoding
+static void
+mpc_decoder_reset_bitstream_decode(mpc_decoder *d) 
+{
+    d->dword = 0;
+    d->pos = 0;
+    d->Zaehler = 0;
+    d->WordsRead = 0;
+}
+
+// reports the number of read bits
+static mpc_uint32_t
+mpc_decoder_bits_read(mpc_decoder *d) 
+{
+    return 32 * d->WordsRead + d->pos;
+}
+
+// read desired number of bits out of the bitstream
+static mpc_uint32_t
+mpc_decoder_bitstream_read(mpc_decoder *d, const mpc_uint32_t bits) 
+{
+    mpc_uint32_t out = d->dword;
+
+    d->pos += bits;
+
+    if (d->pos < 32) {
+        out >>= (32 - d->pos);
+    }
+    else {
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
+        d->pos -= 32;
+        if (d->pos) {
+            out <<= d->pos;
+            out |= d->dword >> (32 - d->pos);
+        }
+        ++(d->WordsRead);
+    }
+
+    return out & mask[bits];
+}
+
+// decode SCFI-bundle (sv4,5,6)
+static void
+mpc_decoder_scfi_bundle_read(
+    mpc_decoder *d,
+    HuffmanTyp* Table, mpc_int32_t* SCFI, mpc_int32_t* DSCF) 
+{
+    // load preview and decode
+    mpc_uint32_t code  = d->dword << d->pos;
+    if (d->pos > 26) {
+        code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
+    }
+    while (code < Table->Code) {
+        Table++;
+    }
+
+    // set the new position within bitstream without performing a dummy-read
+    if ((d->pos += Table->Length) >= 32) {
+        d->pos -= 32;
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler+1) & MEMMASK];
+        ++(d->WordsRead);
+    }
+
+    *SCFI = Table->Value >> 1;
+    *DSCF = Table->Value &  1;
+}
+
+static int
+mpc_decoder_huffman_typ_cmpfn(const void* p1, const void* p2)
+{
+    if (((HuffmanTyp*) p1)->Code < ((HuffmanTyp*) p2)->Code ) return +1;
+    if (((HuffmanTyp*) p1)->Code > ((HuffmanTyp*) p2)->Code ) return -1;
+    return 0;
+}
+
+// sort huffman-tables by codeword
+// offset resulting value
+void
+mpc_decoder_resort_huff_tables(
+    const mpc_uint32_t elements, HuffmanTyp* Table, const mpc_int32_t offset ) 
+{
+    mpc_uint32_t  i;
+
+    for ( i = 0; i < elements; i++ ) {
+        Table[i].Code <<= 32 - Table[i].Length;
+        Table[i].Value  =  i - offset;
+    }
+    qsort(Table, elements, sizeof(*Table), mpc_decoder_huffman_typ_cmpfn);
+}
+
+// basic huffman decoding routine
+// works with maximum lengths up to 14
+static mpc_int32_t
+mpc_decoder_huffman_decode(mpc_decoder *d, const HuffmanTyp *Table) 
+{
+    // load preview and decode
+    mpc_uint32_t code = d->dword << d->pos;
+    if (d->pos > 18) {
+        code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
+    }
+    while (code < Table->Code) {
+        Table++;
+    }
+
+    // set the new position within bitstream without performing a dummy-read
+    if ((d->pos += Table->Length) >= 32) {
+        d->pos -= 32;
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
+        ++(d->WordsRead);
+    }
+
+    return Table->Value;
+}
+
+// faster huffman through previewing less bits
+// works with maximum lengths up to 10
+static mpc_int32_t
+mpc_decoder_huffman_decode_fast(mpc_decoder *d, const HuffmanTyp* Table)
+{
+    // load preview and decode
+    mpc_uint32_t code  = d->dword << d->pos;
+    if (d->pos > 22) {
+        code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
+    }
+    while (code < Table->Code) {
+        Table++;
+    }
+
+    // set the new position within bitstream without performing a dummy-read
+    if ((d->pos += Table->Length) >= 32) {
+        d->pos -= 32;
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
+        ++(d->WordsRead);
+    }
+
+    return Table->Value;
+}
+
+// even faster huffman through previewing even less bits
+// works with maximum lengths up to 5
+static mpc_int32_t
+mpc_decoder_huffman_decode_faster(mpc_decoder *d, const HuffmanTyp* Table)
+{
+    // load preview and decode
+    mpc_uint32_t code  = d->dword << d->pos;
+    if (d->pos > 27) {
+        code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
+    }
+    while (code < Table->Code) {
+        Table++;
+    }
+
+    // set the new position within bitstream without performing a dummy-read
+    if ((d->pos += Table->Length) >= 32) {
+        d->pos -= 32;
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
+        ++(d->WordsRead);
+    }
+
+    return Table->Value;
+}
+
+static void
+mpc_decoder_reset_v(mpc_decoder *d) 
+{
+    memset(d->V_L, 0, sizeof d->V_L);
+    memset(d->V_R, 0, sizeof d->V_R);
+}
+
+static void
+mpc_decoder_reset_synthesis(mpc_decoder *d) 
+{
+    mpc_decoder_reset_v(d);
+}
+
+static void
+mpc_decoder_reset_y(mpc_decoder *d) 
+{
+    memset(d->Y_L, 0, sizeof d->Y_L);
+    memset(d->Y_R, 0, sizeof d->Y_R);
+}
+
+static void
+mpc_decoder_reset_globals(mpc_decoder *d) 
+{
+    mpc_decoder_reset_bitstream_decode(d);
+
+    d->DecodedFrames  = 0;
+    d->StreamVersion  = 0;
+    d->MS_used        = 0;
+
+    memset(d->Y_L          , 0, sizeof d->Y_L           );
+    memset(d->Y_R          , 0, sizeof d->Y_R           );
+    memset(d->SCF_Index_L     , 0, sizeof d->SCF_Index_L      );
+    memset(d->SCF_Index_R     , 0, sizeof d->SCF_Index_R      );
+    memset(d->Res_L           , 0, sizeof d->Res_L            );
+    memset(d->Res_R           , 0, sizeof d->Res_R            );
+    memset(d->SCFI_L          , 0, sizeof d->SCFI_L           );
+    memset(d->SCFI_R          , 0, sizeof d->SCFI_R           );
+    memset(d->DSCF_Flag_L     , 0, sizeof d->DSCF_Flag_L      );
+    memset(d->DSCF_Flag_R     , 0, sizeof d->DSCF_Flag_R      );
+    memset(d->DSCF_Reference_L, 0, sizeof d->DSCF_Reference_L );
+    memset(d->DSCF_Reference_R, 0, sizeof d->DSCF_Reference_R );
+    memset(d->Q               , 0, sizeof d->Q                );
+    memset(d->MS_Flag         , 0, sizeof d->MS_Flag          );
+}
+
+mpc_uint32_t
+mpc_decoder_decode_frame(mpc_decoder *d, mpc_uint32_t *in_buffer,
+                         mpc_uint32_t in_len, MPC_SAMPLE_FORMAT *out_buffer)
+{
+  unsigned int i;
+  mpc_decoder_reset_bitstream_decode(d);
+  if (in_len > sizeof(d->Speicher)) in_len = sizeof(d->Speicher);
+  memcpy(d->Speicher, in_buffer, in_len);
+#ifdef MPC_LITTLE_ENDIAN
+  for (i = 0; i < (in_len + 3) / 4; i++)
+    d->Speicher[i] = mpc_swap32(d->Speicher[i]);
+#endif
+  d->dword = d->Speicher[0];
+  switch (d->StreamVersion) {
+    case 0x04:
+    case 0x05:
+    case 0x06:
+        mpc_decoder_read_bitstream_sv6(d);
+        break;
+    case 0x07:
+    case 0x17:
+        mpc_decoder_read_bitstream_sv7(d);
+        break;
+    default:
+        return (mpc_uint32_t)(-1);
+  }
+  mpc_decoder_requantisierung(d, d->Max_Band);
+  mpc_decoder_synthese_filter_float(d, out_buffer);
+  return mpc_decoder_bits_read(d);
+}
+
+static mpc_uint32_t
+mpc_decoder_decode_internal(mpc_decoder *d, MPC_SAMPLE_FORMAT *buffer) 
+{
+    mpc_uint32_t output_frame_length = MPC_FRAME_LENGTH;
+
+    mpc_uint32_t  FrameBitCnt = 0;
+
+    if (d->DecodedFrames >= d->OverallFrames) {
+        return (mpc_uint32_t)(-1);                           // end of file -> abort decoding
+    }
+
+    // read jump-info for validity check of frame
+    d->FwdJumpInfo  = mpc_decoder_bitstream_read(d, 20);
+
+    d->ActDecodePos = (d->Zaehler << 5) + d->pos;
+
+    // decode data and check for validity of frame
+    FrameBitCnt = mpc_decoder_bits_read(d);
+    switch (d->StreamVersion) {
+    case 0x04:
+    case 0x05:
+    case 0x06:
+        mpc_decoder_read_bitstream_sv6(d);
+        break;
+    case 0x07:
+    case 0x17:
+        mpc_decoder_read_bitstream_sv7(d);
+        break;
+    default:
+        return (mpc_uint32_t)(-1);
+    }
+    d->FrameWasValid = mpc_decoder_bits_read(d) - FrameBitCnt == d->FwdJumpInfo;
+
+    // synthesize signal
+    mpc_decoder_requantisierung(d, d->Max_Band);
+
+    //if ( d->EQ_activated && PluginSettings.EQbyMPC )
+    //    perform_EQ ();
+
+    mpc_decoder_synthese_filter_float(d, buffer);
+
+    d->DecodedFrames++;
+
+    // cut off first MPC_DECODER_SYNTH_DELAY zero-samples
+    if (d->DecodedFrames == d->OverallFrames  && d->StreamVersion >= 6) {        
+        // reconstruct exact filelength
+        mpc_int32_t  mod_block   = mpc_decoder_bitstream_read(d,  11);
+        mpc_int32_t  FilterDecay;
+
+        if (mod_block == 0) {
+            // Encoder bugfix
+            mod_block = 1152;                    
+        }
+        FilterDecay = (mod_block + MPC_DECODER_SYNTH_DELAY) % MPC_FRAME_LENGTH;
+
+        // additional FilterDecay samples are needed for decay of synthesis filter
+        if (MPC_DECODER_SYNTH_DELAY + mod_block >= MPC_FRAME_LENGTH) {
+
+            // **********************************************************************
+            // Rhoades 4/16/2002
+            // Commented out are blocks of code which cause gapless playback to fail.
+            // Temporary fix...
+            // **********************************************************************
+
+            if (!d->TrueGaplessPresent) {
+                mpc_decoder_reset_y(d);
+            } 
+            else {
+                //if ( MPC_FRAME_LENGTH != d->LastValidSamples ) {
+                mpc_decoder_bitstream_read(d, 20);
+                mpc_decoder_read_bitstream_sv7(d);
+                mpc_decoder_requantisierung(d, d->Max_Band);
+                //FilterDecay = d->LastValidSamples;
+                //}
+                //else {
+                //FilterDecay = 0;
+                //}
+            }
+
+            mpc_decoder_synthese_filter_float(d, buffer + 2304);
+
+            output_frame_length = MPC_FRAME_LENGTH + FilterDecay;
+        }
+        else {                              // there are only FilterDecay samples needed for this frame
+            output_frame_length = FilterDecay;
+        }
+    }
+
+    if (d->samples_to_skip) {
+        if (output_frame_length < d->samples_to_skip) {
+            d->samples_to_skip -= output_frame_length;
+            output_frame_length = 0;
+        }
+        else {
+            output_frame_length -= d->samples_to_skip;
+            memmove(
+                buffer, 
+                buffer + d->samples_to_skip * 2, 
+                output_frame_length * 2 * sizeof (MPC_SAMPLE_FORMAT));
+            d->samples_to_skip = 0;
+        }
+    }
+
+    return output_frame_length;
+}
+
+mpc_uint32_t mpc_decoder_decode(
+    mpc_decoder *d,
+    MPC_SAMPLE_FORMAT *buffer, 
+    mpc_uint32_t *vbr_update_acc, 
+    mpc_uint32_t *vbr_update_bits)
+{
+    for(;;)
+    {
+        //const mpc_int32_t MaxBrokenFrames = 0; // PluginSettings.MaxBrokenFrames
+
+        mpc_uint32_t RING = d->Zaehler;
+        mpc_int32_t vbr_ring = (RING << 5) + d->pos;
+
+        mpc_uint32_t valid_samples = mpc_decoder_decode_internal(d, buffer);
+
+        if (valid_samples == (mpc_uint32_t)(-1) ) {
+            return 0;
+        }
+
+        /**************** ERROR CONCEALMENT *****************/
+        if (d->FrameWasValid == 0 ) {
+            // error occurred in bitstream
+            return (mpc_uint32_t)(-1);
+        } 
+        else {
+            if (vbr_update_acc && vbr_update_bits) {
+                (*vbr_update_acc) ++;
+                vbr_ring = (d->Zaehler << 5) + d->pos - vbr_ring;
+                if (vbr_ring < 0) {
+                    vbr_ring += 524288;
+                }
+                (*vbr_update_bits) += vbr_ring;
+            }
+
+        }
+        mpc_decoder_update_buffer(d, RING);
+
+        if (valid_samples > 0) {
+            return valid_samples;
+        }
+    }
+}
+
+void
+mpc_decoder_requantisierung(mpc_decoder *d, const mpc_int32_t Last_Band) 
+{
+    mpc_int32_t     Band;
+    mpc_int32_t     n;
+    MPC_SAMPLE_FORMAT facL;
+    MPC_SAMPLE_FORMAT facR;
+    MPC_SAMPLE_FORMAT templ;
+    MPC_SAMPLE_FORMAT tempr;
+    MPC_SAMPLE_FORMAT* YL;
+    MPC_SAMPLE_FORMAT* YR;
+    mpc_int32_t*    L;
+    mpc_int32_t*    R;
+
+#ifdef MPC_FIXED_POINT
+#if MPC_FIXED_POINT_FRACTPART == 14
+#define MPC_MULTIPLY_SCF(CcVal, SCF_idx) \
+    MPC_MULTIPLY_EX(CcVal, d->SCF[SCF_idx], d->SCF_shift[SCF_idx])
+#else
+
+#error FIXME, Cc table is in 18.14 format
+
+#endif
+#else
+#define MPC_MULTIPLY_SCF(CcVal, SCF_idx) \
+    MPC_MULTIPLY(CcVal, d->SCF[SCF_idx])
+#endif
+    // requantization and scaling of subband-samples
+    for ( Band = 0; Band <= Last_Band; Band++ ) {   // setting pointers
+        YL = d->Y_L[0] + Band;
+        YR = d->Y_R[0] + Band;
+        L  = d->Q[Band].L;
+        R  = d->Q[Band].R;
+        /************************** MS-coded **************************/
+        if ( d->MS_Flag [Band] ) {
+            if ( d->Res_L [Band] ) {
+                if ( d->Res_R [Band] ) {    // M!=0, S!=0
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YL   = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++));
+                        *YR   = templ - tempr;
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YL   = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++));
+                        *YR   = templ - tempr;
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YL   = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++));
+                        *YR   = templ - tempr;
+                    }
+                } else {    // M!=0, S==0
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                    }
+                }
+            } else {
+                if (d->Res_R[Band])    // M==0, S!=0
+                {
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YR = - (*YL = MPC_MULTIPLY_FLOAT_INT(facR,*(R++)));
+                    }
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YR = - (*YL = MPC_MULTIPLY_FLOAT_INT(facR,*(R++)));
+                    }
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YR = - (*YL = MPC_MULTIPLY_FLOAT_INT(facR,*(R++)));
+                    }
+                } else {    // M==0, S==0
+                    for ( n = 0; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = 0;
+                    }
+                }
+            }
+        }
+        /************************** LR-coded **************************/
+        else {
+            if ( d->Res_L [Band] ) {
+                if ( d->Res_R [Band] ) {    // L!=0, R!=0
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
+                    for (n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
+                    for (; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
+                    for (; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                } else {     // L!=0, R==0
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = 0;
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = 0;
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = 0;
+                    }
+                }
+            }
+            else {
+                if ( d->Res_R [Band] ) {    // L==0, R!=0
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YL = 0;
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YL = 0;
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YL = 0;
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                } else {    // L==0, R==0
+                    for ( n = 0; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = 0;
+                    }
+                }
+            }
+        }
+    }
+}
+
+/****************************************** SV 6 ******************************************/
+void
+mpc_decoder_read_bitstream_sv6(mpc_decoder *d) 
+{
+    mpc_int32_t n,k;
+    mpc_int32_t Max_used_Band=0;
+    HuffmanTyp *Table;
+    const HuffmanTyp *x1;
+    const HuffmanTyp *x2;
+    mpc_int32_t *L;
+    mpc_int32_t *R;
+    mpc_int32_t *ResL = d->Res_L;
+    mpc_int32_t *ResR = d->Res_R;
+
+    /************************ HEADER **************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    for (n=0; n <= d->Max_Band; ++n, ++ResL, ++ResR)
+    {
+        if      (n<11)           Table = d->Region_A;
+        else if (n>=11 && n<=22) Table = d->Region_B;
+        else /*if (n>=23)*/      Table = d->Region_C;
+
+        *ResL = d->Q_res[n][mpc_decoder_huffman_decode(d, Table)];
+        if (d->MS_used) {
+            d->MS_Flag[n] = mpc_decoder_bitstream_read(d,  1);
+        }
+        *ResR = d->Q_res[n][mpc_decoder_huffman_decode(d, Table)];
+
+        // only perform the following procedure up to the maximum non-zero subband
+        if (*ResL || *ResR) Max_used_Band = n;
+    }
+
+    /************************* SCFI-Bundle *****************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    for (n=0; n<=Max_used_Band; ++n, ++ResL, ++ResR) {
+        if (*ResL) mpc_decoder_scfi_bundle_read(d, d->SCFI_Bundle, &(d->SCFI_L[n]), &(d->DSCF_Flag_L[n]));
+        if (*ResR) mpc_decoder_scfi_bundle_read(d, d->SCFI_Bundle, &(d->SCFI_R[n]), &(d->DSCF_Flag_R[n]));
+    }
+
+    /***************************** SCFI ********************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    L    = d->SCF_Index_L[0];
+    R    = d->SCF_Index_R[0];
+    for (n=0; n <= Max_used_Band; ++n, ++ResL, ++ResR, L+=3, R+=3)
+    {
+        if (*ResL)
+        {
+            /*********** DSCF ************/
+            if (d->DSCF_Flag_L[n]==1)
+            {
+                L[2] = d->DSCF_Reference_L[n];
+                switch (d->SCFI_L[n])
+                {
+                case 3:
+                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[1] = L[0];
+                    L[2] = L[1];
+                    break;
+                case 1:
+                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[1] = L[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[2] = L[1];
+                    break;
+                case 2:
+                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[1] = L[0];
+                    L[2] = L[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    break;
+                case 0:
+                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[1] = L[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[2] = L[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    break;
+                default:
+                    return;
+                    break;
+                }
+            }
+            /************ SCF ************/
+            else
+            {
+                switch (d->SCFI_L[n])
+                {
+                case 3:
+                    L[0] = mpc_decoder_bitstream_read(d,  6);
+                    L[1] = L[0];
+                    L[2] = L[1];
+                    break;
+                case 1:
+                    L[0] = mpc_decoder_bitstream_read(d,  6);
+                    L[1] = mpc_decoder_bitstream_read(d,  6);
+                    L[2] = L[1];
+                    break;
+                case 2:
+                    L[0] = mpc_decoder_bitstream_read(d,  6);
+                    L[1] = L[0];
+                    L[2] = mpc_decoder_bitstream_read(d,  6);
+                    break;
+                case 0:
+                    L[0] = mpc_decoder_bitstream_read(d,  6);
+                    L[1] = mpc_decoder_bitstream_read(d,  6);
+                    L[2] = mpc_decoder_bitstream_read(d,  6);
+                    break;
+                default:
+                    return;
+                    break;
+                }
+            }
+            // update Reference for DSCF
+            d->DSCF_Reference_L[n] = L[2];
+        }
+        if (*ResR)
+        {
+            R[2] = d->DSCF_Reference_R[n];
+            /*********** DSCF ************/
+            if (d->DSCF_Flag_R[n]==1)
+            {
+                switch (d->SCFI_R[n])
+                {
+                case 3:
+                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[1] = R[0];
+                    R[2] = R[1];
+                    break;
+                case 1:
+                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[1] = R[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[2] = R[1];
+                    break;
+                case 2:
+                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[1] = R[0];
+                    R[2] = R[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    break;
+                case 0:
+                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[1] = R[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[2] = R[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    break;
+                default:
+                    return;
+                    break;
+                }
+            }
+            /************ SCF ************/
+            else
+            {
+                switch (d->SCFI_R[n])
+                {
+                case 3:
+                    R[0] = mpc_decoder_bitstream_read(d, 6);
+                    R[1] = R[0];
+                    R[2] = R[1];
+                    break;
+                case 1:
+                    R[0] = mpc_decoder_bitstream_read(d, 6);
+                    R[1] = mpc_decoder_bitstream_read(d, 6);
+                    R[2] = R[1];
+                    break;
+                case 2:
+                    R[0] = mpc_decoder_bitstream_read(d, 6);
+                    R[1] = R[0];
+                    R[2] = mpc_decoder_bitstream_read(d, 6);
+                    break;
+                case 0:
+                    R[0] = mpc_decoder_bitstream_read(d, 6);
+                    R[1] = mpc_decoder_bitstream_read(d, 6);
+                    R[2] = mpc_decoder_bitstream_read(d, 6);
+                    break;
+                default:
+                    return;
+                    break;
+                }
+            }
+            // update Reference for DSCF
+            d->DSCF_Reference_R[n] = R[2];
+        }
+    }
+
+    /**************************** Samples ****************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    for (n=0; n <= Max_used_Band; ++n, ++ResL, ++ResR)
+    {
+        // setting pointers
+        x1 = d->SampleHuff[*ResL];
+        x2 = d->SampleHuff[*ResR];
+        L = d->Q[n].L;
+        R = d->Q[n].R;
+
+        if (x1!=NULL || x2!=NULL)
+            for (k=0; k<36; ++k)
+            {
+                if (x1 != NULL) *L++ = mpc_decoder_huffman_decode_fast(d,  x1);
+                if (x2 != NULL) *R++ = mpc_decoder_huffman_decode_fast(d,  x2);
+            }
+
+        if (*ResL>7 || *ResR>7)
+            for (k=0; k<36; ++k)
+            {
+                if (*ResL>7) *L++ = (mpc_int32_t)mpc_decoder_bitstream_read(d,  Res_bit[*ResL]) - Dc[*ResL];
+                if (*ResR>7) *R++ = (mpc_int32_t)mpc_decoder_bitstream_read(d,  Res_bit[*ResR]) - Dc[*ResR];
+            }
+    }
+}
+
+/****************************************** SV 7 ******************************************/
+void
+mpc_decoder_read_bitstream_sv7(mpc_decoder *d) 
+{
+    // these arrays hold decoding results for bundled quantizers (3- and 5-step)
+    /*static*/ mpc_int32_t idx30[] = { -1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1};
+    /*static*/ mpc_int32_t idx31[] = { -1,-1,-1, 0, 0, 0, 1, 1, 1,-1,-1,-1, 0, 0, 0, 1, 1, 1,-1,-1,-1, 0, 0, 0, 1, 1, 1};
+    /*static*/ mpc_int32_t idx32[] = { -1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1};
+    /*static*/ mpc_int32_t idx50[] = { -2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2};
+    /*static*/ mpc_int32_t idx51[] = { -2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2};
+
+    mpc_int32_t n,k;
+    mpc_int32_t Max_used_Band=0;
+    const HuffmanTyp *Table;
+    mpc_int32_t idx;
+    mpc_int32_t *L   ,*R;
+    mpc_int32_t *ResL,*ResR;
+    mpc_uint32_t tmp;
+
+    /***************************** Header *****************************/
+    ResL  = d->Res_L;
+    ResR  = d->Res_R;
+
+    // first subband
+    *ResL = mpc_decoder_bitstream_read(d, 4);
+    *ResR = mpc_decoder_bitstream_read(d, 4);
+    if (d->MS_used && !(*ResL==0 && *ResR==0)) {
+        d->MS_Flag[0] = mpc_decoder_bitstream_read(d, 1);
+    }
+
+    // consecutive subbands
+    ++ResL; ++ResR; // increase pointers
+    for (n=1; n <= d->Max_Band; ++n, ++ResL, ++ResR)
+    {
+        idx   = mpc_decoder_huffman_decode_fast(d, d->HuffHdr);
+        *ResL = (idx!=4) ? *(ResL-1) + idx : (int) mpc_decoder_bitstream_read(d, 4);
+
+        idx   = mpc_decoder_huffman_decode_fast(d, d->HuffHdr);
+        *ResR = (idx!=4) ? *(ResR-1) + idx : (int) mpc_decoder_bitstream_read(d, 4);
+
+        if (d->MS_used && !(*ResL==0 && *ResR==0)) {
+            d->MS_Flag[n] = mpc_decoder_bitstream_read(d, 1);
+        }
+
+        // only perform following procedures up to the maximum non-zero subband
+        if (*ResL!=0 || *ResR!=0) {
+            Max_used_Band = n;
+        }
+    }
+    /****************************** SCFI ******************************/
+    L     = d->SCFI_L;
+    R     = d->SCFI_R;
+    ResL  = d->Res_L;
+    ResR  = d->Res_R;
+    for (n=0; n <= Max_used_Band; ++n, ++L, ++R, ++ResL, ++ResR) {
+        if (*ResL) *L = mpc_decoder_huffman_decode_faster(d, d->HuffSCFI);
+        if (*ResR) *R = mpc_decoder_huffman_decode_faster(d, d->HuffSCFI);
+    }
+
+    /**************************** SCF/DSCF ****************************/
+    ResL  = d->Res_L;
+    ResR  = d->Res_R;
+    L     = d->SCF_Index_L[0];
+    R     = d->SCF_Index_R[0];
+    for (n=0; n<=Max_used_Band; ++n, ++ResL, ++ResR, L+=3, R+=3) {
+        if (*ResL)
+        {
+            L[2] = d->DSCF_Reference_L[n];
+            switch (d->SCFI_L[n])
+            {
+            case 1:
+                idx  = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
+                L[0] = (idx!=8) ? L[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
+                L[1] = (idx!=8) ? L[0] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                L[2] = L[1];
+                break;
+            case 3:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[0] = (idx!=8) ? L[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                L[1] = L[0];
+                L[2] = L[1];
+                break;
+            case 2:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[0] = (idx!=8) ? L[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                L[1] = L[0];
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[2] = (idx!=8) ? L[1] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                break;
+            case 0:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[0] = (idx!=8) ? L[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[1] = (idx!=8) ? L[0] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[2] = (idx!=8) ? L[1] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                break;
+            default:
+                return;
+                break;
+            }
+            // update Reference for DSCF
+            d->DSCF_Reference_L[n] = L[2];
+        }
+        if (*ResR)
+        {
+            R[2] = d->DSCF_Reference_R[n];
+            switch (d->SCFI_R[n])
+            {
+            case 1:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[0] = (idx!=8) ? R[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[1] = (idx!=8) ? R[0] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                R[2] = R[1];
+                break;
+            case 3:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[0] = (idx!=8) ? R[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                R[1] = R[0];
+                R[2] = R[1];
+                break;
+            case 2:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[0] = (idx!=8) ? R[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                R[1] = R[0];
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[2] = (idx!=8) ? R[1] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                break;
+            case 0:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[0] = (idx!=8) ? R[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[1] = (idx!=8) ? R[0] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[2] = (idx!=8) ? R[1] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+                break;
+            default:
+                return;
+                break;
+            }
+            // update Reference for DSCF
+            d->DSCF_Reference_R[n] = R[2];
+        }
+    }
+    /***************************** Samples ****************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    L    = d->Q[0].L;
+    R    = d->Q[0].R;
+    for (n=0; n <= Max_used_Band; ++n, ++ResL, ++ResR, L+=36, R+=36)
+    {
+        /************** links **************/
+        switch (*ResL)
+        {
+        case  -2: case  -3: case  -4: case  -5: case  -6: case  -7: case  -8: case  -9:
+        case -10: case -11: case -12: case -13: case -14: case -15: case -16: case -17:
+            L += 36;
+            break;
+        case -1:
+            for (k=0; k<36; k++ ) {
+                tmp  = mpc_random_int(d);
+                *L++ = ((tmp >> 24) & 0xFF) + ((tmp >> 16) & 0xFF) + ((tmp >>  8) & 0xFF) + ((tmp >>  0) & 0xFF) - 510;
+            }
+            break;
+        case 0:
+            L += 36;// increase pointer
+            break;
+        case 1:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][1];
+            for (k=0; k<12; ++k)
+            {
+                idx = mpc_decoder_huffman_decode_fast(d,  Table);
+                *L++ = idx30[idx];
+                *L++ = idx31[idx];
+                *L++ = idx32[idx];
+            }
+            break;
+        case 2:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][2];
+            for (k=0; k<18; ++k)
+            {
+                idx = mpc_decoder_huffman_decode_fast(d,  Table);
+                *L++ = idx50[idx];
+                *L++ = idx51[idx];
+            }
+            break;
+        case 3:
+        case 4:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
+            for (k=0; k<36; ++k)
+                *L++ = mpc_decoder_huffman_decode_faster(d, Table);
+            break;
+        case 5:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
+            for (k=0; k<36; ++k)
+                *L++ = mpc_decoder_huffman_decode_fast(d, Table);
+            break;
+        case 6:
+        case 7:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
+            for (k=0; k<36; ++k)
+                *L++ = mpc_decoder_huffman_decode(d, Table);
+            break;
+        case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17:
+            tmp = Dc[*ResL];
+            for (k=0; k<36; ++k)
+                *L++ = (mpc_int32_t)mpc_decoder_bitstream_read(d, Res_bit[*ResL]) - tmp;
+            break;
+        default:
+            return;
+        }
+        /************** rechts **************/
+        switch (*ResR)
+        {
+        case  -2: case  -3: case  -4: case  -5: case  -6: case  -7: case  -8: case  -9:
+        case -10: case -11: case -12: case -13: case -14: case -15: case -16: case -17:
+            R += 36;
+            break;
+        case -1:
+                for (k=0; k<36; k++ ) {
+                    tmp  = mpc_random_int(d);
+                    *R++ = ((tmp >> 24) & 0xFF) + ((tmp >> 16) & 0xFF) + ((tmp >>  8) & 0xFF) + ((tmp >>  0) & 0xFF) - 510;
+                }
+                break;
+            case 0:
+                R += 36;// increase pointer
+                break;
+            case 1:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][1];
+                for (k=0; k<12; ++k)
+                {
+                    idx = mpc_decoder_huffman_decode_fast(d, Table);
+                    *R++ = idx30[idx];
+                    *R++ = idx31[idx];
+                    *R++ = idx32[idx];
+                }
+                break;
+            case 2:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][2];
+                for (k=0; k<18; ++k)
+                {
+                    idx = mpc_decoder_huffman_decode_fast(d, Table);
+                    *R++ = idx50[idx];
+                    *R++ = idx51[idx];
+                }
+                break;
+            case 3:
+            case 4:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
+                for (k=0; k<36; ++k)
+                    *R++ = mpc_decoder_huffman_decode_faster(d, Table);
+                break;
+            case 5:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
+                for (k=0; k<36; ++k)
+                    *R++ = mpc_decoder_huffman_decode_fast(d, Table);
+                break;
+            case 6:
+            case 7:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
+                for (k=0; k<36; ++k)
+                    *R++ = mpc_decoder_huffman_decode(d, Table);
+                break;
+            case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17:
+                tmp = Dc[*ResR];
+                for (k=0; k<36; ++k)
+                    *R++ = (mpc_int32_t)mpc_decoder_bitstream_read(d, Res_bit[*ResR]) - tmp;
+                break;
+            default:
+                return;
+        }
+    }
+}
+
+void mpc_decoder_setup(mpc_decoder *d, mpc_reader *r)
+{
+  d->r = r;
+
+  d->HuffQ[0][0] = 0;
+  d->HuffQ[1][0] = 0;
+  d->HuffQ[0][1] = d->HuffQ1[0];
+  d->HuffQ[1][1] = d->HuffQ1[1];
+  d->HuffQ[0][2] = d->HuffQ2[0];
+  d->HuffQ[1][2] = d->HuffQ2[1];
+  d->HuffQ[0][3] = d->HuffQ3[0];
+  d->HuffQ[1][3] = d->HuffQ3[1];
+  d->HuffQ[0][4] = d->HuffQ4[0];
+  d->HuffQ[1][4] = d->HuffQ4[1];
+  d->HuffQ[0][5] = d->HuffQ5[0];
+  d->HuffQ[1][5] = d->HuffQ5[1];
+  d->HuffQ[0][6] = d->HuffQ6[0];
+  d->HuffQ[1][6] = d->HuffQ6[1];
+  d->HuffQ[0][7] = d->HuffQ7[0];
+  d->HuffQ[1][7] = d->HuffQ7[1];
+
+  d->SampleHuff[0] = NULL;
+  d->SampleHuff[1] = d->Entropie_1;
+  d->SampleHuff[2] = d->Entropie_2;
+  d->SampleHuff[3] = d->Entropie_3;
+  d->SampleHuff[4] = d->Entropie_4;
+  d->SampleHuff[5] = d->Entropie_5;
+  d->SampleHuff[6] = d->Entropie_6;
+  d->SampleHuff[7] = d->Entropie_7;
+  d->SampleHuff[8] = NULL;
+  d->SampleHuff[9] = NULL;
+  d->SampleHuff[10] = NULL;
+  d->SampleHuff[11] = NULL;
+  d->SampleHuff[12] = NULL;
+  d->SampleHuff[13] = NULL;
+  d->SampleHuff[14] = NULL;
+  d->SampleHuff[15] = NULL;
+  d->SampleHuff[16] = NULL;
+  d->SampleHuff[17] = NULL;
+
+  d->EQ_activated = 0;
+  d->MPCHeaderPos = 0;
+  d->StreamVersion = 0;
+  d->MS_used = 0;
+  d->FwdJumpInfo = 0;
+  d->ActDecodePos = 0;
+  d->FrameWasValid = 0;
+  d->OverallFrames = 0;
+  d->DecodedFrames = 0;
+  d->LastValidSamples = 0;
+  d->TrueGaplessPresent = 0;
+  d->WordsRead = 0;
+  d->Max_Band = 0;
+  d->SampleRate = 0;
+//  clips = 0;
+  d->__r1 = 1;
+  d->__r2 = 1;
+
+  d->dword = 0;
+  d->pos = 0;
+  d->Zaehler = 0;
+  d->WordsRead = 0;
+  d->Max_Band = 0;
+
+  mpc_decoder_initialisiere_quantisierungstabellen(d, 1.0f);
+  mpc_decoder_init_huffman_sv6(d);
+  mpc_decoder_init_huffman_sv7(d);
+}
+
+void mpc_decoder_set_streaminfo(mpc_decoder *d, mpc_streaminfo *si)
+{
+    mpc_decoder_reset_synthesis(d);
+    mpc_decoder_reset_globals(d);
+
+    d->StreamVersion      = si->stream_version;
+    d->MS_used            = si->ms;
+    d->Max_Band           = si->max_band;
+    d->OverallFrames      = si->frames;
+    d->MPCHeaderPos       = si->header_position;
+    d->LastValidSamples   = si->last_frame_samples;
+    d->TrueGaplessPresent = si->is_true_gapless;
+    d->SampleRate         = (mpc_int32_t)si->sample_freq;
+
+    d->samples_to_skip = MPC_DECODER_SYNTH_DELAY;
+}
+
+mpc_bool_t mpc_decoder_initialize(mpc_decoder *d, mpc_streaminfo *si) 
+{
+    mpc_decoder_set_streaminfo(d, si);
+
+    // AB: setting position to the beginning of the data-bitstream
+    switch (d->StreamVersion) {
+    case 0x04: f_seek(d, 4 + d->MPCHeaderPos); d->pos = 16; break;  // Geht auch über eine der Helperfunktionen
+    case 0x05:
+    case 0x06: f_seek(d, 8 + d->MPCHeaderPos); d->pos =  0; break;
+    case 0x07:
+    case 0x17: /*f_seek ( 24 + d->MPCHeaderPos );*/ d->pos =  8; break;
+    default: return FALSE;
+    }
+
+    // AB: fill buffer and initialize decoder
+    f_read_dword(d, d->Speicher, MEMSIZE );
+    d->dword = d->Speicher[d->Zaehler = 0];
+
+    return TRUE;
+}
+
+//---------------------------------------------------------------
+// will seek from the beginning of the file to the desired
+// position in ms (given by seek_needed)
+//---------------------------------------------------------------
+#if 0
+static void
+helper1(mpc_decoder *d, mpc_uint32_t bitpos) 
+{
+    f_seek(d, (bitpos >> 5) * 4 + d->MPCHeaderPos);
+    f_read_dword(d, d->Speicher, 2);
+    d->dword = d->Speicher[d->Zaehler = 0];
+    d->pos = bitpos & 31;
+}
+#endif
+
+static void
+helper2(mpc_decoder *d, mpc_uint32_t bitpos) 
+{
+    f_seek(d, (bitpos>>5) * 4 + d->MPCHeaderPos);
+    f_read_dword(d, d->Speicher, MEMSIZE);
+    d->dword = d->Speicher[d->Zaehler = 0];
+    d->pos = bitpos & 31;
+}
+
+#if 0
+static void
+helper3(mpc_decoder *d, mpc_uint32_t bitpos, mpc_uint32_t* buffoffs) 
+{
+    d->pos = bitpos & 31;
+    bitpos >>= 5;
+    if ((mpc_uint32_t)(bitpos - *buffoffs) >= MEMSIZE - 2) {
+        *buffoffs = bitpos;
+        f_seek(d, bitpos * 4L + d->MPCHeaderPos);
+        f_read_dword(d, d->Speicher, MEMSIZE );
+    }
+    d->dword = d->Speicher[d->Zaehler = bitpos - *buffoffs ];
+}
+#endif
+
+static mpc_uint32_t get_initial_fpos(mpc_decoder *d, mpc_uint32_t StreamVersion)
+{
+    mpc_uint32_t fpos = 0;
+    (void) StreamVersion;
+    switch ( d->StreamVersion ) {                                                  // setting position to the beginning of the data-bitstream
+    case  0x04: fpos =  48; break;
+    case  0x05:
+    case  0x06: fpos =  64; break;
+    case  0x07:
+    case  0x17: fpos = 200; break;
+    }
+    return fpos;
+}
+
+mpc_bool_t mpc_decoder_seek_seconds(mpc_decoder *d, double seconds) 
+{
+    return mpc_decoder_seek_sample(d, (mpc_int64_t)(seconds * (double)d->SampleRate + 0.5));
+}
+
+mpc_bool_t mpc_decoder_seek_sample(mpc_decoder *d, mpc_int64_t destsample) 
+{
+    mpc_uint32_t fpos;
+    mpc_uint32_t fwd;
+
+    fwd = (mpc_uint32_t) (destsample / MPC_FRAME_LENGTH);
+    d->samples_to_skip = MPC_DECODER_SYNTH_DELAY + (mpc_uint32_t)(destsample % MPC_FRAME_LENGTH);
+
+    memset(d->Y_L          , 0, sizeof d->Y_L           );
+    memset(d->Y_R          , 0, sizeof d->Y_R           );
+    memset(d->SCF_Index_L     , 0, sizeof d->SCF_Index_L      );
+    memset(d->SCF_Index_R     , 0, sizeof d->SCF_Index_R      );
+    memset(d->Res_L           , 0, sizeof d->Res_L            );
+    memset(d->Res_R           , 0, sizeof d->Res_R            );
+    memset(d->SCFI_L          , 0, sizeof d->SCFI_L           );
+    memset(d->SCFI_R          , 0, sizeof d->SCFI_R           );
+    memset(d->DSCF_Flag_L     , 0, sizeof d->DSCF_Flag_L      );
+    memset(d->DSCF_Flag_R     , 0, sizeof d->DSCF_Flag_R      );
+    memset(d->DSCF_Reference_L, 0, sizeof d->DSCF_Reference_L );
+    memset(d->DSCF_Reference_R, 0, sizeof d->DSCF_Reference_R );
+    memset(d->Q               , 0, sizeof d->Q                );
+    memset(d->MS_Flag         , 0, sizeof d->MS_Flag          );
+
+    // resetting synthesis filter to avoid "clicks"
+    mpc_decoder_reset_synthesis(d);
+
+    // prevent from desired position out of allowed range
+    fwd = fwd < d->OverallFrames  ?  fwd  :  d->OverallFrames;
+
+    // reset number of decoded frames
+    d->DecodedFrames = 0;
+
+    fpos = get_initial_fpos(d, d->StreamVersion);
+    if (fpos == 0) {
+        return FALSE;
+    }
+
+    helper2(d, fpos);
+
+    // read the last 32 frames before the desired position to scan the scalefactors (artifactless jumping)
+    for ( ; d->DecodedFrames < fwd; d->DecodedFrames++ ) {
+        mpc_uint32_t   FrameBitCnt;
+        mpc_uint32_t   RING;
+        RING         = d->Zaehler;
+        d->FwdJumpInfo  = mpc_decoder_bitstream_read(d, 20);    // read jump-info
+        d->ActDecodePos = (d->Zaehler << 5) + d->pos;
+        FrameBitCnt  = mpc_decoder_bits_read(d);  // scanning the scalefactors and check for validity of frame
+        if (d->StreamVersion >= 7)  {
+            mpc_decoder_read_bitstream_sv7(d);
+        }
+        else {
+            mpc_decoder_read_bitstream_sv6(d);
+        }
+        if (mpc_decoder_bits_read(d) - FrameBitCnt != d->FwdJumpInfo ) {
+            // Box ("Bug in perform_jump");
+            return FALSE;
+        }
+        // update buffer
+        if ((RING ^ d->Zaehler) & MEMSIZE2) {
+            f_read_dword(d, d->Speicher + (RING & MEMSIZE2),  MEMSIZE2);
+        }
+    }
+
+    // LastBitsRead = BitsRead ();
+    // LastFrame = d->DecodedFrames;
+
+    return TRUE;
+}
+
+void mpc_decoder_update_buffer(mpc_decoder *d, mpc_uint32_t RING) 
+{
+    if ((RING ^ d->Zaehler) & MEMSIZE2 ) {
+        // update buffer
+        f_read_dword(d, d->Speicher + (RING & MEMSIZE2), MEMSIZE2);
+    }
+}
+
+
Index: /libmpcdec/tags/release-1.2.2/src/mpc_reader.c
===================================================================
--- /libmpcdec/tags/release-1.2.2/src/mpc_reader.c	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/src/mpc_reader.c	(revision 30)
@@ -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.
+*/
+
+/// \file mpc_reader.c
+/// Contains implementations for simple file-based mpc_reader
+
+#include <mpcdec/mpcdec.h>
+
+/// mpc_reader callback implementations
+static mpc_int32_t
+read_impl(void *data, void *ptr, mpc_int32_t size)
+{
+    mpc_reader_file *d = (mpc_reader_file *) data;
+
+    return fread(ptr, 1, size, d->file);
+}
+
+static mpc_bool_t
+seek_impl(void *data, mpc_int32_t offset)
+{
+    mpc_reader_file *d = (mpc_reader_file *) data;
+
+    return d->is_seekable ? !fseek(d->file, offset, SEEK_SET) : FALSE;
+}
+
+static mpc_int32_t
+tell_impl(void *data)
+{
+    mpc_reader_file *d = (mpc_reader_file *) data;
+
+    return ftell(d->file);
+}
+
+static mpc_int32_t
+get_size_impl(void *data)
+{
+    mpc_reader_file *d = (mpc_reader_file *) data;
+
+    return d->file_size;
+}
+
+static mpc_bool_t
+canseek_impl(void *data)
+{
+    mpc_reader_file *d = (mpc_reader_file *) data;
+
+    return d->is_seekable;
+}
+
+void
+mpc_reader_setup_file_reader(mpc_reader_file *p_reader, FILE *input)
+{
+    p_reader->reader.seek = seek_impl;
+    p_reader->reader.read = read_impl;
+    p_reader->reader.tell = tell_impl;
+    p_reader->reader.get_size = get_size_impl;
+    p_reader->reader.canseek = canseek_impl;
+    p_reader->reader.data = p_reader; // point back to ourselves
+
+    p_reader->file = input;
+    p_reader->is_seekable = TRUE;
+    fseek(input, 0, SEEK_END);
+    p_reader->file_size = ftell(input);
+    fseek(input, 0, SEEK_SET);
+}
Index: /libmpcdec/tags/release-1.2.2/src/requant.c
===================================================================
--- /libmpcdec/tags/release-1.2.2/src/requant.c	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/src/requant.c	(revision 30)
@@ -0,0 +1,152 @@
+/*
+  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.c
+/// Requantization function implementations.
+/// \todo document me
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/internal.h>
+
+/* C O N S T A N T S */
+// bits per sample for chosen quantizer
+const mpc_uint32_t  Res_bit [18] = {
+    0,  0,  0,  0,  0,  0,  0,  0,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16
+};
+
+// coefficients for requantization
+// 65536/step bzw. 65536/(2*D+1)
+
+#define _(X) MAKE_MPC_SAMPLE_EX(X,14)
+
+const MPC_SAMPLE_FORMAT  __Cc [1 + 18] = {
+      _(111.285962475327f),                                        // 32768/2/255*sqrt(3)
+    _(65536.000000000000f), _(21845.333333333332f), _(13107.200000000001f), _(9362.285714285713f),
+    _(7281.777777777777f),  _(4369.066666666666f),  _(2114.064516129032f), _(1040.253968253968f),
+     _(516.031496062992f),  _(257.003921568627f),   _(128.250489236790f),   _(64.062561094819f),
+       _(32.015632633121f),    _(16.003907203907f),     _(8.000976681723f),    _(4.000244155527f),
+        _(2.000061037018f),     _(1.000015259021f)
+};
+
+#undef _
+
+// offset for requantization
+// 2*D+1 = steps of quantizer
+const mpc_int32_t  __Dc [1 + 18] = {
+      2,
+      0,     1,     2,     3,     4,     7,    15,    31,    63,
+    127,   255,   511,  1023,  2047,  4095,  8191, 16383, 32767
+};
+
+#ifdef MPC_FIXED_POINT
+static mpc_uint32_t find_shift(double fval)
+{
+	mpc_int64_t val = (mpc_int64_t)fval;
+	if (val<0) val = -val;
+	mpc_uint32_t ptr = 0;
+	while(val) {val>>=1;ptr++;}
+
+	return ptr > 31 ? 0 : 31 - ptr;
+}
+#endif
+
+/* F U N C T I O N S */
+
+#define SET_SCF(N,X) d->SCF[N] = MAKE_MPC_SAMPLE_EX(X,d->SCF_shift[N] = (unsigned char)find_shift(X));
+
+void
+mpc_decoder_scale_output(mpc_decoder *d, double factor) 
+{
+    mpc_int32_t     n;
+    double  f1;
+    double  f2;
+#ifndef MPC_FIXED_POINT
+	factor *= 1.0 / (double)(1<<(MPC_FIXED_POINT_SHIFT-1));
+#else
+	factor *= 1.0 / (double)(1<<(16 - MPC_FIXED_POINT_SHIFT));
+#endif
+    f1 = f2 = factor;
+
+    // handles +1.58...-98.41 dB, where's scf[n] / scf[n-1] = 1.20050805774840750476
+	
+	SET_SCF(1,factor);
+
+	f1 *=   0.83298066476582673961;
+	f2 *= 1/0.83298066476582673961;
+
+    for ( n = 1; n <= 128; n++ ) {
+		SET_SCF((unsigned char)(1+n),f1);
+		SET_SCF((unsigned char)(1-n),f2);
+        f1 *=   0.83298066476582673961;
+        f2 *= 1/0.83298066476582673961;
+    }
+}
+
+static void
+mpc_decoder_quantisierungsmodes(mpc_decoder *d) // conversion: index -> quantizer (bitstream reading)
+{                                               // conversion: quantizer -> index (bitstream writing)
+    mpc_int32_t  Band = 0;
+    mpc_int32_t  i;
+
+    do {
+        d->Q_bit [Band] = 4;
+        for ( i = 0; i < 16-1; i++ )
+            d->Q_res [Band] [i] = i;
+        d->Q_res [Band][i] = 17;
+        Band++;
+    } while ( Band < 11 );
+
+    do {
+        d->Q_bit [Band] = 3;
+        for ( i = 0; i < 8-1; i++ )
+            d->Q_res [Band] [i] = i;
+        d->Q_res [Band] [i] = 17;
+        Band++;
+    } while ( Band < 23 );
+
+    do {
+        d->Q_bit [Band] = 2;
+        for ( i = 0; i < 4-1; i++ )
+            d->Q_res [Band] [i] = i;
+        d->Q_res [Band] [i] = 17;
+        Band++;
+    } while ( Band < 32 );
+}
+
+void
+mpc_decoder_initialisiere_quantisierungstabellen(mpc_decoder *d, double scale_factor) 
+{
+    mpc_decoder_quantisierungsmodes(d);
+    mpc_decoder_scale_output(d, scale_factor);
+}
Index: /libmpcdec/tags/release-1.2.2/src/sample.cpp
===================================================================
--- /libmpcdec/tags/release-1.2.2/src/sample.cpp	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/src/sample.cpp	(revision 30)
@@ -0,0 +1,328 @@
+/*
+  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.
+*/
+
+#include <stdio.h>
+#include <assert.h>
+#include <time.h>
+
+#include <mpcdec/mpcdec.h>
+
+/*
+  The data bundle we pass around with our reader to store file
+  position and size etc. 
+*/
+typedef struct reader_data_t {
+    FILE *file;
+    long size;
+    mpc_bool_t seekable;
+} reader_data;
+
+/*
+  Our implementations of the mpc_reader callback functions.
+*/
+mpc_int32_t
+read_impl(void *data, void *ptr, mpc_int32_t size)
+{
+    reader_data *d = (reader_data *) data;
+    return fread(ptr, 1, size, d->file);
+}
+
+mpc_bool_t
+seek_impl(void *data, mpc_int32_t offset)
+{
+    reader_data *d = (reader_data *) data;
+    return d->seekable ? !fseek(d->file, offset, SEEK_SET) : false;
+}
+
+mpc_int32_t
+tell_impl(void *data)
+{
+    reader_data *d = (reader_data *) data;
+    return ftell(d->file);
+}
+
+mpc_int32_t
+get_size_impl(void *data)
+{
+    reader_data *d = (reader_data *) data;
+    return d->size;
+}
+
+mpc_bool_t
+canseek_impl(void *data)
+{
+    reader_data *d = (reader_data *) data;
+    return d->seekable;
+}
+
+#define WFX_SIZE (2+2+4+4+2+2)
+
+#ifdef MPC_FIXED_POINT
+static int
+shift_signed(MPC_SAMPLE_FORMAT val, int shift)
+{
+    if (shift > 0)
+        val <<= shift;
+    else if (shift < 0)
+        val >>= -shift;
+    return (int)val;
+}
+#endif
+
+class WavWriter {
+  public:
+    WavWriter(FILE * p_output, unsigned p_nch, unsigned p_bps,
+              unsigned p_srate)
+    : m_file(p_output), m_nch(p_nch), m_bps(p_bps), m_srate(p_srate) {
+        assert(m_bps == 16 || m_bps == 24);
+
+        WriteRaw("RIFF", 4);
+        WriteDword(0);          //fix this in destructor
+
+        WriteRaw("WAVE", 4);
+        WriteRaw("fmt ", 4);
+        WriteDword(WFX_SIZE);
+
+        WriteWord(1);           //WAVE_FORMAT_PCM
+        WriteWord(m_nch);
+        WriteDword(m_srate);
+        WriteDword(m_srate * m_nch * (m_bps >> 3));
+        WriteWord(m_nch * (m_bps >> 3));
+        WriteWord(m_bps);
+        /*
+           WORD  wFormatTag; 
+           WORD  nChannels; 
+           DWORD nSamplesPerSec; 
+           DWORD nAvgBytesPerSec; 
+           WORD  nBlockAlign; 
+           WORD  wBitsPerSample; 
+         */
+        WriteRaw("data", 4);
+        WriteDword(0);          //fix this in destructor
+
+        m_data_bytes_written = 0;
+    } mpc_bool_t WriteSamples(const MPC_SAMPLE_FORMAT * p_buffer, unsigned p_size) {
+        unsigned n;
+        int clip_min = -1 << (m_bps - 1),
+            clip_max = (1 << (m_bps - 1)) - 1, float_scale = 1 << (m_bps - 1);
+        for (n = 0; n < p_size; n++) {
+            int val;
+#ifdef MPC_FIXED_POINT
+            val =
+                shift_signed(p_buffer[n],
+                             m_bps - MPC_FIXED_POINT_SCALE_SHIFT);
+#else
+            val = (int)(p_buffer[n] * float_scale);
+#endif
+            if (val < clip_min)
+                val = clip_min;
+            else if (val > clip_max)
+                val = clip_max;
+            if (!WriteInt(val, m_bps))
+                return false;
+        }
+        m_data_bytes_written += p_size * (m_bps >> 3);
+        return true;
+    }
+
+    ~WavWriter() {
+        if (m_data_bytes_written & 1) {
+            char blah = 0;
+            WriteRaw(&blah, 1);
+            m_data_bytes_written++;
+        }
+        Seek(4);
+        WriteDword((unsigned long)(m_data_bytes_written + 4 + 8 + WFX_SIZE +
+                                   8));
+        Seek(8 + 4 + 8 + WFX_SIZE + 4);
+        WriteDword(m_data_bytes_written);
+    }
+
+  private:
+
+    mpc_bool_t Seek(unsigned p_offset) {
+        return !fseek(m_file, p_offset, SEEK_SET);
+    }
+
+    mpc_bool_t WriteRaw(const void *p_buffer, unsigned p_bytes) {
+        return fwrite(p_buffer, 1, p_bytes, m_file) == p_bytes;
+    }
+
+    mpc_bool_t WriteDword(unsigned long p_val) {
+        return WriteInt(p_val, 32);
+    }
+    mpc_bool_t WriteWord(unsigned short p_val) {
+        return WriteInt(p_val, 16);
+    }
+
+    // write a little-endian number properly
+    mpc_bool_t WriteInt(unsigned int p_val, unsigned p_width_bits) {
+        unsigned char temp;
+        unsigned shift = 0;
+        assert((p_width_bits % 8) == 0);
+        do {
+            temp = (unsigned char)((p_val >> shift) & 0xFF);
+            if (!WriteRaw(&temp, 1))
+                return false;
+            shift += 8;
+        } while (shift < p_width_bits);
+        return true;
+    }
+
+    unsigned m_nch, m_bps, m_srate;
+    FILE *m_file;
+    unsigned m_data_bytes_written;
+};
+
+
+static void
+usage(const char *exename)
+{
+    printf
+        ("Usage: %s <infile.mpc> [<outfile.wav>]\nIf <outfile.wav> is not specified, decoder will run in benchmark mode.\n",
+         exename);
+}
+
+int
+main(int argc, char **argv)
+{
+    if (argc != 2 && argc != 3) {
+        if (argc > 0)
+            usage(argv[0]);
+        return 0;
+    }
+
+    FILE *input = fopen(argv[1], "rb");
+    FILE *output = 0;
+    if (input == 0) {
+        usage(argv[0]);
+        printf("Error opening input file: \"%s\"\n", argv[1]);
+        return 1;
+    }
+
+    if (argc == 3) {
+        output = fopen(argv[2], "wb");
+        if (output == 0) {
+            fclose(input);
+            usage(argv[0]);
+            printf("Error opening output file: \"%s\"\n", argv[2]);
+            return 1;
+        }
+    }
+
+    /* initialize our reader_data tag the reader will carry around with it */
+    reader_data data;
+    data.file = input;
+    data.seekable = true;
+    fseek(data.file, 0, SEEK_END);
+    data.size = ftell(data.file);
+    fseek(data.file, 0, SEEK_SET);
+
+    /* set up an mpc_reader linked to our function implementations */
+    mpc_decoder decoder;
+    mpc_reader reader;
+    reader.read = read_impl;
+    reader.seek = seek_impl;
+    reader.tell = tell_impl;
+    reader.get_size = get_size_impl;
+    reader.canseek = canseek_impl;
+    reader.data = &data;
+
+    /* read file's streaminfo data */
+    mpc_streaminfo info;
+    mpc_streaminfo_init(&info);
+    if (mpc_streaminfo_read(&info, &reader) != ERROR_CODE_OK) {
+        printf("Not a valid musepack file: \"%s\"\n", argv[1]);
+        return 1;
+    }
+
+    /* instantiate a decoder with our file reader */
+    mpc_decoder_setup(&decoder, &reader);
+    if (!mpc_decoder_initialize(&decoder, &info)) {
+        printf("Error initializing decoder.\n", argv[1]);
+        return 1;
+    }
+
+    /* decode the file */
+    printf("Decoding from:\n%s\nTo:\n%s\n", argv[1],
+           output ? argv[2] : "N/A");
+    WavWriter *wavwriter =
+        output ? new WavWriter(output, 2, 16, info.sample_freq) : 0;
+    MPC_SAMPLE_FORMAT sample_buffer[MPC_DECODER_BUFFER_LENGTH];
+    clock_t begin, end;
+    begin = clock();
+    unsigned total_samples = 0;
+    mpc_bool_t successful = FALSE;
+    for (;;) {
+        unsigned status = mpc_decoder_decode(&decoder, sample_buffer, 0, 0);
+        if (status == (unsigned)(-1)) {
+            //decode error
+            printf("Error decoding file.\n");
+            break;
+        }
+        else if (status == 0)   //EOF
+        {
+            successful = true;
+            break;
+        }
+        else                    //status>0
+        {
+            total_samples += status;
+            if (wavwriter) {
+                if (!wavwriter->
+                    WriteSamples(sample_buffer, status * /* stereo */ 2)) {
+                    printf("Write error.\n");
+                    break;
+                }
+            }
+        }
+    }
+
+    end = clock();
+
+    if (wavwriter) {
+        delete wavwriter;
+    }
+
+    if (successful) {
+        printf("\nFinished.\nTotal samples decoded: %u.\n", total_samples);
+        unsigned ms = (end - begin) * 1000 / CLOCKS_PER_SEC;
+        unsigned ratio =
+            (unsigned)((double)total_samples / (double)info.sample_freq /
+                       ((double)ms / 1000.0) * 100.0);
+        printf("Time: %u ms (%u.%02ux).\n", ms, ratio / 100, ratio % 100);
+    }
+
+    return 0;
+}
Index: /libmpcdec/tags/release-1.2.2/src/streaminfo.c
===================================================================
--- /libmpcdec/tags/release-1.2.2/src/streaminfo.c	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/src/streaminfo.c	(revision 30)
@@ -0,0 +1,282 @@
+/*
+  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 streaminfo.c
+/// Implementation of streaminfo reading functions.
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/internal.h>
+
+static const char *
+Stringify(mpc_uint32_t profile) // profile is 0...15, where 7...13 is used
+{
+    static const char na[] = "n.a.";
+    static const char *Names[] = {
+        na, "'Unstable/Experimental'", na, na,
+        na, "'quality 0'", "'quality 1'", "'Telephone'",
+        "'Thumb'", "'Radio'", "'Standard'", "'Xtreme'",
+        "'Insane'", "'BrainDead'", "'quality 9'", "'quality 10'"
+    };
+
+    return profile >= sizeof(Names) / sizeof(*Names) ? na : Names[profile];
+}
+
+void
+mpc_streaminfo_init(mpc_streaminfo * si)
+{
+    memset(si, 0, sizeof(mpc_streaminfo));
+}
+
+// read information from SV8 header
+// not yet implemented
+static mpc_int32_t
+streaminfo_read_header_sv8(mpc_streaminfo * si, mpc_reader * fp)
+{
+    (void) si;
+    (void) fp;
+    return 0;
+}
+
+/// Reads streaminfo from SV7 header. 
+static mpc_int32_t
+streaminfo_read_header_sv7(mpc_streaminfo * si, mpc_uint32_t HeaderData[8])
+{
+    const mpc_int32_t samplefreqs[4] = { 44100, 48000, 37800, 32000 };
+
+    //mpc_uint32_t    HeaderData [8];
+    mpc_uint16_t Estimatedpeak_title = 0;
+
+    if (si->stream_version > 0x71) {
+        //        Update (si->stream_version);
+        return 0;
+    }
+
+    /*
+       if ( !fp->seek ( si->header_position ) )         // seek to header start
+       return ERROR_CODE_FILE;
+       if ( fp->read ( HeaderData, sizeof HeaderData) != sizeof HeaderData )
+       return ERROR_CODE_FILE;
+     */
+
+    si->bitrate = 0;
+    si->frames = HeaderData[1];
+    si->is = 0;
+    si->ms = (HeaderData[2] >> 30) & 0x0001;
+    si->max_band = (HeaderData[2] >> 24) & 0x003F;
+    si->block_size = 1;
+    si->profile = (HeaderData[2] << 8) >> 28;
+    si->profile_name = Stringify(si->profile);
+    si->sample_freq = samplefreqs[(HeaderData[2] >> 16) & 0x0003];
+    Estimatedpeak_title = (mpc_uint16_t) (HeaderData[2] & 0xFFFF);   // read the ReplayGain data
+    si->gain_title = (mpc_uint16_t) ((HeaderData[3] >> 16) & 0xFFFF);
+    si->peak_title = (mpc_uint16_t) (HeaderData[3] & 0xFFFF);
+    si->gain_album = (mpc_uint16_t) ((HeaderData[4] >> 16) & 0xFFFF);
+    si->peak_album = (mpc_uint16_t) (HeaderData[4] & 0xFFFF);
+    si->is_true_gapless = (HeaderData[5] >> 31) & 0x0001; // true gapless: used?
+    si->last_frame_samples = (HeaderData[5] >> 20) & 0x07FF;  // true gapless: valid samples for last frame
+    si->encoder_version = (HeaderData[6] >> 24) & 0x00FF;
+
+    if (si->encoder_version == 0) {
+        sprintf(si->encoder, "Buschmann 1.7.0...9, Klemm 0.90...1.05");
+    }
+    else {
+        switch (si->encoder_version % 10) {
+        case 0:
+            sprintf(si->encoder, "Release %u.%u", si->encoder_version / 100,
+                    si->encoder_version / 10 % 10);
+            break;
+        case 2:
+        case 4:
+        case 6:
+        case 8:
+            sprintf(si->encoder, "Beta %u.%02u", si->encoder_version / 100,
+                    si->encoder_version % 100);
+            break;
+        default:
+            sprintf(si->encoder, "--Alpha-- %u.%02u",
+                    si->encoder_version / 100, si->encoder_version % 100);
+            break;
+        }
+    }
+
+    //    if ( si->peak_title == 0 )                                      // there is no correct peak_title contained within header
+    //        si->peak_title = (mpc_uint16_t)(Estimatedpeak_title * 1.18);
+    //    if ( si->peak_album == 0 )
+    //        si->peak_album = si->peak_title;                          // no correct peak_album, use peak_title
+
+    //si->sample_freq    = 44100;                                     // AB: used by all files up to SV7
+    si->channels = 2;
+
+    return ERROR_CODE_OK;
+}
+
+// read information from SV4-SV6 header
+static mpc_int32_t
+streaminfo_read_header_sv6(mpc_streaminfo * si, mpc_uint32_t HeaderData[8])
+{
+    //mpc_uint32_t    HeaderData [8];
+
+    /*
+       if ( !fp->seek (  si->header_position ) )         // seek to header start
+       return ERROR_CODE_FILE;
+       if ( fp->read ( HeaderData, sizeof HeaderData ) != sizeof HeaderData )
+       return ERROR_CODE_FILE;
+     */
+
+    si->bitrate = (HeaderData[0] >> 23) & 0x01FF;   // read the file-header (SV6 and below)
+    si->is = (HeaderData[0] >> 22) & 0x0001;
+    si->ms = (HeaderData[0] >> 21) & 0x0001;
+    si->stream_version = (HeaderData[0] >> 11) & 0x03FF;
+    si->max_band = (HeaderData[0] >> 6) & 0x001F;
+    si->block_size = (HeaderData[0]) & 0x003F;
+    si->profile = 0;
+    si->profile_name = Stringify((mpc_uint32_t) (-1));
+    if (si->stream_version >= 5)
+        si->frames = HeaderData[1]; // 32 bit
+    else
+        si->frames = (HeaderData[1] >> 16); // 16 bit
+
+    si->gain_title = 0;          // not supported
+    si->peak_title = 0;
+    si->gain_album = 0;
+    si->peak_album = 0;
+
+    si->last_frame_samples = 0;
+    si->is_true_gapless = 0;
+
+    si->encoder_version = 0;
+    si->encoder[0] = '\0';
+
+    if (si->stream_version == 7)
+        return ERROR_CODE_SV7BETA;  // are there any unsupported parameters used?
+    if (si->bitrate != 0)
+        return ERROR_CODE_CBR;
+    if (si->is != 0)
+        return ERROR_CODE_IS;
+    if (si->block_size != 1)
+        return ERROR_CODE_BLOCKSIZE;
+
+    if (si->stream_version < 6) // Bugfix: last frame was invalid for up to SV5
+        si->frames -= 1;
+
+    si->sample_freq = 44100;     // AB: used by all files up to SV7
+    si->channels = 2;
+
+    if (si->stream_version < 4 || si->stream_version > 7)
+        return ERROR_CODE_INVALIDSV;
+
+    return ERROR_CODE_OK;
+}
+
+// reads file header and tags
+mpc_int32_t
+mpc_streaminfo_read(mpc_streaminfo * si, mpc_reader * r)
+{
+    mpc_uint32_t HeaderData[8];
+    mpc_int32_t Error = 0;
+
+    // get header position
+    if ((si->header_position = JumpID3v2(r)) < 0) {
+        return ERROR_CODE_FILE;
+    }
+    // seek to first byte of mpc data
+    if (!r->seek(r->data, si->header_position)) {
+        return ERROR_CODE_FILE;
+    }
+    if (r->read(r->data, HeaderData, 8 * 4) != 8 * 4) {
+        return ERROR_CODE_FILE;
+    }
+    if (!r->seek(r->data, si->header_position + 6 * 4)) {
+        return ERROR_CODE_FILE;
+    }
+
+    si->total_file_length = r->get_size(r->data);
+    si->tag_offset = si->total_file_length;
+    if (memcmp(HeaderData, "MP+", 3) == 0) {
+#ifndef MPC_LITTLE_ENDIAN
+        mpc_uint32_t ptr;
+        for (ptr = 0; ptr < 8; ptr++) {
+            HeaderData[ptr] = mpc_swap32(HeaderData[ptr]);
+        }
+#endif
+        si->stream_version = HeaderData[0] >> 24;
+
+        // stream version 8
+        if ((si->stream_version & 15) >= 8) {
+            Error = streaminfo_read_header_sv8(si, r);
+        }
+        // stream version 7
+        else if ((si->stream_version & 15) == 7) {
+            Error = streaminfo_read_header_sv7(si, HeaderData);
+        }
+    }
+    else {
+        // stream version 4-6
+        Error = streaminfo_read_header_sv6(si, HeaderData);
+    }
+
+    // estimation, exact value needs too much time
+    si->pcm_samples = 1152 * si->frames - 576;
+
+    if (si->pcm_samples > 0) {
+        si->average_bitrate =
+            (si->tag_offset -
+             si->header_position) * 8.0 * si->sample_freq / si->pcm_samples;
+    }
+    else {
+        si->average_bitrate = 0;
+    }
+
+    return Error;
+}
+
+double
+mpc_streaminfo_get_length(mpc_streaminfo * si)
+{
+    return (double)mpc_streaminfo_get_length_samples(si) /
+        (double)si->sample_freq;
+}
+
+mpc_int64_t
+mpc_streaminfo_get_length_samples(mpc_streaminfo * si)
+{
+    mpc_int64_t samples = (mpc_int64_t) si->frames * MPC_FRAME_LENGTH;
+    if (si->is_true_gapless) {
+        samples -= (MPC_FRAME_LENGTH - si->last_frame_samples);
+    }
+    else {
+        samples -= MPC_DECODER_SYNTH_DELAY;
+    }
+    return samples;
+}
Index: /libmpcdec/tags/release-1.2.2/src/synth_filter.c
===================================================================
--- /libmpcdec/tags/release-1.2.2/src/synth_filter.c	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/src/synth_filter.c	(revision 30)
@@ -0,0 +1,442 @@
+/*
+  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 synth_filter.c
+/// Synthesis functions.
+/// \todo document me
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/internal.h>
+
+typedef mpc_int32_t ptrdiff_t;
+
+/* C O N S T A N T S */
+#undef _
+
+#define MPC_FIXED_POINT_SYNTH_FIX 2
+
+#ifdef MPC_FIXED_POINT
+#define _(value)  MPC_MAKE_FRACT_CONST((double)value/(double)(0x40000))
+#else
+#define _(value)  MAKE_MPC_SAMPLE((double)value/(double)(0x10000))
+#endif
+
+
+static const MPC_SAMPLE_FORMAT  Di_opt [32] [16] = {
+    { _(  0), _( -29), _( 213), _( -459), _( 2037), _(-5153), _(  6574), _(-37489), _(75038), _(37489), _(6574), _( 5153), _(2037), _( 459), _(213), _(29) },
+    { _( -1), _( -31), _( 218), _( -519), _( 2000), _(-5517), _(  5959), _(-39336), _(74992), _(35640), _(7134), _( 4788), _(2063), _( 401), _(208), _(26) },
+    { _( -1), _( -35), _( 222), _( -581), _( 1952), _(-5879), _(  5288), _(-41176), _(74856), _(33791), _(7640), _( 4425), _(2080), _( 347), _(202), _(24) },
+    { _( -1), _( -38), _( 225), _( -645), _( 1893), _(-6237), _(  4561), _(-43006), _(74630), _(31947), _(8092), _( 4063), _(2087), _( 294), _(196), _(21) },
+    { _( -1), _( -41), _( 227), _( -711), _( 1822), _(-6589), _(  3776), _(-44821), _(74313), _(30112), _(8492), _( 3705), _(2085), _( 244), _(190), _(19) },
+    { _( -1), _( -45), _( 228), _( -779), _( 1739), _(-6935), _(  2935), _(-46617), _(73908), _(28289), _(8840), _( 3351), _(2075), _( 197), _(183), _(17) },
+    { _( -1), _( -49), _( 228), _( -848), _( 1644), _(-7271), _(  2037), _(-48390), _(73415), _(26482), _(9139), _( 3004), _(2057), _( 153), _(176), _(16) },
+    { _( -2), _( -53), _( 227), _( -919), _( 1535), _(-7597), _(  1082), _(-50137), _(72835), _(24694), _(9389), _( 2663), _(2032), _( 111), _(169), _(14) },
+    { _( -2), _( -58), _( 224), _( -991), _( 1414), _(-7910), _(    70), _(-51853), _(72169), _(22929), _(9592), _( 2330), _(2001), _(  72), _(161), _(13) },
+    { _( -2), _( -63), _( 221), _(-1064), _( 1280), _(-8209), _(  -998), _(-53534), _(71420), _(21189), _(9750), _( 2006), _(1962), _(  36), _(154), _(11) },
+    { _( -2), _( -68), _( 215), _(-1137), _( 1131), _(-8491), _( -2122), _(-55178), _(70590), _(19478), _(9863), _( 1692), _(1919), _(   2), _(147), _(10) },
+    { _( -3), _( -73), _( 208), _(-1210), _(  970), _(-8755), _( -3300), _(-56778), _(69679), _(17799), _(9935), _( 1388), _(1870), _( -29), _(139), _( 9) },
+    { _( -3), _( -79), _( 200), _(-1283), _(  794), _(-8998), _( -4533), _(-58333), _(68692), _(16155), _(9966), _( 1095), _(1817), _( -57), _(132), _( 8) },
+    { _( -4), _( -85), _( 189), _(-1356), _(  605), _(-9219), _( -5818), _(-59838), _(67629), _(14548), _(9959), _(  814), _(1759), _( -83), _(125), _( 7) },
+    { _( -4), _( -91), _( 177), _(-1428), _(  402), _(-9416), _( -7154), _(-61289), _(66494), _(12980), _(9916), _(  545), _(1698), _(-106), _(117), _( 7) },
+    { _( -5), _( -97), _( 163), _(-1498), _(  185), _(-9585), _( -8540), _(-62684), _(65290), _(11455), _(9838), _(  288), _(1634), _(-127), _(111), _( 6) },
+    { _( -5), _(-104), _( 146), _(-1567), _(  -45), _(-9727), _( -9975), _(-64019), _(64019), _( 9975), _(9727), _(   45), _(1567), _(-146), _(104), _( 5) },
+    { _( -6), _(-111), _( 127), _(-1634), _( -288), _(-9838), _(-11455), _(-65290), _(62684), _( 8540), _(9585), _( -185), _(1498), _(-163), _( 97), _( 5) },
+    { _( -7), _(-117), _( 106), _(-1698), _( -545), _(-9916), _(-12980), _(-66494), _(61289), _( 7154), _(9416), _( -402), _(1428), _(-177), _( 91), _( 4) },
+    { _( -7), _(-125), _(  83), _(-1759), _( -814), _(-9959), _(-14548), _(-67629), _(59838), _( 5818), _(9219), _( -605), _(1356), _(-189), _( 85), _( 4) },
+    { _( -8), _(-132), _(  57), _(-1817), _(-1095), _(-9966), _(-16155), _(-68692), _(58333), _( 4533), _(8998), _( -794), _(1283), _(-200), _( 79), _( 3) },
+    { _( -9), _(-139), _(  29), _(-1870), _(-1388), _(-9935), _(-17799), _(-69679), _(56778), _( 3300), _(8755), _( -970), _(1210), _(-208), _( 73), _( 3) },
+    { _(-10), _(-147), _(  -2), _(-1919), _(-1692), _(-9863), _(-19478), _(-70590), _(55178), _( 2122), _(8491), _(-1131), _(1137), _(-215), _( 68), _( 2) },
+    { _(-11), _(-154), _( -36), _(-1962), _(-2006), _(-9750), _(-21189), _(-71420), _(53534), _(  998), _(8209), _(-1280), _(1064), _(-221), _( 63), _( 2) },
+    { _(-13), _(-161), _( -72), _(-2001), _(-2330), _(-9592), _(-22929), _(-72169), _(51853), _(  -70), _(7910), _(-1414), _( 991), _(-224), _( 58), _( 2) },
+    { _(-14), _(-169), _(-111), _(-2032), _(-2663), _(-9389), _(-24694), _(-72835), _(50137), _(-1082), _(7597), _(-1535), _( 919), _(-227), _( 53), _( 2) },
+    { _(-16), _(-176), _(-153), _(-2057), _(-3004), _(-9139), _(-26482), _(-73415), _(48390), _(-2037), _(7271), _(-1644), _( 848), _(-228), _( 49), _( 1) },
+    { _(-17), _(-183), _(-197), _(-2075), _(-3351), _(-8840), _(-28289), _(-73908), _(46617), _(-2935), _(6935), _(-1739), _( 779), _(-228), _( 45), _( 1) },
+    { _(-19), _(-190), _(-244), _(-2085), _(-3705), _(-8492), _(-30112), _(-74313), _(44821), _(-3776), _(6589), _(-1822), _( 711), _(-227), _( 41), _( 1) },
+    { _(-21), _(-196), _(-294), _(-2087), _(-4063), _(-8092), _(-31947), _(-74630), _(43006), _(-4561), _(6237), _(-1893), _( 645), _(-225), _( 38), _( 1) },
+    { _(-24), _(-202), _(-347), _(-2080), _(-4425), _(-7640), _(-33791), _(-74856), _(41176), _(-5288), _(5879), _(-1952), _( 581), _(-222), _( 35), _( 1) },
+    { _(-26), _(-208), _(-401), _(-2063), _(-4788), _(-7134), _(-35640), _(-74992), _(39336), _(-5959), _(5517), _(-2000), _( 519), _(-218), _( 31), _( 1) }
+};
+
+#undef  _
+
+static void Calculate_New_V ( const MPC_SAMPLE_FORMAT * Sample, MPC_SAMPLE_FORMAT * V )
+{
+    // Calculating new V-buffer values for left channel
+    // calculate new V-values (ISO-11172-3, p. 39)
+    // based upon fast-MDCT algorithm by Byeong Gi Lee
+    /*static*/ MPC_SAMPLE_FORMAT A00, A01, A02, A03, A04, A05, A06, A07, A08, A09, A10, A11, A12, A13, A14, A15;
+    /*static*/ MPC_SAMPLE_FORMAT B00, B01, B02, B03, B04, B05, B06, B07, B08, B09, B10, B11, B12, B13, B14, B15;
+    MPC_SAMPLE_FORMAT tmp;
+
+    A00 = Sample[ 0] + Sample[31];
+    A01 = Sample[ 1] + Sample[30];
+    A02 = Sample[ 2] + Sample[29];
+    A03 = Sample[ 3] + Sample[28];
+    A04 = Sample[ 4] + Sample[27];
+    A05 = Sample[ 5] + Sample[26];
+    A06 = Sample[ 6] + Sample[25];
+    A07 = Sample[ 7] + Sample[24];
+    A08 = Sample[ 8] + Sample[23];
+    A09 = Sample[ 9] + Sample[22];
+    A10 = Sample[10] + Sample[21];
+    A11 = Sample[11] + Sample[20];
+    A12 = Sample[12] + Sample[19];
+    A13 = Sample[13] + Sample[18];
+    A14 = Sample[14] + Sample[17];
+    A15 = Sample[15] + Sample[16];
+
+    B00 = A00 + A15;
+    B01 = A01 + A14;
+    B02 = A02 + A13;
+    B03 = A03 + A12;
+    B04 = A04 + A11;
+    B05 = A05 + A10;
+    B06 = A06 + A09;
+    B07 = A07 + A08;;
+    B08 = MPC_SCALE_CONST((A00 - A15) , 0.5024192929f , 31);
+    B09 = MPC_SCALE_CONST((A01 - A14) , 0.5224986076f , 31);
+    B10 = MPC_SCALE_CONST((A02 - A13) , 0.5669440627f , 31);
+    B11 = MPC_SCALE_CONST((A03 - A12) , 0.6468217969f , 31);
+    B12 = MPC_SCALE_CONST((A04 - A11) , 0.7881546021f , 31);
+    B13 = MPC_SCALE_CONST((A05 - A10) , 1.0606776476f , 30);
+    B14 = MPC_SCALE_CONST((A06 - A09) , 1.7224471569f , 30);
+    B15 = MPC_SCALE_CONST((A07 - A08) , 5.1011486053f , 28);
+
+    A00 =  B00 + B07;
+    A01 =  B01 + B06;
+    A02 =  B02 + B05;
+    A03 =  B03 + B04;
+    A04 = MPC_SCALE_CONST((B00 - B07) , 0.5097956061f , 31);
+    A05 = MPC_SCALE_CONST((B01 - B06) , 0.6013448834f , 31);
+    A06 = MPC_SCALE_CONST((B02 - B05) , 0.8999761939f , 31);
+    A07 = MPC_SCALE_CONST((B03 - B04) , 2.5629155636f , 29);
+    A08 =  B08 + B15;
+    A09 =  B09 + B14;
+    A10 =  B10 + B13;
+    A11 =  B11 + B12;
+    A12 = MPC_SCALE_CONST((B08 - B15) , 0.5097956061f , 31);
+    A13 = MPC_SCALE_CONST((B09 - B14) , 0.6013448834f , 31);
+    A14 = MPC_SCALE_CONST((B10 - B13) , 0.8999761939f , 31);
+    A15 = MPC_SCALE_CONST((B11 - B12) , 2.5629155636f , 29);
+
+    B00 =  A00 + A03;
+    B01 =  A01 + A02;
+    B02 = MPC_MULTIPLY_FRACT_CONST_FIX((A00 - A03) , 0.5411961079f , 1);
+    B03 = MPC_MULTIPLY_FRACT_CONST_FIX((A01 - A02) , 1.3065630198f , 2);
+    B04 =  A04 + A07;
+    B05 =  A05 + A06;
+    B06 = MPC_MULTIPLY_FRACT_CONST_FIX((A04 - A07) , 0.5411961079f , 1);
+    B07 = MPC_MULTIPLY_FRACT_CONST_FIX((A05 - A06) , 1.3065630198f , 2);
+    B08 =  A08 + A11;
+    B09 =  A09 + A10;
+    B10 = MPC_MULTIPLY_FRACT_CONST_FIX((A08 - A11) , 0.5411961079f , 1);
+    B11 = MPC_MULTIPLY_FRACT_CONST_FIX((A09 - A10) , 1.3065630198f , 2);
+    B12 =  A12 + A15;
+    B13 =  A13 + A14;
+    B14 = MPC_MULTIPLY_FRACT_CONST_FIX((A12 - A15) , 0.5411961079f , 1);
+    B15 = MPC_MULTIPLY_FRACT_CONST_FIX((A13 - A14) , 1.3065630198f , 2);
+
+    A00 =  B00 + B01;
+    A01 = MPC_MULTIPLY_FRACT_CONST_FIX((B00 - B01) , 0.7071067691f , 1);
+    A02 =  B02 + B03;
+    A03 = MPC_MULTIPLY_FRACT_CONST_FIX((B02 - B03) , 0.7071067691f , 1);
+    A04 =  B04 + B05;
+    A05 = MPC_MULTIPLY_FRACT_CONST_FIX((B04 - B05) , 0.7071067691f , 1);
+    A06 =  B06 + B07;
+    A07 = MPC_MULTIPLY_FRACT_CONST_FIX((B06 - B07) , 0.7071067691f , 1);
+    A08 =  B08 + B09;
+    A09 = MPC_MULTIPLY_FRACT_CONST_FIX((B08 - B09) , 0.7071067691f , 1);
+    A10 =  B10 + B11;
+    A11 = MPC_MULTIPLY_FRACT_CONST_FIX((B10 - B11) , 0.7071067691f , 1);
+    A12 =  B12 + B13;
+    A13 = MPC_MULTIPLY_FRACT_CONST_FIX((B12 - B13) , 0.7071067691f , 1);
+    A14 =  B14 + B15;
+    A15 = MPC_MULTIPLY_FRACT_CONST_FIX((B14 - B15) , 0.7071067691f , 1);
+
+    V[48] = -A00;
+    V[ 0] =  A01;
+    V[40] = -A02 - (V[ 8] = A03);
+    V[36] = -((V[ 4] = A05 + (V[12] = A07)) + A06);
+    V[44] = - A04 - A06 - A07;
+    V[ 6] = (V[10] = A11 + (V[14] = A15)) + A13;
+    V[38] = (V[34] = -(V[ 2] = A09 + A13 + A15) - A14) + A09 - A10 - A11;
+    V[46] = (tmp = -(A12 + A14 + A15)) - A08;
+    V[42] = tmp - A10 - A11;
+
+    A00 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 0] - Sample[31]) , 0.5006030202f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A01 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 1] - Sample[30]) , 0.5054709315f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A02 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 2] - Sample[29]) , 0.5154473186f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A03 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 3] - Sample[28]) , 0.5310425758f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A04 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 4] - Sample[27]) , 0.5531039238f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A05 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 5] - Sample[26]) , 0.5829349756f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A06 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 6] - Sample[25]) , 0.6225041151f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A07 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 7] - Sample[24]) , 0.6748083234f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A08 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 8] - Sample[23]) , 0.7445362806f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A09 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 9] - Sample[22]) , 0.8393496275f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A10 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[10] - Sample[21]) , 0.9725682139f ,     MPC_FIXED_POINT_SYNTH_FIX);
+#if MPC_FIXED_POINT_SYNTH_FIX>=2
+    A11 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[11] - Sample[20]) , 1.1694399118f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A12 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[12] - Sample[19]) , 1.4841645956f ,     MPC_FIXED_POINT_SYNTH_FIX);
+#else
+    A11 = MPC_SCALE_CONST_SHR         ((Sample[11] - Sample[20]) , 1.1694399118f , 30, MPC_FIXED_POINT_SYNTH_FIX);
+    A12 = MPC_SCALE_CONST_SHR         ((Sample[12] - Sample[19]) , 1.4841645956f , 30, MPC_FIXED_POINT_SYNTH_FIX);
+#endif
+    A13 = MPC_SCALE_CONST_SHR         ((Sample[13] - Sample[18]) , 2.0577809811f , 29, MPC_FIXED_POINT_SYNTH_FIX);
+    A14 = MPC_SCALE_CONST_SHR         ((Sample[14] - Sample[17]) , 3.4076085091f , 29, MPC_FIXED_POINT_SYNTH_FIX);
+    A15 = MPC_SCALE_CONST_SHR         ((Sample[15] - Sample[16]) , 10.1900081635f, 27 ,MPC_FIXED_POINT_SYNTH_FIX);
+
+    B00 =  A00 + A15;
+    B01 =  A01 + A14;
+    B02 =  A02 + A13;
+    B03 =  A03 + A12;
+    B04 =  A04 + A11;
+    B05 =  A05 + A10;
+    B06 =  A06 + A09;
+    B07 =  A07 + A08;
+    B08 = MPC_SCALE_CONST((A00 - A15) , 0.5024192929f , 31);
+    B09 = MPC_SCALE_CONST((A01 - A14) , 0.5224986076f , 31);
+    B10 = MPC_SCALE_CONST((A02 - A13) , 0.5669440627f , 31);
+    B11 = MPC_SCALE_CONST((A03 - A12) , 0.6468217969f , 31);
+    B12 = MPC_SCALE_CONST((A04 - A11) , 0.7881546021f , 31);
+    B13 = MPC_SCALE_CONST((A05 - A10) , 1.0606776476f , 30);
+    B14 = MPC_SCALE_CONST((A06 - A09) , 1.7224471569f , 30);
+    B15 = MPC_SCALE_CONST((A07 - A08) , 5.1011486053f , 28);
+
+    A00 =  B00 + B07;
+    A01 =  B01 + B06;
+    A02 =  B02 + B05;
+    A03 =  B03 + B04;
+    A04 = MPC_SCALE_CONST((B00 - B07) , 0.5097956061f , 31);
+    A05 = MPC_SCALE_CONST((B01 - B06) , 0.6013448834f , 31);
+    A06 = MPC_SCALE_CONST((B02 - B05) , 0.8999761939f , 31);
+    A07 = MPC_SCALE_CONST((B03 - B04) , 2.5629155636f , 29);
+    A08 =  B08 + B15;
+    A09 =  B09 + B14;
+    A10 =  B10 + B13;
+    A11 =  B11 + B12;
+    A12 = MPC_SCALE_CONST((B08 - B15) , 0.5097956061f , 31);
+    A13 = MPC_SCALE_CONST((B09 - B14) , 0.6013448834f , 31);
+    A14 = MPC_SCALE_CONST((B10 - B13) , 0.8999761939f , 31);
+    A15 = MPC_SCALE_CONST((B11 - B12) , 2.5629155636f , 29);
+
+    B00 =  A00 + A03;
+    B01 =  A01 + A02;
+    B02 = MPC_SCALE_CONST((A00 - A03) , 0.5411961079f , 31);
+    B03 = MPC_SCALE_CONST((A01 - A02) , 1.3065630198f , 30);
+    B04 =  A04 + A07;
+    B05 =  A05 + A06;
+    B06 = MPC_SCALE_CONST((A04 - A07) , 0.5411961079f , 31);
+    B07 = MPC_SCALE_CONST((A05 - A06) , 1.3065630198f , 30);
+    B08 =  A08 + A11;
+    B09 =  A09 + A10;
+    B10 = MPC_SCALE_CONST((A08 - A11) , 0.5411961079f , 31);
+    B11 = MPC_SCALE_CONST((A09 - A10) , 1.3065630198f , 30);
+    B12 =  A12 + A15;
+    B13 =  A13 + A14;
+    B14 = MPC_SCALE_CONST((A12 - A15) , 0.5411961079f , 31);
+    B15 = MPC_SCALE_CONST((A13 - A14) , 1.3065630198f , 30);
+
+    A00 = MPC_SHL(B00 + B01, MPC_FIXED_POINT_SYNTH_FIX);
+    A01 = MPC_SCALE_CONST_SHL((B00 - B01) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A02 = MPC_SHL(B02 + B03, MPC_FIXED_POINT_SYNTH_FIX);
+    A03 = MPC_SCALE_CONST_SHL((B02 - B03) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A04 = MPC_SHL(B04 + B05, MPC_FIXED_POINT_SYNTH_FIX);
+    A05 = MPC_SCALE_CONST_SHL((B04 - B05) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A06 = MPC_SHL(B06 + B07, MPC_FIXED_POINT_SYNTH_FIX);
+    A07 = MPC_SCALE_CONST_SHL((B06 - B07) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A08 = MPC_SHL(B08 + B09, MPC_FIXED_POINT_SYNTH_FIX);
+    A09 = MPC_SCALE_CONST_SHL((B08 - B09) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A10 = MPC_SHL(B10 + B11, MPC_FIXED_POINT_SYNTH_FIX);
+    A11 = MPC_SCALE_CONST_SHL((B10 - B11) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A12 = MPC_SHL(B12 + B13, MPC_FIXED_POINT_SYNTH_FIX);
+    A13 = MPC_SCALE_CONST_SHL((B12 - B13) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A14 = MPC_SHL(B14 + B15, MPC_FIXED_POINT_SYNTH_FIX);
+    A15 = MPC_SCALE_CONST_SHL((B14 - B15) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+
+    // mehrfach verwendete Ausdrücke: A04+A06+A07, A09+A13+A15
+    V[ 5] = (V[11] = (V[13] = A07 + (V[15] = A15)) + A11) + A05 + A13;
+    V[ 7] = (V[ 9] = A03 + A11 + A15) + A13;
+    V[33] = -(V[ 1] = A01 + A09 + A13 + A15) - A14;
+    V[35] = -(V[ 3] = A05 + A07 + A09 + A13 + A15) - A06 - A14;
+    V[37] = (tmp = -(A10 + A11 + A13 + A14 + A15)) - A05 - A06 - A07;
+    V[39] = tmp - A02 - A03;                      // abhängig vom Befehl drüber
+    V[41] = (tmp += A13 - A12) - A02 - A03;       // abhängig vom Befehl 2 drüber
+    V[43] = tmp - A04 - A06 - A07;                // abhängig von Befehlen 1 und 3 drüber
+    V[47] = (tmp = -(A08 + A12 + A14 + A15)) - A00;
+    V[45] = tmp - A04 - A06 - A07;                // abhängig vom Befehl drüber
+
+    V[32] = -V[ 0];
+    V[31] = -V[ 1];
+    V[30] = -V[ 2];
+    V[29] = -V[ 3];
+    V[28] = -V[ 4];
+    V[27] = -V[ 5];
+    V[26] = -V[ 6];
+    V[25] = -V[ 7];
+    V[24] = -V[ 8];
+    V[23] = -V[ 9];
+    V[22] = -V[10];
+    V[21] = -V[11];
+    V[20] = -V[12];
+    V[19] = -V[13];
+    V[18] = -V[14];
+    V[17] = -V[15];
+
+    V[63] =  V[33];
+    V[62] =  V[34];
+    V[61] =  V[35];
+    V[60] =  V[36];
+    V[59] =  V[37];
+    V[58] =  V[38];
+    V[57] =  V[39];
+    V[56] =  V[40];
+    V[55] =  V[41];
+    V[54] =  V[42];
+    V[53] =  V[43];
+    V[52] =  V[44];
+    V[51] =  V[45];
+    V[50] =  V[46];
+    V[49] =  V[47];
+}
+
+static void Synthese_Filter_float_internal(MPC_SAMPLE_FORMAT * OutData,MPC_SAMPLE_FORMAT * V,const MPC_SAMPLE_FORMAT * Y)
+{
+    mpc_uint32_t n;
+    for ( n = 0; n < 36; n++, Y += 32 ) {
+        V -= 64;
+        Calculate_New_V ( Y, V );
+        {
+            MPC_SAMPLE_FORMAT * Data = OutData;
+            const MPC_SAMPLE_FORMAT *  D = (const MPC_SAMPLE_FORMAT *) &Di_opt;
+            mpc_int32_t           k;
+            //mpc_int32_t           tmp;
+
+            
+            
+            for ( k = 0; k < 32; k++, D += 16, V++ ) {
+                *Data = MPC_SHL(
+                    MPC_MULTIPLY_FRACT(V[  0],D[ 0]) + MPC_MULTIPLY_FRACT(V[ 96],D[ 1]) + MPC_MULTIPLY_FRACT(V[128],D[ 2]) + MPC_MULTIPLY_FRACT(V[224],D[ 3])
+                    + MPC_MULTIPLY_FRACT(V[256],D[ 4]) + MPC_MULTIPLY_FRACT(V[352],D[ 5]) + MPC_MULTIPLY_FRACT(V[384],D[ 6]) + MPC_MULTIPLY_FRACT(V[480],D[ 7])
+                    + MPC_MULTIPLY_FRACT(V[512],D[ 8]) + MPC_MULTIPLY_FRACT(V[608],D[ 9]) + MPC_MULTIPLY_FRACT(V[640],D[10]) + MPC_MULTIPLY_FRACT(V[736],D[11])
+                    + MPC_MULTIPLY_FRACT(V[768],D[12]) + MPC_MULTIPLY_FRACT(V[864],D[13]) + MPC_MULTIPLY_FRACT(V[896],D[14]) + MPC_MULTIPLY_FRACT(V[992],D[15])
+                    , 2);
+                
+                Data += 2;
+            }
+            V -= 32;//bleh
+            OutData+=64;
+        }
+    }
+}
+
+void
+mpc_decoder_synthese_filter_float(mpc_decoder *d, MPC_SAMPLE_FORMAT* OutData) 
+{
+    /********* left channel ********/
+    memmove(d->V_L + MPC_V_MEM, d->V_L, 960 * sizeof(MPC_SAMPLE_FORMAT) );
+
+    Synthese_Filter_float_internal(
+        OutData,
+        (MPC_SAMPLE_FORMAT *)(d->V_L + MPC_V_MEM),
+        (MPC_SAMPLE_FORMAT *)(d->Y_L [0]));
+
+    /******** right channel ********/
+    memmove(d->V_R + MPC_V_MEM, d->V_R, 960 * sizeof(MPC_SAMPLE_FORMAT) );
+
+    Synthese_Filter_float_internal(
+        OutData + 1,
+        (MPC_SAMPLE_FORMAT *)(d->V_R + MPC_V_MEM),
+        (MPC_SAMPLE_FORMAT *)(d->Y_R [0]));
+}
+
+/*******************************************/
+/*                                         */
+/*            dithered synthesis           */
+/*                                         */
+/*******************************************/
+
+static const unsigned char    Parity [256] = {  // parity
+    0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
+    1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
+    1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
+    0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
+    1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
+    0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
+    0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
+    1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0
+};
+
+/*
+ *  This is a simple random number generator with good quality for audio purposes.
+ *  It consists of two polycounters with opposite rotation direction and different
+ *  periods. The periods are coprime, so the total period is the product of both.
+ *
+ *     -------------------------------------------------------------------------------------------------
+ * +-> |31:30:29:28:27:26:25:24:23:22:21:20:19:18:17:16:15:14:13:12:11:10: 9: 8: 7: 6: 5: 4: 3: 2: 1: 0|
+ * |   -------------------------------------------------------------------------------------------------
+ * |                                                                          |  |  |  |     |        |
+ * |                                                                          +--+--+--+-XOR-+--------+
+ * |                                                                                      |
+ * +--------------------------------------------------------------------------------------+
+ *
+ *     -------------------------------------------------------------------------------------------------
+ *     |31:30:29:28:27:26:25:24:23:22:21:20:19:18:17:16:15:14:13:12:11:10: 9: 8: 7: 6: 5: 4: 3: 2: 1: 0| <-+
+ *     -------------------------------------------------------------------------------------------------   |
+ *       |  |           |  |                                                                               |
+ *       +--+----XOR----+--+                                                                               |
+ *                |                                                                                        |
+ *                +----------------------------------------------------------------------------------------+
+ *
+ *
+ *  The first has an period of 3*5*17*257*65537, the second of 7*47*73*178481,
+ *  which gives a period of 18.410.713.077.675.721.215. The result is the
+ *  XORed values of both generators.
+ */
+mpc_uint32_t
+mpc_random_int(mpc_decoder *d) 
+{
+#if 1
+    mpc_uint32_t  t1, t2, t3, t4;
+
+    t3   = t1 = d->__r1;   t4   = t2 = d->__r2;  // Parity calculation is done via table lookup, this is also available
+    t1  &= 0xF5;        t2 >>= 25;               // on CPUs without parity, can be implemented in C and avoid unpredictable
+    t1   = Parity [t1]; t2  &= 0x63;             // jumps and slow rotate through the carry flag operations.
+    t1 <<= 31;          t2   = Parity [t2];
+
+    return (d->__r1 = (t3 >> 1) | t1 ) ^ (d->__r2 = (t4 + t4) | t2 );
+#else
+    return (d->__r1 = (d->__r1 >> 1) | ((mpc_uint32_t)Parity [d->__r1 & 0xF5] << 31) ) ^
+        (d->__r2 = (d->__r2 << 1) |  (mpc_uint32_t)Parity [(d->__r2 >> 25) & 0x63] );
+#endif
+}
Index: /libmpcdec/tags/release-1.2.2/win32/libmpcdec.dsp
===================================================================
--- /libmpcdec/tags/release-1.2.2/win32/libmpcdec.dsp	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/win32/libmpcdec.dsp	(revision 30)
@@ -0,0 +1,233 @@
+# Microsoft Developer Studio Project File - Name="libmpcdec" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=libmpcdec - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "libmpcdec.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "libmpcdec.mak" CFG="libmpcdec - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "libmpcdec - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "libmpcdec - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=xicl6.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "LibRelease"
+# PROP Intermediate_Dir "LibRelease"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /W3 /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "MPC_LITTLE_ENDIAN" /FR /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=xilink6.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "LibDebug"
+# PROP Intermediate_Dir "LibDebug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "MPC_LITTLE_ENDIAN" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=xilink6.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ENDIF 
+
+# Begin Target
+
+# Name "libmpcdec - Win32 Release"
+# Name "libmpcdec - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\src\huffsv46.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\huffsv7.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\idtag.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\mpc_decoder.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\mpc_reader.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\requant.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\streaminfo.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\synth_filter.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\include\mpcdec\config_win32.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\decoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\huffman.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\internal.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\math.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\mpcdec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\reader.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\requant.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\streaminfo.h
+# End Source File
+# End Group
+# End Target
+# End Project
Index: /libmpcdec/tags/release-1.2.2/win32/libmpcdec.dsw
===================================================================
--- /libmpcdec/tags/release-1.2.2/win32/libmpcdec.dsw	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/win32/libmpcdec.dsw	(revision 30)
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "libmpcdec"=".\libmpcdec.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
Index: /libmpcdec/tags/release-1.2.2/win32/sample.dsp
===================================================================
--- /libmpcdec/tags/release-1.2.2/win32/sample.dsp	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/win32/sample.dsp	(revision 30)
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="sample" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=sample - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "sample.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "sample.mak" CFG="sample - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "sample - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "sample - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=xicl6.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "sample - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "sample___Win32_Release"
+# PROP BASE Intermediate_Dir "sample___Win32_Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "SampleRelease"
+# PROP Intermediate_Dir "SampleRelease"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmpcdec.lib /nologo /subsystem:console /machine:I386 /libpath:"libRelease"
+
+!ELSEIF  "$(CFG)" == "sample - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "sample___Win32_Debug"
+# PROP BASE Intermediate_Dir "sample___Win32_Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "SampleDebug"
+# PROP Intermediate_Dir "SampleDebug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "MPC_LITTLE_ENDIAN" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmpcdec.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"libDebug"
+# SUBTRACT LINK32 /nodefaultlib
+
+!ENDIF 
+
+# Begin Target
+
+# Name "sample - Win32 Release"
+# Name "sample - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\src\sample.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
Index: /libmpcdec/tags/release-1.2.2/win32/sample.dsw
===================================================================
--- /libmpcdec/tags/release-1.2.2/win32/sample.dsw	(revision 30)
+++ /libmpcdec/tags/release-1.2.2/win32/sample.dsw	(revision 30)
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "sample"=".\sample.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
Index: /libmpcdec/tags/release-1.2/AUTHORS
===================================================================
--- /libmpcdec/tags/release-1.2/AUTHORS	(revision 30)
+++ /libmpcdec/tags/release-1.2/AUTHORS	(revision 30)
@@ -0,0 +1,10 @@
+libmpcdec is the result of the work of many people:
+
+* Andree Buschmann and Frank Klemm
+  Original implementation and core development.
+
+* Peter Pawlowski and Benoit Amiaux
+  Portability and further optimizations.
+
+* Miles Egan
+  Port to pure C, documentation, and api refinements.
Index: /libmpcdec/tags/release-1.2/COPYING
===================================================================
--- /libmpcdec/tags/release-1.2/COPYING	(revision 30)
+++ /libmpcdec/tags/release-1.2/COPYING	(revision 30)
@@ -0,0 +1,31 @@
+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.
Index: /libmpcdec/tags/release-1.2/ChangeLog
===================================================================
--- /libmpcdec/tags/release-1.2/ChangeLog	(revision 30)
+++ /libmpcdec/tags/release-1.2/ChangeLog	(revision 30)
@@ -0,0 +1,23 @@
+1.2
+    * 1.1.1 broke the API (BOOL type changed to mpc_bool_t). Version bumped to 1.2 to reflect the major change. Sorry to those who were caught by this error
+    * Fixed relative/absolute includes (#include "stuff.h" in /include/mpcdec, #include <mpcdec/stuff> in src/)
+    * Added msvc project files
+    * Changed mpc_reader_t structure, any specific data of the reader's
+    implementations should be hidden behind the (void*) data pointer. (example
+    in default implementation mpc_reader_file)
+    * Renamed to libmpcdec (to make room for libmpcenc)
+
+1.1.1
+    * fix for fixed-point mode bug
+
+1.1
+    * add compliance & cleanup patches from Michael Roitzsch of xine project 	
+    * switch to BSD license
+    * port to pure C
+    * add doxygen documentation
+    * revise API somewhat
+	
+1.0.3			
+    * autotools build process
+    * sample binary added
+    * floating-point mode by default
Index: /libmpcdec/tags/release-1.2/INSTALL
===================================================================
--- /libmpcdec/tags/release-1.2/INSTALL	(revision 30)
+++ /libmpcdec/tags/release-1.2/INSTALL	(revision 30)
@@ -0,0 +1,3 @@
+How to install libmpcdec:
+"./configure [--prefix=/usr] && make" as a regular user
+"make install" as root
Index: /libmpcdec/tags/release-1.2/Makefile.am
===================================================================
--- /libmpcdec/tags/release-1.2/Makefile.am	(revision 30)
+++ /libmpcdec/tags/release-1.2/Makefile.am	(revision 30)
@@ -0,0 +1,5 @@
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+
+SUBDIRS = src include
Index: /libmpcdec/tags/release-1.2/README
===================================================================
--- /libmpcdec/tags/release-1.2/README	(revision 30)
+++ /libmpcdec/tags/release-1.2/README	(revision 30)
@@ -0,0 +1,6 @@
+Musepack Decoder Library 1.2:
+
+run "./configure; make"
+
+To create a sample app using the musepack decoder library in src/
+Check src/sample.cpp for more details.
Index: /libmpcdec/tags/release-1.2/autogen.sh
===================================================================
--- /libmpcdec/tags/release-1.2/autogen.sh	(revision 30)
+++ /libmpcdec/tags/release-1.2/autogen.sh	(revision 30)
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+libtoolize --copy --force
+aclocal
+autoheader
+automake --gnu --add-missing --copy
+autoconf
Index: /libmpcdec/tags/release-1.2/configure.ac
===================================================================
--- /libmpcdec/tags/release-1.2/configure.ac	(revision 30)
+++ /libmpcdec/tags/release-1.2/configure.ac	(revision 30)
@@ -0,0 +1,202 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(src/mpc_decoder.c)
+AC_CONFIG_AUX_DIR(config)
+AM_INIT_AUTOMAKE(libmpcdec,1.2)
+AM_CONFIG_HEADER(include/config.h)
+
+AM_PROG_LIBTOOL
+
+CFLAGS="$CFLAGS -O3 -fomit-frame-pointer -fPIC"
+
+AC_C_BIGENDIAN(,CFLAGS="$CFLAGS -DMPC_LITTLE_ENDIAN",)
+
+AC_HEADER_STDC
+AC_CHECK_HEADERS([inttypes.h string.h])
+
+AC_HEADER_STDBOOL
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_OFF_T
+AC_TYPE_SIZE_T
+AC_CHECK_TYPES([ptrdiff_t])
+
+AC_FUNC_MEMCMP
+AC_CHECK_FUNCS([memmove memset sqrt])
+
+AC_MSG_CHECKING(for int16_t)
+AC_CACHE_VAL(has_int16_t,
+[AC_TRY_RUN([
+int16_t foo;
+int main() {return 0;}
+],
+has_int16_t=yes,
+has_int16_t=no,
+has_int16_t=no
+)])
+AC_MSG_RESULT($has_int16_t)
+
+AC_MSG_CHECKING(for int32_t)
+AC_CACHE_VAL(has_int32_t,
+[AC_TRY_RUN([
+int32_t foo;
+int main() {return 0;}
+],
+has_int32_t=yes,
+has_int32_t=no,
+has_int32_t=no
+)])
+AC_MSG_RESULT($has_int32_t)
+
+AC_MSG_CHECKING(for uint32_t)
+AC_CACHE_VAL(has_uint32_t,
+[AC_TRY_RUN([
+uint32_t foo;
+int main() {return 0;}
+],
+has_uint32_t=yes,
+has_uint32_t=no,
+has_uint32_t=no
+)])
+AC_MSG_RESULT($has_uint32_t)
+
+AC_MSG_CHECKING(for uint16_t)
+AC_CACHE_VAL(has_uint16_t,
+[AC_TRY_RUN([
+uint16_t foo;
+int main() {return 0;}
+],
+has_uint16_t=yes,
+has_uint16_t=no,
+has_uint16_t=no
+)])
+AC_MSG_RESULT($has_uint16_t)
+
+AC_MSG_CHECKING(for u_int32_t)
+AC_CACHE_VAL(has_u_int32_t,
+[AC_TRY_RUN([
+u_int32_t foo;
+int main() {return 0;}
+],
+has_u_int32_t=yes,
+has_u_int32_t=no,
+has_u_int32_t=no
+)])
+AC_MSG_RESULT($has_u_int32_t)
+
+AC_MSG_CHECKING(for u_int16_t)
+AC_CACHE_VAL(has_u_int16_t,
+[AC_TRY_RUN([
+u_int16_t foo;
+int main() {return 0;}
+],
+has_u_int16_t=yes,
+has_u_int16_t=no,
+has_u_int16_t=no
+)])
+AC_MSG_RESULT($has_u_int16_t)
+
+AC_MSG_CHECKING(for int64_t)
+AC_CACHE_VAL(has_int64_t,
+[AC_TRY_RUN([
+int64_t foo;
+int main() {return 0;}
+],
+has_int64_t=yes,
+has_int64_t=no,
+has_int64_t=no
+)])
+AC_MSG_RESULT($has_int64_t)
+
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+
+
+if test x$has_int16_t = "xyes" ; then
+        SIZE16="int16_t"
+else
+        case 2 in
+                $ac_cv_sizeof_short) SIZE16="short";;
+                $ac_cv_sizeof_int) SIZE16="int";;
+        esac
+fi
+
+if test x$has_int32_t = "xyes" ; then
+        SIZE32="int32_t"
+else
+        case 4 in
+                $ac_cv_sizeof_short) SIZE32="short";;
+                $ac_cv_sizeof_int) SIZE32="int";;
+                $ac_cv_sizeof_long) SIZE32="long";;
+        esac
+fi
+
+if test x$has_uint32_t = "xyes" ; then
+        USIZE32="uint32_t"
+else
+        if test x$has_u_int32_t = "xyes" ; then
+                USIZE32="u_int32_t"
+        else
+                case 4 in
+                        $ac_cv_sizeof_short) USIZE32="unsigned short";;
+                        $ac_cv_sizeof_int) USIZE32="unsigned int";;
+                        $ac_cv_sizeof_long) USIZE32="unsigned long";;
+                esac
+        fi
+fi
+
+if test x$has_uint16_t = "xyes" ; then
+        USIZE16="uint16_t"
+else
+        if test x$has_u_int16_t = "xyes" ; then
+                USIZE16="u_int16_t"
+        else
+                case 2 in
+                        $ac_cv_sizeof_short) USIZE16="unsigned short";;
+                        $ac_cv_sizeof_int) USIZE16="unsigned int";;
+                        $ac_cv_sizeof_long) USIZE16="unsigned long";;
+                esac
+        fi
+fi
+
+if test x$has_int64_t = "xyes" ; then
+        SIZE64="int64_t"
+else
+case 8 in
+        $ac_cv_sizeof_int) SIZE64="int";;
+        $ac_cv_sizeof_long) SIZE64="long";;
+        $ac_cv_sizeof_long_long) SIZE64="long long";;
+esac
+fi
+
+if test -z "$SIZE16"; then
+        AC_MSG_ERROR(No 16 bit type found on this platform!)
+fi
+if test -z "$USIZE16"; then
+        AC_MSG_ERROR(No unsigned 16 bit type found on this platform!)
+fi
+if test -z "$SIZE32"; then
+        AC_MSG_ERROR(No 32 bit type found on this platform!)
+fi
+if test -z "$USIZE32"; then
+        AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
+fi
+if test -z "$SIZE64"; then
+        AC_MSG_WARN(No 64 bit type found on this platform!)
+fi
+
+dnl Make substitutions
+
+AC_SUBST(VERSION)
+AC_SUBST(LIBTOOL_DEPS)
+AC_SUBST(SIZE16)
+AC_SUBST(USIZE16)
+AC_SUBST(SIZE32)
+AC_SUBST(USIZE32)
+AC_SUBST(SIZE64)
+AC_SUBST(OPT)
+AC_SUBST(LIBS)
+
+AC_OUTPUT(Makefile src/Makefile include/Makefile include/mpcdec/config_types.h)
+AC_MSG_RESULT([=> libmpcdec $VERSION configured successfully])
Index: /libmpcdec/tags/release-1.2/docs/Doxyfile
===================================================================
--- /libmpcdec/tags/release-1.2/docs/Doxyfile	(revision 30)
+++ /libmpcdec/tags/release-1.2/docs/Doxyfile	(revision 30)
@@ -0,0 +1,1161 @@
+# Doxyfile 1.3.9.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = libmpcdec
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 1.2
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = docs
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of source 
+# files, where putting all generated files in the same directory would otherwise 
+# cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, 
+# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, 
+# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, 
+# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, 
+# Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE        = English
+
+# This tag can be used to specify the encoding used in the generated output. 
+# The encoding is not always determined by the language that is chosen, 
+# but also whether or not the output is meant for Windows or non-Windows users. 
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES 
+# forces the Windows encoding (this is the default for the Windows binary), 
+# whereas setting the tag to NO uses a Unix-style encoding (the default for 
+# all platforms other than Windows).
+
+USE_WINDOWS_ENCODING   = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is used 
+# as the annotated text. Otherwise, the brief description is used as-is. If left 
+# blank, the following values are used ("$name" is automatically replaced with the 
+# name of the entity): "The $name class" "The $name widget" "The $name file" 
+# "is" "provides" "specifies" "contains" "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = 
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited 
+# members of a class in the documentation of that class as if those members were 
+# ordinary class members. Constructors, destructors and assignment operators of 
+# the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like the Qt-style comments (thus requiring an 
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF      = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member 
+# documentation.
+
+DETAILS_AT_TOP         = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = 
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources 
+# only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources 
+# only. Doxygen will then generate output that is more tailored for Java. 
+# For instance, namespaces will be presented as packages, qualified scopes 
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories 
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
+# in the documentation.
+
+SHOW_DIRECTORIES       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text.
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT                  = include src
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp 
+# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm
+
+FILE_PATTERNS          = 
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                = include/config.h
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories 
+# that are symbolic links (a Unix filesystem feature) are excluded from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories.
+
+EXCLUDE_PATTERNS       = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = 
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# ignored.
+
+INPUT_FILTER           = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis.  Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match.  The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
+# is applied to all files.
+
+FILTER_PATTERNS        = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default) 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        = docs/custom.css
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+
+PREDEFINED             = 
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line, have an all uppercase name, and do not end with a semicolon. Such 
+# function macros are typically used for boiler-plate code, and will confuse the 
+# parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or 
+# super classes. Setting the tag to NO turns the diagrams off. Note that this 
+# option is superseded by the HAVE_DOT option below. This is only a fallback. It is 
+# recommended to install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+
+UML_LOOK               = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
+# generate a call dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable call graphs for selected 
+# functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found on the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+
+MAX_DOT_GRAPH_WIDTH    = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT   = 1024
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
+# graphs generated by dot. A depth value of 3 means that only nodes reachable 
+# from the root by following a path via at most 3 edges will be shown. Nodes that 
+# lay further from the root node will be omitted. Note that setting this option to 
+# 1 or 2 may greatly reduce the computation time needed for large code bases. Also 
+# note that a graph may be further truncated if the graph's image dimensions are 
+# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). 
+# If 0 is used for the depth value (the default), the graph is not depth-constrained.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE           = NO
Index: /libmpcdec/tags/release-1.2/docs/custom.css
===================================================================
--- /libmpcdec/tags/release-1.2/docs/custom.css	(revision 30)
+++ /libmpcdec/tags/release-1.2/docs/custom.css	(revision 30)
@@ -0,0 +1,212 @@
+BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
+	font-family: sans-serif;
+}
+h1 {
+	text-align: center;
+    text-transform: lowercase;
+    margin: 0.5em 0;
+}
+h2, h2 a { color: #f90; margin: 1em 0 0.25em 0; }
+h3, h3 a { color: #88f; margin: 1em 0 0.25em 0; }
+
+CAPTION { font-weight: bold }
+DIV.qindex {
+	width: 100%;
+	background-color: #eeeeff;
+	border: 1px solid #b0b0b0;
+	text-align: center;
+	margin: 2px;
+	padding: 2px;
+	line-height: 140%;
+}
+DIV.nav {
+	text-align: center;
+    padding: 0.25em 0;
+}
+A.qindex {
+    text-decoration: none;
+    font-weight: bold;
+    color: #1A419D;
+    text-transform: lowercase;
+}
+A.qindex:visited {
+    text-decoration: none;
+    font-weight: bold;
+    color: #1A419D
+}
+A.qindex:hover {
+	text-decoration: none;
+	background-color: #ddddff;
+}
+A.qindexHL {
+	text-decoration: none;
+	font-weight: bold;
+	background-color: #6666cc;
+	color: #ffffff;
+	border: 1px double #9295C2;
+    text-transform: lowercase;
+}
+A.qindexHL:hover {
+	text-decoration: none;
+	background-color: #6666cc;
+	color: #ffffff;
+}
+A.qindex, A.qindexHL { padding: 0.1em 0.5em; }
+A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff }
+A.el { text-decoration: none; font-weight: bold; color: #d66; font-style: italic }
+A.elRef { font-weight: bold }
+A.code:link { text-decoration: none; font-weight: normal; color: #0000FF}
+A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF}
+A.codeRef:link { font-weight: normal; color: #0000FF}
+A.codeRef:visited { font-weight: normal; color: #0000FF}
+A:hover { text-decoration: none; background-color: #f2f2ff }
+DL.el { margin-left: -1cm }
+.fragment {
+       font-family: monospace
+}
+PRE.fragment {
+	border: 1px solid #CCCCCC;
+	background-color: #f5f5f5;
+	margin-top: 4px;
+	margin-bottom: 4px;
+	margin-left: 2px;
+	margin-right: 8px;
+	padding-left: 6px;
+	padding-right: 6px;
+	padding-top: 4px;
+	padding-bottom: 4px;
+}
+hr { display: none }
+DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
+TD.md { font-weight: bold; }
+TD.mdname1, TD.mdname { color: #088; font-weight: bold; }
+TABLE[cellspacing="5"] { margin-left: 2em; }
+TABLE[cellspacing="5"] dl em { color: #088; font-weight: bold; }
+DIV.groupHeader {
+       margin-left: 16px;
+       margin-top: 12px;
+       margin-bottom: 6px;
+       font-weight: bold;
+}
+DIV.groupText { margin-left: 16px; font-style: italic; font-size: 14px }
+BODY {
+	background: white;
+	color: black;
+	margin-right: 20px;
+	margin-left: 20px;
+}
+TD.indexkey, TD.indexvalue {
+    padding: 0.1em 1em 0.1em 0.1em;
+}
+TD.indexkey {
+	font-weight: bold;
+}
+TD.indexvalue {
+	font-style: italic;
+}
+TR.memlist {
+   background-color: #f0f0f0; 
+}
+P.formulaDsp { text-align: center; }
+IMG.formulaDsp { }
+IMG.formulaInl { vertical-align: middle; }
+SPAN.keyword       { color: #008000 }
+SPAN.keywordtype   { color: #604020 }
+SPAN.keywordflow   { color: #e08000 }
+SPAN.comment       { color: #800000 }
+SPAN.preprocessor  { color: #806020 }
+SPAN.stringliteral { color: #002080 }
+SPAN.charliteral   { color: #008080 }
+.mdTable {
+}
+.mdRow {
+}
+.mdescLeft, .mdescRight {
+    font-style: italic;
+    font-size: 80%;
+}
+.mdescRight {
+}
+.memItemLeft {
+    font-style: italic;
+}
+.memItemLeft, .memItemRight {
+    font-size: 80%;
+}
+.memItemRight {
+}
+.memTemplItemLeft {
+	padding: 1px 0px 0px 8px;
+	margin: 4px;
+	border-top-width: 1px;
+	border-right-width: 1px;
+	border-bottom-width: 1px;
+	border-left-width: 1px;
+	border-top-color: #E0E0E0;
+	border-right-color: #E0E0E0;
+	border-bottom-color: #E0E0E0;
+	border-left-color: #E0E0E0;
+	border-top-style: none;
+	border-right-style: none;
+	border-bottom-style: none;
+	border-left-style: none;
+	background-color: #FAFAFA;
+	font-size: 12px;
+}
+.memTemplItemRight {
+	padding: 1px 8px 0px 8px;
+	margin: 4px;
+	border-top-width: 1px;
+	border-right-width: 1px;
+	border-bottom-width: 1px;
+	border-left-width: 1px;
+	border-top-color: #E0E0E0;
+	border-right-color: #E0E0E0;
+	border-bottom-color: #E0E0E0;
+	border-left-color: #E0E0E0;
+	border-top-style: none;
+	border-right-style: none;
+	border-bottom-style: none;
+	border-left-style: none;
+	background-color: #FAFAFA;
+	font-size: 13px;
+}
+.memTemplParams {
+	padding: 1px 0px 0px 8px;
+	margin: 4px;
+	border-top-width: 1px;
+	border-right-width: 1px;
+	border-bottom-width: 1px;
+	border-left-width: 1px;
+	border-top-color: #E0E0E0;
+	border-right-color: #E0E0E0;
+	border-bottom-color: #E0E0E0;
+	border-left-color: #E0E0E0;
+	border-top-style: solid;
+	border-right-style: none;
+	border-bottom-style: none;
+	border-left-style: none;
+       color: #606060;
+	background-color: #FAFAFA;
+	font-size: 12px;
+}
+.search     { color: #003399;
+              font-weight: bold;
+}
+FORM.search {
+              margin-bottom: 0px;
+              margin-top: 0px;
+}
+INPUT.search { font-size: 75%;
+               color: #000080;
+               font-weight: normal;
+               background-color: #eeeeff;
+}
+TD.tiny      { font-size: 75%;
+}
+a {
+	color: #252E78;
+}
+a:visited {
+	color: #3D2185;
+}
Index: /libmpcdec/tags/release-1.2/include/Makefile.am
===================================================================
--- /libmpcdec/tags/release-1.2/include/Makefile.am	(revision 30)
+++ /libmpcdec/tags/release-1.2/include/Makefile.am	(revision 30)
@@ -0,0 +1,13 @@
+## 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/tags/release-1.2/include/config.h.in
===================================================================
--- /libmpcdec/tags/release-1.2/include/config.h.in	(revision 30)
+++ /libmpcdec/tags/release-1.2/include/config.h.in	(revision 30)
@@ -0,0 +1,104 @@
+/* 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/tags/release-1.2/include/mainpage.h
===================================================================
--- /libmpcdec/tags/release-1.2/include/mainpage.h	(revision 30)
+++ /libmpcdec/tags/release-1.2/include/mainpage.h	(revision 30)
@@ -0,0 +1,38 @@
+/**
+   \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/tags/release-1.2/include/mpcdec/config_types.h.in
===================================================================
--- /libmpcdec/tags/release-1.2/include/mpcdec/config_types.h.in	(revision 30)
+++ /libmpcdec/tags/release-1.2/include/mpcdec/config_types.h.in	(revision 30)
@@ -0,0 +1,48 @@
+/*
+  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/tags/release-1.2/include/mpcdec/config_win32.h
===================================================================
--- /libmpcdec/tags/release-1.2/include/mpcdec/config_win32.h	(revision 30)
+++ /libmpcdec/tags/release-1.2/include/mpcdec/config_win32.h	(revision 30)
@@ -0,0 +1,48 @@
+/*
+  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 __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;
+
+#endif // __MUSEPACK_CONFIG_WIN32_H__
Index: /libmpcdec/tags/release-1.2/include/mpcdec/decoder.h
===================================================================
--- /libmpcdec/tags/release-1.2/include/mpcdec/decoder.h	(revision 30)
+++ /libmpcdec/tags/release-1.2/include/mpcdec/decoder.h	(revision 30)
@@ -0,0 +1,148 @@
+/*
+  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"
+
+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; /// actually 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  FwdJumpInfo;
+    mpc_uint32_t  ActDecodePos;
+    mpc_uint32_t  FrameWasValid;
+
+    mpc_uint32_t  DecodedFrames;
+    mpc_uint32_t  OverallFrames;
+    mpc_int32_t   SampleRate;                 // Sample frequency
+
+    mpc_uint32_t  StreamVersion;              // version of bitstream
+    mpc_uint32_t  MS_used;                    // MS-coding used ?
+    mpc_int32_t   Max_Band;
+    mpc_uint32_t  MPCHeaderPos;               // AB: needed to support ID3v2
+    mpc_uint32_t  LastValidSamples;
+    mpc_uint32_t  TrueGaplessPresent;
+
+    mpc_uint32_t  EQ_activated;
+
+    mpc_uint32_t  WordsRead;                  // counts amount of decoded dwords
+
+    // randomizer state variables
+    mpc_uint32_t  __r1; 
+    mpc_uint32_t  __r2; 
+
+    mpc_uint32_t  Q_bit [32];     
+    mpc_uint32_t  Q_res [32][16];
+
+    // huffman table stuff
+    HuffmanTyp    HuffHdr  [10];
+    HuffmanTyp    HuffSCFI [ 4];
+    HuffmanTyp    HuffDSCF [16];
+    HuffmanTyp*   HuffQ [2] [8];
+
+    HuffmanTyp    HuffQ1 [2] [3*3*3];
+    HuffmanTyp    HuffQ2 [2] [5*5];
+    HuffmanTyp    HuffQ3 [2] [ 7];
+    HuffmanTyp    HuffQ4 [2] [ 9];
+    HuffmanTyp    HuffQ5 [2] [15];
+    HuffmanTyp    HuffQ6 [2] [31];
+    HuffmanTyp    HuffQ7 [2] [63];
+    const HuffmanTyp* SampleHuff [18];
+    HuffmanTyp    SCFI_Bundle   [ 8];
+    HuffmanTyp    DSCF_Entropie [13];
+    HuffmanTyp    Region_A [16];
+    HuffmanTyp    Region_B [ 8];
+    HuffmanTyp    Region_C [ 4];
+
+    HuffmanTyp    Entropie_1 [ 3];
+    HuffmanTyp    Entropie_2 [ 5];
+    HuffmanTyp    Entropie_3 [ 7];
+    HuffmanTyp    Entropie_4 [ 9];
+    HuffmanTyp    Entropie_5 [15];
+    HuffmanTyp    Entropie_6 [31];
+    HuffmanTyp    Entropie_7 [63];
+
+    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_int32_t   DSCF_Flag_L [32];
+    mpc_int32_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_int32_t   DSCF_Reference_L [32];
+    mpc_int32_t   DSCF_Reference_R [32];      // holds last frames SCF
+    mpc_int32_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/tags/release-1.2/include/mpcdec/huffman.h
===================================================================
--- /libmpcdec/tags/release-1.2/include/mpcdec/huffman.h	(revision 30)
+++ /libmpcdec/tags/release-1.2/include/mpcdec/huffman.h	(revision 30)
@@ -0,0 +1,80 @@
+/*
+  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_uint32_t  Length;
+    mpc_int32_t   Value;
+} HuffmanTyp;
+
+//! \brief Sorts huffman-tables by codeword.
+//!
+//! offset resulting value.
+//! \param elements
+//! \param Table table to sort
+//! \param offset offset of resulting sort
+void
+mpc_decoder_resort_huff_tables(
+    const mpc_uint32_t elements, HuffmanTyp *Table, const mpc_int32_t offset);
+
+/// Initializes sv6 huffman decoding structures.
+void mpc_decoder_init_huffman_sv6(struct mpc_decoder_t *d);
+
+/// Initializes sv6 huffman decoding tables.
+void mpc_decoder_init_huffman_sv6_tables(struct mpc_decoder_t *d);
+
+/// Initializes sv7 huffman decoding structures.
+void mpc_decoder_init_huffman_sv7(struct mpc_decoder_t *d);
+
+/// Initializes sv7 huffman decoding tables.
+void mpc_decoder_init_huffman_sv7_tables(struct mpc_decoder_t *d);
+
+#endif // _mpcdec_huffman_h_
Index: /libmpcdec/tags/release-1.2/include/mpcdec/internal.h
===================================================================
--- /libmpcdec/tags/release-1.2/include/mpcdec/internal.h	(revision 30)
+++ /libmpcdec/tags/release-1.2/include/mpcdec/internal.h	(revision 30)
@@ -0,0 +1,67 @@
+/*
+  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 swap32(mpc_uint32_t val) {
+    const unsigned char* src = (const unsigned char*)&val;
+    return 
+        (mpc_uint32_t)src[0] | 
+        ((mpc_uint32_t)src[1] << 8) | ((mpc_uint32_t)src[2] << 16) | ((mpc_uint32_t)src[3] << 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/tags/release-1.2/include/mpcdec/math.h
===================================================================
--- /libmpcdec/tags/release-1.2/include/mpcdec/math.h	(revision 30)
+++ /libmpcdec/tags/release-1.2/include/mpcdec/math.h	(revision 30)
@@ -0,0 +1,144 @@
+/*
+  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/tags/release-1.2/include/mpcdec/mpcdec.h
===================================================================
--- /libmpcdec/tags/release-1.2/include/mpcdec/mpcdec.h	(revision 30)
+++ /libmpcdec/tags/release-1.2/include/mpcdec/mpcdec.h	(revision 30)
@@ -0,0 +1,132 @@
+/*
+  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 mpcdec.h
+/// Top level include file for libmpcdec.
+
+#ifndef _mpcdec_h_
+#define _mpcdec_h_
+
+#ifdef __cplusplus
+extern "C" {
+#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);
+
+/// 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);
+
+/// 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);
+
+/// 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);
+
+/// Actually reads data from previously initialized stream.  Call
+/// this iteratively to decode the mpc stream.
+/// \param buffer destination buffer for decoded samples
+/// \param vbr_update_acc \todo document me
+/// \param vbr_update_bits \todo document me
+/// \return -1 if an error is encountered
+/// \return 0 if the stream has been completely decoded successfully and there are no more samples
+/// \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_SAMPLE_FORMAT *buffer, 
+    mpc_uint32_t *vbr_update_acc, 
+    mpc_uint32_t *vbr_update_bits);
+
+/// Seeks to the specified sample in the source stream.
+mpc_bool_t mpc_decoder_seek_sample(mpc_decoder *d, 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);
+
+#ifdef __cplusplus
+}
+#endif // __cplusplus
+
+#endif // _mpcdec_h_
Index: /libmpcdec/tags/release-1.2/include/mpcdec/reader.h
===================================================================
--- /libmpcdec/tags/release-1.2/include/mpcdec/reader.h	(revision 30)
+++ /libmpcdec/tags/release-1.2/include/mpcdec/reader.h	(revision 30)
@@ -0,0 +1,82 @@
+/*
+  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 reader.h
+
+#ifndef _mpcdec_reader_h_
+#define _mpcdec_reader_h_
+
+/// \brief Stream reader interface structure.
+///
+/// This is the structure you must supply to the musepack decoding library
+/// to feed it with raw data.  Implement the five member functions to provide
+/// a functional reader.
+typedef 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);
+
+    /// Seeks to byte position offset.
+	mpc_bool_t (*seek)(void *t, mpc_int32_t offset);
+
+    /// Returns the current byte offset in the stream.
+	mpc_int32_t (*tell)(void *t);
+
+    /// Returns the total length of the source stream, in bytes.
+	mpc_int32_t (*get_size)(void *t);
+
+    /// True if the stream is a seekable stream.
+	mpc_bool_t (*canseek)(void *t);
+
+    /// 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);
+
+#endif // _mpcdec_reader_h_
Index: /libmpcdec/tags/release-1.2/include/mpcdec/requant.h
===================================================================
--- /libmpcdec/tags/release-1.2/include/mpcdec/requant.h	(revision 30)
+++ /libmpcdec/tags/release-1.2/include/mpcdec/requant.h	(revision 30)
@@ -0,0 +1,51 @@
+/*
+  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/tags/release-1.2/include/mpcdec/streaminfo.h
===================================================================
--- /libmpcdec/tags/release-1.2/include/mpcdec/streaminfo.h	(revision 30)
+++ /libmpcdec/tags/release-1.2/include/mpcdec/streaminfo.h	(revision 30)
@@ -0,0 +1,86 @@
+/*
+  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 streaminfo.h
+
+#ifndef _mpcdec_streaminfo_h_
+#define _mpcdec_streaminfo_h_
+
+typedef mpc_int32_t mpc_streaminfo_off_t;
+
+/// \brief mpc stream properties structure
+///
+/// Structure containing all the properties of an mpc stream.  Populated
+/// by the streaminfo_read function.
+typedef struct mpc_streaminfo {
+    /// @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
+    //@}
+
+    /// @name replaygain related fields
+    //@{
+    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
+    //@{
+    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_streaminfo_off_t tag_offset;         ///< offset to file tags
+    mpc_streaminfo_off_t total_file_length;  ///< total length of underlying file
+    //@}
+} mpc_streaminfo;
+
+#endif // _mpcdec_streaminfo_h_
Index: /libmpcdec/tags/release-1.2/src/Makefile.am
===================================================================
--- /libmpcdec/tags/release-1.2/src/Makefile.am	(revision 30)
+++ /libmpcdec/tags/release-1.2/src/Makefile.am	(revision 30)
@@ -0,0 +1,21 @@
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+
+lib_LTLIBRARIES = libmpcdec.la
+
+libmpcdec_la_SOURCES = \
+	huffsv46.c \
+	huffsv7.c \
+	idtag.c \
+	mpc_decoder.c \
+	mpc_reader.c \
+	requant.c \
+	streaminfo.c \
+	synth_filter.c
+libmpcdec_la_LDFLAGS = -no-undefined -version-info 3:0:0
+
+noinst_PROGRAMS = sample
+sample_SOURCES = sample.cpp
+sample_LDADD = libmpcdec.la
+
Index: /libmpcdec/tags/release-1.2/src/huffsv46.c
===================================================================
--- /libmpcdec/tags/release-1.2/src/huffsv46.c	(revision 30)
+++ /libmpcdec/tags/release-1.2/src/huffsv46.c	(revision 30)
@@ -0,0 +1,268 @@
+/*
+  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 huffsv46.c
+/// Implementations of huffman decoding for streamversions < 7.
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/requant.h>
+#include <mpcdec/huffman.h>
+
+void
+mpc_decoder_init_huffman_sv6(mpc_decoder *d) 
+{
+    mpc_decoder_init_huffman_sv6_tables(d);
+    mpc_decoder_resort_huff_tables(16, d->Region_A      , 0);
+    mpc_decoder_resort_huff_tables( 8, d->Region_B      , 0);
+    mpc_decoder_resort_huff_tables( 4, d->Region_C      , 0);
+    mpc_decoder_resort_huff_tables( 8, d->SCFI_Bundle   , 0);
+    mpc_decoder_resort_huff_tables(13, d->DSCF_Entropie , 6);
+    mpc_decoder_resort_huff_tables( 3, d->Entropie_1    , Dc[1]);
+    mpc_decoder_resort_huff_tables( 5, d->Entropie_2    , Dc[2]);
+    mpc_decoder_resort_huff_tables( 7, d->Entropie_3    , Dc[3]);
+    mpc_decoder_resort_huff_tables( 9, d->Entropie_4    , Dc[4]);
+    mpc_decoder_resort_huff_tables(15, d->Entropie_5    , Dc[5]);
+    mpc_decoder_resort_huff_tables(31, d->Entropie_6    , Dc[6]);
+    mpc_decoder_resort_huff_tables(63, d->Entropie_7    , Dc[7]);
+}
+
+void 
+mpc_decoder_init_huffman_sv6_tables(mpc_decoder *d) 
+{
+    // SCFI-bundle
+    d->SCFI_Bundle[7].Code=  1; d->SCFI_Bundle[7].Length= 1;
+    d->SCFI_Bundle[3].Code=  1; d->SCFI_Bundle[3].Length= 2;
+    d->SCFI_Bundle[5].Code=  0; d->SCFI_Bundle[5].Length= 3;
+    d->SCFI_Bundle[1].Code=  7; d->SCFI_Bundle[1].Length= 5;
+    d->SCFI_Bundle[2].Code=  6; d->SCFI_Bundle[2].Length= 5;
+    d->SCFI_Bundle[4].Code=  4; d->SCFI_Bundle[4].Length= 5;
+    d->SCFI_Bundle[0].Code= 11; d->SCFI_Bundle[0].Length= 6;
+    d->SCFI_Bundle[6].Code= 10; d->SCFI_Bundle[6].Length= 6;
+
+    // region A (subbands  0..10)
+    d->Region_A[ 1].Code=    1; d->Region_A[ 1].Length=  1;
+    d->Region_A[ 2].Code=    0; d->Region_A[ 2].Length=  2;
+    d->Region_A[ 0].Code=    2; d->Region_A[ 0].Length=  3;
+    d->Region_A[ 3].Code=   15; d->Region_A[ 3].Length=  5;
+    d->Region_A[ 5].Code=   13; d->Region_A[ 5].Length=  5;
+    d->Region_A[ 6].Code=   12; d->Region_A[ 6].Length=  5;
+    d->Region_A[ 4].Code=   29; d->Region_A[ 4].Length=  6;
+    d->Region_A[ 7].Code=   57; d->Region_A[ 7].Length=  7;
+    d->Region_A[ 8].Code=  113; d->Region_A[ 8].Length=  8;
+    d->Region_A[ 9].Code=  225; d->Region_A[ 9].Length=  9;
+    d->Region_A[10].Code=  449; d->Region_A[10].Length= 10;
+    d->Region_A[11].Code=  897; d->Region_A[11].Length= 11;
+    d->Region_A[12].Code= 1793; d->Region_A[12].Length= 12;
+    d->Region_A[13].Code= 3585; d->Region_A[13].Length= 13;
+    d->Region_A[14].Code= 7169; d->Region_A[14].Length= 14;
+    d->Region_A[15].Code= 7168; d->Region_A[15].Length= 14;
+
+    // region B (subbands 11..22)
+    d->Region_B[1].Code= 1; d->Region_B[1].Length= 1;
+    d->Region_B[0].Code= 1; d->Region_B[0].Length= 2;
+    d->Region_B[2].Code= 1; d->Region_B[2].Length= 3;
+    d->Region_B[3].Code= 1; d->Region_B[3].Length= 4;
+    d->Region_B[4].Code= 1; d->Region_B[4].Length= 5;
+    d->Region_B[5].Code= 1; d->Region_B[5].Length= 6;
+    d->Region_B[6].Code= 1; d->Region_B[6].Length= 7;
+    d->Region_B[7].Code= 0; d->Region_B[7].Length= 7;
+
+    // region C (subbands 23..31)
+    d->Region_C[0].Code= 1; d->Region_C[0].Length= 1;
+    d->Region_C[1].Code= 1; d->Region_C[1].Length= 2;
+    d->Region_C[2].Code= 1; d->Region_C[2].Length= 3;
+    d->Region_C[3].Code= 0; d->Region_C[3].Length= 3;
+
+    // DSCF
+    d->DSCF_Entropie[ 6].Code=  0; d->DSCF_Entropie[ 6].Length= 2;
+    d->DSCF_Entropie[ 7].Code=  7; d->DSCF_Entropie[ 7].Length= 3;
+    d->DSCF_Entropie[ 5].Code=  4; d->DSCF_Entropie[ 5].Length= 3;
+    d->DSCF_Entropie[ 8].Code=  3; d->DSCF_Entropie[ 8].Length= 3;
+    d->DSCF_Entropie[ 9].Code= 13; d->DSCF_Entropie[ 9].Length= 4;
+    d->DSCF_Entropie[ 4].Code= 11; d->DSCF_Entropie[ 4].Length= 4;
+    d->DSCF_Entropie[10].Code= 10; d->DSCF_Entropie[10].Length= 4;
+    d->DSCF_Entropie[ 2].Code=  4; d->DSCF_Entropie[ 2].Length= 4;
+    d->DSCF_Entropie[11].Code= 25; d->DSCF_Entropie[11].Length= 5;
+    d->DSCF_Entropie[ 3].Code= 24; d->DSCF_Entropie[ 3].Length= 5;
+    d->DSCF_Entropie[ 1].Code= 11; d->DSCF_Entropie[ 1].Length= 5;
+    d->DSCF_Entropie[12].Code= 21; d->DSCF_Entropie[12].Length= 6;
+    d->DSCF_Entropie[ 0].Code= 20; d->DSCF_Entropie[ 0].Length= 6;
+
+    // first quantizer
+    d->Entropie_1[1].Code= 1; d->Entropie_1[1].Length= 1;
+    d->Entropie_1[0].Code= 1; d->Entropie_1[0].Length= 2;
+    d->Entropie_1[2].Code= 0; d->Entropie_1[2].Length= 2;
+
+    // second quantizer
+    d->Entropie_2[2].Code=  3; d->Entropie_2[2].Length= 2;
+    d->Entropie_2[3].Code=  1; d->Entropie_2[3].Length= 2;
+    d->Entropie_2[1].Code=  0; d->Entropie_2[1].Length= 2;
+    d->Entropie_2[4].Code=  5; d->Entropie_2[4].Length= 3;
+    d->Entropie_2[0].Code=  4; d->Entropie_2[0].Length= 3;
+
+    // third quantizer
+    d->Entropie_3[3].Code=  3; d->Entropie_3[3].Length= 2;
+    d->Entropie_3[2].Code=  1; d->Entropie_3[2].Length= 2;
+    d->Entropie_3[4].Code=  0; d->Entropie_3[4].Length= 2;
+    d->Entropie_3[1].Code=  5; d->Entropie_3[1].Length= 3;
+    d->Entropie_3[5].Code=  9; d->Entropie_3[5].Length= 4;
+    d->Entropie_3[0].Code= 17; d->Entropie_3[0].Length= 5;
+    d->Entropie_3[6].Code= 16; d->Entropie_3[6].Length= 5;
+
+    // forth quantizer
+    d->Entropie_4[4].Code=  0; d->Entropie_4[4].Length= 2;
+    d->Entropie_4[5].Code=  6; d->Entropie_4[5].Length= 3;
+    d->Entropie_4[3].Code=  5; d->Entropie_4[3].Length= 3;
+    d->Entropie_4[6].Code=  4; d->Entropie_4[6].Length= 3;
+    d->Entropie_4[2].Code=  3; d->Entropie_4[2].Length= 3;
+    d->Entropie_4[7].Code= 15; d->Entropie_4[7].Length= 4;
+    d->Entropie_4[1].Code= 14; d->Entropie_4[1].Length= 4;
+    d->Entropie_4[0].Code=  5; d->Entropie_4[0].Length= 4;
+    d->Entropie_4[8].Code=  4; d->Entropie_4[8].Length= 4;
+
+    // fifth quantizer
+    d->Entropie_5[7 ].Code=  4; d->Entropie_5[7 ].Length= 3;
+    d->Entropie_5[8 ].Code=  3; d->Entropie_5[8 ].Length= 3;
+    d->Entropie_5[6 ].Code=  2; d->Entropie_5[6 ].Length= 3;
+    d->Entropie_5[9 ].Code=  0; d->Entropie_5[9 ].Length= 3;
+    d->Entropie_5[5 ].Code= 15; d->Entropie_5[5 ].Length= 4;
+    d->Entropie_5[4 ].Code= 13; d->Entropie_5[4 ].Length= 4;
+    d->Entropie_5[10].Code= 12; d->Entropie_5[10].Length= 4;
+    d->Entropie_5[11].Code= 10; d->Entropie_5[11].Length= 4;
+    d->Entropie_5[3 ].Code=  3; d->Entropie_5[3 ].Length= 4;
+    d->Entropie_5[12].Code=  2; d->Entropie_5[12].Length= 4;
+    d->Entropie_5[2 ].Code= 29; d->Entropie_5[2 ].Length= 5;
+    d->Entropie_5[1 ].Code= 23; d->Entropie_5[1 ].Length= 5;
+    d->Entropie_5[13].Code= 22; d->Entropie_5[13].Length= 5;
+    d->Entropie_5[0 ].Code= 57; d->Entropie_5[0 ].Length= 6;
+    d->Entropie_5[14].Code= 56; d->Entropie_5[14].Length= 6;
+
+    // sixth quantizer
+    d->Entropie_6[15].Code=  9; d->Entropie_6[15].Length= 4;
+    d->Entropie_6[16].Code=  8; d->Entropie_6[16].Length= 4;
+    d->Entropie_6[14].Code=  7; d->Entropie_6[14].Length= 4;
+    d->Entropie_6[18].Code=  6; d->Entropie_6[18].Length= 4;
+    d->Entropie_6[17].Code=  5; d->Entropie_6[17].Length= 4;
+    d->Entropie_6[12].Code=  3; d->Entropie_6[12].Length= 4;
+    d->Entropie_6[13].Code=  2; d->Entropie_6[13].Length= 4;
+    d->Entropie_6[19].Code=  0; d->Entropie_6[19].Length= 4;
+    d->Entropie_6[11].Code= 31; d->Entropie_6[11].Length= 5;
+    d->Entropie_6[20].Code= 30; d->Entropie_6[20].Length= 5;
+    d->Entropie_6[10].Code= 29; d->Entropie_6[10].Length= 5;
+    d->Entropie_6[9 ].Code= 27; d->Entropie_6[9 ].Length= 5;
+    d->Entropie_6[21].Code= 26; d->Entropie_6[21].Length= 5;
+    d->Entropie_6[22].Code= 25; d->Entropie_6[22].Length= 5;
+    d->Entropie_6[8 ].Code= 24; d->Entropie_6[8 ].Length= 5;
+    d->Entropie_6[7 ].Code= 23; d->Entropie_6[7 ].Length= 5;
+    d->Entropie_6[23].Code= 21; d->Entropie_6[23].Length= 5;
+    d->Entropie_6[6 ].Code=  9; d->Entropie_6[6 ].Length= 5;
+    d->Entropie_6[24].Code=  3; d->Entropie_6[24].Length= 5;
+    d->Entropie_6[25].Code= 57; d->Entropie_6[25].Length= 6;
+    d->Entropie_6[5 ].Code= 56; d->Entropie_6[5 ].Length= 6;
+    d->Entropie_6[4 ].Code= 45; d->Entropie_6[4 ].Length= 6;
+    d->Entropie_6[26].Code= 41; d->Entropie_6[26].Length= 6;
+    d->Entropie_6[2 ].Code= 40; d->Entropie_6[2 ].Length= 6;
+    d->Entropie_6[27].Code= 17; d->Entropie_6[27].Length= 6;
+    d->Entropie_6[28].Code= 16; d->Entropie_6[28].Length= 6;
+    d->Entropie_6[3 ].Code=  5; d->Entropie_6[3 ].Length= 6;
+    d->Entropie_6[29].Code= 89; d->Entropie_6[29].Length= 7;
+    d->Entropie_6[1 ].Code= 88; d->Entropie_6[1 ].Length= 7;
+    d->Entropie_6[30].Code=  9; d->Entropie_6[30].Length= 7;
+    d->Entropie_6[0 ].Code=  8; d->Entropie_6[0 ].Length= 7;
+
+    // seventh quantizer
+    d->Entropie_7[25].Code=   0; d->Entropie_7[25].Length= 5;
+    d->Entropie_7[37].Code=   1; d->Entropie_7[37].Length= 5;
+    d->Entropie_7[62].Code=  16; d->Entropie_7[62].Length= 8;
+    d->Entropie_7[ 0].Code=  17; d->Entropie_7[ 0].Length= 8;
+    d->Entropie_7[ 3].Code=   9; d->Entropie_7[ 3].Length= 7;
+    d->Entropie_7[ 5].Code=  10; d->Entropie_7[ 5].Length= 7;
+    d->Entropie_7[ 6].Code=  11; d->Entropie_7[ 6].Length= 7;
+    d->Entropie_7[38].Code=   3; d->Entropie_7[38].Length= 5;
+    d->Entropie_7[35].Code=   4; d->Entropie_7[35].Length= 5;
+    d->Entropie_7[33].Code=   5; d->Entropie_7[33].Length= 5;
+    d->Entropie_7[24].Code=   6; d->Entropie_7[24].Length= 5;
+    d->Entropie_7[27].Code=   7; d->Entropie_7[27].Length= 5;
+    d->Entropie_7[26].Code=   8; d->Entropie_7[26].Length= 5;
+    d->Entropie_7[12].Code=  18; d->Entropie_7[12].Length= 6;
+    d->Entropie_7[50].Code=  19; d->Entropie_7[50].Length= 6;
+    d->Entropie_7[29].Code=  10; d->Entropie_7[29].Length= 5;
+    d->Entropie_7[31].Code=  11; d->Entropie_7[31].Length= 5;
+    d->Entropie_7[36].Code=  12; d->Entropie_7[36].Length= 5;
+    d->Entropie_7[34].Code=  13; d->Entropie_7[34].Length= 5;
+    d->Entropie_7[28].Code=  14; d->Entropie_7[28].Length= 5;
+    d->Entropie_7[49].Code=  30; d->Entropie_7[49].Length= 6;
+    d->Entropie_7[56].Code=  62; d->Entropie_7[56].Length= 7;
+    d->Entropie_7[ 7].Code=  63; d->Entropie_7[ 7].Length= 7;
+    d->Entropie_7[32].Code=  16; d->Entropie_7[32].Length= 5;
+    d->Entropie_7[30].Code=  17; d->Entropie_7[30].Length= 5;
+    d->Entropie_7[13].Code=  36; d->Entropie_7[13].Length= 6;
+    d->Entropie_7[55].Code=  74; d->Entropie_7[55].Length= 7;
+    d->Entropie_7[61].Code= 150; d->Entropie_7[61].Length= 8;
+    d->Entropie_7[ 1].Code= 151; d->Entropie_7[ 1].Length= 8;
+    d->Entropie_7[14].Code=  38; d->Entropie_7[14].Length= 6;
+    d->Entropie_7[48].Code=  39; d->Entropie_7[48].Length= 6;
+    d->Entropie_7[ 4].Code=  80; d->Entropie_7[ 4].Length= 7;
+    d->Entropie_7[58].Code=  81; d->Entropie_7[58].Length= 7;
+    d->Entropie_7[47].Code=  41; d->Entropie_7[47].Length= 6;
+    d->Entropie_7[15].Code=  42; d->Entropie_7[15].Length= 6;
+    d->Entropie_7[16].Code=  43; d->Entropie_7[16].Length= 6;
+    d->Entropie_7[54].Code=  88; d->Entropie_7[54].Length= 7;
+    d->Entropie_7[ 8].Code=  89; d->Entropie_7[ 8].Length= 7;
+    d->Entropie_7[17].Code=  45; d->Entropie_7[17].Length= 6;
+    d->Entropie_7[46].Code=  46; d->Entropie_7[46].Length= 6;
+    d->Entropie_7[45].Code=  47; d->Entropie_7[45].Length= 6;
+    d->Entropie_7[53].Code=  96; d->Entropie_7[53].Length= 7;
+    d->Entropie_7[ 9].Code=  97; d->Entropie_7[ 9].Length= 7;
+    d->Entropie_7[43].Code=  49; d->Entropie_7[43].Length= 6;
+    d->Entropie_7[19].Code=  50; d->Entropie_7[19].Length= 6;
+    d->Entropie_7[18].Code=  51; d->Entropie_7[18].Length= 6;
+    d->Entropie_7[44].Code=  52; d->Entropie_7[44].Length= 6;
+    d->Entropie_7[ 2].Code= 212; d->Entropie_7[ 2].Length= 8;
+    d->Entropie_7[60].Code= 213; d->Entropie_7[60].Length= 8;
+    d->Entropie_7[10].Code= 107; d->Entropie_7[10].Length= 7;
+    d->Entropie_7[42].Code=  54; d->Entropie_7[42].Length= 6;
+    d->Entropie_7[41].Code=  55; d->Entropie_7[41].Length= 6;
+    d->Entropie_7[20].Code=  56; d->Entropie_7[20].Length= 6;
+    d->Entropie_7[21].Code=  57; d->Entropie_7[21].Length= 6;
+    d->Entropie_7[52].Code= 116; d->Entropie_7[52].Length= 7;
+    d->Entropie_7[51].Code= 117; d->Entropie_7[51].Length= 7;
+    d->Entropie_7[40].Code=  59; d->Entropie_7[40].Length= 6;
+    d->Entropie_7[22].Code=  60; d->Entropie_7[22].Length= 6;
+    d->Entropie_7[23].Code=  61; d->Entropie_7[23].Length= 6;
+    d->Entropie_7[39].Code=  62; d->Entropie_7[39].Length= 6;
+    d->Entropie_7[11].Code= 126; d->Entropie_7[11].Length= 7;
+    d->Entropie_7[57].Code= 254; d->Entropie_7[57].Length= 8;
+    d->Entropie_7[59].Code= 255; d->Entropie_7[59].Length= 8;
+}
Index: /libmpcdec/tags/release-1.2/src/huffsv7.c
===================================================================
--- /libmpcdec/tags/release-1.2/src/huffsv7.c	(revision 30)
+++ /libmpcdec/tags/release-1.2/src/huffsv7.c	(revision 30)
@@ -0,0 +1,500 @@
+/*
+  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 huffsv7.c
+/// Implementations of sv7 huffman decoding functions.
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/huffman.h>
+#include <mpcdec/requant.h>
+
+void
+mpc_decoder_init_huffman_sv7(mpc_decoder *d) 
+{
+    mpc_decoder_init_huffman_sv7_tables(d);
+    mpc_decoder_resort_huff_tables(10, &(d->HuffHdr[0])   , 5);
+    mpc_decoder_resort_huff_tables( 4, &(d->HuffSCFI[0])  , 0);
+    mpc_decoder_resort_huff_tables(16, &(d->HuffDSCF[0])  , 7);
+    mpc_decoder_resort_huff_tables(27, &(d->HuffQ1[0][0]) , 0);
+    mpc_decoder_resort_huff_tables(27, &(d->HuffQ1[1][0]) , 0);
+    mpc_decoder_resort_huff_tables(25, &(d->HuffQ2[0][0]) , 0);
+    mpc_decoder_resort_huff_tables(25, &(d->HuffQ2[1][0]) , 0);
+    mpc_decoder_resort_huff_tables( 7, &(d->HuffQ3[0][0]) , Dc[3]);
+    mpc_decoder_resort_huff_tables( 7, &(d->HuffQ3[1][0]) , Dc[3]);
+    mpc_decoder_resort_huff_tables( 9, &(d->HuffQ4[0][0]) , Dc[4]);
+    mpc_decoder_resort_huff_tables( 9, &(d->HuffQ4[1][0]) , Dc[4]);
+    mpc_decoder_resort_huff_tables(15, &(d->HuffQ5[0][0]) , Dc[5]);
+    mpc_decoder_resort_huff_tables(15, &(d->HuffQ5[1][0]) , Dc[5]);
+    mpc_decoder_resort_huff_tables(31, &(d->HuffQ6[0][0]) , Dc[6]);
+    mpc_decoder_resort_huff_tables(31, &(d->HuffQ6[1][0]) , Dc[6]);
+    mpc_decoder_resort_huff_tables(63, &(d->HuffQ7[0][0]) , Dc[7]);
+    mpc_decoder_resort_huff_tables(63, &(d->HuffQ7[1][0]) , Dc[7]);
+}
+
+void 
+mpc_decoder_init_huffman_sv7_tables(mpc_decoder *d) 
+{
+    /***************************** SCFI *******************************/
+    d->HuffSCFI[0].Code = 2; d->HuffSCFI[0].Length = 3;
+    d->HuffSCFI[1].Code = 1; d->HuffSCFI[1].Length = 1;
+    d->HuffSCFI[2].Code = 3; d->HuffSCFI[2].Length = 3;
+    d->HuffSCFI[3].Code = 0; d->HuffSCFI[3].Length = 2;
+
+    /***************************** DSCF *******************************/
+    d->HuffDSCF[ 0].Code = 32; d->HuffDSCF[ 0].Length = 6;
+    d->HuffDSCF[ 1].Code =  4; d->HuffDSCF[ 1].Length = 5;
+    d->HuffDSCF[ 2].Code = 17; d->HuffDSCF[ 2].Length = 5;
+    d->HuffDSCF[ 3].Code = 30; d->HuffDSCF[ 3].Length = 5;
+    d->HuffDSCF[ 4].Code = 13; d->HuffDSCF[ 4].Length = 4;
+    d->HuffDSCF[ 5].Code =  0; d->HuffDSCF[ 5].Length = 3;
+    d->HuffDSCF[ 6].Code =  3; d->HuffDSCF[ 6].Length = 3;
+    d->HuffDSCF[ 7].Code =  9; d->HuffDSCF[ 7].Length = 4;
+    d->HuffDSCF[ 8].Code =  5; d->HuffDSCF[ 8].Length = 3;
+    d->HuffDSCF[ 9].Code =  2; d->HuffDSCF[ 9].Length = 3;
+    d->HuffDSCF[10].Code = 14; d->HuffDSCF[10].Length = 4;
+    d->HuffDSCF[11].Code =  3; d->HuffDSCF[11].Length = 4;
+    d->HuffDSCF[12].Code = 31; d->HuffDSCF[12].Length = 5;
+    d->HuffDSCF[13].Code =  5; d->HuffDSCF[13].Length = 5;
+    d->HuffDSCF[14].Code = 33; d->HuffDSCF[14].Length = 6;
+    d->HuffDSCF[15].Code = 12; d->HuffDSCF[15].Length = 4;
+
+    /************************* frame-header ***************************/
+    /***************** differential quantizer indizes *****************/
+    d->HuffHdr[0].Code =  92; d->HuffHdr[0].Length = 8;
+    d->HuffHdr[1].Code =  47; d->HuffHdr[1].Length = 7;
+    d->HuffHdr[2].Code =  10; d->HuffHdr[2].Length = 5;
+    d->HuffHdr[3].Code =   4; d->HuffHdr[3].Length = 4;
+    d->HuffHdr[4].Code =   0; d->HuffHdr[4].Length = 2;
+    d->HuffHdr[5].Code =   1; d->HuffHdr[5].Length = 1;
+    d->HuffHdr[6].Code =   3; d->HuffHdr[6].Length = 3;
+    d->HuffHdr[7].Code =  22; d->HuffHdr[7].Length = 6;
+    d->HuffHdr[8].Code = 187; d->HuffHdr[8].Length = 9;
+    d->HuffHdr[9].Code = 186; d->HuffHdr[9].Length = 9;
+
+    /********************** 3-step quantizer **************************/
+    /********************* 3 bundled samples **************************/
+    //less shaped, book 0
+    d->HuffQ1[0][ 0].Code = 54; d->HuffQ1[0][ 0].Length = 6;
+    d->HuffQ1[0][ 1].Code =  9; d->HuffQ1[0][ 1].Length = 5;
+    d->HuffQ1[0][ 2].Code = 32; d->HuffQ1[0][ 2].Length = 6;
+    d->HuffQ1[0][ 3].Code =  5; d->HuffQ1[0][ 3].Length = 5;
+    d->HuffQ1[0][ 4].Code = 10; d->HuffQ1[0][ 4].Length = 4;
+    d->HuffQ1[0][ 5].Code =  7; d->HuffQ1[0][ 5].Length = 5;
+    d->HuffQ1[0][ 6].Code = 52; d->HuffQ1[0][ 6].Length = 6;
+    d->HuffQ1[0][ 7].Code =  0; d->HuffQ1[0][ 7].Length = 5;
+    d->HuffQ1[0][ 8].Code = 35; d->HuffQ1[0][ 8].Length = 6;
+    d->HuffQ1[0][ 9].Code = 10; d->HuffQ1[0][ 9].Length = 5;
+    d->HuffQ1[0][10].Code =  6; d->HuffQ1[0][10].Length = 4;
+    d->HuffQ1[0][11].Code =  4; d->HuffQ1[0][11].Length = 5;
+    d->HuffQ1[0][12].Code = 11; d->HuffQ1[0][12].Length = 4;
+    d->HuffQ1[0][13].Code =  7; d->HuffQ1[0][13].Length = 3;
+    d->HuffQ1[0][14].Code = 12; d->HuffQ1[0][14].Length = 4;
+    d->HuffQ1[0][15].Code =  3; d->HuffQ1[0][15].Length = 5;
+    d->HuffQ1[0][16].Code =  7; d->HuffQ1[0][16].Length = 4;
+    d->HuffQ1[0][17].Code = 11; d->HuffQ1[0][17].Length = 5;
+    d->HuffQ1[0][18].Code = 34; d->HuffQ1[0][18].Length = 6;
+    d->HuffQ1[0][19].Code =  1; d->HuffQ1[0][19].Length = 5;
+    d->HuffQ1[0][20].Code = 53; d->HuffQ1[0][20].Length = 6;
+    d->HuffQ1[0][21].Code =  6; d->HuffQ1[0][21].Length = 5;
+    d->HuffQ1[0][22].Code =  9; d->HuffQ1[0][22].Length = 4;
+    d->HuffQ1[0][23].Code =  2; d->HuffQ1[0][23].Length = 5;
+    d->HuffQ1[0][24].Code = 33; d->HuffQ1[0][24].Length = 6;
+    d->HuffQ1[0][25].Code =  8; d->HuffQ1[0][25].Length = 5;
+    d->HuffQ1[0][26].Code = 55; d->HuffQ1[0][26].Length = 6;
+
+    //more shaped, book 1
+    d->HuffQ1[1][ 0].Code = 103; d->HuffQ1[1][ 0].Length = 8;
+    d->HuffQ1[1][ 1].Code =  62; d->HuffQ1[1][ 1].Length = 7;
+    d->HuffQ1[1][ 2].Code = 225; d->HuffQ1[1][ 2].Length = 9;
+    d->HuffQ1[1][ 3].Code =  55; d->HuffQ1[1][ 3].Length = 7;
+    d->HuffQ1[1][ 4].Code =   3; d->HuffQ1[1][ 4].Length = 4;
+    d->HuffQ1[1][ 5].Code =  52; d->HuffQ1[1][ 5].Length = 7;
+    d->HuffQ1[1][ 6].Code = 101; d->HuffQ1[1][ 6].Length = 8;
+    d->HuffQ1[1][ 7].Code =  60; d->HuffQ1[1][ 7].Length = 7;
+    d->HuffQ1[1][ 8].Code = 227; d->HuffQ1[1][ 8].Length = 9;
+    d->HuffQ1[1][ 9].Code =  24; d->HuffQ1[1][ 9].Length = 6;
+    d->HuffQ1[1][10].Code =   0; d->HuffQ1[1][10].Length = 4;
+    d->HuffQ1[1][11].Code =  61; d->HuffQ1[1][11].Length = 7;
+    d->HuffQ1[1][12].Code =   4; d->HuffQ1[1][12].Length = 4;
+    d->HuffQ1[1][13].Code =   1; d->HuffQ1[1][13].Length = 1;
+    d->HuffQ1[1][14].Code =   5; d->HuffQ1[1][14].Length = 4;
+    d->HuffQ1[1][15].Code =  63; d->HuffQ1[1][15].Length = 7;
+    d->HuffQ1[1][16].Code =   1; d->HuffQ1[1][16].Length = 4;
+    d->HuffQ1[1][17].Code =  59; d->HuffQ1[1][17].Length = 7;
+    d->HuffQ1[1][18].Code = 226; d->HuffQ1[1][18].Length = 9;
+    d->HuffQ1[1][19].Code =  57; d->HuffQ1[1][19].Length = 7;
+    d->HuffQ1[1][20].Code = 100; d->HuffQ1[1][20].Length = 8;
+    d->HuffQ1[1][21].Code =  53; d->HuffQ1[1][21].Length = 7;
+    d->HuffQ1[1][22].Code =   2; d->HuffQ1[1][22].Length = 4;
+    d->HuffQ1[1][23].Code =  54; d->HuffQ1[1][23].Length = 7;
+    d->HuffQ1[1][24].Code = 224; d->HuffQ1[1][24].Length = 9;
+    d->HuffQ1[1][25].Code =  58; d->HuffQ1[1][25].Length = 7;
+    d->HuffQ1[1][26].Code = 102; d->HuffQ1[1][26].Length = 8;
+
+    /********************** 5-step quantizer **************************/
+    /********************* 2 bundled samples **************************/
+    //less shaped, book 0
+    d->HuffQ2[0][ 0].Code =  89; d->HuffQ2[0][ 0].Length = 7;
+    d->HuffQ2[0][ 1].Code =  47; d->HuffQ2[0][ 1].Length = 6;
+    d->HuffQ2[0][ 2].Code =  15; d->HuffQ2[0][ 2].Length = 5;
+    d->HuffQ2[0][ 3].Code =   0; d->HuffQ2[0][ 3].Length = 5;
+    d->HuffQ2[0][ 4].Code =  91; d->HuffQ2[0][ 4].Length = 7;
+    d->HuffQ2[0][ 5].Code =   4; d->HuffQ2[0][ 5].Length = 5;
+    d->HuffQ2[0][ 6].Code =   6; d->HuffQ2[0][ 6].Length = 4;
+    d->HuffQ2[0][ 7].Code =  13; d->HuffQ2[0][ 7].Length = 4;
+    d->HuffQ2[0][ 8].Code =   4; d->HuffQ2[0][ 8].Length = 4;
+    d->HuffQ2[0][ 9].Code =   5; d->HuffQ2[0][ 9].Length = 5;
+    d->HuffQ2[0][10].Code =  20; d->HuffQ2[0][10].Length = 5;
+    d->HuffQ2[0][11].Code =  12; d->HuffQ2[0][11].Length = 4;
+    d->HuffQ2[0][12].Code =   4; d->HuffQ2[0][12].Length = 3;
+    d->HuffQ2[0][13].Code =  15; d->HuffQ2[0][13].Length = 4;
+    d->HuffQ2[0][14].Code =  14; d->HuffQ2[0][14].Length = 5;
+    d->HuffQ2[0][15].Code =   3; d->HuffQ2[0][15].Length = 5;
+    d->HuffQ2[0][16].Code =   3; d->HuffQ2[0][16].Length = 4;
+    d->HuffQ2[0][17].Code =  14; d->HuffQ2[0][17].Length = 4;
+    d->HuffQ2[0][18].Code =   5; d->HuffQ2[0][18].Length = 4;
+    d->HuffQ2[0][19].Code =   1; d->HuffQ2[0][19].Length = 5;
+    d->HuffQ2[0][20].Code =  90; d->HuffQ2[0][20].Length = 7;
+    d->HuffQ2[0][21].Code =   2; d->HuffQ2[0][21].Length = 5;
+    d->HuffQ2[0][22].Code =  21; d->HuffQ2[0][22].Length = 5;
+    d->HuffQ2[0][23].Code =  46; d->HuffQ2[0][23].Length = 6;
+    d->HuffQ2[0][24].Code =  88; d->HuffQ2[0][24].Length = 7;
+
+    //more shaped, book 1
+    d->HuffQ2[1][ 0].Code =  921; d->HuffQ2[1][ 0].Length = 10;
+    d->HuffQ2[1][ 1].Code =  113; d->HuffQ2[1][ 1].Length =  7;
+    d->HuffQ2[1][ 2].Code =   51; d->HuffQ2[1][ 2].Length =  6;
+    d->HuffQ2[1][ 3].Code =  231; d->HuffQ2[1][ 3].Length =  8;
+    d->HuffQ2[1][ 4].Code =  922; d->HuffQ2[1][ 4].Length = 10;
+    d->HuffQ2[1][ 5].Code =  104; d->HuffQ2[1][ 5].Length =  7;
+    d->HuffQ2[1][ 6].Code =   30; d->HuffQ2[1][ 6].Length =  5;
+    d->HuffQ2[1][ 7].Code =    0; d->HuffQ2[1][ 7].Length =  3;
+    d->HuffQ2[1][ 8].Code =   29; d->HuffQ2[1][ 8].Length =  5;
+    d->HuffQ2[1][ 9].Code =  105; d->HuffQ2[1][ 9].Length =  7;
+    d->HuffQ2[1][10].Code =   50; d->HuffQ2[1][10].Length =  6;
+    d->HuffQ2[1][11].Code =    1; d->HuffQ2[1][11].Length =  3;
+    d->HuffQ2[1][12].Code =    2; d->HuffQ2[1][12].Length =  2;
+    d->HuffQ2[1][13].Code =    3; d->HuffQ2[1][13].Length =  3;
+    d->HuffQ2[1][14].Code =   49; d->HuffQ2[1][14].Length =  6;
+    d->HuffQ2[1][15].Code =  107; d->HuffQ2[1][15].Length =  7;
+    d->HuffQ2[1][16].Code =   27; d->HuffQ2[1][16].Length =  5;
+    d->HuffQ2[1][17].Code =    2; d->HuffQ2[1][17].Length =  3;
+    d->HuffQ2[1][18].Code =   31; d->HuffQ2[1][18].Length =  5;
+    d->HuffQ2[1][19].Code =  112; d->HuffQ2[1][19].Length =  7;
+    d->HuffQ2[1][20].Code =  920; d->HuffQ2[1][20].Length = 10;
+    d->HuffQ2[1][21].Code =  106; d->HuffQ2[1][21].Length =  7;
+    d->HuffQ2[1][22].Code =   48; d->HuffQ2[1][22].Length =  6;
+    d->HuffQ2[1][23].Code =  114; d->HuffQ2[1][23].Length =  7;
+    d->HuffQ2[1][24].Code =  923; d->HuffQ2[1][24].Length = 10;
+
+    /********************** 7-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ3[0][0].Code = 12; d->HuffQ3[0][0].Length = 4;
+    d->HuffQ3[0][1].Code =  4; d->HuffQ3[0][1].Length = 3;
+    d->HuffQ3[0][2].Code =  0; d->HuffQ3[0][2].Length = 2;
+    d->HuffQ3[0][3].Code =  1; d->HuffQ3[0][3].Length = 2;
+    d->HuffQ3[0][4].Code =  7; d->HuffQ3[0][4].Length = 3;
+    d->HuffQ3[0][5].Code =  5; d->HuffQ3[0][5].Length = 3;
+    d->HuffQ3[0][6].Code = 13; d->HuffQ3[0][6].Length = 4;
+
+    //more shaped, book 1
+    d->HuffQ3[1][0].Code = 4; d->HuffQ3[1][0].Length = 5;
+    d->HuffQ3[1][1].Code = 3; d->HuffQ3[1][1].Length = 4;
+    d->HuffQ3[1][2].Code = 2; d->HuffQ3[1][2].Length = 2;
+    d->HuffQ3[1][3].Code = 3; d->HuffQ3[1][3].Length = 2;
+    d->HuffQ3[1][4].Code = 1; d->HuffQ3[1][4].Length = 2;
+    d->HuffQ3[1][5].Code = 0; d->HuffQ3[1][5].Length = 3;
+    d->HuffQ3[1][6].Code = 5; d->HuffQ3[1][6].Length = 5;
+
+    /********************** 9-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ4[0][0].Code = 5; d->HuffQ4[0][0].Length = 4;
+    d->HuffQ4[0][1].Code = 0; d->HuffQ4[0][1].Length = 3;
+    d->HuffQ4[0][2].Code = 4; d->HuffQ4[0][2].Length = 3;
+    d->HuffQ4[0][3].Code = 6; d->HuffQ4[0][3].Length = 3;
+    d->HuffQ4[0][4].Code = 7; d->HuffQ4[0][4].Length = 3;
+    d->HuffQ4[0][5].Code = 5; d->HuffQ4[0][5].Length = 3;
+    d->HuffQ4[0][6].Code = 3; d->HuffQ4[0][6].Length = 3;
+    d->HuffQ4[0][7].Code = 1; d->HuffQ4[0][7].Length = 3;
+    d->HuffQ4[0][8].Code = 4; d->HuffQ4[0][8].Length = 4;
+
+    //more shaped, book 1
+    d->HuffQ4[1][0].Code =  9; d->HuffQ4[1][0].Length = 5;
+    d->HuffQ4[1][1].Code = 12; d->HuffQ4[1][1].Length = 4;
+    d->HuffQ4[1][2].Code =  3; d->HuffQ4[1][2].Length = 3;
+    d->HuffQ4[1][3].Code =  0; d->HuffQ4[1][3].Length = 2;
+    d->HuffQ4[1][4].Code =  2; d->HuffQ4[1][4].Length = 2;
+    d->HuffQ4[1][5].Code =  7; d->HuffQ4[1][5].Length = 3;
+    d->HuffQ4[1][6].Code = 13; d->HuffQ4[1][6].Length = 4;
+    d->HuffQ4[1][7].Code =  5; d->HuffQ4[1][7].Length = 4;
+    d->HuffQ4[1][8].Code =  8; d->HuffQ4[1][8].Length = 5;
+
+    /********************* 15-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ5[0][ 0].Code = 57; d->HuffQ5[0][ 0].Length = 6;
+    d->HuffQ5[0][ 1].Code = 23; d->HuffQ5[0][ 1].Length = 5;
+    d->HuffQ5[0][ 2].Code =  8; d->HuffQ5[0][ 2].Length = 4;
+    d->HuffQ5[0][ 3].Code = 10; d->HuffQ5[0][ 3].Length = 4;
+    d->HuffQ5[0][ 4].Code = 13; d->HuffQ5[0][ 4].Length = 4;
+    d->HuffQ5[0][ 5].Code =  0; d->HuffQ5[0][ 5].Length = 3;
+    d->HuffQ5[0][ 6].Code =  2; d->HuffQ5[0][ 6].Length = 3;
+    d->HuffQ5[0][ 7].Code =  3; d->HuffQ5[0][ 7].Length = 3;
+    d->HuffQ5[0][ 8].Code =  1; d->HuffQ5[0][ 8].Length = 3;
+    d->HuffQ5[0][ 9].Code = 15; d->HuffQ5[0][ 9].Length = 4;
+    d->HuffQ5[0][10].Code = 12; d->HuffQ5[0][10].Length = 4;
+    d->HuffQ5[0][11].Code =  9; d->HuffQ5[0][11].Length = 4;
+    d->HuffQ5[0][12].Code = 29; d->HuffQ5[0][12].Length = 5;
+    d->HuffQ5[0][13].Code = 22; d->HuffQ5[0][13].Length = 5;
+    d->HuffQ5[0][14].Code = 56; d->HuffQ5[0][14].Length = 6;
+
+    //more shaped, book 1
+    d->HuffQ5[1][ 0].Code = 229; d->HuffQ5[1][ 0].Length = 8;
+    d->HuffQ5[1][ 1].Code =  56; d->HuffQ5[1][ 1].Length = 6;
+    d->HuffQ5[1][ 2].Code =   7; d->HuffQ5[1][ 2].Length = 5;
+    d->HuffQ5[1][ 3].Code =   2; d->HuffQ5[1][ 3].Length = 4;
+    d->HuffQ5[1][ 4].Code =   0; d->HuffQ5[1][ 4].Length = 3;
+    d->HuffQ5[1][ 5].Code =   3; d->HuffQ5[1][ 5].Length = 3;
+    d->HuffQ5[1][ 6].Code =   5; d->HuffQ5[1][ 6].Length = 3;
+    d->HuffQ5[1][ 7].Code =   6; d->HuffQ5[1][ 7].Length = 3;
+    d->HuffQ5[1][ 8].Code =   4; d->HuffQ5[1][ 8].Length = 3;
+    d->HuffQ5[1][ 9].Code =   2; d->HuffQ5[1][ 9].Length = 3;
+    d->HuffQ5[1][10].Code =  15; d->HuffQ5[1][10].Length = 4;
+    d->HuffQ5[1][11].Code =  29; d->HuffQ5[1][11].Length = 5;
+    d->HuffQ5[1][12].Code =   6; d->HuffQ5[1][12].Length = 5;
+    d->HuffQ5[1][13].Code = 115; d->HuffQ5[1][13].Length = 7;
+    d->HuffQ5[1][14].Code = 228; d->HuffQ5[1][14].Length = 8;
+
+    /********************* 31-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ6[0][ 0].Code =  65; d->HuffQ6[0][ 0].Length = 7;
+    d->HuffQ6[0][ 1].Code =   6; d->HuffQ6[0][ 1].Length = 6;
+    d->HuffQ6[0][ 2].Code =  44; d->HuffQ6[0][ 2].Length = 6;
+    d->HuffQ6[0][ 3].Code =  45; d->HuffQ6[0][ 3].Length = 6;
+    d->HuffQ6[0][ 4].Code =  59; d->HuffQ6[0][ 4].Length = 6;
+    d->HuffQ6[0][ 5].Code =  13; d->HuffQ6[0][ 5].Length = 5;
+    d->HuffQ6[0][ 6].Code =  17; d->HuffQ6[0][ 6].Length = 5;
+    d->HuffQ6[0][ 7].Code =  19; d->HuffQ6[0][ 7].Length = 5;
+    d->HuffQ6[0][ 8].Code =  23; d->HuffQ6[0][ 8].Length = 5;
+    d->HuffQ6[0][ 9].Code =  21; d->HuffQ6[0][ 9].Length = 5;
+    d->HuffQ6[0][10].Code =  26; d->HuffQ6[0][10].Length = 5;
+    d->HuffQ6[0][11].Code =  30; d->HuffQ6[0][11].Length = 5;
+    d->HuffQ6[0][12].Code =   0; d->HuffQ6[0][12].Length = 4;
+    d->HuffQ6[0][13].Code =   2; d->HuffQ6[0][13].Length = 4;
+    d->HuffQ6[0][14].Code =   5; d->HuffQ6[0][14].Length = 4;
+    d->HuffQ6[0][15].Code =   7; d->HuffQ6[0][15].Length = 4;
+    d->HuffQ6[0][16].Code =   3; d->HuffQ6[0][16].Length = 4;
+    d->HuffQ6[0][17].Code =   4; d->HuffQ6[0][17].Length = 4;
+    d->HuffQ6[0][18].Code =  31; d->HuffQ6[0][18].Length = 5;
+    d->HuffQ6[0][19].Code =  28; d->HuffQ6[0][19].Length = 5;
+    d->HuffQ6[0][20].Code =  25; d->HuffQ6[0][20].Length = 5;
+    d->HuffQ6[0][21].Code =  27; d->HuffQ6[0][21].Length = 5;
+    d->HuffQ6[0][22].Code =  24; d->HuffQ6[0][22].Length = 5;
+    d->HuffQ6[0][23].Code =  20; d->HuffQ6[0][23].Length = 5;
+    d->HuffQ6[0][24].Code =  18; d->HuffQ6[0][24].Length = 5;
+    d->HuffQ6[0][25].Code =  12; d->HuffQ6[0][25].Length = 5;
+    d->HuffQ6[0][26].Code =   2; d->HuffQ6[0][26].Length = 5;
+    d->HuffQ6[0][27].Code =  58; d->HuffQ6[0][27].Length = 6;
+    d->HuffQ6[0][28].Code =  33; d->HuffQ6[0][28].Length = 6;
+    d->HuffQ6[0][29].Code =   7; d->HuffQ6[0][29].Length = 6;
+    d->HuffQ6[0][30].Code =  64; d->HuffQ6[0][30].Length = 7;
+
+    //more shaped, book 1
+    d->HuffQ6[1][ 0].Code = 6472; d->HuffQ6[1][ 0].Length = 13;
+    d->HuffQ6[1][ 1].Code = 6474; d->HuffQ6[1][ 1].Length = 13;
+    d->HuffQ6[1][ 2].Code =  808; d->HuffQ6[1][ 2].Length = 10;
+    d->HuffQ6[1][ 3].Code =  405; d->HuffQ6[1][ 3].Length =  9;
+    d->HuffQ6[1][ 4].Code =  203; d->HuffQ6[1][ 4].Length =  8;
+    d->HuffQ6[1][ 5].Code =  102; d->HuffQ6[1][ 5].Length =  7;
+    d->HuffQ6[1][ 6].Code =   49; d->HuffQ6[1][ 6].Length =  6;
+    d->HuffQ6[1][ 7].Code =    9; d->HuffQ6[1][ 7].Length =  5;
+    d->HuffQ6[1][ 8].Code =   15; d->HuffQ6[1][ 8].Length =  5;
+    d->HuffQ6[1][ 9].Code =   31; d->HuffQ6[1][ 9].Length =  5;
+    d->HuffQ6[1][10].Code =    2; d->HuffQ6[1][10].Length =  4;
+    d->HuffQ6[1][11].Code =    6; d->HuffQ6[1][11].Length =  4;
+    d->HuffQ6[1][12].Code =    8; d->HuffQ6[1][12].Length =  4;
+    d->HuffQ6[1][13].Code =   11; d->HuffQ6[1][13].Length =  4;
+    d->HuffQ6[1][14].Code =   13; d->HuffQ6[1][14].Length =  4;
+    d->HuffQ6[1][15].Code =    0; d->HuffQ6[1][15].Length =  3;
+    d->HuffQ6[1][16].Code =   14; d->HuffQ6[1][16].Length =  4;
+    d->HuffQ6[1][17].Code =   10; d->HuffQ6[1][17].Length =  4;
+    d->HuffQ6[1][18].Code =    9; d->HuffQ6[1][18].Length =  4;
+    d->HuffQ6[1][19].Code =    5; d->HuffQ6[1][19].Length =  4;
+    d->HuffQ6[1][20].Code =    3; d->HuffQ6[1][20].Length =  4;
+    d->HuffQ6[1][21].Code =   30; d->HuffQ6[1][21].Length =  5;
+    d->HuffQ6[1][22].Code =   14; d->HuffQ6[1][22].Length =  5;
+    d->HuffQ6[1][23].Code =    8; d->HuffQ6[1][23].Length =  5;
+    d->HuffQ6[1][24].Code =   48; d->HuffQ6[1][24].Length =  6;
+    d->HuffQ6[1][25].Code =  103; d->HuffQ6[1][25].Length =  7;
+    d->HuffQ6[1][26].Code =  201; d->HuffQ6[1][26].Length =  8;
+    d->HuffQ6[1][27].Code =  200; d->HuffQ6[1][27].Length =  8;
+    d->HuffQ6[1][28].Code = 1619; d->HuffQ6[1][28].Length = 11;
+    d->HuffQ6[1][29].Code = 6473; d->HuffQ6[1][29].Length = 13;
+    d->HuffQ6[1][30].Code = 6475; d->HuffQ6[1][30].Length = 13;
+
+    /********************* 63-step quantizer **************************/
+    /*********************** single samples ***************************/
+    //less shaped, book 0
+    d->HuffQ7[0][ 0].Code = 103; d->HuffQ7[0][ 0].Length = 8;    /* 0.003338  -          01100111  */
+    d->HuffQ7[0][ 1].Code = 153; d->HuffQ7[0][ 1].Length = 8;    /* 0.003766  -          10011001  */
+    d->HuffQ7[0][ 2].Code = 181; d->HuffQ7[0][ 2].Length = 8;    /* 0.004715  -          10110101  */
+    d->HuffQ7[0][ 3].Code = 233; d->HuffQ7[0][ 3].Length = 8;    /* 0.005528  -          11101001  */
+    d->HuffQ7[0][ 4].Code =  64; d->HuffQ7[0][ 4].Length = 7;    /* 0.006677  -           1000000  */
+    d->HuffQ7[0][ 5].Code =  65; d->HuffQ7[0][ 5].Length = 7;    /* 0.007041  -           1000001  */
+    d->HuffQ7[0][ 6].Code =  77; d->HuffQ7[0][ 6].Length = 7;    /* 0.007733  -           1001101  */
+    d->HuffQ7[0][ 7].Code =  81; d->HuffQ7[0][ 7].Length = 7;    /* 0.008296  -           1010001  */
+    d->HuffQ7[0][ 8].Code =  91; d->HuffQ7[0][ 8].Length = 7;    /* 0.009295  -           1011011  */
+    d->HuffQ7[0][ 9].Code = 113; d->HuffQ7[0][ 9].Length = 7;    /* 0.010814  -           1110001  */
+    d->HuffQ7[0][10].Code = 112; d->HuffQ7[0][10].Length = 7;    /* 0.010807  -           1110000  */
+    d->HuffQ7[0][11].Code =  24; d->HuffQ7[0][11].Length = 6;    /* 0.012748  -            011000  */
+    d->HuffQ7[0][12].Code =  29; d->HuffQ7[0][12].Length = 6;    /* 0.013390  -            011101  */
+    d->HuffQ7[0][13].Code =  35; d->HuffQ7[0][13].Length = 6;    /* 0.014224  -            100011  */
+    d->HuffQ7[0][14].Code =  37; d->HuffQ7[0][14].Length = 6;    /* 0.015201  -            100101  */
+    d->HuffQ7[0][15].Code =  41; d->HuffQ7[0][15].Length = 6;    /* 0.016642  -            101001  */
+    d->HuffQ7[0][16].Code =  44; d->HuffQ7[0][16].Length = 6;    /* 0.017292  -            101100  */
+    d->HuffQ7[0][17].Code =  46; d->HuffQ7[0][17].Length = 6;    /* 0.018647  -            101110  */
+    d->HuffQ7[0][18].Code =  51; d->HuffQ7[0][18].Length = 6;    /* 0.020473  -            110011  */
+    d->HuffQ7[0][19].Code =  49; d->HuffQ7[0][19].Length = 6;    /* 0.020152  -            110001  */
+    d->HuffQ7[0][20].Code =  54; d->HuffQ7[0][20].Length = 6;    /* 0.021315  -            110110  */
+    d->HuffQ7[0][21].Code =  55; d->HuffQ7[0][21].Length = 6;    /* 0.021358  -            110111  */
+    d->HuffQ7[0][22].Code =  57; d->HuffQ7[0][22].Length = 6;    /* 0.021700  -            111001  */
+    d->HuffQ7[0][23].Code =  60; d->HuffQ7[0][23].Length = 6;    /* 0.022449  -            111100  */
+    d->HuffQ7[0][24].Code =   0; d->HuffQ7[0][24].Length = 5;    /* 0.023063  -             00000  */
+    d->HuffQ7[0][25].Code =   2; d->HuffQ7[0][25].Length = 5;    /* 0.023854  -             00010  */
+    d->HuffQ7[0][26].Code =  10; d->HuffQ7[0][26].Length = 5;    /* 0.025481  -             01010  */
+    d->HuffQ7[0][27].Code =   5; d->HuffQ7[0][27].Length = 5;    /* 0.024867  -             00101  */
+    d->HuffQ7[0][28].Code =   9; d->HuffQ7[0][28].Length = 5;    /* 0.025352  -             01001  */
+    d->HuffQ7[0][29].Code =   6; d->HuffQ7[0][29].Length = 5;    /* 0.025074  -             00110  */
+    d->HuffQ7[0][30].Code =  13; d->HuffQ7[0][30].Length = 5;    /* 0.025745  -             01101  */
+    d->HuffQ7[0][31].Code =   7; d->HuffQ7[0][31].Length = 5;    /* 0.025195  -             00111  */
+    d->HuffQ7[0][32].Code =  11; d->HuffQ7[0][32].Length = 5;    /* 0.025502  -             01011  */
+    d->HuffQ7[0][33].Code =  15; d->HuffQ7[0][33].Length = 5;    /* 0.026251  -             01111  */
+    d->HuffQ7[0][34].Code =   8; d->HuffQ7[0][34].Length = 5;    /* 0.025260  -             01000  */
+    d->HuffQ7[0][35].Code =   4; d->HuffQ7[0][35].Length = 5;    /* 0.024418  -             00100  */
+    d->HuffQ7[0][36].Code =   3; d->HuffQ7[0][36].Length = 5;    /* 0.023983  -             00011  */
+    d->HuffQ7[0][37].Code =   1; d->HuffQ7[0][37].Length = 5;    /* 0.023697  -             00001  */
+    d->HuffQ7[0][38].Code =  63; d->HuffQ7[0][38].Length = 6;    /* 0.023041  -            111111  */
+    d->HuffQ7[0][39].Code =  62; d->HuffQ7[0][39].Length = 6;    /* 0.022656  -            111110  */
+    d->HuffQ7[0][40].Code =  61; d->HuffQ7[0][40].Length = 6;    /* 0.022549  -            111101  */
+    d->HuffQ7[0][41].Code =  53; d->HuffQ7[0][41].Length = 6;    /* 0.021151  -            110101  */
+    d->HuffQ7[0][42].Code =  59; d->HuffQ7[0][42].Length = 6;    /* 0.022042  -            111011  */
+    d->HuffQ7[0][43].Code =  52; d->HuffQ7[0][43].Length = 6;    /* 0.020837  -            110100  */
+    d->HuffQ7[0][44].Code =  48; d->HuffQ7[0][44].Length = 6;    /* 0.019446  -            110000  */
+    d->HuffQ7[0][45].Code =  47; d->HuffQ7[0][45].Length = 6;    /* 0.019189  -            101111  */
+    d->HuffQ7[0][46].Code =  43; d->HuffQ7[0][46].Length = 6;    /* 0.017177  -            101011  */
+    d->HuffQ7[0][47].Code =  42; d->HuffQ7[0][47].Length = 6;    /* 0.017035  -            101010  */
+    d->HuffQ7[0][48].Code =  39; d->HuffQ7[0][48].Length = 6;    /* 0.015287  -            100111  */
+    d->HuffQ7[0][49].Code =  36; d->HuffQ7[0][49].Length = 6;    /* 0.014559  -            100100  */
+    d->HuffQ7[0][50].Code =  33; d->HuffQ7[0][50].Length = 6;    /* 0.014117  -            100001  */
+    d->HuffQ7[0][51].Code =  28; d->HuffQ7[0][51].Length = 6;    /* 0.012776  -            011100  */
+    d->HuffQ7[0][52].Code = 117; d->HuffQ7[0][52].Length = 7;    /* 0.011107  -           1110101  */
+    d->HuffQ7[0][53].Code = 101; d->HuffQ7[0][53].Length = 7;    /* 0.010636  -           1100101  */
+    d->HuffQ7[0][54].Code = 100; d->HuffQ7[0][54].Length = 7;    /* 0.009751  -           1100100  */
+    d->HuffQ7[0][55].Code =  80; d->HuffQ7[0][55].Length = 7;    /* 0.008132  -           1010000  */
+    d->HuffQ7[0][56].Code =  69; d->HuffQ7[0][56].Length = 7;    /* 0.007091  -           1000101  */
+    d->HuffQ7[0][57].Code =  68; d->HuffQ7[0][57].Length = 7;    /* 0.007084  -           1000100  */
+    d->HuffQ7[0][58].Code =  50; d->HuffQ7[0][58].Length = 7;    /* 0.006277  -           0110010  */
+    d->HuffQ7[0][59].Code = 232; d->HuffQ7[0][59].Length = 8;    /* 0.005386  -          11101000  */
+    d->HuffQ7[0][60].Code = 180; d->HuffQ7[0][60].Length = 8;    /* 0.004408  -          10110100  */
+    d->HuffQ7[0][61].Code = 152; d->HuffQ7[0][61].Length = 8;    /* 0.003759  -          10011000  */
+    d->HuffQ7[0][62].Code = 102; d->HuffQ7[0][62].Length = 8;    /* 0.003160  -          01100110  */
+
+    //more shaped, book 1
+    d->HuffQ7[1][ 0].Code = 14244; d->HuffQ7[1][ 0].Length = 14;    /* 0.000059  -        11011110100100  */
+    d->HuffQ7[1][ 1].Code = 14253; d->HuffQ7[1][ 1].Length = 14;    /* 0.000098  -        11011110101101  */
+    d->HuffQ7[1][ 2].Code = 14246; d->HuffQ7[1][ 2].Length = 14;    /* 0.000078  -        11011110100110  */
+    d->HuffQ7[1][ 3].Code = 14254; d->HuffQ7[1][ 3].Length = 14;    /* 0.000111  -        11011110101110  */
+    d->HuffQ7[1][ 4].Code =  3562; d->HuffQ7[1][ 4].Length = 12;    /* 0.000320  -          110111101010  */
+    d->HuffQ7[1][ 5].Code =   752; d->HuffQ7[1][ 5].Length = 10;    /* 0.000920  -            1011110000  */
+    d->HuffQ7[1][ 6].Code =   753; d->HuffQ7[1][ 6].Length = 10;    /* 0.001057  -            1011110001  */
+    d->HuffQ7[1][ 7].Code =   160; d->HuffQ7[1][ 7].Length =  9;    /* 0.001403  -             010100000  */
+    d->HuffQ7[1][ 8].Code =   162; d->HuffQ7[1][ 8].Length =  9;    /* 0.001579  -             010100010  */
+    d->HuffQ7[1][ 9].Code =   444; d->HuffQ7[1][ 9].Length =  9;    /* 0.002486  -             110111100  */
+    d->HuffQ7[1][10].Code =   122; d->HuffQ7[1][10].Length =  8;    /* 0.003772  -              01111010  */
+    d->HuffQ7[1][11].Code =   223; d->HuffQ7[1][11].Length =  8;    /* 0.005710  -              11011111  */
+    d->HuffQ7[1][12].Code =    60; d->HuffQ7[1][12].Length =  7;    /* 0.006858  -               0111100  */
+    d->HuffQ7[1][13].Code =    73; d->HuffQ7[1][13].Length =  7;    /* 0.008033  -               1001001  */
+    d->HuffQ7[1][14].Code =   110; d->HuffQ7[1][14].Length =  7;    /* 0.009827  -               1101110  */
+    d->HuffQ7[1][15].Code =    14; d->HuffQ7[1][15].Length =  6;    /* 0.012601  -                001110  */
+    d->HuffQ7[1][16].Code =    24; d->HuffQ7[1][16].Length =  6;    /* 0.013194  -                011000  */
+    d->HuffQ7[1][17].Code =    25; d->HuffQ7[1][17].Length =  6;    /* 0.013938  -                011001  */
+    d->HuffQ7[1][18].Code =    34; d->HuffQ7[1][18].Length =  6;    /* 0.015693  -                100010  */
+    d->HuffQ7[1][19].Code =    37; d->HuffQ7[1][19].Length =  6;    /* 0.017846  -                100101  */
+    d->HuffQ7[1][20].Code =    54; d->HuffQ7[1][20].Length =  6;    /* 0.020078  -                110110  */
+    d->HuffQ7[1][21].Code =     3; d->HuffQ7[1][21].Length =  5;    /* 0.022975  -                 00011  */
+    d->HuffQ7[1][22].Code =     9; d->HuffQ7[1][22].Length =  5;    /* 0.025631  -                 01001  */
+    d->HuffQ7[1][23].Code =    11; d->HuffQ7[1][23].Length =  5;    /* 0.027021  -                 01011  */
+    d->HuffQ7[1][24].Code =    16; d->HuffQ7[1][24].Length =  5;    /* 0.031465  -                 10000  */
+    d->HuffQ7[1][25].Code =    19; d->HuffQ7[1][25].Length =  5;    /* 0.034244  -                 10011  */
+    d->HuffQ7[1][26].Code =    21; d->HuffQ7[1][26].Length =  5;    /* 0.035921  -                 10101  */
+    d->HuffQ7[1][27].Code =    24; d->HuffQ7[1][27].Length =  5;    /* 0.037938  -                 11000  */
+    d->HuffQ7[1][28].Code =    26; d->HuffQ7[1][28].Length =  5;    /* 0.039595  -                 11010  */
+    d->HuffQ7[1][29].Code =    29; d->HuffQ7[1][29].Length =  5;    /* 0.041546  -                 11101  */
+    d->HuffQ7[1][30].Code =    31; d->HuffQ7[1][30].Length =  5;    /* 0.042623  -                 11111  */
+    d->HuffQ7[1][31].Code =     2; d->HuffQ7[1][31].Length =  4;    /* 0.045180  -                  0010  */
+    d->HuffQ7[1][32].Code =     0; d->HuffQ7[1][32].Length =  4;    /* 0.043151  -                  0000  */
+    d->HuffQ7[1][33].Code =    30; d->HuffQ7[1][33].Length =  5;    /* 0.042538  -                 11110  */
+    d->HuffQ7[1][34].Code =    28; d->HuffQ7[1][34].Length =  5;    /* 0.041422  -                 11100  */
+    d->HuffQ7[1][35].Code =    25; d->HuffQ7[1][35].Length =  5;    /* 0.039145  -                 11001  */
+    d->HuffQ7[1][36].Code =    22; d->HuffQ7[1][36].Length =  5;    /* 0.036691  -                 10110  */
+    d->HuffQ7[1][37].Code =    20; d->HuffQ7[1][37].Length =  5;    /* 0.034955  -                 10100  */
+    d->HuffQ7[1][38].Code =    14; d->HuffQ7[1][38].Length =  5;    /* 0.029155  -                 01110  */
+    d->HuffQ7[1][39].Code =    13; d->HuffQ7[1][39].Length =  5;    /* 0.027921  -                 01101  */
+    d->HuffQ7[1][40].Code =     8; d->HuffQ7[1][40].Length =  5;    /* 0.025553  -                 01000  */
+    d->HuffQ7[1][41].Code =     6; d->HuffQ7[1][41].Length =  5;    /* 0.023093  -                 00110  */
+    d->HuffQ7[1][42].Code =     2; d->HuffQ7[1][42].Length =  5;    /* 0.021200  -                 00010  */
+    d->HuffQ7[1][43].Code =    46; d->HuffQ7[1][43].Length =  6;    /* 0.018134  -                101110  */
+    d->HuffQ7[1][44].Code =    35; d->HuffQ7[1][44].Length =  6;    /* 0.015824  -                100011  */
+    d->HuffQ7[1][45].Code =    31; d->HuffQ7[1][45].Length =  6;    /* 0.014701  -                011111  */
+    d->HuffQ7[1][46].Code =    21; d->HuffQ7[1][46].Length =  6;    /* 0.013187  -                010101  */
+    d->HuffQ7[1][47].Code =    15; d->HuffQ7[1][47].Length =  6;    /* 0.012776  -                001111  */
+    d->HuffQ7[1][48].Code =    95; d->HuffQ7[1][48].Length =  7;    /* 0.009664  -               1011111  */
+    d->HuffQ7[1][49].Code =    72; d->HuffQ7[1][49].Length =  7;    /* 0.007922  -               1001000  */
+    d->HuffQ7[1][50].Code =    41; d->HuffQ7[1][50].Length =  7;    /* 0.006838  -               0101001  */
+    d->HuffQ7[1][51].Code =   189; d->HuffQ7[1][51].Length =  8;    /* 0.005024  -              10111101  */
+    d->HuffQ7[1][52].Code =   123; d->HuffQ7[1][52].Length =  8;    /* 0.003830  -              01111011  */
+    d->HuffQ7[1][53].Code =   377; d->HuffQ7[1][53].Length =  9;    /* 0.002232  -             101111001  */
+    d->HuffQ7[1][54].Code =   161; d->HuffQ7[1][54].Length =  9;    /* 0.001566  -             010100001  */
+    d->HuffQ7[1][55].Code =   891; d->HuffQ7[1][55].Length = 10;    /* 0.001383  -            1101111011  */
+    d->HuffQ7[1][56].Code =   327; d->HuffQ7[1][56].Length = 10;    /* 0.000900  -            0101000111  */
+    d->HuffQ7[1][57].Code =   326; d->HuffQ7[1][57].Length = 10;    /* 0.000790  -            0101000110  */
+    d->HuffQ7[1][58].Code =  3560; d->HuffQ7[1][58].Length = 12;    /* 0.000254  -          110111101000  */
+    d->HuffQ7[1][59].Code = 14255; d->HuffQ7[1][59].Length = 14;    /* 0.000117  -        11011110101111  */
+    d->HuffQ7[1][60].Code = 14247; d->HuffQ7[1][60].Length = 14;    /* 0.000085  -        11011110100111  */
+    d->HuffQ7[1][61].Code = 14252; d->HuffQ7[1][61].Length = 14;    /* 0.000085  -        11011110101100  */
+    d->HuffQ7[1][62].Code = 14245; d->HuffQ7[1][62].Length = 14;    /* 0.000065  -        11011110100101  */
+}
Index: /libmpcdec/tags/release-1.2/src/idtag.c
===================================================================
--- /libmpcdec/tags/release-1.2/src/idtag.c	(revision 30)
+++ /libmpcdec/tags/release-1.2/src/idtag.c	(revision 30)
@@ -0,0 +1,83 @@
+/*
+  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 idtag.c
+/// Rudimentary id3tag handling routines, just enough to skip id3v2 tags,
+/// if present.
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/internal.h>
+
+mpc_int32_t
+JumpID3v2 (mpc_reader* r) {
+    unsigned char  tmp [10];
+    mpc_uint32_t   Unsynchronisation;   // ID3v2.4-flag
+    mpc_uint32_t   ExtHeaderPresent;    // ID3v2.4-flag
+    mpc_uint32_t   ExperimentalFlag;    // ID3v2.4-flag
+    mpc_uint32_t   FooterPresent;       // ID3v2.4-flag
+    mpc_int32_t    ret;
+
+    // seek to first byte of mpc data
+    if (!r->seek (r->data, 0)) {
+        return 0;  
+    }
+    
+    r->read(r->data, tmp, sizeof(tmp));
+
+    // check id3-tag
+    if ( 0 != memcmp ( tmp, "ID3", 3) )
+        return 0;
+
+    // read flags
+    Unsynchronisation = tmp[5] & 0x80;
+    ExtHeaderPresent  = tmp[5] & 0x40;
+    ExperimentalFlag  = tmp[5] & 0x20;
+    FooterPresent     = tmp[5] & 0x10;
+
+    if ( tmp[5] & 0x0F )
+        return -1;              // not (yet???) allowed
+    if ( (tmp[6] | tmp[7] | tmp[8] | tmp[9]) & 0x80 )
+        return -1;              // not allowed
+
+    // read HeaderSize (syncsave: 4 * $0xxxxxxx = 28 significant bits)
+    ret  = tmp[6] << 21;
+    ret += tmp[7] << 14;
+    ret += tmp[8] <<  7;
+    ret += tmp[9]      ;
+    ret += 10;
+    if ( FooterPresent )
+        ret += 10;
+
+    return ret;
+}
Index: /libmpcdec/tags/release-1.2/src/mpc_decoder.c
===================================================================
--- /libmpcdec/tags/release-1.2/src/mpc_decoder.c	(revision 30)
+++ /libmpcdec/tags/release-1.2/src/mpc_decoder.c	(revision 30)
@@ -0,0 +1,1349 @@
+/*
+  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 mpc_decoder.c
+/// Core decoding routines and logic.
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/internal.h>
+#include <mpcdec/requant.h>
+#include <mpcdec/huffman.h>
+
+//------------------------------------------------------------------------------
+// types
+//------------------------------------------------------------------------------
+enum
+    {
+        EQ_TAP = 13,                        // length of FIR filter for EQ
+        DELAY = ((EQ_TAP + 1) / 2),         // delay of FIR
+        FIR_BANDS = 4,                      // number of subbands to be FIR filtered
+        MEMSIZE = MPC_DECODER_MEMSIZE,      // overall buffer size
+        MEMSIZE2 = (MEMSIZE/2),             // size of one buffer
+        MEMMASK = (MEMSIZE-1)
+    };
+
+//------------------------------------------------------------------------------
+// forward declarations
+//------------------------------------------------------------------------------
+void mpc_decoder_init_huffman_sv6(mpc_decoder *d);
+void mpc_decoder_init_huffman_sv7(mpc_decoder *d);
+void mpc_decoder_read_bitstream_sv6(mpc_decoder *d);
+void mpc_decoder_read_bitstream_sv7(mpc_decoder *d);
+void mpc_decoder_update_buffer(mpc_decoder *d, mpc_uint32_t RING);
+mpc_bool_t mpc_decoder_seek_sample(mpc_decoder *d, mpc_int64_t destsample);
+void mpc_decoder_requantisierung(mpc_decoder *d, const mpc_int32_t Last_Band);
+
+//------------------------------------------------------------------------------
+// utility functions
+//------------------------------------------------------------------------------
+static mpc_int32_t f_read(mpc_decoder *d, void *ptr, size_t size) 
+{ 
+    return d->r->read(d->r->data, ptr, size); 
+};
+
+static mpc_bool_t f_seek(mpc_decoder *d, mpc_int32_t offset) 
+{ 
+    return d->r->seek(d->r->data, offset); 
+};
+
+static mpc_int32_t f_read_dword(mpc_decoder *d, mpc_uint32_t * ptr, mpc_uint32_t count) 
+{
+    count = f_read(d, ptr, count << 2) >> 2;
+#ifndef MPC_LITTLE_ENDIAN
+    mpc_uint32_t n;
+    for(n = 0; n< count; n++) {
+        ptr[n] = swap32(ptr[n]);
+    }
+#endif
+    return count;
+}
+
+//------------------------------------------------------------------------------
+// huffman & bitstream functions
+//------------------------------------------------------------------------------
+static const mpc_uint32_t mask [33] = {
+    0x00000000, 0x00000001, 0x00000003, 0x00000007,
+    0x0000000F, 0x0000001F, 0x0000003F, 0x0000007F,
+    0x000000FF, 0x000001FF, 0x000003FF, 0x000007FF,
+    0x00000FFF, 0x00001FFF, 0x00003FFF, 0x00007FFF,
+    0x0000FFFF, 0x0001FFFF, 0x0003FFFF, 0x0007FFFF,
+    0x000FFFFF, 0x001FFFFF, 0x003FFFFF, 0x007FFFFF,
+    0x00FFFFFF, 0x01FFFFFF, 0x03FFFFFF, 0x07FFFFFF,
+    0x0FFFFFFF, 0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF,
+    0xFFFFFFFF
+};
+
+/* F U N C T I O N S */
+
+// resets bitstream decoding
+static void
+mpc_decoder_reset_bitstream_decode(mpc_decoder *d) 
+{
+    d->dword = 0;
+    d->pos = 0;
+    d->Zaehler = 0;
+    d->WordsRead = 0;
+}
+
+// reports the number of read bits
+static mpc_uint32_t
+mpc_decoder_bits_read(mpc_decoder *d) 
+{
+    return 32 * d->WordsRead + d->pos;
+}
+
+// read desired number of bits out of the bitstream
+static mpc_uint32_t
+mpc_decoder_bitstream_read(mpc_decoder *d, const mpc_uint32_t bits) 
+{
+    mpc_uint32_t out = d->dword;
+
+    d->pos += bits;
+
+    if (d->pos < 32) {
+        out >>= (32 - d->pos);
+    }
+    else {
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
+        d->pos -= 32;
+        if (d->pos) {
+            out <<= d->pos;
+            out |= d->dword >> (32 - d->pos);
+        }
+        ++(d->WordsRead);
+    }
+
+    return out & mask[bits];
+}
+
+// decode SCFI-bundle (sv4,5,6)
+static void
+mpc_decoder_scfi_bundle_read(
+    mpc_decoder *d,
+    HuffmanTyp* Table, mpc_int32_t* SCFI, mpc_int32_t* DSCF) 
+{
+    // load preview and decode
+    mpc_uint32_t code  = d->dword << d->pos;
+    if (d->pos > 26) {
+        code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
+    }
+    while (code < Table->Code) {
+        Table++;
+    }
+
+    // set the new position within bitstream without performing a dummy-read
+    if ((d->pos += Table->Length) >= 32) {
+        d->pos -= 32;
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler+1) & MEMMASK];
+        ++(d->WordsRead);
+    }
+
+    *SCFI = Table->Value >> 1;
+    *DSCF = Table->Value &  1;
+}
+
+static int
+mpc_decoder_huffman_typ_cmpfn(const void* p1, const void* p2)
+{
+    if (((HuffmanTyp*) p1)->Code < ((HuffmanTyp*) p2)->Code ) return +1;
+    if (((HuffmanTyp*) p1)->Code > ((HuffmanTyp*) p2)->Code ) return -1;
+    return 0;
+}
+
+// sort huffman-tables by codeword
+// offset resulting value
+void
+mpc_decoder_resort_huff_tables(
+    const mpc_uint32_t elements, HuffmanTyp* Table, const mpc_int32_t offset ) 
+{
+    mpc_uint32_t  i;
+
+    for ( i = 0; i < elements; i++ ) {
+        Table[i].Code <<= 32 - Table[i].Length;
+        Table[i].Value  =  i - offset;
+    }
+    qsort(Table, elements, sizeof(*Table), mpc_decoder_huffman_typ_cmpfn);
+}
+
+// basic huffman decoding routine
+// works with maximum lengths up to 14
+static mpc_int32_t
+mpc_decoder_huffman_decode(mpc_decoder *d, const HuffmanTyp *Table) 
+{
+    // load preview and decode
+    mpc_uint32_t code = d->dword << d->pos;
+    if (d->pos > 18) {
+        code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
+    }
+    while (code < Table->Code) {
+        Table++;
+    }
+
+    // set the new position within bitstream without performing a dummy-read
+    if ((d->pos += Table->Length) >= 32) {
+        d->pos -= 32;
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
+        ++(d->WordsRead);
+    }
+
+    return Table->Value;
+}
+
+// faster huffman through previewing less bits
+// works with maximum lengths up to 10
+static mpc_int32_t
+mpc_decoder_huffman_decode_fast(mpc_decoder *d, const HuffmanTyp* Table)
+{
+    // load preview and decode
+    mpc_uint32_t code  = d->dword << d->pos;
+    if (d->pos > 22) {
+        code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
+    }
+    while (code < Table->Code) {
+        Table++;
+    }
+
+    // set the new position within bitstream without performing a dummy-read
+    if ((d->pos += Table->Length) >= 32) {
+        d->pos -= 32;
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
+        ++(d->WordsRead);
+    }
+
+    return Table->Value;
+}
+
+// even faster huffman through previewing even less bits
+// works with maximum lengths up to 5
+static mpc_int32_t
+mpc_decoder_huffman_decode_faster(mpc_decoder *d, const HuffmanTyp* Table)
+{
+    // load preview and decode
+    mpc_uint32_t code  = d->dword << d->pos;
+    if (d->pos > 27) {
+        code |= d->Speicher[(d->Zaehler + 1) & MEMMASK] >> (32 - d->pos);
+    }
+    while (code < Table->Code) {
+        Table++;
+    }
+
+    // set the new position within bitstream without performing a dummy-read
+    if ((d->pos += Table->Length) >= 32) {
+        d->pos -= 32;
+        d->dword = d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK];
+        ++(d->WordsRead);
+    }
+
+    return Table->Value;
+}
+
+static void
+mpc_decoder_reset_v(mpc_decoder *d) 
+{
+    memset(d->V_L, 0, sizeof d->V_L);
+    memset(d->V_R, 0, sizeof d->V_R);
+}
+
+static void
+mpc_decoder_reset_synthesis(mpc_decoder *d) 
+{
+    mpc_decoder_reset_v(d);
+}
+
+static void
+mpc_decoder_reset_y(mpc_decoder *d) 
+{
+    memset(d->Y_L, 0, sizeof d->Y_L);
+    memset(d->Y_R, 0, sizeof d->Y_R);
+}
+
+static void
+mpc_decoder_reset_globals(mpc_decoder *d) 
+{
+    mpc_decoder_reset_bitstream_decode(d);
+
+    d->DecodedFrames  = 0;
+    d->StreamVersion  = 0;
+    d->MS_used        = 0;
+
+    memset(d->Y_L          , 0, sizeof d->Y_L           );
+    memset(d->Y_R          , 0, sizeof d->Y_R           );
+    memset(d->SCF_Index_L     , 0, sizeof d->SCF_Index_L      );
+    memset(d->SCF_Index_R     , 0, sizeof d->SCF_Index_R      );
+    memset(d->Res_L           , 0, sizeof d->Res_L            );
+    memset(d->Res_R           , 0, sizeof d->Res_R            );
+    memset(d->SCFI_L          , 0, sizeof d->SCFI_L           );
+    memset(d->SCFI_R          , 0, sizeof d->SCFI_R           );
+    memset(d->DSCF_Flag_L     , 0, sizeof d->DSCF_Flag_L      );
+    memset(d->DSCF_Flag_R     , 0, sizeof d->DSCF_Flag_R      );
+    memset(d->DSCF_Reference_L, 0, sizeof d->DSCF_Reference_L );
+    memset(d->DSCF_Reference_R, 0, sizeof d->DSCF_Reference_R );
+    memset(d->Q               , 0, sizeof d->Q                );
+    memset(d->MS_Flag         , 0, sizeof d->MS_Flag          );
+}
+
+static mpc_uint32_t
+mpc_decoder_decode_internal(mpc_decoder *d, MPC_SAMPLE_FORMAT *buffer) 
+{
+    mpc_uint32_t output_frame_length = MPC_FRAME_LENGTH;
+
+    mpc_uint32_t  FrameBitCnt = 0;
+
+    if (d->DecodedFrames >= d->OverallFrames) {
+        return (mpc_uint32_t)(-1);                           // end of file -> abort decoding
+    }
+
+    // read jump-info for validity check of frame
+    d->FwdJumpInfo  = mpc_decoder_bitstream_read(d, 20);
+
+    d->ActDecodePos = (d->Zaehler << 5) + d->pos;
+
+    // decode data and check for validity of frame
+    FrameBitCnt = mpc_decoder_bits_read(d);
+    switch (d->StreamVersion) {
+    case 0x04:
+    case 0x05:
+    case 0x06:
+        mpc_decoder_read_bitstream_sv6(d);
+        break;
+    case 0x07:
+    case 0x17:
+        mpc_decoder_read_bitstream_sv7(d);
+        break;
+    default:
+        return (mpc_uint32_t)(-1);
+    }
+    d->FrameWasValid = mpc_decoder_bits_read(d) - FrameBitCnt == d->FwdJumpInfo;
+
+    // synthesize signal
+    mpc_decoder_requantisierung(d, d->Max_Band);
+
+    //if ( d->EQ_activated && PluginSettings.EQbyMPC )
+    //    perform_EQ ();
+
+    mpc_decoder_synthese_filter_float(d, buffer);
+
+    d->DecodedFrames++;
+
+    // cut off first MPC_DECODER_SYNTH_DELAY zero-samples
+    if (d->DecodedFrames == d->OverallFrames  && d->StreamVersion >= 6) {        
+        // reconstruct exact filelength
+        mpc_int32_t  mod_block   = mpc_decoder_bitstream_read(d,  11);
+        mpc_int32_t  FilterDecay;
+
+        if (mod_block == 0) {
+            // Encoder bugfix
+            mod_block = 1152;                    
+        }
+        FilterDecay = (mod_block + MPC_DECODER_SYNTH_DELAY) % MPC_FRAME_LENGTH;
+
+        // additional FilterDecay samples are needed for decay of synthesis filter
+        if (MPC_DECODER_SYNTH_DELAY + mod_block >= MPC_FRAME_LENGTH) {
+
+            // **********************************************************************
+            // Rhoades 4/16/2002
+            // Commented out are blocks of code which cause gapless playback to fail.
+            // Temporary fix...
+            // **********************************************************************
+
+            if (!d->TrueGaplessPresent) {
+                mpc_decoder_reset_y(d);
+            } 
+            else {
+                //if ( MPC_FRAME_LENGTH != d->LastValidSamples ) {
+                mpc_decoder_bitstream_read(d, 20);
+                mpc_decoder_read_bitstream_sv7(d);
+                mpc_decoder_requantisierung(d, d->Max_Band);
+                //FilterDecay = d->LastValidSamples;
+                //}
+                //else {
+                //FilterDecay = 0;
+                //}
+            }
+
+            mpc_decoder_synthese_filter_float(d, buffer + 2304);
+
+            output_frame_length = MPC_FRAME_LENGTH + FilterDecay;
+        }
+        else {                              // there are only FilterDecay samples needed for this frame
+            output_frame_length = FilterDecay;
+        }
+    }
+
+    if (d->samples_to_skip) {
+        if (output_frame_length < d->samples_to_skip) {
+            d->samples_to_skip -= output_frame_length;
+            output_frame_length = 0;
+        }
+        else {
+            output_frame_length -= d->samples_to_skip;
+            memmove(
+                buffer, 
+                buffer + d->samples_to_skip * 2, 
+                output_frame_length * 2 * sizeof (MPC_SAMPLE_FORMAT));
+            d->samples_to_skip = 0;
+        }
+    }
+
+    return output_frame_length;
+}
+
+mpc_uint32_t mpc_decoder_decode(
+    mpc_decoder *d,
+    MPC_SAMPLE_FORMAT *buffer, 
+    mpc_uint32_t *vbr_update_acc, 
+    mpc_uint32_t *vbr_update_bits)
+{
+    for(;;)
+    {
+        //const mpc_int32_t MaxBrokenFrames = 0; // PluginSettings.MaxBrokenFrames
+
+        mpc_uint32_t RING = d->Zaehler;
+        mpc_int32_t vbr_ring = (RING << 5) + d->pos;
+
+        mpc_uint32_t valid_samples = mpc_decoder_decode_internal(d, buffer);
+
+        if (valid_samples == (mpc_uint32_t)(-1) ) {
+            return 0;
+        }
+
+        /**************** ERROR CONCEALMENT *****************/
+        if (d->FrameWasValid == 0 ) {
+            // error occurred in bitstream
+            return (mpc_uint32_t)(-1);
+        } 
+        else {
+            if (vbr_update_acc && vbr_update_bits) {
+                (*vbr_update_acc) ++;
+                vbr_ring = (d->Zaehler << 5) + d->pos - vbr_ring;
+                if (vbr_ring < 0) {
+                    vbr_ring += 524288;
+                }
+                (*vbr_update_bits) += vbr_ring;
+            }
+
+        }
+        mpc_decoder_update_buffer(d, RING);
+
+        if (valid_samples > 0) {
+            return valid_samples;
+        }
+    }
+}
+
+void
+mpc_decoder_requantisierung(mpc_decoder *d, const mpc_int32_t Last_Band) 
+{
+    mpc_int32_t     Band;
+    mpc_int32_t     n;
+    MPC_SAMPLE_FORMAT facL;
+    MPC_SAMPLE_FORMAT facR;
+    MPC_SAMPLE_FORMAT templ;
+    MPC_SAMPLE_FORMAT tempr;
+    MPC_SAMPLE_FORMAT* YL;
+    MPC_SAMPLE_FORMAT* YR;
+    mpc_int32_t*    L;
+    mpc_int32_t*    R;
+
+#ifdef MPC_FIXED_POINT
+#if MPC_FIXED_POINT_FRACTPART == 14
+#define MPC_MULTIPLY_SCF(CcVal, SCF_idx) \
+    MPC_MULTIPLY_EX(CcVal, d->SCF[SCF_idx], d->SCF_shift[SCF_idx])
+#else
+
+#error FIXME, Cc table is in 18.14 format
+
+#endif
+#else
+#define MPC_MULTIPLY_SCF(CcVal, SCF_idx) \
+    MPC_MULTIPLY(CcVal, d->SCF[SCF_idx])
+#endif
+    // requantization and scaling of subband-samples
+    for ( Band = 0; Band <= Last_Band; Band++ ) {   // setting pointers
+        YL = d->Y_L[0] + Band;
+        YR = d->Y_R[0] + Band;
+        L  = d->Q[Band].L;
+        R  = d->Q[Band].R;
+        /************************** MS-coded **************************/
+        if ( d->MS_Flag [Band] ) {
+            if ( d->Res_L [Band] ) {
+                if ( d->Res_R [Band] ) {    // M!=0, S!=0
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YL   = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++));
+                        *YR   = templ - tempr;
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YL   = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++));
+                        *YR   = templ - tempr;
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YL   = (templ = MPC_MULTIPLY_FLOAT_INT(facL,*L++))+(tempr = MPC_MULTIPLY_FLOAT_INT(facR,*R++));
+                        *YR   = templ - tempr;
+                    }
+                } else {    // M!=0, S==0
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                    }
+                }
+            } else {
+                if (d->Res_R[Band])    // M==0, S!=0
+                {
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YR = - (*YL = MPC_MULTIPLY_FLOAT_INT(facR,*(R++)));
+                    }
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YR = - (*YL = MPC_MULTIPLY_FLOAT_INT(facR,*(R++)));
+                    }
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YR = - (*YL = MPC_MULTIPLY_FLOAT_INT(facR,*(R++)));
+                    }
+                } else {    // M==0, S==0
+                    for ( n = 0; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = 0;
+                    }
+                }
+            }
+        }
+        /************************** LR-coded **************************/
+        else {
+            if ( d->Res_L [Band] ) {
+                if ( d->Res_R [Band] ) {    // L!=0, R!=0
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
+                    for (n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
+                    for (; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
+                    for (; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                } else {     // L!=0, R==0
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = 0;
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = 0;
+                    }
+                    facL = MPC_MULTIPLY_SCF( Cc[d->Res_L[Band]] , (unsigned char)d->SCF_Index_L[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YL = MPC_MULTIPLY_FLOAT_INT(facL,*L++);
+                        *YR = 0;
+                    }
+                }
+            }
+            else {
+                if ( d->Res_R [Band] ) {    // L==0, R!=0
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][0]);
+                    for ( n = 0; n < 12; n++, YL += 32, YR += 32 ) {
+                        *YL = 0;
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][1]);
+                    for ( ; n < 24; n++, YL += 32, YR += 32 ) {
+                        *YL = 0;
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                    facR = MPC_MULTIPLY_SCF( Cc[d->Res_R[Band]] , (unsigned char)d->SCF_Index_R[Band][2]);
+                    for ( ; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YL = 0;
+                        *YR = MPC_MULTIPLY_FLOAT_INT(facR,*R++);
+                    }
+                } else {    // L==0, R==0
+                    for ( n = 0; n < 36; n++, YL += 32, YR += 32 ) {
+                        *YR = *YL = 0;
+                    }
+                }
+            }
+        }
+    }
+}
+
+/****************************************** SV 6 ******************************************/
+void
+mpc_decoder_read_bitstream_sv6(mpc_decoder *d) 
+{
+    mpc_int32_t n,k;
+    mpc_int32_t Max_used_Band=0;
+    HuffmanTyp *Table;
+    const HuffmanTyp *x1;
+    const HuffmanTyp *x2;
+    mpc_int32_t *L;
+    mpc_int32_t *R;
+    mpc_int32_t *ResL = d->Res_L;
+    mpc_int32_t *ResR = d->Res_R;
+
+    /************************ HEADER **************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    for (n=0; n <= d->Max_Band; ++n, ++ResL, ++ResR)
+    {
+        if      (n<11)           Table = d->Region_A;
+        else if (n>=11 && n<=22) Table = d->Region_B;
+        else /*if (n>=23)*/      Table = d->Region_C;
+
+        *ResL = d->Q_res[n][mpc_decoder_huffman_decode(d, Table)];
+        if (d->MS_used) {
+            d->MS_Flag[n] = mpc_decoder_bitstream_read(d,  1);
+        }
+        *ResR = d->Q_res[n][mpc_decoder_huffman_decode(d, Table)];
+
+        // only perform the following procedure up to the maximum non-zero subband
+        if (*ResL || *ResR) Max_used_Band = n;
+    }
+
+    /************************* SCFI-Bundle *****************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    for (n=0; n<=Max_used_Band; ++n, ++ResL, ++ResR) {
+        if (*ResL) mpc_decoder_scfi_bundle_read(d, d->SCFI_Bundle, &(d->SCFI_L[n]), &(d->DSCF_Flag_L[n]));
+        if (*ResR) mpc_decoder_scfi_bundle_read(d, d->SCFI_Bundle, &(d->SCFI_R[n]), &(d->DSCF_Flag_R[n]));
+    }
+
+    /***************************** SCFI ********************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    L    = d->SCF_Index_L[0];
+    R    = d->SCF_Index_R[0];
+    for (n=0; n <= Max_used_Band; ++n, ++ResL, ++ResR, L+=3, R+=3)
+    {
+        if (*ResL)
+        {
+            /*********** DSCF ************/
+            if (d->DSCF_Flag_L[n]==1)
+            {
+                L[2] = d->DSCF_Reference_L[n];
+                switch (d->SCFI_L[n])
+                {
+                case 3:
+                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[1] = L[0];
+                    L[2] = L[1];
+                    break;
+                case 1:
+                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[1] = L[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[2] = L[1];
+                    break;
+                case 2:
+                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[1] = L[0];
+                    L[2] = L[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    break;
+                case 0:
+                    L[0] = L[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[1] = L[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    L[2] = L[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    break;
+                default:
+                    return;
+                    break;
+                }
+            }
+            /************ SCF ************/
+            else
+            {
+                switch (d->SCFI_L[n])
+                {
+                case 3:
+                    L[0] = mpc_decoder_bitstream_read(d,  6);
+                    L[1] = L[0];
+                    L[2] = L[1];
+                    break;
+                case 1:
+                    L[0] = mpc_decoder_bitstream_read(d,  6);
+                    L[1] = mpc_decoder_bitstream_read(d,  6);
+                    L[2] = L[1];
+                    break;
+                case 2:
+                    L[0] = mpc_decoder_bitstream_read(d,  6);
+                    L[1] = L[0];
+                    L[2] = mpc_decoder_bitstream_read(d,  6);
+                    break;
+                case 0:
+                    L[0] = mpc_decoder_bitstream_read(d,  6);
+                    L[1] = mpc_decoder_bitstream_read(d,  6);
+                    L[2] = mpc_decoder_bitstream_read(d,  6);
+                    break;
+                default:
+                    return;
+                    break;
+                }
+            }
+            // update Reference for DSCF
+            d->DSCF_Reference_L[n] = L[2];
+        }
+        if (*ResR)
+        {
+            R[2] = d->DSCF_Reference_R[n];
+            /*********** DSCF ************/
+            if (d->DSCF_Flag_R[n]==1)
+            {
+                switch (d->SCFI_R[n])
+                {
+                case 3:
+                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[1] = R[0];
+                    R[2] = R[1];
+                    break;
+                case 1:
+                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[1] = R[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[2] = R[1];
+                    break;
+                case 2:
+                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[1] = R[0];
+                    R[2] = R[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    break;
+                case 0:
+                    R[0] = R[2] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[1] = R[0] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    R[2] = R[1] + mpc_decoder_huffman_decode_fast(d,  d->DSCF_Entropie);
+                    break;
+                default:
+                    return;
+                    break;
+                }
+            }
+            /************ SCF ************/
+            else
+            {
+                switch (d->SCFI_R[n])
+                {
+                case 3:
+                    R[0] = mpc_decoder_bitstream_read(d, 6);
+                    R[1] = R[0];
+                    R[2] = R[1];
+                    break;
+                case 1:
+                    R[0] = mpc_decoder_bitstream_read(d, 6);
+                    R[1] = mpc_decoder_bitstream_read(d, 6);
+                    R[2] = R[1];
+                    break;
+                case 2:
+                    R[0] = mpc_decoder_bitstream_read(d, 6);
+                    R[1] = R[0];
+                    R[2] = mpc_decoder_bitstream_read(d, 6);
+                    break;
+                case 0:
+                    R[0] = mpc_decoder_bitstream_read(d, 6);
+                    R[1] = mpc_decoder_bitstream_read(d, 6);
+                    R[2] = mpc_decoder_bitstream_read(d, 6);
+                    break;
+                default:
+                    return;
+                    break;
+                }
+            }
+            // update Reference for DSCF
+            d->DSCF_Reference_R[n] = R[2];
+        }
+    }
+
+    /**************************** Samples ****************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    for (n=0; n <= Max_used_Band; ++n, ++ResL, ++ResR)
+    {
+        // setting pointers
+        x1 = d->SampleHuff[*ResL];
+        x2 = d->SampleHuff[*ResR];
+        L = d->Q[n].L;
+        R = d->Q[n].R;
+
+        if (x1!=NULL || x2!=NULL)
+            for (k=0; k<36; ++k)
+            {
+                if (x1 != NULL) *L++ = mpc_decoder_huffman_decode_fast(d,  x1);
+                if (x2 != NULL) *R++ = mpc_decoder_huffman_decode_fast(d,  x2);
+            }
+
+        if (*ResL>7 || *ResR>7)
+            for (k=0; k<36; ++k)
+            {
+                if (*ResL>7) *L++ = (mpc_int32_t)mpc_decoder_bitstream_read(d,  Res_bit[*ResL]) - Dc[*ResL];
+                if (*ResR>7) *R++ = (mpc_int32_t)mpc_decoder_bitstream_read(d,  Res_bit[*ResR]) - Dc[*ResR];
+            }
+    }
+}
+
+/****************************************** SV 7 ******************************************/
+void
+mpc_decoder_read_bitstream_sv7(mpc_decoder *d) 
+{
+    // these arrays hold decoding results for bundled quantizers (3- and 5-step)
+    /*static*/ mpc_int32_t idx30[] = { -1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1};
+    /*static*/ mpc_int32_t idx31[] = { -1,-1,-1, 0, 0, 0, 1, 1, 1,-1,-1,-1, 0, 0, 0, 1, 1, 1,-1,-1,-1, 0, 0, 0, 1, 1, 1};
+    /*static*/ mpc_int32_t idx32[] = { -1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1};
+    /*static*/ mpc_int32_t idx50[] = { -2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2};
+    /*static*/ mpc_int32_t idx51[] = { -2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2};
+
+    mpc_int32_t n,k;
+    mpc_int32_t Max_used_Band=0;
+    const HuffmanTyp *Table;
+    mpc_int32_t idx;
+    mpc_int32_t *L   ,*R;
+    mpc_int32_t *ResL,*ResR;
+    mpc_uint32_t tmp;
+
+    /***************************** Header *****************************/
+    ResL  = d->Res_L;
+    ResR  = d->Res_R;
+
+    // first subband
+    *ResL = mpc_decoder_bitstream_read(d, 4);
+    *ResR = mpc_decoder_bitstream_read(d, 4);
+    if (d->MS_used && !(*ResL==0 && *ResR==0)) {
+        d->MS_Flag[0] = mpc_decoder_bitstream_read(d, 1);
+    }
+
+    // consecutive subbands
+    ++ResL; ++ResR; // increase pointers
+    for (n=1; n <= d->Max_Band; ++n, ++ResL, ++ResR)
+    {
+        idx   = mpc_decoder_huffman_decode_fast(d, d->HuffHdr);
+        *ResL = (idx!=4) ? *(ResL-1) + idx : mpc_decoder_bitstream_read(d, 4);
+
+        idx   = mpc_decoder_huffman_decode_fast(d, d->HuffHdr);
+        *ResR = (idx!=4) ? *(ResR-1) + idx : mpc_decoder_bitstream_read(d, 4);
+
+        if (d->MS_used && !(*ResL==0 && *ResR==0)) {
+            d->MS_Flag[n] = mpc_decoder_bitstream_read(d, 1);
+        }
+
+        // only perform following procedures up to the maximum non-zero subband
+        if (*ResL!=0 || *ResR!=0) {
+            Max_used_Band = n;
+        }
+    }
+    /****************************** SCFI ******************************/
+    L     = d->SCFI_L;
+    R     = d->SCFI_R;
+    ResL  = d->Res_L;
+    ResR  = d->Res_R;
+    for (n=0; n <= Max_used_Band; ++n, ++L, ++R, ++ResL, ++ResR) {
+        if (*ResL) *L = mpc_decoder_huffman_decode_faster(d, d->HuffSCFI);
+        if (*ResR) *R = mpc_decoder_huffman_decode_faster(d, d->HuffSCFI);
+    }
+
+    /**************************** SCF/DSCF ****************************/
+    ResL  = d->Res_L;
+    ResR  = d->Res_R;
+    L     = d->SCF_Index_L[0];
+    R     = d->SCF_Index_R[0];
+    for (n=0; n<=Max_used_Band; ++n, ++ResL, ++ResR, L+=3, R+=3) {
+        if (*ResL)
+        {
+            L[2] = d->DSCF_Reference_L[n];
+            switch (d->SCFI_L[n])
+            {
+            case 1:
+                idx  = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
+                L[0] = (idx!=8) ? L[2] + idx : mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d, d->HuffDSCF);
+                L[1] = (idx!=8) ? L[0] + idx : mpc_decoder_bitstream_read(d, 6);
+                L[2] = L[1];
+                break;
+            case 3:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[0] = (idx!=8) ? L[2] + idx : mpc_decoder_bitstream_read(d, 6);
+                L[1] = L[0];
+                L[2] = L[1];
+                break;
+            case 2:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[0] = (idx!=8) ? L[2] + idx : mpc_decoder_bitstream_read(d, 6);
+                L[1] = L[0];
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[2] = (idx!=8) ? L[1] + idx : mpc_decoder_bitstream_read(d, 6);
+                break;
+            case 0:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[0] = (idx!=8) ? L[2] + idx : mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[1] = (idx!=8) ? L[0] + idx : mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                L[2] = (idx!=8) ? L[1] + idx : mpc_decoder_bitstream_read(d, 6);
+                break;
+            default:
+                return;
+                break;
+            }
+            // update Reference for DSCF
+            d->DSCF_Reference_L[n] = L[2];
+        }
+        if (*ResR)
+        {
+            R[2] = d->DSCF_Reference_R[n];
+            switch (d->SCFI_R[n])
+            {
+            case 1:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[0] = (idx!=8) ? R[2] + idx : mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[1] = (idx!=8) ? R[0] + idx : mpc_decoder_bitstream_read(d, 6);
+                R[2] = R[1];
+                break;
+            case 3:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[0] = (idx!=8) ? R[2] + idx : mpc_decoder_bitstream_read(d, 6);
+                R[1] = R[0];
+                R[2] = R[1];
+                break;
+            case 2:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[0] = (idx!=8) ? R[2] + idx : mpc_decoder_bitstream_read(d, 6);
+                R[1] = R[0];
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[2] = (idx!=8) ? R[1] + idx : mpc_decoder_bitstream_read(d, 6);
+                break;
+            case 0:
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[0] = (idx!=8) ? R[2] + idx : mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[1] = (idx!=8) ? R[0] + idx : mpc_decoder_bitstream_read(d, 6);
+                idx  = mpc_decoder_huffman_decode_fast(d,  d->HuffDSCF);
+                R[2] = (idx!=8) ? R[1] + idx : mpc_decoder_bitstream_read(d, 6);
+                break;
+            default:
+                return;
+                break;
+            }
+            // update Reference for DSCF
+            d->DSCF_Reference_R[n] = R[2];
+        }
+    }
+    /***************************** Samples ****************************/
+    ResL = d->Res_L;
+    ResR = d->Res_R;
+    L    = d->Q[0].L;
+    R    = d->Q[0].R;
+    for (n=0; n <= Max_used_Band; ++n, ++ResL, ++ResR, L+=36, R+=36)
+    {
+        /************** links **************/
+        switch (*ResL)
+        {
+        case  -2: case  -3: case  -4: case  -5: case  -6: case  -7: case  -8: case  -9:
+        case -10: case -11: case -12: case -13: case -14: case -15: case -16: case -17:
+            L += 36;
+            break;
+        case -1:
+            for (k=0; k<36; k++ ) {
+                tmp  = mpc_random_int(d);
+                *L++ = ((tmp >> 24) & 0xFF) + ((tmp >> 16) & 0xFF) + ((tmp >>  8) & 0xFF) + ((tmp >>  0) & 0xFF) - 510;
+            }
+            break;
+        case 0:
+            L += 36;// increase pointer
+            break;
+        case 1:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][1];
+            for (k=0; k<12; ++k)
+            {
+                idx = mpc_decoder_huffman_decode_fast(d,  Table);
+                *L++ = idx30[idx];
+                *L++ = idx31[idx];
+                *L++ = idx32[idx];
+            }
+            break;
+        case 2:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][2];
+            for (k=0; k<18; ++k)
+            {
+                idx = mpc_decoder_huffman_decode_fast(d,  Table);
+                *L++ = idx50[idx];
+                *L++ = idx51[idx];
+            }
+            break;
+        case 3:
+        case 4:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
+            for (k=0; k<36; ++k)
+                *L++ = mpc_decoder_huffman_decode_faster(d, Table);
+            break;
+        case 5:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
+            for (k=0; k<36; ++k)
+                *L++ = mpc_decoder_huffman_decode_fast(d, Table);
+            break;
+        case 6:
+        case 7:
+            Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
+            for (k=0; k<36; ++k)
+                *L++ = mpc_decoder_huffman_decode(d, Table);
+            break;
+        case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17:
+            tmp = Dc[*ResL];
+            for (k=0; k<36; ++k)
+                *L++ = (mpc_int32_t)mpc_decoder_bitstream_read(d, Res_bit[*ResL]) - tmp;
+            break;
+        default:
+            return;
+        }
+        /************** rechts **************/
+        switch (*ResR)
+        {
+        case  -2: case  -3: case  -4: case  -5: case  -6: case  -7: case  -8: case  -9:
+        case -10: case -11: case -12: case -13: case -14: case -15: case -16: case -17:
+            R += 36;
+            break;
+        case -1:
+                for (k=0; k<36; k++ ) {
+                    tmp  = mpc_random_int(d);
+                    *R++ = ((tmp >> 24) & 0xFF) + ((tmp >> 16) & 0xFF) + ((tmp >>  8) & 0xFF) + ((tmp >>  0) & 0xFF) - 510;
+                }
+                break;
+            case 0:
+                R += 36;// increase pointer
+                break;
+            case 1:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][1];
+                for (k=0; k<12; ++k)
+                {
+                    idx = mpc_decoder_huffman_decode_fast(d, Table);
+                    *R++ = idx30[idx];
+                    *R++ = idx31[idx];
+                    *R++ = idx32[idx];
+                }
+                break;
+            case 2:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][2];
+                for (k=0; k<18; ++k)
+                {
+                    idx = mpc_decoder_huffman_decode_fast(d, Table);
+                    *R++ = idx50[idx];
+                    *R++ = idx51[idx];
+                }
+                break;
+            case 3:
+            case 4:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
+                for (k=0; k<36; ++k)
+                    *R++ = mpc_decoder_huffman_decode_faster(d, Table);
+                break;
+            case 5:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
+                for (k=0; k<36; ++k)
+                    *R++ = mpc_decoder_huffman_decode_fast(d, Table);
+                break;
+            case 6:
+            case 7:
+                Table = d->HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
+                for (k=0; k<36; ++k)
+                    *R++ = mpc_decoder_huffman_decode(d, Table);
+                break;
+            case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15: case 16: case 17:
+                tmp = Dc[*ResR];
+                for (k=0; k<36; ++k)
+                    *R++ = (mpc_int32_t)mpc_decoder_bitstream_read(d, Res_bit[*ResR]) - tmp;
+                break;
+            default:
+                return;
+        }
+    }
+}
+
+void mpc_decoder_setup(mpc_decoder *d, mpc_reader *r)
+{
+  d->r = r;
+
+  d->HuffQ[0][0] = 0;
+  d->HuffQ[1][0] = 0;
+  d->HuffQ[0][1] = d->HuffQ1[0];
+  d->HuffQ[1][1] = d->HuffQ1[1];
+  d->HuffQ[0][2] = d->HuffQ2[0];
+  d->HuffQ[1][2] = d->HuffQ2[1];
+  d->HuffQ[0][3] = d->HuffQ3[0];
+  d->HuffQ[1][3] = d->HuffQ3[1];
+  d->HuffQ[0][4] = d->HuffQ4[0];
+  d->HuffQ[1][4] = d->HuffQ4[1];
+  d->HuffQ[0][5] = d->HuffQ5[0];
+  d->HuffQ[1][5] = d->HuffQ5[1];
+  d->HuffQ[0][6] = d->HuffQ6[0];
+  d->HuffQ[1][6] = d->HuffQ6[1];
+  d->HuffQ[0][7] = d->HuffQ7[0];
+  d->HuffQ[1][7] = d->HuffQ7[1];
+
+  d->SampleHuff[0] = NULL;
+  d->SampleHuff[1] = d->Entropie_1;
+  d->SampleHuff[2] = d->Entropie_2;
+  d->SampleHuff[3] = d->Entropie_3;
+  d->SampleHuff[4] = d->Entropie_4;
+  d->SampleHuff[5] = d->Entropie_5;
+  d->SampleHuff[6] = d->Entropie_6;
+  d->SampleHuff[7] = d->Entropie_7;
+  d->SampleHuff[8] = NULL;
+  d->SampleHuff[9] = NULL;
+  d->SampleHuff[10] = NULL;
+  d->SampleHuff[11] = NULL;
+  d->SampleHuff[12] = NULL;
+  d->SampleHuff[13] = NULL;
+  d->SampleHuff[14] = NULL;
+  d->SampleHuff[15] = NULL;
+  d->SampleHuff[16] = NULL;
+  d->SampleHuff[17] = NULL;
+
+  d->EQ_activated = 0;
+  d->MPCHeaderPos = 0;
+  d->StreamVersion = 0;
+  d->MS_used = 0;
+  d->FwdJumpInfo = 0;
+  d->ActDecodePos = 0;
+  d->FrameWasValid = 0;
+  d->OverallFrames = 0;
+  d->DecodedFrames = 0;
+  d->LastValidSamples = 0;
+  d->TrueGaplessPresent = 0;
+  d->WordsRead = 0;
+  d->Max_Band = 0;
+  d->SampleRate = 0;
+//  clips = 0;
+  d->__r1 = 1;
+  d->__r2 = 1;
+
+  d->dword = 0;
+  d->pos = 0;
+  d->Zaehler = 0;
+  d->WordsRead = 0;
+  d->Max_Band = 0;
+
+  mpc_decoder_initialisiere_quantisierungstabellen(d, 1.0f);
+  mpc_decoder_init_huffman_sv6(d);
+  mpc_decoder_init_huffman_sv7(d);
+}
+
+static void mpc_decoder_set_streaminfo(mpc_decoder *d, mpc_streaminfo *si)
+{
+    mpc_decoder_reset_synthesis(d);
+    mpc_decoder_reset_globals(d);
+
+    d->StreamVersion      = si->stream_version;
+    d->MS_used            = si->ms;
+    d->Max_Band           = si->max_band;
+    d->OverallFrames      = si->frames;
+    d->MPCHeaderPos       = si->header_position;
+    d->LastValidSamples   = si->last_frame_samples;
+    d->TrueGaplessPresent = si->is_true_gapless;
+    d->SampleRate         = (mpc_int32_t)si->sample_freq;
+
+    d->samples_to_skip = MPC_DECODER_SYNTH_DELAY;
+}
+
+mpc_bool_t mpc_decoder_initialize(mpc_decoder *d, mpc_streaminfo *si) 
+{
+    mpc_decoder_set_streaminfo(d, si);
+
+    // AB: setting position to the beginning of the data-bitstream
+    switch (d->StreamVersion) {
+    case 0x04: f_seek(d, 4 + d->MPCHeaderPos); d->pos = 16; break;  // Geht auch über eine der Helperfunktionen
+    case 0x05:
+    case 0x06: f_seek(d, 8 + d->MPCHeaderPos); d->pos =  0; break;
+    case 0x07:
+    case 0x17: /*f_seek ( 24 + d->MPCHeaderPos );*/ d->pos =  8; break;
+    default: return FALSE;
+    }
+
+    // AB: fill buffer and initialize decoder
+    f_read_dword(d, d->Speicher, MEMSIZE );
+    d->dword = d->Speicher[d->Zaehler = 0];
+
+    return TRUE;
+}
+
+//---------------------------------------------------------------
+// will seek from the beginning of the file to the desired
+// position in ms (given by seek_needed)
+//---------------------------------------------------------------
+#if 0
+static void
+helper1(mpc_decoder *d, mpc_uint32_t bitpos) 
+{
+    f_seek(d, (bitpos >> 5) * 4 + d->MPCHeaderPos);
+    f_read_dword(d, d->Speicher, 2);
+    d->dword = d->Speicher[d->Zaehler = 0];
+    d->pos = bitpos & 31;
+}
+#endif
+
+static void
+helper2(mpc_decoder *d, mpc_uint32_t bitpos) 
+{
+    f_seek(d, (bitpos>>5) * 4 + d->MPCHeaderPos);
+    f_read_dword(d, d->Speicher, MEMSIZE);
+    d->dword = d->Speicher[d->Zaehler = 0];
+    d->pos = bitpos & 31;
+}
+
+#if 0
+static void
+helper3(mpc_decoder *d, mpc_uint32_t bitpos, mpc_uint32_t* buffoffs) 
+{
+    d->pos = bitpos & 31;
+    bitpos >>= 5;
+    if ((mpc_uint32_t)(bitpos - *buffoffs) >= MEMSIZE - 2) {
+        *buffoffs = bitpos;
+        f_seek(d, bitpos * 4L + d->MPCHeaderPos);
+        f_read_dword(d, d->Speicher, MEMSIZE );
+    }
+    d->dword = d->Speicher[d->Zaehler = bitpos - *buffoffs ];
+}
+#endif
+
+static mpc_uint32_t get_initial_fpos(mpc_decoder *d, mpc_uint32_t StreamVersion)
+{
+    mpc_uint32_t fpos = 0;
+    switch ( d->StreamVersion ) {                                                  // setting position to the beginning of the data-bitstream
+    case  0x04: fpos =  48; break;
+    case  0x05:
+    case  0x06: fpos =  64; break;
+    case  0x07:
+    case  0x17: fpos = 200; break;
+    }
+    return fpos;
+}
+
+mpc_bool_t mpc_decoder_seek_seconds(mpc_decoder *d, double seconds) 
+{
+    return mpc_decoder_seek_sample(d, (mpc_int64_t)(seconds * (double)d->SampleRate + 0.5));
+}
+
+mpc_bool_t mpc_decoder_seek_sample(mpc_decoder *d, mpc_int64_t destsample) 
+{
+    mpc_uint32_t fpos;
+    mpc_uint32_t fwd;
+
+    fwd = (mpc_uint32_t) (destsample / MPC_FRAME_LENGTH);
+    d->samples_to_skip = MPC_DECODER_SYNTH_DELAY + (mpc_uint32_t)(destsample % MPC_FRAME_LENGTH);
+
+    memset(d->Y_L          , 0, sizeof d->Y_L           );
+    memset(d->Y_R          , 0, sizeof d->Y_R           );
+    memset(d->SCF_Index_L     , 0, sizeof d->SCF_Index_L      );
+    memset(d->SCF_Index_R     , 0, sizeof d->SCF_Index_R      );
+    memset(d->Res_L           , 0, sizeof d->Res_L            );
+    memset(d->Res_R           , 0, sizeof d->Res_R            );
+    memset(d->SCFI_L          , 0, sizeof d->SCFI_L           );
+    memset(d->SCFI_R          , 0, sizeof d->SCFI_R           );
+    memset(d->DSCF_Flag_L     , 0, sizeof d->DSCF_Flag_L      );
+    memset(d->DSCF_Flag_R     , 0, sizeof d->DSCF_Flag_R      );
+    memset(d->DSCF_Reference_L, 0, sizeof d->DSCF_Reference_L );
+    memset(d->DSCF_Reference_R, 0, sizeof d->DSCF_Reference_R );
+    memset(d->Q               , 0, sizeof d->Q                );
+    memset(d->MS_Flag         , 0, sizeof d->MS_Flag          );
+
+    // resetting synthesis filter to avoid "clicks"
+    mpc_decoder_reset_synthesis(d);
+
+    // prevent from desired position out of allowed range
+    fwd = fwd < d->OverallFrames  ?  fwd  :  d->OverallFrames;
+
+    // reset number of decoded frames
+    d->DecodedFrames = 0;
+
+    fpos = get_initial_fpos(d, d->StreamVersion);
+    if (fpos == 0) {
+        return FALSE;
+    }
+
+    helper2(d, fpos);
+
+    // read the last 32 frames before the desired position to scan the scalefactors (artifactless jumping)
+    for ( ; d->DecodedFrames < fwd; d->DecodedFrames++ ) {
+        mpc_uint32_t   FrameBitCnt;
+        mpc_uint32_t   RING;
+        RING         = d->Zaehler;
+        d->FwdJumpInfo  = mpc_decoder_bitstream_read(d, 20);    // read jump-info
+        d->ActDecodePos = (d->Zaehler << 5) + d->pos;
+        FrameBitCnt  = mpc_decoder_bits_read(d);  // scanning the scalefactors and check for validity of frame
+        if (d->StreamVersion >= 7)  {
+            mpc_decoder_read_bitstream_sv7(d);
+        }
+        else {
+            mpc_decoder_read_bitstream_sv6(d);
+        }
+        if (mpc_decoder_bits_read(d) - FrameBitCnt != d->FwdJumpInfo ) {
+            // Box ("Bug in perform_jump");
+            return FALSE;
+        }
+        // update buffer
+        if ((RING ^ d->Zaehler) & MEMSIZE2) {
+            f_read_dword(d, d->Speicher + (RING & MEMSIZE2),  MEMSIZE2);
+        }
+    }
+
+    // LastBitsRead = BitsRead ();
+    // LastFrame = d->DecodedFrames;
+
+    return TRUE;
+}
+
+void mpc_decoder_update_buffer(mpc_decoder *d, mpc_uint32_t RING) 
+{
+    if ((RING ^ d->Zaehler) & MEMSIZE2 ) {
+        // update buffer
+        f_read_dword(d, d->Speicher + (RING & MEMSIZE2), MEMSIZE2);
+    }
+}
+
+
Index: /libmpcdec/tags/release-1.2/src/mpc_reader.c
===================================================================
--- /libmpcdec/tags/release-1.2/src/mpc_reader.c	(revision 30)
+++ /libmpcdec/tags/release-1.2/src/mpc_reader.c	(revision 30)
@@ -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.
+*/
+
+/// \file mpc_reader.c
+/// Contains implementations for simple file-based mpc_reader
+
+#include <mpcdec/mpcdec.h>
+
+/// mpc_reader callback implementations
+static mpc_int32_t
+read_impl(void *data, void *ptr, mpc_int32_t size)
+{
+    mpc_reader_file *d = (mpc_reader_file *) data;
+
+    return fread(ptr, 1, size, d->file);
+}
+
+static mpc_bool_t
+seek_impl(void *data, mpc_int32_t offset)
+{
+    mpc_reader_file *d = (mpc_reader_file *) data;
+
+    return d->is_seekable ? !fseek(d->file, offset, SEEK_SET) : FALSE;
+}
+
+static mpc_int32_t
+tell_impl(void *data)
+{
+    mpc_reader_file *d = (mpc_reader_file *) data;
+
+    return ftell(d->file);
+}
+
+static mpc_int32_t
+get_size_impl(void *data)
+{
+    mpc_reader_file *d = (mpc_reader_file *) data;
+
+    return d->file_size;
+}
+
+static mpc_bool_t
+canseek_impl(void *data)
+{
+    mpc_reader_file *d = (mpc_reader_file *) data;
+
+    return d->is_seekable;
+}
+
+void
+mpc_reader_setup_file_reader(mpc_reader_file *p_reader, FILE *input)
+{
+    p_reader->reader.seek = seek_impl;
+    p_reader->reader.read = read_impl;
+    p_reader->reader.tell = tell_impl;
+    p_reader->reader.get_size = get_size_impl;
+    p_reader->reader.canseek = canseek_impl;
+    p_reader->reader.data = p_reader; // point back to ourselves
+
+    p_reader->file = input;
+    p_reader->is_seekable = TRUE;
+    fseek(input, 0, SEEK_END);
+    p_reader->file_size = ftell(input);
+    fseek(input, 0, SEEK_SET);
+}
Index: /libmpcdec/tags/release-1.2/src/requant.c
===================================================================
--- /libmpcdec/tags/release-1.2/src/requant.c	(revision 30)
+++ /libmpcdec/tags/release-1.2/src/requant.c	(revision 30)
@@ -0,0 +1,152 @@
+/*
+  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.c
+/// Requantization function implementations.
+/// \todo document me
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/internal.h>
+
+/* C O N S T A N T S */
+// bits per sample for chosen quantizer
+const mpc_uint32_t  Res_bit [18] = {
+    0,  0,  0,  0,  0,  0,  0,  0,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16
+};
+
+// coefficients for requantization
+// 65536/step bzw. 65536/(2*D+1)
+
+#define _(X) MAKE_MPC_SAMPLE_EX(X,14)
+
+const MPC_SAMPLE_FORMAT  __Cc [1 + 18] = {
+      _(111.285962475327f),                                        // 32768/2/255*sqrt(3)
+    _(65536.000000000000f), _(21845.333333333332f), _(13107.200000000001f), _(9362.285714285713f),
+    _(7281.777777777777f),  _(4369.066666666666f),  _(2114.064516129032f), _(1040.253968253968f),
+     _(516.031496062992f),  _(257.003921568627f),   _(128.250489236790f),   _(64.062561094819f),
+       _(32.015632633121f),    _(16.003907203907f),     _(8.000976681723f),    _(4.000244155527f),
+        _(2.000061037018f),     _(1.000015259021f)
+};
+
+#undef _
+
+// offset for requantization
+// 2*D+1 = steps of quantizer
+const mpc_int32_t  __Dc [1 + 18] = {
+      2,
+      0,     1,     2,     3,     4,     7,    15,    31,    63,
+    127,   255,   511,  1023,  2047,  4095,  8191, 16383, 32767
+};
+
+#ifdef MPC_FIXED_POINT
+static mpc_uint32_t find_shift(double fval)
+{
+	mpc_int64_t val = (mpc_int64_t)fval;
+	if (val<0) val = -val;
+	mpc_uint32_t ptr = 0;
+	while(val) {val>>=1;ptr++;}
+
+	return ptr > 31 ? 0 : 31 - ptr;
+}
+#endif
+
+/* F U N C T I O N S */
+
+#define SET_SCF(N,X) d->SCF[N] = MAKE_MPC_SAMPLE_EX(X,d->SCF_shift[N] = (unsigned char)find_shift(X));
+
+void
+mpc_decoder_scale_output(mpc_decoder *d, double factor) 
+{
+    mpc_int32_t     n;
+    double  f1;
+    double  f2;
+#ifndef MPC_FIXED_POINT
+	factor *= 1.0 / (double)(1<<(MPC_FIXED_POINT_SHIFT-1));
+#else
+	factor *= 1.0 / (double)(1<<(16 - MPC_FIXED_POINT_SHIFT));
+#endif
+    f1 = f2 = factor;
+
+    // handles +1.58...-98.41 dB, where's scf[n] / scf[n-1] = 1.20050805774840750476
+	
+	SET_SCF(1,factor);
+
+	f1 *=   0.83298066476582673961;
+	f2 *= 1/0.83298066476582673961;
+
+    for ( n = 1; n <= 128; n++ ) {
+		SET_SCF((unsigned char)(1+n),f1);
+		SET_SCF((unsigned char)(1-n),f2);
+        f1 *=   0.83298066476582673961;
+        f2 *= 1/0.83298066476582673961;
+    }
+}
+
+static void
+mpc_decoder_quantisierungsmodes(mpc_decoder *d) // conversion: index -> quantizer (bitstream reading)
+{                                               // conversion: quantizer -> index (bitstream writing)
+    mpc_int32_t  Band = 0;
+    mpc_int32_t  i;
+
+    do {
+        d->Q_bit [Band] = 4;
+        for ( i = 0; i < 16-1; i++ )
+            d->Q_res [Band] [i] = i;
+        d->Q_res [Band][i] = 17;
+        Band++;
+    } while ( Band < 11 );
+
+    do {
+        d->Q_bit [Band] = 3;
+        for ( i = 0; i < 8-1; i++ )
+            d->Q_res [Band] [i] = i;
+        d->Q_res [Band] [i] = 17;
+        Band++;
+    } while ( Band < 23 );
+
+    do {
+        d->Q_bit [Band] = 2;
+        for ( i = 0; i < 4-1; i++ )
+            d->Q_res [Band] [i] = i;
+        d->Q_res [Band] [i] = 17;
+        Band++;
+    } while ( Band < 32 );
+}
+
+void
+mpc_decoder_initialisiere_quantisierungstabellen(mpc_decoder *d, double scale_factor) 
+{
+    mpc_decoder_quantisierungsmodes(d);
+    mpc_decoder_scale_output(d, scale_factor);
+}
Index: /libmpcdec/tags/release-1.2/src/sample.cpp
===================================================================
--- /libmpcdec/tags/release-1.2/src/sample.cpp	(revision 30)
+++ /libmpcdec/tags/release-1.2/src/sample.cpp	(revision 30)
@@ -0,0 +1,328 @@
+/*
+  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.
+*/
+
+#include <stdio.h>
+#include <assert.h>
+#include <time.h>
+
+#include <mpcdec/mpcdec.h>
+
+/*
+  The data bundle we pass around with our reader to store file
+  position and size etc. 
+*/
+typedef struct reader_data_t {
+    FILE *file;
+    long size;
+    mpc_bool_t seekable;
+} reader_data;
+
+/*
+  Our implementations of the mpc_reader callback functions.
+*/
+mpc_int32_t
+read_impl(void *data, void *ptr, mpc_int32_t size)
+{
+    reader_data *d = (reader_data *) data;
+    return fread(ptr, 1, size, d->file);
+}
+
+mpc_bool_t
+seek_impl(void *data, mpc_int32_t offset)
+{
+    reader_data *d = (reader_data *) data;
+    return d->seekable ? !fseek(d->file, offset, SEEK_SET) : false;
+}
+
+mpc_int32_t
+tell_impl(void *data)
+{
+    reader_data *d = (reader_data *) data;
+    return ftell(d->file);
+}
+
+mpc_int32_t
+get_size_impl(void *data)
+{
+    reader_data *d = (reader_data *) data;
+    return d->size;
+}
+
+mpc_bool_t
+canseek_impl(void *data)
+{
+    reader_data *d = (reader_data *) data;
+    return d->seekable;
+}
+
+#define WFX_SIZE (2+2+4+4+2+2)
+
+#ifdef MPC_FIXED_POINT
+static int
+shift_signed(MPC_SAMPLE_FORMAT val, int shift)
+{
+    if (shift > 0)
+        val <<= shift;
+    else if (shift < 0)
+        val >>= -shift;
+    return (int)val;
+}
+#endif
+
+class WavWriter {
+  public:
+    WavWriter(FILE * p_output, unsigned p_nch, unsigned p_bps,
+              unsigned p_srate)
+    : m_file(p_output), m_nch(p_nch), m_bps(p_bps), m_srate(p_srate) {
+        assert(m_bps == 16 || m_bps == 24);
+
+        WriteRaw("RIFF", 4);
+        WriteDword(0);          //fix this in destructor
+
+        WriteRaw("WAVE", 4);
+        WriteRaw("fmt ", 4);
+        WriteDword(WFX_SIZE);
+
+        WriteWord(1);           //WAVE_FORMAT_PCM
+        WriteWord(m_nch);
+        WriteDword(m_srate);
+        WriteDword(m_srate * m_nch * (m_bps >> 3));
+        WriteWord(m_nch * (m_bps >> 3));
+        WriteWord(m_bps);
+        /*
+           WORD  wFormatTag; 
+           WORD  nChannels; 
+           DWORD nSamplesPerSec; 
+           DWORD nAvgBytesPerSec; 
+           WORD  nBlockAlign; 
+           WORD  wBitsPerSample; 
+         */
+        WriteRaw("data", 4);
+        WriteDword(0);          //fix this in destructor
+
+        m_data_bytes_written = 0;
+    } mpc_bool_t WriteSamples(const MPC_SAMPLE_FORMAT * p_buffer, unsigned p_size) {
+        unsigned n;
+        int clip_min = -1 << (m_bps - 1),
+            clip_max = (1 << (m_bps - 1)) - 1, float_scale = 1 << (m_bps - 1);
+        for (n = 0; n < p_size; n++) {
+            int val;
+#ifdef MPC_FIXED_POINT
+            val =
+                shift_signed(p_buffer[n],
+                             m_bps - MPC_FIXED_POINT_SCALE_SHIFT);
+#else
+            val = (int)(p_buffer[n] * float_scale);
+#endif
+            if (val < clip_min)
+                val = clip_min;
+            else if (val > clip_max)
+                val = clip_max;
+            if (!WriteInt(val, m_bps))
+                return false;
+        }
+        m_data_bytes_written += p_size * (m_bps >> 3);
+        return true;
+    }
+
+    ~WavWriter() {
+        if (m_data_bytes_written & 1) {
+            char blah = 0;
+            WriteRaw(&blah, 1);
+            m_data_bytes_written++;
+        }
+        Seek(4);
+        WriteDword((unsigned long)(m_data_bytes_written + 4 + 8 + WFX_SIZE +
+                                   8));
+        Seek(8 + 4 + 8 + WFX_SIZE + 4);
+        WriteDword(m_data_bytes_written);
+    }
+
+  private:
+
+    mpc_bool_t Seek(unsigned p_offset) {
+        return !fseek(m_file, p_offset, SEEK_SET);
+    }
+
+    mpc_bool_t WriteRaw(const void *p_buffer, unsigned p_bytes) {
+        return fwrite(p_buffer, 1, p_bytes, m_file) == p_bytes;
+    }
+
+    mpc_bool_t WriteDword(unsigned long p_val) {
+        return WriteInt(p_val, 32);
+    }
+    mpc_bool_t WriteWord(unsigned short p_val) {
+        return WriteInt(p_val, 16);
+    }
+
+    // write a little-endian number properly
+    mpc_bool_t WriteInt(unsigned int p_val, unsigned p_width_bits) {
+        unsigned char temp;
+        unsigned shift = 0;
+        assert((p_width_bits % 8) == 0);
+        do {
+            temp = (unsigned char)((p_val >> shift) & 0xFF);
+            if (!WriteRaw(&temp, 1))
+                return false;
+            shift += 8;
+        } while (shift < p_width_bits);
+        return true;
+    }
+
+    unsigned m_nch, m_bps, m_srate;
+    FILE *m_file;
+    unsigned m_data_bytes_written;
+};
+
+
+static void
+usage(const char *exename)
+{
+    printf
+        ("Usage: %s <infile.mpc> [<outfile.wav>]\nIf <outfile.wav> is not specified, decoder will run in benchmark mode.\n",
+         exename);
+}
+
+int
+main(int argc, char **argv)
+{
+    if (argc != 2 && argc != 3) {
+        if (argc > 0)
+            usage(argv[0]);
+        return 0;
+    }
+
+    FILE *input = fopen(argv[1], "rb");
+    FILE *output = 0;
+    if (input == 0) {
+        usage(argv[0]);
+        printf("Error opening input file: \"%s\"\n", argv[1]);
+        return 1;
+    }
+
+    if (argc == 3) {
+        output = fopen(argv[2], "wb");
+        if (output == 0) {
+            fclose(input);
+            usage(argv[0]);
+            printf("Error opening output file: \"%s\"\n", argv[2]);
+            return 1;
+        }
+    }
+
+    /* initialize our reader_data tag the reader will carry around with it */
+    reader_data data;
+    data.file = input;
+    data.seekable = true;
+    fseek(data.file, 0, SEEK_END);
+    data.size = ftell(data.file);
+    fseek(data.file, 0, SEEK_SET);
+
+    /* set up an mpc_reader linked to our function implementations */
+    mpc_decoder decoder;
+    mpc_reader reader;
+    reader.read = read_impl;
+    reader.seek = seek_impl;
+    reader.tell = tell_impl;
+    reader.get_size = get_size_impl;
+    reader.canseek = canseek_impl;
+    reader.data = &data;
+
+    /* read file's streaminfo data */
+    mpc_streaminfo info;
+    mpc_streaminfo_init(&info);
+    if (mpc_streaminfo_read(&info, &reader) != ERROR_CODE_OK) {
+        printf("Not a valid musepack file: \"%s\"\n", argv[1]);
+        return 1;
+    }
+
+    /* instantiate a decoder with our file reader */
+    mpc_decoder_setup(&decoder, &reader);
+    if (!mpc_decoder_initialize(&decoder, &info)) {
+        printf("Error initializing decoder.\n", argv[1]);
+        return 1;
+    }
+
+    /* decode the file */
+    printf("Decoding from:\n%s\nTo:\n%s\n", argv[1],
+           output ? argv[2] : "N/A");
+    WavWriter *wavwriter =
+        output ? new WavWriter(output, 2, 16, info.sample_freq) : 0;
+    MPC_SAMPLE_FORMAT sample_buffer[MPC_DECODER_BUFFER_LENGTH];
+    clock_t begin, end;
+    begin = clock();
+    unsigned total_samples = 0;
+    mpc_bool_t successful = FALSE;
+    for (;;) {
+        unsigned status = mpc_decoder_decode(&decoder, sample_buffer, 0, 0);
+        if (status == (unsigned)(-1)) {
+            //decode error
+            printf("Error decoding file.\n");
+            break;
+        }
+        else if (status == 0)   //EOF
+        {
+            successful = true;
+            break;
+        }
+        else                    //status>0
+        {
+            total_samples += status;
+            if (wavwriter) {
+                if (!wavwriter->
+                    WriteSamples(sample_buffer, status * /* stereo */ 2)) {
+                    printf("Write error.\n");
+                    break;
+                }
+            }
+        }
+    }
+
+    end = clock();
+
+    if (wavwriter) {
+        delete wavwriter;
+    }
+
+    if (successful) {
+        printf("\nFinished.\nTotal samples decoded: %u.\n", total_samples);
+        unsigned ms = (end - begin) * 1000 / CLOCKS_PER_SEC;
+        unsigned ratio =
+            (unsigned)((double)total_samples / (double)info.sample_freq /
+                       ((double)ms / 1000.0) * 100.0);
+        printf("Time: %u ms (%u.%02ux).\n", ms, ratio / 100, ratio % 100);
+    }
+
+    return 0;
+}
Index: /libmpcdec/tags/release-1.2/src/streaminfo.c
===================================================================
--- /libmpcdec/tags/release-1.2/src/streaminfo.c	(revision 30)
+++ /libmpcdec/tags/release-1.2/src/streaminfo.c	(revision 30)
@@ -0,0 +1,280 @@
+/*
+  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 streaminfo.c
+/// Implementation of streaminfo reading functions.
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/internal.h>
+
+static const char *
+Stringify(mpc_uint32_t profile) // profile is 0...15, where 7...13 is used
+{
+    static const char na[] = "n.a.";
+    static const char *Names[] = {
+        na, "'Unstable/Experimental'", na, na,
+        na, "'quality 0'", "'quality 1'", "'Telephone'",
+        "'Thumb'", "'Radio'", "'Standard'", "'Xtreme'",
+        "'Insane'", "'BrainDead'", "'quality 9'", "'quality 10'"
+    };
+
+    return profile >= sizeof(Names) / sizeof(*Names) ? na : Names[profile];
+}
+
+void
+mpc_streaminfo_init(mpc_streaminfo * si)
+{
+    memset(si, 0, sizeof(mpc_streaminfo));
+}
+
+// read information from SV8 header
+// not yet implemented
+static mpc_int32_t
+streaminfo_read_header_sv8(mpc_streaminfo * si, mpc_reader * fp)
+{
+    return 0;
+}
+
+/// Reads streaminfo from SV7 header. 
+static mpc_int32_t
+streaminfo_read_header_sv7(mpc_streaminfo * si, mpc_uint32_t HeaderData[8])
+{
+    const mpc_int32_t samplefreqs[4] = { 44100, 48000, 37800, 32000 };
+
+    //mpc_uint32_t    HeaderData [8];
+    mpc_uint16_t Estimatedpeak_title = 0;
+
+    if (si->stream_version > 0x71) {
+        //        Update (si->stream_version);
+        return 0;
+    }
+
+    /*
+       if ( !fp->seek ( si->header_position ) )         // seek to header start
+       return ERROR_CODE_FILE;
+       if ( fp->read ( HeaderData, sizeof HeaderData) != sizeof HeaderData )
+       return ERROR_CODE_FILE;
+     */
+
+    si->bitrate = 0;
+    si->frames = HeaderData[1];
+    si->is = 0;
+    si->ms = (HeaderData[2] >> 30) & 0x0001;
+    si->max_band = (HeaderData[2] >> 24) & 0x003F;
+    si->block_size = 1;
+    si->profile = (HeaderData[2] << 8) >> 28;
+    si->profile_name = Stringify(si->profile);
+    si->sample_freq = samplefreqs[(HeaderData[2] >> 16) & 0x0003];
+    Estimatedpeak_title = (mpc_uint16_t) (HeaderData[2] & 0xFFFF);   // read the ReplayGain data
+    si->gain_title = (mpc_uint16_t) ((HeaderData[3] >> 16) & 0xFFFF);
+    si->peak_title = (mpc_uint16_t) (HeaderData[3] & 0xFFFF);
+    si->gain_album = (mpc_uint16_t) ((HeaderData[4] >> 16) & 0xFFFF);
+    si->peak_album = (mpc_uint16_t) (HeaderData[4] & 0xFFFF);
+    si->is_true_gapless = (HeaderData[5] >> 31) & 0x0001; // true gapless: used?
+    si->last_frame_samples = (HeaderData[5] >> 20) & 0x07FF;  // true gapless: valid samples for last frame
+    si->encoder_version = (HeaderData[6] >> 24) & 0x00FF;
+
+    if (si->encoder_version == 0) {
+        sprintf(si->encoder, "Buschmann 1.7.0...9, Klemm 0.90...1.05");
+    }
+    else {
+        switch (si->encoder_version % 10) {
+        case 0:
+            sprintf(si->encoder, "Release %u.%u", si->encoder_version / 100,
+                    si->encoder_version / 10 % 10);
+            break;
+        case 2:
+        case 4:
+        case 6:
+        case 8:
+            sprintf(si->encoder, "Beta %u.%02u", si->encoder_version / 100,
+                    si->encoder_version % 100);
+            break;
+        default:
+            sprintf(si->encoder, "--Alpha-- %u.%02u",
+                    si->encoder_version / 100, si->encoder_version % 100);
+            break;
+        }
+    }
+
+    //    if ( si->peak_title == 0 )                                      // there is no correct peak_title contained within header
+    //        si->peak_title = (mpc_uint16_t)(Estimatedpeak_title * 1.18);
+    //    if ( si->peak_album == 0 )
+    //        si->peak_album = si->peak_title;                          // no correct peak_album, use peak_title
+
+    //si->sample_freq    = 44100;                                     // AB: used by all files up to SV7
+    si->channels = 2;
+
+    return ERROR_CODE_OK;
+}
+
+// read information from SV4-SV6 header
+static mpc_int32_t
+streaminfo_read_header_sv6(mpc_streaminfo * si, mpc_uint32_t HeaderData[8])
+{
+    //mpc_uint32_t    HeaderData [8];
+
+    /*
+       if ( !fp->seek (  si->header_position ) )         // seek to header start
+       return ERROR_CODE_FILE;
+       if ( fp->read ( HeaderData, sizeof HeaderData ) != sizeof HeaderData )
+       return ERROR_CODE_FILE;
+     */
+
+    si->bitrate = (HeaderData[0] >> 23) & 0x01FF;   // read the file-header (SV6 and below)
+    si->is = (HeaderData[0] >> 22) & 0x0001;
+    si->ms = (HeaderData[0] >> 21) & 0x0001;
+    si->stream_version = (HeaderData[0] >> 11) & 0x03FF;
+    si->max_band = (HeaderData[0] >> 6) & 0x001F;
+    si->block_size = (HeaderData[0]) & 0x003F;
+    si->profile = 0;
+    si->profile_name = Stringify((mpc_uint32_t) (-1));
+    if (si->stream_version >= 5)
+        si->frames = HeaderData[1]; // 32 bit
+    else
+        si->frames = (HeaderData[1] >> 16); // 16 bit
+
+    si->gain_title = 0;          // not supported
+    si->peak_title = 0;
+    si->gain_album = 0;
+    si->peak_album = 0;
+
+    si->last_frame_samples = 0;
+    si->is_true_gapless = 0;
+
+    si->encoder_version = 0;
+    si->encoder[0] = '\0';
+
+    if (si->stream_version == 7)
+        return ERROR_CODE_SV7BETA;  // are there any unsupported parameters used?
+    if (si->bitrate != 0)
+        return ERROR_CODE_CBR;
+    if (si->is != 0)
+        return ERROR_CODE_IS;
+    if (si->block_size != 1)
+        return ERROR_CODE_BLOCKSIZE;
+
+    if (si->stream_version < 6) // Bugfix: last frame was invalid for up to SV5
+        si->frames -= 1;
+
+    si->sample_freq = 44100;     // AB: used by all files up to SV7
+    si->channels = 2;
+
+    if (si->stream_version < 4 || si->stream_version > 7)
+        return ERROR_CODE_INVALIDSV;
+
+    return ERROR_CODE_OK;
+}
+
+// reads file header and tags
+mpc_int32_t
+mpc_streaminfo_read(mpc_streaminfo * si, mpc_reader * r)
+{
+    mpc_uint32_t HeaderData[8];
+    mpc_int32_t Error = 0;
+
+    // get header position
+    if ((si->header_position = JumpID3v2(r)) < 0) {
+        return ERROR_CODE_FILE;
+    }
+    // seek to first byte of mpc data
+    if (!r->seek(r->data, si->header_position)) {
+        return ERROR_CODE_FILE;
+    }
+    if (r->read(r->data, HeaderData, 8 * 4) != 8 * 4) {
+        return ERROR_CODE_FILE;
+    }
+    if (!r->seek(r->data, si->header_position + 6 * 4)) {
+        return ERROR_CODE_FILE;
+    }
+
+    si->total_file_length = r->get_size(r->data);
+    si->tag_offset = si->total_file_length;
+    if (memcmp(HeaderData, "MP+", 3) == 0) {
+#ifndef MPC_LITTLE_ENDIAN
+        mpc_uint32_t ptr;
+        for (ptr = 0; ptr < 8; ptr++) {
+            HeaderData[ptr] = swap32(HeaderData[ptr]);
+        }
+#endif
+        si->stream_version = HeaderData[0] >> 24;
+
+        // stream version 8
+        if ((si->stream_version & 15) >= 8) {
+            Error = streaminfo_read_header_sv8(si, r);
+        }
+        // stream version 7
+        else if ((si->stream_version & 15) == 7) {
+            Error = streaminfo_read_header_sv7(si, HeaderData);
+        }
+    }
+    else {
+        // stream version 4-6
+        Error = streaminfo_read_header_sv6(si, HeaderData);
+    }
+
+    // estimation, exact value needs too much time
+    si->pcm_samples = 1152 * si->frames - 576;
+
+    if (si->pcm_samples > 0) {
+        si->average_bitrate =
+            (si->tag_offset -
+             si->header_position) * 8.0 * si->sample_freq / si->pcm_samples;
+    }
+    else {
+        si->average_bitrate = 0;
+    }
+
+    return Error;
+}
+
+double
+mpc_streaminfo_get_length(mpc_streaminfo * si)
+{
+    return (double)mpc_streaminfo_get_length_samples(si) /
+        (double)si->sample_freq;
+}
+
+mpc_int64_t
+mpc_streaminfo_get_length_samples(mpc_streaminfo * si)
+{
+    mpc_int64_t samples = (mpc_int64_t) si->frames * MPC_FRAME_LENGTH;
+    if (si->is_true_gapless) {
+        samples -= (MPC_FRAME_LENGTH - si->last_frame_samples);
+    }
+    else {
+        samples -= MPC_DECODER_SYNTH_DELAY;
+    }
+    return samples;
+}
Index: /libmpcdec/tags/release-1.2/src/synth_filter.c
===================================================================
--- /libmpcdec/tags/release-1.2/src/synth_filter.c	(revision 30)
+++ /libmpcdec/tags/release-1.2/src/synth_filter.c	(revision 30)
@@ -0,0 +1,442 @@
+/*
+  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 synth_filter.c
+/// Synthesis functions.
+/// \todo document me
+
+#include <mpcdec/mpcdec.h>
+#include <mpcdec/internal.h>
+
+typedef mpc_int32_t ptrdiff_t;
+
+/* C O N S T A N T S */
+#undef _
+
+#define MPC_FIXED_POINT_SYNTH_FIX 2
+
+#ifdef MPC_FIXED_POINT
+#define _(value)  MPC_MAKE_FRACT_CONST((double)value/(double)(0x40000))
+#else
+#define _(value)  MAKE_MPC_SAMPLE((double)value/(double)(0x10000))
+#endif
+
+
+static const MPC_SAMPLE_FORMAT  Di_opt [32] [16] = {
+    { _(  0), _( -29), _( 213), _( -459), _( 2037), _(-5153), _(  6574), _(-37489), _(75038), _(37489), _(6574), _( 5153), _(2037), _( 459), _(213), _(29) },
+    { _( -1), _( -31), _( 218), _( -519), _( 2000), _(-5517), _(  5959), _(-39336), _(74992), _(35640), _(7134), _( 4788), _(2063), _( 401), _(208), _(26) },
+    { _( -1), _( -35), _( 222), _( -581), _( 1952), _(-5879), _(  5288), _(-41176), _(74856), _(33791), _(7640), _( 4425), _(2080), _( 347), _(202), _(24) },
+    { _( -1), _( -38), _( 225), _( -645), _( 1893), _(-6237), _(  4561), _(-43006), _(74630), _(31947), _(8092), _( 4063), _(2087), _( 294), _(196), _(21) },
+    { _( -1), _( -41), _( 227), _( -711), _( 1822), _(-6589), _(  3776), _(-44821), _(74313), _(30112), _(8492), _( 3705), _(2085), _( 244), _(190), _(19) },
+    { _( -1), _( -45), _( 228), _( -779), _( 1739), _(-6935), _(  2935), _(-46617), _(73908), _(28289), _(8840), _( 3351), _(2075), _( 197), _(183), _(17) },
+    { _( -1), _( -49), _( 228), _( -848), _( 1644), _(-7271), _(  2037), _(-48390), _(73415), _(26482), _(9139), _( 3004), _(2057), _( 153), _(176), _(16) },
+    { _( -2), _( -53), _( 227), _( -919), _( 1535), _(-7597), _(  1082), _(-50137), _(72835), _(24694), _(9389), _( 2663), _(2032), _( 111), _(169), _(14) },
+    { _( -2), _( -58), _( 224), _( -991), _( 1414), _(-7910), _(    70), _(-51853), _(72169), _(22929), _(9592), _( 2330), _(2001), _(  72), _(161), _(13) },
+    { _( -2), _( -63), _( 221), _(-1064), _( 1280), _(-8209), _(  -998), _(-53534), _(71420), _(21189), _(9750), _( 2006), _(1962), _(  36), _(154), _(11) },
+    { _( -2), _( -68), _( 215), _(-1137), _( 1131), _(-8491), _( -2122), _(-55178), _(70590), _(19478), _(9863), _( 1692), _(1919), _(   2), _(147), _(10) },
+    { _( -3), _( -73), _( 208), _(-1210), _(  970), _(-8755), _( -3300), _(-56778), _(69679), _(17799), _(9935), _( 1388), _(1870), _( -29), _(139), _( 9) },
+    { _( -3), _( -79), _( 200), _(-1283), _(  794), _(-8998), _( -4533), _(-58333), _(68692), _(16155), _(9966), _( 1095), _(1817), _( -57), _(132), _( 8) },
+    { _( -4), _( -85), _( 189), _(-1356), _(  605), _(-9219), _( -5818), _(-59838), _(67629), _(14548), _(9959), _(  814), _(1759), _( -83), _(125), _( 7) },
+    { _( -4), _( -91), _( 177), _(-1428), _(  402), _(-9416), _( -7154), _(-61289), _(66494), _(12980), _(9916), _(  545), _(1698), _(-106), _(117), _( 7) },
+    { _( -5), _( -97), _( 163), _(-1498), _(  185), _(-9585), _( -8540), _(-62684), _(65290), _(11455), _(9838), _(  288), _(1634), _(-127), _(111), _( 6) },
+    { _( -5), _(-104), _( 146), _(-1567), _(  -45), _(-9727), _( -9975), _(-64019), _(64019), _( 9975), _(9727), _(   45), _(1567), _(-146), _(104), _( 5) },
+    { _( -6), _(-111), _( 127), _(-1634), _( -288), _(-9838), _(-11455), _(-65290), _(62684), _( 8540), _(9585), _( -185), _(1498), _(-163), _( 97), _( 5) },
+    { _( -7), _(-117), _( 106), _(-1698), _( -545), _(-9916), _(-12980), _(-66494), _(61289), _( 7154), _(9416), _( -402), _(1428), _(-177), _( 91), _( 4) },
+    { _( -7), _(-125), _(  83), _(-1759), _( -814), _(-9959), _(-14548), _(-67629), _(59838), _( 5818), _(9219), _( -605), _(1356), _(-189), _( 85), _( 4) },
+    { _( -8), _(-132), _(  57), _(-1817), _(-1095), _(-9966), _(-16155), _(-68692), _(58333), _( 4533), _(8998), _( -794), _(1283), _(-200), _( 79), _( 3) },
+    { _( -9), _(-139), _(  29), _(-1870), _(-1388), _(-9935), _(-17799), _(-69679), _(56778), _( 3300), _(8755), _( -970), _(1210), _(-208), _( 73), _( 3) },
+    { _(-10), _(-147), _(  -2), _(-1919), _(-1692), _(-9863), _(-19478), _(-70590), _(55178), _( 2122), _(8491), _(-1131), _(1137), _(-215), _( 68), _( 2) },
+    { _(-11), _(-154), _( -36), _(-1962), _(-2006), _(-9750), _(-21189), _(-71420), _(53534), _(  998), _(8209), _(-1280), _(1064), _(-221), _( 63), _( 2) },
+    { _(-13), _(-161), _( -72), _(-2001), _(-2330), _(-9592), _(-22929), _(-72169), _(51853), _(  -70), _(7910), _(-1414), _( 991), _(-224), _( 58), _( 2) },
+    { _(-14), _(-169), _(-111), _(-2032), _(-2663), _(-9389), _(-24694), _(-72835), _(50137), _(-1082), _(7597), _(-1535), _( 919), _(-227), _( 53), _( 2) },
+    { _(-16), _(-176), _(-153), _(-2057), _(-3004), _(-9139), _(-26482), _(-73415), _(48390), _(-2037), _(7271), _(-1644), _( 848), _(-228), _( 49), _( 1) },
+    { _(-17), _(-183), _(-197), _(-2075), _(-3351), _(-8840), _(-28289), _(-73908), _(46617), _(-2935), _(6935), _(-1739), _( 779), _(-228), _( 45), _( 1) },
+    { _(-19), _(-190), _(-244), _(-2085), _(-3705), _(-8492), _(-30112), _(-74313), _(44821), _(-3776), _(6589), _(-1822), _( 711), _(-227), _( 41), _( 1) },
+    { _(-21), _(-196), _(-294), _(-2087), _(-4063), _(-8092), _(-31947), _(-74630), _(43006), _(-4561), _(6237), _(-1893), _( 645), _(-225), _( 38), _( 1) },
+    { _(-24), _(-202), _(-347), _(-2080), _(-4425), _(-7640), _(-33791), _(-74856), _(41176), _(-5288), _(5879), _(-1952), _( 581), _(-222), _( 35), _( 1) },
+    { _(-26), _(-208), _(-401), _(-2063), _(-4788), _(-7134), _(-35640), _(-74992), _(39336), _(-5959), _(5517), _(-2000), _( 519), _(-218), _( 31), _( 1) }
+};
+
+#undef  _
+
+static void Calculate_New_V ( const MPC_SAMPLE_FORMAT * Sample, MPC_SAMPLE_FORMAT * V )
+{
+    // Calculating new V-buffer values for left channel
+    // calculate new V-values (ISO-11172-3, p. 39)
+    // based upon fast-MDCT algorithm by Byeong Gi Lee
+    /*static*/ MPC_SAMPLE_FORMAT A00, A01, A02, A03, A04, A05, A06, A07, A08, A09, A10, A11, A12, A13, A14, A15;
+    /*static*/ MPC_SAMPLE_FORMAT B00, B01, B02, B03, B04, B05, B06, B07, B08, B09, B10, B11, B12, B13, B14, B15;
+    MPC_SAMPLE_FORMAT tmp;
+
+    A00 = Sample[ 0] + Sample[31];
+    A01 = Sample[ 1] + Sample[30];
+    A02 = Sample[ 2] + Sample[29];
+    A03 = Sample[ 3] + Sample[28];
+    A04 = Sample[ 4] + Sample[27];
+    A05 = Sample[ 5] + Sample[26];
+    A06 = Sample[ 6] + Sample[25];
+    A07 = Sample[ 7] + Sample[24];
+    A08 = Sample[ 8] + Sample[23];
+    A09 = Sample[ 9] + Sample[22];
+    A10 = Sample[10] + Sample[21];
+    A11 = Sample[11] + Sample[20];
+    A12 = Sample[12] + Sample[19];
+    A13 = Sample[13] + Sample[18];
+    A14 = Sample[14] + Sample[17];
+    A15 = Sample[15] + Sample[16];
+
+    B00 = A00 + A15;
+    B01 = A01 + A14;
+    B02 = A02 + A13;
+    B03 = A03 + A12;
+    B04 = A04 + A11;
+    B05 = A05 + A10;
+    B06 = A06 + A09;
+    B07 = A07 + A08;;
+    B08 = MPC_SCALE_CONST((A00 - A15) , 0.5024192929f , 31);
+    B09 = MPC_SCALE_CONST((A01 - A14) , 0.5224986076f , 31);
+    B10 = MPC_SCALE_CONST((A02 - A13) , 0.5669440627f , 31);
+    B11 = MPC_SCALE_CONST((A03 - A12) , 0.6468217969f , 31);
+    B12 = MPC_SCALE_CONST((A04 - A11) , 0.7881546021f , 31);
+    B13 = MPC_SCALE_CONST((A05 - A10) , 1.0606776476f , 30);
+    B14 = MPC_SCALE_CONST((A06 - A09) , 1.7224471569f , 30);
+    B15 = MPC_SCALE_CONST((A07 - A08) , 5.1011486053f , 28);
+
+    A00 =  B00 + B07;
+    A01 =  B01 + B06;
+    A02 =  B02 + B05;
+    A03 =  B03 + B04;
+    A04 = MPC_SCALE_CONST((B00 - B07) , 0.5097956061f , 31);
+    A05 = MPC_SCALE_CONST((B01 - B06) , 0.6013448834f , 31);
+    A06 = MPC_SCALE_CONST((B02 - B05) , 0.8999761939f , 31);
+    A07 = MPC_SCALE_CONST((B03 - B04) , 2.5629155636f , 29);
+    A08 =  B08 + B15;
+    A09 =  B09 + B14;
+    A10 =  B10 + B13;
+    A11 =  B11 + B12;
+    A12 = MPC_SCALE_CONST((B08 - B15) , 0.5097956061f , 31);
+    A13 = MPC_SCALE_CONST((B09 - B14) , 0.6013448834f , 31);
+    A14 = MPC_SCALE_CONST((B10 - B13) , 0.8999761939f , 31);
+    A15 = MPC_SCALE_CONST((B11 - B12) , 2.5629155636f , 29);
+
+    B00 =  A00 + A03;
+    B01 =  A01 + A02;
+    B02 = MPC_MULTIPLY_FRACT_CONST_FIX((A00 - A03) , 0.5411961079f , 1);
+    B03 = MPC_MULTIPLY_FRACT_CONST_FIX((A01 - A02) , 1.3065630198f , 2);
+    B04 =  A04 + A07;
+    B05 =  A05 + A06;
+    B06 = MPC_MULTIPLY_FRACT_CONST_FIX((A04 - A07) , 0.5411961079f , 1);
+    B07 = MPC_MULTIPLY_FRACT_CONST_FIX((A05 - A06) , 1.3065630198f , 2);
+    B08 =  A08 + A11;
+    B09 =  A09 + A10;
+    B10 = MPC_MULTIPLY_FRACT_CONST_FIX((A08 - A11) , 0.5411961079f , 1);
+    B11 = MPC_MULTIPLY_FRACT_CONST_FIX((A09 - A10) , 1.3065630198f , 2);
+    B12 =  A12 + A15;
+    B13 =  A13 + A14;
+    B14 = MPC_MULTIPLY_FRACT_CONST_FIX((A12 - A15) , 0.5411961079f , 1);
+    B15 = MPC_MULTIPLY_FRACT_CONST_FIX((A13 - A14) , 1.3065630198f , 2);
+
+    A00 =  B00 + B01;
+    A01 = MPC_MULTIPLY_FRACT_CONST_FIX((B00 - B01) , 0.7071067691f , 1);
+    A02 =  B02 + B03;
+    A03 = MPC_MULTIPLY_FRACT_CONST_FIX((B02 - B03) , 0.7071067691f , 1);
+    A04 =  B04 + B05;
+    A05 = MPC_MULTIPLY_FRACT_CONST_FIX((B04 - B05) , 0.7071067691f , 1);
+    A06 =  B06 + B07;
+    A07 = MPC_MULTIPLY_FRACT_CONST_FIX((B06 - B07) , 0.7071067691f , 1);
+    A08 =  B08 + B09;
+    A09 = MPC_MULTIPLY_FRACT_CONST_FIX((B08 - B09) , 0.7071067691f , 1);
+    A10 =  B10 + B11;
+    A11 = MPC_MULTIPLY_FRACT_CONST_FIX((B10 - B11) , 0.7071067691f , 1);
+    A12 =  B12 + B13;
+    A13 = MPC_MULTIPLY_FRACT_CONST_FIX((B12 - B13) , 0.7071067691f , 1);
+    A14 =  B14 + B15;
+    A15 = MPC_MULTIPLY_FRACT_CONST_FIX((B14 - B15) , 0.7071067691f , 1);
+
+    V[48] = -A00;
+    V[ 0] =  A01;
+    V[40] = -A02 - (V[ 8] = A03);
+    V[36] = -((V[ 4] = A05 + (V[12] = A07)) + A06);
+    V[44] = - A04 - A06 - A07;
+    V[ 6] = (V[10] = A11 + (V[14] = A15)) + A13;
+    V[38] = (V[34] = -(V[ 2] = A09 + A13 + A15) - A14) + A09 - A10 - A11;
+    V[46] = (tmp = -(A12 + A14 + A15)) - A08;
+    V[42] = tmp - A10 - A11;
+
+    A00 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 0] - Sample[31]) , 0.5006030202f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A01 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 1] - Sample[30]) , 0.5054709315f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A02 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 2] - Sample[29]) , 0.5154473186f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A03 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 3] - Sample[28]) , 0.5310425758f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A04 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 4] - Sample[27]) , 0.5531039238f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A05 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 5] - Sample[26]) , 0.5829349756f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A06 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 6] - Sample[25]) , 0.6225041151f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A07 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 7] - Sample[24]) , 0.6748083234f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A08 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 8] - Sample[23]) , 0.7445362806f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A09 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[ 9] - Sample[22]) , 0.8393496275f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A10 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[10] - Sample[21]) , 0.9725682139f ,     MPC_FIXED_POINT_SYNTH_FIX);
+#if MPC_FIXED_POINT_SYNTH_FIX>=2
+    A11 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[11] - Sample[20]) , 1.1694399118f ,     MPC_FIXED_POINT_SYNTH_FIX);
+    A12 = MPC_MULTIPLY_FRACT_CONST_SHR((Sample[12] - Sample[19]) , 1.4841645956f ,     MPC_FIXED_POINT_SYNTH_FIX);
+#else
+    A11 = MPC_SCALE_CONST_SHR         ((Sample[11] - Sample[20]) , 1.1694399118f , 30, MPC_FIXED_POINT_SYNTH_FIX);
+    A12 = MPC_SCALE_CONST_SHR         ((Sample[12] - Sample[19]) , 1.4841645956f , 30, MPC_FIXED_POINT_SYNTH_FIX);
+#endif
+    A13 = MPC_SCALE_CONST_SHR         ((Sample[13] - Sample[18]) , 2.0577809811f , 29, MPC_FIXED_POINT_SYNTH_FIX);
+    A14 = MPC_SCALE_CONST_SHR         ((Sample[14] - Sample[17]) , 3.4076085091f , 29, MPC_FIXED_POINT_SYNTH_FIX);
+    A15 = MPC_SCALE_CONST_SHR         ((Sample[15] - Sample[16]) , 10.1900081635f, 27 ,MPC_FIXED_POINT_SYNTH_FIX);
+
+    B00 =  A00 + A15;
+    B01 =  A01 + A14;
+    B02 =  A02 + A13;
+    B03 =  A03 + A12;
+    B04 =  A04 + A11;
+    B05 =  A05 + A10;
+    B06 =  A06 + A09;
+    B07 =  A07 + A08;
+    B08 = MPC_SCALE_CONST((A00 - A15) , 0.5024192929f , 31);
+    B09 = MPC_SCALE_CONST((A01 - A14) , 0.5224986076f , 31);
+    B10 = MPC_SCALE_CONST((A02 - A13) , 0.5669440627f , 31);
+    B11 = MPC_SCALE_CONST((A03 - A12) , 0.6468217969f , 31);
+    B12 = MPC_SCALE_CONST((A04 - A11) , 0.7881546021f , 31);
+    B13 = MPC_SCALE_CONST((A05 - A10) , 1.0606776476f , 30);
+    B14 = MPC_SCALE_CONST((A06 - A09) , 1.7224471569f , 30);
+    B15 = MPC_SCALE_CONST((A07 - A08) , 5.1011486053f , 28);
+
+    A00 =  B00 + B07;
+    A01 =  B01 + B06;
+    A02 =  B02 + B05;
+    A03 =  B03 + B04;
+    A04 = MPC_SCALE_CONST((B00 - B07) , 0.5097956061f , 31);
+    A05 = MPC_SCALE_CONST((B01 - B06) , 0.6013448834f , 31);
+    A06 = MPC_SCALE_CONST((B02 - B05) , 0.8999761939f , 31);
+    A07 = MPC_SCALE_CONST((B03 - B04) , 2.5629155636f , 29);
+    A08 =  B08 + B15;
+    A09 =  B09 + B14;
+    A10 =  B10 + B13;
+    A11 =  B11 + B12;
+    A12 = MPC_SCALE_CONST((B08 - B15) , 0.5097956061f , 31);
+    A13 = MPC_SCALE_CONST((B09 - B14) , 0.6013448834f , 31);
+    A14 = MPC_SCALE_CONST((B10 - B13) , 0.8999761939f , 31);
+    A15 = MPC_SCALE_CONST((B11 - B12) , 2.5629155636f , 29);
+
+    B00 =  A00 + A03;
+    B01 =  A01 + A02;
+    B02 = MPC_SCALE_CONST((A00 - A03) , 0.5411961079f , 31);
+    B03 = MPC_SCALE_CONST((A01 - A02) , 1.3065630198f , 30);
+    B04 =  A04 + A07;
+    B05 =  A05 + A06;
+    B06 = MPC_SCALE_CONST((A04 - A07) , 0.5411961079f , 31);
+    B07 = MPC_SCALE_CONST((A05 - A06) , 1.3065630198f , 30);
+    B08 =  A08 + A11;
+    B09 =  A09 + A10;
+    B10 = MPC_SCALE_CONST((A08 - A11) , 0.5411961079f , 31);
+    B11 = MPC_SCALE_CONST((A09 - A10) , 1.3065630198f , 30);
+    B12 =  A12 + A15;
+    B13 =  A13 + A14;
+    B14 = MPC_SCALE_CONST((A12 - A15) , 0.5411961079f , 31);
+    B15 = MPC_SCALE_CONST((A13 - A14) , 1.3065630198f , 30);
+
+    A00 = MPC_SHL(B00 + B01, MPC_FIXED_POINT_SYNTH_FIX);
+    A01 = MPC_SCALE_CONST_SHL((B00 - B01) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A02 = MPC_SHL(B02 + B03, MPC_FIXED_POINT_SYNTH_FIX);
+    A03 = MPC_SCALE_CONST_SHL((B02 - B03) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A04 = MPC_SHL(B04 + B05, MPC_FIXED_POINT_SYNTH_FIX);
+    A05 = MPC_SCALE_CONST_SHL((B04 - B05) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A06 = MPC_SHL(B06 + B07, MPC_FIXED_POINT_SYNTH_FIX);
+    A07 = MPC_SCALE_CONST_SHL((B06 - B07) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A08 = MPC_SHL(B08 + B09, MPC_FIXED_POINT_SYNTH_FIX);
+    A09 = MPC_SCALE_CONST_SHL((B08 - B09) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A10 = MPC_SHL(B10 + B11, MPC_FIXED_POINT_SYNTH_FIX);
+    A11 = MPC_SCALE_CONST_SHL((B10 - B11) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A12 = MPC_SHL(B12 + B13, MPC_FIXED_POINT_SYNTH_FIX);
+    A13 = MPC_SCALE_CONST_SHL((B12 - B13) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+    A14 = MPC_SHL(B14 + B15, MPC_FIXED_POINT_SYNTH_FIX);
+    A15 = MPC_SCALE_CONST_SHL((B14 - B15) , 0.7071067691f , 31, MPC_FIXED_POINT_SYNTH_FIX);
+
+    // mehrfach verwendete Ausdrücke: A04+A06+A07, A09+A13+A15
+    V[ 5] = (V[11] = (V[13] = A07 + (V[15] = A15)) + A11) + A05 + A13;
+    V[ 7] = (V[ 9] = A03 + A11 + A15) + A13;
+    V[33] = -(V[ 1] = A01 + A09 + A13 + A15) - A14;
+    V[35] = -(V[ 3] = A05 + A07 + A09 + A13 + A15) - A06 - A14;
+    V[37] = (tmp = -(A10 + A11 + A13 + A14 + A15)) - A05 - A06 - A07;
+    V[39] = tmp - A02 - A03;                      // abhängig vom Befehl drüber
+    V[41] = (tmp += A13 - A12) - A02 - A03;       // abhängig vom Befehl 2 drüber
+    V[43] = tmp - A04 - A06 - A07;                // abhängig von Befehlen 1 und 3 drüber
+    V[47] = (tmp = -(A08 + A12 + A14 + A15)) - A00;
+    V[45] = tmp - A04 - A06 - A07;                // abhängig vom Befehl drüber
+
+    V[32] = -V[ 0];
+    V[31] = -V[ 1];
+    V[30] = -V[ 2];
+    V[29] = -V[ 3];
+    V[28] = -V[ 4];
+    V[27] = -V[ 5];
+    V[26] = -V[ 6];
+    V[25] = -V[ 7];
+    V[24] = -V[ 8];
+    V[23] = -V[ 9];
+    V[22] = -V[10];
+    V[21] = -V[11];
+    V[20] = -V[12];
+    V[19] = -V[13];
+    V[18] = -V[14];
+    V[17] = -V[15];
+
+    V[63] =  V[33];
+    V[62] =  V[34];
+    V[61] =  V[35];
+    V[60] =  V[36];
+    V[59] =  V[37];
+    V[58] =  V[38];
+    V[57] =  V[39];
+    V[56] =  V[40];
+    V[55] =  V[41];
+    V[54] =  V[42];
+    V[53] =  V[43];
+    V[52] =  V[44];
+    V[51] =  V[45];
+    V[50] =  V[46];
+    V[49] =  V[47];
+}
+
+static void Synthese_Filter_float_internal(MPC_SAMPLE_FORMAT * OutData,MPC_SAMPLE_FORMAT * V,const MPC_SAMPLE_FORMAT * Y)
+{
+    mpc_uint32_t n;
+    for ( n = 0; n < 36; n++, Y += 32 ) {
+        V -= 64;
+        Calculate_New_V ( Y, V );
+        {
+            MPC_SAMPLE_FORMAT * Data = OutData;
+            const MPC_SAMPLE_FORMAT *  D = (const MPC_SAMPLE_FORMAT *) &Di_opt;
+            mpc_int32_t           k;
+            //mpc_int32_t           tmp;
+
+            
+            
+            for ( k = 0; k < 32; k++, D += 16, V++ ) {
+                *Data = MPC_SHL(
+                    MPC_MULTIPLY_FRACT(V[  0],D[ 0]) + MPC_MULTIPLY_FRACT(V[ 96],D[ 1]) + MPC_MULTIPLY_FRACT(V[128],D[ 2]) + MPC_MULTIPLY_FRACT(V[224],D[ 3])
+                    + MPC_MULTIPLY_FRACT(V[256],D[ 4]) + MPC_MULTIPLY_FRACT(V[352],D[ 5]) + MPC_MULTIPLY_FRACT(V[384],D[ 6]) + MPC_MULTIPLY_FRACT(V[480],D[ 7])
+                    + MPC_MULTIPLY_FRACT(V[512],D[ 8]) + MPC_MULTIPLY_FRACT(V[608],D[ 9]) + MPC_MULTIPLY_FRACT(V[640],D[10]) + MPC_MULTIPLY_FRACT(V[736],D[11])
+                    + MPC_MULTIPLY_FRACT(V[768],D[12]) + MPC_MULTIPLY_FRACT(V[864],D[13]) + MPC_MULTIPLY_FRACT(V[896],D[14]) + MPC_MULTIPLY_FRACT(V[992],D[15])
+                    , 2);
+                
+                Data += 2;
+            }
+            V -= 32;//bleh
+            OutData+=64;
+        }
+    }
+}
+
+void
+mpc_decoder_synthese_filter_float(mpc_decoder *d, MPC_SAMPLE_FORMAT* OutData) 
+{
+    /********* left channel ********/
+    memmove(d->V_L + MPC_V_MEM, d->V_L, 960 * sizeof(MPC_SAMPLE_FORMAT) );
+
+    Synthese_Filter_float_internal(
+        OutData,
+        (MPC_SAMPLE_FORMAT *)(d->V_L + MPC_V_MEM),
+        (MPC_SAMPLE_FORMAT *)(d->Y_L [0]));
+
+    /******** right channel ********/
+    memmove(d->V_R + MPC_V_MEM, d->V_R, 960 * sizeof(MPC_SAMPLE_FORMAT) );
+
+    Synthese_Filter_float_internal(
+        OutData + 1,
+        (MPC_SAMPLE_FORMAT *)(d->V_R + MPC_V_MEM),
+        (MPC_SAMPLE_FORMAT *)(d->Y_R [0]));
+}
+
+/*******************************************/
+/*                                         */
+/*            dithered synthesis           */
+/*                                         */
+/*******************************************/
+
+static const unsigned char    Parity [256] = {  // parity
+    0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
+    1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
+    1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
+    0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
+    1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
+    0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
+    0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
+    1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0
+};
+
+/*
+ *  This is a simple random number generator with good quality for audio purposes.
+ *  It consists of two polycounters with opposite rotation direction and different
+ *  periods. The periods are coprime, so the total period is the product of both.
+ *
+ *     -------------------------------------------------------------------------------------------------
+ * +-> |31:30:29:28:27:26:25:24:23:22:21:20:19:18:17:16:15:14:13:12:11:10: 9: 8: 7: 6: 5: 4: 3: 2: 1: 0|
+ * |   -------------------------------------------------------------------------------------------------
+ * |                                                                          |  |  |  |     |        |
+ * |                                                                          +--+--+--+-XOR-+--------+
+ * |                                                                                      |
+ * +--------------------------------------------------------------------------------------+
+ *
+ *     -------------------------------------------------------------------------------------------------
+ *     |31:30:29:28:27:26:25:24:23:22:21:20:19:18:17:16:15:14:13:12:11:10: 9: 8: 7: 6: 5: 4: 3: 2: 1: 0| <-+
+ *     -------------------------------------------------------------------------------------------------   |
+ *       |  |           |  |                                                                               |
+ *       +--+----XOR----+--+                                                                               |
+ *                |                                                                                        |
+ *                +----------------------------------------------------------------------------------------+
+ *
+ *
+ *  The first has an period of 3*5*17*257*65537, the second of 7*47*73*178481,
+ *  which gives a period of 18.410.713.077.675.721.215. The result is the
+ *  XORed values of both generators.
+ */
+mpc_uint32_t
+mpc_random_int(mpc_decoder *d) 
+{
+#if 1
+    mpc_uint32_t  t1, t2, t3, t4;
+
+    t3   = t1 = d->__r1;   t4   = t2 = d->__r2;  // Parity calculation is done via table lookup, this is also available
+    t1  &= 0xF5;        t2 >>= 25;               // on CPUs without parity, can be implemented in C and avoid unpredictable
+    t1   = Parity [t1]; t2  &= 0x63;             // jumps and slow rotate through the carry flag operations.
+    t1 <<= 31;          t2   = Parity [t2];
+
+    return (d->__r1 = (t3 >> 1) | t1 ) ^ (d->__r2 = (t4 + t4) | t2 );
+#else
+    return (d->__r1 = (d->__r1 >> 1) | ((mpc_uint32_t)Parity [d->__r1 & 0xF5] << 31) ) ^
+        (d->__r2 = (d->__r2 << 1) |  (mpc_uint32_t)Parity [(d->__r2 >> 25) & 0x63] );
+#endif
+}
Index: /libmpcdec/tags/release-1.2/win32/libmpcdec.dsp
===================================================================
--- /libmpcdec/tags/release-1.2/win32/libmpcdec.dsp	(revision 30)
+++ /libmpcdec/tags/release-1.2/win32/libmpcdec.dsp	(revision 30)
@@ -0,0 +1,233 @@
+# Microsoft Developer Studio Project File - Name="libmpcdec" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=libmpcdec - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "libmpcdec.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "libmpcdec.mak" CFG="libmpcdec - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "libmpcdec - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "libmpcdec - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=xicl6.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "LibRelease"
+# PROP Intermediate_Dir "LibRelease"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /W3 /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "MPC_LITTLE_ENDIAN" /FR /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=xilink6.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "LibDebug"
+# PROP Intermediate_Dir "LibDebug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "MPC_LITTLE_ENDIAN" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=xilink6.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ENDIF 
+
+# Begin Target
+
+# Name "libmpcdec - Win32 Release"
+# Name "libmpcdec - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\src\huffsv46.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\huffsv7.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\idtag.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\mpc_decoder.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\mpc_reader.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\requant.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\streaminfo.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\synth_filter.c
+
+!IF  "$(CFG)" == "libmpcdec - Win32 Release"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF  "$(CFG)" == "libmpcdec - Win32 Debug"
+
+!ENDIF 
+
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\include\mpcdec\config_win32.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\decoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\huffman.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\internal.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\math.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\mpcdec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\reader.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\requant.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\mpcdec\streaminfo.h
+# End Source File
+# End Group
+# End Target
+# End Project
Index: /libmpcdec/tags/release-1.2/win32/libmpcdec.dsw
===================================================================
--- /libmpcdec/tags/release-1.2/win32/libmpcdec.dsw	(revision 30)
+++ /libmpcdec/tags/release-1.2/win32/libmpcdec.dsw	(revision 30)
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "libmpcdec"=".\libmpcdec.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
Index: /libmpcdec/tags/release-1.2/win32/sample.dsp
===================================================================
--- /libmpcdec/tags/release-1.2/win32/sample.dsp	(revision 30)
+++ /libmpcdec/tags/release-1.2/win32/sample.dsp	(revision 30)
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="sample" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=sample - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "sample.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "sample.mak" CFG="sample - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "sample - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "sample - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=xicl6.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "sample - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "sample___Win32_Release"
+# PROP BASE Intermediate_Dir "sample___Win32_Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "SampleRelease"
+# PROP Intermediate_Dir "SampleRelease"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmpcdec.lib /nologo /subsystem:console /machine:I386 /libpath:"libRelease"
+
+!ELSEIF  "$(CFG)" == "sample - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "sample___Win32_Debug"
+# PROP BASE Intermediate_Dir "sample___Win32_Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "SampleDebug"
+# PROP Intermediate_Dir "SampleDebug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "MPC_LITTLE_ENDIAN" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmpcdec.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"libDebug"
+# SUBTRACT LINK32 /nodefaultlib
+
+!ENDIF 
+
+# Begin Target
+
+# Name "sample - Win32 Release"
+# Name "sample - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\src\sample.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
Index: /libmpcdec/tags/release-1.2/win32/sample.dsw
===================================================================
--- /libmpcdec/tags/release-1.2/win32/sample.dsw	(revision 30)
+++ /libmpcdec/tags/release-1.2/win32/sample.dsw	(revision 30)
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "sample"=".\sample.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
