Commit Graph

4745 Commits

Author SHA1 Message Date
James Zern
8dd80ef814 fuzz_utils.h: lower kFuzzPxLimit w/ASan
prevents some timeouts when decoding large jpeg source images.

Change-Id: I5cb6a10cbf0658a71fa9f49fc7da4c8d3e70fa00
2023-05-24 19:39:38 -07:00
Vincent Rabaud
8f187b9f7f Clean message calls in CMake
Change-Id: If1a959d9b8d544c9f4671c84880b1d0d11d3d285
2023-05-24 19:39:26 -07:00
James Zern
cba300781f WebPConfig.cmake.in: use calculated include path
when setting WebP_INCLUDE_DIRS; this value is relative to the
WebPConfig.cmake install location (${PACKAGE_PREFIX_DIR}/include) and
allows the install to be relocated after creation.

See also:
https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html#example-generating-package-files

Bug: webp:610
Change-Id: If877625e96584a9808b0bba902e3f0b2a744aa60
Fixed: webp:610
2023-05-16 17:39:50 -07:00
James Zern
6cf9a76ae2 Merge "webp-lossless-bitstream-spec: remove use of 'dynamics'" into main 2023-05-16 22:00:51 +00:00
James Zern
740943b276 Merge "Specialize and optimize ITransform_SSE2 using do_two" into main 2023-05-16 19:57:48 +00:00
Yannis Guyon
2d547e24dc Compare kFuzzPxLimit to max_num_operations
To avoid timeouts caused by extreme rescaling such as
1x14339 -> 51712x1

Change-Id: I291d8e3b24155c190256411a506b7312abde8c45
2023-05-16 13:20:14 +02:00
Nozomi Isozaki
ac42dde1c5 Specialize and optimize ITransform_SSE2 using do_two
Change-Id: I976eb4a0cc4e669a02b55012d4aba1536f193781
2023-05-16 12:07:58 +09:00
James Zern
17e0ef1da5 webp-lossless-bitstream-spec: remove use of 'dynamics'
when bit width or precision are meant.

Change-Id: I89c2279e99b02c3e8a3bf39860364d2ce6d909c8
2023-05-12 15:10:30 -07:00
James Zern
ed27437160 neon.h,cosmetics: clear a couple lint warnings
Missing space after ,  [whitespace/comma] [3]

Change-Id: Ib8fc05c31cbef5318a752e98ab5106dad55d69e9
2023-05-02 17:32:14 -07:00
James Zern
3fb8294762 cpu.h,cosmetics: segment defines
Change-Id: Idc6dcd31e95de1c89b2a35b4c67fa66b92fe1a60
2023-05-02 12:28:50 -07:00
James Zern
0c496a4ff9 cpu.h: add WEBP_AARCH64
and define it to true for __aarch64__ and Win Arm64 + Visual Studio.

Microsoft's compiler (cl.exe) does not define __aarch64__, but relies on
_M_ARM64 & _M_ARM64EC

Bug: b/277254922
Change-Id: I20e4fa07a4031599db69e3d7ba9050345315ef51
2023-05-02 12:28:50 -07:00
James Zern
8151f388eb move VP8GetCPUInfo declaration to cpu.c
This avoids defining a version in each translation unit when using
__declspec(dllexport) which causes failures due to multiply defined
symbols with clang-cl:

lld-link: error: duplicate symbol: VP8GetCPUInfo
>>> defined at CMakeFiles\webpdecode.dir\Debug\src\dec\alpha_dec.c.obj
>>> defined at CMakeFiles\webpdsp.dir\Debug\src\dsp\dec_sse41.c.obj
...

Bug: webp:607
Change-Id: I6cd1ee75b3db984aa513263a05516e867a64925d
2023-04-27 12:39:13 -07:00
Yannis Guyon
916548c28c Make kFuzzPxLimit sanitizer dependent
Change-Id: Ib70f3c05fc845494c45cb357e70e9602a7e876a3
2023-04-25 08:14:22 +02:00
James Zern
4070b271ab advanced_api_fuzzer: reduce scaling limit
avoids another timeout while fuzzing with ASan

Change-Id: Ic5dfed15347bdd36f42274b8b2a25aec79fd568c
2023-04-18 16:56:23 -07:00
James Zern
761f49c3ab Merge "webp-lossless-bitstream-spec: add missing bits to ABNF" into main 2023-04-13 20:53:32 +00:00
James Zern
84d04c4845 webp-lossless-bitstream-spec: add missing bits to ABNF
alpha-is-used and the version number were missing before 'image-stream'

spotted by thakis@

Change-Id: I7a4f1d2e0f0962bb1a79a0400c229738159d88a5
2023-04-13 12:13:34 -07:00
James Zern
0696e1a7fb advanced_api_fuzzer: reduce scaling limit
avoids another timeout while fuzzing with ASan

Change-Id: Icf7209f3f93b894684ac7364864e4568b6b2c057
2023-04-11 12:16:39 -07:00
James Zern
93d88aa25b Merge "deps.cmake: remove unneeded header checks" into main 2023-04-11 19:13:10 +00:00
James Zern
118e0035df deps.cmake: remove unneeded header checks
These were picked up when matching autoconf's default checks and aren't
useful except to compare the generated config.h. Removing them speeds up
cmake, especially on windows where creating new processes is slow.

Change-Id: Ie891aad0a809af16357168d2ff7fd65922ee4011
2023-04-11 11:37:24 -07:00
James Zern
4c3d7018c0 webp-lossless-bitstream-spec: condense normal-prefix-code
Have this match simple-prefix-code and redirect to "Normal Code Length
Code" as the added indirection to 'code-length-code' and the undefined
'encoded-code-lengths' doesn't add much.

spotted by thakis@

Change-Id: Icd6b64a47c4e0001e93271d9ae5585be4a6d5906
2023-04-10 17:22:55 -07:00
James Zern
a6a09b3296 webp-lossless-bitstream-spec: fix 2 code typos
- add missing '(' in DIV_ROUND_UP
- in 6.2.2, rename 'pos' variable reference to match definition
  ('position')

spotted by thakis@

Change-Id: Ida3ed281c2c753ebbb0e1eb3c4ed04dadc79ca24
2023-04-10 17:18:52 -07:00
James Zern
50ac4f7c97 Merge "cpu.h: enable NEON w/_M_ARM64EC" into main 2023-04-07 20:31:49 +00:00
Yannis Guyon
4b7d7b4f2b Add contribution instructions
Change-Id: Icc58ef6c1e79e59977e0093973ad353237560e8e
2023-04-07 15:10:16 +02:00
James Zern
0afbd97b45 cpu.h: enable NEON w/_M_ARM64EC
The Arm64EC (Emulation Compatible) ABI was added for Windows 11 [1].

[1] https://learn.microsoft.com/en-us/windows/arm/arm64ec

Bug: b/277254922
Change-Id: I3767e1b3db61fa9c33eef7a9ed7abee7c502e36f
2023-04-06 13:49:36 -07:00
James Zern
349f4353dd Merge changes Ibd89e56b,Ic57e7f84,I89096614 into main
* changes:
  advanced_api_fuzzer: reduce scaling limit
  Skip slow scaling in libwebp advanced_api_fuzzer
  Reduce libwebp advanced_api_fuzzer threshold
2023-03-25 01:50:02 +00:00
James Zern
8f7513b7c0 upsampling_neon.c: fix WEBP_SWAP_16BIT_CSP check
this is always defined by default to 0 since:
v0.6.0-158-g663a6d9d unify the ALTERNATE_CODE flag usage

previously the !defined() check would cause a mismatch between C and
assembly.

Change-Id: Idca0b8e39ca90d63785fd4125aeb7af86c5aae61
2023-03-24 11:20:35 -07:00
James Zern
cbf624b561 advanced_api_fuzzer: reduce scaling limit
avoids another timeout while fuzzing with ASan

Change-Id: Ibd89e56bf936aeea040cd4c47ccae20960417ac0
2023-03-24 10:52:46 -07:00
yguyon@google.com
89edfdd1e9 Skip slow scaling in libwebp advanced_api_fuzzer
Change-Id: Ic57e7f8418afec42f042197a401aaf4cc047b23f
2023-03-24 10:52:43 -07:00
yguyon@google.com
859f19f74f Reduce libwebp advanced_api_fuzzer threshold
To avoid timeouts.

Change-Id: I8909661479cdbcb940bb44c6f9130906cab3f271
2023-03-24 10:52:40 -07:00
James Zern
a4f0483579 Merge changes Ic389aaa2,I329ccd79 into main
* changes:
  img2webp: normalize help output
  cwebp: reflow -near_lossless help text
2023-03-20 19:46:23 +00:00
James Zern
1275fac820 Makefile.vc: fix img2webp link w/dynamic cfg
add a dependency on libsharpyuv, which is needed after:
0825faa4c img2webp: add -sharp_yuv/-near_lossless

Change-Id: I2471549aa85a4ead6e00d6c459d9774ea4254eaa
2023-03-18 13:58:21 -07:00
James Zern
2fe27bb96d img2webp: normalize help output
this makes the output from img2webp and the ordering in doc/tools.md and
man/img2webp.1 consistent

Change-Id: Ic389aaa29c20128f2b87f231be383094602f125b
2023-03-17 15:37:55 -07:00
James Zern
24bed3d9fb cwebp: reflow -near_lossless help text
this matches the output from img2webp added in:
0825faa4 img2webp: add -sharp_yuv/-near_lossless

Change-Id: I329ccd796d7e9bee36de1429fceafe83d7dc5532
2023-03-17 15:17:31 -07:00
jzern@google.com
0825faa4c1 img2webp: add -sharp_yuv/-near_lossless
Both are global settings. Modifying them at the frame level is left as a
follow up based on need.

Bug: b/272739498
Change-Id: If15256c052f73fe3df56be5e0095e76d9870cc0f
2023-03-17 09:35:29 -07:00
James Zern
d64e6d7d9d Merge "PaletteSortModifiedZeng: fix leak on error" into main 2023-02-28 00:23:05 +00:00
James Zern
0e12a22d88 Merge "EncodeAlphaInternal: clear result->bw on error" into main 2023-02-28 00:22:57 +00:00
James Zern
0edbb6ea71 PaletteSortModifiedZeng: fix leak on error
Change-Id: I462bd9a3bc4670efdf251c295f6771a38c08a6ce
2023-02-23 22:03:31 -08:00
James Zern
41ffe04e12 Merge "Update yapf style from "chromium" to "yapf"" into main 2023-02-24 01:29:40 +00:00
Thiago Perrotta
2d9d9265f5 Update yapf style from "chromium" to "yapf"
yapf v0.30.0 renamed "chromium" style to "yapf".

Bug: chromium:1306598
Change-Id: I2a637d2c5d64f81ba411b1c0d07339ad7480bd66
2023-02-23 18:10:53 -05:00
James Zern
a486d800b6 EncodeAlphaInternal: clear result->bw on error
This avoids a double free should the function fail prior to
VP8BitWriterInit() and a previous trial result's buffer carried over.
Previously in ApplyFiltersAndEncode() trial.bw (with a previous
iteration's buffer) would be freed, followed by best.bw pointing to the
same buffer.

Since:
187d379d add a fallback to ALPHA_NO_COMPRESSION

In addition, check the return value of VP8BitWriterInit() in this
function.

Bug: webp:603
Change-Id: Ic258381ee26c8c16bc211d157c8153831c8c6910
2023-02-22 22:23:41 -08:00
Yannis Guyon
1347a32d82 Skip big scaled advanced_api_fuzzer
To avoid timeouts.

Change-Id: I8f04fd45313bef47004a616d2460be992692030d
2023-02-08 10:53:40 +01:00
Yannis Guyon
52b6f06703 Fix scaling limit in advanced_api_fuzzer.c
config.options.scaled_width or config.options.scaled_height being 0
means a ratio-conservative scaling so 7361842 was not enough.

Change-Id: Ib75241eb683cf824bc46222c5c07535b6c6d7313
2023-02-07 18:05:42 +01:00
Yannis Guyon
7361842839 Limit scaling in libwebp advanced_api_fuzzer.c
Change-Id: Ic1e3fdc76f4bdcb1ac68cf4f9334d2e77ca29374
2023-01-27 14:39:14 +01:00
James Zern
b54d21a01d Merge "CMakeLists.txt: allow CMAKE_INSTALL_RPATH to be set empty" into main 2023-01-18 19:10:44 +00:00
James Zern
31c28db53c libwebp{,demux,mux}.pc.in: Requires -> Requires.private
The libraries don't expose the symbols in libsharpyuv / libwebp, they're
only needed when static linking.

Noted for libwebp (Requires: libsharpyuv) in:
https://crbug.com/webp/590#c5. libwebpdemux and libwebpmux had a similar
issue with libwebp.

See also:
https://web.archive.org/web/20190921014607/https://wiki.openmandriva.org/en/Overlinking_issues_in_packaging

Change-Id: Ia1866b6b44cbb1ef1a77fd45fbcf10c027eae788
2023-01-17 18:32:44 -08:00
James Zern
d9a505ffb6 CMakeLists.txt: allow CMAKE_INSTALL_RPATH to be set empty
this allows the user to override the default non-empty value added in:
b4994eaa CMake: set rpath for shared objects

Bug: webp:592
Change-Id: I069dcbcd8c2f1e8654d9bc98149139f398ac2c93
Fixed: webp:592
2023-01-17 18:22:47 -08:00
James Zern
bdf33d03b0 libwebp-1.3.0
- 12/16/2022: version 1.3.0
   This is a binary compatible release.
   * add libsharpyuv, which exposes -sharp_yuv/config.use_sharp_yuv
     functionality to other libraries; libwebp now depends on this library
   * major updates to the container and lossless bitstream docs (#448, #546,
     #551)
   * miscellaneous warning, bug & build fixes (#576, #583, #584)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEaw5rcJdt4wPt8vYB+cPWvbgjK10FAmPAtgoACgkQ+cPWvbgj
 K11C9A/9FVNCbB6BTa0q2iZsgoEj49k+6KCsYQs80yhAwBBKtB+b2qHbjoaoGYQN
 cRNeanWvP2XxWcInPvkr6CIOhOaP9U3j3PKlubCeWv4YzI58mOx6uVGv1T9r6Isr
 ogPXrSOATUnVnlgG0RtJLRivOadY0mY+u4JNj2R8kHmSgp50poZRrw8GIiclh1ml
 KVq9RJ9St/p8ps4mJROLowxnaB5pH2jTif5T1rkmq4GsQskkLzPtHfELrM4hQjMz
 dc/pcdT0DCMMRqJZ/ePGMK0BjVjzHEBsxHYuHGfayKesO+MYajwfsTyYxxSGOD3y
 fEb0H7NCwHemGm94AyYj6NyjKUuIG2G2dku+0h0dWn/Ml855RzghGLIqCzqMXs0s
 AwaSpoyxWMBJw39pHcuk+ZuVX+uhy7dndLC5OtTLfEDCDwxKAktGaUdzRIy1nL/k
 NzH0IWCOnb/awux6heamP1gmTfKIKk+IsJwFiFJyfi+VQwxil7jD4rVCYsavL5f0
 hTkBFcZNzZsNSkuFJzqDiCnCFtcXWJ8mQ9fwx38wlvESH+U3k0yggo02cXmLpH8J
 pSYdlOU5kCpipdfgmS7Aa4HHo91SgkjlvL4+bzOa22UBpMQEgD3wgMnkVUm4dZ9F
 bgwMsZLt9KQYso6OKBdvOx+wy6Bp7/gOnIhVPleRZZk/HWoAHdE=
 =67V9
 -----END PGP SIGNATURE-----

Merge tag 'v1.3.0'

libwebp-1.3.0

- 12/16/2022: version 1.3.0
  This is a binary compatible release.
  * add libsharpyuv, which exposes -sharp_yuv/config.use_sharp_yuv
    functionality to other libraries; libwebp now depends on this library
  * major updates to the container and lossless bitstream docs (#448, #546,
    #551)
  * miscellaneous warning, bug & build fixes (#576, #583, #584)

* tag 'v1.3.0':
  update ChangeLog
  update NEWS
  bump version to 1.3.0
  update AUTHORS

Bug: webp:590
Bug: b/262806895
Change-Id: I4bc5cfb0708fab3569dc567d22bfdbcb5ff2a1ad
2023-01-12 17:58:29 -08:00
James Zern
b557776962 update ChangeLog
Change-Id: If794cc65c0813fbff7f5e0ecbd519d5387beb16d
2022-12-19 16:23:35 -08:00
James Zern
0ba772442e update NEWS
Bug: webp:590
Change-Id: I877bda2d177bd371cd2a43974200c66cf5fa8a10
2022-12-16 16:47:42 -08:00
James Zern
e763eb1ea3 bump version to 1.3.0
libwebp{,decoder} - 1.3.0
libwebp libtool - 8.6.1
libwebpdecoder libtool - 4.6.1

mux - 1.3.0
libtool - 3.11.0

demux - 1.3.0
libtool - 2.12.0

sharpyuv - 0.2.0 (unchanged, first release)
libtool - 0.0.0 (ditto)

Bug: webp:590
Change-Id: Ibf3ed56af87667c30650d8dd60eb0ff3bdcb6749
2022-12-16 16:47:42 -08:00