hq3x/4x:
moved source files to seperate directory added 16bit C version C version: cleanup C version: much code merging for 16bit/32bit C version: code optimization ( only calculate YUV values for one pixel once ) C version: corrected one logic mistake when dealing with pixels at the border of the image
This commit is contained in:
parent
555409b3fd
commit
ba8f18d6dc
811
VBA.vcproj
811
VBA.vcproj
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Version="8,00"
|
||||
Name="VisualBoyAdvance"
|
||||
ProjectGUID="{6D4C5EC8-933F-4C05-A1BF-498E658576DF}"
|
||||
RootNamespace="VBA"
|
||||
|
@ -1704,10 +1704,382 @@
|
|||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="HQ"
|
||||
Name="hq"
|
||||
>
|
||||
<Filter
|
||||
Name="H/LQ2x"
|
||||
Name="c"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\src\hq\c\hq3x_pattern.h"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq\c\hq4x_pattern.h"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq\c\hq_base.h"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq\c\hq_implementation.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq\c\hq_shared.h"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="asm"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\src\hq\asm\hq3x32.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq\asm\hq3x32.h"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq\asm\hq3x_16.asm"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -i"src/hq/asm/" -fwin32 -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -i"src/hq/asm/" -fwin32 -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq\asm\hq3x_32.asm"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -i"src/hq/asm/" -fwin32 -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -i"src/hq/asm/" -fwin32 -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq\asm\hq4x_16.asm"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -i"src/hq/asm/" -fwin32 -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -i"src/hq/asm/" -fwin32 -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq\asm\hq4x_32.asm"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -i"src/hq/asm/" -fwin32 -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -i"src/hq/asm/" -fwin32 -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq\asm\macros.mac"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="old"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\src\hq2x.cpp"
|
||||
|
@ -1726,439 +2098,6 @@
|
|||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="HQ34x_ASM"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\src\hq3x32.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AssemblerOutput="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq3x32.h"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq3x_16.asm"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -isrc/ -fwin32 -g -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -isrc/ -fwin64 -g -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -isrc/ -fwin32 -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -isrc/ -fwin64 -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq3x_32.asm"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -isrc/ -fwin32 -g -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -isrc/ -fwin64 -g -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -isrc/ -fwin32 -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -isrc/ -fwin64 -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq4x_16.asm"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -isrc/ -fwin32 -g -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -isrc/ -fwin64 -g -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -isrc/ -fwin32 -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -isrc/ -fwin64 -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq4x_32.asm"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -isrc/ -fwin32 -g -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -isrc/ -fwin64 -g -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -isrc/ -fwin32 -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputFileName)..."
|
||||
CommandLine="nasm -O1 -isrc/ -fwin64 -Xvc -w-orphan-labels -o"$(IntDir)\$(InputName).obj" -- "$(InputPath)"
"
|
||||
Outputs=""$(IntDir)\$(InputName).obj""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\macros.mac"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="HQ34x_C"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\src\hq3x16c.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq3x32c.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq3x_pattern.h"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq4x16c.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq4x32c.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq4x_pattern.h"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq_shared32.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hq_shared32.h"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\hqxx.h"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
|
|
|
@ -10,6 +10,7 @@ Known preprocessor switches:
|
|||
- FINAL_VERSION: Defined for release versions, disables additional GBA logging and completely disables GB logging. Increases the amount of CPU cycles being emulated in one go.
|
||||
- BKPT_SUPPORT
|
||||
- MMX: Enable MMX instruction set
|
||||
- NO_ASM: Use C++ version of hq3x/4x filters
|
||||
- NO_OGL: Exclude OpenGL code
|
||||
- NO_D3D: Exclude Direct3D code
|
||||
- NO_OAL: Exclude OpenAL code
|
||||
|
|
|
@ -1,168 +1,168 @@
|
|||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2005 Forgotten and the VBA development team
|
||||
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2, or(at your option)
|
||||
// any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software Foundation,
|
||||
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#include "Util.h"
|
||||
#define __STDC_CONSTANT_MACROS
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void hq3x_16(unsigned char*, unsigned char*, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
void hq3x_32(unsigned char*, unsigned char*, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
void hq4x_16(unsigned char*, unsigned char*, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
void hq4x_32(unsigned char*, unsigned char*, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
|
||||
unsigned int LUT16to32[65536];
|
||||
unsigned int RGBtoYUV[65536];
|
||||
}
|
||||
|
||||
void InitLUTs(void)
|
||||
{
|
||||
int i, j, k, r, g, b, Y, u, v;
|
||||
|
||||
for (i=0; i<65536; i++)
|
||||
LUT16to32[i] = ((i & 0xF800) << 8) + ((i & 0x07E0) << 5) + ((i & 0x001F) << 3);
|
||||
|
||||
for (i=0; i<32; i++)
|
||||
for (j=0; j<64; j++)
|
||||
for (k=0; k<32; k++)
|
||||
{
|
||||
r = i << 3;
|
||||
g = j << 2;
|
||||
b = k << 3;
|
||||
Y = (r + g + b) >> 2;
|
||||
u = 128 + ((r - b) >> 2);
|
||||
v = 128 + ((-r + 2*g -b)>>3);
|
||||
RGBtoYUV[ (i << 11) + (j << 5) + k ] = (Y<<16) + (u<<8) + v;
|
||||
}
|
||||
}
|
||||
|
||||
int hq3xinited=0;
|
||||
extern int realsystemRedShift, realsystemBlueShift;
|
||||
|
||||
//16 bit input, see below for 32 bit input
|
||||
void hq3x32(unsigned char * pIn, unsigned int srcPitch,
|
||||
unsigned char *,
|
||||
unsigned char * pOut, unsigned int dstPitch,
|
||||
int Xres, int Yres)
|
||||
{
|
||||
if (!hq3xinited)
|
||||
{
|
||||
InitLUTs();
|
||||
hq3xinited=1;
|
||||
}
|
||||
hq3x_32( pIn, pOut, Xres, Yres, dstPitch, srcPitch - (Xres *2) );
|
||||
if (realsystemRedShift == 3)
|
||||
{ // damn you opengl...
|
||||
int offset = (dstPitch - (Xres *12)) / 4;
|
||||
unsigned int *p = (unsigned int *)pOut;
|
||||
Yres *= 3;
|
||||
while(Yres--)
|
||||
{
|
||||
for(int i=0;i<Xres*3;i++)
|
||||
{
|
||||
*p = (*p & 0xFF0000) >> 16 |
|
||||
(*p & 0x0000FF) << 16 |
|
||||
(*p & 0x00FF00);
|
||||
p++;
|
||||
}
|
||||
p += offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void hq3x16(unsigned char * pIn, unsigned int srcPitch,
|
||||
unsigned char *,
|
||||
unsigned char * pOut, unsigned int dstPitch,
|
||||
int Xres, int Yres)
|
||||
{
|
||||
if (!hq3xinited)
|
||||
{
|
||||
InitLUTs();
|
||||
hq3xinited=1;
|
||||
}
|
||||
hq3x_16( pIn, pOut, Xres, Yres, dstPitch, srcPitch - (Xres *2));
|
||||
}
|
||||
|
||||
|
||||
void hq4x16(unsigned char * pIn, unsigned int srcPitch,
|
||||
unsigned char *,
|
||||
unsigned char * pOut, unsigned int dstPitch,
|
||||
int Xres, int Yres)
|
||||
{
|
||||
if (!hq3xinited)
|
||||
{
|
||||
InitLUTs();
|
||||
hq3xinited=1;
|
||||
}
|
||||
hq4x_16( pIn, pOut, Xres, Yres, dstPitch, srcPitch - (Xres *2));
|
||||
}
|
||||
|
||||
//16 bit input, see below for 32 bit input
|
||||
void hq4x32(unsigned char * pIn, unsigned int srcPitch,
|
||||
unsigned char *,
|
||||
unsigned char * pOut, unsigned int dstPitch,
|
||||
int Xres, int Yres)
|
||||
{
|
||||
if (!hq3xinited)
|
||||
{
|
||||
InitLUTs();
|
||||
hq3xinited=1;
|
||||
}
|
||||
hq4x_32( pIn, pOut, Xres, Yres, dstPitch, srcPitch - (Xres *2));
|
||||
if (realsystemRedShift == 3)
|
||||
{ // damn you opengl...
|
||||
int offset = (dstPitch - (Xres *16)) / 4;
|
||||
unsigned int *p = (unsigned int *)pOut;
|
||||
Yres *= 4;
|
||||
while(Yres--)
|
||||
{
|
||||
for(int i=0;i<Xres*4;i++)
|
||||
{
|
||||
*p = (*p & 0xFF0000) >> 16 |
|
||||
(*p & 0x0000FF) << 16 |
|
||||
(*p & 0x00FF00);
|
||||
p++;
|
||||
}
|
||||
p += offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline void convert32bpp_16bpp(unsigned char *pIn, unsigned int width)
|
||||
{
|
||||
for (unsigned int i = 0; i < width; i+=4)
|
||||
{
|
||||
unsigned int p4 = ((unsigned int)pIn[i+2] << 16) | (unsigned int) (pIn[i+1] << 8) | pIn[i+0];
|
||||
unsigned short p2 = ((p4 >> 8)&0xF800) | ((p4 >> 5)&0x07E0) | ((p4 >> 3)&0x001F);
|
||||
pIn[i/2] = (p2 >> 0);
|
||||
pIn[i/2+1] = (p2 >> 8);
|
||||
}
|
||||
}
|
||||
|
||||
void hq3x32_32(unsigned char *pIn, unsigned int srcPitch, unsigned char *, unsigned char *pOut, unsigned int dstPitch, int Xres, int Yres)
|
||||
{
|
||||
convert32bpp_16bpp(pIn, srcPitch*Yres);
|
||||
hq3x32(pIn, srcPitch/2, 0, pOut, dstPitch, Xres, Yres);
|
||||
}
|
||||
|
||||
void hq4x32_32(unsigned char *pIn, unsigned int srcPitch, unsigned char *, unsigned char *pOut, unsigned int dstPitch, int Xres, int Yres)
|
||||
{
|
||||
convert32bpp_16bpp(pIn, srcPitch*Yres);
|
||||
hq4x32(pIn, srcPitch/2, 0, pOut, dstPitch, Xres, Yres);
|
||||
}
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2005 Forgotten and the VBA development team
|
||||
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2, or(at your option)
|
||||
// any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software Foundation,
|
||||
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#include "../../Util.h"
|
||||
#define __STDC_CONSTANT_MACROS
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void hq3x_16(unsigned char*, unsigned char*, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
void hq3x_32(unsigned char*, unsigned char*, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
void hq4x_16(unsigned char*, unsigned char*, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
void hq4x_32(unsigned char*, unsigned char*, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||
|
||||
unsigned int LUT16to32[65536];
|
||||
unsigned int RGBtoYUV[65536];
|
||||
}
|
||||
|
||||
void InitLUTs(void)
|
||||
{
|
||||
int i, j, k, r, g, b, Y, u, v;
|
||||
|
||||
for (i=0; i<65536; i++)
|
||||
LUT16to32[i] = ((i & 0xF800) << 8) + ((i & 0x07E0) << 5) + ((i & 0x001F) << 3);
|
||||
|
||||
for (i=0; i<32; i++)
|
||||
for (j=0; j<64; j++)
|
||||
for (k=0; k<32; k++)
|
||||
{
|
||||
r = i << 3;
|
||||
g = j << 2;
|
||||
b = k << 3;
|
||||
Y = (r + g + b) >> 2;
|
||||
u = 128 + ((r - b) >> 2);
|
||||
v = 128 + ((-r + 2*g -b)>>3);
|
||||
RGBtoYUV[ (i << 11) + (j << 5) + k ] = (Y<<16) + (u<<8) + v;
|
||||
}
|
||||
}
|
||||
|
||||
int hq3xinited=0;
|
||||
extern int realsystemRedShift, realsystemBlueShift;
|
||||
|
||||
//16 bit input, see below for 32 bit input
|
||||
void hq3x32(unsigned char * pIn, unsigned int srcPitch,
|
||||
unsigned char *,
|
||||
unsigned char * pOut, unsigned int dstPitch,
|
||||
int Xres, int Yres)
|
||||
{
|
||||
if (!hq3xinited)
|
||||
{
|
||||
InitLUTs();
|
||||
hq3xinited=1;
|
||||
}
|
||||
hq3x_32( pIn, pOut, Xres, Yres, dstPitch, srcPitch - (Xres *2) );
|
||||
if (realsystemRedShift == 3)
|
||||
{ // damn you opengl...
|
||||
int offset = (dstPitch - (Xres *12)) / 4;
|
||||
unsigned int *p = (unsigned int *)pOut;
|
||||
Yres *= 3;
|
||||
while(Yres--)
|
||||
{
|
||||
for(int i=0;i<Xres*3;i++)
|
||||
{
|
||||
*p = (*p & 0xFF0000) >> 16 |
|
||||
(*p & 0x0000FF) << 16 |
|
||||
(*p & 0x00FF00);
|
||||
p++;
|
||||
}
|
||||
p += offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void hq3x16(unsigned char * pIn, unsigned int srcPitch,
|
||||
unsigned char *,
|
||||
unsigned char * pOut, unsigned int dstPitch,
|
||||
int Xres, int Yres)
|
||||
{
|
||||
if (!hq3xinited)
|
||||
{
|
||||
InitLUTs();
|
||||
hq3xinited=1;
|
||||
}
|
||||
hq3x_16( pIn, pOut, Xres, Yres, dstPitch, srcPitch - (Xres *2));
|
||||
}
|
||||
|
||||
|
||||
void hq4x16(unsigned char * pIn, unsigned int srcPitch,
|
||||
unsigned char *,
|
||||
unsigned char * pOut, unsigned int dstPitch,
|
||||
int Xres, int Yres)
|
||||
{
|
||||
if (!hq3xinited)
|
||||
{
|
||||
InitLUTs();
|
||||
hq3xinited=1;
|
||||
}
|
||||
hq4x_16( pIn, pOut, Xres, Yres, dstPitch, srcPitch - (Xres *2));
|
||||
}
|
||||
|
||||
//16 bit input, see below for 32 bit input
|
||||
void hq4x32(unsigned char * pIn, unsigned int srcPitch,
|
||||
unsigned char *,
|
||||
unsigned char * pOut, unsigned int dstPitch,
|
||||
int Xres, int Yres)
|
||||
{
|
||||
if (!hq3xinited)
|
||||
{
|
||||
InitLUTs();
|
||||
hq3xinited=1;
|
||||
}
|
||||
hq4x_32( pIn, pOut, Xres, Yres, dstPitch, srcPitch - (Xres *2));
|
||||
if (realsystemRedShift == 3)
|
||||
{ // damn you opengl...
|
||||
int offset = (dstPitch - (Xres *16)) / 4;
|
||||
unsigned int *p = (unsigned int *)pOut;
|
||||
Yres *= 4;
|
||||
while(Yres--)
|
||||
{
|
||||
for(int i=0;i<Xres*4;i++)
|
||||
{
|
||||
*p = (*p & 0xFF0000) >> 16 |
|
||||
(*p & 0x0000FF) << 16 |
|
||||
(*p & 0x00FF00);
|
||||
p++;
|
||||
}
|
||||
p += offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline void convert32bpp_16bpp(unsigned char *pIn, unsigned int width)
|
||||
{
|
||||
for (unsigned int i = 0; i < width; i+=4)
|
||||
{
|
||||
unsigned int p4 = ((unsigned int)pIn[i+2] << 16) | (unsigned int) (pIn[i+1] << 8) | pIn[i+0];
|
||||
unsigned short p2 = ((p4 >> 8)&0xF800) | ((p4 >> 5)&0x07E0) | ((p4 >> 3)&0x001F);
|
||||
pIn[i/2] = (p2 >> 0);
|
||||
pIn[i/2+1] = (p2 >> 8);
|
||||
}
|
||||
}
|
||||
|
||||
void hq3x32_32(unsigned char *pIn, unsigned int srcPitch, unsigned char *, unsigned char *pOut, unsigned int dstPitch, int Xres, int Yres)
|
||||
{
|
||||
convert32bpp_16bpp(pIn, srcPitch*Yres);
|
||||
hq3x32(pIn, srcPitch/2, 0, pOut, dstPitch, Xres, Yres);
|
||||
}
|
||||
|
||||
void hq4x32_32(unsigned char *pIn, unsigned int srcPitch, unsigned char *, unsigned char *pOut, unsigned int dstPitch, int Xres, int Yres)
|
||||
{
|
||||
convert32bpp_16bpp(pIn, srcPitch*Yres);
|
||||
hq4x32(pIn, srcPitch/2, 0, pOut, dstPitch, Xres, Yres);
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,73 +1,73 @@
|
|||
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
|
||||
;
|
||||
;http://www.zsnes.com
|
||||
;http://sourceforge.net/projects/zsnes
|
||||
;https://zsnes.bountysource.com
|
||||
;
|
||||
;This program is free software; you can redistribute it and/or
|
||||
;modify it under the terms of the GNU General Public License
|
||||
;version 2 as published by the Free Software Foundation.
|
||||
;
|
||||
;This program is distributed in the hope that it will be useful,
|
||||
;but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;GNU General Public License for more details.
|
||||
;
|
||||
;You should have received a copy of the GNU General Public License
|
||||
;along with this program; if not, write to the Free Software
|
||||
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
%ifdef __AMD64__
|
||||
bits 64
|
||||
%else
|
||||
bits 32
|
||||
%endif
|
||||
|
||||
%ifdef MACHO
|
||||
section .text align=16
|
||||
section .data align=4
|
||||
section .bss align=4
|
||||
%endif
|
||||
|
||||
%ifdef ELF
|
||||
|
||||
%imacro newsym 1
|
||||
GLOBAL %1
|
||||
%1:
|
||||
%endmacro
|
||||
%imacro newsym 2+
|
||||
GLOBAL %1
|
||||
%1: %2
|
||||
%endmacro
|
||||
%define EXTSYM EXTERN
|
||||
|
||||
section .note.GNU-stack noalloc noexec nowrite progbits
|
||||
|
||||
%else
|
||||
|
||||
%imacro newsym 1
|
||||
GLOBAL _%1
|
||||
_%1:
|
||||
%1:
|
||||
%endmacro
|
||||
%imacro newsym 2+
|
||||
GLOBAL _%1
|
||||
_%1:
|
||||
%1: %2
|
||||
%endmacro
|
||||
%imacro EXTSYM 1-*
|
||||
%rep %0
|
||||
EXTERN _%1
|
||||
%define %1 _%1
|
||||
%rotate 1
|
||||
%endrep
|
||||
%endmacro
|
||||
%endif
|
||||
|
||||
%macro ALIGN32 0
|
||||
times ($$-$) & 1Fh nop ; Long word alignment
|
||||
%endmacro
|
||||
%macro ALIGN16 0
|
||||
times ($$-$) & 1Fh nop ; Long word alignment
|
||||
%endmacro
|
||||
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
|
||||
;
|
||||
;http://www.zsnes.com
|
||||
;http://sourceforge.net/projects/zsnes
|
||||
;https://zsnes.bountysource.com
|
||||
;
|
||||
;This program is free software; you can redistribute it and/or
|
||||
;modify it under the terms of the GNU General Public License
|
||||
;version 2 as published by the Free Software Foundation.
|
||||
;
|
||||
;This program is distributed in the hope that it will be useful,
|
||||
;but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;GNU General Public License for more details.
|
||||
;
|
||||
;You should have received a copy of the GNU General Public License
|
||||
;along with this program; if not, write to the Free Software
|
||||
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
%ifdef __AMD64__
|
||||
bits 64
|
||||
%else
|
||||
bits 32
|
||||
%endif
|
||||
|
||||
%ifdef MACHO
|
||||
section .text align=16
|
||||
section .data align=4
|
||||
section .bss align=4
|
||||
%endif
|
||||
|
||||
%ifdef ELF
|
||||
|
||||
%imacro newsym 1
|
||||
GLOBAL %1
|
||||
%1:
|
||||
%endmacro
|
||||
%imacro newsym 2+
|
||||
GLOBAL %1
|
||||
%1: %2
|
||||
%endmacro
|
||||
%define EXTSYM EXTERN
|
||||
|
||||
section .note.GNU-stack noalloc noexec nowrite progbits
|
||||
|
||||
%else
|
||||
|
||||
%imacro newsym 1
|
||||
GLOBAL _%1
|
||||
_%1:
|
||||
%1:
|
||||
%endmacro
|
||||
%imacro newsym 2+
|
||||
GLOBAL _%1
|
||||
_%1:
|
||||
%1: %2
|
||||
%endmacro
|
||||
%imacro EXTSYM 1-*
|
||||
%rep %0
|
||||
EXTERN _%1
|
||||
%define %1 _%1
|
||||
%rotate 1
|
||||
%endrep
|
||||
%endmacro
|
||||
%endif
|
||||
|
||||
%macro ALIGN32 0
|
||||
times ($$-$) & 1Fh nop ; Long word alignment
|
||||
%endmacro
|
||||
%macro ALIGN16 0
|
||||
times ($$-$) & 1Fh nop ; Long word alignment
|
||||
%endmacro
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,384 +1,434 @@
|
|||
/*
|
||||
VisualBoyAdvance - a Game Boy & Game Boy Advance emulator
|
||||
|
||||
Copyright (C) 1999 - 2003 Forgotten
|
||||
Copyright (C) 2003 - 2004 Forgotten and the VBA development team
|
||||
Copyright (C) 2005 - 2006 VBA development team
|
||||
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "System.h"
|
||||
|
||||
#if defined(_16BIT)
|
||||
#define SIZE_PIXEL 2
|
||||
#define COLORTYPE uint32_t
|
||||
#elif defined(_32BIT)
|
||||
#define SIZE_PIXEL 4 // 32bit = 4 bytes
|
||||
#define COLORTYPE unsigned int
|
||||
#endif
|
||||
#define abs32(value) (value & 0x7FFFFFFF)
|
||||
|
||||
|
||||
void Interp1(unsigned char * pc, COLORTYPE c1, COLORTYPE c2);
|
||||
void Interp2(unsigned char * pc, COLORTYPE c1, COLORTYPE c2, COLORTYPE c3);
|
||||
void Interp3(unsigned char * pc, COLORTYPE c1, COLORTYPE c2);
|
||||
void Interp4(unsigned char * pc, COLORTYPE c1, COLORTYPE c2, COLORTYPE c3);
|
||||
void Interp5(unsigned char * pc, COLORTYPE c1, COLORTYPE c2);
|
||||
void Interp6(unsigned char * pc, COLORTYPE c1, COLORTYPE c2, COLORTYPE c3);
|
||||
void Interp7(unsigned char * pc, COLORTYPE c1, COLORTYPE c2, COLORTYPE c3);
|
||||
void Interp8(unsigned char * pc, COLORTYPE c1, COLORTYPE c2);
|
||||
unsigned int RGBtoYUV(COLORTYPE c);
|
||||
bool Diff(COLORTYPE c1, COLORTYPE c2);
|
||||
|
||||
|
||||
#if defined(_HQ3X)
|
||||
#define _MAGNIFICATION 3
|
||||
|
||||
#define PIXEL00_1M Interp1( pOut, c[5], c[1] );
|
||||
#define PIXEL00_1U Interp1( pOut, c[5], c[2] );
|
||||
#define PIXEL00_1L Interp1( pOut, c[5], c[4] );
|
||||
#define PIXEL00_2 Interp2( pOut, c[5], c[4], c[2] );
|
||||
#define PIXEL00_4 Interp4( pOut, c[5], c[4], c[2] );
|
||||
#define PIXEL00_5 Interp5( pOut, c[4], c[2] );
|
||||
#define PIXEL00_C *((COLORTYPE*)(pOut)) = c[5];
|
||||
|
||||
#define PIXEL01_1 Interp1( pOut+SIZE_PIXEL, c[5], c[2] );
|
||||
#define PIXEL01_3 Interp3( pOut+SIZE_PIXEL, c[5], c[2] );
|
||||
#define PIXEL01_6 Interp1( pOut+SIZE_PIXEL, c[2], c[5] );
|
||||
#define PIXEL01_C *((COLORTYPE*)(pOut+SIZE_PIXEL)) = c[5];
|
||||
|
||||
#define PIXEL02_1M Interp1( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[3] );
|
||||
#define PIXEL02_1U Interp1( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2] );
|
||||
#define PIXEL02_1R Interp1( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] );
|
||||
#define PIXEL02_2 Interp2( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2], c[6] );
|
||||
#define PIXEL02_4 Interp4( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2], c[6] );
|
||||
#define PIXEL02_5 Interp5( pOut+SIZE_PIXEL+SIZE_PIXEL, c[2], c[6] );
|
||||
#define PIXEL02_C *((COLORTYPE*)(pOut+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
|
||||
#define PIXEL10_1 Interp1( pOut+dstPitch, c[5], c[4] );
|
||||
#define PIXEL10_3 Interp3( pOut+dstPitch, c[5], c[4] );
|
||||
#define PIXEL10_6 Interp1( pOut+dstPitch, c[4], c[5] );
|
||||
#define PIXEL10_C *((COLORTYPE*)(pOut+dstPitch)) = c[5];
|
||||
|
||||
#define PIXEL11 *((COLORTYPE*)(pOut+dstPitch+SIZE_PIXEL)) = c[5];
|
||||
|
||||
#define PIXEL12_1 Interp1( pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] );
|
||||
#define PIXEL12_3 Interp3( pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] );
|
||||
#define PIXEL12_6 Interp1( pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[6], c[5] );
|
||||
#define PIXEL12_C *((COLORTYPE*)(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
|
||||
#define PIXEL20_1M Interp1( pOut+dstPitch+dstPitch, c[5], c[7] );
|
||||
#define PIXEL20_1D Interp1( pOut+dstPitch+dstPitch, c[5], c[8] );
|
||||
#define PIXEL20_1L Interp1( pOut+dstPitch+dstPitch, c[5], c[4] );
|
||||
#define PIXEL20_2 Interp2( pOut+dstPitch+dstPitch, c[5], c[8], c[4] );
|
||||
#define PIXEL20_4 Interp4( pOut+dstPitch+dstPitch, c[5], c[8], c[4] );
|
||||
#define PIXEL20_5 Interp5( pOut+dstPitch+dstPitch, c[8], c[4] );
|
||||
#define PIXEL20_C *((COLORTYPE*)(pOut+dstPitch+dstPitch)) = c[5];
|
||||
|
||||
#define PIXEL21_1 Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8] );
|
||||
#define PIXEL21_3 Interp3( pOut+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8] );
|
||||
#define PIXEL21_6 Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL, c[8], c[5] );
|
||||
#define PIXEL21_C *((COLORTYPE*)(pOut+dstPitch+dstPitch+SIZE_PIXEL)) = c[5];
|
||||
|
||||
#define PIXEL22_1M Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[9] );
|
||||
#define PIXEL22_1D Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8] );
|
||||
#define PIXEL22_1R Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] );
|
||||
#define PIXEL22_2 Interp2( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[8] );
|
||||
#define PIXEL22_4 Interp4( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[8] );
|
||||
#define PIXEL22_5 Interp5( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[6], c[8] );
|
||||
#define PIXEL22_C *((COLORTYPE*)(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
|
||||
#elif defined(_HQ4X)
|
||||
|
||||
#define _MAGNIFICATION 4
|
||||
|
||||
#define PIXEL00_0 *((COLORTYPE*)(pOut)) = c[5];
|
||||
#define PIXEL00_11 Interp1(pOut, c[5], c[4]);
|
||||
#define PIXEL00_12 Interp1(pOut, c[5], c[2]);
|
||||
#define PIXEL00_20 Interp2(pOut, c[5], c[2], c[4]);
|
||||
#define PIXEL00_50 Interp5(pOut, c[2], c[4]);
|
||||
#define PIXEL00_80 Interp8(pOut, c[5], c[1]);
|
||||
#define PIXEL00_81 Interp8(pOut, c[5], c[4]);
|
||||
#define PIXEL00_82 Interp8(pOut, c[5], c[2]);
|
||||
|
||||
#define PIXEL01_0 *((COLORTYPE*)(pOut+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL01_10 Interp1(pOut+SIZE_PIXEL, c[5], c[1]);
|
||||
#define PIXEL01_12 Interp1(pOut+SIZE_PIXEL, c[5], c[2]);
|
||||
#define PIXEL01_14 Interp1(pOut+SIZE_PIXEL, c[2], c[5]);
|
||||
#define PIXEL01_21 Interp2(pOut+SIZE_PIXEL, c[2], c[5], c[4]);
|
||||
#define PIXEL01_31 Interp3(pOut+SIZE_PIXEL, c[5], c[4]);
|
||||
#define PIXEL01_50 Interp5(pOut+SIZE_PIXEL, c[2], c[5]);
|
||||
#define PIXEL01_60 Interp6(pOut+SIZE_PIXEL, c[5], c[2], c[4]);
|
||||
#define PIXEL01_61 Interp6(pOut+SIZE_PIXEL, c[5], c[2], c[1]);
|
||||
#define PIXEL01_82 Interp8(pOut+SIZE_PIXEL, c[5], c[2]);
|
||||
#define PIXEL01_83 Interp8(pOut+SIZE_PIXEL, c[2], c[4]);
|
||||
|
||||
#define PIXEL02_0 *((COLORTYPE*)(pOut+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL02_10 Interp1(pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[3]);
|
||||
#define PIXEL02_11 Interp1(pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2]);
|
||||
#define PIXEL02_13 Interp1(pOut+SIZE_PIXEL+SIZE_PIXEL, c[2], c[5]);
|
||||
#define PIXEL02_21 Interp2(pOut+SIZE_PIXEL+SIZE_PIXEL, c[2], c[5], c[6]);
|
||||
#define PIXEL02_32 Interp3(pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL02_50 Interp5(pOut+SIZE_PIXEL+SIZE_PIXEL, c[2], c[5]);
|
||||
#define PIXEL02_60 Interp6(pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2], c[6]);
|
||||
#define PIXEL02_61 Interp6(pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2], c[3]);
|
||||
#define PIXEL02_81 Interp8(pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2]);
|
||||
#define PIXEL02_83 Interp8(pOut+SIZE_PIXEL+SIZE_PIXEL, c[2], c[6]);
|
||||
|
||||
#define PIXEL03_0 *((COLORTYPE*)(pOut+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL03_11 Interp1(pOut+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2]);
|
||||
#define PIXEL03_12 Interp1(pOut+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL03_20 Interp2(pOut+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2], c[6]);
|
||||
#define PIXEL03_50 Interp5(pOut+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[2], c[6]);
|
||||
#define PIXEL03_80 Interp8(pOut+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[3]);
|
||||
#define PIXEL03_81 Interp8(pOut+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2]);
|
||||
#define PIXEL03_82 Interp8(pOut+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
|
||||
#define PIXEL10_0 *((COLORTYPE*)(pOut+dstPitch)) = c[5];
|
||||
#define PIXEL10_10 Interp1(pOut+dstPitch, c[5], c[1]);
|
||||
#define PIXEL10_11 Interp1(pOut+dstPitch, c[5], c[4]);
|
||||
#define PIXEL10_13 Interp1(pOut+dstPitch, c[4], c[5]);
|
||||
#define PIXEL10_21 Interp2(pOut+dstPitch, c[4], c[5], c[2]);
|
||||
#define PIXEL10_32 Interp3(pOut+dstPitch, c[5], c[2]);
|
||||
#define PIXEL10_50 Interp5(pOut+dstPitch, c[4], c[5]);
|
||||
#define PIXEL10_60 Interp6(pOut+dstPitch, c[5], c[4], c[2]);
|
||||
#define PIXEL10_61 Interp6(pOut+dstPitch, c[5], c[4], c[1]);
|
||||
#define PIXEL10_81 Interp8(pOut+dstPitch, c[5], c[4]);
|
||||
#define PIXEL10_83 Interp8(pOut+dstPitch, c[4], c[2]);
|
||||
|
||||
#define PIXEL11_0 *((COLORTYPE*)(pOut+dstPitch+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL11_30 Interp3(pOut+dstPitch+SIZE_PIXEL, c[5], c[1]);
|
||||
#define PIXEL11_31 Interp3(pOut+dstPitch+SIZE_PIXEL, c[5], c[4]);
|
||||
#define PIXEL11_32 Interp3(pOut+dstPitch+SIZE_PIXEL, c[5], c[2]);
|
||||
#define PIXEL11_70 Interp7(pOut+dstPitch+SIZE_PIXEL, c[5], c[4], c[2]);
|
||||
|
||||
#define PIXEL12_0 *((COLORTYPE*)(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL12_30 Interp3(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[3]);
|
||||
#define PIXEL12_31 Interp3(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2]);
|
||||
#define PIXEL12_32 Interp3(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL12_70 Interp7(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[2]);
|
||||
|
||||
#define PIXEL13_0 *((COLORTYPE*)(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL13_10 Interp1(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[3]);
|
||||
#define PIXEL13_12 Interp1(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL13_14 Interp1(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[6], c[5]);
|
||||
#define PIXEL13_21 Interp2(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[6], c[5], c[2]);
|
||||
#define PIXEL13_31 Interp3(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2]);
|
||||
#define PIXEL13_50 Interp5(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[6], c[5]);
|
||||
#define PIXEL13_60 Interp6(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[2]);
|
||||
#define PIXEL13_61 Interp6(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[3]);
|
||||
#define PIXEL13_82 Interp8(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL13_83 Interp8(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[6], c[2]);
|
||||
|
||||
#define PIXEL20_0 *((COLORTYPE*)(pOut+dstPitch+dstPitch)) = c[5];
|
||||
#define PIXEL20_10 Interp1(pOut+dstPitch+dstPitch, c[5], c[7]);
|
||||
#define PIXEL20_12 Interp1(pOut+dstPitch+dstPitch, c[5], c[4]);
|
||||
#define PIXEL20_14 Interp1(pOut+dstPitch+dstPitch, c[4], c[5]);
|
||||
#define PIXEL20_21 Interp2(pOut+dstPitch+dstPitch, c[4], c[5], c[8]);
|
||||
#define PIXEL20_31 Interp3(pOut+dstPitch+dstPitch, c[5], c[8]);
|
||||
#define PIXEL20_50 Interp5(pOut+dstPitch+dstPitch, c[4], c[5]);
|
||||
#define PIXEL20_60 Interp6(pOut+dstPitch+dstPitch, c[5], c[4], c[8]);
|
||||
#define PIXEL20_61 Interp6(pOut+dstPitch+dstPitch, c[5], c[4], c[7]);
|
||||
#define PIXEL20_82 Interp8(pOut+dstPitch+dstPitch, c[5], c[4]);
|
||||
#define PIXEL20_83 Interp8(pOut+dstPitch+dstPitch, c[4], c[8]);
|
||||
|
||||
#define PIXEL21_0 *((COLORTYPE*)(pOut+dstPitch+dstPitch+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL21_30 Interp3(pOut+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[7]);
|
||||
#define PIXEL21_31 Interp3(pOut+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8]);
|
||||
#define PIXEL21_32 Interp3(pOut+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[4]);
|
||||
#define PIXEL21_70 Interp7(pOut+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[4], c[8]);
|
||||
#define PIXEL22_0 *((COLORTYPE*)(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL22_30 Interp3(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[9]);
|
||||
#define PIXEL22_31 Interp3(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL22_32 Interp3(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8]);
|
||||
#define PIXEL22_70 Interp7(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[8]);
|
||||
|
||||
#define PIXEL23_0 *((COLORTYPE*)(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL23_10 Interp1(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[9]);
|
||||
#define PIXEL23_11 Interp1(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL23_13 Interp1(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[6], c[5]);
|
||||
#define PIXEL23_21 Interp2(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[6], c[5], c[8]);
|
||||
#define PIXEL23_32 Interp3(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8]);
|
||||
#define PIXEL23_50 Interp5(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[6], c[5]);
|
||||
#define PIXEL23_60 Interp6(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[8]);
|
||||
#define PIXEL23_61 Interp6(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[9]);
|
||||
#define PIXEL23_81 Interp8(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL23_83 Interp8(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[6], c[8]);
|
||||
|
||||
#define PIXEL30_0 *((COLORTYPE*)(pOut+dstPitch+dstPitch+dstPitch)) = c[5];
|
||||
#define PIXEL30_11 Interp1(pOut+dstPitch+dstPitch+dstPitch, c[5], c[8]);
|
||||
#define PIXEL30_12 Interp1(pOut+dstPitch+dstPitch+dstPitch, c[5], c[4]);
|
||||
#define PIXEL30_20 Interp2(pOut+dstPitch+dstPitch+dstPitch, c[5], c[8], c[4]);
|
||||
#define PIXEL30_50 Interp5(pOut+dstPitch+dstPitch+dstPitch, c[8], c[4]);
|
||||
#define PIXEL30_80 Interp8(pOut+dstPitch+dstPitch+dstPitch, c[5], c[7]);
|
||||
#define PIXEL30_81 Interp8(pOut+dstPitch+dstPitch+dstPitch, c[5], c[8]);
|
||||
#define PIXEL30_82 Interp8(pOut+dstPitch+dstPitch+dstPitch, c[5], c[4]);
|
||||
|
||||
#define PIXEL31_0 *((COLORTYPE*)(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL31_10 Interp1(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[7]);
|
||||
#define PIXEL31_11 Interp1(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8]);
|
||||
#define PIXEL31_13 Interp1(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[8], c[5]);
|
||||
#define PIXEL31_21 Interp2(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[8], c[5], c[4]);
|
||||
#define PIXEL31_32 Interp3(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[4]);
|
||||
#define PIXEL31_50 Interp5(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[8], c[5]);
|
||||
#define PIXEL31_60 Interp6(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8], c[4]);
|
||||
#define PIXEL31_61 Interp6(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8], c[7]);
|
||||
#define PIXEL31_81 Interp8(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8]);
|
||||
#define PIXEL31_83 Interp8(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[8], c[4]);
|
||||
|
||||
#define PIXEL32_0 *((COLORTYPE*)(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL32_10 Interp1(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[9]);
|
||||
#define PIXEL32_12 Interp1(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8]);
|
||||
#define PIXEL32_14 Interp1(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[8], c[5]);
|
||||
#define PIXEL32_21 Interp2(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[8], c[5], c[6]);
|
||||
#define PIXEL32_31 Interp3(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL32_50 Interp5(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[8], c[5]);
|
||||
#define PIXEL32_60 Interp6(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8], c[6]);
|
||||
#define PIXEL32_61 Interp6(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8], c[9]);
|
||||
#define PIXEL32_82 Interp8(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8]);
|
||||
#define PIXEL32_83 Interp8(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[8], c[6]);
|
||||
|
||||
#define PIXEL33_0 *((COLORTYPE*)(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL33_11 Interp1(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL33_12 Interp1(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8]);
|
||||
#define PIXEL33_20 Interp2(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8], c[6]);
|
||||
#define PIXEL33_50 Interp5(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[8], c[6]);
|
||||
#define PIXEL33_80 Interp8(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[9]);
|
||||
#define PIXEL33_81 Interp8(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL33_82 Interp8(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8]);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined(_HQ3X)
|
||||
#if defined(_16BIT)
|
||||
void hq3x16(unsigned char * pIn, unsigned int srcPitch,
|
||||
unsigned char *,
|
||||
unsigned char * pOut, unsigned int dstPitch,
|
||||
int Xres, int Yres)
|
||||
#elif defined(_32BIT)
|
||||
void hq3x32_32(unsigned char * pIn, unsigned int srcPitch,
|
||||
unsigned char *,
|
||||
unsigned char * pOut, unsigned int dstPitch,
|
||||
int Xres, int Yres)
|
||||
#endif
|
||||
#elif defined(_HQ4X)
|
||||
#if defined(_16BIT)
|
||||
void hq4x16(unsigned char * pIn, unsigned int srcPitch,
|
||||
unsigned char *,
|
||||
unsigned char * pOut, unsigned int dstPitch,
|
||||
int Xres, int Yres)
|
||||
#elif defined(_32BIT)
|
||||
void hq4x32_32(unsigned char * pIn, unsigned int srcPitch,
|
||||
unsigned char *,
|
||||
unsigned char * pOut, unsigned int dstPitch,
|
||||
int Xres, int Yres)
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
unsigned int YUV1, YUV2;
|
||||
int i, j, k;
|
||||
unsigned int line;
|
||||
COLORTYPE c[10];
|
||||
|
||||
// +----+----+----+
|
||||
// | | | |
|
||||
// | c1 | c2 | c3 |
|
||||
// +----+----+----+
|
||||
// | | | |
|
||||
// | c4 | c5 | c6 |
|
||||
// +----+----+----+
|
||||
// | | | |
|
||||
// | c7 | c8 | c9 |
|
||||
// +----+----+----+
|
||||
|
||||
for (j=0; j<Yres; j++)
|
||||
{
|
||||
if ( (j>0) || (j<Yres-1) ) line = srcPitch; else line = 0;
|
||||
|
||||
for (i=0; i<Xres; i++)
|
||||
{
|
||||
c[2] = *((COLORTYPE*)(pIn - line));
|
||||
c[5] = *((COLORTYPE*)(pIn ));
|
||||
c[8] = *((COLORTYPE*)(pIn + line));
|
||||
|
||||
if (i>0)
|
||||
{
|
||||
c[1] = *((COLORTYPE*)(pIn - line - SIZE_PIXEL));
|
||||
c[4] = *((COLORTYPE*)(pIn - SIZE_PIXEL));
|
||||
c[7] = *((COLORTYPE*)(pIn + line - SIZE_PIXEL));
|
||||
}
|
||||
else
|
||||
{
|
||||
c[1] = c[2];
|
||||
c[4] = c[5];
|
||||
c[7] = c[8];
|
||||
}
|
||||
|
||||
if (i<Xres-1)
|
||||
{
|
||||
c[3] = *((COLORTYPE*)(pIn - line + SIZE_PIXEL));
|
||||
c[6] = *((COLORTYPE*)(pIn + SIZE_PIXEL));
|
||||
c[9] = *((COLORTYPE*)(pIn + line + SIZE_PIXEL));
|
||||
}
|
||||
else
|
||||
{
|
||||
c[3] = c[2];
|
||||
c[6] = c[5];
|
||||
c[9] = c[8];
|
||||
}
|
||||
|
||||
int pattern = 0;
|
||||
int flag = 1;
|
||||
|
||||
YUV1 = RGBtoYUV(c[5]);
|
||||
|
||||
for (k=1; k<=9; k++)
|
||||
{
|
||||
if (k==5) continue;
|
||||
|
||||
if ( c[k] != c[5] )
|
||||
{
|
||||
YUV2 = RGBtoYUV(c[k]);
|
||||
if (
|
||||
( abs32((YUV1 & 0x00FF0000) - (YUV2 & 0x00FF0000)) > 0x00300000 ) ||
|
||||
( abs32((YUV1 & 0x0000FF00) - (YUV2 & 0x0000FF00)) > 0x00000700 ) ||
|
||||
( abs32((YUV1 & 0x000000FF) - (YUV2 & 0x000000FF)) > 0x00000006 )
|
||||
)
|
||||
pattern |= flag;
|
||||
}
|
||||
flag <<= 1;
|
||||
}
|
||||
|
||||
#if defined(_HQ3X)
|
||||
#include "hq3x_pattern.h"
|
||||
#elif defined(_HQ4X)
|
||||
#include "hq4x_pattern.h"
|
||||
#endif
|
||||
|
||||
pIn += SIZE_PIXEL;
|
||||
pOut += _MAGNIFICATION * SIZE_PIXEL;
|
||||
}
|
||||
pIn += srcPitch - (Xres * SIZE_PIXEL);
|
||||
pOut += dstPitch-(_MAGNIFICATION * Xres * SIZE_PIXEL);
|
||||
pOut += (_MAGNIFICATION-1) * dstPitch;
|
||||
}
|
||||
}
|
||||
|
||||
#undef SIZE_PIXEL
|
||||
#undef COLORTYPE
|
||||
#undef abs32
|
||||
/*
|
||||
VisualBoyAdvance - a Game Boy & Game Boy Advance emulator
|
||||
|
||||
Copyright (C) 2008 VBA-M development team
|
||||
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
hq filter by Maxim Stepin ( http://hiend3d.com )
|
||||
*/
|
||||
|
||||
|
||||
#ifdef _16BIT
|
||||
#ifdef _32BIT
|
||||
#error _16BIT and _32BIT defined at the same time!
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _16BIT
|
||||
#define SIZE_PIXEL 2 // 16bit = 2 bytes
|
||||
#define COLORTYPE unsigned short
|
||||
#define RGBtoYUV RGBtoYUV_16
|
||||
#define Interp1 Interp1_16
|
||||
#define Interp2 Interp2_16
|
||||
#define Interp3 Interp3_16
|
||||
#define Interp4 Interp4_16
|
||||
#define Interp5 Interp5_16
|
||||
#define Interp6 Interp6_16
|
||||
#define Interp7 Interp7_16
|
||||
#define Interp8 Interp8_16
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _32BIT
|
||||
#define SIZE_PIXEL 4 // 32bit = 4 bytes
|
||||
#define COLORTYPE unsigned int
|
||||
#define RGBtoYUV RGBtoYUV_32
|
||||
#define Interp1 Interp1_32
|
||||
#define Interp2 Interp2_32
|
||||
#define Interp3 Interp3_32
|
||||
#define Interp4 Interp4_32
|
||||
#define Interp5 Interp5_32
|
||||
#define Interp6 Interp6_32
|
||||
#define Interp7 Interp7_32
|
||||
#define Interp8 Interp8_32
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _HQ3X
|
||||
|
||||
#define _MAGNIFICATION 3
|
||||
|
||||
#define PIXEL00_1M Interp1( pOut, c[5], c[1] );
|
||||
#define PIXEL00_1U Interp1( pOut, c[5], c[2] );
|
||||
#define PIXEL00_1L Interp1( pOut, c[5], c[4] );
|
||||
#define PIXEL00_2 Interp2( pOut, c[5], c[4], c[2] );
|
||||
#define PIXEL00_4 Interp4( pOut, c[5], c[4], c[2] );
|
||||
#define PIXEL00_5 Interp5( pOut, c[4], c[2] );
|
||||
#define PIXEL00_C *((COLORTYPE*)(pOut)) = c[5];
|
||||
|
||||
#define PIXEL01_1 Interp1( pOut+SIZE_PIXEL, c[5], c[2] );
|
||||
#define PIXEL01_3 Interp3( pOut+SIZE_PIXEL, c[5], c[2] );
|
||||
#define PIXEL01_6 Interp1( pOut+SIZE_PIXEL, c[2], c[5] );
|
||||
#define PIXEL01_C *((COLORTYPE*)(pOut+SIZE_PIXEL)) = c[5];
|
||||
|
||||
#define PIXEL02_1M Interp1( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[3] );
|
||||
#define PIXEL02_1U Interp1( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2] );
|
||||
#define PIXEL02_1R Interp1( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] );
|
||||
#define PIXEL02_2 Interp2( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2], c[6] );
|
||||
#define PIXEL02_4 Interp4( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2], c[6] );
|
||||
#define PIXEL02_5 Interp5( pOut+SIZE_PIXEL+SIZE_PIXEL, c[2], c[6] );
|
||||
#define PIXEL02_C *((COLORTYPE*)(pOut+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
|
||||
#define PIXEL10_1 Interp1( pOut+dstPitch, c[5], c[4] );
|
||||
#define PIXEL10_3 Interp3( pOut+dstPitch, c[5], c[4] );
|
||||
#define PIXEL10_6 Interp1( pOut+dstPitch, c[4], c[5] );
|
||||
#define PIXEL10_C *((COLORTYPE*)(pOut+dstPitch)) = c[5];
|
||||
|
||||
#define PIXEL11 *((COLORTYPE*)(pOut+dstPitch+SIZE_PIXEL)) = c[5];
|
||||
|
||||
#define PIXEL12_1 Interp1( pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] );
|
||||
#define PIXEL12_3 Interp3( pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] );
|
||||
#define PIXEL12_6 Interp1( pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[6], c[5] );
|
||||
#define PIXEL12_C *((COLORTYPE*)(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
|
||||
#define PIXEL20_1M Interp1( pOut+dstPitch+dstPitch, c[5], c[7] );
|
||||
#define PIXEL20_1D Interp1( pOut+dstPitch+dstPitch, c[5], c[8] );
|
||||
#define PIXEL20_1L Interp1( pOut+dstPitch+dstPitch, c[5], c[4] );
|
||||
#define PIXEL20_2 Interp2( pOut+dstPitch+dstPitch, c[5], c[8], c[4] );
|
||||
#define PIXEL20_4 Interp4( pOut+dstPitch+dstPitch, c[5], c[8], c[4] );
|
||||
#define PIXEL20_5 Interp5( pOut+dstPitch+dstPitch, c[8], c[4] );
|
||||
#define PIXEL20_C *((COLORTYPE*)(pOut+dstPitch+dstPitch)) = c[5];
|
||||
|
||||
#define PIXEL21_1 Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8] );
|
||||
#define PIXEL21_3 Interp3( pOut+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8] );
|
||||
#define PIXEL21_6 Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL, c[8], c[5] );
|
||||
#define PIXEL21_C *((COLORTYPE*)(pOut+dstPitch+dstPitch+SIZE_PIXEL)) = c[5];
|
||||
|
||||
#define PIXEL22_1M Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[9] );
|
||||
#define PIXEL22_1D Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8] );
|
||||
#define PIXEL22_1R Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] );
|
||||
#define PIXEL22_2 Interp2( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[8] );
|
||||
#define PIXEL22_4 Interp4( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[8] );
|
||||
#define PIXEL22_5 Interp5( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[6], c[8] );
|
||||
#define PIXEL22_C *((COLORTYPE*)(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
|
||||
#endif // #ifdef _HQ3X
|
||||
|
||||
|
||||
|
||||
#ifdef _HQ4X
|
||||
|
||||
#define _MAGNIFICATION 4
|
||||
|
||||
#define PIXEL00_0 *((COLORTYPE*)(pOut)) = c[5];
|
||||
#define PIXEL00_11 Interp1(pOut, c[5], c[4]);
|
||||
#define PIXEL00_12 Interp1(pOut, c[5], c[2]);
|
||||
#define PIXEL00_20 Interp2(pOut, c[5], c[2], c[4]);
|
||||
#define PIXEL00_50 Interp5(pOut, c[2], c[4]);
|
||||
#define PIXEL00_80 Interp8(pOut, c[5], c[1]);
|
||||
#define PIXEL00_81 Interp8(pOut, c[5], c[4]);
|
||||
#define PIXEL00_82 Interp8(pOut, c[5], c[2]);
|
||||
|
||||
#define PIXEL01_0 *((COLORTYPE*)(pOut+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL01_10 Interp1(pOut+SIZE_PIXEL, c[5], c[1]);
|
||||
#define PIXEL01_12 Interp1(pOut+SIZE_PIXEL, c[5], c[2]);
|
||||
#define PIXEL01_14 Interp1(pOut+SIZE_PIXEL, c[2], c[5]);
|
||||
#define PIXEL01_21 Interp2(pOut+SIZE_PIXEL, c[2], c[5], c[4]);
|
||||
#define PIXEL01_31 Interp3(pOut+SIZE_PIXEL, c[5], c[4]);
|
||||
#define PIXEL01_50 Interp5(pOut+SIZE_PIXEL, c[2], c[5]);
|
||||
#define PIXEL01_60 Interp6(pOut+SIZE_PIXEL, c[5], c[2], c[4]);
|
||||
#define PIXEL01_61 Interp6(pOut+SIZE_PIXEL, c[5], c[2], c[1]);
|
||||
#define PIXEL01_82 Interp8(pOut+SIZE_PIXEL, c[5], c[2]);
|
||||
#define PIXEL01_83 Interp8(pOut+SIZE_PIXEL, c[2], c[4]);
|
||||
|
||||
#define PIXEL02_0 *((COLORTYPE*)(pOut+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL02_10 Interp1(pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[3]);
|
||||
#define PIXEL02_11 Interp1(pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2]);
|
||||
#define PIXEL02_13 Interp1(pOut+SIZE_PIXEL+SIZE_PIXEL, c[2], c[5]);
|
||||
#define PIXEL02_21 Interp2(pOut+SIZE_PIXEL+SIZE_PIXEL, c[2], c[5], c[6]);
|
||||
#define PIXEL02_32 Interp3(pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL02_50 Interp5(pOut+SIZE_PIXEL+SIZE_PIXEL, c[2], c[5]);
|
||||
#define PIXEL02_60 Interp6(pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2], c[6]);
|
||||
#define PIXEL02_61 Interp6(pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2], c[3]);
|
||||
#define PIXEL02_81 Interp8(pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2]);
|
||||
#define PIXEL02_83 Interp8(pOut+SIZE_PIXEL+SIZE_PIXEL, c[2], c[6]);
|
||||
|
||||
#define PIXEL03_0 *((COLORTYPE*)(pOut+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL03_11 Interp1(pOut+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2]);
|
||||
#define PIXEL03_12 Interp1(pOut+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL03_20 Interp2(pOut+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2], c[6]);
|
||||
#define PIXEL03_50 Interp5(pOut+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[2], c[6]);
|
||||
#define PIXEL03_80 Interp8(pOut+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[3]);
|
||||
#define PIXEL03_81 Interp8(pOut+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2]);
|
||||
#define PIXEL03_82 Interp8(pOut+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
|
||||
#define PIXEL10_0 *((COLORTYPE*)(pOut+dstPitch)) = c[5];
|
||||
#define PIXEL10_10 Interp1(pOut+dstPitch, c[5], c[1]);
|
||||
#define PIXEL10_11 Interp1(pOut+dstPitch, c[5], c[4]);
|
||||
#define PIXEL10_13 Interp1(pOut+dstPitch, c[4], c[5]);
|
||||
#define PIXEL10_21 Interp2(pOut+dstPitch, c[4], c[5], c[2]);
|
||||
#define PIXEL10_32 Interp3(pOut+dstPitch, c[5], c[2]);
|
||||
#define PIXEL10_50 Interp5(pOut+dstPitch, c[4], c[5]);
|
||||
#define PIXEL10_60 Interp6(pOut+dstPitch, c[5], c[4], c[2]);
|
||||
#define PIXEL10_61 Interp6(pOut+dstPitch, c[5], c[4], c[1]);
|
||||
#define PIXEL10_81 Interp8(pOut+dstPitch, c[5], c[4]);
|
||||
#define PIXEL10_83 Interp8(pOut+dstPitch, c[4], c[2]);
|
||||
|
||||
#define PIXEL11_0 *((COLORTYPE*)(pOut+dstPitch+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL11_30 Interp3(pOut+dstPitch+SIZE_PIXEL, c[5], c[1]);
|
||||
#define PIXEL11_31 Interp3(pOut+dstPitch+SIZE_PIXEL, c[5], c[4]);
|
||||
#define PIXEL11_32 Interp3(pOut+dstPitch+SIZE_PIXEL, c[5], c[2]);
|
||||
#define PIXEL11_70 Interp7(pOut+dstPitch+SIZE_PIXEL, c[5], c[4], c[2]);
|
||||
|
||||
#define PIXEL12_0 *((COLORTYPE*)(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL12_30 Interp3(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[3]);
|
||||
#define PIXEL12_31 Interp3(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2]);
|
||||
#define PIXEL12_32 Interp3(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL12_70 Interp7(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[2]);
|
||||
|
||||
#define PIXEL13_0 *((COLORTYPE*)(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL13_10 Interp1(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[3]);
|
||||
#define PIXEL13_12 Interp1(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL13_14 Interp1(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[6], c[5]);
|
||||
#define PIXEL13_21 Interp2(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[6], c[5], c[2]);
|
||||
#define PIXEL13_31 Interp3(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2]);
|
||||
#define PIXEL13_50 Interp5(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[6], c[5]);
|
||||
#define PIXEL13_60 Interp6(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[2]);
|
||||
#define PIXEL13_61 Interp6(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[3]);
|
||||
#define PIXEL13_82 Interp8(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL13_83 Interp8(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[6], c[2]);
|
||||
|
||||
#define PIXEL20_0 *((COLORTYPE*)(pOut+dstPitch+dstPitch)) = c[5];
|
||||
#define PIXEL20_10 Interp1(pOut+dstPitch+dstPitch, c[5], c[7]);
|
||||
#define PIXEL20_12 Interp1(pOut+dstPitch+dstPitch, c[5], c[4]);
|
||||
#define PIXEL20_14 Interp1(pOut+dstPitch+dstPitch, c[4], c[5]);
|
||||
#define PIXEL20_21 Interp2(pOut+dstPitch+dstPitch, c[4], c[5], c[8]);
|
||||
#define PIXEL20_31 Interp3(pOut+dstPitch+dstPitch, c[5], c[8]);
|
||||
#define PIXEL20_50 Interp5(pOut+dstPitch+dstPitch, c[4], c[5]);
|
||||
#define PIXEL20_60 Interp6(pOut+dstPitch+dstPitch, c[5], c[4], c[8]);
|
||||
#define PIXEL20_61 Interp6(pOut+dstPitch+dstPitch, c[5], c[4], c[7]);
|
||||
#define PIXEL20_82 Interp8(pOut+dstPitch+dstPitch, c[5], c[4]);
|
||||
#define PIXEL20_83 Interp8(pOut+dstPitch+dstPitch, c[4], c[8]);
|
||||
|
||||
#define PIXEL21_0 *((COLORTYPE*)(pOut+dstPitch+dstPitch+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL21_30 Interp3(pOut+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[7]);
|
||||
#define PIXEL21_31 Interp3(pOut+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8]);
|
||||
#define PIXEL21_32 Interp3(pOut+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[4]);
|
||||
#define PIXEL21_70 Interp7(pOut+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[4], c[8]);
|
||||
#define PIXEL22_0 *((COLORTYPE*)(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL22_30 Interp3(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[9]);
|
||||
#define PIXEL22_31 Interp3(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL22_32 Interp3(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8]);
|
||||
#define PIXEL22_70 Interp7(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[8]);
|
||||
|
||||
#define PIXEL23_0 *((COLORTYPE*)(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL23_10 Interp1(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[9]);
|
||||
#define PIXEL23_11 Interp1(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL23_13 Interp1(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[6], c[5]);
|
||||
#define PIXEL23_21 Interp2(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[6], c[5], c[8]);
|
||||
#define PIXEL23_32 Interp3(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8]);
|
||||
#define PIXEL23_50 Interp5(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[6], c[5]);
|
||||
#define PIXEL23_60 Interp6(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[8]);
|
||||
#define PIXEL23_61 Interp6(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[9]);
|
||||
#define PIXEL23_81 Interp8(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL23_83 Interp8(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[6], c[8]);
|
||||
|
||||
#define PIXEL30_0 *((COLORTYPE*)(pOut+dstPitch+dstPitch+dstPitch)) = c[5];
|
||||
#define PIXEL30_11 Interp1(pOut+dstPitch+dstPitch+dstPitch, c[5], c[8]);
|
||||
#define PIXEL30_12 Interp1(pOut+dstPitch+dstPitch+dstPitch, c[5], c[4]);
|
||||
#define PIXEL30_20 Interp2(pOut+dstPitch+dstPitch+dstPitch, c[5], c[8], c[4]);
|
||||
#define PIXEL30_50 Interp5(pOut+dstPitch+dstPitch+dstPitch, c[8], c[4]);
|
||||
#define PIXEL30_80 Interp8(pOut+dstPitch+dstPitch+dstPitch, c[5], c[7]);
|
||||
#define PIXEL30_81 Interp8(pOut+dstPitch+dstPitch+dstPitch, c[5], c[8]);
|
||||
#define PIXEL30_82 Interp8(pOut+dstPitch+dstPitch+dstPitch, c[5], c[4]);
|
||||
|
||||
#define PIXEL31_0 *((COLORTYPE*)(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL31_10 Interp1(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[7]);
|
||||
#define PIXEL31_11 Interp1(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8]);
|
||||
#define PIXEL31_13 Interp1(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[8], c[5]);
|
||||
#define PIXEL31_21 Interp2(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[8], c[5], c[4]);
|
||||
#define PIXEL31_32 Interp3(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[4]);
|
||||
#define PIXEL31_50 Interp5(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[8], c[5]);
|
||||
#define PIXEL31_60 Interp6(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8], c[4]);
|
||||
#define PIXEL31_61 Interp6(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8], c[7]);
|
||||
#define PIXEL31_81 Interp8(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8]);
|
||||
#define PIXEL31_83 Interp8(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL, c[8], c[4]);
|
||||
|
||||
#define PIXEL32_0 *((COLORTYPE*)(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL32_10 Interp1(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[9]);
|
||||
#define PIXEL32_12 Interp1(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8]);
|
||||
#define PIXEL32_14 Interp1(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[8], c[5]);
|
||||
#define PIXEL32_21 Interp2(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[8], c[5], c[6]);
|
||||
#define PIXEL32_31 Interp3(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL32_50 Interp5(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[8], c[5]);
|
||||
#define PIXEL32_60 Interp6(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8], c[6]);
|
||||
#define PIXEL32_61 Interp6(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8], c[9]);
|
||||
#define PIXEL32_82 Interp8(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8]);
|
||||
#define PIXEL32_83 Interp8(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[8], c[6]);
|
||||
|
||||
#define PIXEL33_0 *((COLORTYPE*)(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
#define PIXEL33_11 Interp1(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL33_12 Interp1(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8]);
|
||||
#define PIXEL33_20 Interp2(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8], c[6]);
|
||||
#define PIXEL33_50 Interp5(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[8], c[6]);
|
||||
#define PIXEL33_80 Interp8(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[9]);
|
||||
#define PIXEL33_81 Interp8(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
|
||||
#define PIXEL33_82 Interp8(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8]);
|
||||
|
||||
#endif // #ifdef _HQ4X
|
||||
|
||||
|
||||
|
||||
// function header
|
||||
#ifdef _16BIT
|
||||
#ifdef _HQ3X
|
||||
void hq3x16(
|
||||
#endif
|
||||
#ifdef _HQ4X
|
||||
void hq4x16(
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _32BIT
|
||||
#ifdef _HQ3X
|
||||
void hq3x32(
|
||||
#endif
|
||||
#ifdef _HQ4X
|
||||
void hq4x32(
|
||||
#endif
|
||||
#endif
|
||||
|
||||
unsigned char *pIn, unsigned int srcPitch,
|
||||
unsigned char *,
|
||||
unsigned char *pOut, unsigned int dstPitch,
|
||||
int Xres, int Yres )
|
||||
{
|
||||
unsigned int yuv[10]; // yuv[0] not used
|
||||
// yuv[1-9] allows reusage of calculated YUV values
|
||||
int x, y;
|
||||
unsigned int linePlus, lineMinus;
|
||||
|
||||
COLORTYPE c[10]; // c[0] not used
|
||||
// +----+----+----+
|
||||
// | | | |
|
||||
// | c1 | c2 | c3 |
|
||||
// +----+----+----+
|
||||
// | | | |
|
||||
// | c4 | c5 | c6 |
|
||||
// +----+----+----+
|
||||
// | | | |
|
||||
// | c7 | c8 | c9 |
|
||||
// +----+----+----+
|
||||
|
||||
for (y=0; y<Yres; y++)
|
||||
{
|
||||
if( y == 0 ) {
|
||||
linePlus = srcPitch;
|
||||
lineMinus = 0;
|
||||
} else if( y == ( Yres - 1 ) ) {
|
||||
linePlus = 0;
|
||||
lineMinus = srcPitch;
|
||||
} else {
|
||||
linePlus = srcPitch;
|
||||
lineMinus = srcPitch;
|
||||
}
|
||||
|
||||
for (x=0; x<Xres; x++)
|
||||
{
|
||||
c[2] = *((COLORTYPE*)(pIn - lineMinus));
|
||||
c[5] = *((COLORTYPE*)(pIn ));
|
||||
c[8] = *((COLORTYPE*)(pIn + linePlus ));
|
||||
|
||||
if (x>0)
|
||||
{
|
||||
// upper border possible:
|
||||
c[1] = *((COLORTYPE*)(pIn - lineMinus - SIZE_PIXEL));
|
||||
|
||||
c[4] = *((COLORTYPE*)(pIn - SIZE_PIXEL));
|
||||
|
||||
// lower border possible:
|
||||
c[7] = *((COLORTYPE*)(pIn + linePlus - SIZE_PIXEL));
|
||||
}
|
||||
else
|
||||
{ // left border
|
||||
c[1] = c[2];
|
||||
c[4] = c[5];
|
||||
c[7] = c[8];
|
||||
}
|
||||
|
||||
if (x<Xres-1)
|
||||
{
|
||||
// upper border possible:
|
||||
c[3] = *((COLORTYPE*)(pIn - lineMinus + SIZE_PIXEL));
|
||||
|
||||
c[6] = *((COLORTYPE*)(pIn + SIZE_PIXEL));
|
||||
|
||||
// lower border possible:
|
||||
c[9] = *((COLORTYPE*)(pIn + linePlus + SIZE_PIXEL));
|
||||
}
|
||||
else
|
||||
{ // right border
|
||||
c[3] = c[2];
|
||||
c[6] = c[5];
|
||||
c[9] = c[8];
|
||||
}
|
||||
|
||||
unsigned int pattern = 0;
|
||||
unsigned int flag = 1;
|
||||
|
||||
yuv[5] = RGBtoYUV( c[5] );
|
||||
|
||||
for( unsigned char k = 1; k <= 9; k++)
|
||||
{
|
||||
if( k == 5 ) continue;
|
||||
|
||||
if( c[k] != c[5] )
|
||||
{
|
||||
// pre-calculating the YUV-values for every pixel does
|
||||
// not speed up the process
|
||||
yuv[k] = RGBtoYUV( c[k] );
|
||||
|
||||
if( ( abs_32((yuv[5] & 0x00FF0000) - (yuv[k] & 0x00FF0000)) > 0x00300000 ) ||
|
||||
( abs_32((yuv[5] & 0x0000FF00) - (yuv[k] & 0x0000FF00)) > 0x00000700 ) ||
|
||||
( abs_32((yuv[5] & 0x000000FF) - (yuv[k] & 0x000000FF)) > 0x00000006 )
|
||||
) {
|
||||
pattern |= flag;
|
||||
}
|
||||
}
|
||||
flag <<= 1;
|
||||
}
|
||||
|
||||
#ifdef _HQ3X
|
||||
#include "hq3x_pattern.h"
|
||||
#endif
|
||||
|
||||
#ifdef _HQ4X
|
||||
#include "hq4x_pattern.h"
|
||||
#endif
|
||||
|
||||
pIn += SIZE_PIXEL;
|
||||
pOut += _MAGNIFICATION * SIZE_PIXEL;
|
||||
}
|
||||
pIn += srcPitch - ( Xres * SIZE_PIXEL );
|
||||
pOut += dstPitch - ( _MAGNIFICATION * Xres * SIZE_PIXEL );
|
||||
pOut += ( _MAGNIFICATION - 1 ) * dstPitch;
|
||||
}
|
||||
}
|
||||
|
||||
#undef SIZE_PIXEL
|
||||
#undef COLORTYPE
|
||||
#undef _MAGNIFICATION
|
||||
#undef RGBtoYUV
|
||||
#undef Interp1
|
||||
#undef Interp2
|
||||
#undef Interp3
|
||||
#undef Interp4
|
||||
#undef Interp5
|
||||
#undef Interp6
|
||||
#undef Interp7
|
||||
#undef Interp8
|
|
@ -1,28 +1,51 @@
|
|||
/*
|
||||
VisualBoyAdvance - a Game Boy & Game Boy Advance emulator
|
||||
|
||||
Copyright (C) 1999 - 2003 Forgotten
|
||||
Copyright (C) 2003 - 2004 Forgotten and the VBA development team
|
||||
Copyright (C) 2005 - 2006 VBA development team
|
||||
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define _HQ3X
|
||||
#define _16BIT
|
||||
#include "hqxx.h"
|
||||
#undef _16BIT
|
||||
#undef _HQ3X
|
||||
/*
|
||||
VisualBoyAdvance - a Game Boy & Game Boy Advance emulator
|
||||
|
||||
Copyright (C) 2008 VBA-M development team
|
||||
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
hq filter by Maxim Stepin ( http://hiend3d.com )
|
||||
*/
|
||||
|
||||
|
||||
#include "hq_shared.h"
|
||||
|
||||
|
||||
#define _16BIT
|
||||
#define _HQ3X
|
||||
// hq3x, 16bit
|
||||
#include "hq_base.h"
|
||||
#undef _HQ3X
|
||||
|
||||
#define _HQ4X
|
||||
// hq4x, 16bit
|
||||
#include "hq_base.h"
|
||||
#undef _HQ4X
|
||||
#undef _16BIT
|
||||
|
||||
|
||||
#define _32BIT
|
||||
#define _HQ3X
|
||||
// hq3x, 32bit
|
||||
#include "hq_base.h"
|
||||
#undef _HQ3X
|
||||
|
||||
#define _HQ4X
|
||||
// hq4x, 32bit
|
||||
#include "hq_base.h"
|
||||
#undef _HQ4X
|
||||
#undef _32BIT
|
|
@ -0,0 +1,392 @@
|
|||
/*
|
||||
VisualBoyAdvance - a Game Boy & Game Boy Advance emulator
|
||||
|
||||
Copyright (C) 2008 VBA-M development team
|
||||
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
hq filter by Maxim Stepin ( http://hiend3d.com )
|
||||
*/
|
||||
|
||||
|
||||
// we only need the 32bit version because our YUV format has 32bits
|
||||
#define abs_32( value ) ( value & 0x7FFFFFFF )
|
||||
|
||||
|
||||
inline bool Diff( unsigned int YUV1, unsigned int YUV2 )
|
||||
{
|
||||
if( YUV1 == YUV2 ) return false; // Save some processing power
|
||||
|
||||
return
|
||||
( abs_32((YUV1 & 0x00FF0000) - (YUV2 & 0x00FF0000)) > 0x00300000 ) ||
|
||||
( abs_32((YUV1 & 0x0000FF00) - (YUV2 & 0x0000FF00)) > 0x00000700 ) ||
|
||||
( abs_32((YUV1 & 0x000000FF) - (YUV2 & 0x000000FF)) > 0x00000006 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ===============
|
||||
// 32bit routines:
|
||||
// ===============
|
||||
|
||||
// ( c1*3 + c2 ) / 4
|
||||
// hq3x, hq4x
|
||||
#define Interp1_32( pc, c1, c2 ) \
|
||||
( \
|
||||
*( (unsigned int *)(pc) ) = \
|
||||
( \
|
||||
( ( \
|
||||
( ( (c1) & 0x00FF00 ) * 3 ) + \
|
||||
( (c2) & 0x00FF00 ) \
|
||||
) & 0x0003FC00 ) \
|
||||
+ \
|
||||
( ( \
|
||||
( ( (c1) & 0xFF00FF ) * 3 ) + \
|
||||
( (c2) & 0xFF00FF ) \
|
||||
) & 0x03FC03FC ) \
|
||||
) >> 2 \
|
||||
)
|
||||
|
||||
|
||||
// ( c1*2 + c2 + c3 ) / 4
|
||||
// hq3x, hq4x
|
||||
#define Interp2_32( pc, c1, c2, c3 ) \
|
||||
( \
|
||||
*( (unsigned int *)(pc) ) = \
|
||||
( \
|
||||
( ( \
|
||||
( ( (c1) & 0x00FF00 ) * 2 ) + \
|
||||
( (c2) & 0x00FF00 ) + \
|
||||
( (c3) & 0x00FF00 ) \
|
||||
) & 0x0003FC00 ) \
|
||||
+ \
|
||||
( ( \
|
||||
( ( (c1) & 0xFF00FF ) * 2 ) + \
|
||||
( (c2) & 0xFF00FF ) + \
|
||||
( (c3) & 0xFF00FF ) \
|
||||
) & 0x03FC03FC ) \
|
||||
) >> 2 \
|
||||
)
|
||||
|
||||
|
||||
// ( c1*7 + c2 ) / 8
|
||||
// hq3x, hq4x
|
||||
#define Interp3_32( pc, c1, c2 ) \
|
||||
( \
|
||||
*( (unsigned int *)(pc) ) = \
|
||||
( \
|
||||
( ( \
|
||||
( ( (c1) & 0x00FF00 ) * 7 ) + \
|
||||
( (c2) & 0x00FF00 ) \
|
||||
) & 0x0007F800 ) \
|
||||
+ \
|
||||
( ( \
|
||||
( ( (c1) & 0xFF00FF ) * 7 ) + \
|
||||
( (c2) & 0xFF00FF ) \
|
||||
) & 0x07F807F8 ) \
|
||||
) >> 3 \
|
||||
)
|
||||
|
||||
|
||||
// ( c1*2 + (c2+c3)*7 ) / 16
|
||||
// hq3x, not used by hq4x
|
||||
#define Interp4_32( pc, c1, c2, c3 ) \
|
||||
( \
|
||||
*( (unsigned int *)(pc) ) = \
|
||||
( \
|
||||
( ( ( ( (c1) & 0x00FF00 ) * 2 ) + ( ( ( (c2) & 0x00FF00 ) + ( (c3) & 0x00FF00 ) ) * 7 ) ) & 0x000FF000 ) + \
|
||||
( ( ( ( (c1) & 0xFF00FF ) * 2 ) + ( ( ( (c2) & 0xFF00FF ) + ( (c3) & 0xFF00FF ) ) * 7 ) ) & 0x0FF00FF0 ) \
|
||||
) >> 4 \
|
||||
)
|
||||
|
||||
|
||||
// ( c1 + c2 ) / 2
|
||||
// hq3x, hq4x
|
||||
#define Interp5_32( pc, c1, c2 ) \
|
||||
( \
|
||||
*( (unsigned int *)(pc) ) = \
|
||||
( \
|
||||
( ( \
|
||||
( (c1) & 0x00FF00 ) + \
|
||||
( (c2) & 0x00FF00 ) \
|
||||
) & 0x0001FE00 ) \
|
||||
+ \
|
||||
( ( \
|
||||
( (c1) & 0xFF00FF ) + \
|
||||
( (c2) & 0xFF00FF ) \
|
||||
) & 0x01FE01FE ) \
|
||||
) >> 1 \
|
||||
)
|
||||
|
||||
|
||||
// ( c1*5 + c2*2 + c3 ) / 8
|
||||
// hq4x
|
||||
#define Interp6_32( pc, c1, c2, c3 ) \
|
||||
( \
|
||||
*( (unsigned int *)(pc) ) = \
|
||||
( \
|
||||
( ( \
|
||||
( ( (c1) & 0x00FF00 ) * 5 ) + \
|
||||
( ( (c2) & 0x00FF00 ) * 2 ) + \
|
||||
( (c3) & 0x00FF00 ) \
|
||||
) & 0x0007F800 ) \
|
||||
+ \
|
||||
( ( \
|
||||
( ( (c1) & 0xFF00FF ) * 5 ) + \
|
||||
( ( (c2) & 0xFF00FF ) * 2 ) + \
|
||||
( (c3) & 0xFF00FF ) \
|
||||
) & 0x07F807F8 ) \
|
||||
) >> 3 \
|
||||
)
|
||||
|
||||
|
||||
// ( c1*6 + c2 + c3 ) / 8
|
||||
// hq4x
|
||||
#define Interp7_32( pc, c1, c2, c3 ) \
|
||||
( \
|
||||
*( (unsigned int *)(pc) ) = \
|
||||
( \
|
||||
( ( \
|
||||
( ( (c1) & 0x00FF00 ) * 6 ) + \
|
||||
( (c2) & 0x00FF00 ) + \
|
||||
( (c3) & 0x00FF00 ) \
|
||||
) & 0x0007F800 ) \
|
||||
+ \
|
||||
( ( \
|
||||
( ( (c1) & 0xFF00FF ) * 6 ) + \
|
||||
( (c2) & 0xFF00FF ) + \
|
||||
( (c3) & 0xFF00FF ) \
|
||||
) & 0x07F807F8 ) \
|
||||
) >> 3 \
|
||||
)
|
||||
|
||||
|
||||
// ( c1*5 + c2*3 ) / 8
|
||||
// hq4x
|
||||
#define Interp8_32( pc, c1, c2 ) \
|
||||
( \
|
||||
*( (unsigned int *)(pc) ) = \
|
||||
( \
|
||||
( ( \
|
||||
( ( (c1) & 0x00FF00 ) * 5 ) + \
|
||||
( ( (c2) & 0x00FF00 ) * 3 ) \
|
||||
) & 0x0007F800 ) \
|
||||
+ \
|
||||
( ( \
|
||||
( ( (c1) & 0xFF00FF ) * 5 ) + \
|
||||
( ( (c2) & 0xFF00FF ) * 3 ) \
|
||||
) & 0x07F807F8 ) \
|
||||
) >> 3 \
|
||||
)
|
||||
|
||||
|
||||
// 32 bit input color
|
||||
// 0x00YYUUVV return value
|
||||
inline unsigned int RGBtoYUV_32( unsigned int c )
|
||||
{
|
||||
// Division through 3 slows down the emulation about 10% !!!
|
||||
|
||||
register unsigned char r, g, b;
|
||||
r = ( c & 0x000000FF );
|
||||
g = ( c & 0x0000FF00 ) >> 8;
|
||||
b = ( c & 0x00FF0000 ) >> 16;
|
||||
return ( (r + g + b) << 14 ) +
|
||||
( ( r - b + 512 ) << 4 ) +
|
||||
( ( 2*g - r - b ) >> 3 ) + 128;
|
||||
|
||||
// unoptimized:
|
||||
//unsigned char r, g, b, Y, u, v;
|
||||
//r = (c & 0x000000FF);
|
||||
//g = (c & 0x0000FF00) >> 8;
|
||||
//b = (c & 0x00FF0000) >> 16;
|
||||
//Y = (r + g + b) >> 2;
|
||||
//u = 128 + ((r - b) >> 2);
|
||||
//v = 128 + ((-r + 2*g -b)>>3);
|
||||
//return (Y<<16) + (u<<8) + v;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ===============
|
||||
// 16bit routines:
|
||||
// ===============
|
||||
|
||||
// ( c1*3 + c2 ) / 4
|
||||
// hq3x, hq4x
|
||||
#define Interp1_16( pc, c1, c2 ) \
|
||||
( \
|
||||
*( (unsigned short *)(pc) ) = \
|
||||
( \
|
||||
( ( \
|
||||
( ( (c1) & 0x07E0 ) * 3 ) + \
|
||||
( (c2) & 0x07E0 ) \
|
||||
) & 0x00001F80 ) \
|
||||
+ \
|
||||
( ( \
|
||||
( ( (c1) & 0xF81F ) * 3 ) + \
|
||||
( (c2) & 0xF81F ) \
|
||||
) & 0x0003E07C ) \
|
||||
) >> 2 \
|
||||
)
|
||||
|
||||
|
||||
// ( c1*2 + c2 + c3 ) / 4
|
||||
// hq3x, hq4x
|
||||
#define Interp2_16( pc, c1, c2, c3 ) \
|
||||
( \
|
||||
*( (unsigned short *)(pc) ) = \
|
||||
( \
|
||||
( ( \
|
||||
( ( (c1) & 0x07E0 ) * 2 ) + \
|
||||
( (c2) & 0x07E0 ) + \
|
||||
( (c3) & 0x07E0 ) \
|
||||
) & 0x00001F80 ) \
|
||||
+ \
|
||||
( ( \
|
||||
( ( (c1) & 0xF81F ) * 2 ) + \
|
||||
( (c2) & 0xF81F ) + \
|
||||
( (c3) & 0xF81F ) \
|
||||
) & 0x0003E07C ) \
|
||||
) >> 2 \
|
||||
)
|
||||
|
||||
|
||||
// ( c1*7 + c2 ) / 8
|
||||
// hq3x, hq4x
|
||||
#define Interp3_16( pc, c1, c2 ) \
|
||||
( \
|
||||
*( (unsigned short *)(pc) ) = \
|
||||
( \
|
||||
( ( \
|
||||
( ( (c1) & 0x07E0 ) * 7 ) + \
|
||||
( (c2) & 0x07E0 ) \
|
||||
) & 0x00003F00 ) \
|
||||
+ \
|
||||
( ( \
|
||||
( ( (c1) & 0xF81F ) * 7 ) + \
|
||||
( (c2) & 0xF81F ) \
|
||||
) & 0x0007C0F8 ) \
|
||||
) >> 3 \
|
||||
)
|
||||
|
||||
|
||||
// ( c1*2 + (c2+c3)*7 ) / 16
|
||||
// hq3x, not used by hq4x
|
||||
#define Interp4_16( pc, c1, c2, c3 ) \
|
||||
( \
|
||||
*( (unsigned short *)(pc) ) = \
|
||||
( \
|
||||
( ( ( ( (c1) & 0x07E0 ) * 2 ) + ( ( ( (c2) & 0x07E0 ) + ( (c3) & 0x07E0 ) ) * 7 ) ) & 0x00007E00 ) + \
|
||||
( ( ( ( (c1) & 0xF81F ) * 2 ) + ( ( ( (c2) & 0xF81F ) + ( (c3) & 0xF81F ) ) * 7 ) ) & 0x000F81F0 ) \
|
||||
) >> 4 \
|
||||
)
|
||||
|
||||
|
||||
// ( c1 + c2 ) / 2
|
||||
// hq3x, hq4x
|
||||
#define Interp5_16( pc, c1, c2 ) \
|
||||
( \
|
||||
*( (unsigned short *)(pc) ) = \
|
||||
( \
|
||||
( ( \
|
||||
( (c1) & 0x07E0 ) + \
|
||||
( (c2) & 0x07E0 ) \
|
||||
) & 0x00000FC0 ) \
|
||||
+ \
|
||||
( ( \
|
||||
( (c1) & 0xF81F ) + \
|
||||
( (c2) & 0xF81F ) \
|
||||
) & 0x0001F03E ) \
|
||||
) >> 1 \
|
||||
)
|
||||
|
||||
|
||||
// ( c1*5 + c2*2 + c3 ) / 8
|
||||
// hq4x
|
||||
#define Interp6_16( pc, c1, c2, c3 ) \
|
||||
( \
|
||||
*( (unsigned short *)(pc) ) = \
|
||||
( \
|
||||
( ( \
|
||||
( ( (c1) & 0x07E0 ) * 5 ) + \
|
||||
( ( (c2) & 0x07E0 ) * 2 ) + \
|
||||
( (c3) & 0x07E0 ) \
|
||||
) & 0x00003F00 ) \
|
||||
+ \
|
||||
( ( \
|
||||
( ( (c1) & 0xF81F ) * 5 ) + \
|
||||
( ( (c2) & 0xF81F ) * 2 ) + \
|
||||
( (c3) & 0xF81F ) \
|
||||
) & 0x0007C0F8 ) \
|
||||
) >> 3 \
|
||||
)
|
||||
|
||||
|
||||
// ( c1*6 + c2 + c3 ) / 8
|
||||
// hq4x
|
||||
#define Interp7_16( pc, c1, c2, c3 ) \
|
||||
( \
|
||||
*( (unsigned short *)(pc) ) = \
|
||||
( \
|
||||
( ( \
|
||||
( ( (c1) & 0x07E0 ) * 6 ) + \
|
||||
( (c2) & 0x07E0 ) + \
|
||||
( (c3) & 0x07E0 ) \
|
||||
) & 0x00003F00 ) \
|
||||
+ \
|
||||
( ( \
|
||||
( ( (c1) & 0xF81F ) * 6 ) + \
|
||||
( (c2) & 0xF81F ) + \
|
||||
( (c3) & 0xF81F ) \
|
||||
) & 0x0007C0F8 ) \
|
||||
) >> 3 \
|
||||
)
|
||||
|
||||
|
||||
// ( c1*5 + c2*3 ) / 8
|
||||
// hq4x
|
||||
#define Interp8_16( pc, c1, c2 ) \
|
||||
( \
|
||||
*( (unsigned short *)(pc) ) = \
|
||||
( \
|
||||
( ( \
|
||||
( ( (c1) & 0x07E0 ) * 5 ) + \
|
||||
( ( (c2) & 0x07E0 ) * 3 ) \
|
||||
) & 0x00003F00 ) \
|
||||
+ \
|
||||
( ( \
|
||||
( ( (c1) & 0xF81F ) * 5 ) + \
|
||||
( ( (c2) & 0xF81F ) * 3 ) \
|
||||
) & 0x0007C0F8 ) \
|
||||
) >> 3 \
|
||||
)
|
||||
|
||||
|
||||
// 16 bit input color
|
||||
// 0x00YYUUVV return value
|
||||
inline unsigned int RGBtoYUV_16( unsigned short c )
|
||||
{
|
||||
// Division through 3 slows down the emulation about 10% !!!
|
||||
|
||||
register unsigned char r, g, b;
|
||||
r = ( c & 0xF800 ) >> 8;
|
||||
g = ( c & 0x07E0 ) >> 3;
|
||||
b = ( c & 0x001F ) << 3;
|
||||
|
||||
return ( (r + g + b) << 14 ) +
|
||||
( ( r - b + 512 ) << 4 ) +
|
||||
( ( 2*g - r - b ) >> 3 ) + 128;
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
VisualBoyAdvance - a Game Boy & Game Boy Advance emulator
|
||||
|
||||
Copyright (C) 1999 - 2003 Forgotten
|
||||
Copyright (C) 2003 - 2004 Forgotten and the VBA development team
|
||||
Copyright (C) 2005 - 2006 VBA development team
|
||||
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define _HQ3X
|
||||
#define _32BIT
|
||||
#include "hqxx.h"
|
||||
#undef _32BIT
|
||||
#undef _HQ3X
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
VisualBoyAdvance - a Game Boy & Game Boy Advance emulator
|
||||
|
||||
Copyright (C) 1999 - 2003 Forgotten
|
||||
Copyright (C) 2003 - 2004 Forgotten and the VBA development team
|
||||
Copyright (C) 2005 - 2006 VBA development team
|
||||
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define _HQ4X
|
||||
#define _16BIT
|
||||
#include "hqxx.h"
|
||||
#undef _16BIT
|
||||
#undef _HQ4X
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
VisualBoyAdvance - a Game Boy & Game Boy Advance emulator
|
||||
|
||||
Copyright (C) 1999 - 2003 Forgotten
|
||||
Copyright (C) 2003 - 2004 Forgotten and the VBA development team
|
||||
Copyright (C) 2005 - 2006 VBA development team
|
||||
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define _HQ4X
|
||||
#define _32BIT
|
||||
#include "hqxx.h"
|
||||
#undef _32BIT
|
||||
#undef _HQ4X
|
|
@ -1,101 +0,0 @@
|
|||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2005 Forgotten and the VBA development team
|
||||
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2, or(at your option)
|
||||
// any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software Foundation,
|
||||
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include "hq_shared32.h"
|
||||
#define __STDC_CONSTANT_MACROS
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
const uint64_t reg_blank = UINT64_C(0x0000000000000000);
|
||||
const uint64_t const7 = UINT64_C(0x0000000700070007);
|
||||
const uint64_t treshold = UINT64_C(0x0000000000300706);
|
||||
|
||||
void Interp1(unsigned char * pc, unsigned int c1, unsigned int c2)
|
||||
{
|
||||
*((int*)pc) = (c1*3+c2)/4;
|
||||
}
|
||||
|
||||
void Interp2(unsigned char * pc, unsigned int c1, unsigned int c2, unsigned int c3)
|
||||
{
|
||||
*((int*)pc) = (c1*2+c2+c3)/4;
|
||||
}
|
||||
|
||||
void Interp3(unsigned char * pc, unsigned int c1, unsigned int c2)
|
||||
{
|
||||
*((int*)pc) = (c1*7+c2)/8;
|
||||
*((int*)pc) = ((((c1 & 0x00FF00)*7 + (c2 & 0x00FF00) ) & 0x0007F800) +
|
||||
(((c1 & 0xFF00FF)*7 + (c2 & 0xFF00FF) ) & 0x07F807F8)) >> 3;
|
||||
}
|
||||
|
||||
void Interp4(unsigned char * pc, unsigned int c1, unsigned int c2, unsigned int c3)
|
||||
{
|
||||
*((int*)pc) = (c1*2+(c2+c3)*7)/16;
|
||||
*((int*)pc) = ((((c1 & 0x00FF00)*2 + ((c2 & 0x00FF00) + (c3 & 0x00FF00))*7 ) & 0x000FF000) +
|
||||
(((c1 & 0xFF00FF)*2 + ((c2 & 0xFF00FF) + (c3 & 0xFF00FF))*7 ) & 0x0FF00FF0)) >> 4;
|
||||
}
|
||||
|
||||
void Interp5(unsigned char * pc, unsigned int c1, unsigned int c2)
|
||||
{
|
||||
*((int*)pc) = (c1+c2)/2;
|
||||
}
|
||||
|
||||
void Interp6(unsigned char * pc, unsigned int c1, unsigned int c2, unsigned int c3)
|
||||
{
|
||||
*((int*)pc) = (c1*5+c2*2+c3)/8;
|
||||
}
|
||||
|
||||
void Interp7(unsigned char * pc, unsigned int c1, unsigned int c2, unsigned int c3)
|
||||
{
|
||||
*((int*)pc) = (c1*6+c2+c3)/8;
|
||||
}
|
||||
|
||||
void Interp8(unsigned char * pc, unsigned int c1, unsigned int c2)
|
||||
{
|
||||
*((int*)pc) = (c1*5+c2*3)/8;
|
||||
}
|
||||
|
||||
|
||||
bool Diff(unsigned int c1, unsigned int c2)
|
||||
{
|
||||
unsigned int
|
||||
YUV1 = RGBtoYUV(c1),
|
||||
YUV2 = RGBtoYUV(c2);
|
||||
|
||||
if (YUV1 == YUV2) return false; // Save some processing power
|
||||
|
||||
return
|
||||
( abs32((YUV1 & Ymask) - (YUV2 & Ymask)) > trY ) ||
|
||||
( abs32((YUV1 & Umask) - (YUV2 & Umask)) > trU ) ||
|
||||
( abs32((YUV1 & Vmask) - (YUV2 & Vmask)) > trV );
|
||||
}
|
||||
|
||||
|
||||
unsigned int RGBtoYUV(unsigned int c)
|
||||
{
|
||||
// Division through 3 slows down the emulation about 10% !!!
|
||||
unsigned char r, g, b, Y, u, v;
|
||||
r = (c & 0x000000FF);
|
||||
g = (c & 0x0000FF00) >> 8;
|
||||
b = (c & 0x00FF0000) >> 16;
|
||||
Y = (r + g + b) >> 2;
|
||||
u = 128 + ((r - b) >> 2);
|
||||
v = 128 + ((-r + 2*g -b)>>3);
|
||||
return (Y<<16) + (u<<8) + v;
|
||||
}
|
|
@ -1,90 +0,0 @@
|
|||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2005 Forgotten and the VBA development team
|
||||
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2, or(at your option)
|
||||
// any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software Foundation,
|
||||
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#define SIZE_PIXEL 4 // 32bit = 4 bytes
|
||||
|
||||
#define abs32(value) (value & 0x7FFFFFFF)
|
||||
|
||||
#define PIXEL00_1M Interp1( pOut, c[5], c[1] );
|
||||
#define PIXEL00_1U Interp1( pOut, c[5], c[2] );
|
||||
#define PIXEL00_1L Interp1( pOut, c[5], c[4] );
|
||||
#define PIXEL00_2 Interp2( pOut, c[5], c[4], c[2] );
|
||||
#define PIXEL00_4 Interp4( pOut, c[5], c[4], c[2] );
|
||||
#define PIXEL00_5 Interp5( pOut, c[4], c[2] );
|
||||
#define PIXEL00_C *((unsigned int*)(pOut)) = c[5];
|
||||
|
||||
#define PIXEL01_1 Interp1( pOut+SIZE_PIXEL, c[5], c[2] );
|
||||
#define PIXEL01_3 Interp3( pOut+SIZE_PIXEL, c[5], c[2] );
|
||||
#define PIXEL01_6 Interp1( pOut+SIZE_PIXEL, c[2], c[5] );
|
||||
#define PIXEL01_C *((unsigned int*)(pOut+4)) = c[5];
|
||||
|
||||
#define PIXEL02_1M Interp1( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[3] );
|
||||
#define PIXEL02_1U Interp1( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2] );
|
||||
#define PIXEL02_1R Interp1( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] );
|
||||
#define PIXEL02_2 Interp2( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2], c[6] );
|
||||
#define PIXEL02_4 Interp4( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2], c[6] );
|
||||
#define PIXEL02_5 Interp5( pOut+SIZE_PIXEL+SIZE_PIXEL, c[2], c[6] );
|
||||
#define PIXEL02_C *((unsigned int*)(pOut+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
|
||||
#define PIXEL10_1 Interp1( pOut+dstPitch, c[5], c[4] );
|
||||
#define PIXEL10_3 Interp3( pOut+dstPitch, c[5], c[4] );
|
||||
#define PIXEL10_6 Interp1( pOut+dstPitch, c[4], c[5] );
|
||||
#define PIXEL10_C *((unsigned int*)(pOut+dstPitch)) = c[5];
|
||||
|
||||
#define PIXEL11 *((unsigned int*)(pOut+dstPitch+SIZE_PIXEL)) = c[5];
|
||||
|
||||
#define PIXEL12_1 Interp1( pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] );
|
||||
#define PIXEL12_3 Interp3( pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] );
|
||||
#define PIXEL12_6 Interp1( pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[6], c[5] );
|
||||
#define PIXEL12_C *((unsigned int*)(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
|
||||
#define PIXEL20_1M Interp1( pOut+dstPitch+dstPitch, c[5], c[7] );
|
||||
#define PIXEL20_1D Interp1( pOut+dstPitch+dstPitch, c[5], c[8] );
|
||||
#define PIXEL20_1L Interp1( pOut+dstPitch+dstPitch, c[5], c[4] );
|
||||
#define PIXEL20_2 Interp2( pOut+dstPitch+dstPitch, c[5], c[8], c[4] );
|
||||
#define PIXEL20_4 Interp4( pOut+dstPitch+dstPitch, c[5], c[8], c[4] );
|
||||
#define PIXEL20_5 Interp5( pOut+dstPitch+dstPitch, c[8], c[4] );
|
||||
#define PIXEL20_C *((unsigned int*)(pOut+dstPitch+dstPitch)) = c[5];
|
||||
|
||||
#define PIXEL21_1 Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8] );
|
||||
#define PIXEL21_3 Interp3( pOut+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8] );
|
||||
#define PIXEL21_6 Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL, c[8], c[5] );
|
||||
#define PIXEL21_C *((unsigned int*)(pOut+dstPitch+dstPitch+SIZE_PIXEL)) = c[5];
|
||||
|
||||
#define PIXEL22_1M Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[9] );
|
||||
#define PIXEL22_1D Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8] );
|
||||
#define PIXEL22_1R Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] );
|
||||
#define PIXEL22_2 Interp2( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[8] );
|
||||
#define PIXEL22_4 Interp4( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[8] );
|
||||
#define PIXEL22_5 Interp5( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[6], c[8] );
|
||||
#define PIXEL22_C *((unsigned int*)(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
|
||||
|
||||
const int Ymask = 0x00FF0000;
|
||||
const int Umask = 0x0000FF00;
|
||||
const int Vmask = 0x000000FF;
|
||||
const int trY = 0x00300000;
|
||||
const int trU = 0x00000700;
|
||||
const int trV = 0x00000006;
|
||||
|
||||
void Interp1(unsigned char * pc, unsigned int c1, unsigned int c2);
|
||||
void Interp2(unsigned char * pc, unsigned int c1, unsigned int c2, unsigned int c3);
|
||||
void Interp3(unsigned char * pc, unsigned int c1, unsigned int c2);
|
||||
void Interp4(unsigned char * pc, unsigned int c1, unsigned int c2, unsigned int c3);
|
||||
void Interp5(unsigned char * pc, unsigned int c1, unsigned int c2);
|
||||
bool Diff(unsigned int c1, unsigned int c2);
|
||||
unsigned int RGBtoYUV(unsigned int c);
|
|
@ -86,18 +86,10 @@ extern void Simple3x16(u8*,u32,u8*,u8*,u32,int,int);
|
|||
extern void Simple3x32(u8*,u32,u8*,u8*,u32,int,int);
|
||||
extern void Simple4x16(u8*,u32,u8*,u8*,u32,int,int);
|
||||
extern void Simple4x32(u8*,u32,u8*,u8*,u32,int,int);
|
||||
|
||||
extern void hq3x16(u8*,u32,u8*,u8*,u32,int,int);
|
||||
extern void hq4x16(u8*,u32,u8*,u8*,u32,int,int);
|
||||
#ifdef MMX
|
||||
extern void hq3x32(u8*,u32,u8*,u8*,u32,int,int);
|
||||
extern void hq4x32(u8*,u32,u8*,u8*,u32,int,int);
|
||||
#else
|
||||
extern void hq3x32_32(u8*,u32,u8*,u8*,u32,int,int);
|
||||
extern void hq4x32_32(u8*,u32,u8*,u8*,u32,int,int);
|
||||
#define hq3x32 hq3x32_32
|
||||
#define hq4x32 hq4x32_32
|
||||
#endif
|
||||
|
||||
extern void SmartIB(u8*,u32,int,int);
|
||||
extern void SmartIB32(u8*,u32,int,int);
|
||||
|
@ -693,6 +685,8 @@ void VBA::updateFilter()
|
|||
// HQ3X asm wants 16 bit input. When we switch
|
||||
// away from 16 bits we need to restore the driver values
|
||||
|
||||
// This hack is also necessary for Kega Fusion filter plugins
|
||||
|
||||
if ( b16to32Video )
|
||||
{
|
||||
b16to32Video = false;
|
||||
|
@ -881,12 +875,16 @@ void VBA::updateFilter()
|
|||
case FILTER_HQ3X:
|
||||
filterFunction = hq3x32;
|
||||
filterMagnification = 3;
|
||||
#ifndef NO_ASM
|
||||
b16to32Video=true;
|
||||
#endif
|
||||
break;
|
||||
case FILTER_HQ4X:
|
||||
filterFunction = hq4x32;
|
||||
filterMagnification = 4;
|
||||
#ifndef NO_ASM
|
||||
b16to32Video=true;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue