[Scummvm-cvs-logs] scummvm master -> 47e9a6ccdc6a162309ddaba2e6f6f83d5a047990

Littleboy littleboy22 at gmail.com
Mon Jul 4 20:37:27 CEST 2011


This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
3afa4c312f DISTS: Add Windows Game Explorer xml resource
f88ef9b965 NSIS: Register with game explorer on installation
de8c606c12 NSIS: Handle case when the Games.dll plugin cannot be loaded (and skip shortcut creation)
14733b6112 CREATE_PROJECT: Remove copying of README-SDL in postbuild command script
47e9a6ccdc LASTEXPRESS: Move sound filtering to base Sound class


Commit: 3afa4c312f0161c1162eb0b14ca9e02c5c277b52
    https://github.com/scummvm/scummvm/commit/3afa4c312f0161c1162eb0b14ca9e02c5c277b52
Author: Littleboy (littleboy at users.sourceforge.net)
Date: 2011-07-04T11:26:24-07:00

Commit Message:
DISTS: Add Windows Game Explorer xml resource

Changed paths:
  A dists/win32/scummvm.gdf.xml
    dists/scummvm.rc
    dists/scummvm.rc.in



diff --git a/dists/scummvm.rc b/dists/scummvm.rc
index 55f9dfb..9fa5489 100644
--- a/dists/scummvm.rc
+++ b/dists/scummvm.rc
@@ -7,10 +7,13 @@
 #define FILE 256
 #define IDI_ICON  1001
 #define IDI_COUNT 1002
+#define ID_GDF_XML __GDF_XML
 
 IDI_ICON               ICON    DISCARDABLE     "icons/scummvm.ico"
 IDI_COUNT              ICON    DISCARDABLE     "icons/count.ico"
 
+ID_GDF_XML             DATA    "dists/win32/scummvm.gdf.xml"
+
 scummmodern.zip        FILE    "gui/themes/scummmodern.zip"
 #ifdef USE_TRANSLATION
 translations.dat       FILE    "gui/themes/translations.dat"
diff --git a/dists/scummvm.rc.in b/dists/scummvm.rc.in
index 2fd3946..b91e7eb 100644
--- a/dists/scummvm.rc.in
+++ b/dists/scummvm.rc.in
@@ -7,10 +7,13 @@
 #define FILE 256
 #define IDI_ICON  1001
 #define IDI_COUNT 1002
+#define ID_GDF_XML __GDF_XML
 
 IDI_ICON               ICON    DISCARDABLE     "icons/scummvm.ico"
 IDI_COUNT              ICON    DISCARDABLE     "icons/count.ico"
 
+ID_GDF_XML             DATA    "dists/win32/scummvm.gdf.xml"
+
 scummmodern.zip        FILE    "gui/themes/scummmodern.zip"
 #ifdef USE_TRANSLATION
 translations.dat       FILE    "gui/themes/translations.dat"
diff --git a/dists/win32/scummvm.gdf.xml b/dists/win32/scummvm.gdf.xml
new file mode 100644
index 0000000..899260e
--- /dev/null
+++ b/dists/win32/scummvm.gdf.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<GameDefinitionFile xmlns:baseTypes="urn:schemas-microsoft-com:GamesExplorerBaseTypes.v1" xmlns="urn:schemas-microsoft-com:GameDescription.v1">
+    <GameDefinition gameID="{F2475C5C-EA7C-41F0-A56D-1ABF7CFEA389}">
+        <Name>ScummVM</Name>
+        <Description>ScummVM is a program which allows you to run certain classic graphical point-and-click adventure games, provided you already have their data files. The clever part about this: ScummVM just replaces the executables shipped with the games, allowing you to play them on systems for which they were never designed!</Description>
+        <ReleaseDate>2011-09-30</ReleaseDate>
+        <Genres>
+            <Genre>Adventure</Genre>
+        </Genres>
+        <Version>
+            <VersionFile path="scummvm.exe" />
+        </Version>
+        <WindowsSystemPerformanceRating minimum="1.0" recommended="2.0" />
+        <Developers>
+            <Developer URI="http://www.scummvm.org">The ScummVM Team</Developer>
+        </Developers>
+        <Publishers>
+            <Publisher URI="http://www.scummvm.org">The ScummVM Team</Publisher>
+        </Publishers>
+        <GameExecutables>
+            <GameExecutable path="scummvm.exe" />
+        </GameExecutables>
+        <ExtendedProperties>
+            <GameTasks>
+                <Play>
+                    <Primary>
+                        <FileTask path="scummvm.exe" arguments="-noconsole" />
+                    </Primary>
+                </Play>
+                <Support>
+                    <Task index="0" name="View README">
+                        <FileTask path="README.txt" arguments="" />
+                    </Task>
+                    <Task index="1" name="ScummVM Website">
+                        <URLTask Link="http://www.scummvm.org" />
+                    </Task>
+                </Support>
+            </GameTasks>
+        </ExtendedProperties>
+    </GameDefinition>
+</GameDefinitionFile>
\ No newline at end of file


Commit: f88ef9b96589f29104ffd2b3900d6ed7bf8ed343
    https://github.com/scummvm/scummvm/commit/f88ef9b96589f29104ffd2b3900d6ed7bf8ed343
Author: Littleboy (littleboy at users.sourceforge.net)
Date: 2011-07-04T11:26:26-07:00

Commit Message:
NSIS: Register with game explorer on installation

Changed paths:
  A dists/win32/plugins/Games.dll
    dists/win32/scummvm.gdf.xml
    dists/win32/scummvm.nsi
    dists/win32/scummvm.nsi.in



diff --git a/dists/win32/plugins/Games.dll b/dists/win32/plugins/Games.dll
new file mode 100644
index 0000000..3a378b7
Binary files /dev/null and b/dists/win32/plugins/Games.dll differ
diff --git a/dists/win32/scummvm.gdf.xml b/dists/win32/scummvm.gdf.xml
index 899260e..1c50924 100644
--- a/dists/win32/scummvm.gdf.xml
+++ b/dists/win32/scummvm.gdf.xml
@@ -24,8 +24,11 @@
             <GameTasks>
                 <Play>
                     <Primary>
-                        <FileTask path="scummvm.exe" arguments="-noconsole" />
+                        <FileTask path="scummvm.exe" arguments="--no-console" />
                     </Primary>
+                    <Task index="1" name="Play (console)">
+                        <FileTask path="scummvm.exe" arguments="" />
+                    </Task>
                 </Play>
                 <Support>
                     <Task index="0" name="View README">
diff --git a/dists/win32/scummvm.nsi b/dists/win32/scummvm.nsi
index 480f8f4..f5eb584 100644
--- a/dists/win32/scummvm.nsi
+++ b/dists/win32/scummvm.nsi
@@ -20,12 +20,20 @@
 
 #!define _DEBUG
 #!define _INCLUDE_DATA_FILES
+!define _ENABLE_GAME_EXPLORER
+#!define _LOG_BUILD
+!define _CONVERT_TEXT
 
 Name ScummVM
 
 # Included files
 !include MUI2.nsh
 
+# Plugins
+!ifdef _ENABLE_GAME_EXPLORER
+!AddPluginDir "./plugins"
+!endif
+
 #########################################################################################
 # Command line options
 #########################################################################################
@@ -221,6 +229,9 @@ Var StartMenuGroup
 # Installer sections
 #########################################################################################
 Section "ScummVM" SecMain
+!ifdef _LOG_BUILD
+	LogSet on
+!endif
 	SetOutPath $INSTDIR
 	SetOverwrite on
 
@@ -232,6 +243,7 @@ Section "ScummVM" SecMain
 	File /oname=NEWS.txt         "${top_srcdir}\NEWS"
 	File /oname=README.txt       "${top_srcdir}\README"
 	
+!ifdef _CONVERT_TEXT
 	# Convert line endings
 	Push "$INSTDIR\AUTHORS.txt"
 	Call unix2dos
@@ -245,6 +257,7 @@ Section "ScummVM" SecMain
 	Call unix2dos
 	Push "$INSTDIR\README.txt"
 	Call unix2dos
+!endif
 
 !ifdef _INCLUDE_DATA_FILES
 	# Engine data
@@ -271,6 +284,22 @@ Section "ScummVM" SecMain
 	File "${staging_dir}\SDL.dll"
 
 	WriteRegStr HKCU "${REGKEY}" InstallPath "$INSTDIR"    ; Store installation folder
+	
+	#Register with game explorer
+!ifdef _ENABLE_GAME_EXPLORER
+	Games::registerGame "$INSTDIR\scummvm.exe"
+	pop $0
+	# This is for Vista only, for 7 the tasks are defined in the gdf xml
+	${If} $0 != "0"
+	${AndIf} $0 != ""
+		CreateDirectory "$0\PlayTasks\0"
+		CreateShortcut "$0\PlayTasks\0\Play.lnk" "$INSTDIR\scummvm.exe" "--no-console"
+		CreateDirectory "$0\PlayTasks\1"
+		CreateShortcut "$0\PlayTasks\1\Play (console).lnk" "$INSTDIR\scummvm.exe"
+		CreateDirectory "$0\SupportTasks\0"
+		CreateShortcut "$0\SupportTasks\0\Home Page.lnk" "${URL}"
+	${EndIf}
+!endif
 SectionEnd
 
 # Write Start menu entries and uninstaller
@@ -280,7 +309,8 @@ Section -post SecMainPost
 	!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
 	SetShellVarContext all     ; Create shortcuts in the all-users folder
 	CreateDirectory "$SMPROGRAMS\$StartMenuGroup"
-	CreateShortCut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk"           $INSTDIR\$(^Name).exe "" "$INSTDIR\$(^Name).exe" 0    ; Create shortcut with icon
+	CreateShortCut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk"              $INSTDIR\$(^Name).exe "" "$INSTDIR\$(^Name).exe" 0    ; Create shortcut with icon
+	CreateShortCut "$SMPROGRAMS\$StartMenuGroup\$(^Name) (No console).lnk" $INSTDIR\$(^Name).exe "--no-console" "$INSTDIR\$(^Name).exe" 0
 	CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Readme.lnk"             $INSTDIR\README.txt
 	CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe
 	!insertmacro MUI_STARTMENU_WRITE_END
@@ -334,6 +364,10 @@ Section -un.Main SecUninstall
 	Delete /REBOOTOK $INSTDIR\translations.dat
 !endif
 
+!ifdef _ENABLE_GAME_EXPLORER
+	Games::unregisterGame "$INSTDIR\scummvm.exe"
+!endif
+
 	Delete /REBOOTOK $INSTDIR\scummvm.exe
 	Delete /REBOOTOK $INSTDIR\SDL.dll
 SectionEnd
@@ -374,6 +408,7 @@ FunctionEnd
 # Helper functions
 #########################################################################################
 
+!ifdef _CONVERT_TEXT
 ;-------------------------------------------------------------------------------
 ; strips all CRs and then converts all LFs into CRLFs
 ; (this is roughly equivalent to "cat file | dos2unix | unix2dos")
@@ -426,3 +461,4 @@ unix2dos_done:
 	Pop $0
 	Delete $0.U2D
 FunctionEnd
+!endif
diff --git a/dists/win32/scummvm.nsi.in b/dists/win32/scummvm.nsi.in
index a87f5d6..51a2999 100644
--- a/dists/win32/scummvm.nsi.in
+++ b/dists/win32/scummvm.nsi.in
@@ -20,12 +20,20 @@
 
 #!define _DEBUG
 #!define _INCLUDE_DATA_FILES
+!define _ENABLE_GAME_EXPLORER
+#!define _LOG_BUILD
+!define _CONVERT_TEXT
 
 Name ScummVM
 
 # Included files
 !include MUI2.nsh
 
+# Plugins
+!ifdef _ENABLE_GAME_EXPLORER
+!AddPluginDir "./plugins"
+!endif
+
 #########################################################################################
 # Command line options
 #########################################################################################
@@ -221,6 +229,9 @@ Var StartMenuGroup
 # Installer sections
 #########################################################################################
 Section "ScummVM" SecMain
+!ifdef _LOG_BUILD
+	LogSet on
+!endif
 	SetOutPath $INSTDIR
 	SetOverwrite on
 
@@ -232,6 +243,7 @@ Section "ScummVM" SecMain
 	File /oname=NEWS.txt         "${top_srcdir}\NEWS"
 	File /oname=README.txt       "${top_srcdir}\README"
 	
+!ifdef _CONVERT_TEXT
 	# Convert line endings
 	Push "$INSTDIR\AUTHORS.txt"
 	Call unix2dos
@@ -245,6 +257,7 @@ Section "ScummVM" SecMain
 	Call unix2dos
 	Push "$INSTDIR\README.txt"
 	Call unix2dos
+!endif
 
 !ifdef _INCLUDE_DATA_FILES
 	# Engine data
@@ -271,6 +284,22 @@ Section "ScummVM" SecMain
 	File "${staging_dir}\SDL.dll"
 
 	WriteRegStr HKCU "${REGKEY}" InstallPath "$INSTDIR"    ; Store installation folder
+	
+	#Register with game explorer
+!ifdef _ENABLE_GAME_EXPLORER
+	Games::registerGame "$INSTDIR\scummvm.exe"
+	pop $0
+	# This is for Vista only, for 7 the tasks are defined in the gdf xml
+	${If} $0 != "0"
+	${AndIf} $0 != ""
+		CreateDirectory "$0\PlayTasks\0"
+		CreateShortcut "$0\PlayTasks\0\Play.lnk" "$INSTDIR\scummvm.exe" "--no-console"
+		CreateDirectory "$0\PlayTasks\1"
+		CreateShortcut "$0\PlayTasks\1\Play (console).lnk" "$INSTDIR\scummvm.exe"
+		CreateDirectory "$0\SupportTasks\0"
+		CreateShortcut "$0\SupportTasks\0\Home Page.lnk" "${URL}"
+	${EndIf}
+!endif
 SectionEnd
 
 # Write Start menu entries and uninstaller
@@ -280,7 +309,8 @@ Section -post SecMainPost
 	!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
 	SetShellVarContext all     ; Create shortcuts in the all-users folder
 	CreateDirectory "$SMPROGRAMS\$StartMenuGroup"
-	CreateShortCut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk"           $INSTDIR\$(^Name).exe "" "$INSTDIR\$(^Name).exe" 0    ; Create shortcut with icon
+	CreateShortCut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk"              $INSTDIR\$(^Name).exe "" "$INSTDIR\$(^Name).exe" 0    ; Create shortcut with icon
+	CreateShortCut "$SMPROGRAMS\$StartMenuGroup\$(^Name) (No console).lnk" $INSTDIR\$(^Name).exe "--no-console" "$INSTDIR\$(^Name).exe" 0
 	CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Readme.lnk"             $INSTDIR\README.txt
 	CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe
 	!insertmacro MUI_STARTMENU_WRITE_END
@@ -334,6 +364,10 @@ Section -un.Main SecUninstall
 	Delete /REBOOTOK $INSTDIR\translations.dat
 !endif
 
+!ifdef _ENABLE_GAME_EXPLORER
+	Games::unregisterGame "$INSTDIR\scummvm.exe"
+!endif
+
 	Delete /REBOOTOK $INSTDIR\scummvm.exe
 	Delete /REBOOTOK $INSTDIR\SDL.dll
 SectionEnd
@@ -374,6 +408,7 @@ FunctionEnd
 # Helper functions
 #########################################################################################
 
+!ifdef _CONVERT_TEXT
 ;-------------------------------------------------------------------------------
 ; strips all CRs and then converts all LFs into CRLFs
 ; (this is roughly equivalent to "cat file | dos2unix | unix2dos")
@@ -426,3 +461,4 @@ unix2dos_done:
 	Pop $0
 	Delete $0.U2D
 FunctionEnd
+!endif


Commit: de8c606c1224009a7f4cb92a7f212157a6160966
    https://github.com/scummvm/scummvm/commit/de8c606c1224009a7f4cb92a7f212157a6160966
Author: Littleboy (littleboy at users.sourceforge.net)
Date: 2011-07-04T11:26:27-07:00

Commit Message:
NSIS: Handle case when the Games.dll plugin cannot be loaded (and skip shortcut creation)

Changed paths:
    dists/win32/scummvm.nsi
    dists/win32/scummvm.nsi.in



diff --git a/dists/win32/scummvm.nsi b/dists/win32/scummvm.nsi
index f5eb584..01a7e72 100644
--- a/dists/win32/scummvm.nsi
+++ b/dists/win32/scummvm.nsi
@@ -292,6 +292,7 @@ Section "ScummVM" SecMain
 	# This is for Vista only, for 7 the tasks are defined in the gdf xml
 	${If} $0 != "0"
 	${AndIf} $0 != ""
+	${AndIf} $0 != "$INSTDIR\scummvm.exe"
 		CreateDirectory "$0\PlayTasks\0"
 		CreateShortcut "$0\PlayTasks\0\Play.lnk" "$INSTDIR\scummvm.exe" "--no-console"
 		CreateDirectory "$0\PlayTasks\1"
diff --git a/dists/win32/scummvm.nsi.in b/dists/win32/scummvm.nsi.in
index 51a2999..cba1e81 100644
--- a/dists/win32/scummvm.nsi.in
+++ b/dists/win32/scummvm.nsi.in
@@ -292,6 +292,7 @@ Section "ScummVM" SecMain
 	# This is for Vista only, for 7 the tasks are defined in the gdf xml
 	${If} $0 != "0"
 	${AndIf} $0 != ""
+	${AndIf} $0 != "$INSTDIR\scummvm.exe"
 		CreateDirectory "$0\PlayTasks\0"
 		CreateShortcut "$0\PlayTasks\0\Play.lnk" "$INSTDIR\scummvm.exe" "--no-console"
 		CreateDirectory "$0\PlayTasks\1"


Commit: 14733b6112f214c1c37e01a21bef6de7ac463c68
    https://github.com/scummvm/scummvm/commit/14733b6112f214c1c37e01a21bef6de7ac463c68
Author: Littleboy (littleboy at users.sourceforge.net)
Date: 2011-07-04T11:26:29-07:00

Commit Message:
CREATE_PROJECT: Remove copying of README-SDL in postbuild command script

Changed paths:
    devtools/create_project/scripts/postbuild.cmd



diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd
index a5051d8..dd52c02 100644
--- a/devtools/create_project/scripts/postbuild.cmd
+++ b/devtools/create_project/scripts/postbuild.cmd
@@ -23,23 +23,7 @@ if "%~5"=="" goto error_installer
 echo Copying data files

 echo.

 

-REM xcopy /F /Y "%~1/AUTHORS" %~2       1>NUL 2>&1

-REM xcopy /F /Y "%~1/COPYING.GPL" %~2   1>NUL 2>&1

-REM xcopy /F /Y "%~1/COPYING" %~2       1>NUL 2>&1

-REM xcopy /F /Y "%~1/COPYING.LGPL" %~2  1>NUL 2>&1

-REM xcopy /F /Y "%~1/COPYRIGHT" %~2     1>NUL 2>&1

-REM xcopy /F /Y "%~1/NEWS" %~2          1>NUL 2>&1

-REM xcopy /F /Y "%~1/README" %~2        1>NUL 2>&1

-

-REM xcopy /F /Y "%~1/dists/engine-data/*.dat" %~2     1>NUL 2>&1

-REM xcopy /F /Y "%~1/dists/engine-data/*.tbl" %~2     1>NUL 2>&1

-REM xcopy /F /Y "%~1/dists/engine-data/*.cpt" %~2     1>NUL 2>&1

-REM xcopy /F /Y "%~1/gui/themes/*.zip" %~2            1>NUL 2>&1

-REM xcopy /F /Y "%~1/gui/themes/translations.dat" %~2 1>NUL 2>&1

-

-xcopy /F /Y "%~4/lib/%~3/SDL.dll" "%~2"             1>NUL 2>&1

-xcopy /F /Y "%~4/README-SDL" "%~2"                  1>NUL 2>&1

-

+xcopy /F /Y "%~4/lib/%~3/SDL.dll"                          "%~2" 1>NUL 2>&1

 xcopy /F /Y "%~1/backends/vkeybd/packs/vkeybd_default.zip" "%~2" 1>NUL 2>&1

 

 if "%~5"=="0" goto done



Commit: 47e9a6ccdc6a162309ddaba2e6f6f83d5a047990
    https://github.com/scummvm/scummvm/commit/47e9a6ccdc6a162309ddaba2e6f6f83d5a047990
Author: Littleboy (littleboy at users.sourceforge.net)
Date: 2011-07-04T11:26:31-07:00

Commit Message:
LASTEXPRESS: Move sound filtering to base Sound class

 - Rename kSoundStatusRemoved to kSoundStatusClosed
 - Rename kSoundStatusClear2 to kSoundStatusCached
 - Remove sound cache handling

Changed paths:
    engines/lastexpress/data/snd.cpp
    engines/lastexpress/data/snd.h
    engines/lastexpress/shared.h
    engines/lastexpress/sound/entry.cpp
    engines/lastexpress/sound/entry.h
    engines/lastexpress/sound/queue.cpp



diff --git a/engines/lastexpress/data/snd.cpp b/engines/lastexpress/data/snd.cpp
index fa2d8a2..28d20df 100644
--- a/engines/lastexpress/data/snd.cpp
+++ b/engines/lastexpress/data/snd.cpp
@@ -36,13 +36,329 @@
 
 namespace LastExpress {
 
+#pragma region Sound filters tables
+
+static const int filterData[1424] = {
+	0, 0, 0, 0, 128, 256, 384, 512, 0, 0, 0, 0, 128, 256,
+	384, 512, 0, 0, 0, 0, 192, 320, 448, 576, 0, 0, 0, 0,
+	192, 320, 448, 576, 64, 64, 64, 64, 256, 384, 512, 640,
+	64, 64, 64, 64, 256, 384, 512, 640, 128, 128, 128, 128,
+	320, 448, 576, 704, 128, 128, 128, 128, 320, 448, 576,
+	704, 192, 192, 192, 192, 384, 512, 640, 768, 192, 192,
+	192, 192, 384, 512, 640, 768, 256, 256, 256, 256, 448,
+	576, 704, 832, 256, 256, 256, 256, 448, 576, 704, 832,
+	320, 320, 320, 320, 512, 640, 768, 896, 320, 320, 320,
+	320, 512, 640, 768, 896, 384, 384, 384, 384, 576, 704,
+	832, 960, 384, 384, 384, 384, 576, 704, 832, 960, 448,
+	448, 448, 448, 640, 768, 896, 1024, 448, 448, 448, 448,
+	640, 768, 896, 1024, 512, 512, 512, 512, 704, 832, 960,
+	1088, 512, 512, 512, 512, 704, 832, 960, 1088, 576,
+	576, 576, 576, 768, 896, 1024, 1152, 576, 576, 576,
+	576, 768, 896, 1024, 1152, 640, 640, 640, 640, 832,
+	960, 1088, 1216, 640, 640, 640, 640, 832, 960, 1088,
+	1216, 704, 704, 704, 704, 896, 1024, 1152, 1280, 704,
+	704, 704, 704, 896, 1024, 1152, 1280, 768, 768, 768,
+	768, 960, 1088, 1216, 1344, 768, 768, 768, 768, 960,
+	1088, 1216, 1344, 832, 832, 832, 832, 1024, 1152, 1280,
+	1408, 832, 832, 832, 832, 1024, 1152, 1280, 1408, 896,
+	896, 896, 896, 1088, 1216, 1344, 1472, 896, 896, 896,
+	896, 1088, 1216, 1344, 1472, 960, 960, 960, 960, 1152,
+	1280, 1408, 1536, 960, 960, 960, 960, 1152, 1280, 1408,
+	1536, 1024, 1024, 1024, 1024, 1216, 1344, 1472, 1600,
+	1024, 1024, 1024, 1024, 1216, 1344, 1472, 1600, 1088,
+	1088, 1088, 1088, 1280, 1408, 1536, 1664, 1088, 1088,
+	1088, 1088, 1280, 1408, 1536, 1664, 1152, 1152, 1152,
+	1152, 1344, 1472, 1600, 1728, 1152, 1152, 1152, 1152,
+	1344, 1472, 1600, 1728, 1216, 1216, 1216, 1216, 1408,
+	1536, 1664, 1792, 1216, 1216, 1216, 1216, 1408, 1536,
+	1664, 1792, 1280, 1280, 1280, 1280, 1472, 1600, 1728,
+	1856, 1280, 1280, 1280, 1280, 1472, 1600, 1728, 1856,
+	1344, 1344, 1344, 1344, 1536, 1664, 1792, 1920, 1344,
+	1344, 1344, 1344, 1536, 1664, 1792, 1920, 1408, 1408,
+	1408, 1408, 1600, 1728, 1856, 1984, 1408, 1408, 1408,
+	1408, 1600, 1728, 1856, 1984, 1472, 1472, 1472, 1472,
+	1664, 1792, 1920, 2048, 1472, 1472, 1472, 1472, 1664,
+	1792, 1920, 2048, 1536, 1536, 1536, 1536, 1728, 1856,
+	1984, 2112, 1536, 1536, 1536, 1536, 1728, 1856, 1984,
+	2112, 1600, 1600, 1600, 1600, 1792, 1920, 2048, 2176,
+	1600, 1600, 1600, 1600, 1792, 1920, 2048, 2176, 1664,
+	1664, 1664, 1664, 1856, 1984, 2112, 2240, 1664, 1664,
+	1664, 1664, 1856, 1984, 2112, 2240, 1728, 1728, 1728,
+	1728, 1920, 2048, 2176, 2304, 1728, 1728, 1728, 1728,
+	1920, 2048, 2176, 2304, 1792, 1792, 1792, 1792, 1984,
+	2112, 2240, 2368, 1792, 1792, 1792, 1792, 1984, 2112,
+	2240, 2368, 1856, 1856, 1856, 1856, 2048, 2176, 2304,
+	2432, 1856, 1856, 1856, 1856, 2048, 2176, 2304, 2432,
+	1920, 1920, 1920, 1920, 2112, 2240, 2368, 2496, 1920,
+	1920, 1920, 1920, 2112, 2240, 2368, 2496, 1984, 1984,
+	1984, 1984, 2176, 2304, 2432, 2560, 1984, 1984, 1984,
+	1984, 2176, 2304, 2432, 2560, 2048, 2048, 2048, 2048,
+	2240, 2368, 2496, 2624, 2048, 2048, 2048, 2048, 2240,
+	2368, 2496, 2624, 2112, 2112, 2112, 2112, 2304, 2432,
+	2560, 2688, 2112, 2112, 2112, 2112, 2304, 2432, 2560,
+	2688, 2176, 2176, 2176, 2176, 2368, 2496, 2624, 2752,
+	2176, 2176, 2176, 2176, 2368, 2496, 2624, 2752, 2240,
+	2240, 2240, 2240, 2432, 2560, 2688, 2816, 2240, 2240,
+	2240, 2240, 2432, 2560, 2688, 2816, 2304, 2304, 2304,
+	2304, 2496, 2624, 2752, 2880, 2304, 2304, 2304, 2304,
+	2496, 2624, 2752, 2880, 2368, 2368, 2368, 2368, 2560,
+	2688, 2816, 2944, 2368, 2368, 2368, 2368, 2560, 2688,
+	2816, 2944, 2432, 2432, 2432, 2432, 2624, 2752, 2880,
+	3008, 2432, 2432, 2432, 2432, 2624, 2752, 2880, 3008,
+	2496, 2496, 2496, 2496, 2688, 2816, 2944, 3072, 2496,
+	2496, 2496, 2496, 2688, 2816, 2944, 3072, 2560, 2560,
+	2560, 2560, 2752, 2880, 3008, 3136, 2560, 2560, 2560,
+	2560, 2752, 2880, 3008, 3136, 2624, 2624, 2624, 2624,
+	2816, 2944, 3072, 3200, 2624, 2624, 2624, 2624, 2816,
+	2944, 3072, 3200, 2688, 2688, 2688, 2688, 2880, 3008,
+	3136, 3264, 2688, 2688, 2688, 2688, 2880, 3008, 3136,
+	3264, 2752, 2752, 2752, 2752, 2944, 3072, 3200, 3328,
+	2752, 2752, 2752, 2752, 2944, 3072, 3200, 3328, 2816,
+	2816, 2816, 2816, 3008, 3136, 3264, 3392, 2816, 2816,
+	2816, 2816, 3008, 3136, 3264, 3392, 2880, 2880, 2880,
+	2880, 3072, 3200, 3328, 3456, 2880, 2880, 2880, 2880,
+	3072, 3200, 3328, 3456, 2944, 2944, 2944, 2944, 3136,
+	3264, 3392, 3520, 2944, 2944, 2944, 2944, 3136, 3264,
+	3392, 3520, 3008, 3008, 3008, 3008, 3200, 3328, 3456,
+	3584, 3008, 3008, 3008, 3008, 3200, 3328, 3456, 3584,
+	3072, 3072, 3072, 3072, 3264, 3392, 3520, 3648, 3072,
+	3072, 3072, 3072, 3264, 3392, 3520, 3648, 3136, 3136,
+	3136, 3136, 3328, 3456, 3584, 3712, 3136, 3136, 3136,
+	3136, 3328, 3456, 3584, 3712, 3200, 3200, 3200, 3200,
+	3392, 3520, 3648, 3776, 3200, 3200, 3200, 3200, 3392,
+	3520, 3648, 3776, 3264, 3264, 3264, 3264, 3456, 3584,
+	3712, 3840, 3264, 3264, 3264, 3264, 3456, 3584, 3712,
+	3840, 3328, 3328, 3328, 3328, 3520, 3648, 3776, 3904,
+	3328, 3328, 3328, 3328, 3520, 3648, 3776, 3904, 3392,
+	3392, 3392, 3392, 3584, 3712, 3840, 3968, 3392, 3392,
+	3392, 3392, 3584, 3712, 3840, 3968, 3456, 3456, 3456,
+	3456, 3648, 3776, 3904, 4032, 3456, 3456, 3456, 3456,
+	3648, 3776, 3904, 4032, 3520, 3520, 3520, 3520, 3712,
+	3840, 3968, 4096, 3520, 3520, 3520, 3520, 3712, 3840,
+	3968, 4096, 3584, 3584, 3584, 3584, 3776, 3904, 4032,
+	4160, 3584, 3584, 3584, 3584, 3776, 3904, 4032, 4160,
+	3648, 3648, 3648, 3648, 3840, 3968, 4096, 4224, 3648,
+	3648, 3648, 3648, 3840, 3968, 4096, 4224, 3712, 3712,
+	3712, 3712, 3904, 4032, 4160, 4288, 3712, 3712, 3712,
+	3712, 3904, 4032, 4160, 4288, 3776, 3776, 3776, 3776,
+	3968, 4096, 4224, 4352, 3776, 3776, 3776, 3776, 3968,
+	4096, 4224, 4352, 3840, 3840, 3840, 3840, 4032, 4160,
+	4288, 4416, 3840, 3840, 3840, 3840, 4032, 4160, 4288,
+	4416, 3904, 3904, 3904, 3904, 4096, 4224, 4352, 4480,
+	3904, 3904, 3904, 3904, 4096, 4224, 4352, 4480, 3968,
+	3968, 3968, 3968, 4160, 4288, 4416, 4544, 3968, 3968,
+	3968, 3968, 4160, 4288, 4416, 4544, 4032, 4032, 4032,
+	4032, 4224, 4352, 4480, 4608, 4032, 4032, 4032, 4032,
+	4224, 4352, 4480, 4608, 4096, 4096, 4096, 4096, 4288,
+	4416, 4544, 4672, 4096, 4096, 4096, 4096, 4288, 4416,
+	4544, 4672, 4160, 4160, 4160, 4160, 4352, 4480, 4608,
+	4.6, 4160, 4160, 4160, 4160, 4352, 4480, 4608, 4736,
+	4224, 4224, 4224, 4224, 4416, 4544, 4672, 4800, 4224,
+	4224, 4224, 4224, 4416, 4544, 4672, 4800, 4288, 4288,
+	4288, 4288, 4480, 4608, 4736, 4864, 4288, 4288, 4288,
+	4288, 4480, 4608, 4736, 4864, 4352, 4352, 4352, 4352,
+	4544, 4672, 4800, 4928, 4352, 4352, 4352, 4352, 4544,
+	4672, 4800, 4928, 4416, 4416, 4416, 4416, 4608, 4736,
+	4864, 4992, 4416, 4416, 4416, 4416, 4608, 4736, 4864,
+	4992, 4480, 4480, 4480, 4480, 4672, 4800, 4928, 5056,
+	4480, 4480, 4480, 4480, 4672, 4800, 4928, 5056, 4544,
+	4544, 4544, 4544, 4736, 4864, 4992, 5120, 4544, 4544,
+	4544, 4544, 4736, 4864, 4992, 5120, 4608, 4608, 4608,
+	4608, 4800, 4928, 5056, 5184, 4608, 4608, 4608, 4608,
+	4800, 4928, 5056, 5184, 4672, 4672, 4672, 4672, 4864,
+	4992, 5120, 5248, 4672, 4672, 4672, 4672, 4864, 4992,
+	5120, 5248, 4736, 4736, 4736, 4736, 4928, 5056, 5184,
+	5312, 4736, 4736, 4736, 4736, 4928, 5056, 5184, 5312,
+	4800, 4800, 4800, 4800, 4992, 5120, 5248, 5376, 4800,
+	4800, 4800, 4800, 4992, 5120, 5248, 5376, 4864, 4864,
+	4864, 4864, 5056, 5184, 5312, 5440, 4864, 4864, 4864,
+	4864, 5056, 5184, 5312, 5440, 4928, 4928, 4928, 4928,
+	5120, 5248, 5376, 5504, 4928, 4928, 4928, 4928, 5120,
+	5248, 5376, 5504, 4992, 4992, 4992, 4992, 5184, 5312,
+	5440, 5568, 4992, 4992, 4992, 4992, 5184, 5312, 5440,
+	5568, 5056, 5056, 5056, 5056, 5248, 5376, 5504, 5632,
+	5056, 5056, 5056, 5056, 5248, 5376, 5504, 5632, 5120,
+	5120, 5120, 5120, 5312, 5440, 5568, 5632, 5120, 5120,
+	5120, 5120, 5312, 5440, 5568, 5632, 5184, 5184, 5184,
+	5184, 5376, 5504, 5632, 5632, 5184, 5184, 5184, 5184,
+	5376, 5504, 5632, 5632, 5248, 5248, 5248, 5248, 5440,
+	5568, 5632, 5632, 5248, 5248, 5248, 5248, 5440, 5568,
+	5632, 5632, 5312, 5312, 5312, 5312, 5504, 5632, 5632,
+	5632, 5312, 5312, 5312, 5312, 5504, 5632, 5632, 5632,
+	5376, 5376, 5376, 5376, 5568, 5632, 5632, 5632, 5376,
+	5376, 5376, 5376, 5568, 5632, 5632, 5632, 5440, 5440,
+	5440, 5440, 5632, 5632, 5632, 5632, 5440, 5440, 5440,
+	5440, 5632, 5632, 5632, 5632, 5504, 5504, 5504, 5504,
+	5632, 5632, 5632, 5632, 5504, 5504, 5504, 5504, 5632,
+	5632, 5632, 5632, 5568, 5568, 5568, 5568, 5632, 5632,
+	5632, 5632, 5568, 5568, 5568, 5568, 5632, 5632, 5632,
+	5632
+};
+
+static const int filterData2[1424] = {
+	0, 2, 4, 6, 7, 9, 11, 13, 0, -2, -4, -6, -7, -9, -11,
+	-13, 1, 3, 5, 7, 9, 11, 13, 15, -1, -3, -5, -7, -9,
+	-11, -13, -15, 1, 3, 5, 7, 10, 12, 14, 16, -1, -3, -5,
+	-7, -10, -12, -14, -16, 1, 3, 6, 8, 11, 13, 16, 18,
+	-1, -3, -6, -8, -11, -13, -16, -18, 1, 4, 6, 9, 12,
+	15, 17, 20, -1, -4, -6, -9, -12, -15, -17, -20, 1, 4,
+	7, 10, 13, 16, 19, 22, -1, -4, -7, -10, -13, -16, -19,
+	-22, 1, 4, 8, 11, 14, 17, 21, 24, -1, -4, -8, -11, -14,
+	-17, -21, -24, 1, 5, 8, 12, 15, 19, 22, 26, -1, -5,
+	-8, -12, -15, -19, -22, -26, 2, 6, 10, 14, 18, 22, 26,
+	30, -2, -6, -10, -14, -18, -22, -26, -30, 2, 6, 10,
+	14, 19, 23, 27, 31, -2, -6, -10, -14, -19, -23, -27,
+	-31, 2, 7, 11, 16, 21, 26, 30, 35, -2, -7, -11, -16,
+	-21, -26, -30, -35, 2, 7, 13, 18, 23, 28, 34, 39, -2,
+	-7, -13, -18, -23, -28, -34, -39, 2, 8, 14, 20, 25,
+	31, 37, 43, -2, -8, -14, -20, -25, -31, -37, -43, 3,
+	9, 15, 21, 28, 34, 40, 46, -3, -9, -15, -21, -28, -34,
+	-40, -46, 3, 10, 17, 24, 31, 38, 45, 52, -3, -10, -17,
+	-24, -31, -38, -45, -52, 3, 11, 19, 27, 34, 42, 50,
+	58, -3, -11, -19, -27, -34, -42, -50, -58, 4, 12, 21,
+	29, 38, 46, 55, 63, -4, -12, -21, -29, -38, -46, -55,
+	-63, 4, 13, 23, 32, 41, 50, 60, 69, -4, -13, -23, -32,
+	-41, -50, -60, -69, 5, 15, 25, 35, 46, 56, 66, 76, -5,
+	-15, -25, -35, -46, -56, -66, -76, 5, 16, 28, 39, 50,
+	61, 73, 84, -5, -16, -28, -39, -50, -61, -73, -84, 6,
+	18, 31, 43, 56, 68, 81, 93, -6, -18, -31, -43, -56,
+	-68, -81, -93, 6, 20, 34, 48, 61, 75, 89, 103, -6, -20,
+	-34, -48, -61, -75, -89, -103, 7, 22, 37, 52, 67, 82,
+	97, 112, -7, -22, -37, -52, -67, -82, -97, -112, 8,
+	24, 41, 57, 74, 90, 107, 123, -8, -24, -41, -57, -74,
+	-90, -107, -123, 9, 27, 45, 63, 82, 100, 118, 136, -9,
+	-27, -45, -63, -82, -100, -118, -136, 10, 30, 50, 70,
+	90, 110, 130, 150, -10, -30, -50, -70, -90, -110, -130,
+	-150, 11, 33, 55, 77, 99, 121, 143, 165, -11, -33, -55,
+	-77, -99, -121, -143, -165, 12, 36, 60, 84, 109, 133,
+	157, 181, -12, -36, -60, -84, -109, -133, -157, -181,
+	13, 40, 66, 93, 120, 147, 173, 200, -13, -40, -66, -93,
+	-120, -147, -173, -200, 14, 44, 73, 103, 132, 162, 191,
+	221, -14, -44, -73, -103, -132, -162, -191, -221, 16,
+	48, 81, 113, 146, 178, 211, 243, -16, -48, -81, -113,
+	-146, -178, -211, -243, 17, 53, 89, 125, 160, 196, 232,
+	268, -17, -53, -89, -125, -160, -196, -232, -268, 19,
+	58, 98, 137, 176, 215, 255, 294, -19, -58, -98, -137,
+	-176, -215, -255, -294, 21, 64, 108, 151, 194, 237,
+	281, 324, -21, -64, -108, -151, -194, -237, -281, -324,
+	23, 71, 118, 166, 213, 261, 308, 356, -23, -71, -118,
+	-166, -213, -261, -308, -356, 26, 78, 130, 182, 235,
+	287, 339, 391, -26, -78, -130, -182, -235, -287, -339,
+	-391, 28, 86, 143, 201, 258, 316, 373, 431, -28, -86,
+	-143, -201, -258, -316, -373, -431, 31, 94, 158, 221,
+	284, 347, 411, 474, -31, -94, -158, -221, -284, -347,
+	-411, -474, 34, 104, 174, 244, 313, 383, 453, 523, -34,
+	-104, -174, -244, -313, -383, -453, -523, 38, 115, 191,
+	268, 345, 422, 498, 575, -38, -115, -191, -268, -345,
+	-422, -498, -575, 42, 126, 210, 294, 379, 463, 547,
+	631, -42, -126, -210, -294, -379, -463, -547, -631,
+	46, 139, 231, 324, 417, 510, 602, 695, -46, -139, -231,
+	-324, -417, -510, -602, -695, 51, 153, 255, 357, 459,
+	561, 663, 765, -51, -153, -255, -357, -459, -561, -663,
+	-765, 56, 168, 280, 392, 505, 617, 729, 841, -56, -168,
+	-280, -392, -505, -617, -729, -841, 61, 185, 308, 432,
+	555, 679, 802, 926, -61, -185, -308, -432, -555, -679,
+	-802, -926, 68, 204, 340, 476, 612, 748, 884, 1020,
+	-68, -204, -340, -476, -612, -748, -884, -1020, 74,
+	224, 373, 523, 672, 822, 971, 1121, -74, -224, -373,
+	-523, -672, -822, -971, -1121, 82, 246, 411, 575, 740,
+	904, 1069, 1233, -82, -246, -411, -575, -740, -904,
+	-1069, -1233, 90, 271, 452, 633, 814, 995, 1176, 1357,
+	-90, -271, -452, -633, -814, -995, -1176, -1357, 99,
+	298, 497, 696, 895, 1094, 1293, 1492, -99, -298, -497,
+	-696, -895, -1094, -1293, -1492, 109, 328, 547, 766,
+	985, 1204, 1423, 1642, -109, -328, -547, -766, -985,
+	-1204, -1423, -1642, 120, 361, 601, 842, 1083, 1324,
+	1564, 1805, -120, -361, -601, -842, -1083, -1324, -1564,
+	-1805, 132, 397, 662, 927, 1192, 1457, 1722, 1987, -132,
+	-397, -662, -927, -1192, -1457, -1722, -1987, 145, 437,
+	728, 1020, 1311, 1603, 1894, 2186, -145, -437, -728,
+	-1020, -1311, -1603, -1894, -2186, 160, 480, 801, 1121,
+	1442, 1762, 2083, 2403, -160, -480, -801, -1121, -1442,
+	-1762, -2083, -2403, 176, 529, 881, 1234, 1587, 1940,
+	2292, 2645, -176, -529, -881, -1234, -1587, -1940, -2292,
+	-2645, 194, 582, 970, 1358, 1746, 2134, 2522, 2910,
+	-194, -582, -970, -1358, -1746, -2134, -2522, -2910,
+	213, 640, 1066, 1493, 1920, 2347, 2773, 3200, -213,
+	-640, -1066, -1493, -1920, -2347, -2773, -3200, 234,
+	704, 1173, 1643, 2112, 2582, 3051, 3521, -234, -704,
+	-1173, -1643, -2112, -2582, -3051, -3521, 258, 774,
+	1291, 1807, 2324, 2840, 3357, 3873, -258, -774, -1291,
+	-1807, -2324, -2840, -3357, -3873, 284, 852, 1420, 1988,
+	2556, 3124, 3692, 4260, -284, -852, -1420, -1988, -2556,
+	-3124, -3692, -4260, 312, 937, 1561, 2186, 2811, 3436,
+	4060, 4685, -312, -937, -1561, -2186, -2811, -3436,
+	-4060, -4685, 343, 1030, 1718, 2405, 3092, 3779, 4467,
+	5154, -343, -1030, -1718, -2405, -3092, -3779, -4467,
+	-5154, 378, 1134, 1890, 2646, 3402, 4158, 4914, 5670,
+	-378, -1134, -1890, -2646, -3402, -4158, -4914, -5670,
+	415, 1247, 2079, 2911, 3742, 4574, 5406, 6238, -415,
+	-1247, -2079, -2911, -3742, -4574, -5406, -6238, 457,
+	1372, 2287, 3202, 4117, 5032, 5947, 6862, -457, -1372,
+	-2287, -3202, -4117, -5032, -5947, -6862, 503, 1509,
+	2516, 3522, 4529, 5535, 6542, 7548, -503, -1509, -2516,
+	-3522, -4529, -5535, -6542, -7548, 553, 1660, 2767,
+	3874, 4981, 6088, 7195, 8302, -553, -1660, -2767, -3874,
+	-4981, -6088, -7195, -8302, 608, 1826, 3044, 4262, 5479,
+	6697, 7915, 9133, -608, -1826, -3044, -4262, -5479,
+	-6697, -7915, -9133, 669, 2009, 3348, 4688, 6027, 7367,
+	8706, 10046, -669, -2009, -3348, -4688, -6027, -7367,
+	-8706, -10046, 736, 2210, 3683, 5157, 6630, 8104, 9577,
+	11051, -736, -2210, -3683, -5157, -6630, -8104, -9577,
+	-11051, 810, 2431, 4052, 5673, 7294, 8915, 10536, 12157,
+	-810, -2431, -4052, -5673, -7294, -8915, -10536, -12157,
+	891, 2674, 4457, 6240, 8023, 9806, 11589, 13372, -891,
+	-2674, -4457, -6240, -8023, -9806, -11589, -13372, 980,
+	2941, 4903, 6864, 8825, 10786, 12748, 14709, -980, -2941,
+	-4903, -6864, -8825, -10786, -12748, -14709, 1078, 3236,
+	5393, 7551, 9708, 11866, 14023, 16181, -1078, -3236,
+	-5393, -7551, -9708, -11866, -14023, -16181, 1186, 3559,
+	5933, 8306, 10679, 13052, 15426, 17799, -1186, -3559,
+	-5933, -8306, -10679, -13052, -15426, -17799, 1305,
+	3915, 6526, 9136, 11747, 14357, 16968, 19578, -1305,
+	-3915, -6526, -9136, -11747, -14357, -16968, -19578,
+	1435, 4307, 7179, 10051, 12922, 15794, 18666, 21538,
+	-1435, -4307, -7179, -10051, -12922, -15794, -18666,
+	-21538, 1579, 4738, 7896, 11055, 14214, 17373, 20531,
+	23690, -1579, -4738, -7896, -11055, -14214, -17373,
+	-20531, -23690, 1737, 5212, 8686, 12161, 15636, 19111,
+	22585, 26060, -1737, -5212, -8686, -12161, -15636, -19111,
+	-22585, -26060, 1911, 5733, 9555, 13377, 17200, 21022,
+	24844, 28666, -1911, -5733, -9555, -13377, -17200, -21022,
+	-24844, -28666, 2102, 6306, 10511, 14715, 18920, 23124,
+	27329, 31533, -2102, -6306, -10511, -14715, -18920,
+	-23124, -27329, -31533, 2312, 6937, 11562, 16187, 20812,
+	25437, 30062, 32767, -2312, -6937, -11562, -16187, -20812,
+	-25437, -30062, -32767, 2543, 7631, 12718, 17806, 22893,
+	27981, 32767, 32767, -2543, -7631, -12718, -17806, -22893,
+	-27981, -32767, -32767, 2798, 8394, 13990, 19586, 25183,
+	30779, 32767, 32767, -2798, -8394, -13990, -19586, -25183,
+	-30779, -32767, -32767, 3077, 9233, 15389, 21545, 27700,
+	32767, 32767, 32767, -3077, -9233, -15389, -21545, -27700,
+	-32767, -32767, -32767, 3385, 10157, 16928, 23700, 30471,
+	32767, 32767, 32767, -3385, -10157, -16928, -23700,
+	-30471, -32767, -32767, -32767, 3724, 11172, 18621,
+	26069, 32767, 32767, 32767, 32767, -3724, -11172, -18621,
+	-26069, -32767, -32767, -32767, -32767, 4095, 12287,
+	20479, 28671, 32767, 32767, 32767, 32767, -4095, -12287,
+	-20479, -28671, -32767, -32767, -32767, -32767
+};
+
+static const int p1s[17] = { 0, 4, 3, 4, 2, 4, 3, 4, 1, 4, 3, 4,  2, 4,  3, 4,  0 };
+static const int p2s[17] = { 0, 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15, 1 };
+
+#pragma endregion
+
 // Last Express ADPCM is similar to MS IMA mono, but inverts its nibbles
 // and does not have the 4 byte per channel requirement
 
 class LastExpress_ADPCMStream : public Audio::Ima_ADPCMStream {
 public:
-	LastExpress_ADPCMStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, uint32 size, uint32 blockSize) :
-			Audio::Ima_ADPCMStream(stream, disposeAfterUse, size, 44100, 1, blockSize) {}
+	LastExpress_ADPCMStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, uint32 size, uint32 blockSize, int32 filterId) :
+			Audio::Ima_ADPCMStream(stream, disposeAfterUse, size, 44100, 1, blockSize) {
+		_currentFilterId = -1;
+		_nextFilterId = filterId;
+	}
 
 	int readBuffer(int16 *buffer, const int numSamples) {
 		int samples = 0;
@@ -67,6 +383,45 @@ public:
 
 		return samples;
 	}
+
+	void setFilterId(int32 filterId) { _nextFilterId = filterId; }
+
+private:
+	int32  _currentFilterId;
+	int32  _nextFilterId;    // the sound filter id, -1 for none
+
+	/**
+	 * Sound filter
+	 *
+	 * @param [in]      data    If non-null, the input data
+	 * @param [in,out]  buffer  If non-null, the output buffer.
+	 * @param           p1      The first filter input.
+	 * @param           p2      The second filter input.
+	 */
+	static void soundFilter(byte *data, int16 *buffer, int p1, int p2) {
+		int data1, data2, data1p, data2p;
+		byte idx;
+
+		data2 = data[0];
+		data1 = data[1] << 6;
+
+		data += 2;
+
+		for (int count = 0; count < 735; count++) {
+			idx = data[count] >> 4;
+
+			data1p = filterData[idx + data1];
+			data2p = CLIP(filterData2[idx + data1] + data2, -32767, 32767);
+
+			buffer[2 * count] = (p2 * data2p) >> p1;
+
+			idx = data[count] & 0xF;
+
+			data1 = filterData[idx + data1p];
+			data2 = CLIP(filterData2[idx + data1p] + data2p, -32767, 32767);
+			buffer[2 * count + 1] = (p2 * data2) >> p1;
+		}
+	}
 };
 
 //////////////////////////////////////////////////////////////////////////
@@ -92,8 +447,8 @@ void SimpleSound::loadHeader(Common::SeekableReadStream *in) {
 	_blockSize = _size / _blocks;
 }
 
-Audio::AudioStream *SimpleSound::makeDecoder(Common::SeekableReadStream *in, uint32 size) const {
-	return new LastExpress_ADPCMStream(in, DisposeAfterUse::YES, size, _blockSize);
+Audio::AudioStream *SimpleSound::makeDecoder(Common::SeekableReadStream *in, uint32 size, int32 filterId) const {
+	return new LastExpress_ADPCMStream(in, DisposeAfterUse::YES, size, _blockSize, filterId);
 }
 
 void SimpleSound::play(Audio::AudioStream *as) {
@@ -103,11 +458,11 @@ void SimpleSound::play(Audio::AudioStream *as) {
 //////////////////////////////////////////////////////////////////////////
 // StreamedSound
 //////////////////////////////////////////////////////////////////////////
-StreamedSound::StreamedSound() : _loaded(false) {}
+StreamedSound::StreamedSound() : _as(NULL), _loaded(false) {}
 
 StreamedSound::~StreamedSound() {}
 
-bool StreamedSound::load(Common::SeekableReadStream *stream) {
+bool StreamedSound::load(Common::SeekableReadStream *stream, int32 filterId) {
 	if (!stream)
 		return false;
 
@@ -116,10 +471,10 @@ bool StreamedSound::load(Common::SeekableReadStream *stream) {
 	loadHeader(stream);
 
 	// Start decoding the input stream
-	Audio::AudioStream *as = makeDecoder(stream, _size);
+	_as = makeDecoder(stream, _size, filterId);
 
 	// Start playing the decoded audio stream
-	play(as);
+	play(_as);
 
 	_loaded = true;
 
@@ -133,6 +488,10 @@ bool StreamedSound::isFinished() {
 	return !g_system->getMixer()->isSoundHandleActive(_handle);
 }
 
+void StreamedSound::setFilterId(int32 filterId) {
+	((LastExpress_ADPCMStream *)_as)->setFilterId(filterId);
+}
+
 //////////////////////////////////////////////////////////////////////////
 // StreamedSound
 //////////////////////////////////////////////////////////////////////////
diff --git a/engines/lastexpress/data/snd.h b/engines/lastexpress/data/snd.h
index 1c34e4f..7111d93 100644
--- a/engines/lastexpress/data/snd.h
+++ b/engines/lastexpress/data/snd.h
@@ -59,7 +59,7 @@ public:
 
 protected:
 	void loadHeader(Common::SeekableReadStream *in);
-	Audio::AudioStream *makeDecoder(Common::SeekableReadStream *in, uint32 size) const;
+	Audio::AudioStream *makeDecoder(Common::SeekableReadStream *in, uint32 size, int32 filterId = -1) const;
 	void play(Audio::AudioStream *as);
 
 	uint32 _size;   ///< data size
@@ -76,11 +76,13 @@ public:
 	StreamedSound();
 	~StreamedSound();
 
-	bool load(Common::SeekableReadStream *stream);
-
+	bool load(Common::SeekableReadStream *stream, int32 filterId = -1);
 	virtual bool isFinished();
 
+	void setFilterId(int32 filterId);
+
 private:
+	Audio::AudioStream *_as;
 	bool _loaded;
 };
 
diff --git a/engines/lastexpress/shared.h b/engines/lastexpress/shared.h
index b4ced96..7b640c7 100644
--- a/engines/lastexpress/shared.h
+++ b/engines/lastexpress/shared.h
@@ -93,7 +93,7 @@ enum SoundStatus {
 	kSoundStatus_20            = 0x20,
 	kSoundStatus_40            = 0x40,
 	kSoundStatus_180           = 0x180,
-	kSoundStatusRemoved        = 0x200,
+	kSoundStatusClosed         = 0x200,
 	kSoundStatus_400           = 0x400,
 
 	kSoundStatus_8000          = 0x8000,
@@ -103,8 +103,8 @@ enum SoundStatus {
 	kSoundStatus_40000000      = 0x40000000,
 
 	kSoundStatusClear0         = 0x10,
-	kSoundStatusFilterVariant  = 0x1F,
-	kSoundStatusClear2         = 0x80,
+	kSoundStatusFilter         = 0x1F,
+	kSoundStatusCached         = 0x80,
 	kSoundStatusClear3         = 0x200,
 	kSoundStatusClear4         = 0x800,
 	kSoundStatusClearAll       = 0xFFFFFFE0
diff --git a/engines/lastexpress/sound/entry.cpp b/engines/lastexpress/sound/entry.cpp
index 2840d85..1ba1862 100644
--- a/engines/lastexpress/sound/entry.cpp
+++ b/engines/lastexpress/sound/entry.cpp
@@ -47,9 +47,6 @@ namespace LastExpress {
 SoundEntry::SoundEntry(LastExpressEngine *engine) : _engine(engine) {
 	_type = kSoundTypeNone;
 
-	_currentDataPtr = NULL;
-	_soundBuffer = NULL;
-
 	_blockCount = 0;
 	_time = 0;
 
@@ -76,8 +73,6 @@ SoundEntry::~SoundEntry() {
 		SAFE_DELETE(_stream);
 	delete _soundStream;
 
-	free(_soundBuffer);
-
 	// Zero passed pointers
 	_engine = NULL;
 }
@@ -86,14 +81,11 @@ void SoundEntry::open(Common::String name, SoundFlag flag, int priority) {
 	_priority = priority;
 	setType(flag);
 	setupStatus(flag);
-
-	// Add entry to cache and load sound data
-	setupCache();
-	loadSoundData(name);
+	loadStream(name);
 }
 
 void SoundEntry::close() {
-	_status.status |= kSoundStatusRemoved;
+	_status.status |= kSoundStatusClosed;
 
 	// Loop until ready
 	while (!(_status.status1 & 4) && !(getSoundQueue()->getFlag() & 8) && (getSoundQueue()->getFlag() & 1))
@@ -123,34 +115,24 @@ void SoundEntry::play() {
 		return;
 	}
 
-	if (_queued)
-		return;
-
-	// Apply filter
-	int16 *buffer = (int16 *)malloc(FILTER_BUFFER_SIZE);
-	memset(buffer, 0, FILTER_BUFFER_SIZE);
-
-	applyFilter(buffer);
-
-	// Queue the filtered data
-#if 0
+	// Prepare sound stream
 	if (!_soundStream)
-		_soundStream = new AppendableSound();
+		_soundStream = new StreamedSound();
 
-	// FIXME: make sure the filtered sound buffer is disposed
-	_soundStream->queueBuffer((const byte *)buffer, FILTER_BUFFER_SIZE /* true */);
-#else
-	free(buffer);
+	// Compute current filter id
+	int32 filterId = _status.status & kSoundStatusFilter;
+	// TODO adjust status (based on stepIndex)
 
-	// DEBUG: unfiltered stream
-	if (!_soundStream)
-		_soundStream = new StreamedSound();
+	if (_queued) {
+		_soundStream->setFilterId(filterId);
+	} else {
+		_stream->seek(0);
 
-	_stream->seek(0);
-	_soundStream->load(_stream);
-#endif
+		// Load the stream and start playing
+		_soundStream->load(_stream, filterId);
 
-	_queued = true;
+		_queued = true;
+	}
 }
 
 bool SoundEntry::isFinished() {
@@ -238,8 +220,8 @@ void SoundEntry::setType(SoundFlag flag) {
 
 void SoundEntry::setupStatus(SoundFlag flag) {
 	SoundStatus statusFlag = (SoundStatus)flag;
-	if (!((statusFlag & 0xFF) & kSoundStatusFilterVariant))
-		statusFlag = (SoundStatus)(statusFlag | kSoundStatusClear2);
+	if (!((statusFlag & 0xFF) & kSoundStatusFilter))
+		statusFlag = (SoundStatus)(statusFlag | kSoundStatusCached);
 
 	if (((statusFlag & 0xFF00) >> 8) & kSoundStatusClear0)
 		_status.status = (uint32)statusFlag;
@@ -247,23 +229,7 @@ void SoundEntry::setupStatus(SoundFlag flag) {
 		_status.status = (statusFlag | kSoundStatusClear4);
 }
 
-void SoundEntry::setupCache() {
-	if (_soundBuffer)
-		return;
-
-	// Original has a priority-based shared buffer (of 6 entries)
-	// We simply allocate a new buffer for each sound entry that needs it
-	_soundBuffer = (byte *)malloc(SOUNDCACHE_ENTRY_SIZE);
-	memset(_soundBuffer, 0, SOUNDCACHE_ENTRY_SIZE);
-
-	setInCache();
-}
-
-void SoundEntry::setInCache() {
-	_status.status |= kSoundStatusClear2;
-}
-
-void SoundEntry::loadSoundData(Common::String name) {
+void SoundEntry::loadStream(Common::String name) {
 	_name2 = name;
 
 	// Load sound data
@@ -272,12 +238,8 @@ void SoundEntry::loadSoundData(Common::String name) {
 	if (!_stream)
 		_stream = getArchive("DEFAULT.SND");
 
-	if (_stream) {
-		_stream->read(_soundBuffer, MIN(SOUNDCACHE_ENTRY_SIZE, _stream->size()));
-		_currentDataPtr = _soundBuffer + 6;
-	} else {
-		_status.status = kSoundStatusRemoved;
-	}
+	if (!_stream)
+		_status.status = kSoundStatusClosed;
 }
 
 void SoundEntry::update(uint val) {
@@ -303,7 +265,7 @@ void SoundEntry::update(uint val) {
 void SoundEntry::updateState() {
 	if (getSoundQueue()->getFlag() & 32) {
 		if (_type != kSoundType9 && _type != kSoundType7 && _type != kSoundType5) {
-			uint32 variant = _status.status & kSoundStatusFilterVariant;
+			uint32 variant = _status.status & kSoundStatusFilter;
 
 			_status.status &= kSoundStatusClearAll;
 
@@ -316,7 +278,7 @@ void SoundEntry::updateState() {
 }
 
 void SoundEntry::reset() {
-	_status.status |= kSoundStatusRemoved;
+	_status.status |= kSoundStatusClosed;
 	_entity = kEntityPlayer;
 
 	if (_stream) {
@@ -372,366 +334,6 @@ void SoundEntry::saveLoadWithSerializer(Common::Serializer &s) {
 }
 
 //////////////////////////////////////////////////////////////////////////
-// Sound filters
-//////////////////////////////////////////////////////////////////////////
-static const int filterData[1424] = {
-	0, 0, 0, 0, 128, 256, 384, 512, 0, 0, 0, 0, 128, 256,
-	384, 512, 0, 0, 0, 0, 192, 320, 448, 576, 0, 0, 0, 0,
-	192, 320, 448, 576, 64, 64, 64, 64, 256, 384, 512, 640,
-	64, 64, 64, 64, 256, 384, 512, 640, 128, 128, 128, 128,
-	320, 448, 576, 704, 128, 128, 128, 128, 320, 448, 576,
-	704, 192, 192, 192, 192, 384, 512, 640, 768, 192, 192,
-	192, 192, 384, 512, 640, 768, 256, 256, 256, 256, 448,
-	576, 704, 832, 256, 256, 256, 256, 448, 576, 704, 832,
-	320, 320, 320, 320, 512, 640, 768, 896, 320, 320, 320,
-	320, 512, 640, 768, 896, 384, 384, 384, 384, 576, 704,
-	832, 960, 384, 384, 384, 384, 576, 704, 832, 960, 448,
-	448, 448, 448, 640, 768, 896, 1024, 448, 448, 448, 448,
-	640, 768, 896, 1024, 512, 512, 512, 512, 704, 832, 960,
-	1088, 512, 512, 512, 512, 704, 832, 960, 1088, 576,
-	576, 576, 576, 768, 896, 1024, 1152, 576, 576, 576,
-	576, 768, 896, 1024, 1152, 640, 640, 640, 640, 832,
-	960, 1088, 1216, 640, 640, 640, 640, 832, 960, 1088,
-	1216, 704, 704, 704, 704, 896, 1024, 1152, 1280, 704,
-	704, 704, 704, 896, 1024, 1152, 1280, 768, 768, 768,
-	768, 960, 1088, 1216, 1344, 768, 768, 768, 768, 960,
-	1088, 1216, 1344, 832, 832, 832, 832, 1024, 1152, 1280,
-	1408, 832, 832, 832, 832, 1024, 1152, 1280, 1408, 896,
-	896, 896, 896, 1088, 1216, 1344, 1472, 896, 896, 896,
-	896, 1088, 1216, 1344, 1472, 960, 960, 960, 960, 1152,
-	1280, 1408, 1536, 960, 960, 960, 960, 1152, 1280, 1408,
-	1536, 1024, 1024, 1024, 1024, 1216, 1344, 1472, 1600,
-	1024, 1024, 1024, 1024, 1216, 1344, 1472, 1600, 1088,
-	1088, 1088, 1088, 1280, 1408, 1536, 1664, 1088, 1088,
-	1088, 1088, 1280, 1408, 1536, 1664, 1152, 1152, 1152,
-	1152, 1344, 1472, 1600, 1728, 1152, 1152, 1152, 1152,
-	1344, 1472, 1600, 1728, 1216, 1216, 1216, 1216, 1408,
-	1536, 1664, 1792, 1216, 1216, 1216, 1216, 1408, 1536,
-	1664, 1792, 1280, 1280, 1280, 1280, 1472, 1600, 1728,
-	1856, 1280, 1280, 1280, 1280, 1472, 1600, 1728, 1856,
-	1344, 1344, 1344, 1344, 1536, 1664, 1792, 1920, 1344,
-	1344, 1344, 1344, 1536, 1664, 1792, 1920, 1408, 1408,
-	1408, 1408, 1600, 1728, 1856, 1984, 1408, 1408, 1408,
-	1408, 1600, 1728, 1856, 1984, 1472, 1472, 1472, 1472,
-	1664, 1792, 1920, 2048, 1472, 1472, 1472, 1472, 1664,
-	1792, 1920, 2048, 1536, 1536, 1536, 1536, 1728, 1856,
-	1984, 2112, 1536, 1536, 1536, 1536, 1728, 1856, 1984,
-	2112, 1600, 1600, 1600, 1600, 1792, 1920, 2048, 2176,
-	1600, 1600, 1600, 1600, 1792, 1920, 2048, 2176, 1664,
-	1664, 1664, 1664, 1856, 1984, 2112, 2240, 1664, 1664,
-	1664, 1664, 1856, 1984, 2112, 2240, 1728, 1728, 1728,
-	1728, 1920, 2048, 2176, 2304, 1728, 1728, 1728, 1728,
-	1920, 2048, 2176, 2304, 1792, 1792, 1792, 1792, 1984,
-	2112, 2240, 2368, 1792, 1792, 1792, 1792, 1984, 2112,
-	2240, 2368, 1856, 1856, 1856, 1856, 2048, 2176, 2304,
-	2432, 1856, 1856, 1856, 1856, 2048, 2176, 2304, 2432,
-	1920, 1920, 1920, 1920, 2112, 2240, 2368, 2496, 1920,
-	1920, 1920, 1920, 2112, 2240, 2368, 2496, 1984, 1984,
-	1984, 1984, 2176, 2304, 2432, 2560, 1984, 1984, 1984,
-	1984, 2176, 2304, 2432, 2560, 2048, 2048, 2048, 2048,
-	2240, 2368, 2496, 2624, 2048, 2048, 2048, 2048, 2240,
-	2368, 2496, 2624, 2112, 2112, 2112, 2112, 2304, 2432,
-	2560, 2688, 2112, 2112, 2112, 2112, 2304, 2432, 2560,
-	2688, 2176, 2176, 2176, 2176, 2368, 2496, 2624, 2752,
-	2176, 2176, 2176, 2176, 2368, 2496, 2624, 2752, 2240,
-	2240, 2240, 2240, 2432, 2560, 2688, 2816, 2240, 2240,
-	2240, 2240, 2432, 2560, 2688, 2816, 2304, 2304, 2304,
-	2304, 2496, 2624, 2752, 2880, 2304, 2304, 2304, 2304,
-	2496, 2624, 2752, 2880, 2368, 2368, 2368, 2368, 2560,
-	2688, 2816, 2944, 2368, 2368, 2368, 2368, 2560, 2688,
-	2816, 2944, 2432, 2432, 2432, 2432, 2624, 2752, 2880,
-	3008, 2432, 2432, 2432, 2432, 2624, 2752, 2880, 3008,
-	2496, 2496, 2496, 2496, 2688, 2816, 2944, 3072, 2496,
-	2496, 2496, 2496, 2688, 2816, 2944, 3072, 2560, 2560,
-	2560, 2560, 2752, 2880, 3008, 3136, 2560, 2560, 2560,
-	2560, 2752, 2880, 3008, 3136, 2624, 2624, 2624, 2624,
-	2816, 2944, 3072, 3200, 2624, 2624, 2624, 2624, 2816,
-	2944, 3072, 3200, 2688, 2688, 2688, 2688, 2880, 3008,
-	3136, 3264, 2688, 2688, 2688, 2688, 2880, 3008, 3136,
-	3264, 2752, 2752, 2752, 2752, 2944, 3072, 3200, 3328,
-	2752, 2752, 2752, 2752, 2944, 3072, 3200, 3328, 2816,
-	2816, 2816, 2816, 3008, 3136, 3264, 3392, 2816, 2816,
-	2816, 2816, 3008, 3136, 3264, 3392, 2880, 2880, 2880,
-	2880, 3072, 3200, 3328, 3456, 2880, 2880, 2880, 2880,
-	3072, 3200, 3328, 3456, 2944, 2944, 2944, 2944, 3136,
-	3264, 3392, 3520, 2944, 2944, 2944, 2944, 3136, 3264,
-	3392, 3520, 3008, 3008, 3008, 3008, 3200, 3328, 3456,
-	3584, 3008, 3008, 3008, 3008, 3200, 3328, 3456, 3584,
-	3072, 3072, 3072, 3072, 3264, 3392, 3520, 3648, 3072,
-	3072, 3072, 3072, 3264, 3392, 3520, 3648, 3136, 3136,
-	3136, 3136, 3328, 3456, 3584, 3712, 3136, 3136, 3136,
-	3136, 3328, 3456, 3584, 3712, 3200, 3200, 3200, 3200,
-	3392, 3520, 3648, 3776, 3200, 3200, 3200, 3200, 3392,
-	3520, 3648, 3776, 3264, 3264, 3264, 3264, 3456, 3584,
-	3712, 3840, 3264, 3264, 3264, 3264, 3456, 3584, 3712,
-	3840, 3328, 3328, 3328, 3328, 3520, 3648, 3776, 3904,
-	3328, 3328, 3328, 3328, 3520, 3648, 3776, 3904, 3392,
-	3392, 3392, 3392, 3584, 3712, 3840, 3968, 3392, 3392,
-	3392, 3392, 3584, 3712, 3840, 3968, 3456, 3456, 3456,
-	3456, 3648, 3776, 3904, 4032, 3456, 3456, 3456, 3456,
-	3648, 3776, 3904, 4032, 3520, 3520, 3520, 3520, 3712,
-	3840, 3968, 4096, 3520, 3520, 3520, 3520, 3712, 3840,
-	3968, 4096, 3584, 3584, 3584, 3584, 3776, 3904, 4032,
-	4160, 3584, 3584, 3584, 3584, 3776, 3904, 4032, 4160,
-	3648, 3648, 3648, 3648, 3840, 3968, 4096, 4224, 3648,
-	3648, 3648, 3648, 3840, 3968, 4096, 4224, 3712, 3712,
-	3712, 3712, 3904, 4032, 4160, 4288, 3712, 3712, 3712,
-	3712, 3904, 4032, 4160, 4288, 3776, 3776, 3776, 3776,
-	3968, 4096, 4224, 4352, 3776, 3776, 3776, 3776, 3968,
-	4096, 4224, 4352, 3840, 3840, 3840, 3840, 4032, 4160,
-	4288, 4416, 3840, 3840, 3840, 3840, 4032, 4160, 4288,
-	4416, 3904, 3904, 3904, 3904, 4096, 4224, 4352, 4480,
-	3904, 3904, 3904, 3904, 4096, 4224, 4352, 4480, 3968,
-	3968, 3968, 3968, 4160, 4288, 4416, 4544, 3968, 3968,
-	3968, 3968, 4160, 4288, 4416, 4544, 4032, 4032, 4032,
-	4032, 4224, 4352, 4480, 4608, 4032, 4032, 4032, 4032,
-	4224, 4352, 4480, 4608, 4096, 4096, 4096, 4096, 4288,
-	4416, 4544, 4672, 4096, 4096, 4096, 4096, 4288, 4416,
-	4544, 4672, 4160, 4160, 4160, 4160, 4352, 4480, 4608,
-	4736, 4160, 4160, 4160, 4160, 4352, 4480, 4608, 4736,
-	4224, 4224, 4224, 4224, 4416, 4544, 4672, 4800, 4224,
-	4224, 4224, 4224, 4416, 4544, 4672, 4800, 4288, 4288,
-	4288, 4288, 4480, 4608, 4736, 4864, 4288, 4288, 4288,
-	4288, 4480, 4608, 4736, 4864, 4352, 4352, 4352, 4352,
-	4544, 4672, 4800, 4928, 4352, 4352, 4352, 4352, 4544,
-	4672, 4800, 4928, 4416, 4416, 4416, 4416, 4608, 4736,
-	4864, 4992, 4416, 4416, 4416, 4416, 4608, 4736, 4864,
-	4992, 4480, 4480, 4480, 4480, 4672, 4800, 4928, 5056,
-	4480, 4480, 4480, 4480, 4672, 4800, 4928, 5056, 4544,
-	4544, 4544, 4544, 4736, 4864, 4992, 5120, 4544, 4544,
-	4544, 4544, 4736, 4864, 4992, 5120, 4608, 4608, 4608,
-	4608, 4800, 4928, 5056, 5184, 4608, 4608, 4608, 4608,
-	4800, 4928, 5056, 5184, 4672, 4672, 4672, 4672, 4864,
-	4992, 5120, 5248, 4672, 4672, 4672, 4672, 4864, 4992,
-	5120, 5248, 4736, 4736, 4736, 4736, 4928, 5056, 5184,
-	5312, 4736, 4736, 4736, 4736, 4928, 5056, 5184, 5312,
-	4800, 4800, 4800, 4800, 4992, 5120, 5248, 5376, 4800,
-	4800, 4800, 4800, 4992, 5120, 5248, 5376, 4864, 4864,
-	4864, 4864, 5056, 5184, 5312, 5440, 4864, 4864, 4864,
-	4864, 5056, 5184, 5312, 5440, 4928, 4928, 4928, 4928,
-	5120, 5248, 5376, 5504, 4928, 4928, 4928, 4928, 5120,
-	5248, 5376, 5504, 4992, 4992, 4992, 4992, 5184, 5312,
-	5440, 5568, 4992, 4992, 4992, 4992, 5184, 5312, 5440,
-	5568, 5056, 5056, 5056, 5056, 5248, 5376, 5504, 5632,
-	5056, 5056, 5056, 5056, 5248, 5376, 5504, 5632, 5120,
-	5120, 5120, 5120, 5312, 5440, 5568, 5632, 5120, 5120,
-	5120, 5120, 5312, 5440, 5568, 5632, 5184, 5184, 5184,
-	5184, 5376, 5504, 5632, 5632, 5184, 5184, 5184, 5184,
-	5376, 5504, 5632, 5632, 5248, 5248, 5248, 5248, 5440,
-	5568, 5632, 5632, 5248, 5248, 5248, 5248, 5440, 5568,
-	5632, 5632, 5312, 5312, 5312, 5312, 5504, 5632, 5632,
-	5632, 5312, 5312, 5312, 5312, 5504, 5632, 5632, 5632,
-	5376, 5376, 5376, 5376, 5568, 5632, 5632, 5632, 5376,
-	5376, 5376, 5376, 5568, 5632, 5632, 5632, 5440, 5440,
-	5440, 5440, 5632, 5632, 5632, 5632, 5440, 5440, 5440,
-	5440, 5632, 5632, 5632, 5632, 5504, 5504, 5504, 5504,
-	5632, 5632, 5632, 5632, 5504, 5504, 5504, 5504, 5632,
-	5632, 5632, 5632, 5568, 5568, 5568, 5568, 5632, 5632,
-	5632, 5632, 5568, 5568, 5568, 5568, 5632, 5632, 5632,
-	5632
-};
-
-static const int filterData2[1424] = {
-	0, 2, 4, 6, 7, 9, 11, 13, 0, -2, -4, -6, -7, -9, -11,
-	-13, 1, 3, 5, 7, 9, 11, 13, 15, -1, -3, -5, -7, -9,
-	-11, -13, -15, 1, 3, 5, 7, 10, 12, 14, 16, -1, -3, -5,
-	-7, -10, -12, -14, -16, 1, 3, 6, 8, 11, 13, 16, 18,
-	-1, -3, -6, -8, -11, -13, -16, -18, 1, 4, 6, 9, 12,
-	15, 17, 20, -1, -4, -6, -9, -12, -15, -17, -20, 1, 4,
-	7, 10, 13, 16, 19, 22, -1, -4, -7, -10, -13, -16, -19,
-	-22, 1, 4, 8, 11, 14, 17, 21, 24, -1, -4, -8, -11, -14,
-	-17, -21, -24, 1, 5, 8, 12, 15, 19, 22, 26, -1, -5,
-	-8, -12, -15, -19, -22, -26, 2, 6, 10, 14, 18, 22, 26,
-	30, -2, -6, -10, -14, -18, -22, -26, -30, 2, 6, 10,
-	14, 19, 23, 27, 31, -2, -6, -10, -14, -19, -23, -27,
-	-31, 2, 7, 11, 16, 21, 26, 30, 35, -2, -7, -11, -16,
-	-21, -26, -30, -35, 2, 7, 13, 18, 23, 28, 34, 39, -2,
-	-7, -13, -18, -23, -28, -34, -39, 2, 8, 14, 20, 25,
-	31, 37, 43, -2, -8, -14, -20, -25, -31, -37, -43, 3,
-	9, 15, 21, 28, 34, 40, 46, -3, -9, -15, -21, -28, -34,
-	-40, -46, 3, 10, 17, 24, 31, 38, 45, 52, -3, -10, -17,
-	-24, -31, -38, -45, -52, 3, 11, 19, 27, 34, 42, 50,
-	58, -3, -11, -19, -27, -34, -42, -50, -58, 4, 12, 21,
-	29, 38, 46, 55, 63, -4, -12, -21, -29, -38, -46, -55,
-	-63, 4, 13, 23, 32, 41, 50, 60, 69, -4, -13, -23, -32,
-	-41, -50, -60, -69, 5, 15, 25, 35, 46, 56, 66, 76, -5,
-	-15, -25, -35, -46, -56, -66, -76, 5, 16, 28, 39, 50,
-	61, 73, 84, -5, -16, -28, -39, -50, -61, -73, -84, 6,
-	18, 31, 43, 56, 68, 81, 93, -6, -18, -31, -43, -56,
-	-68, -81, -93, 6, 20, 34, 48, 61, 75, 89, 103, -6, -20,
-	-34, -48, -61, -75, -89, -103, 7, 22, 37, 52, 67, 82,
-	97, 112, -7, -22, -37, -52, -67, -82, -97, -112, 8,
-	24, 41, 57, 74, 90, 107, 123, -8, -24, -41, -57, -74,
-	-90, -107, -123, 9, 27, 45, 63, 82, 100, 118, 136, -9,
-	-27, -45, -63, -82, -100, -118, -136, 10, 30, 50, 70,
-	90, 110, 130, 150, -10, -30, -50, -70, -90, -110, -130,
-	-150, 11, 33, 55, 77, 99, 121, 143, 165, -11, -33, -55,
-	-77, -99, -121, -143, -165, 12, 36, 60, 84, 109, 133,
-	157, 181, -12, -36, -60, -84, -109, -133, -157, -181,
-	13, 40, 66, 93, 120, 147, 173, 200, -13, -40, -66, -93,
-	-120, -147, -173, -200, 14, 44, 73, 103, 132, 162, 191,
-	221, -14, -44, -73, -103, -132, -162, -191, -221, 16,
-	48, 81, 113, 146, 178, 211, 243, -16, -48, -81, -113,
-	-146, -178, -211, -243, 17, 53, 89, 125, 160, 196, 232,
-	268, -17, -53, -89, -125, -160, -196, -232, -268, 19,
-	58, 98, 137, 176, 215, 255, 294, -19, -58, -98, -137,
-	-176, -215, -255, -294, 21, 64, 108, 151, 194, 237,
-	281, 324, -21, -64, -108, -151, -194, -237, -281, -324,
-	23, 71, 118, 166, 213, 261, 308, 356, -23, -71, -118,
-	-166, -213, -261, -308, -356, 26, 78, 130, 182, 235,
-	287, 339, 391, -26, -78, -130, -182, -235, -287, -339,
-	-391, 28, 86, 143, 201, 258, 316, 373, 431, -28, -86,
-	-143, -201, -258, -316, -373, -431, 31, 94, 158, 221,
-	284, 347, 411, 474, -31, -94, -158, -221, -284, -347,
-	-411, -474, 34, 104, 174, 244, 313, 383, 453, 523, -34,
-	-104, -174, -244, -313, -383, -453, -523, 38, 115, 191,
-	268, 345, 422, 498, 575, -38, -115, -191, -268, -345,
-	-422, -498, -575, 42, 126, 210, 294, 379, 463, 547,
-	631, -42, -126, -210, -294, -379, -463, -547, -631,
-	46, 139, 231, 324, 417, 510, 602, 695, -46, -139, -231,
-	-324, -417, -510, -602, -695, 51, 153, 255, 357, 459,
-	561, 663, 765, -51, -153, -255, -357, -459, -561, -663,
-	-765, 56, 168, 280, 392, 505, 617, 729, 841, -56, -168,
-	-280, -392, -505, -617, -729, -841, 61, 185, 308, 432,
-	555, 679, 802, 926, -61, -185, -308, -432, -555, -679,
-	-802, -926, 68, 204, 340, 476, 612, 748, 884, 1020,
-	-68, -204, -340, -476, -612, -748, -884, -1020, 74,
-	224, 373, 523, 672, 822, 971, 1121, -74, -224, -373,
-	-523, -672, -822, -971, -1121, 82, 246, 411, 575, 740,
-	904, 1069, 1233, -82, -246, -411, -575, -740, -904,
-	-1069, -1233, 90, 271, 452, 633, 814, 995, 1176, 1357,
-	-90, -271, -452, -633, -814, -995, -1176, -1357, 99,
-	298, 497, 696, 895, 1094, 1293, 1492, -99, -298, -497,
-	-696, -895, -1094, -1293, -1492, 109, 328, 547, 766,
-	985, 1204, 1423, 1642, -109, -328, -547, -766, -985,
-	-1204, -1423, -1642, 120, 361, 601, 842, 1083, 1324,
-	1564, 1805, -120, -361, -601, -842, -1083, -1324, -1564,
-	-1805, 132, 397, 662, 927, 1192, 1457, 1722, 1987, -132,
-	-397, -662, -927, -1192, -1457, -1722, -1987, 145, 437,
-	728, 1020, 1311, 1603, 1894, 2186, -145, -437, -728,
-	-1020, -1311, -1603, -1894, -2186, 160, 480, 801, 1121,
-	1442, 1762, 2083, 2403, -160, -480, -801, -1121, -1442,
-	-1762, -2083, -2403, 176, 529, 881, 1234, 1587, 1940,
-	2292, 2645, -176, -529, -881, -1234, -1587, -1940, -2292,
-	-2645, 194, 582, 970, 1358, 1746, 2134, 2522, 2910,
-	-194, -582, -970, -1358, -1746, -2134, -2522, -2910,
-	213, 640, 1066, 1493, 1920, 2347, 2773, 3200, -213,
-	-640, -1066, -1493, -1920, -2347, -2773, -3200, 234,
-	704, 1173, 1643, 2112, 2582, 3051, 3521, -234, -704,
-	-1173, -1643, -2112, -2582, -3051, -3521, 258, 774,
-	1291, 1807, 2324, 2840, 3357, 3873, -258, -774, -1291,
-	-1807, -2324, -2840, -3357, -3873, 284, 852, 1420, 1988,
-	2556, 3124, 3692, 4260, -284, -852, -1420, -1988, -2556,
-	-3124, -3692, -4260, 312, 937, 1561, 2186, 2811, 3436,
-	4060, 4685, -312, -937, -1561, -2186, -2811, -3436,
-	-4060, -4685, 343, 1030, 1718, 2405, 3092, 3779, 4467,
-	5154, -343, -1030, -1718, -2405, -3092, -3779, -4467,
-	-5154, 378, 1134, 1890, 2646, 3402, 4158, 4914, 5670,
-	-378, -1134, -1890, -2646, -3402, -4158, -4914, -5670,
-	415, 1247, 2079, 2911, 3742, 4574, 5406, 6238, -415,
-	-1247, -2079, -2911, -3742, -4574, -5406, -6238, 457,
-	1372, 2287, 3202, 4117, 5032, 5947, 6862, -457, -1372,
-	-2287, -3202, -4117, -5032, -5947, -6862, 503, 1509,
-	2516, 3522, 4529, 5535, 6542, 7548, -503, -1509, -2516,
-	-3522, -4529, -5535, -6542, -7548, 553, 1660, 2767,
-	3874, 4981, 6088, 7195, 8302, -553, -1660, -2767, -3874,
-	-4981, -6088, -7195, -8302, 608, 1826, 3044, 4262, 5479,
-	6697, 7915, 9133, -608, -1826, -3044, -4262, -5479,
-	-6697, -7915, -9133, 669, 2009, 3348, 4688, 6027, 7367,
-	8706, 10046, -669, -2009, -3348, -4688, -6027, -7367,
-	-8706, -10046, 736, 2210, 3683, 5157, 6630, 8104, 9577,
-	11051, -736, -2210, -3683, -5157, -6630, -8104, -9577,
-	-11051, 810, 2431, 4052, 5673, 7294, 8915, 10536, 12157,
-	-810, -2431, -4052, -5673, -7294, -8915, -10536, -12157,
-	891, 2674, 4457, 6240, 8023, 9806, 11589, 13372, -891,
-	-2674, -4457, -6240, -8023, -9806, -11589, -13372, 980,
-	2941, 4903, 6864, 8825, 10786, 12748, 14709, -980, -2941,
-	-4903, -6864, -8825, -10786, -12748, -14709, 1078, 3236,
-	5393, 7551, 9708, 11866, 14023, 16181, -1078, -3236,
-	-5393, -7551, -9708, -11866, -14023, -16181, 1186, 3559,
-	5933, 8306, 10679, 13052, 15426, 17799, -1186, -3559,
-	-5933, -8306, -10679, -13052, -15426, -17799, 1305,
-	3915, 6526, 9136, 11747, 14357, 16968, 19578, -1305,
-	-3915, -6526, -9136, -11747, -14357, -16968, -19578,
-	1435, 4307, 7179, 10051, 12922, 15794, 18666, 21538,
-	-1435, -4307, -7179, -10051, -12922, -15794, -18666,
-	-21538, 1579, 4738, 7896, 11055, 14214, 17373, 20531,
-	23690, -1579, -4738, -7896, -11055, -14214, -17373,
-	-20531, -23690, 1737, 5212, 8686, 12161, 15636, 19111,
-	22585, 26060, -1737, -5212, -8686, -12161, -15636, -19111,
-	-22585, -26060, 1911, 5733, 9555, 13377, 17200, 21022,
-	24844, 28666, -1911, -5733, -9555, -13377, -17200, -21022,
-	-24844, -28666, 2102, 6306, 10511, 14715, 18920, 23124,
-	27329, 31533, -2102, -6306, -10511, -14715, -18920,
-	-23124, -27329, -31533, 2312, 6937, 11562, 16187, 20812,
-	25437, 30062, 32767, -2312, -6937, -11562, -16187, -20812,
-	-25437, -30062, -32767, 2543, 7631, 12718, 17806, 22893,
-	27981, 32767, 32767, -2543, -7631, -12718, -17806, -22893,
-	-27981, -32767, -32767, 2798, 8394, 13990, 19586, 25183,
-	30779, 32767, 32767, -2798, -8394, -13990, -19586, -25183,
-	-30779, -32767, -32767, 3077, 9233, 15389, 21545, 27700,
-	32767, 32767, 32767, -3077, -9233, -15389, -21545, -27700,
-	-32767, -32767, -32767, 3385, 10157, 16928, 23700, 30471,
-	32767, 32767, 32767, -3385, -10157, -16928, -23700,
-	-30471, -32767, -32767, -32767, 3724, 11172, 18621,
-	26069, 32767, 32767, 32767, 32767, -3724, -11172, -18621,
-	-26069, -32767, -32767, -32767, -32767, 4095, 12287,
-	20479, 28671, 32767, 32767, 32767, 32767, -4095, -12287,
-	-20479, -28671, -32767, -32767, -32767, -32767
-};
-
-static const int p1s[17] = { 0, 4, 3, 4, 2, 4, 3, 4, 1, 4, 3, 4,  2, 4,  3, 4,  0 };
-static const int p2s[17] = { 0, 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15, 1 };
-
-static void soundFilter(byte *data, int16 *buffer, int p1, int p2);
-
-void SoundEntry::applyFilter(int16 *buffer) {
-	if ((READ_UINT16((int16 *)(_currentDataPtr + 2)) << 6) > 5632) {
-		_status.status |= kSoundStatus_20000000;
-	} else {
-		int variant = _status.status & kSoundStatusFilterVariant;
-
-		soundFilter(_currentDataPtr, buffer, p1s[variant], p2s[variant]);
-		_currentDataPtr += 739;
-	}
-}
-
-static void soundFilter(byte *data, int16 *buffer, int p1, int p2) {
-	int data1, data2, data1p, data2p;
-	byte idx;
-
-	data2 = data[0];
-	data1 = data[1] << 6;
-
-	data += 2;
-
-	for (int count = 0; count < 735; count++) {
-		idx = data[count] >> 4;
-
-		if ((idx + data1) > ARRAYSIZE(filterData)) {
-			warning("Error in sound filter, aborting...");
-			return;
-		}
-
-		data1p = filterData[idx + data1];
-		data2p = CLIP(filterData2[idx + data1] + data2, -32767, 32767);
-
-		buffer[2 * count] = (p2 * data2p) >> p1;
-
-		idx = data[count] & 0xF;
-
-		if ((idx + data1p) > ARRAYSIZE(filterData)) {
-			warning("Error in sound filter, aborting...");
-			return;
-		}
-
-		data1 = filterData[idx + data1p];
-		data2 = CLIP(filterData2[idx + data1p] + data2p, -32767, 32767);
-		buffer[2 * count + 1] = (p2 * data2) >> p1;
-	}
-}
-
-//////////////////////////////////////////////////////////////////////////
 // SubtitleEntry
 //////////////////////////////////////////////////////////////////////////
 SubtitleEntry::SubtitleEntry(LastExpressEngine *engine) : _engine(engine) {
diff --git a/engines/lastexpress/sound/entry.h b/engines/lastexpress/sound/entry.h
index a466d31..c175b7b 100644
--- a/engines/lastexpress/sound/entry.h
+++ b/engines/lastexpress/sound/entry.h
@@ -124,8 +124,7 @@ public:
 	Common::String   getName2()    { return _name2; }
 
 	// Streams
-	SimpleSound                *getSoundStream() { return _soundStream; }
-	byte                       *getSoundBuffer() { return _soundBuffer; }
+	SimpleSound *getSoundStream() { return _soundStream; }
 
 private:
 	LastExpressEngine *_engine;
@@ -156,16 +155,11 @@ private:
 
 	// Sound buffer & stream
 	bool _queued;
-	byte *_soundBuffer;
 	StreamedSound *_soundStream;    // the filtered sound stream
 
 	void setType(SoundFlag flag);
 	void setupStatus(SoundFlag flag);
-	void setupCache();
-	void setInCache();
-	void loadSoundData(Common::String name);
-
-	void applyFilter(int16 *buffer);
+	void loadStream(Common::String name);
 };
 
 //////////////////////////////////////////////////////////////////////////
@@ -184,7 +178,7 @@ public:
 
 	// Accessors
 	SoundStatusUnion getStatus() { return _status; }
-	SoundEntry *getSoundEntry() { return _sound; }
+	SoundEntry *getSoundEntry()  { return _sound; }
 
 private:
 	LastExpressEngine *_engine;
diff --git a/engines/lastexpress/sound/queue.cpp b/engines/lastexpress/sound/queue.cpp
index ad5c9bf..b2f48cf 100644
--- a/engines/lastexpress/sound/queue.cpp
+++ b/engines/lastexpress/sound/queue.cpp
@@ -292,11 +292,11 @@ void SoundQueue::updateSubtitles() {
 		if (!(status & kSoundStatus_40)
 		 || status & kSoundStatus_180
 		 || soundEntry->getTime() == 0
-		 || (status & kSoundStatusFilterVariant) < 6
+		 || (status & kSoundStatusFilter) < 6
 		 || ((getFlags()->nis & 0x8000) && soundEntry->getPriority() < 90)) {
 			 current_index = 0;
 		} else {
-			current_index = soundEntry->getPriority() + (status & kSoundStatusFilterVariant);
+			current_index = soundEntry->getPriority() + (status & kSoundStatusFilter);
 
 			if (_currentSubtitle == (*i))
 				current_index += 4;






More information about the Scummvm-git-logs mailing list