Commit Graph

4562 Commits

Author SHA1 Message Date
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
James Zern
2a8686fcab update AUTHORS
Bug: webp:590
Change-Id: I5f18987cd56f5efd47fe901b097669346c698446
2022-12-16 16:47:36 -08:00
James Zern
106a57c1db Merge "*/Android.mk: add a check for NDK_ROOT" into main 2022-12-16 20:59:49 +00:00
James Zern
c5e841c417 Merge "extras: WebpToSDL -> WebPToSDL" into main 2022-12-16 20:15:12 +00:00
James Zern
dbc3071512 Merge "xcframeworkbuild.sh: bump MACOSX_CATALYST_MIN_VERSION" into main 2022-12-16 20:13:44 +00:00
James Zern
6fc1a9f96e */Android.mk: add a check for NDK_ROOT
This simplifies integration with the Android platform and avoids the
files from being used when a non-NDK build is performed. In that case
Android.bp is preferred.

Change-Id: I6e334cf8b05a19da8452405f5f448f9e4b6e4a40
2022-12-16 12:10:36 -08:00
James Zern
d3e151fc03 doc/api.md,webp_js/README.md: Webp -> WebP
Change-Id: Ib30d008b5750d2e4064aaf478db6f5bc7aa5902e
2022-12-15 18:14:19 -08:00
James Zern
ed92a62649 extras: WebpToSDL -> WebPToSDL
this normalizes the function case to what's more commonly used in the
project

Change-Id: If614cb8eff4afba96b2468e28c52d850651a759b
2022-12-15 18:11:40 -08:00
James Zern
6eb0189b24 xcframeworkbuild.sh: bump MACOSX_CATALYST_MIN_VERSION
14.0 (-target x86_64-apple-ios14.0-macabi) is supported by default in
Xcode 14.0.1.

Change-Id: I05bc318fe321758c68c7be2e339d77512dd81684
2022-12-15 15:14:44 -08:00
James Zern
1d58575b18 CMake: align .pc variables with autoconf
Use prefix/exec_prefix for includedir/libdir if
CMAKE_INSTALL_{LIBDIR,INCLUDEDIR} are relative and the CMake variable
alone if they're absolute.

This matches what autoconf will produce if a custom --libdir or
--includedir are used.

See also: https://github.com/AOMediaCodec/libavif/issues/1220

Change-Id: I6fbc016c0009ede42e1e5db3a9ee7ae9545d8da0
2022-12-14 19:21:12 -08:00
James Zern
e5fe2cfc1b webp-lossless-bitstream-spec,cosmetics: reflow paragraphs
Change-Id: Ifd7472fe0678b45efc62faa66de8e8dc2e9931e3
2022-11-22 11:38:01 -08:00
James Zern
0ceeeab987 webp-lossless-bitstream-spec: add amendment note
for fixes to the distance_map pseudo-code, the inverse color transform
description and the num_code_lengths check.

Bug: webp:448
Bug: webp:551
Change-Id: Id7e791b97704dd64bb9519657ce48b92cb457ae4
2022-11-22 11:38:01 -08:00
James Zern
607611cd86 Merge "webp-container-spec: normalize section title case" into main 2022-11-22 19:35:41 +00:00
James Zern
f853685e13 lossless: SUBTRACT_GREEN -> SUBTRACT_GREEN_TRANSFORM
this makes the name of the TransformType enum value match the other
members

Bug: webp:448
Change-Id: I85b2f615f97b40fc6d544197cccfb7189dcf4fc0
2022-11-21 16:48:51 -08:00
James Zern
786497e48a webp-lossless-bitstream-spec: fix inv color txfm description
The prose describing the process was missed in:
44dd765d webp-lossless-bitstream-spec: fix ColorTransform impl

Bug: webp:448
Bug: webp:551
Change-Id: If5fb95103ffedeed113e3ad62510f3a19bfd280e
2022-11-21 16:48:51 -08:00
James Zern
c6ac672dbc webp-lossless-bitstream-spec: fix num_code_lengths check
in the 'Normal Code Length Code' description the number of valid code
lengths is 19, not 18.

Bug: webp:448
Bug: webp:551
Change-Id: Id929604e1d771cb09b2d0ac617e83f21077f21de
2022-11-21 16:48:51 -08:00
James Zern
b5700efb70 webp-lossless-bitstream-spec,cosmetics: grammar/capitalization
Bug: webp:448
Change-Id: I2d6cc66b45342716fdba7792c570510601432109
2022-11-21 16:48:41 -08:00
James Zern
d8ed8c117c webp-container-spec: normalize section title case
Use 'title case' as recommended in RFC 7322 (Section 3.4 Capitalization)

Bug: webp:448
Change-Id: I9762402499eb58acbe9ccb75f4f8d2b9c3e9b26b
2022-11-21 10:53:13 -08:00
James Zern
52ec0b8f61 Merge changes Ie975dbb5,Ifc8c93af,I6ca7c5d6,I2e8d66f5,I152477b8 into main
* changes:
  webp-lossless-bitstream-spec,cosmetics: reflow abstract
  webp-lossless-bitstream-spec: reword abstract re alpha
  webp-lossless-bitstream-spec,cosmetics: normalize range syntax
  webp-lossless-bitstream-spec: limit dist map lut to 69 cols
  webp-lossless-bitstream-spec: fix dist mapping example
2022-11-18 18:28:15 +00:00
James Zern
5097ef6255 webp-container-spec,cosmetics: grammar/capitalization
Bug: webp:448
Change-Id: I8b5e218df95436b6b8b2ecc751c70015d46fe7a0
2022-11-17 19:13:39 -08:00
James Zern
e3ba2b1f5b webp-lossless-bitstream-spec,cosmetics: reflow abstract
Bug: webp:448
Change-Id: Ie975dbb52687c6c068b029fc8f84db8cf189523a
2022-11-17 18:25:13 -08:00
James Zern
1e8e3ded21 webp-lossless-bitstream-spec: reword abstract re alpha
'zero alpha pixels' was a bit hard to parse; replace this with something
more explicit

Bug: webp:448
Change-Id: Ifc8c93af5520ffdafc58e3fc311dfb4cb19626e9
2022-11-17 18:22:56 -08:00
James Zern
017cb6fa94 webp-container-spec,cosmetics: normalize range syntax
this makes the syntax in this document consistent with
webp-lossless-bitstream-spec.txt

[N-M] -> [N..M]

Bug: webp:448
Change-Id: Iebf39eefb7d3c081a3d10e2804ee215c3aed6b79
2022-11-17 18:13:32 -08:00
James Zern
f6a4684ba8 webp-lossless-bitstream-spec,cosmetics: normalize range syntax
[N-M], [N, M] -> [N..M]

these were missed in:
e74f8a62 webp-lossless-bitstream-spec,cosmetics: normalize range syntax

Bug: webp:448
Change-Id: I6ca7c5d6b0473fdf3de0c6dba00b0f1e3da46a23
2022-11-17 18:06:49 -08:00
James Zern
54ebd5a375 webp-lossless-bitstream-spec: limit dist map lut to 69 cols
this is similar to an earlier change for most of the code examples:
  7a0a9935 doc/*.txt: restrict code to 69 columns

some renderers may limit output to 72 and use a 3 space indent; this
avoids overflowing into the margin

Bug: webp:448
Change-Id: I2e8d66f598889c7bd824e911ea01fd70f98a4130
2022-11-17 18:06:45 -08:00
James Zern
44741f9c58 webp-lossless-bitstream-spec: fix dist mapping example
The distance code read from the bitstream is reduced by 1 before doing
the lookup. The prose describing the lookup was correct, the pseudocode
failed to subtract 1 and used x/y instead of xi/yi from the lookup.

Bug: webp:448
Change-Id: I152477b888c26a0473a35373d3d331fddd14237f
2022-11-17 18:06:31 -08:00
James Zern
fad0ece7ed pnmdec.c: use snprintf instead of sprintf
this is consistent with the rest of the example code

Change-Id: Id4c02e16be84fbe21ddc74c9049d8cbda2d875a8
2022-11-15 17:10:26 -08:00
James Zern
3f73e8f7ac sharpyuv: add SharpYuvGetVersion()
Change-Id: Ic7e93c7c3ec33b8ab0105a6e81b76a7869422b55
2022-10-28 19:15:32 -07:00
James Zern
ce2f2d668e SharpYuvConvert: fix a race on SharpYuvGetCPUInfo
Rather than make a copy, requiring an additional lock/unlock only to set
the pointer to itself, pass the address of SharpYuvGetCPUInfo and use it
as a sentinel to avoid updating the pointer.

Change-Id: I22fb467f1659c16805c0d3bc7aaeba6a1bb16dbb
2022-10-27 13:52:01 -07:00
James Zern
a458e3086c sharpyuv_dsp.h: restore sharpyuv_cpu.h include
this was removed in:
979c0ebb sharpyuv: add SharpYuvGetCPUInfo

but currently, consumers of sharpyuv_dsp.h depend on the presence of
WEBP_USE_*

Change-Id: I9524aa5ab767a1b46770022220372455a86f198f
2022-10-26 15:22:48 -07:00
James Zern
9ba800a745 Merge changes Id72fbf3b,Ic59d23a2 into main
* changes:
  sharpyuv: add SharpYuvGetCPUInfo
  cpu.c,cosmetics: fix a typo
2022-10-26 20:56:42 +00:00
James Zern
979c0ebbcd sharpyuv: add SharpYuvGetCPUInfo
This gives a similar structure to libwebp and fixes a bug where passing
NULL to SharpYuvInit() would unconditionally set optimized function
pointers. SharpYuvInit() is left as an undocumented public function and
SharpYuvGetCPUInfo is kept private to serialize updates to the pointer.

Change-Id: Id72fbf3ba5b396367510e3bcd1ee2e4e11b95b8c
2022-10-26 13:07:01 -07:00
James Zern
8bab09a4a8 Merge "*.pc.in: rename lib_prefix to webp_libname_prefix" into main 2022-10-26 19:57:24 +00:00
James Zern
769387c54a cpu.c,cosmetics: fix a typo
VP8DecGetCPUInfo -> VP8GetCPUInfo

Change-Id: Ic59d23a2964a881b853db62b3617117bf10ec66d
2022-10-25 16:24:07 -07:00