diff --git a/.gitmodules b/.gitmodules index 1037b8ffd5..7e1b643bfd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -27,3 +27,6 @@ [submodule "3rdparty/rcheevos/rcheevos"] path = 3rdparty/rcheevos/rcheevos url = https://github.com/RetroAchievements/rcheevos.git +[submodule "3rdparty/libwebp/libwebp"] + path = 3rdparty/libwebp/libwebp + url = https://github.com/webmproject/libwebp diff --git a/3rdparty/libwebp/CMakeLists.txt b/3rdparty/libwebp/CMakeLists.txt new file mode 100644 index 0000000000..438bce1841 --- /dev/null +++ b/3rdparty/libwebp/CMakeLists.txt @@ -0,0 +1,82 @@ +# Intentionally only includes the decoder, not the encoder, to save on binary size. + +add_library(pcsx2-libwebp + libwebp/src/dec/alpha_dec.c + libwebp/src/dec/alphai_dec.h + libwebp/src/dec/buffer_dec.c + libwebp/src/dec/common_dec.h + libwebp/src/dec/frame_dec.c + libwebp/src/dec/idec_dec.c + libwebp/src/dec/io_dec.c + libwebp/src/dec/quant_dec.c + libwebp/src/dec/tree_dec.c + libwebp/src/dec/vp8_dec.c + libwebp/src/dec/vp8_dec.h + libwebp/src/dec/vp8i_dec.h + libwebp/src/dec/vp8l_dec.c + libwebp/src/dec/vp8li_dec.h + libwebp/src/dec/webp_dec.c + libwebp/src/dec/webpi_dec.h + libwebp/src/dsp/alpha_processing.c + libwebp/src/dsp/alpha_processing_sse2.c + libwebp/src/dsp/alpha_processing_sse41.c + libwebp/src/dsp/common_sse2.h + libwebp/src/dsp/common_sse41.h + libwebp/src/dsp/cpu.c + libwebp/src/dsp/cpu.h + libwebp/src/dsp/dec.c + libwebp/src/dsp/dec_clip_tables.c + libwebp/src/dsp/dec_sse2.c + libwebp/src/dsp/dec_sse41.c + libwebp/src/dsp/dsp.h + libwebp/src/dsp/filters.c + libwebp/src/dsp/filters_sse2.c + libwebp/src/dsp/lossless.c + libwebp/src/dsp/lossless.h + libwebp/src/dsp/lossless_common.h + libwebp/src/dsp/lossless_sse2.c + libwebp/src/dsp/lossless_sse41.c + libwebp/src/dsp/rescaler.c + libwebp/src/dsp/rescaler_sse2.c + libwebp/src/dsp/upsampling.c + libwebp/src/dsp/upsampling_sse2.c + libwebp/src/dsp/upsampling_sse41.c + libwebp/src/dsp/yuv.c + libwebp/src/dsp/yuv.h + libwebp/src/dsp/yuv_sse2.c + libwebp/src/dsp/yuv_sse41.c + libwebp/src/utils/bit_reader_utils.c + libwebp/src/utils/bit_reader_utils.h + libwebp/src/utils/color_cache_utils.c + libwebp/src/utils/color_cache_utils.h + libwebp/src/utils/huffman_utils.c + libwebp/src/utils/huffman_utils.h + libwebp/src/utils/quant_levels_dec_utils.c + libwebp/src/utils/quant_levels_dec_utils.h + libwebp/src/utils/random_utils.c + libwebp/src/utils/random_utils.h + libwebp/src/utils/rescaler_utils.c + libwebp/src/utils/rescaler_utils.h + libwebp/src/utils/thread_utils.c + libwebp/src/utils/thread_utils.h + libwebp/src/utils/utils.c + libwebp/src/utils/utils.h + libwebp/src/webp/decode.h + libwebp/src/webp/demux.h + libwebp/src/webp/encode.h + libwebp/src/webp/format_constants.h + libwebp/src/webp/mux.h + libwebp/src/webp/mux_types.h + libwebp/src/webp/types.h +) + +if(NOT MSVC OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + # clang-cl won't build SSE4 functions without -msse4.1. + target_compile_options(pcsx2-libwebp PRIVATE "-msse4.1") +endif() + +target_include_directories(pcsx2-libwebp PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/libwebp") +target_include_directories(pcsx2-libwebp INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/libwebp/src") +add_library(WebP::libwebp ALIAS pcsx2-libwebp) + +disable_compiler_warnings_for_target(pcsx2-libwebp) diff --git a/3rdparty/libwebp/libwebp b/3rdparty/libwebp/libwebp new file mode 160000 index 0000000000..ca332209cb --- /dev/null +++ b/3rdparty/libwebp/libwebp @@ -0,0 +1 @@ +Subproject commit ca332209cb5567c9b249c86788cb2dbf8847e760 diff --git a/3rdparty/libwebp/libwebp.vcxproj b/3rdparty/libwebp/libwebp.vcxproj new file mode 100644 index 0000000000..11a4e84f33 --- /dev/null +++ b/3rdparty/libwebp/libwebp.vcxproj @@ -0,0 +1,113 @@ + + + + + + {522DAF2A-1F24-4742-B2C4-A956411F6AB2} + + + + StaticLibrary + $(DefaultPlatformToolset) + ClangCL + Unicode + true + true + false + + + + + + + + + + + + + + AllRules.ruleset + + + + TurnOffAllWarnings + %(PreprocessorDefinitions) + $(ProjectDir)\libwebp;%(AdditionalIncludeDirectories) + %(AdditionalOptions) -msse4.1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/3rdparty/libwebp/libwebp.vcxproj.filters b/3rdparty/libwebp/libwebp.vcxproj.filters new file mode 100644 index 0000000000..0843fc8aa5 --- /dev/null +++ b/3rdparty/libwebp/libwebp.vcxproj.filters @@ -0,0 +1,222 @@ + + + + + {76c0f4d4-ee4a-4d7d-8945-35d0e8d14c31} + + + {9b72c794-2ba2-4aab-af7d-6bddd88beedd} + + + {67893497-bdc4-4e15-bb1b-16608bc150e7} + + + {98285b2d-d9ad-4642-bd53-59aeb8c9cb19} + + + + + dec + + + dec + + + dec + + + dec + + + dec + + + dec + + + dec + + + dec + + + dec + + + dec + + + utils + + + dsp + + + dsp + + + dsp + + + utils + + + dsp + + + dsp + + + dsp + + + utils + + + utils + + + dsp + + + dsp + + + dsp + + + utils + + + utils + + + dsp + + + dsp + + + dsp + + + dsp + + + dsp + + + dsp + + + dsp + + + dsp + + + dsp + + + dsp + + + dsp + + + utils + + + utils + + + dsp + + + + + dec + + + dec + + + dec + + + dec + + + dec + + + dec + + + webp + + + webp + + + webp + + + webp + + + webp + + + webp + + + webp + + + utils + + + dsp + + + dsp + + + utils + + + dsp + + + utils + + + utils + + + dsp + + + utils + + + utils + + + dsp + + + dsp + + + dsp + + + utils + + + utils + + + \ No newline at end of file