diff --git a/.hgignore b/.hgignore
index 636b7ab19..d4c66b856 100644
--- a/.hgignore
+++ b/.hgignore
@@ -70,14 +70,19 @@ test/controllermap
test/loopwave
test/loopwavequeue
test/testatomic
+test/testaudiocapture
test/testaudiohotplug
test/testaudioinfo
test/testautomation
+test/testbounds
+test/testcustomcursor
+test/testdisplayinfo
test/testdraw2
test/testdrawchessboard
test/testdropfile
test/testerror
test/testfile
+test/testfilesystem
test/testgamecontroller
test/testgesture
test/testgl2
@@ -99,7 +104,7 @@ test/testnative
test/testoverlay2
test/testplatform
test/testpower
-test/testfilesystem
+test/testqsort
test/testrelative
test/testrendercopyex
test/testrendertarget
@@ -117,11 +122,8 @@ test/testtimer
test/testver
test/testviewport
test/testwm2
-test/testbounds
+test/testyuv
test/torturethread
-test/testdisplayinfo
-test/testqsort
-test/testaudiocapture
test/*.exe
test/*.dSYM
buildbot
diff --git a/Android.mk b/Android.mk
index d593d68d2..e70ededaf 100755
--- a/Android.mk
+++ b/Android.mk
@@ -45,6 +45,7 @@ LOCAL_SRC_FILES := \
$(wildcard $(LOCAL_PATH)/src/timer/unix/*.c) \
$(wildcard $(LOCAL_PATH)/src/video/*.c) \
$(wildcard $(LOCAL_PATH)/src/video/android/*.c) \
+ $(wildcard $(LOCAL_PATH)/src/video/yuv2rgb/*.c) \
$(wildcard $(LOCAL_PATH)/src/test/*.c))
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1be707e6b..2329d391b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -357,6 +357,7 @@ file(GLOB SOURCE_FILES
${SDL2_SOURCE_DIR}/src/thread/*.c
${SDL2_SOURCE_DIR}/src/timer/*.c
${SDL2_SOURCE_DIR}/src/video/*.c)
+ ${SDL2_SOURCE_DIR}/src/video/yuv2rgb/*.c)
if(ASSERTIONS STREQUAL "auto")
diff --git a/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj b/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj
index 5564b185c..841a0b966 100644
--- a/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj
+++ b/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj
@@ -117,7 +117,7 @@
-
+
@@ -155,12 +155,14 @@
+
+
@@ -251,11 +253,11 @@
true
true
+
-
@@ -305,6 +307,7 @@
+
true
true
@@ -369,6 +372,7 @@
true
true
+
{89e9b32e-a86a-47c3-a948-d2b1622925ce}
diff --git a/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters b/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters
index f23cd1890..5a2068996 100644
--- a/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters
+++ b/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters
@@ -267,9 +267,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -411,6 +408,15 @@
Source Files
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
@@ -551,9 +557,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -737,5 +740,14 @@
Source Files
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
\ No newline at end of file
diff --git a/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj b/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj
index 183e427f4..2091df090 100644
--- a/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj
+++ b/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj
@@ -235,7 +235,7 @@
-
+
@@ -272,12 +272,14 @@
+
+
@@ -350,11 +352,11 @@
true
true
+
-
@@ -404,6 +406,7 @@
+
true
true
@@ -452,6 +455,7 @@
true
true
+
diff --git a/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj.filters b/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj.filters
index 304c0472d..9aafdce6c 100644
--- a/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj.filters
+++ b/VisualC-WinRT/WinPhone80_VS2012/SDL-WinPhone80.vcxproj.filters
@@ -216,9 +216,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -375,6 +372,15 @@
Source Files
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
@@ -467,9 +473,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -683,5 +686,14 @@
Source Files
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
\ No newline at end of file
diff --git a/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj b/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj
index c291871b2..f7b887cc6 100644
--- a/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj
+++ b/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj
@@ -101,7 +101,7 @@
-
+
@@ -138,12 +138,14 @@
+
+
@@ -216,11 +218,11 @@
true
true
+
-
@@ -271,6 +273,7 @@
+
true
true
@@ -319,6 +322,7 @@
true
true
+
{48fadc0e-964d-4dab-bced-372e0ad19577}
diff --git a/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj.filters b/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj.filters
index badba57cc..4bfbe8302 100644
--- a/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj.filters
+++ b/VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj.filters
@@ -252,9 +252,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -384,6 +381,13 @@
Source Files
+
+ Source Files
+
+
+ Source Files
+
+
@@ -515,9 +519,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -695,5 +696,12 @@
Source Files
+
+ Source Files
+
+
+ Source Files
+
+
\ No newline at end of file
diff --git a/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj b/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj
index f29cd42ac..2e1fc8ba6 100644
--- a/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj
+++ b/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj
@@ -114,11 +114,11 @@
true
true
+
-
@@ -168,6 +168,7 @@
+
true
true
@@ -232,6 +233,7 @@
true
true
+
@@ -323,7 +325,7 @@
-
+
@@ -361,12 +363,14 @@
+
+
{aeaea3a2-d4e6-45b1-8ec6-53d84287fc14}
diff --git a/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj.filters b/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj.filters
index 5c601be17..3e2f4c68e 100644
--- a/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj.filters
+++ b/VisualC-WinRT/WinRT80_VS2012/SDL-WinRT80.vcxproj.filters
@@ -220,9 +220,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -322,6 +319,15 @@
Source Files
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
@@ -444,9 +450,6 @@
Source Files
-
- Source Files
-
Header Files
@@ -723,6 +726,15 @@
Source Files
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
diff --git a/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj b/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj
index ec044385b..d3f34d7a2 100644
--- a/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj
+++ b/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj
@@ -116,7 +116,7 @@
-
+
@@ -152,12 +152,14 @@
+
+
@@ -248,11 +250,11 @@
true
true
+
-
@@ -303,6 +305,7 @@
+
true
true
@@ -367,6 +370,7 @@
true
true
+
{c8df6173-06a1-4f56-a9bc-2002596b30e9}
diff --git a/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj.filters b/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj.filters
index f6b398a97..b499c70a8 100644
--- a/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj.filters
+++ b/VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj.filters
@@ -252,9 +252,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -384,9 +381,6 @@
Source Files
-
-
-
Source Files
@@ -396,6 +390,24 @@
Source Files
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
@@ -527,9 +539,6 @@
Source Files
-
- Source Files
-
Source Files
@@ -695,9 +704,6 @@
Source Files
-
-
-
Source Files
@@ -719,5 +725,23 @@
Source Files
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
\ No newline at end of file
diff --git a/VisualC/SDL.sln b/VisualC/SDL.sln
index 5feee2409..b30d4eb54 100644
--- a/VisualC/SDL.sln
+++ b/VisualC/SDL.sln
@@ -50,6 +50,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "controllermap", "tests\cont
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testvulkan", "tests\testvulkan\testvulkan.vcxproj", "{0D604DFD-AAB6-442C-9368-F91A344146AB}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testyuv", "tests\testyuv\testyuv.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C97635682}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -250,6 +252,14 @@ Global
{0D604DFD-AAB6-442C-9368-F91A344146AB}.Release|Win32.Build.0 = Release|Win32
{0D604DFD-AAB6-442C-9368-F91A344146AB}.Release|x64.ActiveCfg = Release|x64
{0D604DFD-AAB6-442C-9368-F91A344146AB}.Release|x64.Build.0 = Release|x64
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682}.Debug|Win32.ActiveCfg = Debug|Win32
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682}.Debug|Win32.Build.0 = Debug|Win32
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682}.Debug|x64.ActiveCfg = Debug|x64
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682}.Debug|x64.Build.0 = Debug|x64
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682}.Release|Win32.ActiveCfg = Release|Win32
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682}.Release|Win32.Build.0 = Release|Win32
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682}.Release|x64.ActiveCfg = Release|x64
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -276,5 +286,6 @@ Global
{E9558DFE-1961-4DD4-B09B-DD0EEFD5C315} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{55812185-D13C-4022-9C81-32E0F4A08306} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{0D604DFD-AAB6-442C-9368-F91A344146AB} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
EndGlobalSection
EndGlobal
diff --git a/VisualC/SDL/SDL.vcxproj b/VisualC/SDL/SDL.vcxproj
index 24fd72238..a4fb4478d 100644
--- a/VisualC/SDL/SDL.vcxproj
+++ b/VisualC/SDL/SDL.vcxproj
@@ -78,6 +78,7 @@
AllRules.ruleset
+ C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;$(LibraryPath)
@@ -324,7 +325,8 @@
-
+
+
@@ -358,6 +360,7 @@
+
@@ -372,6 +375,7 @@
+
@@ -434,15 +438,16 @@
+
+
-
@@ -494,6 +499,7 @@
+
@@ -507,6 +513,7 @@
+
diff --git a/VisualC/SDL/SDL.vcxproj.filters b/VisualC/SDL/SDL.vcxproj.filters
index fb00991bf..dcfd74a70 100644
--- a/VisualC/SDL/SDL.vcxproj.filters
+++ b/VisualC/SDL/SDL.vcxproj.filters
@@ -262,7 +262,6 @@
-
@@ -310,6 +309,10 @@
+
+
+
+
@@ -439,12 +442,15 @@
-
+
+
+
+
diff --git a/VisualC/tests/testyuv/testyuv.vcxproj b/VisualC/tests/testyuv/testyuv.vcxproj
new file mode 100644
index 000000000..c5738c67d
--- /dev/null
+++ b/VisualC/tests/testyuv/testyuv.vcxproj
@@ -0,0 +1,229 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ Win32
+
+
+ Release
+ x64
+
+
+
+ {40FB7794-D3C3-4CFE-BCF4-A80C97635682}
+ testyuv
+
+
+
+ Application
+
+
+ Application
+
+
+ Application
+
+
+ Application
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_ProjectFileVersion>10.0.40219.1
+ $(SolutionDir)$(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\
+ $(SolutionDir)$(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\
+ $(SolutionDir)$(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\
+ $(SolutionDir)$(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\
+ AllRules.ruleset
+
+
+ AllRules.ruleset
+
+
+ AllRules.ruleset
+
+
+ AllRules.ruleset
+
+
+
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ Win32
+ .\Release/testyuv.tlb
+
+
+ $(SolutionDir)/../include;%(AdditionalIncludeDirectories)
+ %(AdditionalUsingDirectories)
+ WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ MultiThreadedDLL
+ Level3
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ Windows
+
+
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ X64
+ .\Release/testyuv.tlb
+
+
+ $(SolutionDir)/../include;%(AdditionalIncludeDirectories)
+ %(AdditionalUsingDirectories)
+ WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ MultiThreadedDLL
+ Level3
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ Windows
+
+
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ Win32
+ .\Debug/testyuv.tlb
+
+
+ Disabled
+ $(SolutionDir)/../include;%(AdditionalIncludeDirectories)
+ %(AdditionalUsingDirectories)
+ WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ MultiThreadedDLL
+ Level3
+ OldStyle
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ true
+ Windows
+
+
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ true
+ true
+ X64
+ .\Debug/testyuv.tlb
+
+
+ Disabled
+ $(SolutionDir)/../include;%(AdditionalIncludeDirectories)
+ %(AdditionalUsingDirectories)
+ WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ MultiThreadedDebugDLL
+ Level3
+ OldStyle
+
+
+ _DEBUG;%(PreprocessorDefinitions)
+ 0x0409
+
+
+ true
+ Windows
+
+
+
+
+ {81ce8daf-ebb2-4761-8e45-b71abcca8c68}
+ false
+ false
+ true
+
+
+ {da956fd3-e142-46f2-9dd5-c78bebb56b7a}
+ false
+ false
+ true
+
+
+ {da956fd3-e143-46f2-9fe5-c77bebc56b1a}
+ false
+ false
+ true
+
+
+
+
+ Copying %(Filename)%(Extension)
+ copy %(FullPath) $(ProjectDir)\
+
+ $(ProjectDir)\%(Filename)%(Extension);%(Outputs)
+ Copying %(Filename)%(Extension)
+ copy %(FullPath) $(ProjectDir)\
+
+ $(ProjectDir)\%(Filename)%(Extension);%(Outputs)
+ Copying %(Filename)%(Extension)
+ copy %(FullPath) $(ProjectDir)\
+
+ $(ProjectDir)\%(Filename)%(Extension);%(Outputs)
+ Copying %(Filename)%(Extension)
+ copy %(FullPath) $(ProjectDir)\
+
+ $(ProjectDir)\%(Filename)%(Extension);%(Outputs)
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj b/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
index 72cd2adf4..4557c94f0 100755
--- a/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
+++ b/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
@@ -52,8 +52,6 @@
041B2CF212FA0F680087D585 /* SDL_sysrender.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2CEB12FA0F680087D585 /* SDL_sysrender.h */; };
0420497011E6F03D007E7EC9 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */; };
0420497111E6F03D007E7EC9 /* SDL_clipboardevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */; };
- 04409BA612FA989600FB9AA8 /* mmx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409BA212FA989600FB9AA8 /* mmx.h */; };
- 04409BA712FA989600FB9AA8 /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409BA312FA989600FB9AA8 /* SDL_yuv_mmx.c */; };
04409BA812FA989600FB9AA8 /* SDL_yuv_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409BA412FA989600FB9AA8 /* SDL_yuv_sw_c.h */; };
04409BA912FA989600FB9AA8 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409BA512FA989600FB9AA8 /* SDL_yuv_sw.c */; };
0442EC5012FE1C1E004C9285 /* SDL_render_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0442EC4E12FE1C1E004C9285 /* SDL_render_sw_c.h */; };
@@ -119,6 +117,17 @@
AA0F8495178D5F1A00823F9D /* SDL_systls.c in Sources */ = {isa = PBXBuildFile; fileRef = AA0F8494178D5F1A00823F9D /* SDL_systls.c */; };
AA126AD41617C5E7005ABC8F /* SDL_uikitmodes.h in Headers */ = {isa = PBXBuildFile; fileRef = AA126AD21617C5E6005ABC8F /* SDL_uikitmodes.h */; };
AA126AD51617C5E7005ABC8F /* SDL_uikitmodes.m in Sources */ = {isa = PBXBuildFile; fileRef = AA126AD31617C5E6005ABC8F /* SDL_uikitmodes.m */; };
+ AA13B3491FB8B27800D9FEE6 /* SDL_egl_c.h in Headers */ = {isa = PBXBuildFile; fileRef = AA13B3431FB8B27700D9FEE6 /* SDL_egl_c.h */; };
+ AA13B34A1FB8B27800D9FEE6 /* SDL_shape.c in Sources */ = {isa = PBXBuildFile; fileRef = AA13B3441FB8B27800D9FEE6 /* SDL_shape.c */; };
+ AA13B34B1FB8B27800D9FEE6 /* SDL_shape_internals.h in Headers */ = {isa = PBXBuildFile; fileRef = AA13B3451FB8B27800D9FEE6 /* SDL_shape_internals.h */; };
+ AA13B34C1FB8B27800D9FEE6 /* SDL_rect_c.h in Headers */ = {isa = PBXBuildFile; fileRef = AA13B3461FB8B27800D9FEE6 /* SDL_rect_c.h */; };
+ AA13B34D1FB8B27800D9FEE6 /* SDL_egl.c in Sources */ = {isa = PBXBuildFile; fileRef = AA13B3471FB8B27800D9FEE6 /* SDL_egl.c */; };
+ AA13B34E1FB8B27800D9FEE6 /* SDL_yuv_c.h in Headers */ = {isa = PBXBuildFile; fileRef = AA13B3481FB8B27800D9FEE6 /* SDL_yuv_c.h */; };
+ AA13B3501FB8B3CC00D9FEE6 /* SDL_yuv.c in Sources */ = {isa = PBXBuildFile; fileRef = AA13B34F1FB8B3CC00D9FEE6 /* SDL_yuv.c */; };
+ AA13B3571FB8B46400D9FEE6 /* yuv_rgb_std_func.h in Headers */ = {isa = PBXBuildFile; fileRef = AA13B3531FB8B46300D9FEE6 /* yuv_rgb_std_func.h */; };
+ AA13B3581FB8B46400D9FEE6 /* yuv_rgb_sse_func.h in Headers */ = {isa = PBXBuildFile; fileRef = AA13B3541FB8B46300D9FEE6 /* yuv_rgb_sse_func.h */; };
+ AA13B3591FB8B46400D9FEE6 /* yuv_rgb.h in Headers */ = {isa = PBXBuildFile; fileRef = AA13B3551FB8B46300D9FEE6 /* yuv_rgb.h */; };
+ AA13B35A1FB8B46400D9FEE6 /* yuv_rgb.c in Sources */ = {isa = PBXBuildFile; fileRef = AA13B3561FB8B46300D9FEE6 /* yuv_rgb.c */; };
AA628ADB159369E3005138DD /* SDL_rotate.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628AD9159369E3005138DD /* SDL_rotate.c */; };
AA628ADC159369E3005138DD /* SDL_rotate.h in Headers */ = {isa = PBXBuildFile; fileRef = AA628ADA159369E3005138DD /* SDL_rotate.h */; };
AA704DD6162AA90A0076D1C1 /* SDL_dropevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = AA704DD4162AA90A0076D1C1 /* SDL_dropevents_c.h */; };
@@ -222,7 +231,6 @@
FAB598681BB5C31600BE72C5 /* SDL_render_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC4F12FE1C1E004C9285 /* SDL_render_sw.c */; };
FAB5986A1BB5C31600BE72C5 /* SDL_rotate.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628AD9159369E3005138DD /* SDL_rotate.c */; };
FAB5986D1BB5C31600BE72C5 /* SDL_render.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2CEA12FA0F680087D585 /* SDL_render.c */; };
- FAB5986F1BB5C31600BE72C5 /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409BA312FA989600FB9AA8 /* SDL_yuv_mmx.c */; };
FAB598711BB5C31600BE72C5 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409BA512FA989600FB9AA8 /* SDL_yuv_sw.c */; };
FAB598721BB5C31600BE72C5 /* SDL_getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A700DEA620800C5B771 /* SDL_getenv.c */; };
FAB598731BB5C31600BE72C5 /* SDL_iconv.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A710DEA620800C5B771 /* SDL_iconv.c */; };
@@ -358,8 +366,6 @@
041B2CEB12FA0F680087D585 /* SDL_sysrender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysrender.h; sourceTree = ""; };
0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboardevents_c.h; sourceTree = ""; };
0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboardevents.c; sourceTree = ""; };
- 04409BA212FA989600FB9AA8 /* mmx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mmx.h; sourceTree = ""; };
- 04409BA312FA989600FB9AA8 /* SDL_yuv_mmx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_mmx.c; sourceTree = ""; };
04409BA412FA989600FB9AA8 /* SDL_yuv_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_yuv_sw_c.h; sourceTree = ""; };
04409BA512FA989600FB9AA8 /* SDL_yuv_sw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_sw.c; sourceTree = ""; };
0442EC4E12FE1C1E004C9285 /* SDL_render_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_render_sw_c.h; sourceTree = ""; };
@@ -424,6 +430,17 @@
AA0F8494178D5F1A00823F9D /* SDL_systls.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_systls.c; sourceTree = ""; };
AA126AD21617C5E6005ABC8F /* SDL_uikitmodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitmodes.h; sourceTree = ""; };
AA126AD31617C5E6005ABC8F /* SDL_uikitmodes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitmodes.m; sourceTree = ""; };
+ AA13B3431FB8B27700D9FEE6 /* SDL_egl_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_egl_c.h; sourceTree = ""; };
+ AA13B3441FB8B27800D9FEE6 /* SDL_shape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_shape.c; sourceTree = ""; };
+ AA13B3451FB8B27800D9FEE6 /* SDL_shape_internals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shape_internals.h; sourceTree = ""; };
+ AA13B3461FB8B27800D9FEE6 /* SDL_rect_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rect_c.h; sourceTree = ""; };
+ AA13B3471FB8B27800D9FEE6 /* SDL_egl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_egl.c; sourceTree = ""; };
+ AA13B3481FB8B27800D9FEE6 /* SDL_yuv_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_yuv_c.h; sourceTree = ""; };
+ AA13B34F1FB8B3CC00D9FEE6 /* SDL_yuv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv.c; sourceTree = ""; };
+ AA13B3531FB8B46300D9FEE6 /* yuv_rgb_std_func.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb_std_func.h; sourceTree = ""; };
+ AA13B3541FB8B46300D9FEE6 /* yuv_rgb_sse_func.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb_sse_func.h; sourceTree = ""; };
+ AA13B3551FB8B46300D9FEE6 /* yuv_rgb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb.h; sourceTree = ""; };
+ AA13B3561FB8B46300D9FEE6 /* yuv_rgb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = yuv_rgb.c; sourceTree = ""; };
AA628AD9159369E3005138DD /* SDL_rotate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rotate.c; sourceTree = ""; };
AA628ADA159369E3005138DD /* SDL_rotate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rotate.h; sourceTree = ""; };
AA704DD4162AA90A0076D1C1 /* SDL_dropevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dropevents_c.h; sourceTree = ""; };
@@ -608,10 +625,8 @@
041B2CE812FA0F680087D585 /* opengles */,
0402A85412FE70C600CECEE3 /* opengles2 */,
041B2CEC12FA0F680087D585 /* software */,
- 04409BA212FA989600FB9AA8 /* mmx.h */,
041B2CEA12FA0F680087D585 /* SDL_render.c */,
041B2CEB12FA0F680087D585 /* SDL_sysrender.h */,
- 04409BA312FA989600FB9AA8 /* SDL_yuv_mmx.c */,
04409BA412FA989600FB9AA8 /* SDL_yuv_sw_c.h */,
04409BA512FA989600FB9AA8 /* SDL_yuv_sw.c */,
);
@@ -760,6 +775,17 @@
path = steam;
sourceTree = "";
};
+ AA13B3521FB8B41700D9FEE6 /* yuv2rgb */ = {
+ isa = PBXGroup;
+ children = (
+ AA13B3541FB8B46300D9FEE6 /* yuv_rgb_sse_func.h */,
+ AA13B3531FB8B46300D9FEE6 /* yuv_rgb_std_func.h */,
+ AA13B3561FB8B46300D9FEE6 /* yuv_rgb.c */,
+ AA13B3551FB8B46300D9FEE6 /* yuv_rgb.h */,
+ );
+ path = yuv2rgb;
+ sourceTree = "";
+ };
FD3F4A6F0DEA620800C5B771 /* stdlib */ = {
isa = PBXGroup;
children = (
@@ -1070,10 +1096,9 @@
FDA682420DF2374D00F98A1A /* video */ = {
isa = PBXGroup;
children = (
- FD689F090E26E5D900F90B21 /* uikit */,
FDA685F40DF244C800F98A1A /* dummy */,
- FDA683000DF2374E00F98A1A /* SDL_blit.c */,
- FDA683010DF2374E00F98A1A /* SDL_blit.h */,
+ FD689F090E26E5D900F90B21 /* uikit */,
+ AA13B3521FB8B41700D9FEE6 /* yuv2rgb */,
FDA683020DF2374E00F98A1A /* SDL_blit_0.c */,
FDA683030DF2374E00F98A1A /* SDL_blit_1.c */,
FDA683040DF2374E00F98A1A /* SDL_blit_A.c */,
@@ -1084,20 +1109,29 @@
FDA683090DF2374E00F98A1A /* SDL_blit_N.c */,
FDA6830A0DF2374E00F98A1A /* SDL_blit_slow.c */,
0463873A0F0B5B7D0041FD65 /* SDL_blit_slow.h */,
+ FDA683000DF2374E00F98A1A /* SDL_blit.c */,
+ FDA683010DF2374E00F98A1A /* SDL_blit.h */,
FDA6830B0DF2374E00F98A1A /* SDL_bmp.c */,
044E5FB711E606EB0076F181 /* SDL_clipboard.c */,
+ AA13B3431FB8B27700D9FEE6 /* SDL_egl_c.h */,
+ AA13B3471FB8B27800D9FEE6 /* SDL_egl.c */,
0463873E0F0B5B7D0041FD65 /* SDL_fillrect.c */,
- FDA6830F0DF2374E00F98A1A /* SDL_pixels.c */,
FDA683100DF2374E00F98A1A /* SDL_pixels_c.h */,
+ FDA6830F0DF2374E00F98A1A /* SDL_pixels.c */,
+ AA13B3461FB8B27800D9FEE6 /* SDL_rect_c.h */,
FDA683110DF2374E00F98A1A /* SDL_rect.c */,
- FDA683150DF2374E00F98A1A /* SDL_RLEaccel.c */,
FDA683160DF2374E00F98A1A /* SDL_RLEaccel_c.h */,
+ FDA683150DF2374E00F98A1A /* SDL_RLEaccel.c */,
+ AA13B3451FB8B27800D9FEE6 /* SDL_shape_internals.h */,
+ AA13B3441FB8B27800D9FEE6 /* SDL_shape.c */,
FDA683170DF2374E00F98A1A /* SDL_stretch.c */,
FDA683190DF2374E00F98A1A /* SDL_surface.c */,
FDA6831A0DF2374E00F98A1A /* SDL_sysvideo.h */,
FDA6831B0DF2374E00F98A1A /* SDL_video.c */,
4D75171D1EE1D98200820EEA /* SDL_vulkan_internal.h */,
4D75171E1EE1D98200820EEA /* SDL_vulkan_utils.c */,
+ AA13B34F1FB8B3CC00D9FEE6 /* SDL_yuv.c */,
+ AA13B3481FB8B27800D9FEE6 /* SDL_yuv_c.h */,
);
name = video;
path = ../../src/video;
@@ -1144,20 +1178,24 @@
56A6703818565E760007D20F /* SDL_dynapi.h in Headers */,
FD689FCF0E26E9D400F90B21 /* SDL_uikitappdelegate.h in Headers */,
56A6703518565E760007D20F /* SDL_dynapi_overrides.h in Headers */,
+ AA13B3571FB8B46400D9FEE6 /* yuv_rgb_std_func.h in Headers */,
047677BD0EA76A31008ABAF1 /* SDL_syshaptic.h in Headers */,
046387420F0B5B7D0041FD65 /* SDL_blit_slow.h in Headers */,
006E9888119552DD001DE610 /* SDL_rwopsbundlesupport.h in Headers */,
0420497011E6F03D007E7EC9 /* SDL_clipboardevents_c.h in Headers */,
+ AA13B34C1FB8B27800D9FEE6 /* SDL_rect_c.h in Headers */,
+ AA13B3581FB8B46400D9FEE6 /* yuv_rgb_sse_func.h in Headers */,
04BA9D6311EF474A00B60E01 /* SDL_gesture_c.h in Headers */,
04BA9D6511EF474A00B60E01 /* SDL_touch_c.h in Headers */,
041B2CF212FA0F680087D585 /* SDL_sysrender.h in Headers */,
- 04409BA612FA989600FB9AA8 /* mmx.h in Headers */,
04409BA812FA989600FB9AA8 /* SDL_yuv_sw_c.h in Headers */,
+ AA13B3591FB8B46400D9FEE6 /* yuv_rgb.h in Headers */,
04F7807712FB751400FC43C0 /* SDL_blendfillrect.h in Headers */,
04F7807912FB751400FC43C0 /* SDL_blendline.h in Headers */,
04F7807B12FB751400FC43C0 /* SDL_blendpoint.h in Headers */,
04F7807C12FB751400FC43C0 /* SDL_draw.h in Headers */,
04F7807E12FB751400FC43C0 /* SDL_drawline.h in Headers */,
+ AA13B34E1FB8B27800D9FEE6 /* SDL_yuv_c.h in Headers */,
04F7808012FB751400FC43C0 /* SDL_drawpoint.h in Headers */,
04F7808412FB753F00FC43C0 /* SDL_nullframebuffer_c.h in Headers */,
A7A9EEAA1F702631002A5589 /* SDL_steamcontroller.h in Headers */,
@@ -1178,6 +1216,7 @@
AA75589F1595D55500BBD41B /* SDL_config_iphoneos.h in Headers */,
AA7558A01595D55500BBD41B /* SDL_config.h in Headers */,
AA7558A11595D55500BBD41B /* SDL_copying.h in Headers */,
+ AA13B3491FB8B27800D9FEE6 /* SDL_egl_c.h in Headers */,
AA7558A21595D55500BBD41B /* SDL_cpuinfo.h in Headers */,
AA7558A31595D55500BBD41B /* SDL_endian.h in Headers */,
AA7558A41595D55500BBD41B /* SDL_error.h in Headers */,
@@ -1188,6 +1227,7 @@
AA7558A81595D55500BBD41B /* SDL_hints.h in Headers */,
566726461DF72CF5001DD3DB /* SDL_dataqueue.h in Headers */,
AA7558AA1595D55500BBD41B /* SDL_joystick.h in Headers */,
+ AA13B34B1FB8B27800D9FEE6 /* SDL_shape_internals.h in Headers */,
AA7558AB1595D55500BBD41B /* SDL_keyboard.h in Headers */,
AA7558AC1595D55500BBD41B /* SDL_keycode.h in Headers */,
AA7558AD1595D55500BBD41B /* SDL_loadso.h in Headers */,
@@ -1407,7 +1447,6 @@
FAB598681BB5C31600BE72C5 /* SDL_render_sw.c in Sources */,
FAB5986A1BB5C31600BE72C5 /* SDL_rotate.c in Sources */,
FAB5986D1BB5C31600BE72C5 /* SDL_render.c in Sources */,
- FAB5986F1BB5C31600BE72C5 /* SDL_yuv_mmx.c in Sources */,
FAB598711BB5C31600BE72C5 /* SDL_yuv_sw.c in Sources */,
FAB598721BB5C31600BE72C5 /* SDL_getenv.c in Sources */,
FAB598731BB5C31600BE72C5 /* SDL_iconv.c in Sources */,
@@ -1501,6 +1540,7 @@
FD3F4A7A0DEA620800C5B771 /* SDL_stdlib.c in Sources */,
FDA6844D0DF2374E00F98A1A /* SDL_blit.c in Sources */,
FDA6844F0DF2374E00F98A1A /* SDL_blit_0.c in Sources */,
+ AA13B3501FB8B3CC00D9FEE6 /* SDL_yuv.c in Sources */,
FDA684500DF2374E00F98A1A /* SDL_blit_1.c in Sources */,
566726451DF72CF5001DD3DB /* SDL_dataqueue.c in Sources */,
FDA684510DF2374E00F98A1A /* SDL_blit_A.c in Sources */,
@@ -1513,6 +1553,7 @@
FDA6845E0DF2374E00F98A1A /* SDL_rect.c in Sources */,
FDA684620DF2374E00F98A1A /* SDL_RLEaccel.c in Sources */,
FDA684640DF2374E00F98A1A /* SDL_stretch.c in Sources */,
+ AA13B34D1FB8B27800D9FEE6 /* SDL_egl.c in Sources */,
FDA684660DF2374E00F98A1A /* SDL_surface.c in Sources */,
FDA684680DF2374E00F98A1A /* SDL_video.c in Sources */,
FDA685FB0DF244C800F98A1A /* SDL_nullevents.c in Sources */,
@@ -1520,6 +1561,7 @@
FD5F9D2F0E0E08B3008E885B /* SDL_joystick.c in Sources */,
FD689F030E26E5B600F90B21 /* SDL_sysjoystick.m in Sources */,
FD689F1D0E26E5D900F90B21 /* SDL_uikitevents.m in Sources */,
+ AA13B35A1FB8B46400D9FEE6 /* yuv_rgb.c in Sources */,
FD689F1F0E26E5D900F90B21 /* SDL_uikitopengles.m in Sources */,
FD689F210E26E5D900F90B21 /* SDL_uikitvideo.m in Sources */,
FD689F230E26E5D900F90B21 /* SDL_uikitview.m in Sources */,
@@ -1542,7 +1584,6 @@
04FFAB8B12E23B8D00BA343D /* SDL_atomic.c in Sources */,
04FFAB8C12E23B8D00BA343D /* SDL_spinlock.c in Sources */,
041B2CF112FA0F680087D585 /* SDL_render.c in Sources */,
- 04409BA712FA989600FB9AA8 /* SDL_yuv_mmx.c in Sources */,
04409BA912FA989600FB9AA8 /* SDL_yuv_sw.c in Sources */,
04F7807612FB751400FC43C0 /* SDL_blendfillrect.c in Sources */,
04F7807812FB751400FC43C0 /* SDL_blendline.c in Sources */,
@@ -1553,6 +1594,7 @@
0442EC5112FE1C1E004C9285 /* SDL_render_sw.c in Sources */,
0442EC5312FE1C28004C9285 /* SDL_render_gles.c in Sources */,
0442EC5512FE1C3F004C9285 /* SDL_hints.c in Sources */,
+ AA13B34A1FB8B27800D9FEE6 /* SDL_shape.c in Sources */,
0402A85812FE70C600CECEE3 /* SDL_render_gles2.c in Sources */,
0402A85912FE70C600CECEE3 /* SDL_shaders_gles2.c in Sources */,
04BAC09D1300C1290055DE28 /* SDL_log.c in Sources */,
diff --git a/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj b/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj
index 99afeb1ee..89e381e0a 100644
--- a/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj
+++ b/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj
@@ -318,6 +318,7 @@
isa = XCBuildConfiguration;
buildSettings = {
EXECUTABLE_PREFIX = lib;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
@@ -326,6 +327,7 @@
isa = XCBuildConfiguration;
buildSettings = {
EXECUTABLE_PREFIX = lib;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
diff --git a/Xcode-iOS/Test/Info.plist b/Xcode-iOS/Test/Info.plist
index c0f1179d3..cd3c096da 100644
--- a/Xcode-iOS/Test/Info.plist
+++ b/Xcode-iOS/Test/Info.plist
@@ -22,7 +22,5 @@
????
CFBundleVersion
1.0
- NSMainNibFile
-
diff --git a/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj b/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj
index 2e9cbb3a3..519d1507b 100755
--- a/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj
+++ b/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj
@@ -36,6 +36,22 @@
56ED0508118A8FE400A56AA6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
56ED0509118A8FE400A56AA6 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
56ED0511118A904200A56AA6 /* testpower.c in Sources */ = {isa = PBXBuildFile; fileRef = 56ED0510118A904200A56AA6 /* testpower.c */; };
+ AA13B3171FB8AEBC00D9FEE6 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34761D8B4EAD00915323 /* AVFoundation.framework */; };
+ AA13B3181FB8AEBC00D9FEE6 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; };
+ AA13B3191FB8AEBC00D9FEE6 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; };
+ AA13B31A1FB8AEBC00D9FEE6 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA684F7A1BAF1A4400DCFD1A /* GameController.framework */; };
+ AA13B31B1FB8AEBC00D9FEE6 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BAC1967076F00F8EB7C /* CoreMotion.framework */; };
+ AA13B31C1FB8AEBC00D9FEE6 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; };
+ AA13B31D1FB8AEBC00D9FEE6 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; };
+ AA13B31E1FB8AEBC00D9FEE6 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; };
+ AA13B31F1FB8AEBC00D9FEE6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; };
+ AA13B3201FB8AEBC00D9FEE6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; };
+ AA13B3211FB8AEBC00D9FEE6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; };
+ AA13B3221FB8AEBC00D9FEE6 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; };
+ AA13B32F1FB8AF0C00D9FEE6 /* testyuv.bmp in Resources */ = {isa = PBXBuildFile; fileRef = AA13B32E1FB8AF0C00D9FEE6 /* testyuv.bmp */; };
+ AA13B3301FB8AF2300D9FEE6 /* testyuv.bmp in Resources */ = {isa = PBXBuildFile; fileRef = AA13B32E1FB8AF0C00D9FEE6 /* testyuv.bmp */; };
+ AA13B35D1FB8B4E200D9FEE6 /* testyuv.c in Sources */ = {isa = PBXBuildFile; fileRef = AA13B35B1FB8B4D600D9FEE6 /* testyuv.c */; };
+ AA13B3611FB8B52500D9FEE6 /* testyuv_cvt.c in Sources */ = {isa = PBXBuildFile; fileRef = AA13B35E1FB8B50D00D9FEE6 /* testyuv_cvt.c */; };
AA1EE470176059D00029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; };
AA1EE47117605A7F0029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; };
AA1EE47417605B5C0029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; };
@@ -407,6 +423,10 @@
1D6058910D05DD3D006BFB54 /* testwm2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testwm2.app; sourceTree = BUILT_PRODUCTS_DIR; };
56ED050D118A8FE400A56AA6 /* testpower.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testpower.app; sourceTree = BUILT_PRODUCTS_DIR; };
56ED0510118A904200A56AA6 /* testpower.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testpower.c; path = ../../test/testpower.c; sourceTree = SOURCE_ROOT; };
+ AA13B3261FB8AEBC00D9FEE6 /* testyuv.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testyuv.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ AA13B32E1FB8AF0C00D9FEE6 /* testyuv.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = testyuv.bmp; path = ../../test/testyuv.bmp; sourceTree = ""; };
+ AA13B35B1FB8B4D600D9FEE6 /* testyuv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testyuv.c; path = ../../test/testyuv.c; sourceTree = ""; };
+ AA13B35E1FB8B50D00D9FEE6 /* testyuv_cvt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testyuv_cvt.c; path = ../../test/testyuv_cvt.c; sourceTree = ""; };
AA1EE44D176059220029C7A5 /* SDL2test.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL2test.xcodeproj; path = ../SDLtest/SDL2test.xcodeproj; sourceTree = ""; };
AAE7DEEC14CBB1E100DF1A0E /* testscale.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testscale.app; sourceTree = BUILT_PRODUCTS_DIR; };
AAE7DF4514CBB43900DF1A0E /* testscale.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testscale.c; path = ../../test/testscale.c; sourceTree = ""; };
@@ -552,6 +572,25 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ AA13B3161FB8AEBC00D9FEE6 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AA13B3171FB8AEBC00D9FEE6 /* AVFoundation.framework in Frameworks */,
+ AA13B3181FB8AEBC00D9FEE6 /* libSDL2test.a in Frameworks */,
+ AA13B3191FB8AEBC00D9FEE6 /* libSDL2.a in Frameworks */,
+ AA13B31A1FB8AEBC00D9FEE6 /* GameController.framework in Frameworks */,
+ AA13B31B1FB8AEBC00D9FEE6 /* CoreMotion.framework in Frameworks */,
+ AA13B31C1FB8AEBC00D9FEE6 /* AudioToolbox.framework in Frameworks */,
+ AA13B31D1FB8AEBC00D9FEE6 /* QuartzCore.framework in Frameworks */,
+ AA13B31E1FB8AEBC00D9FEE6 /* OpenGLES.framework in Frameworks */,
+ AA13B31F1FB8AEBC00D9FEE6 /* CoreGraphics.framework in Frameworks */,
+ AA13B3201FB8AEBC00D9FEE6 /* UIKit.framework in Frameworks */,
+ AA13B3211FB8AEBC00D9FEE6 /* Foundation.framework in Frameworks */,
+ AA13B3221FB8AEBC00D9FEE6 /* CoreAudio.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
AAE7DEE014CBB1E100DF1A0E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -1003,6 +1042,7 @@
FA3D99341BC4E644002C96C8 /* testgamecontroller-TV.app */,
FABA34911D8B575200915323 /* testaudiocapture.app */,
FABA34AA1D8B582100915323 /* loopwav-TV.app */,
+ AA13B3261FB8AEBC00D9FEE6 /* testyuv.app */,
);
name = Products;
sourceTree = "";
@@ -1051,9 +1091,9 @@
FDA8A73B0E2D0F0400EA573E /* src */ = {
isa = PBXGroup;
children = (
- FABA34931D8B578200915323 /* testaudiocapture.c */,
047A63F013285CD100CD7973 /* checkkeys.c */,
FDA8A78B0E2D0F3D00EA573E /* loopwave.c */,
+ FABA34931D8B578200915323 /* testaudiocapture.c */,
FDA8A7410E2D0F1600EA573E /* testaudioinfo.c */,
FDC430090F0D86BF009C87E1 /* testdraw2.c */,
FDA8A7470E2D0F1600EA573E /* testerror.c */,
@@ -1076,6 +1116,8 @@
FDA8A75A0E2D0F1600EA573E /* testtimer.c */,
FDA8A75B0E2D0F1600EA573E /* testver.c */,
FDA8A75F0E2D0F1600EA573E /* testwm2.c */,
+ AA13B35E1FB8B50D00D9FEE6 /* testyuv_cvt.c */,
+ AA13B35B1FB8B4D600D9FEE6 /* testyuv.c */,
FDA8A7610E2D0F1600EA573E /* torturethread.c */,
);
name = src;
@@ -1103,12 +1145,13 @@
FA0EF2281BAF4487000E07A6 /* axis.bmp */,
FA0EF2291BAF4487000E07A6 /* button.bmp */,
FA0EF22A1BAF4487000E07A6 /* controllermap.bmp */,
- FDD2C18A0E2E52FE00B7A85F /* utf8.txt */,
FDA8AAD90E2D33B000EA573E /* icon.bmp */,
FDA8AADA0E2D33BA00EA573E /* moose.dat */,
FDA8AADB0E2D33BA00EA573E /* picture.xbm */,
FDA8AADE0E2D33C100EA573E /* sample.bmp */,
FDA8AAE20E2D33C600EA573E /* sample.wav */,
+ AA13B32E1FB8AF0C00D9FEE6 /* testyuv.bmp */,
+ FDD2C18A0E2E52FE00B7A85F /* utf8.txt */,
);
name = Resources;
sourceTree = "";
@@ -1184,6 +1227,23 @@
productReference = 56ED050D118A8FE400A56AA6 /* testpower.app */;
productType = "com.apple.product-type.application";
};
+ AA13B3111FB8AEBC00D9FEE6 /* testyuv */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = AA13B3231FB8AEBC00D9FEE6 /* Build configuration list for PBXNativeTarget "testyuv" */;
+ buildPhases = (
+ AA13B3121FB8AEBC00D9FEE6 /* Resources */,
+ AA13B3141FB8AEBC00D9FEE6 /* Sources */,
+ AA13B3161FB8AEBC00D9FEE6 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = testyuv;
+ productName = Test;
+ productReference = AA13B3261FB8AEBC00D9FEE6 /* testyuv.app */;
+ productType = "com.apple.product-type.application";
+ };
AAE7DEDA14CBB1E100DF1A0E /* testscale */ = {
isa = PBXNativeTarget;
buildConfigurationList = AAE7DEE914CBB1E100DF1A0E /* Build configuration list for PBXNativeTarget "testscale" */;
@@ -1584,6 +1644,9 @@
attributes = {
LastUpgradeCheck = 0630;
TargetAttributes = {
+ AA13B3111FB8AEBC00D9FEE6 = {
+ DevelopmentTeam = EH385AYQ6F;
+ };
FA3D99331BC4E644002C96C8 = {
CreatedOnToolsVersion = 7.1;
};
@@ -1643,6 +1706,7 @@
FDD2C5740E2E8C7400B7A85F /* testtimer */,
FDD2C5B30E2E8CFC00B7A85F /* testver */,
1D6058900D05DD3D006BFB54 /* testwm2 */,
+ AA13B3111FB8AEBC00D9FEE6 /* testyuv */,
FDD2C6E20E2E959E00B7A85F /* torturethread */,
);
};
@@ -1692,6 +1756,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ AA13B32F1FB8AF0C00D9FEE6 /* testyuv.bmp in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1710,6 +1775,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ AA13B3121FB8AEBC00D9FEE6 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AA13B3301FB8AF2300D9FEE6 /* testyuv.bmp in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
AAE7DEDB14CBB1E100DF1A0E /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -1926,6 +1999,15 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ AA13B3141FB8AEBC00D9FEE6 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AA13B3611FB8B52500D9FEE6 /* testyuv_cvt.c in Sources */,
+ AA13B35D1FB8B4E200D9FEE6 /* testyuv.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
AAE7DEDD14CBB1E100DF1A0E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -2185,6 +2267,24 @@
};
name = Release;
};
+ AA13B3241FB8AEBC00D9FEE6 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ DEVELOPMENT_TEAM = EH385AYQ6F;
+ INFOPLIST_FILE = Info.plist;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Debug;
+ };
+ AA13B3251FB8AEBC00D9FEE6 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ DEVELOPMENT_TEAM = EH385AYQ6F;
+ INFOPLIST_FILE = Info.plist;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Release;
+ };
AAE7DEEA14CBB1E100DF1A0E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -2221,8 +2321,10 @@
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ ENABLE_BITCODE = NO;
GCC_OPTIMIZATION_LEVEL = 0;
HEADER_SEARCH_PATHS = ../../include;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "-ObjC";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
@@ -2235,7 +2337,9 @@
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ ENABLE_BITCODE = NO;
HEADER_SEARCH_PATHS = ../../include;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
OTHER_LDFLAGS = "-ObjC";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
SDKROOT = iphoneos;
@@ -2696,6 +2800,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
+ AA13B3231FB8AEBC00D9FEE6 /* Build configuration list for PBXNativeTarget "testyuv" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ AA13B3241FB8AEBC00D9FEE6 /* Debug */,
+ AA13B3251FB8AEBC00D9FEE6 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
AAE7DEE914CBB1E100DF1A0E /* Build configuration list for PBXNativeTarget "testscale" */ = {
isa = XCConfigurationList;
buildConfigurations = (
diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj
index 4208d9af9..aada0f3e6 100755
--- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj
+++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj
@@ -25,12 +25,8 @@
0435673F1303160F00BA5428 /* SDL_shaders_gl.h in Headers */ = {isa = PBXBuildFile; fileRef = 0435673D1303160F00BA5428 /* SDL_shaders_gl.h */; };
043567401303160F00BA5428 /* SDL_shaders_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0435673C1303160F00BA5428 /* SDL_shaders_gl.c */; };
043567411303160F00BA5428 /* SDL_shaders_gl.h in Headers */ = {isa = PBXBuildFile; fileRef = 0435673D1303160F00BA5428 /* SDL_shaders_gl.h */; };
- 04409B9112FA97ED00FB9AA8 /* mmx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8D12FA97ED00FB9AA8 /* mmx.h */; };
- 04409B9212FA97ED00FB9AA8 /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409B8E12FA97ED00FB9AA8 /* SDL_yuv_mmx.c */; };
04409B9312FA97ED00FB9AA8 /* SDL_yuv_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8F12FA97ED00FB9AA8 /* SDL_yuv_sw_c.h */; };
04409B9412FA97ED00FB9AA8 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409B9012FA97ED00FB9AA8 /* SDL_yuv_sw.c */; };
- 04409B9512FA97ED00FB9AA8 /* mmx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8D12FA97ED00FB9AA8 /* mmx.h */; };
- 04409B9612FA97ED00FB9AA8 /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409B8E12FA97ED00FB9AA8 /* SDL_yuv_mmx.c */; };
04409B9712FA97ED00FB9AA8 /* SDL_yuv_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8F12FA97ED00FB9AA8 /* SDL_yuv_sw_c.h */; };
04409B9812FA97ED00FB9AA8 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409B9012FA97ED00FB9AA8 /* SDL_yuv_sw.c */; };
0442EC1812FE1BBA004C9285 /* SDL_render_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC1712FE1BBA004C9285 /* SDL_render_gl.c */; };
@@ -540,6 +536,10 @@
AA75585E1595D4D800BBD41B /* SDL.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F91595D4D800BBD41B /* SDL.h */; settings = {ATTRIBUTES = (Public, ); }; };
AA75585F1595D4D800BBD41B /* SDL.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F91595D4D800BBD41B /* SDL.h */; settings = {ATTRIBUTES = (Public, ); }; };
AA8167541F5E727800518735 /* SDL_vulkan.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D4820431F0F10B400EDC31C /* SDL_vulkan.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AA9A7F111FB0206400FED37F /* yuv_rgb.h in Headers */ = {isa = PBXBuildFile; fileRef = AA9A7F0F1FB0206300FED37F /* yuv_rgb.h */; };
+ AA9A7F121FB0206400FED37F /* yuv_rgb.c in Sources */ = {isa = PBXBuildFile; fileRef = AA9A7F101FB0206300FED37F /* yuv_rgb.c */; };
+ AA9A7F151FB0209D00FED37F /* SDL_yuv.c in Sources */ = {isa = PBXBuildFile; fileRef = AA9A7F131FB0209C00FED37F /* SDL_yuv.c */; };
+ AA9A7F161FB0209D00FED37F /* SDL_yuv_c.h in Headers */ = {isa = PBXBuildFile; fileRef = AA9A7F141FB0209C00FED37F /* SDL_yuv_c.h */; };
AA9E4093163BE51E007A2AD0 /* SDL_x11messagebox.c in Sources */ = {isa = PBXBuildFile; fileRef = AA9E4092163BE51E007A2AD0 /* SDL_x11messagebox.c */; };
AA9E4094163BE51E007A2AD0 /* SDL_x11messagebox.c in Sources */ = {isa = PBXBuildFile; fileRef = AA9E4092163BE51E007A2AD0 /* SDL_x11messagebox.c */; };
AA9FF95A1637CBF9000DF050 /* SDL_messagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AA9FF9591637CBF9000DF050 /* SDL_messagebox.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -644,7 +644,6 @@
DB313FB617554B71006C0E22 /* SDL_x11video.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD412E6671800899322 /* SDL_x11video.h */; };
DB313FB717554B71006C0E22 /* SDL_x11window.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD612E6671800899322 /* SDL_x11window.h */; };
DB313FB817554B71006C0E22 /* SDL_sysrender.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2C9F12FA0D680087D585 /* SDL_sysrender.h */; };
- DB313FB917554B71006C0E22 /* mmx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8D12FA97ED00FB9AA8 /* mmx.h */; };
DB313FBA17554B71006C0E22 /* SDL_yuv_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8F12FA97ED00FB9AA8 /* SDL_yuv_sw_c.h */; };
DB313FBB17554B71006C0E22 /* SDL_nullframebuffer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803712FB748500FC43C0 /* SDL_nullframebuffer_c.h */; };
DB313FBC17554B71006C0E22 /* SDL_blendfillrect.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803E12FB74A200FC43C0 /* SDL_blendfillrect.h */; };
@@ -801,7 +800,6 @@
DB31405617554B71006C0E22 /* SDL_x11video.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD312E6671800899322 /* SDL_x11video.c */; };
DB31405717554B71006C0E22 /* SDL_x11window.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD512E6671800899322 /* SDL_x11window.c */; };
DB31405817554B71006C0E22 /* SDL_render.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2C9E12FA0D680087D585 /* SDL_render.c */; };
- DB31405917554B71006C0E22 /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409B8E12FA97ED00FB9AA8 /* SDL_yuv_mmx.c */; };
DB31405A17554B71006C0E22 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409B9012FA97ED00FB9AA8 /* SDL_yuv_sw.c */; };
DB31405B17554B71006C0E22 /* SDL_nullframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803812FB748500FC43C0 /* SDL_nullframebuffer.c */; };
DB31405C17554B71006C0E22 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803D12FB74A200FC43C0 /* SDL_blendfillrect.c */; };
@@ -852,8 +850,6 @@
041B2C9F12FA0D680087D585 /* SDL_sysrender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysrender.h; sourceTree = ""; };
0435673C1303160F00BA5428 /* SDL_shaders_gl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_shaders_gl.c; sourceTree = ""; };
0435673D1303160F00BA5428 /* SDL_shaders_gl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shaders_gl.h; sourceTree = ""; };
- 04409B8D12FA97ED00FB9AA8 /* mmx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mmx.h; sourceTree = ""; };
- 04409B8E12FA97ED00FB9AA8 /* SDL_yuv_mmx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_mmx.c; sourceTree = ""; };
04409B8F12FA97ED00FB9AA8 /* SDL_yuv_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_yuv_sw_c.h; sourceTree = ""; };
04409B9012FA97ED00FB9AA8 /* SDL_yuv_sw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_sw.c; sourceTree = ""; };
0442EC1712FE1BBA004C9285 /* SDL_render_gl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render_gl.c; sourceTree = ""; };
@@ -1104,6 +1100,10 @@
AA7557F71595D4D800BBD41B /* SDL_version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_version.h; sourceTree = ""; };
AA7557F81595D4D800BBD41B /* SDL_video.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_video.h; sourceTree = ""; };
AA7557F91595D4D800BBD41B /* SDL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL.h; sourceTree = ""; };
+ AA9A7F0F1FB0206300FED37F /* yuv_rgb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb.h; sourceTree = ""; };
+ AA9A7F101FB0206300FED37F /* yuv_rgb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = yuv_rgb.c; sourceTree = ""; };
+ AA9A7F131FB0209C00FED37F /* SDL_yuv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv.c; sourceTree = ""; };
+ AA9A7F141FB0209C00FED37F /* SDL_yuv_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_yuv_c.h; sourceTree = ""; };
AA9E4092163BE51E007A2AD0 /* SDL_x11messagebox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11messagebox.c; sourceTree = ""; };
AA9FF9591637CBF9000DF050 /* SDL_messagebox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_messagebox.h; sourceTree = ""; };
AABCC38B164063D200AB8930 /* SDL_cocoamessagebox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoamessagebox.h; sourceTree = ""; };
@@ -1264,10 +1264,8 @@
children = (
041B2C9A12FA0D680087D585 /* opengl */,
041B2CA012FA0D680087D585 /* software */,
- 04409B8D12FA97ED00FB9AA8 /* mmx.h */,
041B2C9E12FA0D680087D585 /* SDL_render.c */,
041B2C9F12FA0D680087D585 /* SDL_sysrender.h */,
- 04409B8E12FA97ED00FB9AA8 /* SDL_yuv_mmx.c */,
04409B8F12FA97ED00FB9AA8 /* SDL_yuv_sw_c.h */,
04409B9012FA97ED00FB9AA8 /* SDL_yuv_sw.c */,
);
@@ -1568,8 +1566,7 @@
04BDFEC112E6671800899322 /* cocoa */,
04BDFEE712E6671800899322 /* dummy */,
04BDFFB712E6671800899322 /* x11 */,
- 04BDFF4E12E6671800899322 /* SDL_blit.c */,
- 04BDFF4F12E6671800899322 /* SDL_blit.h */,
+ AA9A7F0E1FB0200B00FED37F /* yuv2rgb */,
04BDFF5012E6671800899322 /* SDL_blit_0.c */,
04BDFF5112E6671800899322 /* SDL_blit_1.c */,
04BDFF5212E6671800899322 /* SDL_blit_A.c */,
@@ -1580,22 +1577,26 @@
04BDFF5712E6671800899322 /* SDL_blit_N.c */,
04BDFF5812E6671800899322 /* SDL_blit_slow.c */,
04BDFF5912E6671800899322 /* SDL_blit_slow.h */,
+ 04BDFF4E12E6671800899322 /* SDL_blit.c */,
+ 04BDFF4F12E6671800899322 /* SDL_blit.h */,
04BDFF5A12E6671800899322 /* SDL_bmp.c */,
04BDFF5B12E6671800899322 /* SDL_clipboard.c */,
04BDFF6012E6671800899322 /* SDL_fillrect.c */,
- 04BDFF6512E6671800899322 /* SDL_pixels.c */,
04BDFF6612E6671800899322 /* SDL_pixels_c.h */,
+ 04BDFF6512E6671800899322 /* SDL_pixels.c */,
04BDFF6712E6671800899322 /* SDL_rect.c */,
- 04BDFF6F12E6671800899322 /* SDL_RLEaccel.c */,
04BDFF7012E6671800899322 /* SDL_RLEaccel_c.h */,
- 04BDFF7112E6671800899322 /* SDL_shape.c */,
+ 04BDFF6F12E6671800899322 /* SDL_RLEaccel.c */,
04BDFF7212E6671800899322 /* SDL_shape_internals.h */,
+ 04BDFF7112E6671800899322 /* SDL_shape.c */,
04BDFF7312E6671800899322 /* SDL_stretch.c */,
04BDFF7412E6671800899322 /* SDL_surface.c */,
04BDFF7512E6671800899322 /* SDL_sysvideo.h */,
04BDFF7612E6671800899322 /* SDL_video.c */,
4D16644C1EDD6023003DE88E /* SDL_vulkan_internal.h */,
4D16644D1EDD6023003DE88E /* SDL_vulkan_utils.c */,
+ AA9A7F141FB0209C00FED37F /* SDL_yuv_c.h */,
+ AA9A7F131FB0209C00FED37F /* SDL_yuv.c */,
);
name = video;
path = ../../src/video;
@@ -1763,6 +1764,16 @@
name = dynapi;
sourceTree = "";
};
+ AA9A7F0E1FB0200B00FED37F /* yuv2rgb */ = {
+ isa = PBXGroup;
+ children = (
+ AA9A7F101FB0206300FED37F /* yuv_rgb.c */,
+ AA9A7F0F1FB0206300FED37F /* yuv_rgb.h */,
+ );
+ name = yuv2rgb;
+ path = ../../src/video/yuv2rgb;
+ sourceTree = SOURCE_ROOT;
+ };
BEC562FE0761C0E800A33029 /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
@@ -1882,6 +1893,7 @@
04BD004B12E6671800899322 /* SDL_events_c.h in Headers */,
04BD004D12E6671800899322 /* SDL_gesture_c.h in Headers */,
04BD004F12E6671800899322 /* SDL_keyboard_c.h in Headers */,
+ AA9A7F111FB0206400FED37F /* yuv_rgb.h in Headers */,
04BD005112E6671800899322 /* SDL_mouse_c.h in Headers */,
04BD005312E6671800899322 /* SDL_sysevents.h in Headers */,
04BD005512E6671800899322 /* SDL_touch_c.h in Headers */,
@@ -1937,7 +1949,7 @@
04BD01F712E6671800899322 /* SDL_x11video.h in Headers */,
04BD01F912E6671800899322 /* SDL_x11window.h in Headers */,
041B2CA612FA0D680087D585 /* SDL_sysrender.h in Headers */,
- 04409B9112FA97ED00FB9AA8 /* mmx.h in Headers */,
+ AA9A7F161FB0209D00FED37F /* SDL_yuv_c.h in Headers */,
04409B9312FA97ED00FB9AA8 /* SDL_yuv_sw_c.h in Headers */,
04F7803912FB748500FC43C0 /* SDL_nullframebuffer_c.h in Headers */,
04F7804A12FB74A200FC43C0 /* SDL_blendfillrect.h in Headers */,
@@ -2094,7 +2106,6 @@
AAC07100195606770073DCDF /* SDL_opengles2_gl2ext.h in Headers */,
04BD041112E6671800899322 /* SDL_x11window.h in Headers */,
041B2CAC12FA0D680087D585 /* SDL_sysrender.h in Headers */,
- 04409B9512FA97ED00FB9AA8 /* mmx.h in Headers */,
04409B9712FA97ED00FB9AA8 /* SDL_yuv_sw_c.h in Headers */,
04F7803B12FB748500FC43C0 /* SDL_nullframebuffer_c.h in Headers */,
04F7805612FB74A200FC43C0 /* SDL_blendfillrect.h in Headers */,
@@ -2249,7 +2260,6 @@
AAC07101195606770073DCDF /* SDL_opengles2_gl2ext.h in Headers */,
DB313FB717554B71006C0E22 /* SDL_x11window.h in Headers */,
DB313FB817554B71006C0E22 /* SDL_sysrender.h in Headers */,
- DB313FB917554B71006C0E22 /* mmx.h in Headers */,
DB313FBA17554B71006C0E22 /* SDL_yuv_sw_c.h in Headers */,
DB313FBB17554B71006C0E22 /* SDL_nullframebuffer_c.h in Headers */,
DB313FBC17554B71006C0E22 /* SDL_blendfillrect.h in Headers */,
@@ -2475,6 +2485,7 @@
04BD00F412E6671800899322 /* SDL_cocoaclipboard.m in Sources */,
04BD00F612E6671800899322 /* SDL_cocoaevents.m in Sources */,
04BD00F812E6671800899322 /* SDL_cocoakeyboard.m in Sources */,
+ AA9A7F151FB0209D00FED37F /* SDL_yuv.c in Sources */,
04BD00FA12E6671800899322 /* SDL_cocoamodes.m in Sources */,
4D16644F1EDD6023003DE88E /* SDL_vulkan_utils.c in Sources */,
04BD00FC12E6671800899322 /* SDL_cocoamouse.m in Sources */,
@@ -2487,6 +2498,7 @@
04BD017512E6671800899322 /* SDL_blit.c in Sources */,
04BD017712E6671800899322 /* SDL_blit_0.c in Sources */,
04BD017812E6671800899322 /* SDL_blit_1.c in Sources */,
+ AA9A7F121FB0206400FED37F /* yuv_rgb.c in Sources */,
04BD017912E6671800899322 /* SDL_blit_A.c in Sources */,
04BD017A12E6671800899322 /* SDL_blit_auto.c in Sources */,
04BD017C12E6671800899322 /* SDL_blit_copy.c in Sources */,
@@ -2516,7 +2528,6 @@
04BD01F612E6671800899322 /* SDL_x11video.c in Sources */,
04BD01F812E6671800899322 /* SDL_x11window.c in Sources */,
041B2CA512FA0D680087D585 /* SDL_render.c in Sources */,
- 04409B9212FA97ED00FB9AA8 /* SDL_yuv_mmx.c in Sources */,
04409B9412FA97ED00FB9AA8 /* SDL_yuv_sw.c in Sources */,
04F7803A12FB748500FC43C0 /* SDL_nullframebuffer.c in Sources */,
04F7804912FB74A200FC43C0 /* SDL_blendfillrect.c in Sources */,
@@ -2641,7 +2652,6 @@
04BD040E12E6671800899322 /* SDL_x11video.c in Sources */,
04BD041012E6671800899322 /* SDL_x11window.c in Sources */,
041B2CAB12FA0D680087D585 /* SDL_render.c in Sources */,
- 04409B9612FA97ED00FB9AA8 /* SDL_yuv_mmx.c in Sources */,
04409B9812FA97ED00FB9AA8 /* SDL_yuv_sw.c in Sources */,
04F7803C12FB748500FC43C0 /* SDL_nullframebuffer.c in Sources */,
04F7805512FB74A200FC43C0 /* SDL_blendfillrect.c in Sources */,
@@ -2764,7 +2774,6 @@
DB31405617554B71006C0E22 /* SDL_x11video.c in Sources */,
DB31405717554B71006C0E22 /* SDL_x11window.c in Sources */,
DB31405817554B71006C0E22 /* SDL_render.c in Sources */,
- DB31405917554B71006C0E22 /* SDL_yuv_mmx.c in Sources */,
DB31405A17554B71006C0E22 /* SDL_yuv_sw.c in Sources */,
DB31405B17554B71006C0E22 /* SDL_nullframebuffer.c in Sources */,
DB31405C17554B71006C0E22 /* SDL_blendfillrect.c in Sources */,
diff --git a/configure b/configure
index b233aca8e..743cd0552 100755
--- a/configure
+++ b/configure
@@ -16874,6 +16874,7 @@ SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
SOURCES="$SOURCES $srcdir/src/thread/*.c"
SOURCES="$SOURCES $srcdir/src/timer/*.c"
SOURCES="$SOURCES $srcdir/src/video/*.c"
+SOURCES="$SOURCES $srcdir/src/video/yuv2rgb/*.c"
# Check whether --enable-atomic was given.
diff --git a/configure.in b/configure.in
index f8b556eb6..e55d02e3e 100644
--- a/configure.in
+++ b/configure.in
@@ -343,6 +343,7 @@ SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
SOURCES="$SOURCES $srcdir/src/thread/*.c"
SOURCES="$SOURCES $srcdir/src/timer/*.c"
SOURCES="$SOURCES $srcdir/src/video/*.c"
+SOURCES="$SOURCES $srcdir/src/video/yuv2rgb/*.c"
dnl Enable/disable various subsystems of the SDL library
diff --git a/include/SDL_surface.h b/include/SDL_surface.h
index 510690c9c..ab9ba1197 100644
--- a/include/SDL_surface.h
+++ b/include/SDL_surface.h
@@ -97,6 +97,17 @@ typedef struct SDL_Surface
typedef int (SDLCALL *SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
struct SDL_Surface * dst, SDL_Rect * dstrect);
+/**
+ * \brief The formula used for converting between YUV and RGB
+ */
+typedef enum
+{
+ SDL_YUV_CONVERSION_JPEG, /**< Full range JPEG */
+ SDL_YUV_CONVERSION_BT601, /**< BT.601 (the default) */
+ SDL_YUV_CONVERSION_BT709, /**< BT.709 */
+ SDL_YUV_CONVERSION_AUTOMATIC /**< BT.601 for SD content, BT.709 for HD content */
+} SDL_YUV_CONVERSION_MODE;
+
/**
* Allocate and free an RGB surface.
*
@@ -509,6 +520,20 @@ extern DECLSPEC int SDLCALL SDL_LowerBlitScaled
(SDL_Surface * src, SDL_Rect * srcrect,
SDL_Surface * dst, SDL_Rect * dstrect);
+/**
+ * \brief Set the YUV conversion mode
+ */
+extern DECLSPEC void SDLCALL SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode);
+
+/**
+ * \brief Get the YUV conversion mode
+ */
+extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionMode(void);
+
+/**
+ * \brief Get the YUV conversion mode, returning the correct mode for the resolution when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC
+ */
+extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionModeForResolution(int width, int height);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h
index 5f2c0a428..cf61acf9b 100644
--- a/src/dynapi/SDL_dynapi_overrides.h
+++ b/src/dynapi/SDL_dynapi_overrides.h
@@ -660,3 +660,6 @@
#define SDL_scalbnf SDL_scalbnf_REAL
#define SDL_fmod SDL_fmod_REAL
#define SDL_fmodf SDL_fmodf_REAL
+#define SDL_SetYUVConversionMode SDL_SetYUVConversionMode_REAL
+#define SDL_GetYUVConversionMode SDL_GetYUVConversionMode_REAL
+#define SDL_GetYUVConversionModeForResolution SDL_GetYUVConversionModeForResolution_REAL
diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h
index 01b4da198..de2d48807 100644
--- a/src/dynapi/SDL_dynapi_procs.h
+++ b/src/dynapi/SDL_dynapi_procs.h
@@ -694,3 +694,6 @@ SDL_DYNAPI_PROC(float,SDL_powf,(float a, float b),(a,b),return)
SDL_DYNAPI_PROC(float,SDL_scalbnf,(float a, int b),(a,b),return)
SDL_DYNAPI_PROC(double,SDL_fmod,(double a, double b),(a,b),return)
SDL_DYNAPI_PROC(float,SDL_fmodf,(float a, float b),(a,b),return)
+SDL_DYNAPI_PROC(void,SDL_SetYUVConversionMode,(SDL_YUV_CONVERSION_MODE a),(a),)
+SDL_DYNAPI_PROC(SDL_YUV_CONVERSION_MODE,SDL_GetYUVConversionMode,(void),(),return)
+SDL_DYNAPI_PROC(SDL_YUV_CONVERSION_MODE,SDL_GetYUVConversionModeForResolution,(int a, int b),(a,b),return)
diff --git a/src/render/SDL_yuv_mmx.c b/src/render/SDL_yuv_mmx.c
deleted file mode 100644
index 90da9f9b9..000000000
--- a/src/render/SDL_yuv_mmx.c
+++ /dev/null
@@ -1,409 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2017 Sam Lantinga
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../SDL_internal.h"
-
-#include "SDL_yuv_mmx_c.h"
-
-#ifdef USE_MMX_ASSEMBLY
-
-#include "SDL_stdinc.h"
-
-#include "mmx.h"
-
-/* *INDENT-OFF* */
-
-static mmx_t MMX_0080w = { .ud = {0x00800080, 0x00800080} };
-static mmx_t MMX_00FFw = { .ud = {0x00ff00ff, 0x00ff00ff} };
-static mmx_t MMX_FF00w = { .ud = {0xff00ff00, 0xff00ff00} };
-
-static mmx_t MMX_Ycoeff = { .uw = {0x004a, 0x004a, 0x004a, 0x004a} };
-
-static mmx_t MMX_UbluRGB = { .uw = {0x0072, 0x0072, 0x0072, 0x0072} };
-static mmx_t MMX_VredRGB = { .uw = {0x0059, 0x0059, 0x0059, 0x0059} };
-static mmx_t MMX_UgrnRGB = { .uw = {0xffea, 0xffea, 0xffea, 0xffea} };
-static mmx_t MMX_VgrnRGB = { .uw = {0xffd2, 0xffd2, 0xffd2, 0xffd2} };
-
-static mmx_t MMX_Ublu5x5 = { .uw = {0x0081, 0x0081, 0x0081, 0x0081} };
-static mmx_t MMX_Vred5x5 = { .uw = {0x0066, 0x0066, 0x0066, 0x0066} };
-static mmx_t MMX_Ugrn565 = { .uw = {0xffe8, 0xffe8, 0xffe8, 0xffe8} };
-static mmx_t MMX_Vgrn565 = { .uw = {0xffcd, 0xffcd, 0xffcd, 0xffcd} };
-
-static mmx_t MMX_red565 = { .uw = {0xf800, 0xf800, 0xf800, 0xf800} };
-static mmx_t MMX_grn565 = { .uw = {0x07e0, 0x07e0, 0x07e0, 0x07e0} };
-
-/**
- This MMX assembler is my first assembler/MMX program ever.
- Thus it maybe buggy.
- Send patches to:
- mvogt@rhrk.uni-kl.de
-
- After it worked fine I have "obfuscated" the code a bit to have
- more parallism in the MMX units. This means I moved
- initilisation around and delayed other instruction.
- Performance measurement did not show that this brought any advantage
- but in theory it _should_ be faster this way.
-
- The overall performanve gain to the C based dither was 30%-40%.
- The MMX routine calculates 256bit=8RGB values in each cycle
- (4 for row1 & 4 for row2)
-
- The red/green/blue.. coefficents are taken from the mpeg_play
- player. They look nice, but I dont know if you can have
- better values, to avoid integer rounding errors.
-
-
- IMPORTANT:
- ==========
-
- It is a requirement that the cr/cb/lum are 8 byte aligned and
- the out are 16byte aligned or you will/may get segfaults
-
-*/
-
-void ColorRGBDitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod )
-{
- Uint32 *row1;
- Uint32 *row2;
-
- unsigned char* y = lum +cols*rows; /* Pointer to the end */
- int x = 0;
- row1 = (Uint32 *)out; /* 32 bit target */
- row2 = (Uint32 *)out+cols+mod; /* start of second row */
- mod = (mod+cols+mod)*4; /* increment for row1 in byte */
-
- __asm__ __volatile__ (
- ".align 8\n"
- "1:\n"
-
- /* create Cr (result in mm1) */
- "movd (%0),%%mm1\n" /* 0 0 0 0 v3 v2 v1 v0 */
- "pxor %%mm7,%%mm7\n" /* 00 00 00 00 00 00 00 00 */
- "movd (%2), %%mm2\n" /* 0 0 0 0 l3 l2 l1 l0 */
- "punpcklbw %%mm7,%%mm1\n" /* 0 v3 0 v2 00 v1 00 v0 */
- "punpckldq %%mm1,%%mm1\n" /* 00 v1 00 v0 00 v1 00 v0 */
- "psubw %9,%%mm1\n" /* mm1-128:r1 r1 r0 r0 r1 r1 r0 r0 */
-
- /* create Cr_g (result in mm0) */
- "movq %%mm1,%%mm0\n" /* r1 r1 r0 r0 r1 r1 r0 r0 */
- "pmullw %10,%%mm0\n" /* red*-46dec=0.7136*64 */
- "pmullw %11,%%mm1\n" /* red*89dec=1.4013*64 */
- "psraw $6, %%mm0\n" /* red=red/64 */
- "psraw $6, %%mm1\n" /* red=red/64 */
-
- /* create L1 L2 (result in mm2,mm4) */
- /* L2=lum+cols */
- "movq (%2,%4),%%mm3\n" /* 0 0 0 0 L3 L2 L1 L0 */
- "punpckldq %%mm3,%%mm2\n" /* L3 L2 L1 L0 l3 l2 l1 l0 */
- "movq %%mm2,%%mm4\n" /* L3 L2 L1 L0 l3 l2 l1 l0 */
- "pand %12,%%mm2\n" /* L3 0 L1 0 l3 0 l1 0 */
- "pand %13,%%mm4\n" /* 0 L2 0 L0 0 l2 0 l0 */
- "psrlw $8,%%mm2\n" /* 0 L3 0 L1 0 l3 0 l1 */
-
- /* create R (result in mm6) */
- "movq %%mm2,%%mm5\n" /* 0 L3 0 L1 0 l3 0 l1 */
- "movq %%mm4,%%mm6\n" /* 0 L2 0 L0 0 l2 0 l0 */
- "paddsw %%mm1, %%mm5\n" /* lum1+red:x R3 x R1 x r3 x r1 */
- "paddsw %%mm1, %%mm6\n" /* lum1+red:x R2 x R0 x r2 x r0 */
- "packuswb %%mm5,%%mm5\n" /* R3 R1 r3 r1 R3 R1 r3 r1 */
- "packuswb %%mm6,%%mm6\n" /* R2 R0 r2 r0 R2 R0 r2 r0 */
- "pxor %%mm7,%%mm7\n" /* 00 00 00 00 00 00 00 00 */
- "punpcklbw %%mm5,%%mm6\n" /* R3 R2 R1 R0 r3 r2 r1 r0 */
-
- /* create Cb (result in mm1) */
- "movd (%1), %%mm1\n" /* 0 0 0 0 u3 u2 u1 u0 */
- "punpcklbw %%mm7,%%mm1\n" /* 0 u3 0 u2 00 u1 00 u0 */
- "punpckldq %%mm1,%%mm1\n" /* 00 u1 00 u0 00 u1 00 u0 */
- "psubw %9,%%mm1\n" /* mm1-128:u1 u1 u0 u0 u1 u1 u0 u0 */
-
- /* create Cb_g (result in mm5) */
- "movq %%mm1,%%mm5\n" /* u1 u1 u0 u0 u1 u1 u0 u0 */
- "pmullw %14,%%mm5\n" /* blue*-109dec=1.7129*64 */
- "pmullw %15,%%mm1\n" /* blue*114dec=1.78125*64 */
- "psraw $6, %%mm5\n" /* blue=red/64 */
- "psraw $6, %%mm1\n" /* blue=blue/64 */
-
- /* create G (result in mm7) */
- "movq %%mm2,%%mm3\n" /* 0 L3 0 L1 0 l3 0 l1 */
- "movq %%mm4,%%mm7\n" /* 0 L2 0 L0 0 l2 0 l1 */
- "paddsw %%mm5, %%mm3\n" /* lum1+Cb_g:x G3t x G1t x g3t x g1t */
- "paddsw %%mm5, %%mm7\n" /* lum1+Cb_g:x G2t x G0t x g2t x g0t */
- "paddsw %%mm0, %%mm3\n" /* lum1+Cr_g:x G3 x G1 x g3 x g1 */
- "paddsw %%mm0, %%mm7\n" /* lum1+blue:x G2 x G0 x g2 x g0 */
- "packuswb %%mm3,%%mm3\n" /* G3 G1 g3 g1 G3 G1 g3 g1 */
- "packuswb %%mm7,%%mm7\n" /* G2 G0 g2 g0 G2 G0 g2 g0 */
- "punpcklbw %%mm3,%%mm7\n" /* G3 G2 G1 G0 g3 g2 g1 g0 */
-
- /* create B (result in mm5) */
- "movq %%mm2,%%mm3\n" /* 0 L3 0 L1 0 l3 0 l1 */
- "movq %%mm4,%%mm5\n" /* 0 L2 0 L0 0 l2 0 l1 */
- "paddsw %%mm1, %%mm3\n" /* lum1+blue:x B3 x B1 x b3 x b1 */
- "paddsw %%mm1, %%mm5\n" /* lum1+blue:x B2 x B0 x b2 x b0 */
- "packuswb %%mm3,%%mm3\n" /* B3 B1 b3 b1 B3 B1 b3 b1 */
- "packuswb %%mm5,%%mm5\n" /* B2 B0 b2 b0 B2 B0 b2 b0 */
- "punpcklbw %%mm3,%%mm5\n" /* B3 B2 B1 B0 b3 b2 b1 b0 */
-
- /* fill destination row1 (needed are mm6=Rr,mm7=Gg,mm5=Bb) */
-
- "pxor %%mm2,%%mm2\n" /* 0 0 0 0 0 0 0 0 */
- "pxor %%mm4,%%mm4\n" /* 0 0 0 0 0 0 0 0 */
- "movq %%mm6,%%mm1\n" /* R3 R2 R1 R0 r3 r2 r1 r0 */
- "movq %%mm5,%%mm3\n" /* B3 B2 B1 B0 b3 b2 b1 b0 */
-
- /* process lower lum */
- "punpcklbw %%mm4,%%mm1\n" /* 0 r3 0 r2 0 r1 0 r0 */
- "punpcklbw %%mm4,%%mm3\n" /* 0 b3 0 b2 0 b1 0 b0 */
- "movq %%mm1,%%mm2\n" /* 0 r3 0 r2 0 r1 0 r0 */
- "movq %%mm3,%%mm0\n" /* 0 b3 0 b2 0 b1 0 b0 */
- "punpcklwd %%mm1,%%mm3\n" /* 0 r1 0 b1 0 r0 0 b0 */
- "punpckhwd %%mm2,%%mm0\n" /* 0 r3 0 b3 0 r2 0 b2 */
-
- "pxor %%mm2,%%mm2\n" /* 0 0 0 0 0 0 0 0 */
- "movq %%mm7,%%mm1\n" /* G3 G2 G1 G0 g3 g2 g1 g0 */
- "punpcklbw %%mm1,%%mm2\n" /* g3 0 g2 0 g1 0 g0 0 */
- "punpcklwd %%mm4,%%mm2\n" /* 0 0 g1 0 0 0 g0 0 */
- "por %%mm3, %%mm2\n" /* 0 r1 g1 b1 0 r0 g0 b0 */
- "movq %%mm2,(%3)\n" /* wrote out ! row1 */
-
- "pxor %%mm2,%%mm2\n" /* 0 0 0 0 0 0 0 0 */
- "punpcklbw %%mm1,%%mm4\n" /* g3 0 g2 0 g1 0 g0 0 */
- "punpckhwd %%mm2,%%mm4\n" /* 0 0 g3 0 0 0 g2 0 */
- "por %%mm0, %%mm4\n" /* 0 r3 g3 b3 0 r2 g2 b2 */
- "movq %%mm4,8(%3)\n" /* wrote out ! row1 */
-
- /* fill destination row2 (needed are mm6=Rr,mm7=Gg,mm5=Bb) */
- /* this can be done "destructive" */
- "pxor %%mm2,%%mm2\n" /* 0 0 0 0 0 0 0 0 */
- "punpckhbw %%mm2,%%mm6\n" /* 0 R3 0 R2 0 R1 0 R0 */
- "punpckhbw %%mm1,%%mm5\n" /* G3 B3 G2 B2 G1 B1 G0 B0 */
- "movq %%mm5,%%mm1\n" /* G3 B3 G2 B2 G1 B1 G0 B0 */
- "punpcklwd %%mm6,%%mm1\n" /* 0 R1 G1 B1 0 R0 G0 B0 */
- "movq %%mm1,(%5)\n" /* wrote out ! row2 */
- "punpckhwd %%mm6,%%mm5\n" /* 0 R3 G3 B3 0 R2 G2 B2 */
- "movq %%mm5,8(%5)\n" /* wrote out ! row2 */
-
- "addl $4,%2\n" /* lum+4 */
- "leal 16(%3),%3\n" /* row1+16 */
- "leal 16(%5),%5\n" /* row2+16 */
- "addl $2,%0\n" /* cr+2 */
- "addl $2,%1\n" /* cb+2 */
-
- "addl $4,%6\n" /* x+4 */
- "cmpl %4,%6\n"
-
- "jl 1b\n"
- "addl %4,%2\n" /* lum += cols */
- "addl %8,%3\n" /* row1+= mod */
- "addl %8,%5\n" /* row2+= mod */
- "movl $0,%6\n" /* x=0 */
- "cmpl %7,%2\n"
- "jl 1b\n"
-
- "emms\n" /* reset MMX registers. */
- :
- : "r" (cr), "r"(cb),"r"(lum),
- "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
- "m"(MMX_0080w),"m"(MMX_VgrnRGB),"m"(MMX_VredRGB),
- "m"(MMX_FF00w),"m"(MMX_00FFw),"m"(MMX_UgrnRGB),
- "m"(MMX_UbluRGB)
- );
-}
-
-void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod )
-{
- Uint16 *row1;
- Uint16 *row2;
-
- unsigned char* y = lum +cols*rows; /* Pointer to the end */
- int x = 0;
- row1 = (Uint16 *)out; /* 16 bit target */
- row2 = (Uint16 *)out+cols+mod; /* start of second row */
- mod = (mod+cols+mod)*2; /* increment for row1 in byte */
-
- __asm__ __volatile__(
- ".align 8\n"
- "1:\n"
-
- "movd (%1), %%mm0\n" /* 4 Cb 0 0 0 0 u3 u2 u1 u0 */
- "pxor %%mm7, %%mm7\n"
- "movd (%0), %%mm1\n" /* 4 Cr 0 0 0 0 v3 v2 v1 v0 */
-
- "punpcklbw %%mm7, %%mm0\n" /* 4 W cb 0 u3 0 u2 0 u1 0 u0 */
- "punpcklbw %%mm7, %%mm1\n" /* 4 W cr 0 v3 0 v2 0 v1 0 v0 */
- "psubw %9, %%mm0\n"
- "psubw %9, %%mm1\n"
- "movq %%mm0, %%mm2\n" /* Cb 0 u3 0 u2 0 u1 0 u0 */
- "movq %%mm1, %%mm3\n" /* Cr */
- "pmullw %10, %%mm2\n" /* Cb2green 0 R3 0 R2 0 R1 0 R0 */
- "movq (%2), %%mm6\n" /* L1 l7 L6 L5 L4 L3 L2 L1 L0 */
- "pmullw %11, %%mm0\n" /* Cb2blue */
- "pand %12, %%mm6\n" /* L1 00 L6 00 L4 00 L2 00 L0 */
- "pmullw %13, %%mm3\n" /* Cr2green */
- "movq (%2), %%mm7\n" /* L2 */
- "pmullw %14, %%mm1\n" /* Cr2red */
- "psrlw $8, %%mm7\n" /* L2 00 L7 00 L5 00 L3 00 L1 */
- "pmullw %15, %%mm6\n" /* lum1 */
- "paddw %%mm3, %%mm2\n" /* Cb2green + Cr2green == green */
- "pmullw %15, %%mm7\n" /* lum2 */
-
- "movq %%mm6, %%mm4\n" /* lum1 */
- "paddw %%mm0, %%mm6\n" /* lum1 +blue 00 B6 00 B4 00 B2 00 B0 */
- "movq %%mm4, %%mm5\n" /* lum1 */
- "paddw %%mm1, %%mm4\n" /* lum1 +red 00 R6 00 R4 00 R2 00 R0 */
- "paddw %%mm2, %%mm5\n" /* lum1 +green 00 G6 00 G4 00 G2 00 G0 */
- "psraw $6, %%mm4\n" /* R1 0 .. 64 */
- "movq %%mm7, %%mm3\n" /* lum2 00 L7 00 L5 00 L3 00 L1 */
- "psraw $6, %%mm5\n" /* G1 - .. + */
- "paddw %%mm0, %%mm7\n" /* Lum2 +blue 00 B7 00 B5 00 B3 00 B1 */
- "psraw $6, %%mm6\n" /* B1 0 .. 64 */
- "packuswb %%mm4, %%mm4\n" /* R1 R1 */
- "packuswb %%mm5, %%mm5\n" /* G1 G1 */
- "packuswb %%mm6, %%mm6\n" /* B1 B1 */
- "punpcklbw %%mm4, %%mm4\n"
- "punpcklbw %%mm5, %%mm5\n"
-
- "pand %16, %%mm4\n"
- "psllw $3, %%mm5\n" /* GREEN 1 */
- "punpcklbw %%mm6, %%mm6\n"
- "pand %17, %%mm5\n"
- "pand %16, %%mm6\n"
- "por %%mm5, %%mm4\n" /* */
- "psrlw $11, %%mm6\n" /* BLUE 1 */
- "movq %%mm3, %%mm5\n" /* lum2 */
- "paddw %%mm1, %%mm3\n" /* lum2 +red 00 R7 00 R5 00 R3 00 R1 */
- "paddw %%mm2, %%mm5\n" /* lum2 +green 00 G7 00 G5 00 G3 00 G1 */
- "psraw $6, %%mm3\n" /* R2 */
- "por %%mm6, %%mm4\n" /* MM4 */
- "psraw $6, %%mm5\n" /* G2 */
- "movq (%2, %4), %%mm6\n" /* L3 load lum2 */
- "psraw $6, %%mm7\n"
- "packuswb %%mm3, %%mm3\n"
- "packuswb %%mm5, %%mm5\n"
- "packuswb %%mm7, %%mm7\n"
- "pand %12, %%mm6\n" /* L3 */
- "punpcklbw %%mm3, %%mm3\n"
- "punpcklbw %%mm5, %%mm5\n"
- "pmullw %15, %%mm6\n" /* lum3 */
- "punpcklbw %%mm7, %%mm7\n"
- "psllw $3, %%mm5\n" /* GREEN 2 */
- "pand %16, %%mm7\n"
- "pand %16, %%mm3\n"
- "psrlw $11, %%mm7\n" /* BLUE 2 */
- "pand %17, %%mm5\n"
- "por %%mm7, %%mm3\n"
- "movq (%2,%4), %%mm7\n" /* L4 load lum2 */
- "por %%mm5, %%mm3\n"
- "psrlw $8, %%mm7\n" /* L4 */
- "movq %%mm4, %%mm5\n"
- "punpcklwd %%mm3, %%mm4\n"
- "pmullw %15, %%mm7\n" /* lum4 */
- "punpckhwd %%mm3, %%mm5\n"
-
- "movq %%mm4, (%3)\n" /* write row1 */
- "movq %%mm5, 8(%3)\n" /* write row1 */
-
- "movq %%mm6, %%mm4\n" /* Lum3 */
- "paddw %%mm0, %%mm6\n" /* Lum3 +blue */
-
- "movq %%mm4, %%mm5\n" /* Lum3 */
- "paddw %%mm1, %%mm4\n" /* Lum3 +red */
- "paddw %%mm2, %%mm5\n" /* Lum3 +green */
- "psraw $6, %%mm4\n"
- "movq %%mm7, %%mm3\n" /* Lum4 */
- "psraw $6, %%mm5\n"
- "paddw %%mm0, %%mm7\n" /* Lum4 +blue */
- "psraw $6, %%mm6\n" /* Lum3 +blue */
- "movq %%mm3, %%mm0\n" /* Lum4 */
- "packuswb %%mm4, %%mm4\n"
- "paddw %%mm1, %%mm3\n" /* Lum4 +red */
- "packuswb %%mm5, %%mm5\n"
- "paddw %%mm2, %%mm0\n" /* Lum4 +green */
- "packuswb %%mm6, %%mm6\n"
- "punpcklbw %%mm4, %%mm4\n"
- "punpcklbw %%mm5, %%mm5\n"
- "punpcklbw %%mm6, %%mm6\n"
- "psllw $3, %%mm5\n" /* GREEN 3 */
- "pand %16, %%mm4\n"
- "psraw $6, %%mm3\n" /* psr 6 */
- "psraw $6, %%mm0\n"
- "pand %16, %%mm6\n" /* BLUE */
- "pand %17, %%mm5\n"
- "psrlw $11, %%mm6\n" /* BLUE 3 */
- "por %%mm5, %%mm4\n"
- "psraw $6, %%mm7\n"
- "por %%mm6, %%mm4\n"
- "packuswb %%mm3, %%mm3\n"
- "packuswb %%mm0, %%mm0\n"
- "packuswb %%mm7, %%mm7\n"
- "punpcklbw %%mm3, %%mm3\n"
- "punpcklbw %%mm0, %%mm0\n"
- "punpcklbw %%mm7, %%mm7\n"
- "pand %16, %%mm3\n"
- "pand %16, %%mm7\n" /* BLUE */
- "psllw $3, %%mm0\n" /* GREEN 4 */
- "psrlw $11, %%mm7\n"
- "pand %17, %%mm0\n"
- "por %%mm7, %%mm3\n"
- "por %%mm0, %%mm3\n"
-
- "movq %%mm4, %%mm5\n"
-
- "punpcklwd %%mm3, %%mm4\n"
- "punpckhwd %%mm3, %%mm5\n"
-
- "movq %%mm4, (%5)\n"
- "movq %%mm5, 8(%5)\n"
-
- "addl $8, %6\n"
- "addl $8, %2\n"
- "addl $4, %0\n"
- "addl $4, %1\n"
- "cmpl %4, %6\n"
- "leal 16(%3), %3\n"
- "leal 16(%5),%5\n" /* row2+16 */
-
- "jl 1b\n"
- "addl %4, %2\n" /* lum += cols */
- "addl %8, %3\n" /* row1+= mod */
- "addl %8, %5\n" /* row2+= mod */
- "movl $0, %6\n" /* x=0 */
- "cmpl %7, %2\n"
- "jl 1b\n"
- "emms\n"
- :
- : "r" (cr), "r"(cb),"r"(lum),
- "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
- "m"(MMX_0080w),"m"(MMX_Ugrn565),"m"(MMX_Ublu5x5),
- "m"(MMX_00FFw),"m"(MMX_Vgrn565),"m"(MMX_Vred5x5),
- "m"(MMX_Ycoeff),"m"(MMX_red565),"m"(MMX_grn565)
- );
-}
-
-/* *INDENT-ON* */
-
-#endif /* USE_MMX_ASSEMBLY */
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/render/SDL_yuv_sw.c b/src/render/SDL_yuv_sw.c
index 49fce6db2..0ca9c969e 100644
--- a/src/render/SDL_yuv_sw.c
+++ b/src/render/SDL_yuv_sw.c
@@ -22,1058 +22,15 @@
/* This is the software implementation of the YUV texture support */
-/* This code was derived from code carrying the following copyright notices:
-
- * Copyright (c) 1995 The Regents of the University of California.
- * All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose, without fee, and without written agreement is
- * hereby granted, provided that the above copyright notice and the following
- * two paragraphs appear in all copies of this software.
- *
- * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
- * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
- * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
- * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
- * Copyright (c) 1995 Erik Corry
- * All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose, without fee, and without written agreement is
- * hereby granted, provided that the above copyright notice and the following
- * two paragraphs appear in all copies of this software.
- *
- * IN NO EVENT SHALL ERIK CORRY BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
- * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
- * THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ERIK CORRY HAS BEEN ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ERIK CORRY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
- * BASIS, AND ERIK CORRY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
- * UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
- * Portions of this software Copyright (c) 1995 Brown University.
- * All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose, without fee, and without written agreement
- * is hereby granted, provided that the above copyright notice and the
- * following two paragraphs appear in all copies of this software.
- *
- * IN NO EVENT SHALL BROWN UNIVERSITY BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
- * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF BROWN
- * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * BROWN UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
- * BASIS, AND BROWN UNIVERSITY HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
- * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- */
-
#include "SDL_assert.h"
-#include "SDL_video.h"
-#include "SDL_cpuinfo.h"
+
#include "SDL_yuv_sw_c.h"
-#include "SDL_yuv_mmx_c.h"
-/* The colorspace conversion functions */
-
-#ifdef USE_MMX_ASSEMBLY
-extern void Color565DitherYV12MMX1X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod);
-extern void ColorRGBDitherYV12MMX1X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod);
-#endif
-
-static void
-Color16DitherYV12Mod1X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned short *row1;
- unsigned short *row2;
- unsigned char *lum2;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- row1 = (unsigned short *) out;
- row2 = row1 + cols + mod;
- lum2 = lum + cols;
-
- mod += cols + mod;
-
- y = rows / 2;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- ++cr;
- ++cb;
-
- L = *lum++;
- *row1++ = (unsigned short) (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
-
- L = *lum++;
- *row1++ = (unsigned short) (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
-
-
- /* Now, do second row. */
-
- L = *lum2++;
- *row2++ = (unsigned short) (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
-
- L = *lum2++;
- *row2++ = (unsigned short) (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
- }
-
- /*
- * These values are at the start of the next line, (due
- * to the ++'s above),but they need to be at the start
- * of the line after that.
- */
- lum += cols;
- lum2 += cols;
- row1 += mod;
- row2 += mod;
- }
-}
-
-static void
-Color24DitherYV12Mod1X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int value;
- unsigned char *row1;
- unsigned char *row2;
- unsigned char *lum2;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- row1 = out;
- row2 = row1 + cols * 3 + mod * 3;
- lum2 = lum + cols;
-
- mod += cols + mod;
- mod *= 3;
-
- y = rows / 2;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- ++cr;
- ++cb;
-
- L = *lum++;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- *row1++ = (value) & 0xFF;
- *row1++ = (value >> 8) & 0xFF;
- *row1++ = (value >> 16) & 0xFF;
-
- L = *lum++;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- *row1++ = (value) & 0xFF;
- *row1++ = (value >> 8) & 0xFF;
- *row1++ = (value >> 16) & 0xFF;
-
-
- /* Now, do second row. */
-
- L = *lum2++;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- *row2++ = (value) & 0xFF;
- *row2++ = (value >> 8) & 0xFF;
- *row2++ = (value >> 16) & 0xFF;
-
- L = *lum2++;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- *row2++ = (value) & 0xFF;
- *row2++ = (value >> 8) & 0xFF;
- *row2++ = (value >> 16) & 0xFF;
- }
-
- /*
- * These values are at the start of the next line, (due
- * to the ++'s above),but they need to be at the start
- * of the line after that.
- */
- lum += cols;
- lum2 += cols;
- row1 += mod;
- row2 += mod;
- }
-}
-
-static void
-Color32DitherYV12Mod1X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int *row1;
- unsigned int *row2;
- unsigned char *lum2;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = (cols + 1) / 2;
- /* not even dimensions */
- int skip_last_col = 0;
- int skip_last_row = 0;
-
- if ( (cols & 0x1) ) {
- skip_last_col = 1;
- }
-
- if ( (rows & 0x1) ) {
- skip_last_row = 1;
- }
-
- row1 = (unsigned int *) out;
- row2 = row1 + cols + mod;
- lum2 = lum + cols;
-
- mod += cols + mod;
-
- y = (rows + 1) / 2;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- ++cr;
- ++cb;
-
- L = *lum++;
- *row1++ = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-
- if (!(x == 0 && skip_last_col)) {
- L = *lum++;
- *row1++ = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- } /* skip col */
-
-
- if (!(y == 0 && skip_last_row)) {
-
- /* Now, do second row. */
-
- L = *lum2++;
- *row2++ = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-
- if (!(x == 1 && skip_last_col)) {
- L = *lum2++;
- *row2++ = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- } /* skip col */
- } /* skip row */
- }
-
- /*
- * These values are at the start of the next line, (due
- * to the ++'s above),but they need to be at the start
- * of the line after that.
- */
- lum += cols;
- lum2 += cols;
- row1 += mod;
- row2 += mod;
- }
-}
-
-/*
- * In this function I make use of a nasty trick. The tables have the lower
- * 16 bits replicated in the upper 16. This means I can write ints and get
- * the horisontal doubling for free (almost).
- */
-static void
-Color16DitherYV12Mod2X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int *row1 = (unsigned int *) out;
- const int next_row = cols + (mod / 2);
- unsigned int *row2 = row1 + 2 * next_row;
- unsigned char *lum2;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- lum2 = lum + cols;
-
- mod = (next_row * 3) + (mod / 2);
-
- y = rows / 2;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- ++cr;
- ++cb;
-
- L = *lum++;
- row1[0] = row1[next_row] = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
- row1++;
-
- L = *lum++;
- row1[0] = row1[next_row] = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
- row1++;
-
-
- /* Now, do second row. */
-
- L = *lum2++;
- row2[0] = row2[next_row] = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
- row2++;
-
- L = *lum2++;
- row2[0] = row2[next_row] = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
- row2++;
- }
-
- /*
- * These values are at the start of the next line, (due
- * to the ++'s above),but they need to be at the start
- * of the line after that.
- */
- lum += cols;
- lum2 += cols;
- row1 += mod;
- row2 += mod;
- }
-}
-
-static void
-Color24DitherYV12Mod2X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int value;
- unsigned char *row1 = out;
- const int next_row = (cols * 2 + mod) * 3;
- unsigned char *row2 = row1 + 2 * next_row;
- unsigned char *lum2;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- lum2 = lum + cols;
-
- mod = next_row * 3 + mod * 3;
-
- y = rows / 2;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- ++cr;
- ++cb;
-
- L = *lum++;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row1[0 + 0] = row1[3 + 0] = row1[next_row + 0] =
- row1[next_row + 3 + 0] = (value) & 0xFF;
- row1[0 + 1] = row1[3 + 1] = row1[next_row + 1] =
- row1[next_row + 3 + 1] = (value >> 8) & 0xFF;
- row1[0 + 2] = row1[3 + 2] = row1[next_row + 2] =
- row1[next_row + 3 + 2] = (value >> 16) & 0xFF;
- row1 += 2 * 3;
-
- L = *lum++;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row1[0 + 0] = row1[3 + 0] = row1[next_row + 0] =
- row1[next_row + 3 + 0] = (value) & 0xFF;
- row1[0 + 1] = row1[3 + 1] = row1[next_row + 1] =
- row1[next_row + 3 + 1] = (value >> 8) & 0xFF;
- row1[0 + 2] = row1[3 + 2] = row1[next_row + 2] =
- row1[next_row + 3 + 2] = (value >> 16) & 0xFF;
- row1 += 2 * 3;
-
-
- /* Now, do second row. */
-
- L = *lum2++;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row2[0 + 0] = row2[3 + 0] = row2[next_row + 0] =
- row2[next_row + 3 + 0] = (value) & 0xFF;
- row2[0 + 1] = row2[3 + 1] = row2[next_row + 1] =
- row2[next_row + 3 + 1] = (value >> 8) & 0xFF;
- row2[0 + 2] = row2[3 + 2] = row2[next_row + 2] =
- row2[next_row + 3 + 2] = (value >> 16) & 0xFF;
- row2 += 2 * 3;
-
- L = *lum2++;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row2[0 + 0] = row2[3 + 0] = row2[next_row + 0] =
- row2[next_row + 3 + 0] = (value) & 0xFF;
- row2[0 + 1] = row2[3 + 1] = row2[next_row + 1] =
- row2[next_row + 3 + 1] = (value >> 8) & 0xFF;
- row2[0 + 2] = row2[3 + 2] = row2[next_row + 2] =
- row2[next_row + 3 + 2] = (value >> 16) & 0xFF;
- row2 += 2 * 3;
- }
-
- /*
- * These values are at the start of the next line, (due
- * to the ++'s above),but they need to be at the start
- * of the line after that.
- */
- lum += cols;
- lum2 += cols;
- row1 += mod;
- row2 += mod;
- }
-}
-
-static void
-Color32DitherYV12Mod2X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int *row1 = (unsigned int *) out;
- const int next_row = cols * 2 + mod;
- unsigned int *row2 = row1 + 2 * next_row;
- unsigned char *lum2;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- lum2 = lum + cols;
-
- mod = (next_row * 3) + mod;
-
- y = rows / 2;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- ++cr;
- ++cb;
-
- L = *lum++;
- row1[0] = row1[1] = row1[next_row] = row1[next_row + 1] =
- (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row1 += 2;
-
- L = *lum++;
- row1[0] = row1[1] = row1[next_row] = row1[next_row + 1] =
- (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row1 += 2;
-
-
- /* Now, do second row. */
-
- L = *lum2++;
- row2[0] = row2[1] = row2[next_row] = row2[next_row + 1] =
- (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row2 += 2;
-
- L = *lum2++;
- row2[0] = row2[1] = row2[next_row] = row2[next_row + 1] =
- (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row2 += 2;
- }
-
- /*
- * These values are at the start of the next line, (due
- * to the ++'s above),but they need to be at the start
- * of the line after that.
- */
- lum += cols;
- lum2 += cols;
- row1 += mod;
- row2 += mod;
- }
-}
-
-static void
-Color16DitherYUY2Mod1X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned short *row;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- row = (unsigned short *) out;
-
- y = rows;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- cr += 4;
- cb += 4;
-
- L = *lum;
- lum += 2;
- *row++ = (unsigned short) (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
-
- L = *lum;
- lum += 2;
- *row++ = (unsigned short) (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
-
- }
-
- row += mod;
- }
-}
-
-static void
-Color24DitherYUY2Mod1X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int value;
- unsigned char *row;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- row = (unsigned char *) out;
- mod *= 3;
- y = rows;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- cr += 4;
- cb += 4;
-
- L = *lum;
- lum += 2;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- *row++ = (value) & 0xFF;
- *row++ = (value >> 8) & 0xFF;
- *row++ = (value >> 16) & 0xFF;
-
- L = *lum;
- lum += 2;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- *row++ = (value) & 0xFF;
- *row++ = (value >> 8) & 0xFF;
- *row++ = (value >> 16) & 0xFF;
-
- }
- row += mod;
- }
-}
-
-static void
-Color32DitherYUY2Mod1X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int *row;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = (cols + 1) / 2;
- /* not even dimensions */
- int skip_last_col = 0;
- if ( (cols & 0x1) ) {
- skip_last_col = 1;
- }
-
- row = (unsigned int *) out;
- y = rows;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- cr += 4;
- cb += 4;
-
- L = *lum;
- lum += 2;
- *row++ = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
-
- L = *lum;
- lum += 2;
-
- if (!(x == 0 && skip_last_col)) {
- *row++ = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- } /* skip col */
-
- }
- row += mod;
- }
-}
-
-/*
- * In this function I make use of a nasty trick. The tables have the lower
- * 16 bits replicated in the upper 16. This means I can write ints and get
- * the horisontal doubling for free (almost).
- */
-static void
-Color16DitherYUY2Mod2X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int *row = (unsigned int *) out;
- const int next_row = cols + (mod / 2);
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- y = rows;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- cr += 4;
- cb += 4;
-
- L = *lum;
- lum += 2;
- row[0] = row[next_row] = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
- row++;
-
- L = *lum;
- lum += 2;
- row[0] = row[next_row] = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] |
- rgb_2_pix[L + cb_b]);
- row++;
-
- }
- row += next_row;
- }
-}
-
-static void
-Color24DitherYUY2Mod2X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int value;
- unsigned char *row = out;
- const int next_row = (cols * 2 + mod) * 3;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
- y = rows;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- cr += 4;
- cb += 4;
-
- L = *lum;
- lum += 2;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row[0 + 0] = row[3 + 0] = row[next_row + 0] =
- row[next_row + 3 + 0] = (value) & 0xFF;
- row[0 + 1] = row[3 + 1] = row[next_row + 1] =
- row[next_row + 3 + 1] = (value >> 8) & 0xFF;
- row[0 + 2] = row[3 + 2] = row[next_row + 2] =
- row[next_row + 3 + 2] = (value >> 16) & 0xFF;
- row += 2 * 3;
-
- L = *lum;
- lum += 2;
- value = (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row[0 + 0] = row[3 + 0] = row[next_row + 0] =
- row[next_row + 3 + 0] = (value) & 0xFF;
- row[0 + 1] = row[3 + 1] = row[next_row + 1] =
- row[next_row + 3 + 1] = (value >> 8) & 0xFF;
- row[0 + 2] = row[3 + 2] = row[next_row + 2] =
- row[next_row + 3 + 2] = (value >> 16) & 0xFF;
- row += 2 * 3;
-
- }
- row += next_row;
- }
-}
-
-static void
-Color32DitherYUY2Mod2X(int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod)
-{
- unsigned int *row = (unsigned int *) out;
- const int next_row = cols * 2 + mod;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
- mod += mod;
- y = rows;
- while (y--) {
- x = cols_2;
- while (x--) {
- register int L;
-
- cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
- crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
- + colortab[*cb + 2 * 256];
- cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
- cr += 4;
- cb += 4;
-
- L = *lum;
- lum += 2;
- row[0] = row[1] = row[next_row] = row[next_row + 1] =
- (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row += 2;
-
- L = *lum;
- lum += 2;
- row[0] = row[1] = row[next_row] = row[next_row + 1] =
- (rgb_2_pix[L + cr_r] |
- rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
- row += 2;
-
-
- }
-
- row += next_row;
- }
-}
-
-/*
- * How many 1 bits are there in the Uint32.
- * Low performance, do not call often.
- */
-static int
-number_of_bits_set(Uint32 a)
-{
- if (!a)
- return 0;
- if (a & 1)
- return 1 + number_of_bits_set(a >> 1);
- return (number_of_bits_set(a >> 1));
-}
-
-/*
- * How many 0 bits are there at least significant end of Uint32.
- * Low performance, do not call often.
- */
-static int
-free_bits_at_bottom_nonzero(Uint32 a)
-{
- SDL_assert(a != 0);
- return (((Sint32) a) & 1l) ? 0 : 1 + free_bits_at_bottom_nonzero(a >> 1);
-}
-
-static SDL_INLINE int
-free_bits_at_bottom(Uint32 a)
-{
- return a ? free_bits_at_bottom_nonzero(a) : 32;
-}
-
-static int
-SDL_SW_SetupYUVDisplay(SDL_SW_YUVTexture * swdata, Uint32 target_format)
-{
- Uint32 *r_2_pix_alloc;
- Uint32 *g_2_pix_alloc;
- Uint32 *b_2_pix_alloc;
- int i;
- int bpp;
- Uint32 Rmask, Gmask, Bmask, Amask;
- int freebits;
-
- if (!SDL_PixelFormatEnumToMasks
- (target_format, &bpp, &Rmask, &Gmask, &Bmask, &Amask) || bpp < 15) {
- return SDL_SetError("Unsupported YUV destination format");
- }
-
- swdata->target_format = target_format;
- r_2_pix_alloc = &swdata->rgb_2_pix[0 * 768];
- g_2_pix_alloc = &swdata->rgb_2_pix[1 * 768];
- b_2_pix_alloc = &swdata->rgb_2_pix[2 * 768];
-
- /*
- * Set up entries 0-255 in rgb-to-pixel value tables.
- */
- for (i = 0; i < 256; ++i) {
- r_2_pix_alloc[i + 256] = i >> (8 - number_of_bits_set(Rmask));
- freebits = free_bits_at_bottom(Rmask);
- if (freebits < 32) {
- r_2_pix_alloc[i + 256] <<= freebits;
- }
- r_2_pix_alloc[i + 256] |= Amask;
-
- g_2_pix_alloc[i + 256] = i >> (8 - number_of_bits_set(Gmask));
- freebits = free_bits_at_bottom(Gmask);
- if (freebits < 32) {
- g_2_pix_alloc[i + 256] <<= freebits;
- }
- g_2_pix_alloc[i + 256] |= Amask;
-
- b_2_pix_alloc[i + 256] = i >> (8 - number_of_bits_set(Bmask));
- freebits = free_bits_at_bottom(Bmask);
- if (freebits < 32) {
- b_2_pix_alloc[i + 256] <<= freebits;
- }
- b_2_pix_alloc[i + 256] |= Amask;
- }
-
- /*
- * If we have 16-bit output depth, then we double the value
- * in the top word. This means that we can write out both
- * pixels in the pixel doubling mode with one op. It is
- * harmless in the normal case as storing a 32-bit value
- * through a short pointer will lose the top bits anyway.
- */
- if (SDL_BYTESPERPIXEL(target_format) == 2) {
- for (i = 0; i < 256; ++i) {
- r_2_pix_alloc[i + 256] |= (r_2_pix_alloc[i + 256]) << 16;
- g_2_pix_alloc[i + 256] |= (g_2_pix_alloc[i + 256]) << 16;
- b_2_pix_alloc[i + 256] |= (b_2_pix_alloc[i + 256]) << 16;
- }
- }
-
- /*
- * Spread out the values we have to the rest of the array so that
- * we do not need to check for overflow.
- */
- for (i = 0; i < 256; ++i) {
- r_2_pix_alloc[i] = r_2_pix_alloc[256];
- r_2_pix_alloc[i + 512] = r_2_pix_alloc[511];
- g_2_pix_alloc[i] = g_2_pix_alloc[256];
- g_2_pix_alloc[i + 512] = g_2_pix_alloc[511];
- b_2_pix_alloc[i] = b_2_pix_alloc[256];
- b_2_pix_alloc[i + 512] = b_2_pix_alloc[511];
- }
-
- /* You have chosen wisely... */
- switch (swdata->format) {
- case SDL_PIXELFORMAT_YV12:
- case SDL_PIXELFORMAT_IYUV:
- if (SDL_BYTESPERPIXEL(target_format) == 2) {
-#ifdef USE_MMX_ASSEMBLY
- /* inline assembly functions */
- if (SDL_HasMMX() && (Rmask == 0xF800) &&
- (Gmask == 0x07E0) && (Bmask == 0x001F)
- && (swdata->w & 15) == 0) {
-/* printf("Using MMX 16-bit 565 dither\n"); */
- swdata->Display1X = Color565DitherYV12MMX1X;
- } else {
-/* printf("Using C 16-bit dither\n"); */
- swdata->Display1X = Color16DitherYV12Mod1X;
- }
-#else
- swdata->Display1X = Color16DitherYV12Mod1X;
-#endif
- swdata->Display2X = Color16DitherYV12Mod2X;
- }
- if (SDL_BYTESPERPIXEL(target_format) == 3) {
- swdata->Display1X = Color24DitherYV12Mod1X;
- swdata->Display2X = Color24DitherYV12Mod2X;
- }
- if (SDL_BYTESPERPIXEL(target_format) == 4) {
-#ifdef USE_MMX_ASSEMBLY
- /* inline assembly functions */
- if (SDL_HasMMX() && (Rmask == 0x00FF0000) &&
- (Gmask == 0x0000FF00) &&
- (Bmask == 0x000000FF) && (swdata->w & 15) == 0) {
-/* printf("Using MMX 32-bit dither\n"); */
- swdata->Display1X = ColorRGBDitherYV12MMX1X;
- } else {
-/* printf("Using C 32-bit dither\n"); */
- swdata->Display1X = Color32DitherYV12Mod1X;
- }
-#else
- swdata->Display1X = Color32DitherYV12Mod1X;
-#endif
- swdata->Display2X = Color32DitherYV12Mod2X;
- }
- break;
- case SDL_PIXELFORMAT_YUY2:
- case SDL_PIXELFORMAT_UYVY:
- case SDL_PIXELFORMAT_YVYU:
- if (SDL_BYTESPERPIXEL(target_format) == 2) {
- swdata->Display1X = Color16DitherYUY2Mod1X;
- swdata->Display2X = Color16DitherYUY2Mod2X;
- }
- if (SDL_BYTESPERPIXEL(target_format) == 3) {
- swdata->Display1X = Color24DitherYUY2Mod1X;
- swdata->Display2X = Color24DitherYUY2Mod2X;
- }
- if (SDL_BYTESPERPIXEL(target_format) == 4) {
- swdata->Display1X = Color32DitherYUY2Mod1X;
- swdata->Display2X = Color32DitherYUY2Mod2X;
- }
- break;
- case SDL_PIXELFORMAT_NV21:
- case SDL_PIXELFORMAT_NV12:
- /* no Display{1,2}X function */
- swdata->Display1X = NULL;
- swdata->Display2X = NULL;
- break;
-
- default:
- /* We should never get here (caught above) */
- break;
- }
-
- SDL_FreeSurface(swdata->display);
- swdata->display = NULL;
- return 0;
-}
-
SDL_SW_YUVTexture *
SDL_SW_CreateYUVTexture(Uint32 format, int w, int h)
{
SDL_SW_YUVTexture *swdata;
- int *Cr_r_tab;
- int *Cr_g_tab;
- int *Cb_g_tab;
- int *Cb_b_tab;
- int i;
- int CR, CB;
switch (format) {
case SDL_PIXELFORMAT_YV12:
@@ -1127,32 +84,14 @@ SDL_SW_CreateYUVTexture(Uint32 format, int w, int h)
break;
}
swdata->pixels = (Uint8 *) SDL_malloc(dst_size);
- }
- swdata->colortab = (int *) SDL_malloc(4 * 256 * sizeof(int));
- swdata->rgb_2_pix = (Uint32 *) SDL_malloc(3 * 768 * sizeof(Uint32));
- if (!swdata->pixels || !swdata->colortab || !swdata->rgb_2_pix) {
- SDL_SW_DestroyYUVTexture(swdata);
- SDL_OutOfMemory();
- return NULL;
+ if (!swdata->pixels) {
+ SDL_SW_DestroyYUVTexture(swdata);
+ SDL_OutOfMemory();
+ return NULL;
+ }
}
- /* Generate the tables for the display surface */
- Cr_r_tab = &swdata->colortab[0 * 256];
- Cr_g_tab = &swdata->colortab[1 * 256];
- Cb_g_tab = &swdata->colortab[2 * 256];
- Cb_b_tab = &swdata->colortab[3 * 256];
- for (i = 0; i < 256; i++) {
- /* Gamma correction (luminescence table) and chroma correction
- would be done here. See the Berkeley mpeg_play sources.
- */
- CB = CR = (i - 128);
- Cr_r_tab[i] = (int) ((0.419 / 0.299) * CR);
- Cr_g_tab[i] = (int) (-(0.299 / 0.419) * CR);
- Cb_g_tab[i] = (int) (-(0.114 / 0.331) * CB);
- Cb_b_tab[i] = (int) ((0.587 / 0.331) * CB);
- }
-
- /* Find the pitch and offset values for the overlay */
+ /* Find the pitch and offset values for the texture */
switch (format) {
case SDL_PIXELFORMAT_YV12:
case SDL_PIXELFORMAT_IYUV:
@@ -1300,8 +239,6 @@ SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
}
}
}
- break;
-
}
return 0;
}
@@ -1398,27 +335,16 @@ SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture * swdata, const SDL_Rect * srcrect,
Uint32 target_format, int w, int h, void *pixels,
int pitch)
{
- const int targetbpp = SDL_BYTESPERPIXEL(target_format);
int stretch;
- int scale_2x;
- Uint8 *lum, *Cr, *Cb;
- int mod;
-
- if (targetbpp == 0) {
- return SDL_SetError("Invalid target pixel format");
- }
/* Make sure we're set up to display in the desired format */
- if (target_format != swdata->target_format) {
- if (SDL_SW_SetupYUVDisplay(swdata, target_format) < 0) {
- return -1;
- }
+ if (target_format != swdata->target_format && swdata->display) {
+ SDL_FreeSurface(swdata->display);
+ swdata->display = NULL;
}
stretch = 0;
- scale_2x = 0;
- if (srcrect->x || srcrect->y || srcrect->w < swdata->w
- || srcrect->h < swdata->h) {
+ if (srcrect->x || srcrect->y || srcrect->w < swdata->w || srcrect->h < swdata->h) {
/* The source rectangle has been clipped.
Using a scratch surface is easier than adding clipped
source support to all the blitters, plus that would
@@ -1426,11 +352,7 @@ SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture * swdata, const SDL_Rect * srcrect,
*/
stretch = 1;
} else if ((srcrect->w != w) || (srcrect->h != h)) {
- if ((w == 2 * srcrect->w) && (h == 2 * srcrect->h)) {
- scale_2x = 1;
- } else {
- stretch = 1;
- }
+ stretch = 1;
}
if (stretch) {
int bpp;
@@ -1466,51 +388,10 @@ SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture * swdata, const SDL_Rect * srcrect,
pixels = swdata->stretch->pixels;
pitch = swdata->stretch->pitch;
}
- switch (swdata->format) {
- case SDL_PIXELFORMAT_YV12:
- lum = swdata->planes[0];
- Cr = swdata->planes[1];
- Cb = swdata->planes[2];
- break;
- case SDL_PIXELFORMAT_IYUV:
- lum = swdata->planes[0];
- Cr = swdata->planes[2];
- Cb = swdata->planes[1];
- break;
- case SDL_PIXELFORMAT_YUY2:
- lum = swdata->planes[0];
- Cr = lum + 3;
- Cb = lum + 1;
- break;
- case SDL_PIXELFORMAT_UYVY:
- lum = swdata->planes[0] + 1;
- Cr = lum + 1;
- Cb = lum - 1;
- break;
- case SDL_PIXELFORMAT_YVYU:
- lum = swdata->planes[0];
- Cr = lum + 1;
- Cb = lum + 3;
- break;
- case SDL_PIXELFORMAT_NV12:
- case SDL_PIXELFORMAT_NV21:
- return SDL_ConvertPixels(swdata->w, swdata->h,
- swdata->format, swdata->planes[0], swdata->pitches[0],
- target_format, pixels, pitch);
- break;
- default:
- return SDL_SetError("Unsupported YUV format in copy");
- }
- mod = (pitch / targetbpp);
-
- if (scale_2x) {
- mod -= (swdata->w * 2);
- swdata->Display2X(swdata->colortab, swdata->rgb_2_pix,
- lum, Cr, Cb, pixels, swdata->h, swdata->w, mod);
- } else {
- mod -= swdata->w;
- swdata->Display1X(swdata->colortab, swdata->rgb_2_pix,
- lum, Cr, Cb, pixels, swdata->h, swdata->w, mod);
+ if (SDL_ConvertPixels(swdata->w, swdata->h, swdata->format,
+ swdata->planes[0], swdata->pitches[0],
+ target_format, pixels, pitch) < 0) {
+ return -1;
}
if (stretch) {
SDL_Rect rect = *srcrect;
@@ -1524,8 +405,6 @@ SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata)
{
if (swdata) {
SDL_free(swdata->pixels);
- SDL_free(swdata->colortab);
- SDL_free(swdata->rgb_2_pix);
SDL_FreeSurface(swdata->stretch);
SDL_FreeSurface(swdata->display);
SDL_free(swdata);
diff --git a/src/render/SDL_yuv_sw_c.h b/src/render/SDL_yuv_sw_c.h
index 248dd45e2..5cd878666 100644
--- a/src/render/SDL_yuv_sw_c.h
+++ b/src/render/SDL_yuv_sw_c.h
@@ -30,16 +30,6 @@ struct SDL_SW_YUVTexture
Uint32 target_format;
int w, h;
Uint8 *pixels;
- int *colortab;
- Uint32 *rgb_2_pix;
- void (*Display1X) (int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod);
- void (*Display2X) (int *colortab, Uint32 * rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod);
/* These are just so we don't have to allocate them separately */
Uint16 pitches[3];
diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c
index c40f699bb..04982481e 100644
--- a/src/render/direct3d/SDL_render_d3d.c
+++ b/src/render/direct3d/SDL_render_d3d.c
@@ -39,85 +39,7 @@
#include
#endif
-
-#ifdef ASSEMBLE_SHADER
-#pragma comment(lib, "d3dx9.lib")
-
-/**************************************************************************
- * ID3DXBuffer:
- * ------------
- * The buffer object is used by D3DX to return arbitrary size data.
- *
- * GetBufferPointer -
- * Returns a pointer to the beginning of the buffer.
- *
- * GetBufferSize -
- * Returns the size of the buffer, in bytes.
- **************************************************************************/
-
-typedef interface ID3DXBuffer ID3DXBuffer;
-typedef interface ID3DXBuffer *LPD3DXBUFFER;
-
-/* {8BA5FB08-5195-40e2-AC58-0D989C3A0102} */
-DEFINE_GUID(IID_ID3DXBuffer,
-0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2);
-
-#undef INTERFACE
-#define INTERFACE ID3DXBuffer
-
-typedef interface ID3DXBuffer {
- const struct ID3DXBufferVtbl FAR* lpVtbl;
-} ID3DXBuffer;
-typedef const struct ID3DXBufferVtbl ID3DXBufferVtbl;
-const struct ID3DXBufferVtbl
-{
- /* IUnknown */
- STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
- STDMETHOD_(ULONG, AddRef)(THIS) PURE;
- STDMETHOD_(ULONG, Release)(THIS) PURE;
-
- /* ID3DXBuffer */
- STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE;
- STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE;
-};
-
-HRESULT WINAPI
- D3DXAssembleShader(
- LPCSTR pSrcData,
- UINT SrcDataLen,
- CONST LPVOID* pDefines,
- LPVOID pInclude,
- DWORD Flags,
- LPD3DXBUFFER* ppShader,
- LPD3DXBUFFER* ppErrorMsgs);
-
-static void PrintShaderData(LPDWORD shader_data, DWORD shader_size)
-{
- OutputDebugStringA("const DWORD shader_data[] = {\n\t");
- {
- SDL_bool newline = SDL_FALSE;
- unsigned i;
- for (i = 0; i < shader_size / sizeof(DWORD); ++i) {
- char dword[11];
- if (i > 0) {
- if ((i%6) == 0) {
- newline = SDL_TRUE;
- }
- if (newline) {
- OutputDebugStringA(",\n ");
- newline = SDL_FALSE;
- } else {
- OutputDebugStringA(", ");
- }
- }
- SDL_snprintf(dword, sizeof(dword), "0x%8.8x", shader_data[i]);
- OutputDebugStringA(dword);
- }
- OutputDebugStringA("\n};\n");
- }
-}
-
-#endif /* ASSEMBLE_SHADER */
+#include "SDL_shaders_d3d.h"
/* Direct3D renderer implementation */
@@ -188,7 +110,7 @@ typedef struct
IDirect3DSurface9 *defaultRenderTarget;
IDirect3DSurface9 *currentRenderTarget;
void* d3dxDLL;
- LPDIRECT3DPIXELSHADER9 ps_yuv;
+ LPDIRECT3DPIXELSHADER9 shaders[NUM_SHADERS];
} D3D_RenderData;
typedef struct
@@ -197,6 +119,7 @@ typedef struct
int w, h;
DWORD usage;
Uint32 format;
+ D3DFORMAT d3dfmt;
IDirect3DTexture9 *texture;
IDirect3DTexture9 *staging;
} D3D_TextureRep;
@@ -313,6 +236,8 @@ PixelFormatToD3DFMT(Uint32 format)
return D3DFMT_A8R8G8B8;
case SDL_PIXELFORMAT_YV12:
case SDL_PIXELFORMAT_IYUV:
+ case SDL_PIXELFORMAT_NV12:
+ case SDL_PIXELFORMAT_NV21:
return D3DFMT_L8;
default:
return D3DFMT_UNKNOWN;
@@ -661,137 +586,19 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags)
/* Set up parameters for rendering */
D3D_InitRenderState(data);
- if (caps.MaxSimultaneousTextures >= 3)
- {
-#ifdef ASSEMBLE_SHADER
- /* This shader was created by running the following HLSL through the fxc compiler
- and then tuning the generated assembly.
-
- fxc /T fx_4_0 /O3 /Gfa /Fc yuv.fxc yuv.fx
-
- --- yuv.fx ---
- Texture2D g_txY;
- Texture2D g_txU;
- Texture2D g_txV;
-
- SamplerState samLinear
- {
- Filter = ANISOTROPIC;
- AddressU = Clamp;
- AddressV = Clamp;
- MaxAnisotropy = 1;
- };
-
- struct VS_OUTPUT
- {
- float2 TextureUV : TEXCOORD0;
- };
-
- struct PS_OUTPUT
- {
- float4 RGBAColor : SV_Target;
- };
-
- PS_OUTPUT YUV420( VS_OUTPUT In )
- {
- const float3 offset = {-0.0627451017, -0.501960814, -0.501960814};
- const float3 Rcoeff = {1.164, 0.000, 1.596};
- const float3 Gcoeff = {1.164, -0.391, -0.813};
- const float3 Bcoeff = {1.164, 2.018, 0.000};
-
- PS_OUTPUT Output;
- float2 TextureUV = In.TextureUV;
-
- float3 yuv;
- yuv.x = g_txY.Sample( samLinear, TextureUV ).r;
- yuv.y = g_txU.Sample( samLinear, TextureUV ).r;
- yuv.z = g_txV.Sample( samLinear, TextureUV ).r;
-
- yuv += offset;
- Output.RGBAColor.r = dot(yuv, Rcoeff);
- Output.RGBAColor.g = dot(yuv, Gcoeff);
- Output.RGBAColor.b = dot(yuv, Bcoeff);
- Output.RGBAColor.a = 1.0f;
-
- return Output;
- }
-
- technique10 RenderYUV420
- {
- pass P0
- {
- SetPixelShader( CompileShader( ps_4_0_level_9_0, YUV420() ) );
- }
- }
- */
- const char *shader_text =
- "ps_2_0\n"
- "def c0, -0.0627451017, -0.501960814, -0.501960814, 1\n"
- "def c1, 1.16400003, 0, 1.59599996, 0\n"
- "def c2, 1.16400003, -0.391000003, -0.813000023, 0\n"
- "def c3, 1.16400003, 2.01799989, 0, 0\n"
- "dcl t0.xy\n"
- "dcl v0.xyzw\n"
- "dcl_2d s0\n"
- "dcl_2d s1\n"
- "dcl_2d s2\n"
- "texld r0, t0, s0\n"
- "texld r1, t0, s1\n"
- "texld r2, t0, s2\n"
- "mov r0.y, r1.x\n"
- "mov r0.z, r2.x\n"
- "add r0.xyz, r0, c0\n"
- "dp3 r1.x, r0, c1\n"
- "dp3 r1.y, r0, c2\n"
- "dp2add r1.z, r0, c3, c3.z\n" /* Logically this is "dp3 r1.z, r0, c3" but the optimizer did its magic */
- "mov r1.w, c0.w\n"
- "mul r0, r1, v0\n" /* Not in the HLSL, multiply by vertex color */
- "mov oC0, r0\n"
- ;
- LPD3DXBUFFER pCode;
- LPD3DXBUFFER pErrorMsgs;
- LPDWORD shader_data = NULL;
- DWORD shader_size = 0;
- result = D3DXAssembleShader(shader_text, SDL_strlen(shader_text), NULL, NULL, 0, &pCode, &pErrorMsgs);
- if (!FAILED(result)) {
- shader_data = (DWORD*)pCode->lpVtbl->GetBufferPointer(pCode);
- shader_size = pCode->lpVtbl->GetBufferSize(pCode);
- PrintShaderData(shader_data, shader_size);
- } else {
- const char *error = (const char *)pErrorMsgs->lpVtbl->GetBufferPointer(pErrorMsgs);
- SDL_SetError("Couldn't assemble shader: %s", error);
- }
- if (shader_data != NULL)
-#else
- const DWORD shader_data[] = {
- 0xffff0200, 0x05000051, 0xa00f0000, 0xbd808081, 0xbf008081, 0xbf008081,
- 0x3f800000, 0x05000051, 0xa00f0001, 0x3f94fdf4, 0x00000000, 0x3fcc49ba,
- 0x00000000, 0x05000051, 0xa00f0002, 0x3f94fdf4, 0xbec83127, 0xbf5020c5,
- 0x00000000, 0x05000051, 0xa00f0003, 0x3f94fdf4, 0x400126e9, 0x00000000,
- 0x00000000, 0x0200001f, 0x80000000, 0xb0030000, 0x0200001f, 0x80000000,
- 0x900f0000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000,
- 0xa00f0801, 0x0200001f, 0x90000000, 0xa00f0802, 0x03000042, 0x800f0000,
- 0xb0e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0xb0e40000, 0xa0e40801,
- 0x03000042, 0x800f0002, 0xb0e40000, 0xa0e40802, 0x02000001, 0x80020000,
- 0x80000001, 0x02000001, 0x80040000, 0x80000002, 0x03000002, 0x80070000,
- 0x80e40000, 0xa0e40000, 0x03000008, 0x80010001, 0x80e40000, 0xa0e40001,
- 0x03000008, 0x80020001, 0x80e40000, 0xa0e40002, 0x0400005a, 0x80040001,
- 0x80e40000, 0xa0e40003, 0xa0aa0003, 0x02000001, 0x80080001, 0xa0ff0000,
- 0x03000005, 0x800f0000, 0x80e40001, 0x90e40000, 0x02000001, 0x800f0800,
- 0x80e40000, 0x0000ffff
- };
-#endif
- {
- result = IDirect3DDevice9_CreatePixelShader(data->device, shader_data, &data->ps_yuv);
- if (!FAILED(result)) {
- renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_YV12;
- renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_IYUV;
- } else {
+ if (caps.MaxSimultaneousTextures >= 3) {
+ int i;
+ for (i = 0; i < SDL_arraysize(data->shaders); ++i) {
+ result = D3D9_CreatePixelShader(data->device, (D3D9_Shader)i, &data->shaders[i]);
+ if (FAILED(result)) {
D3D_SetError("CreatePixelShader()", result);
}
}
+ if (data->shaders[SHADER_YUV_JPEG] && data->shaders[SHADER_YUV_BT601] && data->shaders[SHADER_YUV_BT709]) {
+ renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_YV12;
+ renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_IYUV;
+ }
}
-
return renderer;
}
@@ -870,7 +677,7 @@ GetScaleQuality(void)
}
static int
-D3D_CreateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, DWORD usage, Uint32 format, int w, int h)
+D3D_CreateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, DWORD usage, Uint32 format, D3DFORMAT d3dfmt, int w, int h)
{
HRESULT result;
@@ -879,6 +686,7 @@ D3D_CreateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, DWORD us
texture->h = h;
texture->usage = usage;
texture->format = format;
+ texture->d3dfmt = d3dfmt;
result = IDirect3DDevice9_CreateTexture(device, w, h, 1, usage,
PixelFormatToD3DFMT(format),
@@ -897,8 +705,7 @@ D3D_CreateStagingTexture(IDirect3DDevice9 *device, D3D_TextureRep *texture)
if (texture->staging == NULL) {
result = IDirect3DDevice9_CreateTexture(device, texture->w, texture->h, 1, 0,
- PixelFormatToD3DFMT(texture->format),
- D3DPOOL_SYSTEMMEM, &texture->staging, NULL);
+ texture->d3dfmt, D3DPOOL_SYSTEMMEM, &texture->staging, NULL);
if (FAILED(result)) {
return D3D_SetError("CreateTexture(D3DPOOL_SYSTEMMEM)", result);
}
@@ -934,7 +741,7 @@ D3D_BindTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, DWORD samp
}
static int
-D3D_RecreateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, Uint32 format, int w, int h)
+D3D_RecreateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture)
{
if (texture->texture) {
IDirect3DTexture9_Release(texture->texture);
@@ -948,7 +755,7 @@ D3D_RecreateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, Uint32
}
static int
-D3D_UpdateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, Uint32 format, int x, int y, int w, int h, const void *pixels, int pitch)
+D3D_UpdateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, int x, int y, int w, int h, const void *pixels, int pitch)
{
RECT d3drect;
D3DLOCKED_RECT locked;
@@ -972,8 +779,8 @@ D3D_UpdateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, Uint32 f
}
src = (const Uint8 *)pixels;
- dst = locked.pBits;
- length = w * SDL_BYTESPERPIXEL(format);
+ dst = (Uint8 *)locked.pBits;
+ length = w * SDL_BYTESPERPIXEL(texture->format);
if (length == pitch && length == locked.Pitch) {
SDL_memcpy(dst, src, length*h);
} else {
@@ -1032,7 +839,7 @@ D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
usage = 0;
}
- if (D3D_CreateTextureRep(data->device, &texturedata->texture, usage, texture->format, texture->w, texture->h) < 0) {
+ if (D3D_CreateTextureRep(data->device, &texturedata->texture, usage, texture->format, PixelFormatToD3DFMT(texture->format), texture->w, texture->h) < 0) {
return -1;
}
@@ -1040,11 +847,11 @@ D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
texture->format == SDL_PIXELFORMAT_IYUV) {
texturedata->yuv = SDL_TRUE;
- if (D3D_CreateTextureRep(data->device, &texturedata->utexture, usage, texture->format, texture->w / 2, texture->h / 2) < 0) {
+ if (D3D_CreateTextureRep(data->device, &texturedata->utexture, usage, texture->format, PixelFormatToD3DFMT(texture->format), (texture->w + 1) / 2, (texture->h + 1) / 2) < 0) {
return -1;
}
- if (D3D_CreateTextureRep(data->device, &texturedata->vtexture, usage, texture->format, texture->w / 2, texture->h / 2) < 0) {
+ if (D3D_CreateTextureRep(data->device, &texturedata->vtexture, usage, texture->format, PixelFormatToD3DFMT(texture->format), (texture->w + 1) / 2, (texture->h + 1) / 2) < 0) {
return -1;
}
}
@@ -1061,16 +868,16 @@ D3D_RecreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
return 0;
}
- if (D3D_RecreateTextureRep(data->device, &texturedata->texture, texture->format, texture->w, texture->h) < 0) {
+ if (D3D_RecreateTextureRep(data->device, &texturedata->texture) < 0) {
return -1;
}
if (texturedata->yuv) {
- if (D3D_RecreateTextureRep(data->device, &texturedata->utexture, texture->format, texture->w / 2, texture->h / 2) < 0) {
+ if (D3D_RecreateTextureRep(data->device, &texturedata->utexture) < 0) {
return -1;
}
- if (D3D_RecreateTextureRep(data->device, &texturedata->vtexture, texture->format, texture->w / 2, texture->h / 2) < 0) {
+ if (D3D_RecreateTextureRep(data->device, &texturedata->vtexture) < 0) {
return -1;
}
}
@@ -1089,7 +896,7 @@ D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
return -1;
}
- if (D3D_UpdateTextureRep(data->device, &texturedata->texture, texture->format, rect->x, rect->y, rect->w, rect->h, pixels, pitch) < 0) {
+ if (D3D_UpdateTextureRep(data->device, &texturedata->texture, rect->x, rect->y, rect->w, rect->h, pixels, pitch) < 0) {
return -1;
}
@@ -1097,13 +904,13 @@ D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
/* Skip to the correct offset into the next texture */
pixels = (const void*)((const Uint8*)pixels + rect->h * pitch);
- if (D3D_UpdateTextureRep(data->device, texture->format == SDL_PIXELFORMAT_YV12 ? &texturedata->vtexture : &texturedata->utexture, texture->format, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, pixels, pitch / 2) < 0) {
+ if (D3D_UpdateTextureRep(data->device, texture->format == SDL_PIXELFORMAT_YV12 ? &texturedata->vtexture : &texturedata->utexture, rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2, pixels, (pitch + 1) / 2) < 0) {
return -1;
}
/* Skip to the correct offset into the next texture */
- pixels = (const void*)((const Uint8*)pixels + (rect->h * pitch)/4);
- if (D3D_UpdateTextureRep(data->device, texture->format == SDL_PIXELFORMAT_YV12 ? &texturedata->utexture : &texturedata->vtexture, texture->format, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, pixels, pitch / 2) < 0) {
+ pixels = (const void*)((const Uint8*)pixels + ((rect->h + 1) / 2) * ((pitch + 1) / 2));
+ if (D3D_UpdateTextureRep(data->device, texture->format == SDL_PIXELFORMAT_YV12 ? &texturedata->utexture : &texturedata->vtexture, rect->x / 2, (rect->y + 1) / 2, (rect->w + 1) / 2, (rect->h + 1) / 2, pixels, (pitch + 1) / 2) < 0) {
return -1;
}
}
@@ -1125,13 +932,13 @@ D3D_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture,
return -1;
}
- if (D3D_UpdateTextureRep(data->device, &texturedata->texture, texture->format, rect->x, rect->y, rect->w, rect->h, Yplane, Ypitch) < 0) {
+ if (D3D_UpdateTextureRep(data->device, &texturedata->texture, rect->x, rect->y, rect->w, rect->h, Yplane, Ypitch) < 0) {
return -1;
}
- if (D3D_UpdateTextureRep(data->device, &texturedata->utexture, texture->format, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, Uplane, Upitch) < 0) {
+ if (D3D_UpdateTextureRep(data->device, &texturedata->utexture, rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2, Uplane, Upitch) < 0) {
return -1;
}
- if (D3D_UpdateTextureRep(data->device, &texturedata->vtexture, texture->format, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, Vplane, Vpitch) < 0) {
+ if (D3D_UpdateTextureRep(data->device, &texturedata->vtexture, rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2, Vplane, Vpitch) < 0) {
return -1;
}
return 0;
@@ -1609,13 +1416,60 @@ D3D_UpdateTextureScaleMode(D3D_RenderData *data, D3D_TextureData *texturedata, u
}
}
+static int
+D3D_RenderSetupTextureState(SDL_Renderer * renderer, SDL_Texture * texture, LPDIRECT3DPIXELSHADER9 *shader)
+{
+ D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
+ D3D_TextureData *texturedata;
+
+ *shader = NULL;
+
+ texturedata = (D3D_TextureData *)texture->driverdata;
+ if (!texturedata) {
+ SDL_SetError("Texture is not currently available");
+ return -1;
+ }
+
+ D3D_UpdateTextureScaleMode(data, texturedata, 0);
+
+ if (D3D_BindTextureRep(data->device, &texturedata->texture, 0) < 0) {
+ return -1;
+ }
+
+ if (texturedata->yuv) {
+ switch (SDL_GetYUVConversionModeForResolution(texture->w, texture->h)) {
+ case SDL_YUV_CONVERSION_JPEG:
+ *shader = data->shaders[SHADER_YUV_JPEG];
+ break;
+ case SDL_YUV_CONVERSION_BT601:
+ *shader = data->shaders[SHADER_YUV_BT601];
+ break;
+ case SDL_YUV_CONVERSION_BT709:
+ *shader = data->shaders[SHADER_YUV_BT709];
+ break;
+ default:
+ return SDL_SetError("Unsupported YUV conversion mode");
+ }
+
+ D3D_UpdateTextureScaleMode(data, texturedata, 1);
+ D3D_UpdateTextureScaleMode(data, texturedata, 2);
+
+ if (D3D_BindTextureRep(data->device, &texturedata->utexture, 1) < 0) {
+ return -1;
+ }
+ if (D3D_BindTextureRep(data->device, &texturedata->vtexture, 2) < 0) {
+ return -1;
+ }
+ }
+ return 0;
+}
+
static int
D3D_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
const SDL_Rect * srcrect, const SDL_FRect * dstrect)
{
D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
- D3D_TextureData *texturedata;
- LPDIRECT3DPIXELSHADER9 shader = NULL;
+ LPDIRECT3DPIXELSHADER9 shader;
float minx, miny, maxx, maxy;
float minu, maxu, minv, maxv;
DWORD color;
@@ -1626,12 +1480,6 @@ D3D_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
return -1;
}
- texturedata = (D3D_TextureData *)texture->driverdata;
- if (!texturedata) {
- SDL_SetError("Texture is not currently available");
- return -1;
- }
-
minx = dstrect->x - 0.5f;
miny = dstrect->y - 0.5f;
maxx = dstrect->x + dstrect->w - 0.5f;
@@ -1674,45 +1522,25 @@ D3D_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
D3D_SetBlendMode(data, texture->blendMode);
- D3D_UpdateTextureScaleMode(data, texturedata, 0);
-
- if (D3D_BindTextureRep(data->device, &texturedata->texture, 0) < 0) {
+ if (D3D_RenderSetupTextureState(renderer, texture, &shader) < 0) {
return -1;
}
-
- if (texturedata->yuv) {
- shader = data->ps_yuv;
-
- D3D_UpdateTextureScaleMode(data, texturedata, 1);
- D3D_UpdateTextureScaleMode(data, texturedata, 2);
-
- if (D3D_BindTextureRep(data->device, &texturedata->utexture, 1) < 0) {
- return -1;
- }
- if (D3D_BindTextureRep(data->device, &texturedata->vtexture, 2) < 0) {
- return -1;
- }
- }
-
+
if (shader) {
result = IDirect3DDevice9_SetPixelShader(data->device, shader);
if (FAILED(result)) {
return D3D_SetError("SetShader()", result);
}
}
- result =
- IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLEFAN, 2,
- vertices, sizeof(*vertices));
+ result = IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLEFAN, 2,
+ vertices, sizeof(*vertices));
if (FAILED(result)) {
- return D3D_SetError("DrawPrimitiveUP()", result);
+ D3D_SetError("DrawPrimitiveUP()", result);
}
if (shader) {
- result = IDirect3DDevice9_SetPixelShader(data->device, NULL);
- if (FAILED(result)) {
- return D3D_SetError("SetShader()", result);
- }
+ IDirect3DDevice9_SetPixelShader(data->device, NULL);
}
- return 0;
+ return FAILED(result) ? -1 : 0;
}
@@ -1722,7 +1550,6 @@ D3D_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
const double angle, const SDL_FPoint * center, const SDL_RendererFlip flip)
{
D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
- D3D_TextureData *texturedata;
LPDIRECT3DPIXELSHADER9 shader = NULL;
float minx, miny, maxx, maxy;
float minu, maxu, minv, maxv;
@@ -1736,12 +1563,6 @@ D3D_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
return -1;
}
- texturedata = (D3D_TextureData *)texture->driverdata;
- if (!texturedata) {
- SDL_SetError("Texture is not currently available");
- return -1;
- }
-
centerx = center->x;
centery = center->y;
@@ -1798,54 +1619,37 @@ D3D_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
D3D_SetBlendMode(data, texture->blendMode);
+ if (D3D_RenderSetupTextureState(renderer, texture, &shader) < 0) {
+ return -1;
+ }
+
/* Rotate and translate */
modelMatrix = MatrixMultiply(
MatrixRotationZ((float)(M_PI * (float) angle / 180.0f)),
MatrixTranslation(dstrect->x + center->x - 0.5f, dstrect->y + center->y - 0.5f, 0));
IDirect3DDevice9_SetTransform(data->device, D3DTS_VIEW, (D3DMATRIX*)&modelMatrix);
-
- D3D_UpdateTextureScaleMode(data, texturedata, 0);
-
- if (D3D_BindTextureRep(data->device, &texturedata->texture, 0) < 0) {
- return -1;
- }
-
- if (texturedata->yuv) {
- shader = data->ps_yuv;
-
- D3D_UpdateTextureScaleMode(data, texturedata, 1);
- D3D_UpdateTextureScaleMode(data, texturedata, 2);
-
- if (D3D_BindTextureRep(data->device, &texturedata->utexture, 1) < 0) {
- return -1;
- }
- if (D3D_BindTextureRep(data->device, &texturedata->vtexture, 2) < 0) {
- return -1;
- }
- }
-
+
if (shader) {
result = IDirect3DDevice9_SetPixelShader(data->device, shader);
if (FAILED(result)) {
- return D3D_SetError("SetShader()", result);
+ D3D_SetError("SetShader()", result);
+ goto done;
}
}
- result =
- IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLEFAN, 2,
- vertices, sizeof(*vertices));
+ result = IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLEFAN, 2,
+ vertices, sizeof(*vertices));
if (FAILED(result)) {
- return D3D_SetError("DrawPrimitiveUP()", result);
+ D3D_SetError("DrawPrimitiveUP()", result);
}
+done:
if (shader) {
- result = IDirect3DDevice9_SetPixelShader(data->device, NULL);
- if (FAILED(result)) {
- return D3D_SetError("SetShader()", result);
- }
+ IDirect3DDevice9_SetPixelShader(data->device, NULL);
}
modelMatrix = MatrixIdentity();
IDirect3DDevice9_SetTransform(data->device, D3DTS_VIEW, (D3DMATRIX*)&modelMatrix);
- return 0;
+
+ return FAILED(result) ? -1 : 0;
}
static int
@@ -1955,6 +1759,8 @@ D3D_DestroyRenderer(SDL_Renderer * renderer)
D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata;
if (data) {
+ int i;
+
/* Release the render target */
if (data->defaultRenderTarget) {
IDirect3DSurface9_Release(data->defaultRenderTarget);
@@ -1964,11 +1770,15 @@ D3D_DestroyRenderer(SDL_Renderer * renderer)
IDirect3DSurface9_Release(data->currentRenderTarget);
data->currentRenderTarget = NULL;
}
- if (data->ps_yuv) {
- IDirect3DPixelShader9_Release(data->ps_yuv);
+ for (i = 0; i < SDL_arraysize(data->shaders); ++i) {
+ if (data->shaders[i]) {
+ IDirect3DPixelShader9_Release(data->shaders[i]);
+ data->shaders[i] = NULL;
+ }
}
if (data->device) {
IDirect3DDevice9_Release(data->device);
+ data->device = NULL;
}
if (data->d3d) {
IDirect3D9_Release(data->d3d);
diff --git a/src/render/direct3d/SDL_shaders_d3d.c b/src/render/direct3d/SDL_shaders_d3d.c
new file mode 100644
index 000000000..37a0dd7d0
--- /dev/null
+++ b/src/render/direct3d/SDL_shaders_d3d.c
@@ -0,0 +1,274 @@
+/*
+ Simple DirectMedia Layer
+ Copyright (C) 1997-2017 Sam Lantinga
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+*/
+#include "../../SDL_internal.h"
+
+#include "SDL_render.h"
+#include "SDL_system.h"
+
+#if SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED
+
+#include "../../core/windows/SDL_windows.h"
+
+#include
+
+#include "SDL_shaders_d3d.h"
+
+/* The shaders here were compiled with:
+
+ fxc /T ps_2_0 /Fo"