• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisionc968b0e5b33d9d63c5806cd652dfb1c38ef0a90c (tree)
Zeit2024-04-18 20:54:25
AutorFs <Fsu0413@vip....>
CommiterFs

Log Message

update libwebp patch

Ändern Zusammenfassung

Diff

--- a/Patches/6.2/2023-09-22-CVE-2023-4863-qtimageformats-6.2.patch
+++ b/Patches/6.2/2023-09-22-CVE-2023-4863-qtimageformats-6.2.patch
@@ -1,21 +1,7 @@
11 diff -rNuZ a/src/3rdparty/libwebp/AUTHORS b/src/3rdparty/libwebp/AUTHORS
2---- a/src/3rdparty/libwebp/AUTHORS 2023-11-01 02:38:38.000000000 +0800
3-+++ b/src/3rdparty/libwebp/AUTHORS 2023-09-14 06:11:07.000000000 +0800
4-@@ -11,11 +11,13 @@
5- - Djordje Pesut (djordje dot pesut at imgtec dot com)
6- - Frank Barchard (fbarchard at google dot com)
7- - Hui Su (huisu at google dot com)
8-+- H. Vetinari (h dot vetinari at gmx dot com)
9- - Ilya Kurdyukov (jpegqs at gmail dot com)
10- - Ingvar Stepanyan (rreverser at google dot com)
11- - James Zern (jzern at google dot com)
12- - Jan Engelhardt (jengelh at medozas dot de)
13- - Jehan (jehan at girinstud dot io)
14-+- Jeremy Maitin-Shepard (jbms at google dot com)
15- - Johann Koenig (johann dot koenig at duck dot com)
16- - Jovan Zelincevic (jovan dot zelincevic at imgtec dot com)
17- - Jyrki Alakuijala (jyrki at google dot com)
18-@@ -30,6 +32,7 @@
2+--- a/src/3rdparty/libwebp/AUTHORS 2024-03-27 03:34:35.000000000 +0800
3++++ b/src/3rdparty/libwebp/AUTHORS 2024-03-17 19:08:13.312591300 +0800
4+@@ -32,6 +32,7 @@
195 - Mislav Bradac (mislavm at google dot com)
206 - Nico Weber (thakis at chromium dot org)
217 - Noel Chromium (noel at chromium dot org)
@@ -23,7 +9,7 @@ diff -rNuZ a/src/3rdparty/libwebp/AUTHORS b/src/3rdparty/libwebp/AUTHORS
239 - Oliver Wolff (oliver dot wolff at qt dot io)
2410 - Owen Rodley (orodley at google dot com)
2511 - Parag Salasakar (img dot mips1 at gmail dot com)
26-@@ -45,6 +48,7 @@
12+@@ -47,6 +48,7 @@
2713 - Somnath Banerjee (somnath dot banerjee at gmail dot com)
2814 - Sriraman Tallam (tmsriram at google dot com)
2915 - Tamar Levy (tamar dot levy at intel dot com)
@@ -32,9 +18,9 @@ diff -rNuZ a/src/3rdparty/libwebp/AUTHORS b/src/3rdparty/libwebp/AUTHORS
3218 - Urvang Joshi (urvang at google dot com)
3319 - Vikas Arora (vikasa at google dot com)
3420 diff -rNuZ a/src/3rdparty/libwebp/ChangeLog b/src/3rdparty/libwebp/ChangeLog
35---- a/src/3rdparty/libwebp/ChangeLog 2023-11-01 02:38:38.000000000 +0800
36-+++ b/src/3rdparty/libwebp/ChangeLog 2023-09-14 06:11:07.000000000 +0800
37-@@ -1,8 +1,228 @@
21+--- a/src/3rdparty/libwebp/ChangeLog 2024-03-27 03:34:35.000000000 +0800
22++++ b/src/3rdparty/libwebp/ChangeLog 2024-03-17 19:08:13.312591300 +0800
23+@@ -1,3 +1,82 @@
3824 +1ace578c update NEWS
3925 +63234c42 bump version to 1.3.2
4026 +2af26267 Fix OOB write in BuildHuffmanTable.
@@ -114,159 +100,22 @@ diff -rNuZ a/src/3rdparty/libwebp/ChangeLog b/src/3rdparty/libwebp/ChangeLog
114100 +d9a505ff CMakeLists.txt: allow CMAKE_INSTALL_RPATH to be set empty
115101 +bdf33d03 Merge tag 'v1.3.0'
116102 +b5577769 update ChangeLog (tag: v1.3.0-rc1, tag: v1.3.0)
117-+0ba77244 update NEWS
118-+e763eb1e bump version to 1.3.0
119-+2a8686fc update AUTHORS
120-+106a57c1 Merge "*/Android.mk: add a check for NDK_ROOT" into main
121-+c5e841c4 Merge "extras: WebpToSDL -> WebPToSDL" into main
122-+dbc30715 Merge "xcframeworkbuild.sh: bump MACOSX_CATALYST_MIN_VERSION" into main
123-+6fc1a9f9 */Android.mk: add a check for NDK_ROOT
124-+d3e151fc doc/api.md,webp_js/README.md: Webp -> WebP
125-+ed92a626 extras: WebpToSDL -> WebPToSDL
126-+6eb0189b xcframeworkbuild.sh: bump MACOSX_CATALYST_MIN_VERSION
127-+1d58575b CMake: align .pc variables with autoconf
128-+e5fe2cfc webp-lossless-bitstream-spec,cosmetics: reflow paragraphs
129-+0ceeeab9 webp-lossless-bitstream-spec: add amendment note
130-+607611cd Merge "webp-container-spec: normalize section title case" into main
131-+f853685e lossless: SUBTRACT_GREEN -> SUBTRACT_GREEN_TRANSFORM
132-+786497e4 webp-lossless-bitstream-spec: fix inv color txfm description
133-+c6ac672d webp-lossless-bitstream-spec: fix num_code_lengths check
134-+b5700efb webp-lossless-bitstream-spec,cosmetics: grammar/capitalization
135-+d8ed8c11 webp-container-spec: normalize section title case
136-+52ec0b8f Merge changes Ie975dbb5,Ifc8c93af,I6ca7c5d6,I2e8d66f5,I152477b8 into main
137-+5097ef62 webp-container-spec,cosmetics: grammar/capitalization
138-+e3ba2b1f webp-lossless-bitstream-spec,cosmetics: reflow abstract
139-+1e8e3ded webp-lossless-bitstream-spec: reword abstract re alpha
140-+017cb6fa webp-container-spec,cosmetics: normalize range syntax
141-+f6a4684b webp-lossless-bitstream-spec,cosmetics: normalize range syntax
142-+54ebd5a3 webp-lossless-bitstream-spec: limit dist map lut to 69 cols
143-+44741f9c webp-lossless-bitstream-spec: fix dist mapping example
144-+fad0ece7 pnmdec.c: use snprintf instead of sprintf
145-+3f73e8f7 sharpyuv: add SharpYuvGetVersion()
146-+ce2f2d66 SharpYuvConvert: fix a race on SharpYuvGetCPUInfo
147-+a458e308 sharpyuv_dsp.h: restore sharpyuv_cpu.h include
148-+9ba800a7 Merge changes Id72fbf3b,Ic59d23a2 into main
149-+979c0ebb sharpyuv: add SharpYuvGetCPUInfo
150-+8bab09a4 Merge "*.pc.in: rename lib_prefix to webp_libname_prefix" into main
151-+769387c5 cpu.c,cosmetics: fix a typo
152-+a02978c2 sharpyuv/Makefile.am+cmake: add missing -lm
153-+28aedcb9 *.pc.in: rename lib_prefix to webp_libname_prefix
154-+c42e6d5a configure.ac: export an empty lib_prefix variable
155-+dfc843aa Merge "*.pc.in: add lib prefix to lib names w/MSVC" into main
156-+2498209b *.pc.in: add lib prefix to lib names w/MSVC
157-+ac252b61 Merge "analysis_enc.c: fix a dead store warning" into main
158-+56944762 analysis_enc.c: fix a dead store warning
159-+d34f9b99 Merge "webp-lossless-bitstream-spec: convert BNF to ABNF" into main
160-+dc05b4db Merge changes I96bc063c,I45880467,If9e18e5a,I6ee938e4,I0a410b28, ... into main
161-+83270c7f webp-container-spec: add prose for rendering process
162-+73b19b64 webp-container-spec: note reserved fields MUST be ignored
163-+57101d3f webp-lossless-bitstream-spec: improve 'small' color table stmt
164-+dfd32e45 webp-container-spec: remove redundant sentence
165-+8a6185dd doc/webp-*: fix some punctuation, grammar
166-+72776530 webp-lossless-bitstream-spec: convert BNF to ABNF
167-+d992bb08 cmake: rename cpufeatures target to cpufeatures-webp
168-+3ed2b275 webp-container-spec: clarify background color note
169-+951c292d webp-container-spec: come too late -> out of order
170-+902dd787 webp-container-spec: prefer hex literals
171-+a8f6b5ee webp-container-spec: change SHOULD to MUST w/ANIM chunk
172-+1dc59435 webp-container-spec: add unknown fields MUST be ignored
173-+280a810f webp-container-spec: make padding byte=0 a MUST
174-+41f0bf68 webp-container-spec: update note on trailing data
175-+6bdd36db webp-container-spec: clarify Chunk Size is in bytes
176-+87e36c48 Merge "webp_js/README.md,cosmetics: reflow some lines" into main
177-+5b01f321 Merge "Update Windows makefile to build libsharpyuv library." into main
178-+19b1a71c webp_js/README.md,cosmetics: reflow some lines
179-+780db756 Update Windows makefile to build libsharpyuv library.
180-+e407d4b3 CMakeLists.txt: replace GLUT_glut_LIBRARY w/GLUT::GLUT
181-+abf73d62 Merge "WebPConfig.cmake.in: add find_dependency(Threads)" into main
182-+25807fb4 Merge "cmake: restore compatibility with cmake < 3.12" into main
183-+5dbc4bfa WebPConfig.cmake.in: add find_dependency(Threads)
184-+b2a175dd Merge "Update wasm instructions." into main
185-+cb90f76b Update wasm instructions.
186-+02d15258 cmake: restore compatibility with cmake < 3.12
187-+5ba046e2 CMake: add_definitions -> add_compile_options
188-+e68765af dsp,neon: use vaddv in a few more places
189-+e8f83de2 Set libsharpyuv include dir to 'webp' subdirectory.
190-+15a91ab1 cmake,cosmetics: apply cmake-format
191-+0dd49d1a CMakeLists.txt: set @ONLY in configure_file() calls
192-+62b1bfe8 Merge changes I2877e7bb,I777cad70,I15af7d1a,I686e6740,If10538a9, ... into main
193-+95c8fe5f Merge changes Iecea3603,I9dc228ab into main
194-+e7c805cf picture_csp_enc.c: remove SafeInitSharpYuv
195-+6af8845a sharpyuv: prefer webp/types.h
196-+639619ce cmake: fix dll exports
197-+782ed48c sharpyuv,SharpYuvInit: add mutex protection when available
198-+cad0d5ad sharyuv_{neon,sse2}.c: merge WEBP_USE_* sections
199-+ef70ee06 add a few missing <stddef.h> includes for NULL
200-+f0f9eda4 sharpyuv.h: remove <inttypes.h>
201-+9b902cba Merge "picture_csp_enc.c,CheckNonOpaque: rm unneeded local" into main
202-+9c1d457c cmake/cpu.cmake: remove unused variable
203-+9ac25bcb CMakeLists.txt,win32: match naming convention used by nmake
204-+76c353ba picture_csp_enc.c,CheckNonOpaque: rm unneeded local
205-+5000de54 Merge "cwebp: fix WebPPictureHasTransparency call" into main
206-+e1729309 Merge "WebPPictureHasTransparency: add missing pointer check" into main
207-+00ff988a vp8l_enc,AddSingleSubGreen: clear int sanitizer warnings
208-+e2fecc22 dsp/lossless_enc.c: clear int sanitizer warnings
209-+129cf9e9 dsp/lossless.c: clear int sanitizer warnings
210-+ad7d1753 dsp/lossless_enc.c: clear int sanitizer warnings
211-+5037220e VP8LSubtractGreenFromBlueAndRed_C: clear int sanitizer warnings
212-+2ee786c7 upsampling_sse2.c: clear int sanitizer warnings
213-+4cc157d4 ParseOptionalChunks: clear int sanitizer warning
214-+892cf033 BuildHuffmanTable: clear int sanitizer warning
215-+3a9a4d45 VP8GetSigned: clear int sanitizer warnings
216-+704a3d0a dsp/lossless.c: quiet int sanitizer warnings
217-+1a6c109c WebPPictureHasTransparency: add missing pointer check
218-+c626e7d5 cwebp: fix WebPPictureHasTransparency call
219-+866e349c Merge tag 'v1.2.4'
220-+c170df38 Merge "Create libsharpyuv.a in makefile.unix." into main
221-+9d7ff74a Create libsharpyuv.a in makefile.unix.
103+ 0ba77244 update NEWS
104+ e763eb1e bump version to 1.3.0
105+ 2a8686fc update AUTHORS
106+@@ -103,7 +182,7 @@
107+ 866e349c Merge tag 'v1.2.4'
108+ c170df38 Merge "Create libsharpyuv.a in makefile.unix." into main
109+ 9d7ff74a Create libsharpyuv.a in makefile.unix.
110+-0d1f1254 update ChangeLog (tag: v1.2.4, origin/1.2.4)
222111 +0d1f1254 update ChangeLog (tag: v1.2.4)
223-+fcbc2d78 Merge "doc/*.txt: restrict code to 69 columns" into main
224-+4ad0e189 Merge "webp-container-spec.txt: normalize fourcc spelling" into main
112+ fcbc2d78 Merge "doc/*.txt: restrict code to 69 columns" into main
113+ 4ad0e189 Merge "webp-container-spec.txt: normalize fourcc spelling" into main
225114 980d2488 update NEWS
226- 9fde8127 bump version to 1.2.4
227-+7a0a9935 doc/*.txt: restrict code to 69 columns
228-+c040a615 webp-container-spec.txt: normalize fourcc spelling
229-+aff1c546 dsp,x86: normalize types w/_mm_cvtsi128_si32 calls
230-+ab540ae0 dsp,x86: normalize types w/_mm_cvtsi32_si128 calls
231-+8980362e dsp,x86: normalize types w/_mm_set* calls (2)
232- e626925c lossless: fix crunch mode w/WEBP_REDUCE_SIZE
233-+83539239 dsp,x86: normalize types w/_mm_set* calls
234-+8a4576ce webp-container-spec.txt: replace &amp; with &
235-+db870881 Merge "webp-container-spec.txt: make reserved 0 values a MUST" into main
236-+01d7d378 webp-lossless-bitstream-spec: number all sections
237-+337cf69f webp-lossless-bitstream-spec: mv Nomenclature after Intro
238-+79be856e Merge changes I7111d1f7,I872cd62c into main
239-+5b87983a webp-container-spec.txt: make reserved 0 values a MUST
240-+bd939123 Merge changes I7a25b1a6,I51b2c2a0,I87d0cbcf,I6ec60af6,I0a3fe9dc into main
241-+04764b56 libwebp.pc: add libsharpyuv to requires
242-+7deee810 libsharpyuv: add pkg-config file
243-+1a64a7e6 webp-container-spec.txt: clarify some SHOULDs
244-+bec2c88a webp-container-spec.txt: move ChunkHeader to terminology
245-+c9359332 webp-container-spec.txt: clarify 'VP8 '/'XMP ' fourccs
246-+70fe3063 webp-container-spec.txt: rightsize table entries
247-+ddbf3f3f webp-container-spec.txt: update 'key words' text
248-+c151e95b utils.h,WEBP_ALIGN: make bitmask unsigned
249-+748e92bb add WebPInt32ToMem
250-+3fe15b67 Merge "Build libsharpyuv as a full installable library." into main
251-+4f402f34 add WebPMemToInt32
252-+a3b68c19 Build libsharpyuv as a full installable library.
253-+b4994eaa CMake: set rpath for shared objects
254-+94cd7117 Merge "CMake: fix dylib versioning" into main
255-+e91451b6 Fix the lossless specs a bit more.
256-+231bdfb7 CMake: fix dylib versioning
257- bfad7ab5 CMakeLists.txt: correct libwebpmux name in WebPConfig.cmake
258- c2e3fd30 Revert "cmake: fix webpmux lib name for cmake linking"
259-+7366f7f3 Merge "lossless: fix crunch mode w/WEBP_REDUCE_SIZE" into main
260-+84163d9d lossless: fix crunch mode w/WEBP_REDUCE_SIZE
261-+d01c1eb3 webp-lossless-bitstream-spec,cosmetics: normalize capitalization
262-+8813ca8e Merge tag 'v1.2.3'
263- 3c4a0fbf update ChangeLog (tag: v1.2.3)
264- 56a480e8 dsp/cpu.h: add missing extern "C"
265- 62b45bdd update ChangeLog (tag: v1.2.3-rc1)
266115 diff -rNuZ a/src/3rdparty/libwebp/NEWS b/src/3rdparty/libwebp/NEWS
267---- a/src/3rdparty/libwebp/NEWS 2023-11-01 02:38:38.000000000 +0800
268-+++ b/src/3rdparty/libwebp/NEWS 2023-09-14 06:11:07.000000000 +0800
269-@@ -1,3 +1,30 @@
116+--- a/src/3rdparty/libwebp/NEWS 2024-03-27 03:34:35.000000000 +0800
117++++ b/src/3rdparty/libwebp/NEWS 2024-03-17 19:08:13.322351600 +0800
118+@@ -1,3 +1,22 @@
270119 +- 9/13/2023: version 1.3.2
271120 + This is a binary compatible release.
272121 + * security fix for lossless decoder (chromium: #1479274, CVE-2023-4863)
@@ -286,20 +135,12 @@ diff -rNuZ a/src/3rdparty/libwebp/NEWS b/src/3rdparty/libwebp/NEWS
286135 + * CMake fixes (#592, #610, #612)
287136 + * further updates to the container and lossless bitstream docs (#581, #611)
288137 +
289-+- 12/16/2022: version 1.3.0
290-+ This is a binary compatible release.
291-+ * add libsharpyuv, which exposes -sharp_yuv/config.use_sharp_yuv
292-+ functionality to other libraries; libwebp now depends on this library
293-+ * major updates to the container and lossless bitstream docs (#448, #546,
294-+ #551)
295-+ * miscellaneous warning, bug & build fixes (#576, #583, #584)
296-+
297- - 8/4/2022: version 1.2.4
138+ - 12/16/2022: version 1.3.0
298139 This is a binary compatible release.
299- * restore CMake libwebpmux target name for compatibility with 1.2.2 (#575)
140+ * add libsharpyuv, which exposes -sharp_yuv/config.use_sharp_yuv
300141 diff -rNuZ a/src/3rdparty/libwebp/patches/0001-Fix-Windows-build-for-clang-and-neon.patch b/src/3rdparty/libwebp/patches/0001-Fix-Windows-build-for-clang-and-neon.patch
301---- a/src/3rdparty/libwebp/patches/0001-Fix-Windows-build-for-clang-and-neon.patch 2023-11-01 02:38:38.000000000 +0800
302-+++ b/src/3rdparty/libwebp/patches/0001-Fix-Windows-build-for-clang-and-neon.patch 2024-03-17 17:51:53.649178500 +0800
142+--- a/src/3rdparty/libwebp/patches/0001-Fix-Windows-build-for-clang-and-neon.patch 2024-03-27 03:34:35.000000000 +0800
143++++ b/src/3rdparty/libwebp/patches/0001-Fix-Windows-build-for-clang-and-neon.patch 2024-03-17 19:08:13.322351600 +0800
303144 @@ -1,17 +1,15 @@
304145 -diff --git a/src/3rdparty/libwebp/src/dsp/cpu.h b/src/3rdparty/libwebp/src/dsp/cpu.h
305146 -index 57a40d8..8cf3e92 100644
@@ -343,19 +184,19 @@ diff -rNuZ a/src/3rdparty/libwebp/patches/0001-Fix-Windows-build-for-clang-and-n
343184 #define WEBP_USE_NEON
344185 #define WEBP_USE_INTRINSICS
345186 diff -rNuZ a/src/3rdparty/libwebp/qt_attribution.json b/src/3rdparty/libwebp/qt_attribution.json
346---- a/src/3rdparty/libwebp/qt_attribution.json 2023-11-01 02:38:38.000000000 +0800
347-+++ b/src/3rdparty/libwebp/qt_attribution.json 2024-03-17 17:44:39.084175500 +0800
187+--- a/src/3rdparty/libwebp/qt_attribution.json 2024-03-27 03:34:35.000000000 +0800
188++++ b/src/3rdparty/libwebp/qt_attribution.json 2024-03-17 19:08:13.322351600 +0800
348189 @@ -6,7 +6,7 @@
349190
350191 "Description": "WebP is a new image format that provides lossless and lossy compression for images on the web.",
351192 "Homepage": "https://developers.google.com/speed/webp/",
352-- "Version": "1.2.4",
193+- "Version": "1.3.0",
353194 + "Version": "1.3.2",
354195 "License": "BSD 3-clause \"New\" or \"Revised\" License",
355196 "LicenseId": "BSD-3-Clause",
356197 "LicenseFile": "COPYING",
357198 diff -rNuZ a/src/3rdparty/libwebp/README b/src/3rdparty/libwebp/README
358---- a/src/3rdparty/libwebp/README 2023-11-01 02:38:38.000000000 +0800
199+--- a/src/3rdparty/libwebp/README 2024-03-27 03:34:35.000000000 +0800
359200 +++ b/src/3rdparty/libwebp/README 1970-01-01 08:00:00.000000000 +0800
360201 @@ -1,795 +0,0 @@
361202 - __ __ ____ ____ ____
@@ -1155,7 +996,7 @@ diff -rNuZ a/src/3rdparty/libwebp/README b/src/3rdparty/libwebp/README
1155996 -Web: https://groups.google.com/a/webmproject.org/group/webp-discuss
1156997 diff -rNuZ a/src/3rdparty/libwebp/README.md b/src/3rdparty/libwebp/README.md
1157998 --- a/src/3rdparty/libwebp/README.md 1970-01-01 08:00:00.000000000 +0800
1158-+++ b/src/3rdparty/libwebp/README.md 2023-09-14 06:11:07.000000000 +0800
999++++ b/src/3rdparty/libwebp/README.md 2024-03-17 19:08:13.328221700 +0800
11591000 @@ -0,0 +1,53 @@
11601001 +# WebP Codec
11611002 +
@@ -1211,265 +1052,32 @@ diff -rNuZ a/src/3rdparty/libwebp/README.md b/src/3rdparty/libwebp/README.md
12111052 +
12121053 +Web: https://groups.google.com/a/webmproject.org/group/webp-discuss
12131054 diff -rNuZ a/src/3rdparty/libwebp/sharpyuv/sharpyuv.c b/src/3rdparty/libwebp/sharpyuv/sharpyuv.c
1214---- a/src/3rdparty/libwebp/sharpyuv/sharpyuv.c 2023-11-01 02:38:38.000000000 +0800
1215-+++ b/src/3rdparty/libwebp/sharpyuv/sharpyuv.c 2023-09-14 06:11:07.000000000 +0800
1216-@@ -15,16 +15,22 @@
1217-
1218- #include <assert.h>
1219- #include <limits.h>
1220--#include <math.h>
1221-+#include <stddef.h>
1222- #include <stdlib.h>
1223- #include <string.h>
1224-
1225- #include "src/webp/types.h"
1226--#include "src/dsp/cpu.h"
1227-+#include "sharpyuv/sharpyuv_cpu.h"
1228- #include "sharpyuv/sharpyuv_dsp.h"
1229- #include "sharpyuv/sharpyuv_gamma.h"
1230-
1231- //------------------------------------------------------------------------------
1232-+
1233-+int SharpYuvGetVersion(void) {
1234-+ return SHARPYUV_VERSION;
1235-+}
1236-+
1237-+//------------------------------------------------------------------------------
1238- // Sharp RGB->YUV conversion
1239-
1240- static const int kNumIterations = 4;
1241-@@ -414,24 +420,46 @@
1242- }
1243- #undef SAFE_ALLOC
1244-
1245-+#if defined(WEBP_USE_THREAD) && !defined(_WIN32)
1246-+#include <pthread.h> // NOLINT
1247-+
1248-+#define LOCK_ACCESS \
1249-+ static pthread_mutex_t sharpyuv_lock = PTHREAD_MUTEX_INITIALIZER; \
1250-+ if (pthread_mutex_lock(&sharpyuv_lock)) return
1251-+#define UNLOCK_ACCESS_AND_RETURN \
1252-+ do { \
1253-+ (void)pthread_mutex_unlock(&sharpyuv_lock); \
1254-+ return; \
1255-+ } while (0)
1256-+#else // !(defined(WEBP_USE_THREAD) && !defined(_WIN32))
1257-+#define LOCK_ACCESS do {} while (0)
1258-+#define UNLOCK_ACCESS_AND_RETURN return
1259-+#endif // defined(WEBP_USE_THREAD) && !defined(_WIN32)
1260-+
1261- // Hidden exported init function.
1262--// By default SharpYuvConvert calls it with NULL. If needed, users can declare
1263--// it as extern and call it with a VP8CPUInfo function.
1264--extern void SharpYuvInit(VP8CPUInfo cpu_info_func);
1265-+// By default SharpYuvConvert calls it with SharpYuvGetCPUInfo. If needed,
1266-+// users can declare it as extern and call it with an alternate VP8CPUInfo
1267-+// function.
1055+--- a/src/3rdparty/libwebp/sharpyuv/sharpyuv.c 2024-03-27 03:34:35.000000000 +0800
1056++++ b/src/3rdparty/libwebp/sharpyuv/sharpyuv.c 2024-03-17 19:08:13.328221700 +0800
1057+@@ -440,6 +440,7 @@
1058+ // By default SharpYuvConvert calls it with SharpYuvGetCPUInfo. If needed,
1059+ // users can declare it as extern and call it with an alternate VP8CPUInfo
1060+ // function.
12681061 +extern VP8CPUInfo SharpYuvGetCPUInfo;
1269-+SHARPYUV_EXTERN void SharpYuvInit(VP8CPUInfo cpu_info_func);
1062+ SHARPYUV_EXTERN void SharpYuvInit(VP8CPUInfo cpu_info_func);
12701063 void SharpYuvInit(VP8CPUInfo cpu_info_func) {
12711064 static volatile VP8CPUInfo sharpyuv_last_cpuinfo_used =
1272- (VP8CPUInfo)&sharpyuv_last_cpuinfo_used;
1273-- const int initialized =
1274-- (sharpyuv_last_cpuinfo_used != (VP8CPUInfo)&sharpyuv_last_cpuinfo_used);
1275-- if (cpu_info_func == NULL && initialized) return;
1276-- if (sharpyuv_last_cpuinfo_used == cpu_info_func) return;
1277--
1278-- SharpYuvInitDsp(cpu_info_func);
1279-- if (!initialized) {
1280-- SharpYuvInitGammaTables();
1281-+ LOCK_ACCESS;
1282-+ // Only update SharpYuvGetCPUInfo when called from external code to avoid a
1283-+ // race on reading the value in SharpYuvConvert().
1284-+ if (cpu_info_func != (VP8CPUInfo)&SharpYuvGetCPUInfo) {
1285-+ SharpYuvGetCPUInfo = cpu_info_func;
1286- }
1287-+ if (sharpyuv_last_cpuinfo_used == SharpYuvGetCPUInfo) {
1288-+ UNLOCK_ACCESS_AND_RETURN;
1289-+ }
1290-+
1291-+ SharpYuvInitDsp();
1292-+ SharpYuvInitGammaTables();
1293-
1294-- sharpyuv_last_cpuinfo_used = cpu_info_func;
1295-+ sharpyuv_last_cpuinfo_used = SharpYuvGetCPUInfo;
1296-+ UNLOCK_ACCESS_AND_RETURN;
1297- }
1298-
1299- int SharpYuvConvert(const void* r_ptr, const void* g_ptr,
1300-@@ -467,7 +495,8 @@
1301- // Stride should be even for uint16_t buffers.
1302- return 0;
1303- }
1304-- SharpYuvInit(NULL);
1305-+ // The address of the function pointer is used to avoid a read race.
1306-+ SharpYuvInit((VP8CPUInfo)&SharpYuvGetCPUInfo);
1307-
1308- // Add scaling factor to go from rgb_bit_depth to yuv_bit_depth, to the
1309- // rgb->yuv conversion matrix.
13101065 diff -rNuZ a/src/3rdparty/libwebp/sharpyuv/sharpyuv.h b/src/3rdparty/libwebp/sharpyuv/sharpyuv.h
1311---- a/src/3rdparty/libwebp/sharpyuv/sharpyuv.h 2023-11-01 02:38:38.000000000 +0800
1312-+++ b/src/3rdparty/libwebp/sharpyuv/sharpyuv.h 2023-09-14 06:11:07.000000000 +0800
1313-@@ -12,16 +12,32 @@
1314- #ifndef WEBP_SHARPYUV_SHARPYUV_H_
1315- #define WEBP_SHARPYUV_SHARPYUV_H_
1316-
1317--#include <inttypes.h>
1318--
1319- #ifdef __cplusplus
1320- extern "C" {
1321- #endif
1322-
1323-+#ifndef SHARPYUV_EXTERN
1324-+#ifdef WEBP_EXTERN
1325-+#define SHARPYUV_EXTERN WEBP_EXTERN
1326-+#else
1327-+// This explicitly marks library functions and allows for changing the
1328-+// signature for e.g., Windows DLL builds.
1329-+#if defined(__GNUC__) && __GNUC__ >= 4
1330-+#define SHARPYUV_EXTERN extern __attribute__((visibility("default")))
1331-+#else
1332-+#if defined(_MSC_VER) && defined(WEBP_DLL)
1333-+#define SHARPYUV_EXTERN __declspec(dllexport)
1334-+#else
1335-+#define SHARPYUV_EXTERN extern
1336-+#endif /* _MSC_VER && WEBP_DLL */
1337-+#endif /* __GNUC__ >= 4 */
1338-+#endif /* WEBP_EXTERN */
1339-+#endif /* SHARPYUV_EXTERN */
1340-+
1066+--- a/src/3rdparty/libwebp/sharpyuv/sharpyuv.h 2024-03-27 03:34:35.000000000 +0800
1067++++ b/src/3rdparty/libwebp/sharpyuv/sharpyuv.h 2024-03-17 19:08:13.328221700 +0800
1068+@@ -37,7 +37,7 @@
13411069 // SharpYUV API version following the convention from semver.org
13421070 #define SHARPYUV_VERSION_MAJOR 0
1343--#define SHARPYUV_VERSION_MINOR 1
1071+ #define SHARPYUV_VERSION_MINOR 2
13441072 -#define SHARPYUV_VERSION_PATCH 0
1345-+#define SHARPYUV_VERSION_MINOR 2
13461073 +#define SHARPYUV_VERSION_PATCH 1
13471074 // Version as a uint32_t. The major number is the high 8 bits.
13481075 // The minor number is the middle 8 bits. The patch number is the low 16 bits.
13491076 #define SHARPYUV_MAKE_VERSION(MAJOR, MINOR, PATCH) \
1350-@@ -30,6 +46,10 @@
1351- SHARPYUV_MAKE_VERSION(SHARPYUV_VERSION_MAJOR, SHARPYUV_VERSION_MINOR, \
1352- SHARPYUV_VERSION_PATCH)
1353-
1354-+// Returns the library's version number, packed in hexadecimal. See
1355-+// SHARPYUV_VERSION.
1356-+SHARPYUV_EXTERN int SharpYuvGetVersion(void);
1357-+
1358- // RGB to YUV conversion matrix, in 16 bit fixed point.
1359- // y = rgb_to_y[0] * r + rgb_to_y[1] * g + rgb_to_y[2] * b + rgb_to_y[3]
1360- // u = rgb_to_u[0] * r + rgb_to_u[1] * g + rgb_to_u[2] * b + rgb_to_u[3]
1361-@@ -65,11 +85,13 @@
1362- // adjacent pixels on the y, u and v channels. If yuv_bit_depth > 8, they
1363- // should be multiples of 2.
1364- // width, height: width and height of the image in pixels
1365--int SharpYuvConvert(const void* r_ptr, const void* g_ptr, const void* b_ptr,
1366-- int rgb_step, int rgb_stride, int rgb_bit_depth,
1367-- void* y_ptr, int y_stride, void* u_ptr, int u_stride,
1368-- void* v_ptr, int v_stride, int yuv_bit_depth, int width,
1369-- int height, const SharpYuvConversionMatrix* yuv_matrix);
1370-+SHARPYUV_EXTERN int SharpYuvConvert(const void* r_ptr, const void* g_ptr,
1371-+ const void* b_ptr, int rgb_step,
1372-+ int rgb_stride, int rgb_bit_depth,
1373-+ void* y_ptr, int y_stride, void* u_ptr,
1374-+ int u_stride, void* v_ptr, int v_stride,
1375-+ int yuv_bit_depth, int width, int height,
1376-+ const SharpYuvConversionMatrix* yuv_matrix);
1377-
1378- // TODO(b/194336375): Add YUV444 to YUV420 conversion. Maybe also add 422
1379- // support (it's rarely used in practice, especially for images).
1380-diff -rNuZ a/src/3rdparty/libwebp/sharpyuv/sharpyuv_cpu.c b/src/3rdparty/libwebp/sharpyuv/sharpyuv_cpu.c
1381---- a/src/3rdparty/libwebp/sharpyuv/sharpyuv_cpu.c 1970-01-01 08:00:00.000000000 +0800
1382-+++ b/src/3rdparty/libwebp/sharpyuv/sharpyuv_cpu.c 2023-09-14 06:11:07.000000000 +0800
1383-@@ -0,0 +1,14 @@
1384-+// Copyright 2022 Google Inc. All Rights Reserved.
1385-+//
1386-+// Use of this source code is governed by a BSD-style license
1387-+// that can be found in the COPYING file in the root of the source
1388-+// tree. An additional intellectual property rights grant can be found
1389-+// in the file PATENTS. All contributing project authors may
1390-+// be found in the AUTHORS file in the root of the source tree.
1391-+// -----------------------------------------------------------------------------
1392-+//
1393-+#include "sharpyuv/sharpyuv_cpu.h"
1394-+
1395-+// Include src/dsp/cpu.c to create SharpYuvGetCPUInfo from VP8GetCPUInfo. The
1396-+// function pointer is renamed in sharpyuv_cpu.h.
1397-+#include "src/dsp/cpu.c"
1398-diff -rNuZ a/src/3rdparty/libwebp/sharpyuv/sharpyuv_cpu.h b/src/3rdparty/libwebp/sharpyuv/sharpyuv_cpu.h
1399---- a/src/3rdparty/libwebp/sharpyuv/sharpyuv_cpu.h 1970-01-01 08:00:00.000000000 +0800
1400-+++ b/src/3rdparty/libwebp/sharpyuv/sharpyuv_cpu.h 2023-09-14 06:11:07.000000000 +0800
1401-@@ -0,0 +1,22 @@
1402-+// Copyright 2022 Google Inc. All Rights Reserved.
1403-+//
1404-+// Use of this source code is governed by a BSD-style license
1405-+// that can be found in the COPYING file in the root of the source
1406-+// tree. An additional intellectual property rights grant can be found
1407-+// in the file PATENTS. All contributing project authors may
1408-+// be found in the AUTHORS file in the root of the source tree.
1409-+// -----------------------------------------------------------------------------
1410-+//
1411-+#ifndef WEBP_SHARPYUV_SHARPYUV_CPU_H_
1412-+#define WEBP_SHARPYUV_SHARPYUV_CPU_H_
1413-+
1414-+#include "sharpyuv/sharpyuv.h"
1415-+
1416-+// Avoid exporting SharpYuvGetCPUInfo in shared object / DLL builds.
1417-+// SharpYuvInit() replaces the use of the function pointer.
1418-+#undef WEBP_EXTERN
1419-+#define WEBP_EXTERN extern
1420-+#define VP8GetCPUInfo SharpYuvGetCPUInfo
1421-+#include "src/dsp/cpu.h"
1422-+
1423-+#endif // WEBP_SHARPYUV_SHARPYUV_CPU_H_
1424-diff -rNuZ a/src/3rdparty/libwebp/sharpyuv/sharpyuv_csp.c b/src/3rdparty/libwebp/sharpyuv/sharpyuv_csp.c
1425---- a/src/3rdparty/libwebp/sharpyuv/sharpyuv_csp.c 2023-11-01 02:38:38.000000000 +0800
1426-+++ b/src/3rdparty/libwebp/sharpyuv/sharpyuv_csp.c 2023-09-14 06:11:07.000000000 +0800
1427-@@ -13,7 +13,7 @@
1428-
1429- #include <assert.h>
1430- #include <math.h>
1431--#include <string.h>
1432-+#include <stddef.h>
1433-
1434- static int ToFixed16(float f) { return (int)floor(f * (1 << 16) + 0.5f); }
1435-
1436-diff -rNuZ a/src/3rdparty/libwebp/sharpyuv/sharpyuv_csp.h b/src/3rdparty/libwebp/sharpyuv/sharpyuv_csp.h
1437---- a/src/3rdparty/libwebp/sharpyuv/sharpyuv_csp.h 2023-11-01 02:38:38.000000000 +0800
1438-+++ b/src/3rdparty/libwebp/sharpyuv/sharpyuv_csp.h 2023-09-14 06:11:07.000000000 +0800
1439-@@ -35,8 +35,9 @@
1440- } SharpYuvColorSpace;
1441-
1442- // Fills in 'matrix' for the given YUVColorSpace.
1443--void SharpYuvComputeConversionMatrix(const SharpYuvColorSpace* yuv_color_space,
1444-- SharpYuvConversionMatrix* matrix);
1445-+SHARPYUV_EXTERN void SharpYuvComputeConversionMatrix(
1446-+ const SharpYuvColorSpace* yuv_color_space,
1447-+ SharpYuvConversionMatrix* matrix);
1448-
1449- // Enums for precomputed conversion matrices.
1450- typedef enum {
1451-@@ -49,7 +50,7 @@
1452- } SharpYuvMatrixType;
1453-
1454- // Returns a pointer to a matrix for one of the predefined colorspaces.
1455--const SharpYuvConversionMatrix* SharpYuvGetConversionMatrix(
1456-+SHARPYUV_EXTERN const SharpYuvConversionMatrix* SharpYuvGetConversionMatrix(
1457- SharpYuvMatrixType matrix_type);
1458-
1459- #ifdef __cplusplus
14601077 diff -rNuZ a/src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.c b/src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.c
1461---- a/src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.c 2023-11-01 02:38:38.000000000 +0800
1462-+++ b/src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.c 2023-09-14 06:11:07.000000000 +0800
1463-@@ -16,7 +16,7 @@
1464- #include <assert.h>
1465- #include <stdlib.h>
1466-
1467--#include "src/dsp/cpu.h"
1468-+#include "sharpyuv/sharpyuv_cpu.h"
1469-
1470- //-----------------------------------------------------------------------------
1471-
1472-@@ -72,26 +72,28 @@
1078+--- a/src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.c 2024-03-27 03:34:35.000000000 +0800
1079++++ b/src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.c 2024-03-17 19:08:13.332225200 +0800
1080+@@ -72,6 +72,7 @@
14731081 const uint16_t* best_y, uint16_t* out,
14741082 int bit_depth);
14751083
@@ -1477,140 +1085,9 @@ diff -rNuZ a/src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.c b/src/3rdparty/libwebp
14771085 extern void InitSharpYuvSSE2(void);
14781086 extern void InitSharpYuvNEON(void);
14791087
1480--void SharpYuvInitDsp(VP8CPUInfo cpu_info_func) {
1481-- (void)cpu_info_func;
1482--
1483-+void SharpYuvInitDsp(void) {
1484- #if !WEBP_NEON_OMIT_C_CODE
1485- SharpYuvUpdateY = SharpYuvUpdateY_C;
1486- SharpYuvUpdateRGB = SharpYuvUpdateRGB_C;
1487- SharpYuvFilterRow = SharpYuvFilterRow_C;
1488- #endif
1489-
1490-+ if (SharpYuvGetCPUInfo != NULL) {
1491- #if defined(WEBP_HAVE_SSE2)
1492-- if (cpu_info_func == NULL || cpu_info_func(kSSE2)) {
1493-- InitSharpYuvSSE2();
1494-- }
1495-+ if (SharpYuvGetCPUInfo(kSSE2)) {
1496-+ InitSharpYuvSSE2();
1497-+ }
1498- #endif // WEBP_HAVE_SSE2
1499-+ }
1500-
1501- #if defined(WEBP_HAVE_NEON)
1502-- if (WEBP_NEON_OMIT_C_CODE || cpu_info_func == NULL || cpu_info_func(kNEON)) {
1503-+ if (WEBP_NEON_OMIT_C_CODE ||
1504-+ (SharpYuvGetCPUInfo != NULL && SharpYuvGetCPUInfo(kNEON))) {
1505- InitSharpYuvNEON();
1506- }
1507- #endif // WEBP_HAVE_NEON
1508-diff -rNuZ a/src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.h b/src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.h
1509---- a/src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.h 2023-11-01 02:38:38.000000000 +0800
1510-+++ b/src/3rdparty/libwebp/sharpyuv/sharpyuv_dsp.h 2023-09-14 06:11:07.000000000 +0800
1511-@@ -12,9 +12,8 @@
1512- #ifndef WEBP_SHARPYUV_SHARPYUV_DSP_H_
1513- #define WEBP_SHARPYUV_SHARPYUV_DSP_H_
1514-
1515--#include <stdint.h>
1516--
1517--#include "src/dsp/cpu.h"
1518-+#include "sharpyuv/sharpyuv_cpu.h"
1519-+#include "src/webp/types.h"
1520-
1521- extern uint64_t (*SharpYuvUpdateY)(const uint16_t* src, const uint16_t* ref,
1522- uint16_t* dst, int len, int bit_depth);
1523-@@ -24,6 +23,6 @@
1524- const uint16_t* best_y, uint16_t* out,
1525- int bit_depth);
1526-
1527--void SharpYuvInitDsp(VP8CPUInfo cpu_info_func);
1528-+void SharpYuvInitDsp(void);
1529-
1530- #endif // WEBP_SHARPYUV_SHARPYUV_DSP_H_
1531-diff -rNuZ a/src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.c b/src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.c
1532---- a/src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.c 2023-11-01 02:38:38.000000000 +0800
1533-+++ b/src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.c 2023-09-14 06:11:07.000000000 +0800
1534-@@ -13,7 +13,6 @@
1535-
1536- #include <assert.h>
1537- #include <math.h>
1538--#include <stdint.h>
1539-
1540- #include "src/webp/types.h"
1541-
1542-diff -rNuZ a/src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.h b/src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.h
1543---- a/src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.h 2023-11-01 02:38:38.000000000 +0800
1544-+++ b/src/3rdparty/libwebp/sharpyuv/sharpyuv_gamma.h 2023-09-14 06:11:07.000000000 +0800
1545-@@ -12,7 +12,7 @@
1546- #ifndef WEBP_SHARPYUV_SHARPYUV_GAMMA_H_
1547- #define WEBP_SHARPYUV_SHARPYUV_GAMMA_H_
1548-
1549--#include <stdint.h>
1550-+#include "src/webp/types.h"
1551-
1552- #ifdef __cplusplus
1553- extern "C" {
1554-diff -rNuZ a/src/3rdparty/libwebp/sharpyuv/sharpyuv_neon.c b/src/3rdparty/libwebp/sharpyuv/sharpyuv_neon.c
1555---- a/src/3rdparty/libwebp/sharpyuv/sharpyuv_neon.c 2023-11-01 02:38:38.000000000 +0800
1556-+++ b/src/3rdparty/libwebp/sharpyuv/sharpyuv_neon.c 2023-09-14 06:11:07.000000000 +0800
1557-@@ -17,11 +17,6 @@
1558- #include <assert.h>
1559- #include <stdlib.h>
1560- #include <arm_neon.h>
1561--#endif
1562--
1563--extern void InitSharpYuvNEON(void);
1564--
1565--#if defined(WEBP_USE_NEON)
1566-
1567- static uint16_t clip_NEON(int v, int max) {
1568- return (v < 0) ? 0 : (v > max) ? max : (uint16_t)v;
1569-@@ -169,6 +164,8 @@
1570-
1571- //------------------------------------------------------------------------------
1572-
1573-+extern void InitSharpYuvNEON(void);
1574-+
1575- WEBP_TSAN_IGNORE_FUNCTION void InitSharpYuvNEON(void) {
1576- SharpYuvUpdateY = SharpYuvUpdateY_NEON;
1577- SharpYuvUpdateRGB = SharpYuvUpdateRGB_NEON;
1578-@@ -177,6 +174,8 @@
1579-
1580- #else // !WEBP_USE_NEON
1581-
1582-+extern void InitSharpYuvNEON(void);
1583-+
1584- void InitSharpYuvNEON(void) {}
1585-
1586- #endif // WEBP_USE_NEON
1587-diff -rNuZ a/src/3rdparty/libwebp/sharpyuv/sharpyuv_sse2.c b/src/3rdparty/libwebp/sharpyuv/sharpyuv_sse2.c
1588---- a/src/3rdparty/libwebp/sharpyuv/sharpyuv_sse2.c 2023-11-01 02:38:38.000000000 +0800
1589-+++ b/src/3rdparty/libwebp/sharpyuv/sharpyuv_sse2.c 2023-09-14 06:11:07.000000000 +0800
1590-@@ -16,11 +16,6 @@
1591- #if defined(WEBP_USE_SSE2)
1592- #include <stdlib.h>
1593- #include <emmintrin.h>
1594--#endif
1595--
1596--extern void InitSharpYuvSSE2(void);
1597--
1598--#if defined(WEBP_USE_SSE2)
1599-
1600- static uint16_t clip_SSE2(int v, int max) {
1601- return (v < 0) ? 0 : (v > max) ? max : (uint16_t)v;
1602-@@ -199,6 +194,8 @@
1603- }
1604- #else // !WEBP_USE_SSE2
1605-
1606-+extern void InitSharpYuvSSE2(void);
1607-+
1608- void InitSharpYuvSSE2(void) {}
1609-
1610- #endif // WEBP_USE_SSE2
16111088 diff -rNuZ a/src/3rdparty/libwebp/src/dec/tree_dec.c b/src/3rdparty/libwebp/src/dec/tree_dec.c
1612---- a/src/3rdparty/libwebp/src/dec/tree_dec.c 2023-11-01 02:38:38.000000000 +0800
1613-+++ b/src/3rdparty/libwebp/src/dec/tree_dec.c 2023-09-14 06:11:07.000000000 +0800
1089+--- a/src/3rdparty/libwebp/src/dec/tree_dec.c 2024-03-27 03:34:35.000000000 +0800
1090++++ b/src/3rdparty/libwebp/src/dec/tree_dec.c 2024-03-17 19:08:13.332225200 +0800
16141091 @@ -12,10 +12,11 @@
16151092 // Author: Skal (pascal.massimino@gmail.com)
16161093
@@ -1625,8 +1102,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dec/tree_dec.c b/src/3rdparty/libwebp/src/
16251102 #define USE_GENERIC_TREE 1 // ALTERNATE_CODE
16261103 #else
16271104 diff -rNuZ a/src/3rdparty/libwebp/src/dec/vp8_dec.c b/src/3rdparty/libwebp/src/dec/vp8_dec.c
1628---- a/src/3rdparty/libwebp/src/dec/vp8_dec.c 2023-11-01 02:38:38.000000000 +0800
1629-+++ b/src/3rdparty/libwebp/src/dec/vp8_dec.c 2023-09-14 06:11:07.000000000 +0800
1105+--- a/src/3rdparty/libwebp/src/dec/vp8_dec.c 2024-03-27 03:34:35.000000000 +0800
1106++++ b/src/3rdparty/libwebp/src/dec/vp8_dec.c 2024-03-17 19:08:13.342361800 +0800
16301107 @@ -494,6 +494,8 @@
16311108 return 16;
16321109 }
@@ -1637,22 +1114,20 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dec/vp8_dec.c b/src/3rdparty/libwebp/src/d
16371114 if (VP8GetCPUInfo != NULL && VP8GetCPUInfo(kSlowSSSE3)) {
16381115 GetCoeffs = GetCoeffsAlt;
16391116 diff -rNuZ a/src/3rdparty/libwebp/src/dec/vp8i_dec.h b/src/3rdparty/libwebp/src/dec/vp8i_dec.h
1640---- a/src/3rdparty/libwebp/src/dec/vp8i_dec.h 2023-11-01 02:38:38.000000000 +0800
1641-+++ b/src/3rdparty/libwebp/src/dec/vp8i_dec.h 2023-09-14 06:11:07.000000000 +0800
1642-@@ -31,8 +31,8 @@
1643-
1117+--- a/src/3rdparty/libwebp/src/dec/vp8i_dec.h 2024-03-27 03:34:35.000000000 +0800
1118++++ b/src/3rdparty/libwebp/src/dec/vp8i_dec.h 2024-03-17 19:08:13.343872800 +0800
1119+@@ -32,7 +32,7 @@
16441120 // version numbers
16451121 #define DEC_MAJ_VERSION 1
1646--#define DEC_MIN_VERSION 2
1647--#define DEC_REV_VERSION 4
1648-+#define DEC_MIN_VERSION 3
1122+ #define DEC_MIN_VERSION 3
1123+-#define DEC_REV_VERSION 0
16491124 +#define DEC_REV_VERSION 2
16501125
16511126 // YUV-cache parameters. Cache is 32-bytes wide (= one cacheline).
16521127 // Constraints are: We need to store one 16x16 block of luma samples (y),
16531128 diff -rNuZ a/src/3rdparty/libwebp/src/dec/vp8l_dec.c b/src/3rdparty/libwebp/src/dec/vp8l_dec.c
1654---- a/src/3rdparty/libwebp/src/dec/vp8l_dec.c 2023-11-01 02:38:38.000000000 +0800
1655-+++ b/src/3rdparty/libwebp/src/dec/vp8l_dec.c 2023-09-14 06:11:07.000000000 +0800
1129+--- a/src/3rdparty/libwebp/src/dec/vp8l_dec.c 2024-03-27 03:34:35.000000000 +0800
1130++++ b/src/3rdparty/libwebp/src/dec/vp8l_dec.c 2024-03-17 19:08:13.343872800 +0800
16561131 @@ -253,11 +253,11 @@
16571132 int symbol;
16581133 int max_symbol;
@@ -1779,15 +1254,6 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dec/vp8l_dec.c b/src/3rdparty/libwebp/src/
17791254 VP8LHtreeGroupsFree(htree_groups);
17801255 }
17811256 return ok;
1782-@@ -1336,7 +1340,7 @@
1783- ok = ok && ExpandColorMap(num_colors, transform);
1784- break;
1785- }
1786-- case SUBTRACT_GREEN:
1787-+ case SUBTRACT_GREEN_TRANSFORM:
1788- break;
1789- default:
1790- assert(0); // can't happen
17911257 @@ -1358,7 +1362,7 @@
17921258 assert(hdr != NULL);
17931259
@@ -1807,8 +1273,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dec/vp8l_dec.c b/src/3rdparty/libwebp/src/
18071273 assert(dec->hdr_.num_htree_groups_ > 0);
18081274
18091275 diff -rNuZ a/src/3rdparty/libwebp/src/dec/vp8li_dec.h b/src/3rdparty/libwebp/src/dec/vp8li_dec.h
1810---- a/src/3rdparty/libwebp/src/dec/vp8li_dec.h 2023-11-01 02:38:38.000000000 +0800
1811-+++ b/src/3rdparty/libwebp/src/dec/vp8li_dec.h 2023-09-14 06:11:07.000000000 +0800
1276+--- a/src/3rdparty/libwebp/src/dec/vp8li_dec.h 2024-03-27 03:34:35.000000000 +0800
1277++++ b/src/3rdparty/libwebp/src/dec/vp8li_dec.h 2024-03-17 19:08:13.343872800 +0800
18121278 @@ -51,7 +51,7 @@
18131279 uint32_t* huffman_image_;
18141280 int num_htree_groups_;
@@ -1819,17 +1285,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dec/vp8li_dec.h b/src/3rdparty/libwebp/src
18191285
18201286 typedef struct VP8LDecoder VP8LDecoder;
18211287 diff -rNuZ a/src/3rdparty/libwebp/src/dec/webp_dec.c b/src/3rdparty/libwebp/src/dec/webp_dec.c
1822---- a/src/3rdparty/libwebp/src/dec/webp_dec.c 2023-11-01 02:38:38.000000000 +0800
1823-+++ b/src/3rdparty/libwebp/src/dec/webp_dec.c 2023-09-14 06:11:07.000000000 +0800
1824-@@ -179,7 +179,7 @@
1825- return VP8_STATUS_BITSTREAM_ERROR; // Not a valid chunk size.
1826- }
1827- // For odd-sized chunk-payload, there's one byte padding at the end.
1828-- disk_chunk_size = (CHUNK_HEADER_SIZE + chunk_size + 1) & ~1;
1829-+ disk_chunk_size = (CHUNK_HEADER_SIZE + chunk_size + 1) & ~1u;
1830- total_size += disk_chunk_size;
1831-
1832- // Check that total bytes skipped so far does not exceed riff_size.
1288+--- a/src/3rdparty/libwebp/src/dec/webp_dec.c 2024-03-27 03:34:35.000000000 +0800
1289++++ b/src/3rdparty/libwebp/src/dec/webp_dec.c 2024-03-17 19:08:13.343872800 +0800
18331290 @@ -658,19 +658,26 @@
18341291 uint8_t* WebPDecodeYUV(const uint8_t* data, size_t data_size,
18351292 int* width, int* height, uint8_t** u, uint8_t** v,
@@ -1870,22 +1327,20 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dec/webp_dec.c b/src/3rdparty/libwebp/src/
18701327
18711328 static void DefaultFeatures(WebPBitstreamFeatures* const features) {
18721329 diff -rNuZ a/src/3rdparty/libwebp/src/demux/demux.c b/src/3rdparty/libwebp/src/demux/demux.c
1873---- a/src/3rdparty/libwebp/src/demux/demux.c 2023-11-01 02:38:38.000000000 +0800
1874-+++ b/src/3rdparty/libwebp/src/demux/demux.c 2023-09-14 06:11:07.000000000 +0800
1875-@@ -24,8 +24,8 @@
1876- #include "src/webp/format_constants.h"
1330+--- a/src/3rdparty/libwebp/src/demux/demux.c 2024-03-27 03:34:35.000000000 +0800
1331++++ b/src/3rdparty/libwebp/src/demux/demux.c 2024-03-17 19:08:13.343872800 +0800
1332+@@ -25,7 +25,7 @@
18771333
18781334 #define DMUX_MAJ_VERSION 1
1879--#define DMUX_MIN_VERSION 2
1880--#define DMUX_REV_VERSION 4
1881-+#define DMUX_MIN_VERSION 3
1335+ #define DMUX_MIN_VERSION 3
1336+-#define DMUX_REV_VERSION 0
18821337 +#define DMUX_REV_VERSION 2
18831338
18841339 typedef struct {
18851340 size_t start_; // start location of the data
18861341 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/alpha_processing.c b/src/3rdparty/libwebp/src/dsp/alpha_processing.c
1887---- a/src/3rdparty/libwebp/src/dsp/alpha_processing.c 2023-11-01 02:38:38.000000000 +0800
1888-+++ b/src/3rdparty/libwebp/src/dsp/alpha_processing.c 2023-09-14 06:11:07.000000000 +0800
1342+--- a/src/3rdparty/libwebp/src/dsp/alpha_processing.c 2024-03-27 03:34:35.000000000 +0800
1343++++ b/src/3rdparty/libwebp/src/dsp/alpha_processing.c 2024-03-17 19:08:13.343872800 +0800
18891344 @@ -425,6 +425,7 @@
18901345 //------------------------------------------------------------------------------
18911346 // Init function
@@ -1894,64 +1349,9 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/alpha_processing.c b/src/3rdparty/libw
18941349 extern void WebPInitAlphaProcessingMIPSdspR2(void);
18951350 extern void WebPInitAlphaProcessingSSE2(void);
18961351 extern void WebPInitAlphaProcessingSSE41(void);
1897-diff -rNuZ a/src/3rdparty/libwebp/src/dsp/alpha_processing_sse2.c b/src/3rdparty/libwebp/src/dsp/alpha_processing_sse2.c
1898---- a/src/3rdparty/libwebp/src/dsp/alpha_processing_sse2.c 2023-11-01 02:38:38.000000000 +0800
1899-+++ b/src/3rdparty/libwebp/src/dsp/alpha_processing_sse2.c 2023-09-14 06:11:07.000000000 +0800
1900-@@ -26,8 +26,8 @@
1901- uint32_t alpha_and = 0xff;
1902- int i, j;
1903- const __m128i zero = _mm_setzero_si128();
1904-- const __m128i rgb_mask = _mm_set1_epi32(0xffffff00u); // to preserve RGB
1905-- const __m128i all_0xff = _mm_set_epi32(0, 0, ~0u, ~0u);
1906-+ const __m128i rgb_mask = _mm_set1_epi32((int)0xffffff00); // to preserve RGB
1907-+ const __m128i all_0xff = _mm_set_epi32(0, 0, ~0, ~0);
1908- __m128i all_alphas = all_0xff;
1909-
1910- // We must be able to access 3 extra bytes after the last written byte
1911-@@ -106,8 +106,8 @@
1912- // value is not 0xff if any of the alpha[] is not equal to 0xff.
1913- uint32_t alpha_and = 0xff;
1914- int i, j;
1915-- const __m128i a_mask = _mm_set1_epi32(0xffu); // to preserve alpha
1916-- const __m128i all_0xff = _mm_set_epi32(0, 0, ~0u, ~0u);
1917-+ const __m128i a_mask = _mm_set1_epi32(0xff); // to preserve alpha
1918-+ const __m128i all_0xff = _mm_set_epi32(0, 0, ~0, ~0);
1919- __m128i all_alphas = all_0xff;
1920-
1921- // We must be able to access 3 extra bytes after the last written byte
1922-@@ -178,7 +178,7 @@
1923- static void ApplyAlphaMultiply_SSE2(uint8_t* rgba, int alpha_first,
1924- int w, int h, int stride) {
1925- const __m128i zero = _mm_setzero_si128();
1926-- const __m128i kMult = _mm_set1_epi16(0x8081u);
1927-+ const __m128i kMult = _mm_set1_epi16((short)0x8081);
1928- const __m128i kMask = _mm_set_epi16(0, 0xff, 0xff, 0, 0, 0xff, 0xff, 0);
1929- const int kSpan = 4;
1930- while (h-- > 0) {
1931-@@ -267,7 +267,7 @@
1932- }
1933-
1934- static void AlphaReplace_SSE2(uint32_t* src, int length, uint32_t color) {
1935-- const __m128i m_color = _mm_set1_epi32(color);
1936-+ const __m128i m_color = _mm_set1_epi32((int)color);
1937- const __m128i zero = _mm_setzero_si128();
1938- int i = 0;
1939- for (; i + 8 <= length; i += 8) {
1940-diff -rNuZ a/src/3rdparty/libwebp/src/dsp/alpha_processing_sse41.c b/src/3rdparty/libwebp/src/dsp/alpha_processing_sse41.c
1941---- a/src/3rdparty/libwebp/src/dsp/alpha_processing_sse41.c 2023-11-01 02:38:38.000000000 +0800
1942-+++ b/src/3rdparty/libwebp/src/dsp/alpha_processing_sse41.c 2023-09-14 06:11:07.000000000 +0800
1943-@@ -26,7 +26,7 @@
1944- // value is not 0xff if any of the alpha[] is not equal to 0xff.
1945- uint32_t alpha_and = 0xff;
1946- int i, j;
1947-- const __m128i all_0xff = _mm_set1_epi32(~0u);
1948-+ const __m128i all_0xff = _mm_set1_epi32(~0);
1949- __m128i all_alphas = all_0xff;
1950-
1951- // We must be able to access 3 extra bytes after the last written byte
19521352 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/cost.c b/src/3rdparty/libwebp/src/dsp/cost.c
1953---- a/src/3rdparty/libwebp/src/dsp/cost.c 2023-11-01 02:38:38.000000000 +0800
1954-+++ b/src/3rdparty/libwebp/src/dsp/cost.c 2023-09-14 06:11:07.000000000 +0800
1353+--- a/src/3rdparty/libwebp/src/dsp/cost.c 2024-03-27 03:34:35.000000000 +0800
1354++++ b/src/3rdparty/libwebp/src/dsp/cost.c 2024-03-17 19:08:13.352376100 +0800
19551355 @@ -374,6 +374,7 @@
19561356 VP8GetResidualCostFunc VP8GetResidualCost;
19571357 VP8SetResidualCoeffsFunc VP8SetResidualCoeffs;
@@ -1961,8 +1361,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/cost.c b/src/3rdparty/libwebp/src/dsp/
19611361 extern void VP8EncDspCostInitMIPSdspR2(void);
19621362 extern void VP8EncDspCostInitSSE2(void);
19631363 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/cost_neon.c b/src/3rdparty/libwebp/src/dsp/cost_neon.c
1964---- a/src/3rdparty/libwebp/src/dsp/cost_neon.c 2023-11-01 02:38:38.000000000 +0800
1965-+++ b/src/3rdparty/libwebp/src/dsp/cost_neon.c 2023-09-14 06:11:07.000000000 +0800
1364+--- a/src/3rdparty/libwebp/src/dsp/cost_neon.c 2024-03-27 03:34:35.000000000 +0800
1365++++ b/src/3rdparty/libwebp/src/dsp/cost_neon.c 2024-03-17 19:08:13.352376100 +0800
19661366 @@ -29,7 +29,7 @@
19671367 const uint8x16_t eob = vcombine_u8(vqmovn_u16(eob_0), vqmovn_u16(eob_1));
19681368 const uint8x16_t masked = vandq_u8(eob, vld1q_u8(position));
@@ -1982,8 +1382,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/cost_neon.c b/src/3rdparty/libwebp/src
19821382 res->coeffs = coeffs;
19831383 }
19841384 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/cpu.c b/src/3rdparty/libwebp/src/dsp/cpu.c
1985---- a/src/3rdparty/libwebp/src/dsp/cpu.c 2023-11-01 02:38:38.000000000 +0800
1986-+++ b/src/3rdparty/libwebp/src/dsp/cpu.c 2023-09-14 06:11:07.000000000 +0800
1385+--- a/src/3rdparty/libwebp/src/dsp/cpu.c 2024-03-27 03:34:35.000000000 +0800
1386++++ b/src/3rdparty/libwebp/src/dsp/cpu.c 2024-03-17 19:08:13.352376100 +0800
19871387 @@ -173,6 +173,7 @@
19881388 }
19891389 return 0;
@@ -2000,7 +1400,7 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/cpu.c b/src/3rdparty/libwebp/src/dsp/c
20001400 VP8CPUInfo VP8GetCPUInfo = AndroidCPUInfo;
20011401 #elif defined(EMSCRIPTEN) // also needs to be before generic NEON test
20021402 // Use compile flags as an indicator of SIMD support instead of a runtime check.
2003-@@ -208,11 +210,12 @@
1403+@@ -208,6 +210,7 @@
20041404 }
20051405 return 0;
20061406 }
@@ -2008,12 +1408,6 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/cpu.c b/src/3rdparty/libwebp/src/dsp/c
20081408 VP8CPUInfo VP8GetCPUInfo = wasmCPUInfo;
20091409 #elif defined(WEBP_HAVE_NEON)
20101410 // In most cases this function doesn't check for NEON support (it's assumed by
2011- // the configuration), but enables turning off NEON at runtime, for testing
2012--// purposes, by setting VP8DecGetCPUInfo = NULL.
2013-+// purposes, by setting VP8GetCPUInfo = NULL.
2014- static int armCPUInfo(CPUFeature feature) {
2015- if (feature != kNEON) return 0;
2016- #if defined(__linux__) && defined(WEBP_HAVE_NEON_RTCD)
20171411 @@ -236,6 +239,7 @@
20181412 return 1;
20191413 #endif
@@ -2033,18 +1427,9 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/cpu.c b/src/3rdparty/libwebp/src/dsp/c
20331427 VP8CPUInfo VP8GetCPUInfo = NULL;
20341428 #endif
20351429 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/cpu.h b/src/3rdparty/libwebp/src/dsp/cpu.h
2036---- a/src/3rdparty/libwebp/src/dsp/cpu.h 2023-11-01 02:38:38.000000000 +0800
2037-+++ b/src/3rdparty/libwebp/src/dsp/cpu.h 2024-03-17 17:50:33.634580700 +0800
2038-@@ -14,6 +14,8 @@
2039- #ifndef WEBP_DSP_CPU_H_
2040- #define WEBP_DSP_CPU_H_
2041-
2042-+#include <stddef.h>
2043-+
2044- #include <qglobal.h>
2045-
2046- #ifdef HAVE_CONFIG_H
2047-@@ -43,6 +45,9 @@
1430+--- a/src/3rdparty/libwebp/src/dsp/cpu.h 2024-03-27 03:34:35.000000000 +0800
1431++++ b/src/3rdparty/libwebp/src/dsp/cpu.h 2024-03-17 19:08:13.352376100 +0800
1432+@@ -45,6 +45,9 @@
20481433 #define __has_builtin(x) 0
20491434 #endif
20501435
@@ -2054,7 +1439,7 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/cpu.h b/src/3rdparty/libwebp/src/dsp/c
20541439 #if !defined(HAVE_CONFIG_H)
20551440 #if defined(_MSC_VER) && _MSC_VER > 1310 && \
20561441 (defined(_M_X64) || defined(_M_IX86)) && !defined(__clang__)
2057-@@ -80,6 +85,9 @@
1442+@@ -82,6 +85,9 @@
20581443 #undef WEBP_MSC_SSE41
20591444 #undef WEBP_MSC_SSE2
20601445
@@ -2064,7 +1449,7 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/cpu.h b/src/3rdparty/libwebp/src/dsp/c
20641449 // The intrinsics currently cause compiler errors with arm-nacl-gcc and the
20651450 // inline assembly would need to be modified for use with Native Client.
20661451 #if ((defined(__ARM_NEON__) || defined(__aarch64__)) && \
2067-@@ -98,17 +106,27 @@
1452+@@ -100,17 +106,27 @@
20681453 // inclusion of arm64_neon.h; Visual Studio 2019 includes this file in
20691454 // arm_neon.h. Compile errors were seen with Visual Studio 2019 16.4 with
20701455 // vtbl4_u8(); a fix was made in 16.6.
@@ -2094,7 +1479,7 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/cpu.h b/src/3rdparty/libwebp/src/dsp/c
20941479 #if defined(__mips__) && !defined(__mips64) && defined(__mips_isa_rev) && \
20951480 (__mips_isa_rev >= 1) && (__mips_isa_rev < 6)
20961481 #define WEBP_USE_MIPS32
2097-@@ -124,6 +142,8 @@
1482+@@ -126,6 +142,8 @@
20981483 #define WEBP_USE_MSA
20991484 #endif
21001485
@@ -2103,7 +1488,7 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/cpu.h b/src/3rdparty/libwebp/src/dsp/c
21031488 #ifndef WEBP_DSP_OMIT_C_CODE
21041489 #define WEBP_DSP_OMIT_C_CODE 1
21051490 #endif
2106-@@ -134,13 +154,14 @@
1491+@@ -136,13 +154,14 @@
21071492 #define WEBP_NEON_OMIT_C_CODE 0
21081493 #endif
21091494
@@ -2120,7 +1505,7 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/cpu.h b/src/3rdparty/libwebp/src/dsp/c
21201505 // This macro prevents thread_sanitizer from reporting known concurrent writes.
21211506 #define WEBP_TSAN_IGNORE_FUNCTION
21221507 #if defined(__has_feature)
2123-@@ -242,16 +263,7 @@
1508+@@ -244,16 +263,7 @@
21241509 kMSA
21251510 } CPUFeature;
21261511
@@ -2138,8 +1523,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/cpu.h b/src/3rdparty/libwebp/src/dsp/c
21381523
21391524 #endif // WEBP_DSP_CPU_H_
21401525 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/dec.c b/src/3rdparty/libwebp/src/dsp/dec.c
2141---- a/src/3rdparty/libwebp/src/dsp/dec.c 2023-11-01 02:38:38.000000000 +0800
2142-+++ b/src/3rdparty/libwebp/src/dsp/dec.c 2023-09-14 06:11:07.000000000 +0800
1526+--- a/src/3rdparty/libwebp/src/dsp/dec.c 2024-03-27 03:34:35.000000000 +0800
1527++++ b/src/3rdparty/libwebp/src/dsp/dec.c 2024-03-17 19:08:13.352376100 +0800
21431528 @@ -734,6 +734,7 @@
21441529 void (*VP8DitherCombine8x8)(const uint8_t* dither, uint8_t* dst,
21451530 int dst_stride);
@@ -2149,8 +1534,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/dec.c b/src/3rdparty/libwebp/src/dsp/d
21491534 extern void VP8DspInitSSE41(void);
21501535 extern void VP8DspInitNEON(void);
21511536 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/dec_neon.c b/src/3rdparty/libwebp/src/dsp/dec_neon.c
2152---- a/src/3rdparty/libwebp/src/dsp/dec_neon.c 2023-11-01 02:38:38.000000000 +0800
2153-+++ b/src/3rdparty/libwebp/src/dsp/dec_neon.c 2023-09-14 06:11:07.000000000 +0800
1537+--- a/src/3rdparty/libwebp/src/dsp/dec_neon.c 2024-03-27 03:34:35.000000000 +0800
1538++++ b/src/3rdparty/libwebp/src/dsp/dec_neon.c 2024-03-17 19:08:13.359990700 +0800
21541539 @@ -1428,7 +1428,7 @@
21551540
21561541 if (do_top) {
@@ -2169,237 +1554,9 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/dec_neon.c b/src/3rdparty/libwebp/src/
21691554 const uint16_t p3 = vaddlvq_u8(A);
21701555 sum_top = vdupq_n_u16(p3);
21711556 #else
2172-diff -rNuZ a/src/3rdparty/libwebp/src/dsp/dec_sse2.c b/src/3rdparty/libwebp/src/dsp/dec_sse2.c
2173---- a/src/3rdparty/libwebp/src/dsp/dec_sse2.c 2023-11-01 02:38:38.000000000 +0800
2174-+++ b/src/3rdparty/libwebp/src/dsp/dec_sse2.c 2023-09-14 06:11:07.000000000 +0800
2175-@@ -158,10 +158,10 @@
2176- dst3 = _mm_loadl_epi64((__m128i*)(dst + 3 * BPS));
2177- } else {
2178- // Load four bytes/pixels per line.
2179-- dst0 = _mm_cvtsi32_si128(WebPMemToUint32(dst + 0 * BPS));
2180-- dst1 = _mm_cvtsi32_si128(WebPMemToUint32(dst + 1 * BPS));
2181-- dst2 = _mm_cvtsi32_si128(WebPMemToUint32(dst + 2 * BPS));
2182-- dst3 = _mm_cvtsi32_si128(WebPMemToUint32(dst + 3 * BPS));
2183-+ dst0 = _mm_cvtsi32_si128(WebPMemToInt32(dst + 0 * BPS));
2184-+ dst1 = _mm_cvtsi32_si128(WebPMemToInt32(dst + 1 * BPS));
2185-+ dst2 = _mm_cvtsi32_si128(WebPMemToInt32(dst + 2 * BPS));
2186-+ dst3 = _mm_cvtsi32_si128(WebPMemToInt32(dst + 3 * BPS));
2187- }
2188- // Convert to 16b.
2189- dst0 = _mm_unpacklo_epi8(dst0, zero);
2190-@@ -187,10 +187,10 @@
2191- _mm_storel_epi64((__m128i*)(dst + 3 * BPS), dst3);
2192- } else {
2193- // Store four bytes/pixels per line.
2194-- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(dst0));
2195-- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(dst1));
2196-- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(dst2));
2197-- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(dst3));
2198-+ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(dst0));
2199-+ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(dst1));
2200-+ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(dst2));
2201-+ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(dst3));
2202- }
2203- }
2204- }
2205-@@ -213,10 +213,10 @@
2206- const __m128i m3 = _mm_subs_epi16(B, d4);
2207- const __m128i zero = _mm_setzero_si128();
2208- // Load the source pixels.
2209-- __m128i dst0 = _mm_cvtsi32_si128(WebPMemToUint32(dst + 0 * BPS));
2210-- __m128i dst1 = _mm_cvtsi32_si128(WebPMemToUint32(dst + 1 * BPS));
2211-- __m128i dst2 = _mm_cvtsi32_si128(WebPMemToUint32(dst + 2 * BPS));
2212-- __m128i dst3 = _mm_cvtsi32_si128(WebPMemToUint32(dst + 3 * BPS));
2213-+ __m128i dst0 = _mm_cvtsi32_si128(WebPMemToInt32(dst + 0 * BPS));
2214-+ __m128i dst1 = _mm_cvtsi32_si128(WebPMemToInt32(dst + 1 * BPS));
2215-+ __m128i dst2 = _mm_cvtsi32_si128(WebPMemToInt32(dst + 2 * BPS));
2216-+ __m128i dst3 = _mm_cvtsi32_si128(WebPMemToInt32(dst + 3 * BPS));
2217- // Convert to 16b.
2218- dst0 = _mm_unpacklo_epi8(dst0, zero);
2219- dst1 = _mm_unpacklo_epi8(dst1, zero);
2220-@@ -233,10 +233,10 @@
2221- dst2 = _mm_packus_epi16(dst2, dst2);
2222- dst3 = _mm_packus_epi16(dst3, dst3);
2223- // Store the results.
2224-- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(dst0));
2225-- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(dst1));
2226-- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(dst2));
2227-- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(dst3));
2228-+ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(dst0));
2229-+ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(dst1));
2230-+ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(dst2));
2231-+ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(dst3));
2232- }
2233- #undef MUL
2234- #endif // USE_TRANSFORM_AC3
2235-@@ -477,11 +477,11 @@
2236- // A0 = 63 62 61 60 23 22 21 20 43 42 41 40 03 02 01 00
2237- // A1 = 73 72 71 70 33 32 31 30 53 52 51 50 13 12 11 10
2238- const __m128i A0 = _mm_set_epi32(
2239-- WebPMemToUint32(&b[6 * stride]), WebPMemToUint32(&b[2 * stride]),
2240-- WebPMemToUint32(&b[4 * stride]), WebPMemToUint32(&b[0 * stride]));
2241-+ WebPMemToInt32(&b[6 * stride]), WebPMemToInt32(&b[2 * stride]),
2242-+ WebPMemToInt32(&b[4 * stride]), WebPMemToInt32(&b[0 * stride]));
2243- const __m128i A1 = _mm_set_epi32(
2244-- WebPMemToUint32(&b[7 * stride]), WebPMemToUint32(&b[3 * stride]),
2245-- WebPMemToUint32(&b[5 * stride]), WebPMemToUint32(&b[1 * stride]));
2246-+ WebPMemToInt32(&b[7 * stride]), WebPMemToInt32(&b[3 * stride]),
2247-+ WebPMemToInt32(&b[5 * stride]), WebPMemToInt32(&b[1 * stride]));
2248-
2249- // B0 = 53 43 52 42 51 41 50 40 13 03 12 02 11 01 10 00
2250- // B1 = 73 63 72 62 71 61 70 60 33 23 32 22 31 21 30 20
2251-@@ -540,7 +540,7 @@
2252- uint8_t* dst, int stride) {
2253- int i;
2254- for (i = 0; i < 4; ++i, dst += stride) {
2255-- WebPUint32ToMem(dst, _mm_cvtsi128_si32(*x));
2256-+ WebPInt32ToMem(dst, _mm_cvtsi128_si32(*x));
2257- *x = _mm_srli_si128(*x, 4);
2258- }
2259- }
2260-@@ -908,10 +908,10 @@
2261- const __m128i lsb = _mm_and_si128(_mm_xor_si128(ABCDEFGH, CDEFGH00), one);
2262- const __m128i b = _mm_subs_epu8(a, lsb);
2263- const __m128i avg = _mm_avg_epu8(b, BCDEFGH0);
2264-- const uint32_t vals = _mm_cvtsi128_si32(avg);
2265-+ const int vals = _mm_cvtsi128_si32(avg);
2266- int i;
2267- for (i = 0; i < 4; ++i) {
2268-- WebPUint32ToMem(dst + i * BPS, vals);
2269-+ WebPInt32ToMem(dst + i * BPS, vals);
2270- }
2271- }
2272-
2273-@@ -925,10 +925,10 @@
2274- const __m128i lsb = _mm_and_si128(_mm_xor_si128(ABCDEFGH, CDEFGHH0), one);
2275- const __m128i avg2 = _mm_subs_epu8(avg1, lsb);
2276- const __m128i abcdefg = _mm_avg_epu8(avg2, BCDEFGH0);
2277-- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcdefg ));
2278-- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1)));
2279-- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2)));
2280-- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3)));
2281-+ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcdefg ));
2282-+ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1)));
2283-+ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2)));
2284-+ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3)));
2285- }
2286-
2287- static void VR4_SSE2(uint8_t* dst) { // Vertical-Right
2288-@@ -946,10 +946,10 @@
2289- const __m128i lsb = _mm_and_si128(_mm_xor_si128(IXABCD, ABCD0), one);
2290- const __m128i avg2 = _mm_subs_epu8(avg1, lsb);
2291- const __m128i efgh = _mm_avg_epu8(avg2, XABCD);
2292-- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcd ));
2293-- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( efgh ));
2294-- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(abcd, 1)));
2295-- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(efgh, 1)));
2296-+ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcd ));
2297-+ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( efgh ));
2298-+ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(abcd, 1)));
2299-+ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(efgh, 1)));
2300-
2301- // these two are hard to implement in SSE2, so we keep the C-version:
2302- DST(0, 2) = AVG3(J, I, X);
2303-@@ -970,11 +970,12 @@
2304- const __m128i abbc = _mm_or_si128(ab, bc);
2305- const __m128i lsb2 = _mm_and_si128(abbc, lsb1);
2306- const __m128i avg4 = _mm_subs_epu8(avg3, lsb2);
2307-- const uint32_t extra_out = _mm_cvtsi128_si32(_mm_srli_si128(avg4, 4));
2308-- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( avg1 ));
2309-- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( avg4 ));
2310-- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg1, 1)));
2311-- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg4, 1)));
2312-+ const uint32_t extra_out =
2313-+ (uint32_t)_mm_cvtsi128_si32(_mm_srli_si128(avg4, 4));
2314-+ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( avg1 ));
2315-+ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( avg4 ));
2316-+ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg1, 1)));
2317-+ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg4, 1)));
2318-
2319- // these two are hard to get and irregular
2320- DST(3, 2) = (extra_out >> 0) & 0xff;
2321-@@ -990,7 +991,7 @@
2322- const uint32_t K = dst[-1 + 2 * BPS];
2323- const uint32_t L = dst[-1 + 3 * BPS];
2324- const __m128i LKJI_____ =
2325-- _mm_cvtsi32_si128(L | (K << 8) | (J << 16) | (I << 24));
2326-+ _mm_cvtsi32_si128((int)(L | (K << 8) | (J << 16) | (I << 24)));
2327- const __m128i LKJIXABCD = _mm_or_si128(LKJI_____, ____XABCD);
2328- const __m128i KJIXABCD_ = _mm_srli_si128(LKJIXABCD, 1);
2329- const __m128i JIXABCD__ = _mm_srli_si128(LKJIXABCD, 2);
2330-@@ -998,10 +999,10 @@
2331- const __m128i lsb = _mm_and_si128(_mm_xor_si128(JIXABCD__, LKJIXABCD), one);
2332- const __m128i avg2 = _mm_subs_epu8(avg1, lsb);
2333- const __m128i abcdefg = _mm_avg_epu8(avg2, KJIXABCD_);
2334-- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32( abcdefg ));
2335-- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1)));
2336-- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2)));
2337-- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3)));
2338-+ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32( abcdefg ));
2339-+ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1)));
2340-+ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2)));
2341-+ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3)));
2342- }
2343-
2344- #undef DST
2345-@@ -1015,13 +1016,13 @@
2346- const __m128i zero = _mm_setzero_si128();
2347- int y;
2348- if (size == 4) {
2349-- const __m128i top_values = _mm_cvtsi32_si128(WebPMemToUint32(top));
2350-+ const __m128i top_values = _mm_cvtsi32_si128(WebPMemToInt32(top));
2351- const __m128i top_base = _mm_unpacklo_epi8(top_values, zero);
2352- for (y = 0; y < 4; ++y, dst += BPS) {
2353- const int val = dst[-1] - top[-1];
2354- const __m128i base = _mm_set1_epi16(val);
2355- const __m128i out = _mm_packus_epi16(_mm_add_epi16(base, top_base), zero);
2356-- WebPUint32ToMem(dst, _mm_cvtsi128_si32(out));
2357-+ WebPInt32ToMem(dst, _mm_cvtsi128_si32(out));
2358- }
2359- } else if (size == 8) {
2360- const __m128i top_values = _mm_loadl_epi64((const __m128i*)top);
2361-@@ -1062,7 +1063,7 @@
2362- static void HE16_SSE2(uint8_t* dst) { // horizontal
2363- int j;
2364- for (j = 16; j > 0; --j) {
2365-- const __m128i values = _mm_set1_epi8(dst[-1]);
2366-+ const __m128i values = _mm_set1_epi8((char)dst[-1]);
2367- _mm_storeu_si128((__m128i*)dst, values);
2368- dst += BPS;
2369- }
2370-@@ -1070,7 +1071,7 @@
2371-
2372- static WEBP_INLINE void Put16_SSE2(uint8_t v, uint8_t* dst) {
2373- int j;
2374-- const __m128i values = _mm_set1_epi8(v);
2375-+ const __m128i values = _mm_set1_epi8((char)v);
2376- for (j = 0; j < 16; ++j) {
2377- _mm_storeu_si128((__m128i*)(dst + j * BPS), values);
2378- }
2379-@@ -1130,7 +1131,7 @@
2380- // helper for chroma-DC predictions
2381- static WEBP_INLINE void Put8x8uv_SSE2(uint8_t v, uint8_t* dst) {
2382- int j;
2383-- const __m128i values = _mm_set1_epi8(v);
2384-+ const __m128i values = _mm_set1_epi8((char)v);
2385- for (j = 0; j < 8; ++j) {
2386- _mm_storel_epi64((__m128i*)(dst + j * BPS), values);
2387- }
2388-diff -rNuZ a/src/3rdparty/libwebp/src/dsp/dec_sse41.c b/src/3rdparty/libwebp/src/dsp/dec_sse41.c
2389---- a/src/3rdparty/libwebp/src/dsp/dec_sse41.c 2023-11-01 02:38:38.000000000 +0800
2390-+++ b/src/3rdparty/libwebp/src/dsp/dec_sse41.c 2023-09-14 06:11:07.000000000 +0800
2391-@@ -23,7 +23,7 @@
2392- int j;
2393- const __m128i kShuffle3 = _mm_set1_epi8(3);
2394- for (j = 16; j > 0; --j) {
2395-- const __m128i in = _mm_cvtsi32_si128(WebPMemToUint32(dst - 4));
2396-+ const __m128i in = _mm_cvtsi32_si128(WebPMemToInt32(dst - 4));
2397- const __m128i values = _mm_shuffle_epi8(in, kShuffle3);
2398- _mm_storeu_si128((__m128i*)dst, values);
2399- dst += BPS;
24001557 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/enc.c b/src/3rdparty/libwebp/src/dsp/enc.c
2401---- a/src/3rdparty/libwebp/src/dsp/enc.c 2023-11-01 02:38:38.000000000 +0800
2402-+++ b/src/3rdparty/libwebp/src/dsp/enc.c 2023-09-14 06:11:07.000000000 +0800
1558+--- a/src/3rdparty/libwebp/src/dsp/enc.c 2024-03-27 03:34:35.000000000 +0800
1559++++ b/src/3rdparty/libwebp/src/dsp/enc.c 2024-03-17 19:08:13.362495000 +0800
24031560 @@ -732,6 +732,7 @@
24041561 VP8BlockCopy VP8Copy4x4;
24051562 VP8BlockCopy VP8Copy16x8;
@@ -2409,26 +1566,18 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/enc.c b/src/3rdparty/libwebp/src/dsp/e
24091566 extern void VP8EncDspInitSSE41(void);
24101567 extern void VP8EncDspInitNEON(void);
24111568 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/enc_neon.c b/src/3rdparty/libwebp/src/dsp/enc_neon.c
2412---- a/src/3rdparty/libwebp/src/dsp/enc_neon.c 2023-11-01 02:38:38.000000000 +0800
2413-+++ b/src/3rdparty/libwebp/src/dsp/enc_neon.c 2023-09-14 06:11:07.000000000 +0800
2414-@@ -764,9 +764,14 @@
1569+--- a/src/3rdparty/libwebp/src/dsp/enc_neon.c 2024-03-27 03:34:35.000000000 +0800
1570++++ b/src/3rdparty/libwebp/src/dsp/enc_neon.c 2024-03-17 19:08:13.362495000 +0800
1571+@@ -764,7 +764,7 @@
24151572
24161573 // Horizontal sum of all four uint32_t values in 'sum'.
24171574 static int SumToInt_NEON(uint32x4_t sum) {
1575+-#if defined(__aarch64__)
24181576 +#if WEBP_AARCH64
2419-+ return (int)vaddvq_u32(sum);
2420-+#else
1577+ return (int)vaddvq_u32(sum);
1578+ #else
24211579 const uint64x2_t sum2 = vpaddlq_u32(sum);
2422-- const uint64_t sum3 = vgetq_lane_u64(sum2, 0) + vgetq_lane_u64(sum2, 1);
2423-- return (int)sum3;
2424-+ const uint32x2_t sum3 = vadd_u32(vreinterpret_u32_u64(vget_low_u64(sum2)),
2425-+ vreinterpret_u32_u64(vget_high_u64(sum2)));
2426-+ return (int)vget_lane_u32(sum3, 0);
2427-+#endif
2428- }
2429-
2430- static int SSE16x16_NEON(const uint8_t* a, const uint8_t* b) {
2431-@@ -860,7 +865,7 @@
1580+@@ -865,7 +865,7 @@
24321581 uint8x8x4_t shuffles;
24331582 // vtbl?_u8 are marked unavailable for iOS arm64 with Xcode < 6.3, use
24341583 // non-standard versions there.
@@ -2438,8 +1587,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/enc_neon.c b/src/3rdparty/libwebp/src/
24381587 uint8x16x2_t all_out;
24391588 INIT_VECTOR2(all_out, vreinterpretq_u8_s16(out0), vreinterpretq_u8_s16(out1));
24401589 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/enc_sse2.c b/src/3rdparty/libwebp/src/dsp/enc_sse2.c
2441---- a/src/3rdparty/libwebp/src/dsp/enc_sse2.c 2023-11-01 02:38:38.000000000 +0800
2442-+++ b/src/3rdparty/libwebp/src/dsp/enc_sse2.c 2023-09-14 06:11:07.000000000 +0800
1590+--- a/src/3rdparty/libwebp/src/dsp/enc_sse2.c 2024-03-27 03:34:35.000000000 +0800
1591++++ b/src/3rdparty/libwebp/src/dsp/enc_sse2.c 2024-03-17 19:08:13.362495000 +0800
24431592 @@ -25,9 +25,160 @@
24441593 //------------------------------------------------------------------------------
24451594 // Transforms (Paragraph 14.4)
@@ -2663,10 +1812,10 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/enc_sse2.c b/src/3rdparty/libwebp/src/
26631812 - ref3 = _mm_loadl_epi64((const __m128i*)&ref[3 * BPS]);
26641813 - } else {
26651814 - // Load four bytes/pixels per line.
2666-- ref0 = _mm_cvtsi32_si128(WebPMemToUint32(&ref[0 * BPS]));
2667-- ref1 = _mm_cvtsi32_si128(WebPMemToUint32(&ref[1 * BPS]));
2668-- ref2 = _mm_cvtsi32_si128(WebPMemToUint32(&ref[2 * BPS]));
2669-- ref3 = _mm_cvtsi32_si128(WebPMemToUint32(&ref[3 * BPS]));
1815+- ref0 = _mm_cvtsi32_si128(WebPMemToInt32(&ref[0 * BPS]));
1816+- ref1 = _mm_cvtsi32_si128(WebPMemToInt32(&ref[1 * BPS]));
1817+- ref2 = _mm_cvtsi32_si128(WebPMemToInt32(&ref[2 * BPS]));
1818+- ref3 = _mm_cvtsi32_si128(WebPMemToInt32(&ref[3 * BPS]));
26701819 - }
26711820 + // Load eight bytes/pixels per line.
26721821 + ref0 = _mm_loadl_epi64((const __m128i*)&ref[0 * BPS]);
@@ -2689,10 +1838,10 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/enc_sse2.c b/src/3rdparty/libwebp/src/
26891838 - _mm_storel_epi64((__m128i*)&dst[3 * BPS], ref3);
26901839 - } else {
26911840 - // Store four bytes/pixels per line.
2692-- WebPUint32ToMem(&dst[0 * BPS], _mm_cvtsi128_si32(ref0));
2693-- WebPUint32ToMem(&dst[1 * BPS], _mm_cvtsi128_si32(ref1));
2694-- WebPUint32ToMem(&dst[2 * BPS], _mm_cvtsi128_si32(ref2));
2695-- WebPUint32ToMem(&dst[3 * BPS], _mm_cvtsi128_si32(ref3));
1841+- WebPInt32ToMem(&dst[0 * BPS], _mm_cvtsi128_si32(ref0));
1842+- WebPInt32ToMem(&dst[1 * BPS], _mm_cvtsi128_si32(ref1));
1843+- WebPInt32ToMem(&dst[2 * BPS], _mm_cvtsi128_si32(ref2));
1844+- WebPInt32ToMem(&dst[3 * BPS], _mm_cvtsi128_si32(ref3));
26961845 - }
26971846 + // Store eight bytes/pixels per line.
26981847 + _mm_storel_epi64((__m128i*)&dst[0 * BPS], ref0);
@@ -2712,138 +1861,9 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/enc_sse2.c b/src/3rdparty/libwebp/src/
27121861 }
27131862 }
27141863
2715-@@ -481,7 +613,7 @@
2716- // helper for chroma-DC predictions
2717- static WEBP_INLINE void Put8x8uv_SSE2(uint8_t v, uint8_t* dst) {
2718- int j;
2719-- const __m128i values = _mm_set1_epi8(v);
2720-+ const __m128i values = _mm_set1_epi8((char)v);
2721- for (j = 0; j < 8; ++j) {
2722- _mm_storel_epi64((__m128i*)(dst + j * BPS), values);
2723- }
2724-@@ -489,7 +621,7 @@
2725-
2726- static WEBP_INLINE void Put16_SSE2(uint8_t v, uint8_t* dst) {
2727- int j;
2728-- const __m128i values = _mm_set1_epi8(v);
2729-+ const __m128i values = _mm_set1_epi8((char)v);
2730- for (j = 0; j < 16; ++j) {
2731- _mm_store_si128((__m128i*)(dst + j * BPS), values);
2732- }
2733-@@ -540,7 +672,7 @@
2734- static WEBP_INLINE void HE8uv_SSE2(uint8_t* dst, const uint8_t* left) {
2735- int j;
2736- for (j = 0; j < 8; ++j) {
2737-- const __m128i values = _mm_set1_epi8(left[j]);
2738-+ const __m128i values = _mm_set1_epi8((char)left[j]);
2739- _mm_storel_epi64((__m128i*)dst, values);
2740- dst += BPS;
2741- }
2742-@@ -549,7 +681,7 @@
2743- static WEBP_INLINE void HE16_SSE2(uint8_t* dst, const uint8_t* left) {
2744- int j;
2745- for (j = 0; j < 16; ++j) {
2746-- const __m128i values = _mm_set1_epi8(left[j]);
2747-+ const __m128i values = _mm_set1_epi8((char)left[j]);
2748- _mm_store_si128((__m128i*)dst, values);
2749- dst += BPS;
2750- }
2751-@@ -722,10 +854,10 @@
2752- const __m128i lsb = _mm_and_si128(_mm_xor_si128(ABCDEFGH, CDEFGH00), one);
2753- const __m128i b = _mm_subs_epu8(a, lsb);
2754- const __m128i avg = _mm_avg_epu8(b, BCDEFGH0);
2755-- const uint32_t vals = _mm_cvtsi128_si32(avg);
2756-+ const int vals = _mm_cvtsi128_si32(avg);
2757- int i;
2758- for (i = 0; i < 4; ++i) {
2759-- WebPUint32ToMem(dst + i * BPS, vals);
2760-+ WebPInt32ToMem(dst + i * BPS, vals);
2761- }
2762- }
2763-
2764-@@ -760,10 +892,10 @@
2765- const __m128i lsb = _mm_and_si128(_mm_xor_si128(ABCDEFGH, CDEFGHH0), one);
2766- const __m128i avg2 = _mm_subs_epu8(avg1, lsb);
2767- const __m128i abcdefg = _mm_avg_epu8(avg2, BCDEFGH0);
2768-- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcdefg ));
2769-- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1)));
2770-- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2)));
2771-- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3)));
2772-+ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcdefg ));
2773-+ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1)));
2774-+ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2)));
2775-+ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3)));
2776- }
2777-
2778- static WEBP_INLINE void VR4_SSE2(uint8_t* dst,
2779-@@ -782,10 +914,10 @@
2780- const __m128i lsb = _mm_and_si128(_mm_xor_si128(IXABCD, ABCD0), one);
2781- const __m128i avg2 = _mm_subs_epu8(avg1, lsb);
2782- const __m128i efgh = _mm_avg_epu8(avg2, XABCD);
2783-- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcd ));
2784-- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( efgh ));
2785-- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(abcd, 1)));
2786-- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(efgh, 1)));
2787-+ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( abcd ));
2788-+ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( efgh ));
2789-+ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(abcd, 1)));
2790-+ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_slli_si128(efgh, 1)));
2791-
2792- // these two are hard to implement in SSE2, so we keep the C-version:
2793- DST(0, 2) = AVG3(J, I, X);
2794-@@ -807,11 +939,12 @@
2795- const __m128i abbc = _mm_or_si128(ab, bc);
2796- const __m128i lsb2 = _mm_and_si128(abbc, lsb1);
2797- const __m128i avg4 = _mm_subs_epu8(avg3, lsb2);
2798-- const uint32_t extra_out = _mm_cvtsi128_si32(_mm_srli_si128(avg4, 4));
2799-- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( avg1 ));
2800-- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( avg4 ));
2801-- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg1, 1)));
2802-- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg4, 1)));
2803-+ const uint32_t extra_out =
2804-+ (uint32_t)_mm_cvtsi128_si32(_mm_srli_si128(avg4, 4));
2805-+ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32( avg1 ));
2806-+ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32( avg4 ));
2807-+ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg1, 1)));
2808-+ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(avg4, 1)));
2809-
2810- // these two are hard to get and irregular
2811- DST(3, 2) = (extra_out >> 0) & 0xff;
2812-@@ -829,10 +962,10 @@
2813- const __m128i lsb = _mm_and_si128(_mm_xor_si128(JIXABCD__, LKJIXABCD), one);
2814- const __m128i avg2 = _mm_subs_epu8(avg1, lsb);
2815- const __m128i abcdefg = _mm_avg_epu8(avg2, KJIXABCD_);
2816-- WebPUint32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32( abcdefg ));
2817-- WebPUint32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1)));
2818-- WebPUint32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2)));
2819-- WebPUint32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3)));
2820-+ WebPInt32ToMem(dst + 3 * BPS, _mm_cvtsi128_si32( abcdefg ));
2821-+ WebPInt32ToMem(dst + 2 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 1)));
2822-+ WebPInt32ToMem(dst + 1 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 2)));
2823-+ WebPInt32ToMem(dst + 0 * BPS, _mm_cvtsi128_si32(_mm_srli_si128(abcdefg, 3)));
2824- }
2825-
2826- static WEBP_INLINE void HU4_SSE2(uint8_t* dst, const uint8_t* top) {
2827-@@ -875,14 +1008,14 @@
2828-
2829- static WEBP_INLINE void TM4_SSE2(uint8_t* dst, const uint8_t* top) {
2830- const __m128i zero = _mm_setzero_si128();
2831-- const __m128i top_values = _mm_cvtsi32_si128(WebPMemToUint32(top));
2832-+ const __m128i top_values = _mm_cvtsi32_si128(WebPMemToInt32(top));
2833- const __m128i top_base = _mm_unpacklo_epi8(top_values, zero);
2834- int y;
2835- for (y = 0; y < 4; ++y, dst += BPS) {
2836- const int val = top[-2 - y] - top[-1];
2837- const __m128i base = _mm_set1_epi16(val);
2838- const __m128i out = _mm_packus_epi16(_mm_add_epi16(base, top_base), zero);
2839-- WebPUint32ToMem(dst, _mm_cvtsi128_si32(out));
2840-+ WebPInt32ToMem(dst, _mm_cvtsi128_si32(out));
2841- }
2842- }
2843-
28441864 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/filters.c b/src/3rdparty/libwebp/src/dsp/filters.c
2845---- a/src/3rdparty/libwebp/src/dsp/filters.c 2023-11-01 02:38:38.000000000 +0800
2846-+++ b/src/3rdparty/libwebp/src/dsp/filters.c 2023-09-14 06:11:07.000000000 +0800
1865+--- a/src/3rdparty/libwebp/src/dsp/filters.c 2024-03-27 03:34:35.000000000 +0800
1866++++ b/src/3rdparty/libwebp/src/dsp/filters.c 2024-03-17 19:08:13.362495000 +0800
28471867 @@ -233,6 +233,7 @@
28481868 WebPFilterFunc WebPFilters[WEBP_FILTER_LAST];
28491869 WebPUnfilterFunc WebPUnfilters[WEBP_FILTER_LAST];
@@ -2853,49 +1873,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/filters.c b/src/3rdparty/libwebp/src/d
28531873 extern void VP8FiltersInitMSA(void);
28541874 extern void VP8FiltersInitNEON(void);
28551875 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/lossless.c b/src/3rdparty/libwebp/src/dsp/lossless.c
2856---- a/src/3rdparty/libwebp/src/dsp/lossless.c 2023-11-01 02:38:38.000000000 +0800
2857-+++ b/src/3rdparty/libwebp/src/dsp/lossless.c 2023-09-14 06:11:07.000000000 +0800
2858-@@ -49,7 +49,7 @@
2859- }
2860-
2861- static WEBP_INLINE int AddSubtractComponentFull(int a, int b, int c) {
2862-- return Clip255(a + b - c);
2863-+ return Clip255((uint32_t)(a + b - c));
2864- }
2865-
2866- static WEBP_INLINE uint32_t ClampedAddSubtractFull(uint32_t c0, uint32_t c1,
2867-@@ -66,7 +66,7 @@
2868- }
2869-
2870- static WEBP_INLINE int AddSubtractComponentHalf(int a, int b) {
2871-- return Clip255(a + (a - b) / 2);
2872-+ return Clip255((uint32_t)(a + (a - b) / 2));
2873- }
2874-
2875- static WEBP_INLINE uint32_t ClampedAddSubtractHalf(uint32_t c0, uint32_t c1,
2876-@@ -293,10 +293,10 @@
2877- const uint32_t red = argb >> 16;
2878- int new_red = red & 0xff;
2879- int new_blue = argb & 0xff;
2880-- new_red += ColorTransformDelta(m->green_to_red_, green);
2881-+ new_red += ColorTransformDelta((int8_t)m->green_to_red_, green);
2882- new_red &= 0xff;
2883-- new_blue += ColorTransformDelta(m->green_to_blue_, green);
2884-- new_blue += ColorTransformDelta(m->red_to_blue_, (int8_t)new_red);
2885-+ new_blue += ColorTransformDelta((int8_t)m->green_to_blue_, green);
2886-+ new_blue += ColorTransformDelta((int8_t)m->red_to_blue_, (int8_t)new_red);
2887- new_blue &= 0xff;
2888- dst[i] = (argb & 0xff00ff00u) | (new_red << 16) | (new_blue);
2889- }
2890-@@ -395,7 +395,7 @@
2891- assert(row_start < row_end);
2892- assert(row_end <= transform->ysize_);
2893- switch (transform->type_) {
2894-- case SUBTRACT_GREEN:
2895-+ case SUBTRACT_GREEN_TRANSFORM:
2896- VP8LAddGreenToBlueAndRed(in, (row_end - row_start) * width, out);
2897- break;
2898- case PREDICTOR_TRANSFORM:
1876+--- a/src/3rdparty/libwebp/src/dsp/lossless.c 2024-03-27 03:34:35.000000000 +0800
1877++++ b/src/3rdparty/libwebp/src/dsp/lossless.c 2024-03-17 19:08:13.362495000 +0800
28991878 @@ -588,6 +588,7 @@
29001879 VP8LMapARGBFunc VP8LMapColor32b;
29011880 VP8LMapAlphaFunc VP8LMapColor8b;
@@ -2905,58 +1884,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/lossless.c b/src/3rdparty/libwebp/src/
29051884 extern void VP8LDspInitSSE41(void);
29061885 extern void VP8LDspInitNEON(void);
29071886 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/lossless_enc.c b/src/3rdparty/libwebp/src/dsp/lossless_enc.c
2908---- a/src/3rdparty/libwebp/src/dsp/lossless_enc.c 2023-11-01 02:38:38.000000000 +0800
2909-+++ b/src/3rdparty/libwebp/src/dsp/lossless_enc.c 2023-09-14 06:11:07.000000000 +0800
2910-@@ -522,11 +522,11 @@
2911- void VP8LSubtractGreenFromBlueAndRed_C(uint32_t* argb_data, int num_pixels) {
2912- int i;
2913- for (i = 0; i < num_pixels; ++i) {
2914-- const int argb = argb_data[i];
2915-+ const int argb = (int)argb_data[i];
2916- const int green = (argb >> 8) & 0xff;
2917- const uint32_t new_r = (((argb >> 16) & 0xff) - green) & 0xff;
2918- const uint32_t new_b = (((argb >> 0) & 0xff) - green) & 0xff;
2919-- argb_data[i] = (argb & 0xff00ff00u) | (new_r << 16) | new_b;
2920-+ argb_data[i] = ((uint32_t)argb & 0xff00ff00u) | (new_r << 16) | new_b;
2921- }
2922- }
2923-
2924-@@ -547,10 +547,10 @@
2925- const int8_t red = U32ToS8(argb >> 16);
2926- int new_red = red & 0xff;
2927- int new_blue = argb & 0xff;
2928-- new_red -= ColorTransformDelta(m->green_to_red_, green);
2929-+ new_red -= ColorTransformDelta((int8_t)m->green_to_red_, green);
2930- new_red &= 0xff;
2931-- new_blue -= ColorTransformDelta(m->green_to_blue_, green);
2932-- new_blue -= ColorTransformDelta(m->red_to_blue_, red);
2933-+ new_blue -= ColorTransformDelta((int8_t)m->green_to_blue_, green);
2934-+ new_blue -= ColorTransformDelta((int8_t)m->red_to_blue_, red);
2935- new_blue &= 0xff;
2936- data[i] = (argb & 0xff00ff00u) | (new_red << 16) | (new_blue);
2937- }
2938-@@ -560,7 +560,7 @@
2939- uint32_t argb) {
2940- const int8_t green = U32ToS8(argb >> 8);
2941- int new_red = argb >> 16;
2942-- new_red -= ColorTransformDelta(green_to_red, green);
2943-+ new_red -= ColorTransformDelta((int8_t)green_to_red, green);
2944- return (new_red & 0xff);
2945- }
2946-
2947-@@ -569,9 +569,9 @@
2948- uint32_t argb) {
2949- const int8_t green = U32ToS8(argb >> 8);
2950- const int8_t red = U32ToS8(argb >> 16);
2951-- uint8_t new_blue = argb & 0xff;
2952-- new_blue -= ColorTransformDelta(green_to_blue, green);
2953-- new_blue -= ColorTransformDelta(red_to_blue, red);
2954-+ int new_blue = argb & 0xff;
2955-+ new_blue -= ColorTransformDelta((int8_t)green_to_blue, green);
2956-+ new_blue -= ColorTransformDelta((int8_t)red_to_blue, red);
2957- return (new_blue & 0xff);
2958- }
2959-
1887+--- a/src/3rdparty/libwebp/src/dsp/lossless_enc.c 2024-03-27 03:34:35.000000000 +0800
1888++++ b/src/3rdparty/libwebp/src/dsp/lossless_enc.c 2024-03-17 19:08:13.372402900 +0800
29601889 @@ -791,6 +791,7 @@
29611890 VP8LPredictorAddSubFunc VP8LPredictorsSub[16];
29621891 VP8LPredictorAddSubFunc VP8LPredictorsSub_C[16];
@@ -2966,8 +1895,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/lossless_enc.c b/src/3rdparty/libwebp/
29661895 extern void VP8LEncDspInitSSE41(void);
29671896 extern void VP8LEncDspInitNEON(void);
29681897 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/lossless_enc_neon.c b/src/3rdparty/libwebp/src/dsp/lossless_enc_neon.c
2969---- a/src/3rdparty/libwebp/src/dsp/lossless_enc_neon.c 2023-11-01 02:38:38.000000000 +0800
2970-+++ b/src/3rdparty/libwebp/src/dsp/lossless_enc_neon.c 2023-09-14 06:11:07.000000000 +0800
1898+--- a/src/3rdparty/libwebp/src/dsp/lossless_enc_neon.c 2024-03-27 03:34:35.000000000 +0800
1899++++ b/src/3rdparty/libwebp/src/dsp/lossless_enc_neon.c 2024-03-17 19:08:13.372402900 +0800
29711900 @@ -25,7 +25,7 @@
29721901
29731902 // vtbl?_u8 are marked unavailable for iOS arm64 with Xcode < 6.3, use
@@ -2977,41 +1906,9 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/lossless_enc_neon.c b/src/3rdparty/lib
29771906 defined(__apple_build_version__) && (__apple_build_version__< 6020037)
29781907 #define USE_VTBLQ
29791908 #endif
2980-diff -rNuZ a/src/3rdparty/libwebp/src/dsp/lossless_enc_sse2.c b/src/3rdparty/libwebp/src/dsp/lossless_enc_sse2.c
2981---- a/src/3rdparty/libwebp/src/dsp/lossless_enc_sse2.c 2023-11-01 02:38:38.000000000 +0800
2982-+++ b/src/3rdparty/libwebp/src/dsp/lossless_enc_sse2.c 2023-09-14 06:11:07.000000000 +0800
2983-@@ -54,8 +54,8 @@
2984- const __m128i mults_rb = MK_CST_16(CST_5b(m->green_to_red_),
2985- CST_5b(m->green_to_blue_));
2986- const __m128i mults_b2 = MK_CST_16(CST_5b(m->red_to_blue_), 0);
2987-- const __m128i mask_ag = _mm_set1_epi32(0xff00ff00); // alpha-green masks
2988-- const __m128i mask_rb = _mm_set1_epi32(0x00ff00ff); // red-blue masks
2989-+ const __m128i mask_ag = _mm_set1_epi32((int)0xff00ff00); // alpha-green masks
2990-+ const __m128i mask_rb = _mm_set1_epi32(0x00ff00ff); // red-blue masks
2991- int i;
2992- for (i = 0; i + 4 <= num_pixels; i += 4) {
2993- const __m128i in = _mm_loadu_si128((__m128i*)&argb_data[i]); // argb
2994-@@ -376,7 +376,7 @@
2995- break;
2996- }
2997- case 2: {
2998-- const __m128i mask_or = _mm_set1_epi32(0xff000000);
2999-+ const __m128i mask_or = _mm_set1_epi32((int)0xff000000);
3000- const __m128i mul_cst = _mm_set1_epi16(0x0104);
3001- const __m128i mask_mul = _mm_set1_epi16(0x0f00);
3002- for (x = 0; x + 16 <= width; x += 16, dst += 4) {
3003-@@ -427,7 +427,7 @@
3004- static void PredictorSub0_SSE2(const uint32_t* in, const uint32_t* upper,
3005- int num_pixels, uint32_t* out) {
3006- int i;
3007-- const __m128i black = _mm_set1_epi32(ARGB_BLACK);
3008-+ const __m128i black = _mm_set1_epi32((int)ARGB_BLACK);
3009- for (i = 0; i + 4 <= num_pixels; i += 4) {
3010- const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]);
3011- const __m128i res = _mm_sub_epi8(src, black);
30121909 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/lossless_neon.c b/src/3rdparty/libwebp/src/dsp/lossless_neon.c
3013---- a/src/3rdparty/libwebp/src/dsp/lossless_neon.c 2023-11-01 02:38:38.000000000 +0800
3014-+++ b/src/3rdparty/libwebp/src/dsp/lossless_neon.c 2023-09-14 06:11:07.000000000 +0800
1910+--- a/src/3rdparty/libwebp/src/dsp/lossless_neon.c 2024-03-27 03:34:35.000000000 +0800
1911++++ b/src/3rdparty/libwebp/src/dsp/lossless_neon.c 2024-03-17 19:08:13.375915300 +0800
30151912 @@ -498,7 +498,7 @@
30161913
30171914 // vtbl?_u8 are marked unavailable for iOS arm64 with Xcode < 6.3, use
@@ -3021,268 +1918,9 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/lossless_neon.c b/src/3rdparty/libwebp
30211918 defined(__apple_build_version__) && (__apple_build_version__< 6020037)
30221919 #define USE_VTBLQ
30231920 #endif
3024-diff -rNuZ a/src/3rdparty/libwebp/src/dsp/lossless_sse2.c b/src/3rdparty/libwebp/src/dsp/lossless_sse2.c
3025---- a/src/3rdparty/libwebp/src/dsp/lossless_sse2.c 2023-11-01 02:38:38.000000000 +0800
3026-+++ b/src/3rdparty/libwebp/src/dsp/lossless_sse2.c 2023-09-14 06:11:07.000000000 +0800
3027-@@ -27,23 +27,22 @@
3028- uint32_t c1,
3029- uint32_t c2) {
3030- const __m128i zero = _mm_setzero_si128();
3031-- const __m128i C0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(c0), zero);
3032-- const __m128i C1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(c1), zero);
3033-- const __m128i C2 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(c2), zero);
3034-+ const __m128i C0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128((int)c0), zero);
3035-+ const __m128i C1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128((int)c1), zero);
3036-+ const __m128i C2 = _mm_unpacklo_epi8(_mm_cvtsi32_si128((int)c2), zero);
3037- const __m128i V1 = _mm_add_epi16(C0, C1);
3038- const __m128i V2 = _mm_sub_epi16(V1, C2);
3039- const __m128i b = _mm_packus_epi16(V2, V2);
3040-- const uint32_t output = _mm_cvtsi128_si32(b);
3041-- return output;
3042-+ return (uint32_t)_mm_cvtsi128_si32(b);
3043- }
3044-
3045- static WEBP_INLINE uint32_t ClampedAddSubtractHalf_SSE2(uint32_t c0,
3046- uint32_t c1,
3047- uint32_t c2) {
3048- const __m128i zero = _mm_setzero_si128();
3049-- const __m128i C0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(c0), zero);
3050-- const __m128i C1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(c1), zero);
3051-- const __m128i B0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(c2), zero);
3052-+ const __m128i C0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128((int)c0), zero);
3053-+ const __m128i C1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128((int)c1), zero);
3054-+ const __m128i B0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128((int)c2), zero);
3055- const __m128i avg = _mm_add_epi16(C1, C0);
3056- const __m128i A0 = _mm_srli_epi16(avg, 1);
3057- const __m128i A1 = _mm_sub_epi16(A0, B0);
3058-@@ -52,16 +51,15 @@
3059- const __m128i A3 = _mm_srai_epi16(A2, 1);
3060- const __m128i A4 = _mm_add_epi16(A0, A3);
3061- const __m128i A5 = _mm_packus_epi16(A4, A4);
3062-- const uint32_t output = _mm_cvtsi128_si32(A5);
3063-- return output;
3064-+ return (uint32_t)_mm_cvtsi128_si32(A5);
3065- }
3066-
3067- static WEBP_INLINE uint32_t Select_SSE2(uint32_t a, uint32_t b, uint32_t c) {
3068- int pa_minus_pb;
3069- const __m128i zero = _mm_setzero_si128();
3070-- const __m128i A0 = _mm_cvtsi32_si128(a);
3071-- const __m128i B0 = _mm_cvtsi32_si128(b);
3072-- const __m128i C0 = _mm_cvtsi32_si128(c);
3073-+ const __m128i A0 = _mm_cvtsi32_si128((int)a);
3074-+ const __m128i B0 = _mm_cvtsi32_si128((int)b);
3075-+ const __m128i C0 = _mm_cvtsi32_si128((int)c);
3076- const __m128i AC0 = _mm_subs_epu8(A0, C0);
3077- const __m128i CA0 = _mm_subs_epu8(C0, A0);
3078- const __m128i BC0 = _mm_subs_epu8(B0, C0);
3079-@@ -94,8 +92,8 @@
3080- __m128i* const avg) {
3081- // (a + b) >> 1 = ((a + b + 1) >> 1) - ((a ^ b) & 1)
3082- const __m128i ones = _mm_set1_epi8(1);
3083-- const __m128i A0 = _mm_cvtsi32_si128(a0);
3084-- const __m128i A1 = _mm_cvtsi32_si128(a1);
3085-+ const __m128i A0 = _mm_cvtsi32_si128((int)a0);
3086-+ const __m128i A1 = _mm_cvtsi32_si128((int)a1);
3087- const __m128i avg1 = _mm_avg_epu8(A0, A1);
3088- const __m128i one = _mm_and_si128(_mm_xor_si128(A0, A1), ones);
3089- *avg = _mm_sub_epi8(avg1, one);
3090-@@ -103,8 +101,8 @@
3091-
3092- static WEBP_INLINE __m128i Average2_uint32_16_SSE2(uint32_t a0, uint32_t a1) {
3093- const __m128i zero = _mm_setzero_si128();
3094-- const __m128i A0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(a0), zero);
3095-- const __m128i A1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(a1), zero);
3096-+ const __m128i A0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128((int)a0), zero);
3097-+ const __m128i A1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128((int)a1), zero);
3098- const __m128i sum = _mm_add_epi16(A1, A0);
3099- return _mm_srli_epi16(sum, 1);
3100- }
3101-@@ -112,19 +110,18 @@
3102- static WEBP_INLINE uint32_t Average2_SSE2(uint32_t a0, uint32_t a1) {
3103- __m128i output;
3104- Average2_uint32_SSE2(a0, a1, &output);
3105-- return _mm_cvtsi128_si32(output);
3106-+ return (uint32_t)_mm_cvtsi128_si32(output);
3107- }
3108-
3109- static WEBP_INLINE uint32_t Average3_SSE2(uint32_t a0, uint32_t a1,
3110- uint32_t a2) {
3111- const __m128i zero = _mm_setzero_si128();
3112- const __m128i avg1 = Average2_uint32_16_SSE2(a0, a2);
3113-- const __m128i A1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(a1), zero);
3114-+ const __m128i A1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128((int)a1), zero);
3115- const __m128i sum = _mm_add_epi16(avg1, A1);
3116- const __m128i avg2 = _mm_srli_epi16(sum, 1);
3117- const __m128i A2 = _mm_packus_epi16(avg2, avg2);
3118-- const uint32_t output = _mm_cvtsi128_si32(A2);
3119-- return output;
3120-+ return (uint32_t)_mm_cvtsi128_si32(A2);
3121- }
3122-
3123- static WEBP_INLINE uint32_t Average4_SSE2(uint32_t a0, uint32_t a1,
3124-@@ -134,8 +131,7 @@
3125- const __m128i sum = _mm_add_epi16(avg2, avg1);
3126- const __m128i avg3 = _mm_srli_epi16(sum, 1);
3127- const __m128i A0 = _mm_packus_epi16(avg3, avg3);
3128-- const uint32_t output = _mm_cvtsi128_si32(A0);
3129-- return output;
3130-+ return (uint32_t)_mm_cvtsi128_si32(A0);
3131- }
3132-
3133- static uint32_t Predictor5_SSE2(const uint32_t* const left,
3134-@@ -192,7 +188,7 @@
3135- static void PredictorAdd0_SSE2(const uint32_t* in, const uint32_t* upper,
3136- int num_pixels, uint32_t* out) {
3137- int i;
3138-- const __m128i black = _mm_set1_epi32(ARGB_BLACK);
3139-+ const __m128i black = _mm_set1_epi32((int)ARGB_BLACK);
3140- for (i = 0; i + 4 <= num_pixels; i += 4) {
3141- const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]);
3142- const __m128i res = _mm_add_epi8(src, black);
3143-@@ -208,7 +204,7 @@
3144- static void PredictorAdd1_SSE2(const uint32_t* in, const uint32_t* upper,
3145- int num_pixels, uint32_t* out) {
3146- int i;
3147-- __m128i prev = _mm_set1_epi32(out[-1]);
3148-+ __m128i prev = _mm_set1_epi32((int)out[-1]);
3149- for (i = 0; i + 4 <= num_pixels; i += 4) {
3150- // a | b | c | d
3151- const __m128i src = _mm_loadu_si128((const __m128i*)&in[i]);
3152-@@ -285,12 +281,12 @@
3153- #undef GENERATE_PREDICTOR_2
3154-
3155- // Predictor10: average of (average of (L,TL), average of (T, TR)).
3156--#define DO_PRED10(OUT) do { \
3157-- __m128i avgLTL, avg; \
3158-- Average2_m128i(&L, &TL, &avgLTL); \
3159-- Average2_m128i(&avgTTR, &avgLTL, &avg); \
3160-- L = _mm_add_epi8(avg, src); \
3161-- out[i + (OUT)] = _mm_cvtsi128_si32(L); \
3162-+#define DO_PRED10(OUT) do { \
3163-+ __m128i avgLTL, avg; \
3164-+ Average2_m128i(&L, &TL, &avgLTL); \
3165-+ Average2_m128i(&avgTTR, &avgLTL, &avg); \
3166-+ L = _mm_add_epi8(avg, src); \
3167-+ out[i + (OUT)] = (uint32_t)_mm_cvtsi128_si32(L); \
3168- } while (0)
3169-
3170- #define DO_PRED10_SHIFT do { \
3171-@@ -303,7 +299,7 @@
3172- static void PredictorAdd10_SSE2(const uint32_t* in, const uint32_t* upper,
3173- int num_pixels, uint32_t* out) {
3174- int i;
3175-- __m128i L = _mm_cvtsi32_si128(out[-1]);
3176-+ __m128i L = _mm_cvtsi32_si128((int)out[-1]);
3177- for (i = 0; i + 4 <= num_pixels; i += 4) {
3178- __m128i src = _mm_loadu_si128((const __m128i*)&in[i]);
3179- __m128i TL = _mm_loadu_si128((const __m128i*)&upper[i - 1]);
3180-@@ -336,7 +332,7 @@
3181- const __m128i B = _mm_andnot_si128(mask, T); \
3182- const __m128i pred = _mm_or_si128(A, B); /* pred = (pa > b)? L : T*/ \
3183- L = _mm_add_epi8(src, pred); \
3184-- out[i + (OUT)] = _mm_cvtsi128_si32(L); \
3185-+ out[i + (OUT)] = (uint32_t)_mm_cvtsi128_si32(L); \
3186- } while (0)
3187-
3188- #define DO_PRED11_SHIFT do { \
3189-@@ -351,7 +347,7 @@
3190- int num_pixels, uint32_t* out) {
3191- int i;
3192- __m128i pa;
3193-- __m128i L = _mm_cvtsi32_si128(out[-1]);
3194-+ __m128i L = _mm_cvtsi32_si128((int)out[-1]);
3195- for (i = 0; i + 4 <= num_pixels; i += 4) {
3196- __m128i T = _mm_loadu_si128((const __m128i*)&upper[i]);
3197- __m128i TL = _mm_loadu_si128((const __m128i*)&upper[i - 1]);
3198-@@ -384,12 +380,12 @@
3199- #undef DO_PRED11_SHIFT
3200-
3201- // Predictor12: ClampedAddSubtractFull.
3202--#define DO_PRED12(DIFF, LANE, OUT) do { \
3203-- const __m128i all = _mm_add_epi16(L, (DIFF)); \
3204-- const __m128i alls = _mm_packus_epi16(all, all); \
3205-- const __m128i res = _mm_add_epi8(src, alls); \
3206-- out[i + (OUT)] = _mm_cvtsi128_si32(res); \
3207-- L = _mm_unpacklo_epi8(res, zero); \
3208-+#define DO_PRED12(DIFF, LANE, OUT) do { \
3209-+ const __m128i all = _mm_add_epi16(L, (DIFF)); \
3210-+ const __m128i alls = _mm_packus_epi16(all, all); \
3211-+ const __m128i res = _mm_add_epi8(src, alls); \
3212-+ out[i + (OUT)] = (uint32_t)_mm_cvtsi128_si32(res); \
3213-+ L = _mm_unpacklo_epi8(res, zero); \
3214- } while (0)
3215-
3216- #define DO_PRED12_SHIFT(DIFF, LANE) do { \
3217-@@ -402,7 +398,7 @@
3218- int num_pixels, uint32_t* out) {
3219- int i;
3220- const __m128i zero = _mm_setzero_si128();
3221-- const __m128i L8 = _mm_cvtsi32_si128(out[-1]);
3222-+ const __m128i L8 = _mm_cvtsi32_si128((int)out[-1]);
3223- __m128i L = _mm_unpacklo_epi8(L8, zero);
3224- for (i = 0; i + 4 <= num_pixels; i += 4) {
3225- // Load 4 pixels at a time.
3226-@@ -468,7 +464,7 @@
3227- const __m128i mults_b2 = MK_CST_16(CST(red_to_blue_), 0);
3228- #undef MK_CST_16
3229- #undef CST
3230-- const __m128i mask_ag = _mm_set1_epi32(0xff00ff00); // alpha-green masks
3231-+ const __m128i mask_ag = _mm_set1_epi32((int)0xff00ff00); // alpha-green masks
3232- int i;
3233- for (i = 0; i + 4 <= num_pixels; i += 4) {
3234- const __m128i in = _mm_loadu_si128((const __m128i*)&src[i]); // argb
3235-@@ -532,7 +528,7 @@
3236-
3237- static void ConvertBGRAToRGBA_SSE2(const uint32_t* src,
3238- int num_pixels, uint8_t* dst) {
3239-- const __m128i red_blue_mask = _mm_set1_epi32(0x00ff00ffu);
3240-+ const __m128i red_blue_mask = _mm_set1_epi32(0x00ff00ff);
3241- const __m128i* in = (const __m128i*)src;
3242- __m128i* out = (__m128i*)dst;
3243- while (num_pixels >= 8) {
3244-@@ -561,7 +557,7 @@
3245- static void ConvertBGRAToRGBA4444_SSE2(const uint32_t* src,
3246- int num_pixels, uint8_t* dst) {
3247- const __m128i mask_0x0f = _mm_set1_epi8(0x0f);
3248-- const __m128i mask_0xf0 = _mm_set1_epi8(0xf0);
3249-+ const __m128i mask_0xf0 = _mm_set1_epi8((char)0xf0);
3250- const __m128i* in = (const __m128i*)src;
3251- __m128i* out = (__m128i*)dst;
3252- while (num_pixels >= 8) {
3253-@@ -596,8 +592,8 @@
3254-
3255- static void ConvertBGRAToRGB565_SSE2(const uint32_t* src,
3256- int num_pixels, uint8_t* dst) {
3257-- const __m128i mask_0xe0 = _mm_set1_epi8(0xe0);
3258-- const __m128i mask_0xf8 = _mm_set1_epi8(0xf8);
3259-+ const __m128i mask_0xe0 = _mm_set1_epi8((char)0xe0);
3260-+ const __m128i mask_0xf8 = _mm_set1_epi8((char)0xf8);
3261- const __m128i mask_0x07 = _mm_set1_epi8(0x07);
3262- const __m128i* in = (const __m128i*)src;
3263- __m128i* out = (__m128i*)dst;
3264-diff -rNuZ a/src/3rdparty/libwebp/src/dsp/lossless_sse41.c b/src/3rdparty/libwebp/src/dsp/lossless_sse41.c
3265---- a/src/3rdparty/libwebp/src/dsp/lossless_sse41.c 2023-11-01 02:38:38.000000000 +0800
3266-+++ b/src/3rdparty/libwebp/src/dsp/lossless_sse41.c 2023-09-14 06:11:07.000000000 +0800
3267-@@ -25,11 +25,12 @@
3268- int num_pixels, uint32_t* dst) {
3269- // sign-extended multiplying constants, pre-shifted by 5.
3270- #define CST(X) (((int16_t)(m->X << 8)) >> 5) // sign-extend
3271-- const __m128i mults_rb = _mm_set1_epi32((uint32_t)CST(green_to_red_) << 16 |
3272-- (CST(green_to_blue_) & 0xffff));
3273-+ const __m128i mults_rb =
3274-+ _mm_set1_epi32((int)((uint32_t)CST(green_to_red_) << 16 |
3275-+ (CST(green_to_blue_) & 0xffff)));
3276- const __m128i mults_b2 = _mm_set1_epi32(CST(red_to_blue_));
3277- #undef CST
3278-- const __m128i mask_ag = _mm_set1_epi32(0xff00ff00);
3279-+ const __m128i mask_ag = _mm_set1_epi32((int)0xff00ff00);
3280- const __m128i perm1 = _mm_setr_epi8(-1, 1, -1, 1, -1, 5, -1, 5,
3281- -1, 9, -1, 9, -1, 13, -1, 13);
3282- const __m128i perm2 = _mm_setr_epi8(-1, 2, -1, -1, -1, 6, -1, -1,
32831921 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/neon.h b/src/3rdparty/libwebp/src/dsp/neon.h
3284---- a/src/3rdparty/libwebp/src/dsp/neon.h 2023-11-01 02:38:38.000000000 +0800
3285-+++ b/src/3rdparty/libwebp/src/dsp/neon.h 2023-09-14 06:11:07.000000000 +0800
1922+--- a/src/3rdparty/libwebp/src/dsp/neon.h 2024-03-27 03:34:35.000000000 +0800
1923++++ b/src/3rdparty/libwebp/src/dsp/neon.h 2024-03-17 19:08:13.382498000 +0800
32861924 @@ -21,7 +21,7 @@
32871925 // Right now, some intrinsics functions seem slower, so we disable them
32881926 // everywhere except newer clang/gcc or aarch64 where the inline assembly is
@@ -3302,39 +1940,20 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/neon.h b/src/3rdparty/libwebp/src/dsp/
33021940 #endif
33031941
33041942 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/quant.h b/src/3rdparty/libwebp/src/dsp/quant.h
3305---- a/src/3rdparty/libwebp/src/dsp/quant.h 2023-11-01 02:38:38.000000000 +0800
3306-+++ b/src/3rdparty/libwebp/src/dsp/quant.h 2023-09-14 06:11:07.000000000 +0800
3307-@@ -21,10 +21,15 @@
3308-
1943+--- a/src/3rdparty/libwebp/src/dsp/quant.h 2024-03-27 03:34:35.000000000 +0800
1944++++ b/src/3rdparty/libwebp/src/dsp/quant.h 2024-03-17 19:08:13.382498000 +0800
1945+@@ -22,7 +22,7 @@
33091946 #define IsFlat IsFlat_NEON
33101947
3311--static uint32x2_t horizontal_add_uint32x4(const uint32x4_t a) {
3312-+static uint32_t horizontal_add_uint32x4(const uint32x4_t a) {
1948+ static uint32_t horizontal_add_uint32x4(const uint32x4_t a) {
1949+-#if defined(__aarch64__)
33131950 +#if WEBP_AARCH64
3314-+ return vaddvq_u32(a);
3315-+#else
3316- const uint64x2_t b = vpaddlq_u32(a);
3317-- return vadd_u32(vreinterpret_u32_u64(vget_low_u64(b)),
3318-- vreinterpret_u32_u64(vget_high_u64(b)));
3319-+ const uint32x2_t c = vadd_u32(vreinterpret_u32_u64(vget_low_u64(b)),
3320-+ vreinterpret_u32_u64(vget_high_u64(b)));
3321-+ return vget_lane_u32(c, 0);
3322-+#endif
3323- }
3324-
3325- static WEBP_INLINE int IsFlat(const int16_t* levels, int num_blocks,
3326-@@ -45,7 +50,7 @@
3327-
3328- levels += 16;
3329- }
3330-- return thresh >= (int32_t)vget_lane_u32(horizontal_add_uint32x4(sum), 0);
3331-+ return thresh >= (int)horizontal_add_uint32x4(sum);
3332- }
3333-
1951+ return vaddvq_u32(a);
33341952 #else
1953+ const uint64x2_t b = vpaddlq_u32(a);
33351954 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/rescaler.c b/src/3rdparty/libwebp/src/dsp/rescaler.c
3336---- a/src/3rdparty/libwebp/src/dsp/rescaler.c 2023-11-01 02:38:38.000000000 +0800
3337-+++ b/src/3rdparty/libwebp/src/dsp/rescaler.c 2023-09-14 06:11:07.000000000 +0800
1955+--- a/src/3rdparty/libwebp/src/dsp/rescaler.c 2024-03-27 03:34:35.000000000 +0800
1956++++ b/src/3rdparty/libwebp/src/dsp/rescaler.c 2024-03-17 19:08:13.382498000 +0800
33381957 @@ -197,6 +197,7 @@
33391958 WebPRescalerExportRowFunc WebPRescalerExportRowExpand;
33401959 WebPRescalerExportRowFunc WebPRescalerExportRowShrink;
@@ -3343,39 +1962,9 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/rescaler.c b/src/3rdparty/libwebp/src/
33431962 extern void WebPRescalerDspInitSSE2(void);
33441963 extern void WebPRescalerDspInitMIPS32(void);
33451964 extern void WebPRescalerDspInitMIPSdspR2(void);
3346-diff -rNuZ a/src/3rdparty/libwebp/src/dsp/rescaler_sse2.c b/src/3rdparty/libwebp/src/dsp/rescaler_sse2.c
3347---- a/src/3rdparty/libwebp/src/dsp/rescaler_sse2.c 2023-11-01 02:38:38.000000000 +0800
3348-+++ b/src/3rdparty/libwebp/src/dsp/rescaler_sse2.c 2023-09-14 06:11:07.000000000 +0800
3349-@@ -85,7 +85,7 @@
3350- const __m128i mult = _mm_cvtsi32_si128(((x_add - accum) << 16) | accum);
3351- const __m128i out = _mm_madd_epi16(cur_pixels, mult);
3352- assert(sizeof(*frow) == sizeof(uint32_t));
3353-- WebPUint32ToMem((uint8_t*)frow, _mm_cvtsi128_si32(out));
3354-+ WebPInt32ToMem((uint8_t*)frow, _mm_cvtsi128_si32(out));
3355- frow += 1;
3356- if (frow >= frow_end) break;
3357- accum -= wrk->x_sub;
3358-@@ -132,7 +132,7 @@
3359- __m128i base = zero;
3360- accum += wrk->x_add;
3361- while (accum > 0) {
3362-- const __m128i A = _mm_cvtsi32_si128(WebPMemToUint32(src));
3363-+ const __m128i A = _mm_cvtsi32_si128(WebPMemToInt32(src));
3364- src += 4;
3365- base = _mm_unpacklo_epi8(A, zero);
3366- // To avoid overflow, we need: base * x_add / x_sub < 32768
3367-@@ -198,7 +198,7 @@
3368- const __m128i* const mult,
3369- uint8_t* const dst) {
3370- const __m128i rounder = _mm_set_epi32(0, ROUNDER, 0, ROUNDER);
3371-- const __m128i mask = _mm_set_epi32(0xffffffffu, 0, 0xffffffffu, 0);
3372-+ const __m128i mask = _mm_set_epi32(~0, 0, ~0, 0);
3373- const __m128i B0 = _mm_mul_epu32(*A0, *mult);
3374- const __m128i B1 = _mm_mul_epu32(*A1, *mult);
3375- const __m128i B2 = _mm_mul_epu32(*A2, *mult);
33761965 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/ssim.c b/src/3rdparty/libwebp/src/dsp/ssim.c
3377---- a/src/3rdparty/libwebp/src/dsp/ssim.c 2023-11-01 02:38:38.000000000 +0800
3378-+++ b/src/3rdparty/libwebp/src/dsp/ssim.c 2023-09-14 06:11:07.000000000 +0800
1966+--- a/src/3rdparty/libwebp/src/dsp/ssim.c 2024-03-27 03:34:35.000000000 +0800
1967++++ b/src/3rdparty/libwebp/src/dsp/ssim.c 2024-03-17 19:08:13.382498000 +0800
33791968 @@ -137,6 +137,7 @@
33801969 VP8AccumulateSSEFunc VP8AccumulateSSE;
33811970 #endif
@@ -3385,8 +1974,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/ssim.c b/src/3rdparty/libwebp/src/dsp/
33851974
33861975 WEBP_DSP_INIT_FUNC(VP8SSIMDspInit) {
33871976 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/upsampling.c b/src/3rdparty/libwebp/src/dsp/upsampling.c
3388---- a/src/3rdparty/libwebp/src/dsp/upsampling.c 2023-11-01 02:38:38.000000000 +0800
3389-+++ b/src/3rdparty/libwebp/src/dsp/upsampling.c 2023-09-14 06:11:07.000000000 +0800
1977+--- a/src/3rdparty/libwebp/src/dsp/upsampling.c 2024-03-27 03:34:35.000000000 +0800
1978++++ b/src/3rdparty/libwebp/src/dsp/upsampling.c 2024-03-17 19:08:13.382498000 +0800
33901979 @@ -215,6 +215,7 @@
33911980
33921981 WebPYUV444Converter WebPYUV444Converters[MODE_LAST];
@@ -3396,8 +1985,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/upsampling.c b/src/3rdparty/libwebp/sr
33961985 extern void WebPInitYUV444ConvertersSSE2(void);
33971986 extern void WebPInitYUV444ConvertersSSE41(void);
33981987 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/upsampling_neon.c b/src/3rdparty/libwebp/src/dsp/upsampling_neon.c
3399---- a/src/3rdparty/libwebp/src/dsp/upsampling_neon.c 2023-11-01 02:38:38.000000000 +0800
3400-+++ b/src/3rdparty/libwebp/src/dsp/upsampling_neon.c 2023-09-14 06:11:07.000000000 +0800
1988+--- a/src/3rdparty/libwebp/src/dsp/upsampling_neon.c 2024-03-27 03:34:35.000000000 +0800
1989++++ b/src/3rdparty/libwebp/src/dsp/upsampling_neon.c 2024-03-17 19:08:13.382498000 +0800
34011990 @@ -111,7 +111,7 @@
34021991 vst4_u8(out, v255_r_g_b); \
34031992 } while (0)
@@ -3407,21 +1996,9 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/upsampling_neon.c b/src/3rdparty/libwe
34071996 #define ZIP_U8(lo, hi) vzip_u8((lo), (hi))
34081997 #else
34091998 #define ZIP_U8(lo, hi) vzip_u8((hi), (lo))
3410-diff -rNuZ a/src/3rdparty/libwebp/src/dsp/upsampling_sse2.c b/src/3rdparty/libwebp/src/dsp/upsampling_sse2.c
3411---- a/src/3rdparty/libwebp/src/dsp/upsampling_sse2.c 2023-11-01 02:38:38.000000000 +0800
3412-+++ b/src/3rdparty/libwebp/src/dsp/upsampling_sse2.c 2023-09-14 06:11:07.000000000 +0800
3413-@@ -121,7 +121,7 @@
3414- int uv_pos, pos; \
3415- /* 16byte-aligned array to cache reconstructed u and v */ \
3416- uint8_t uv_buf[14 * 32 + 15] = { 0 }; \
3417-- uint8_t* const r_u = (uint8_t*)((uintptr_t)(uv_buf + 15) & ~15); \
3418-+ uint8_t* const r_u = (uint8_t*)((uintptr_t)(uv_buf + 15) & ~(uintptr_t)15); \
3419- uint8_t* const r_v = r_u + 32; \
3420- \
3421- assert(top_y != NULL); \
34221999 diff -rNuZ a/src/3rdparty/libwebp/src/dsp/yuv.c b/src/3rdparty/libwebp/src/dsp/yuv.c
3423---- a/src/3rdparty/libwebp/src/dsp/yuv.c 2023-11-01 02:38:38.000000000 +0800
3424-+++ b/src/3rdparty/libwebp/src/dsp/yuv.c 2023-09-14 06:11:07.000000000 +0800
2000+--- a/src/3rdparty/libwebp/src/dsp/yuv.c 2024-03-27 03:34:35.000000000 +0800
2001++++ b/src/3rdparty/libwebp/src/dsp/yuv.c 2024-03-17 19:08:13.392497200 +0800
34252002 @@ -70,6 +70,7 @@
34262003
34272004 WebPSamplerRowFunc WebPSamplers[MODE_LAST];
@@ -3430,83 +2007,9 @@ diff -rNuZ a/src/3rdparty/libwebp/src/dsp/yuv.c b/src/3rdparty/libwebp/src/dsp/y
34302007 extern void WebPInitSamplersSSE2(void);
34312008 extern void WebPInitSamplersSSE41(void);
34322009 extern void WebPInitSamplersMIPS32(void);
3433-diff -rNuZ a/src/3rdparty/libwebp/src/dsp/yuv_sse2.c b/src/3rdparty/libwebp/src/dsp/yuv_sse2.c
3434---- a/src/3rdparty/libwebp/src/dsp/yuv_sse2.c 2023-11-01 02:38:38.000000000 +0800
3435-+++ b/src/3rdparty/libwebp/src/dsp/yuv_sse2.c 2023-09-14 06:11:07.000000000 +0800
3436-@@ -15,10 +15,12 @@
3437-
3438- #if defined(WEBP_USE_SSE2)
3439-
3440--#include "src/dsp/common_sse2.h"
3441- #include <stdlib.h>
3442- #include <emmintrin.h>
3443-
3444-+#include "src/dsp/common_sse2.h"
3445-+#include "src/utils/utils.h"
3446-+
3447- //-----------------------------------------------------------------------------
3448- // Convert spans of 32 pixels to various RGB formats for the fancy upsampler.
3449-
3450-@@ -74,7 +76,7 @@
3451- // Load and replicate the U/V samples
3452- static WEBP_INLINE __m128i Load_UV_HI_8_SSE2(const uint8_t* src) {
3453- const __m128i zero = _mm_setzero_si128();
3454-- const __m128i tmp0 = _mm_cvtsi32_si128(*(const uint32_t*)src);
3455-+ const __m128i tmp0 = _mm_cvtsi32_si128(WebPMemToInt32(src));
3456- const __m128i tmp1 = _mm_unpacklo_epi8(zero, tmp0);
3457- return _mm_unpacklo_epi16(tmp1, tmp1); // replicate samples
3458- }
3459-@@ -130,7 +132,7 @@
3460- const __m128i rg0 = _mm_packus_epi16(*B, *A);
3461- const __m128i ba0 = _mm_packus_epi16(*R, *G);
3462- #endif
3463-- const __m128i mask_0xf0 = _mm_set1_epi8(0xf0);
3464-+ const __m128i mask_0xf0 = _mm_set1_epi8((char)0xf0);
3465- const __m128i rb1 = _mm_unpacklo_epi8(rg0, ba0); // rbrbrbrbrb...
3466- const __m128i ga1 = _mm_unpackhi_epi8(rg0, ba0); // gagagagaga...
3467- const __m128i rb2 = _mm_and_si128(rb1, mask_0xf0);
3468-@@ -147,9 +149,10 @@
3469- const __m128i r0 = _mm_packus_epi16(*R, *R);
3470- const __m128i g0 = _mm_packus_epi16(*G, *G);
3471- const __m128i b0 = _mm_packus_epi16(*B, *B);
3472-- const __m128i r1 = _mm_and_si128(r0, _mm_set1_epi8(0xf8));
3473-+ const __m128i r1 = _mm_and_si128(r0, _mm_set1_epi8((char)0xf8));
3474- const __m128i b1 = _mm_and_si128(_mm_srli_epi16(b0, 3), _mm_set1_epi8(0x1f));
3475-- const __m128i g1 = _mm_srli_epi16(_mm_and_si128(g0, _mm_set1_epi8(0xe0)), 5);
3476-+ const __m128i g1 =
3477-+ _mm_srli_epi16(_mm_and_si128(g0, _mm_set1_epi8((char)0xe0)), 5);
3478- const __m128i g2 = _mm_slli_epi16(_mm_and_si128(g0, _mm_set1_epi8(0x1c)), 3);
3479- const __m128i rg = _mm_or_si128(r1, g1);
3480- const __m128i gb = _mm_or_si128(g2, b1);
3481-diff -rNuZ a/src/3rdparty/libwebp/src/dsp/yuv_sse41.c b/src/3rdparty/libwebp/src/dsp/yuv_sse41.c
3482---- a/src/3rdparty/libwebp/src/dsp/yuv_sse41.c 2023-11-01 02:38:38.000000000 +0800
3483-+++ b/src/3rdparty/libwebp/src/dsp/yuv_sse41.c 2023-09-14 06:11:07.000000000 +0800
3484-@@ -15,10 +15,12 @@
3485-
3486- #if defined(WEBP_USE_SSE41)
3487-
3488--#include "src/dsp/common_sse41.h"
3489- #include <stdlib.h>
3490- #include <smmintrin.h>
3491-
3492-+#include "src/dsp/common_sse41.h"
3493-+#include "src/utils/utils.h"
3494-+
3495- //-----------------------------------------------------------------------------
3496- // Convert spans of 32 pixels to various RGB formats for the fancy upsampler.
3497-
3498-@@ -74,7 +76,7 @@
3499- // Load and replicate the U/V samples
3500- static WEBP_INLINE __m128i Load_UV_HI_8_SSE41(const uint8_t* src) {
3501- const __m128i zero = _mm_setzero_si128();
3502-- const __m128i tmp0 = _mm_cvtsi32_si128(*(const uint32_t*)src);
3503-+ const __m128i tmp0 = _mm_cvtsi32_si128(WebPMemToInt32(src));
3504- const __m128i tmp1 = _mm_unpacklo_epi8(zero, tmp0);
3505- return _mm_unpacklo_epi16(tmp1, tmp1); // replicate samples
3506- }
35072010 diff -rNuZ a/src/3rdparty/libwebp/src/enc/alpha_enc.c b/src/3rdparty/libwebp/src/enc/alpha_enc.c
3508---- a/src/3rdparty/libwebp/src/enc/alpha_enc.c 2023-11-01 02:38:38.000000000 +0800
3509-+++ b/src/3rdparty/libwebp/src/enc/alpha_enc.c 2023-09-14 06:11:07.000000000 +0800
2011+--- a/src/3rdparty/libwebp/src/enc/alpha_enc.c 2024-03-27 03:34:35.000000000 +0800
2012++++ b/src/3rdparty/libwebp/src/enc/alpha_enc.c 2024-03-17 19:08:13.392497200 +0800
35102013 @@ -13,6 +13,7 @@
35112014
35122015 #include <assert.h>
@@ -3587,53 +2090,9 @@ diff -rNuZ a/src/3rdparty/libwebp/src/enc/alpha_enc.c b/src/3rdparty/libwebp/src
35872090 WebPGetWorkerInterface()->Launch(worker);
35882091 return 1;
35892092 diff -rNuZ a/src/3rdparty/libwebp/src/enc/analysis_enc.c b/src/3rdparty/libwebp/src/enc/analysis_enc.c
3590---- a/src/3rdparty/libwebp/src/enc/analysis_enc.c 2023-11-01 02:38:38.000000000 +0800
3591-+++ b/src/3rdparty/libwebp/src/enc/analysis_enc.c 2023-09-14 06:11:07.000000000 +0800
3592-@@ -391,12 +391,14 @@
3593- return ok;
3594- }
3595-
3596-+#ifdef WEBP_USE_THREAD
3597- static void MergeJobs(const SegmentJob* const src, SegmentJob* const dst) {
3598- int i;
3599- for (i = 0; i <= MAX_ALPHA; ++i) dst->alphas[i] += src->alphas[i];
3600- dst->alpha += src->alpha;
3601- dst->uv_alpha += src->uv_alpha;
3602- }
3603-+#endif
3604-
3605- // initialize the job struct with some tasks to perform
3606- static void InitSegmentJob(VP8Encoder* const enc, SegmentJob* const job,
3607-@@ -425,10 +427,10 @@
3608- (enc->method_ <= 1); // for method 0 - 1, we need preds_[] to be filled.
3609- if (do_segments) {
3610- const int last_row = enc->mb_h_;
3611-- // We give a little more than a half work to the main thread.
3612-- const int split_row = (9 * last_row + 15) >> 4;
3613- const int total_mb = last_row * enc->mb_w_;
3614- #ifdef WEBP_USE_THREAD
3615-+ // We give a little more than a half work to the main thread.
3616-+ const int split_row = (9 * last_row + 15) >> 4;
3617- const int kMinSplitRow = 2; // minimal rows needed for mt to be worth it
3618- const int do_mt = (enc->thread_level_ > 0) && (split_row >= kMinSplitRow);
3619- #else
3620-@@ -438,6 +440,7 @@
3621- WebPGetWorkerInterface();
3622- SegmentJob main_job;
3623- if (do_mt) {
3624-+#ifdef WEBP_USE_THREAD
3625- SegmentJob side_job;
3626- // Note the use of '&' instead of '&&' because we must call the functions
3627- // no matter what.
3628-@@ -455,6 +458,7 @@
3629- }
3630- worker_interface->End(&side_job.worker);
3631- if (ok) MergeJobs(&side_job, &main_job); // merge results together
3632-+#endif // WEBP_USE_THREAD
3633- } else {
3634- // Even for single-thread case, we use the generic Worker tools.
3635- InitSegmentJob(enc, &main_job, 0, last_row);
3636-@@ -470,6 +474,10 @@
2093+--- a/src/3rdparty/libwebp/src/enc/analysis_enc.c 2024-03-27 03:34:35.000000000 +0800
2094++++ b/src/3rdparty/libwebp/src/enc/analysis_enc.c 2024-03-17 19:08:13.392497200 +0800
2095+@@ -474,6 +474,10 @@
36372096 } else { // Use only one default segment.
36382097 ResetAllMBInfo(enc);
36392098 }
@@ -3645,8 +2104,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/enc/analysis_enc.c b/src/3rdparty/libwebp/
36452104 }
36462105
36472106 diff -rNuZ a/src/3rdparty/libwebp/src/enc/backward_references_enc.c b/src/3rdparty/libwebp/src/enc/backward_references_enc.c
3648---- a/src/3rdparty/libwebp/src/enc/backward_references_enc.c 2023-11-01 02:38:38.000000000 +0800
3649-+++ b/src/3rdparty/libwebp/src/enc/backward_references_enc.c 2023-09-14 06:11:07.000000000 +0800
2107+--- a/src/3rdparty/libwebp/src/enc/backward_references_enc.c 2024-03-27 03:34:35.000000000 +0800
2108++++ b/src/3rdparty/libwebp/src/enc/backward_references_enc.c 2024-03-17 19:08:13.392497200 +0800
36502109 @@ -283,8 +283,7 @@
36512110 hash_to_first_index =
36522111 (int32_t*)WebPSafeMalloc(HASH_SIZE, sizeof(*hash_to_first_index));
@@ -3678,8 +2137,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/enc/backward_references_enc.c b/src/3rdpar
36782137 }
36792138
36802139 diff -rNuZ a/src/3rdparty/libwebp/src/enc/frame_enc.c b/src/3rdparty/libwebp/src/enc/frame_enc.c
3681---- a/src/3rdparty/libwebp/src/enc/frame_enc.c 2023-11-01 02:38:38.000000000 +0800
3682-+++ b/src/3rdparty/libwebp/src/enc/frame_enc.c 2023-09-14 06:11:07.000000000 +0800
2140+--- a/src/3rdparty/libwebp/src/enc/frame_enc.c 2024-03-27 03:34:35.000000000 +0800
2141++++ b/src/3rdparty/libwebp/src/enc/frame_enc.c 2024-03-17 19:08:13.392497200 +0800
36832142 @@ -689,7 +689,7 @@
36842143 }
36852144 if (!ok) {
@@ -3710,26 +2169,9 @@ diff -rNuZ a/src/3rdparty/libwebp/src/enc/frame_enc.c b/src/3rdparty/libwebp/src
37102169 ResetAfterSkip(&it);
37112170 }
37122171 diff -rNuZ a/src/3rdparty/libwebp/src/enc/picture_csp_enc.c b/src/3rdparty/libwebp/src/enc/picture_csp_enc.c
3713---- a/src/3rdparty/libwebp/src/enc/picture_csp_enc.c 2023-11-01 02:38:38.000000000 +0800
3714-+++ b/src/3rdparty/libwebp/src/enc/picture_csp_enc.c 2023-09-14 06:11:07.000000000 +0800
3715-@@ -69,10 +69,12 @@
3716- int WebPPictureHasTransparency(const WebPPicture* picture) {
3717- if (picture == NULL) return 0;
3718- if (picture->use_argb) {
3719-- const int alpha_offset = ALPHA_OFFSET;
3720-- return CheckNonOpaque((const uint8_t*)picture->argb + alpha_offset,
3721-- picture->width, picture->height,
3722-- 4, picture->argb_stride * sizeof(*picture->argb));
3723-+ if (picture->argb != NULL) {
3724-+ return CheckNonOpaque((const uint8_t*)picture->argb + ALPHA_OFFSET,
3725-+ picture->width, picture->height,
3726-+ 4, picture->argb_stride * sizeof(*picture->argb));
3727-+ }
3728-+ return 0;
3729- }
3730- return CheckNonOpaque(picture->a, picture->width, picture->height,
3731- 1, picture->a_stride);
3732-@@ -96,6 +98,7 @@
2172+--- a/src/3rdparty/libwebp/src/enc/picture_csp_enc.c 2024-03-27 03:34:35.000000000 +0800
2173++++ b/src/3rdparty/libwebp/src/enc/picture_csp_enc.c 2024-03-17 19:08:13.402516100 +0800
2174+@@ -98,6 +98,7 @@
37332175 static uint16_t kGammaToLinearTab[256];
37342176 static volatile int kGammaTablesOk = 0;
37352177 static void InitGammaTables(void);
@@ -3737,47 +2179,7 @@ diff -rNuZ a/src/3rdparty/libwebp/src/enc/picture_csp_enc.c b/src/3rdparty/libwe
37372179
37382180 WEBP_DSP_INIT_FUNC(InitGammaTables) {
37392181 if (!kGammaTablesOk) {
3740-@@ -170,21 +173,6 @@
3741- //------------------------------------------------------------------------------
3742- // Main function
3743-
3744--extern void SharpYuvInit(VP8CPUInfo cpu_info_func);
3745--
3746--static void SafeInitSharpYuv(void) {
3747--#if defined(WEBP_USE_THREAD) && !defined(_WIN32)
3748-- static pthread_mutex_t initsharpyuv_lock = PTHREAD_MUTEX_INITIALIZER;
3749-- if (pthread_mutex_lock(&initsharpyuv_lock)) return;
3750--#endif
3751--
3752-- SharpYuvInit(VP8GetCPUInfo);
3753--
3754--#if defined(WEBP_USE_THREAD) && !defined(_WIN32)
3755-- (void)pthread_mutex_unlock(&initsharpyuv_lock);
3756--#endif
3757--}
3758--
3759- static int PreprocessARGB(const uint8_t* r_ptr,
3760- const uint8_t* g_ptr,
3761- const uint8_t* b_ptr,
3762-@@ -481,6 +469,8 @@
3763- }
3764- }
3765-
3766-+extern void SharpYuvInit(VP8CPUInfo cpu_info_func);
3767-+
3768- static int ImportYUVAFromRGBA(const uint8_t* r_ptr,
3769- const uint8_t* g_ptr,
3770- const uint8_t* b_ptr,
3771-@@ -516,7 +506,7 @@
3772- }
3773-
3774- if (use_iterative_conversion) {
3775-- SafeInitSharpYuv();
3776-+ SharpYuvInit(VP8GetCPUInfo);
3777- if (!PreprocessARGB(r_ptr, g_ptr, b_ptr, step, rgb_stride, picture)) {
3778- return 0;
3779- }
3780-@@ -545,7 +535,9 @@
2182+@@ -534,7 +535,9 @@
37812183 WebPInitConvertARGBToYUV();
37822184 InitGammaTables();
37832185
@@ -3789,8 +2191,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/enc/picture_csp_enc.c b/src/3rdparty/libwe
37892191 // Downsample Y/U/V planes, two rows at a time
37902192 for (y = 0; y < (height >> 1); ++y) {
37912193 diff -rNuZ a/src/3rdparty/libwebp/src/enc/picture_rescale_enc.c b/src/3rdparty/libwebp/src/enc/picture_rescale_enc.c
3792---- a/src/3rdparty/libwebp/src/enc/picture_rescale_enc.c 2023-11-01 02:38:38.000000000 +0800
3793-+++ b/src/3rdparty/libwebp/src/enc/picture_rescale_enc.c 2023-09-14 06:11:07.000000000 +0800
2194+--- a/src/3rdparty/libwebp/src/enc/picture_rescale_enc.c 2024-03-27 03:34:35.000000000 +0800
2195++++ b/src/3rdparty/libwebp/src/enc/picture_rescale_enc.c 2024-03-17 19:08:13.402516100 +0800
37942196 @@ -137,7 +137,9 @@
37952197 PictureGrabSpecs(pic, &tmp);
37962198 tmp.width = width;
@@ -3862,8 +2264,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/enc/picture_rescale_enc.c b/src/3rdparty/l
38622264 AlphaMultiplyARGB(&tmp, 1);
38632265 }
38642266 diff -rNuZ a/src/3rdparty/libwebp/src/enc/syntax_enc.c b/src/3rdparty/libwebp/src/enc/syntax_enc.c
3865---- a/src/3rdparty/libwebp/src/enc/syntax_enc.c 2023-11-01 02:38:38.000000000 +0800
3866-+++ b/src/3rdparty/libwebp/src/enc/syntax_enc.c 2023-09-14 06:11:07.000000000 +0800
2267+--- a/src/3rdparty/libwebp/src/enc/syntax_enc.c 2024-03-27 03:34:35.000000000 +0800
2268++++ b/src/3rdparty/libwebp/src/enc/syntax_enc.c 2024-03-17 19:08:13.402516100 +0800
38672269 @@ -258,7 +258,10 @@
38682270 buf[3 * p + 1] = (part_size >> 8) & 0xff;
38692271 buf[3 * p + 2] = (part_size >> 16) & 0xff;
@@ -3885,22 +2287,20 @@ diff -rNuZ a/src/3rdparty/libwebp/src/enc/syntax_enc.c b/src/3rdparty/libwebp/sr
38852287 }
38862288
38872289 diff -rNuZ a/src/3rdparty/libwebp/src/enc/vp8i_enc.h b/src/3rdparty/libwebp/src/enc/vp8i_enc.h
3888---- a/src/3rdparty/libwebp/src/enc/vp8i_enc.h 2023-11-01 02:38:38.000000000 +0800
3889-+++ b/src/3rdparty/libwebp/src/enc/vp8i_enc.h 2023-09-14 06:11:07.000000000 +0800
3890-@@ -31,8 +31,8 @@
3891-
2290+--- a/src/3rdparty/libwebp/src/enc/vp8i_enc.h 2024-03-27 03:34:35.000000000 +0800
2291++++ b/src/3rdparty/libwebp/src/enc/vp8i_enc.h 2024-03-17 19:08:13.402516100 +0800
2292+@@ -32,7 +32,7 @@
38922293 // version numbers
38932294 #define ENC_MAJ_VERSION 1
3894--#define ENC_MIN_VERSION 2
3895--#define ENC_REV_VERSION 4
3896-+#define ENC_MIN_VERSION 3
2295+ #define ENC_MIN_VERSION 3
2296+-#define ENC_REV_VERSION 0
38972297 +#define ENC_REV_VERSION 2
38982298
38992299 enum { MAX_LF_LEVELS = 64, // Maximum loop filter level
39002300 MAX_VARIABLE_LEVEL = 67, // last (inclusive) level with variable cost
39012301 diff -rNuZ a/src/3rdparty/libwebp/src/enc/vp8l_enc.c b/src/3rdparty/libwebp/src/enc/vp8l_enc.c
3902---- a/src/3rdparty/libwebp/src/enc/vp8l_enc.c 2023-11-01 02:38:38.000000000 +0800
3903-+++ b/src/3rdparty/libwebp/src/enc/vp8l_enc.c 2023-09-14 06:11:07.000000000 +0800
2302+--- a/src/3rdparty/libwebp/src/enc/vp8l_enc.c 2024-03-27 03:34:35.000000000 +0800
2303++++ b/src/3rdparty/libwebp/src/enc/vp8l_enc.c 2024-03-17 19:08:13.407896000 +0800
39042304 @@ -196,8 +196,7 @@
39052305 uint32_t palette_sorted[MAX_PALETTE_SIZE];
39062306 lines = (uint32_t*)WebPSafeMalloc(2 * pic->width, sizeof(*lines));
@@ -3924,23 +2324,7 @@ diff -rNuZ a/src/3rdparty/libwebp/src/enc/vp8l_enc.c b/src/3rdparty/libwebp/src/
39242324 return 0;
39252325 }
39262326
3927-@@ -361,10 +360,11 @@
3928- kHistoTotal // Must be last.
3929- } HistoIx;
3930-
3931--static void AddSingleSubGreen(int p, uint32_t* const r, uint32_t* const b) {
3932-- const int green = p >> 8; // The upper bits are masked away later.
3933-- ++r[((p >> 16) - green) & 0xff];
3934-- ++b[((p >> 0) - green) & 0xff];
3935-+static void AddSingleSubGreen(uint32_t p,
3936-+ uint32_t* const r, uint32_t* const b) {
3937-+ const int green = (int)p >> 8; // The upper bits are masked away later.
3938-+ ++r[(((int)p >> 16) - green) & 0xff];
3939-+ ++b[(((int)p >> 0) - green) & 0xff];
3940- }
3941-
3942- static void AddSingle(uint32_t p,
3943-@@ -1011,8 +1011,7 @@
2327+@@ -1012,8 +1011,7 @@
39442328 VP8LRefsCursorNext(&c);
39452329 }
39462330 if (bw->error_) {
@@ -3950,7 +2334,7 @@ diff -rNuZ a/src/3rdparty/libwebp/src/enc/vp8l_enc.c b/src/3rdparty/libwebp/src/
39502334 }
39512335 return 1;
39522336 }
3953-@@ -1296,7 +1295,10 @@
2337+@@ -1297,7 +1295,10 @@
39542338 }
39552339 }
39562340 tokens = (HuffmanTreeToken*)WebPSafeMalloc(max_tokens, sizeof(*tokens));
@@ -3962,16 +2346,7 @@ diff -rNuZ a/src/3rdparty/libwebp/src/enc/vp8l_enc.c b/src/3rdparty/libwebp/src/
39622346 for (i = 0; i < 5 * histogram_image_size; ++i) {
39632347 HuffmanTreeCode* const codes = &huffman_codes[i];
39642348 StoreHuffmanCode(bw, huff_tree, tokens, codes);
3965-@@ -1354,7 +1356,7 @@
3966- static void ApplySubtractGreen(VP8LEncoder* const enc, int width, int height,
3967- VP8LBitWriter* const bw) {
3968- VP8LPutBits(bw, TRANSFORM_PRESENT, 1);
3969-- VP8LPutBits(bw, SUBTRACT_GREEN, 2);
3970-+ VP8LPutBits(bw, SUBTRACT_GREEN_TRANSFORM, 2);
3971- VP8LSubtractGreenFromBlueAndRed(enc->argb_, width * height);
3972- }
3973-
3974-@@ -1447,18 +1449,21 @@
2349+@@ -1448,18 +1449,21 @@
39752350 const size_t vp8l_size = VP8L_SIGNATURE_SIZE + webpll_size;
39762351 const size_t pad = vp8l_size & 1;
39772352 const size_t riff_size = TAG_SIZE + CHUNK_HEADER_SIZE + vp8l_size + pad;
@@ -3997,7 +2372,7 @@ diff -rNuZ a/src/3rdparty/libwebp/src/enc/vp8l_enc.c b/src/3rdparty/libwebp/src/
39972372 }
39982373 }
39992374 *coded_size = CHUNK_HEADER_SIZE + riff_size;
4000-@@ -1503,8 +1508,7 @@
2375+@@ -1504,8 +1508,7 @@
40012376 ClearTransformBuffer(enc);
40022377 mem = (uint32_t*)WebPSafeMalloc(mem_size, sizeof(*mem));
40032378 if (mem == NULL) {
@@ -4007,7 +2382,7 @@ diff -rNuZ a/src/3rdparty/libwebp/src/enc/vp8l_enc.c b/src/3rdparty/libwebp/src/
40072382 }
40082383 enc->transform_mem_ = mem;
40092384 enc->transform_mem_size_ = (size_t)mem_size;
4010-@@ -1612,8 +1616,7 @@
2385+@@ -1613,8 +1616,7 @@
40112386 int x, y;
40122387
40132388 if (tmp_row == NULL) {
@@ -4017,7 +2392,7 @@ diff -rNuZ a/src/3rdparty/libwebp/src/enc/vp8l_enc.c b/src/3rdparty/libwebp/src/
40172392 }
40182393
40192394 if (palette_size < APPLY_PALETTE_GREEDY_MAX) {
4020-@@ -1967,9 +1970,8 @@
2395+@@ -1968,9 +1970,8 @@
40212396 int ok_main;
40222397
40232398 if (enc_main == NULL || !VP8LBitWriterInit(&bw_side, 0)) {
@@ -4028,7 +2403,7 @@ diff -rNuZ a/src/3rdparty/libwebp/src/enc/vp8l_enc.c b/src/3rdparty/libwebp/src/
40282403 }
40292404
40302405 // Avoid "garbage value" error from Clang's static analysis tool.
4031-@@ -2116,8 +2118,7 @@
2406+@@ -2117,8 +2118,7 @@
40322407 if (picture == NULL) return 0;
40332408
40342409 if (config == NULL || picture->argb == NULL) {
@@ -4039,8 +2414,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/enc/vp8l_enc.c b/src/3rdparty/libwebp/src/
40392414
40402415 width = picture->width;
40412416 diff -rNuZ a/src/3rdparty/libwebp/src/enc/webp_enc.c b/src/3rdparty/libwebp/src/enc/webp_enc.c
4042---- a/src/3rdparty/libwebp/src/enc/webp_enc.c 2023-11-01 02:38:38.000000000 +0800
4043-+++ b/src/3rdparty/libwebp/src/enc/webp_enc.c 2023-09-14 06:11:07.000000000 +0800
2417+--- a/src/3rdparty/libwebp/src/enc/webp_enc.c 2024-03-27 03:34:35.000000000 +0800
2418++++ b/src/3rdparty/libwebp/src/enc/webp_enc.c 2024-03-17 19:08:13.407896000 +0800
40442419 @@ -307,7 +307,10 @@
40452420 WebPEncodingError error) {
40462421 assert((int)error < VP8_ENC_ERROR_LAST);
@@ -4073,22 +2448,20 @@ diff -rNuZ a/src/3rdparty/libwebp/src/enc/webp_enc.c b/src/3rdparty/libwebp/src/
40732448 return WebPEncodingSetError(pic, VP8_ENC_ERROR_NULL_PARAMETER);
40742449 }
40752450 diff -rNuZ a/src/3rdparty/libwebp/src/mux/muxi.h b/src/3rdparty/libwebp/src/mux/muxi.h
4076---- a/src/3rdparty/libwebp/src/mux/muxi.h 2023-11-01 02:38:38.000000000 +0800
4077-+++ b/src/3rdparty/libwebp/src/mux/muxi.h 2023-09-14 06:11:07.000000000 +0800
4078-@@ -28,8 +28,8 @@
4079- // Defines and constants.
2451+--- a/src/3rdparty/libwebp/src/mux/muxi.h 2024-03-27 03:34:35.000000000 +0800
2452++++ b/src/3rdparty/libwebp/src/mux/muxi.h 2024-03-17 19:08:13.407896000 +0800
2453+@@ -29,7 +29,7 @@
40802454
40812455 #define MUX_MAJ_VERSION 1
4082--#define MUX_MIN_VERSION 2
4083--#define MUX_REV_VERSION 4
4084-+#define MUX_MIN_VERSION 3
2456+ #define MUX_MIN_VERSION 3
2457+-#define MUX_REV_VERSION 0
40852458 +#define MUX_REV_VERSION 2
40862459
40872460 // Chunk object.
40882461 typedef struct WebPChunk WebPChunk;
40892462 diff -rNuZ a/src/3rdparty/libwebp/src/mux/muxread.c b/src/3rdparty/libwebp/src/mux/muxread.c
4090---- a/src/3rdparty/libwebp/src/mux/muxread.c 2023-11-01 02:38:38.000000000 +0800
4091-+++ b/src/3rdparty/libwebp/src/mux/muxread.c 2023-09-14 06:11:07.000000000 +0800
2463+--- a/src/3rdparty/libwebp/src/mux/muxread.c 2024-03-27 03:34:35.000000000 +0800
2464++++ b/src/3rdparty/libwebp/src/mux/muxread.c 2024-03-17 19:08:13.412412500 +0800
40922465 @@ -116,9 +116,12 @@
40932466 // Each of ANMF chunk contain a header at the beginning. So, its size should
40942467 // be at least 'hdr_size'.
@@ -4104,24 +2477,9 @@ diff -rNuZ a/src/3rdparty/libwebp/src/mux/muxread.c b/src/3rdparty/libwebp/src/m
41042477 wpi->is_partial_ = 1; // Waiting for ALPH and/or VP8/VP8L chunks.
41052478
41062479 // Rest of the chunks.
4107-diff -rNuZ a/src/3rdparty/libwebp/src/utils/bit_reader_inl_utils.h b/src/3rdparty/libwebp/src/utils/bit_reader_inl_utils.h
4108---- a/src/3rdparty/libwebp/src/utils/bit_reader_inl_utils.h 2023-11-01 02:38:38.000000000 +0800
4109-+++ b/src/3rdparty/libwebp/src/utils/bit_reader_inl_utils.h 2023-09-14 06:11:07.000000000 +0800
4110-@@ -148,9 +148,9 @@
4111- const range_t value = (range_t)(br->value_ >> pos);
4112- const int32_t mask = (int32_t)(split - value) >> 31; // -1 or 0
4113- br->bits_ -= 1;
4114-- br->range_ += mask;
4115-+ br->range_ += (range_t)mask;
4116- br->range_ |= 1;
4117-- br->value_ -= (bit_t)((split + 1) & mask) << pos;
4118-+ br->value_ -= (bit_t)((split + 1) & (uint32_t)mask) << pos;
4119- BT_TRACK(br);
4120- return (v ^ mask) - mask;
4121- }
41222480 diff -rNuZ a/src/3rdparty/libwebp/src/utils/bit_reader_utils.c b/src/3rdparty/libwebp/src/utils/bit_reader_utils.c
4123---- a/src/3rdparty/libwebp/src/utils/bit_reader_utils.c 2023-11-01 02:38:38.000000000 +0800
4124-+++ b/src/3rdparty/libwebp/src/utils/bit_reader_utils.c 2023-09-14 06:11:07.000000000 +0800
2481+--- a/src/3rdparty/libwebp/src/utils/bit_reader_utils.c 2024-03-27 03:34:35.000000000 +0800
2482++++ b/src/3rdparty/libwebp/src/utils/bit_reader_utils.c 2024-03-17 19:08:13.412412500 +0800
41252483 @@ -15,6 +15,7 @@
41262484 #include "src/webp/config.h"
41272485 #endif
@@ -4140,8 +2498,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/utils/bit_reader_utils.c b/src/3rdparty/li
41402498 defined(__x86_64__) || defined(_M_X64)
41412499 #define VP8L_USE_FAST_LOAD
41422500 diff -rNuZ a/src/3rdparty/libwebp/src/utils/bit_reader_utils.h b/src/3rdparty/libwebp/src/utils/bit_reader_utils.h
4143---- a/src/3rdparty/libwebp/src/utils/bit_reader_utils.h 2023-11-01 02:38:38.000000000 +0800
4144-+++ b/src/3rdparty/libwebp/src/utils/bit_reader_utils.h 2023-09-14 06:11:07.000000000 +0800
2501+--- a/src/3rdparty/libwebp/src/utils/bit_reader_utils.h 2024-03-27 03:34:35.000000000 +0800
2502++++ b/src/3rdparty/libwebp/src/utils/bit_reader_utils.h 2024-03-17 19:08:13.412412500 +0800
41452503 @@ -19,6 +19,7 @@
41462504 #ifdef _MSC_VER
41472505 #include <stdlib.h> // _byteswap_ulong
@@ -4160,17 +2518,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/utils/bit_reader_utils.h b/src/3rdparty/li
41602518 #elif defined(__mips__) // MIPS
41612519 #define BITS 24
41622520 diff -rNuZ a/src/3rdparty/libwebp/src/utils/huffman_utils.c b/src/3rdparty/libwebp/src/utils/huffman_utils.c
4163---- a/src/3rdparty/libwebp/src/utils/huffman_utils.c 2023-11-01 02:38:38.000000000 +0800
4164-+++ b/src/3rdparty/libwebp/src/utils/huffman_utils.c 2023-09-14 06:11:07.000000000 +0800
4165-@@ -142,7 +142,7 @@
4166-
4167- {
4168- int step; // step size to replicate values in current table
4169-- uint32_t low = -1; // low bits for current root entry
4170-+ uint32_t low = 0xffffffffu; // low bits for current root entry
4171- uint32_t mask = total_size - 1; // mask for low bits
4172- uint32_t key = 0; // reversed prefix code
4173- int num_nodes = 1; // number of Huffman tree nodes
2521+--- a/src/3rdparty/libwebp/src/utils/huffman_utils.c 2024-03-27 03:34:35.000000000 +0800
2522++++ b/src/3rdparty/libwebp/src/utils/huffman_utils.c 2024-03-17 19:08:13.412412500 +0800
41742523 @@ -177,21 +177,24 @@
41752524 if (num_open < 0) {
41762525 return 0;
@@ -4299,8 +2648,8 @@ diff -rNuZ a/src/3rdparty/libwebp/src/utils/huffman_utils.c b/src/3rdparty/libwe
42992648 + }
43002649 +}
43012650 diff -rNuZ a/src/3rdparty/libwebp/src/utils/huffman_utils.h b/src/3rdparty/libwebp/src/utils/huffman_utils.h
4302---- a/src/3rdparty/libwebp/src/utils/huffman_utils.h 2023-11-01 02:38:38.000000000 +0800
4303-+++ b/src/3rdparty/libwebp/src/utils/huffman_utils.h 2023-09-14 06:11:07.000000000 +0800
2651+--- a/src/3rdparty/libwebp/src/utils/huffman_utils.h 2024-03-27 03:34:35.000000000 +0800
2652++++ b/src/3rdparty/libwebp/src/utils/huffman_utils.h 2024-03-17 19:08:13.412412500 +0800
43042653 @@ -43,6 +43,29 @@
43052654 // or non-literal symbol otherwise
43062655 } HuffmanCode32;
@@ -4342,42 +2691,9 @@ diff -rNuZ a/src/3rdparty/libwebp/src/utils/huffman_utils.h b/src/3rdparty/libwe
43422691 const int code_lengths[], int code_lengths_size);
43432692
43442693 #ifdef __cplusplus
4345-diff -rNuZ a/src/3rdparty/libwebp/src/utils/utils.h b/src/3rdparty/libwebp/src/utils/utils.h
4346---- a/src/3rdparty/libwebp/src/utils/utils.h 2023-11-01 02:38:38.000000000 +0800
4347-+++ b/src/3rdparty/libwebp/src/utils/utils.h 2023-09-14 06:11:07.000000000 +0800
4348-@@ -64,7 +64,8 @@
4349- // Alignment
4350-
4351- #define WEBP_ALIGN_CST 31
4352--#define WEBP_ALIGN(PTR) (((uintptr_t)(PTR) + WEBP_ALIGN_CST) & ~WEBP_ALIGN_CST)
4353-+#define WEBP_ALIGN(PTR) (((uintptr_t)(PTR) + WEBP_ALIGN_CST) & \
4354-+ ~(uintptr_t)WEBP_ALIGN_CST)
4355-
4356- #include <string.h>
4357- // memcpy() is the safe way of moving potentially unaligned 32b memory.
4358-@@ -73,10 +74,19 @@
4359- memcpy(&A, ptr, sizeof(A));
4360- return A;
4361- }
4362-+
4363-+static WEBP_INLINE int32_t WebPMemToInt32(const uint8_t* const ptr) {
4364-+ return (int32_t)WebPMemToUint32(ptr);
4365-+}
4366-+
4367- static WEBP_INLINE void WebPUint32ToMem(uint8_t* const ptr, uint32_t val) {
4368- memcpy(ptr, &val, sizeof(val));
4369- }
4370-
4371-+static WEBP_INLINE void WebPInt32ToMem(uint8_t* const ptr, int val) {
4372-+ WebPUint32ToMem(ptr, (uint32_t)val);
4373-+}
4374-+
4375- //------------------------------------------------------------------------------
4376- // Reading/writing data.
4377-
43782694 diff -rNuZ a/src/3rdparty/libwebp/src/webp/decode.h b/src/3rdparty/libwebp/src/webp/decode.h
4379---- a/src/3rdparty/libwebp/src/webp/decode.h 2023-11-01 02:38:38.000000000 +0800
4380-+++ b/src/3rdparty/libwebp/src/webp/decode.h 2023-09-14 06:11:07.000000000 +0800
2695+--- a/src/3rdparty/libwebp/src/webp/decode.h 2024-03-27 03:34:35.000000000 +0800
2696++++ b/src/3rdparty/libwebp/src/webp/decode.h 2024-03-17 19:08:13.420542900 +0800
43812697 @@ -81,10 +81,11 @@
43822698 // returned is the Y samples buffer. Upon return, *u and *v will point to
43832699 // the U and V chroma data. These U and V buffers need NOT be passed to
@@ -4392,42 +2708,3 @@ diff -rNuZ a/src/3rdparty/libwebp/src/webp/decode.h b/src/3rdparty/libwebp/src/w
43922708 // (*) Also named Y'CbCr. See: https://en.wikipedia.org/wiki/YCbCr
43932709 WEBP_EXTERN uint8_t* WebPDecodeYUV(const uint8_t* data, size_t data_size,
43942710 int* width, int* height,
4395-diff -rNuZ a/src/3rdparty/libwebp/src/webp/format_constants.h b/src/3rdparty/libwebp/src/webp/format_constants.h
4396---- a/src/3rdparty/libwebp/src/webp/format_constants.h 2023-11-01 02:38:38.000000000 +0800
4397-+++ b/src/3rdparty/libwebp/src/webp/format_constants.h 2023-09-14 06:11:07.000000000 +0800
4398-@@ -55,7 +55,7 @@
4399- typedef enum {
4400- PREDICTOR_TRANSFORM = 0,
4401- CROSS_COLOR_TRANSFORM = 1,
4402-- SUBTRACT_GREEN = 2,
4403-+ SUBTRACT_GREEN_TRANSFORM = 2,
4404- COLOR_INDEXING_TRANSFORM = 3
4405- } VP8LImageTransformType;
4406-
4407-diff -rNuZ a/src/3rdparty/libwebp/src/webp/types.h b/src/3rdparty/libwebp/src/webp/types.h
4408---- a/src/3rdparty/libwebp/src/webp/types.h 2023-11-01 02:38:38.000000000 +0800
4409-+++ b/src/3rdparty/libwebp/src/webp/types.h 2023-09-14 06:11:07.000000000 +0800
4410-@@ -42,7 +42,11 @@
4411- # if defined(__GNUC__) && __GNUC__ >= 4
4412- # define WEBP_EXTERN extern __attribute__ ((visibility ("default")))
4413- # else
4414--# define WEBP_EXTERN extern
4415-+# if defined(_MSC_VER) && defined(WEBP_DLL)
4416-+# define WEBP_EXTERN __declspec(dllexport)
4417-+# else
4418-+# define WEBP_EXTERN extern
4419-+# endif
4420- # endif /* __GNUC__ >= 4 */
4421- #endif /* WEBP_EXTERN */
4422-
4423-diff -rNuZ a/src/plugins/imageformats/webp/CMakeLists.txt b/src/plugins/imageformats/webp/CMakeLists.txt
4424---- a/src/plugins/imageformats/webp/CMakeLists.txt 2023-11-01 02:38:38.000000000 +0800
4425-+++ b/src/plugins/imageformats/webp/CMakeLists.txt 2024-03-17 17:45:39.749372300 +0800
4426-@@ -30,6 +30,7 @@
4427- qt_internal_extend_target(QWebpPlugin CONDITION NOT QT_FEATURE_system_webp
4428- SOURCES
4429- ../../../3rdparty/libwebp/sharpyuv/sharpyuv.c
4430-+ ../../../3rdparty/libwebp/sharpyuv/sharpyuv_cpu.c
4431- ../../../3rdparty/libwebp/sharpyuv/sharpyuv_csp.c
4432- ../../../3rdparty/libwebp/sharpyuv/sharpyuv_dsp.c
4433- ../../../3rdparty/libwebp/sharpyuv/sharpyuv_gamma.c