Commit Graph

4531 Commits

Author SHA1 Message Date
James Zern
835392393b dsp,x86: normalize types w/_mm_set* calls
fixes integer sanitizer warnings of the form:
runtime error: implicit conversion from type 'unsigned int' of value
4294967295 (32-bit, unsigned) to type 'int' changed the value to -1
(32-bit, signed)
runtime error: implicit conversion from type
'uint8_t' (aka 'unsigned char') of value 128 (8-bit, unsigned) to type
'char' changed the value to -128 (8-bit, signed)

Bug: b/229626362
Change-Id: I6be3c40407cf7a27b79d31ee32d3829ecb78ed66
2022-08-03 16:50:46 -07:00
James Zern
8a4576ce26 webp-container-spec.txt: replace & with &
this conversion is handled by markdown processors

Change-Id: Ic679e40fcea577784deb8b455911bf1f201f2011
2022-08-03 11:12:23 -07:00
James Zern
db87088162 Merge "webp-container-spec.txt: make reserved 0 values a MUST" into main 2022-08-03 18:07:16 +00:00
James Zern
01d7d378d1 webp-lossless-bitstream-spec: number all sections
this makes the structure more consistent

Change-Id: Ie6c8b42506be73e565cfc4d39108eb4d8c038003
2022-08-02 19:03:51 -07:00
James Zern
337cf69f58 webp-lossless-bitstream-spec: mv Nomenclature after Intro
Change-Id: I3337513e48a8e604b154d91993bd7ff84d6c55ad
2022-08-02 18:50:59 -07:00
James Zern
79be856e6e Merge changes I7111d1f7,I872cd62c into main
* changes:
  libwebp.pc: add libsharpyuv to requires
  libsharpyuv: add pkg-config file
2022-08-03 01:43:10 +00:00
James Zern
5b87983ad0 webp-container-spec.txt: make reserved 0 values a MUST
these were intended as an extension point, but in this version of the
spec they're not defined. if they ever were used leaving them as SHOULD
could result in a source of incompatibility.

Change-Id: I1376ab7abe7d955ae335106f2faebc217dac77cd
2022-08-02 15:14:11 -07:00
James Zern
bd9391232d Merge changes I7a25b1a6,I51b2c2a0,I87d0cbcf,I6ec60af6,I0a3fe9dc into main
* changes:
  webp-container-spec.txt: clarify some SHOULDs
  webp-container-spec.txt: move ChunkHeader to terminology
  webp-container-spec.txt: clarify 'VP8 '/'XMP ' fourccs
  webp-container-spec.txt: rightsize table entries
  webp-container-spec.txt: update 'key words' text
2022-08-02 22:13:07 +00:00
Christopher Degawa
04764b56a0
libwebp.pc: add libsharpyuv to requires
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
Change-Id: I7111d1f7738dad566dc74fc11be99ff92e11c50b
2022-08-02 15:58:49 -05:00
Christopher Degawa
7deee8103e
libsharpyuv: add pkg-config file
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
Change-Id: I872cd62ccdf096044c7921afda8289849d141531
2022-08-02 15:46:19 -05:00
James Zern
1a64a7e649 webp-container-spec.txt: clarify some SHOULDs
for compatibility SHOULDs are left as is with some additional
description given of behavior if the recommendation is ignored.

Change-Id: I7a25b1a6fd9f9594390c30fce3af5ca17c3158c0
2022-08-02 13:12:27 -07:00
James Zern
bec2c88a11 webp-container-spec.txt: move ChunkHeader to terminology
this avoids presenting it in the description of a chunk where it could
appear it was defining an element of the diagram

Change-Id: I51b2c2a0dcecb4fc130711ad37c884a434920ecd
2022-08-02 12:46:53 -07:00
James Zern
c9359332a3 webp-container-spec.txt: clarify 'VP8 '/'XMP ' fourccs
Note the fourth character is an ASCII space to avoid confusion.
Also update the FourCC definition to mention that they're case
sensitive.

Change-Id: I87d0cbcf06e7c25bf2b33419b4c8c891adb82a8a
2022-08-01 18:51:35 -07:00
James Zern
70fe3063a5 webp-container-spec.txt: rightsize table entries
Use the correct number of lines for fixed width entries like
ChunkHeader(). ':' is used instead of '|' for variable length entries.

Bug: webp:546
Change-Id: I6ec60af674c0777d5ea6ae99c8aa3c7854ddd9f9
Fixed: webp:546
2022-08-01 18:49:43 -07:00
James Zern
ddbf3f3f2a webp-container-spec.txt: update 'key words' text
RFC 2119 was updated by RFC 8174; use the text from there

+ change INFORMATIVE to informative to avoid confusion with the key
  words in the RFCs

Change-Id: I0a3fe9dc48d284e7ac95633896ffb855ecd1a229
2022-08-01 18:42:21 -07:00
James Zern
c151e95bdc utils.h,WEBP_ALIGN: make bitmask unsigned
this fixes runtime warnings with clang -fsanitize=integer when using the
WEBP_ALIGN_CST constant in WEBP_ALIGN:
implicit conversion from type 'int' of value -32 (32-bit, signed) to
type 'unsigned int' changed the value to 4294967264 (32-bit, unsigned)

Bug: b/229626362
Change-Id: I524d80e620b9869de4e6d322b7de6ffa1ec8657f
2022-08-01 13:44:29 -07:00
James Zern
748e92bbb9 add WebPInt32ToMem
and use it in calls containing _mm_cvtsi32_si128; this calls
WebPUint32ToMem, but corrects the type to avoid runtime warnings with
clang -fsanitize=integer of the form:

implicit conversion from type 'int' of value -1904123502 (32-bit,
signed) to type 'uint32_t' (aka 'unsigned int') changed the value to
2390843794 (32-bit, unsigned)

Bug: b/229626362
Change-Id: I20545e822d8045fa44f688241879206055a0a148
2022-08-01 13:44:20 -07:00
Maryla Ustarroz-Calonge
3fe15b6773 Merge "Build libsharpyuv as a full installable library." into main 2022-08-01 13:10:09 +00:00
James Zern
4f402f34a1 add WebPMemToInt32
and use it with calls to _mm_cvtsi32_si128 and _mm_set_epi32; this calls
WebPMemToUint32, but corrects the type to avoid runtime warnings with
clang -fsanitize=integer of the form:

implicit conversion from type 'uint32_t' (aka 'unsigned int') of value
2155905152 (32-bit, unsigned) to type 'int' changed the value to
-2139062144 (32-bit, signed)

Bug: b/229626362
Change-Id: I50101ba2b46dfaa852f02d46830f3511c80b02d9
2022-07-28 22:10:22 -07:00
Maryla
a3b68c195e Build libsharpyuv as a full installable library.
Headers are installed in a "sharpyuv" subdirectory of the webp
dir, e.g. /usr/local/include/webp/sharpyuv/
Remove unnecessary dependency from sharpyuv to webp/types.h

Add SHARPYUV_EXTERN so that only symbols meant to be public
are exported.

Sharpyuv users can use the library with:

find_package(WebP)
if(TARGET WebP::sharpyuv)
  # ... use WebP::sharpyuv
endif()

Change-Id: I602a25521a135a2edc39d6587610484fe6447ec5
2022-07-28 12:31:59 +00:00
James Zern
b4994eaa6d CMake: set rpath for shared objects
this ensures the correct library is loaded when the install path is not
in the default search path; this matches the behavior of
autoconf/libtool

Change-Id: I7eaa458c353cbdb7f0a1f782a879c59662a5de79
2022-07-25 16:48:00 -07:00
James Zern
94cd711779 Merge "CMake: fix dylib versioning" into main 2022-07-25 23:29:50 +00:00
Vincent Rabaud
e91451b69b Fix the lossless specs a bit more.
Bug: webp:551

Change-Id: I03f729f69d660f17e27cc601e91c703b241f1b83
2022-07-25 22:36:51 +02:00
James Zern
231bdfb762 CMake: fix dylib versioning
match the behavior of autoconf in generating the -compatibility_version
and -current_version options. these use current + 1 and revision:
  # Darwin ld doesn't like 0 for these options...
  func_arith $current + 1
  minor_current=$func_arith_result
  ...
  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"

this requires CMake >= 3.17 to set the MACHO_COMPATIBILITY_VERSION and
MACHO_CURRENT_VERSION properties:
https://cmake.org/cmake/help/latest/prop_tgt/MACHO_COMPATIBILITY_VERSION.html

based on the fix in libexpat:
https://github.com/libexpat/libexpat/issues/55

Bug: webp:576
Fixed: webp:576
Change-Id: Ibc3ab99449aa213fc8c2ca3ae06def648c61acbd
2022-07-22 11:39:18 -07:00
James Zern
bfad7ab589 CMakeLists.txt: correct libwebpmux name in WebPConfig.cmake
this fixes link errors when using ${WEBP_LIBRARIES} from
WebPConfig.cmake:
/usr/bin/ld: cannot find -llibwebpmux: No such file or directory
/usr/bin/ld: note to link with /tmp/install/lib/libwebpmux.a use
-l:libwebpmux.a or rename it to liblibwebpmux.a

previously mentioned in https://github.com/openwrt/packages/pull/16784

Bug: webp:575
Change-Id: I38b45cb102ef1086ed992178cd736f45acf10d35
2022-07-21 19:12:38 -07:00
James Zern
c2e3fd30c4 Revert "cmake: fix webpmux lib name for cmake linking"
This reverts commit 13b8281609.

This breaks target name compatibility with earlier releases.

Conflicts:
	CMakeLists.txt

Bug: webp:575
Change-Id: I3d4895b8a8d14b3f4595ec19646ec4a1001c7748
2022-07-21 18:32:17 -07:00
James Zern
7366f7f394 Merge "lossless: fix crunch mode w/WEBP_REDUCE_SIZE" into main 2022-07-21 16:27:38 +00:00
James Zern
84163d9d02 lossless: fix crunch mode w/WEBP_REDUCE_SIZE
WEBP_REDUCE_SIZE was introduced to bring down the library size by
removing cropping and scaling support. Previously WebPPictureView() was
only used with these two, but in
  ec178f2c Add progress hook granularity in lossless
an additional use was added in VP8LEncodeStream() when extra side
configurations are used in crunch mode (-mt, quality == 100 & method ==
6 or quality >= 75 & method == 5 with a palette present currently).

WebPPictureView() and, for coherency, WebPPictureIsView() are
restored in this configuration to avoid affecting the general encode
path.

Previously WebPPictureView() was assumed to always succeed in these
cases which could result in crashes with WEBP_REDUCE_SIZE defined.

Bug: chromium:1345547
Bug: chromium:1345595
Bug: chromium:1345772
Bug: chromium:1345804
Change-Id: Ifecde36a726a434510478a764514b1469942c684
2022-07-20 22:04:34 -07:00
James Zern
d01c1eb309 webp-lossless-bitstream-spec,cosmetics: normalize capitalization
in section headings

Change-Id: I43b2208f5e0efa32029d519ac9805e871eb51ed3
2022-07-20 10:36:23 -07:00
James Zern
8813ca8e69 libwebp-1.2.3
- 6/30/2022: version 1.2.3
   This is a binary compatible release.
   * security fix for lossless encoder (#565, chromium:1313709)
   * improved progress granularity in WebPReportProgress() when using lossless
   * improved precision in Sharp YUV (-sharp_yuv) conversion
   * many corrections to webp-lossless-bitstream-spec.txt (#551)
   * crash/leak fixes on error/OOM and other bug fixes (#558, #563, #569, #573)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEaw5rcJdt4wPt8vYB+cPWvbgjK10FAmLR6rYACgkQ+cPWvbgj
 K13mwhAAmEqUPCxACgh1M7Tc6BfSkO0Q8FtUzm23/bYndf+t4+n3Oezxm7k5sldR
 OQUJfb9/pe+IegSpJHAOSL5ddTpQlSZfzj6glEHVkd346Ek+ZKzqLCZbWsTKO7xA
 xzv6BXLt49sA1jp62GWi5YyRZ4kQumjXKBxCCwGiaNEI8jd4D9Oduz8jzmRetGHS
 SPleaow7IlxMVgER6jnQZt+nyYGH7UMWI0CWLICRzefHqz+jzwm3GY+brWOPJBbx
 8zZGNmiDzxSOcD7Ce8C13+7EYuLw0GAN6seHa/Lk+y8+w3Eh5tyCp8Z4vHVN32Iv
 2mqXyOo9jgJudZPyMFEduFMUwMo2VmPwnVmQ+5REjfB5dpiFdngHUOoL6MFMNYN/
 +SIPy25mcVJFCYtXQ41FybwG6JfGiba8V6kC3dUedXRodBY/zv5Qw5kjjMe0qzlw
 ey6WO8L5i5LeiGvCJH1mq22JM1UWquNWb1icMsjCbp77QZCDLUH4MYQxJLOgUvoV
 GsX/q8X9kRKPQ3nbwoFGPUAkWd9kGfOd+awef1NENstT6L9eLGYNBmr/p70aYsYh
 G3XcRx/N68oV1zY+/2W//xL/09F/XzGaDIue0pSaXZFuCTcX7h2sKxHT8hodH+zh
 X1y6EY3ezR7ayi1rhfyc+vIw3oqDnX8+mat1xze73AAL5dERBeM=
 =dAgB
 -----END PGP SIGNATURE-----

Merge tag 'v1.2.3'

libwebp-1.2.3

- 6/30/2022: version 1.2.3
  This is a binary compatible release.
  * security fix for lossless encoder (#565, chromium:1313709)
  * improved progress granularity in WebPReportProgress() when using lossless
  * improved precision in Sharp YUV (-sharp_yuv) conversion
  * many corrections to webp-lossless-bitstream-spec.txt (#551)
  * crash/leak fixes on error/OOM and other bug fixes (#558, #563, #569, #573)

Bug: webp:568
Bug: b/230421671

* tag 'v1.2.3':
  update ChangeLog
  dsp/cpu.h: add missing extern "C"
  update ChangeLog
  vwebp: fix file name display in windows unicode build
  webpmux: fix -frame option in windows unicode build
  makefile.unix: add sharpyuv objects to clean target
  update NEWS
  bump version to 1.2.3
  update AUTHORS
  update .mailmap

Change-Id: I148041862bc930472e849d278471aa17ea12258b
2022-07-15 16:00:00 -07:00
James Zern
3c4a0fbfbc update ChangeLog
Change-Id: I6c00a2c32e94d886f749fc09e2bdd71acfeb5402
2022-07-15 12:48:16 -07:00
James Zern
56a480e80c dsp/cpu.h: add missing extern "C"
fixes linking of tests/fuzzer/animencoder_fuzzer on windows

Change-Id: I0bd14b0e8c7ecb261e861689c25cd4b7fdaecbfd
2022-07-08 15:44:39 -07:00
James Zern
62b45bddcd update ChangeLog
Bug: webp:568
Change-Id: Icdb0657f9d19ba85e6235c6ce9577afa23e0ce21
2022-07-07 15:23:40 -07:00
James Zern
8764ec7a07 Merge changes Idb037953,Id582e395 into 1.2.3
* changes:
  vwebp: fix file name display in windows unicode build
  webpmux: fix -frame option in windows unicode build
2022-07-07 22:18:26 +00:00
James Zern
bcb872c31f vwebp: fix file name display in windows unicode build
glutBitmapCharacter() isn't limited to 8-bit characters; add
PrintStringW() to iterate through the file name. This may not fix all
cases, non-existent characters in the font used have no effect.

https://www.opengl.org/resources/libraries/glut/spec3/node76.html#SECTION000111000000000000000

Change-Id: Idb0379539d556a89ec694127f766eb662f09d597
2022-07-05 12:59:06 -07:00
James Zern
67c44ac5db webpmux: fix -frame option in windows unicode build
-frame takes a file name parameter, use wargv[] like in other paths

Change-Id: Id582e395d3ff9b00bb7fcc0261b475211758f6d4
2022-07-05 11:48:56 -07:00
James Zern
8278825aac makefile.unix: add sharpyuv objects to clean target
Change-Id: Iad9ac2530bd892681c055e5ae1bf82eb8782d2a2
2022-07-05 10:41:14 -07:00
James Zern
14a49e018d update NEWS
Bug: webp:568
Change-Id: I0986c33910eba862ef6c1676d7dc58ea6df7ba3b
2022-06-30 19:30:31 -07:00
James Zern
34b1dc336d bump version to 1.2.3
libwebp{,decoder} - 1.2.3
libwebp libtool - 8.4.1
libwebpdecoder libtool - 4.4.1

mux - 1.2.3
libtool - 3.4.0

demux - 1.2.3
libtool - 2.10.0

Bug: webp:568
Change-Id: I943bae1b7eacb445f6a4e13123e63170ac8bb142
2022-06-30 19:30:31 -07:00
James Zern
0b397fda9d update AUTHORS
Bug: webp:568
Change-Id: I333e9679d1d9a9c33f94e214b7ab1723e063fe51
2022-06-30 19:30:27 -07:00
James Zern
c16488ac4a update .mailmap
Bug: webp:568
Change-Id: I34df01bf958ef9de87345e5e43034fafd185f42a
2022-06-30 19:29:53 -07:00
James Zern
5a2d929cd8 Merge "unicode.h: set console mode before using wprintf" into main 2022-07-01 01:03:01 +00:00
James Zern
169f867f3c unicode.h: set console mode before using wprintf
This fixes incorrect character display in the file name
in e.g., stats output from cwebp.exe in visual studio builds.

In mingw further changes will be needed as using %s in wfprintf() for
wchar_t pointers is a Microsoft extension that doesn't seem to be
supported with gcc -fms-extensions. %ls works, but will require updating
format strings and wrapping concatenations with TO_W_CHAR() as visual
studio will reject merging string constants of different width.

https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/setmode

Change-Id: I57d24c3815f7b5aa3971ac315c65c4458258d706
2022-06-29 22:05:26 -07:00
Maryla Ustarroz-Calonge
a94b855c54 Merge "libsharpyuv: add version defines" into main 2022-06-28 09:49:56 +00:00
Maryla
f83bdb5251 libsharpyuv: add version defines
Change-Id: I2dbe69d1ce5abaf7f5bd83daec99655520b5abad
2022-06-28 11:08:14 +02:00
James Zern
bef0d79764 unicode_gif.h: fix -Wdeclaration-after-statement
when building for windows with _UNICODE defined

unicode_gif.h|49 col 3| warning: ISO C90 forbids mixed declarations and
code [-Wdeclaration-after-statement]

Change-Id: Ib9f0cc0eba036d6cd4221a4f70a078770dde01d0
2022-06-20 11:40:09 -07:00
Jyrki Alakuijala
404c1622f8 Rename Huffman coding to prefix coding in the bitstream spec
... since no guarantee of Huffman coding can be introduced at decoding
time and encoding didn't actually use Huffman coding in the first place

Bug: webp:551
Change-Id: I400466bb3b4a1d5506353eb3f287d658603164ee
2022-06-16 10:56:03 -07:00
James Zern
8895f8a345 Merge "run_static_analysis.sh: fix scan-build archive path" into main 2022-06-16 17:27:52 +00:00
Maryla Ustarroz-Calonge
92a673d258 Merge "Add -fvisibility=hidden flag in CMakeLists." into main 2022-06-16 08:02:28 +00:00
James Zern
67c1d72239 Merge "add WEBP_MSAN" into main 2022-06-16 05:11:26 +00:00