Updated SDL's YUV support, many thanks to Adrien Descamps

New functions get and set the YUV colorspace conversion mode:
	SDL_SetYUVConversionMode()
	SDL_GetYUVConversionMode()
	SDL_GetYUVConversionModeForResolution()

SDL_ConvertPixels() converts between all supported RGB and YUV formats, with SSE acceleration for converting from planar YUV formats (YV12, NV12, etc) to common RGB/RGBA formats.

Added a new test program, testyuv, to verify correctness and speed of YUV conversion functionality.
This commit is contained in:
Sam Lantinga 2017-11-12 22:51:12 -08:00
parent e7cc03e0bd
commit 145d2469ae
60 changed files with 8368 additions and 4310 deletions

View file

@ -114,11 +114,11 @@
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.c" />
<ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
<ClCompile Include="..\..\src\render\SDL_d3dmath.c" />
<ClCompile Include="..\..\src\render\SDL_render.c" />
<ClCompile Include="..\..\src\render\SDL_yuv_mmx.c" />
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
<ClCompile Include="..\..\src\render\software\SDL_blendfillrect.c" />
<ClCompile Include="..\..\src\render\software\SDL_blendline.c" />
@ -168,6 +168,7 @@
<ClCompile Include="..\..\src\video\SDL_stretch.c" />
<ClCompile Include="..\..\src\video\SDL_surface.c" />
<ClCompile Include="..\..\src\video\SDL_video.c" />
<ClCompile Include="..\..\src\video\SDL_yuv.c" />
<ClCompile Include="..\..\src\video\winrt\SDL_winrtevents.cpp">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</CompileAsWinRT>
@ -232,6 +233,7 @@
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\begin_code.h" />
@ -323,7 +325,7 @@
<ClInclude Include="..\..\src\joystick\windows\SDL_windowsjoystick_c.h" />
<ClInclude Include="..\..\src\joystick\windows\SDL_xinputjoystick_c.h" />
<ClInclude Include="..\..\src\render\direct3d11\SDL_render_winrt.h" />
<ClInclude Include="..\..\src\render\mmx.h" />
<ClInclude Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.h" />
<ClInclude Include="..\..\src\render\opengles2\SDL_gles2funcs.h" />
<ClInclude Include="..\..\src\render\opengles2\SDL_shaders_gles2.h" />
<ClInclude Include="..\..\src\render\SDL_d3dmath.h" />
@ -361,12 +363,14 @@
<ClInclude Include="..\..\src\video\SDL_RLEaccel_c.h" />
<ClInclude Include="..\..\src\video\SDL_shape_internals.h" />
<ClInclude Include="..\..\src\video\SDL_sysvideo.h" />
<ClInclude Include="..\..\src\video\SDL_yuv_c.h" />
<ClInclude Include="..\..\src\video\winrt\SDL_winrtevents_c.h" />
<ClInclude Include="..\..\src\video\winrt\SDL_winrtgamebar_cpp.h" />
<ClInclude Include="..\..\src\video\winrt\SDL_winrtmessagebox.h" />
<ClInclude Include="..\..\src\video\winrt\SDL_winrtmouse_c.h" />
<ClInclude Include="..\..\src\video\winrt\SDL_winrtopengles.h" />
<ClInclude Include="..\..\src\video\winrt\SDL_winrtvideo_cpp.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{aeaea3a2-d4e6-45b1-8ec6-53d84287fc14}</ProjectGuid>

View file

@ -220,9 +220,6 @@
<ClCompile Include="..\..\src\audio\xaudio2\SDL_xaudio2_winrthelpers.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\render\SDL_yuv_mmx.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c">
<Filter>Source Files</Filter>
</ClCompile>
@ -322,6 +319,15 @@
<ClCompile Include="..\..\src\SDL_dataqueue.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\video\SDL_yuv.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\begin_code.h">
@ -444,9 +450,6 @@
<ClInclude Include="..\..\src\video\SDL_blit_slow.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\render\mmx.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_config.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -723,6 +726,15 @@
<ClInclude Include="..\..\src\SDL_dataqueue.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\video\SDL_yuv_c.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.h">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="Header Files">