Commit Graph

4630 Commits

Author SHA1 Message Date
James Zern
6c3845f9e0 webp-lossless-bitstream-spec: split LZ77 Backward Ref section
Make Distance Mapping its section for ease of reference.

Bug: webp:611
Change-Id: I57bb68e0fcf4d23ce0013f327adce93c6377be3a
2023-06-26 12:51:36 -07:00
James Zern
7f1b6799db webp-lossless-bitstream-spec: split Meta Prefix Codes section
Make Entropy Image and Interpretation of Meta Prefix Codes their own
section for ease of reference.

Bug: webp:611
Change-Id: I2dba7b4efd02d8bb250810ebff42ac1687262804
2023-06-26 12:51:36 -07:00
James Zern
7b634d8f0c webp-lossless-bitstream-spec: note transform order
transforms are applied in reverse bitstream order.

Bug: webp:611
Change-Id: I172aca36bbd5c3358a71b0acb49c5704ceee63d7
2023-06-26 12:51:36 -07:00
James Zern
6d6d4915ce webp-lossless-bitstream-spec: update transformations text
follow up to:
29c9f2d4 webp-lossless-bitstream-spec: minor wording updates

Universally use 'transform' over 'transformation'. The doc generally
uses 'transform' to talk about the individual transforms themselves as
well as their related data.

Bug: webp:611
Change-Id: I097701873bbc440bd399ab5440a914a14f7c62f6
2023-06-26 12:50:39 -07:00
James Zern
08d60d6006 webp-lossless-bitstream-spec: split code length section
Make Simple / Normal Code Length Code their own section for ease of
reference.

Bug: webp:611
Change-Id: I1e6ed50d98f9258cacb163d2059716b5356e8b6f
2023-06-21 19:20:12 -07:00
James Zern
7a12afcc54 webp-lossless-bitstream-spec: rm unused anchor
The last use of #decoding-the-code-lengths was removed in:
86f94ee0 Update lossless spec with Huffman codes.

Also remove the redundant section header associated with it.

Bug: webp:611
Change-Id: I7f6bb1a1b75255324f185f4591313d9e6d49d1e9
2023-06-21 19:16:39 -07:00
James Zern
14a9dbfba0 webp-lossless-bitstream-spec: refine single node text
Remove the ambiguous 'should' which in other contexts might result in
questions as to whether it is a SHOULD or a MUST.

Change-Id: I9b396187ebde5ea5a0dbaf42daee6acf541258cd
2023-06-20 19:30:20 -07:00
Vincent Rabaud
64819c7cf3 Implement ExtractGreen_SSE2
Change-Id: I74f50e0c01603a640aa8cf7c9658d477e696ea8a
2023-06-19 13:31:46 +02:00
James Zern
fe80fbbd6b webp-container-spec: add some missing commas
The serial comma change is based on the Chicago Manual of Style
(CMOS), 17th edition.

Change-Id: I642d6eb87492bb671869b25415c59b96b749c798
2023-06-12 22:03:01 -07:00
Pascal Massimino
e8ed317609 Merge "treat FILTER_NONE as a regular Unfilter[] call" into main 2023-06-12 14:19:04 +00:00
James Zern
03a7a04892 webp-lossless-bitstream-spec: rm redundant statement
Within the 'Entropy image' subsection, its clear this is what is being
described in the following paragraphs. Remove 'as described below' from
the first sentence.

Bug: webp:611
Change-Id: I365d69c8f6963cd826849ebdd96e46206d38b55d
2023-06-08 11:22:10 -07:00
James Zern
c437c7aace webp-lossless-bitstream-spec: mv up prefix code group def
Move this to the top-level of the "Details" section as prefix codes are
discussed in both "Decoding and Building the Prefix Codes" and "Decoding
of Meta Prefix Codes"

Bug: webp:611
Change-Id: Ide2dfedf081d6c94122ac16ecded968ed760f90c
2023-06-08 11:22:10 -07:00
James Zern
e4f17a31a7 webp-lossless-bitstream-spec: fix section reference
in the Transformations section describing decoding of the transform
data followed by the image data. The section numbers were adjusted by 1
in:
337cf69f webp-lossless-bitstream-spec: mv Nomenclature after Intro

Bug: webp:611
Change-Id: I4eede0d068fabdef51a140a0268436ab6629e8bb
2023-06-08 11:22:10 -07:00
James Zern
e2ecd5e937 webp-lossless-bitstream-spec: clarify ABNF syntax
Give some examples of repetition and binary value notation to limit the
need to follow the ABNF reference.

Bug: webp:611
Change-Id: I5b5a7632f011e1523b4a528653fe3630afba3e3e
2023-06-08 11:22:10 -07:00
James Zern
8b55425a56 webp-lossless-bitstream-spec: refine pixel copy text
in 6.2.3 Decoding Entropy-Coded Image Data.

The copying of distance code pixels cause some confusion during the
AUTH48 portion of the RFC review process.

Bug: webp:611
Change-Id: I78f547ae10c95f180355a4c93ec6d48acdc09141
2023-06-08 11:22:10 -07:00
James Zern
29c9f2d410 webp-lossless-bitstream-spec: minor wording updates
Mostly grammatical and addition/subtraction of commas from the AUTH48
portion of the RFC review process.

The serial comma changes are based on the Chicago Manual of Style
(CMOS), 17th edition.

Bug: webp:611
Change-Id: I5ae2d1cc0196009dbf3a4c2195cc73c2ef809b49
2023-06-08 11:21:55 -07:00
skal
6b02f66015 treat FILTER_NONE as a regular Unfilter[] call
Removes the hard-coded memcpy() in alpha-decoding.

Change-Id: I1dfd98db206893d7715a79d05a1bd9272690471a
2023-06-07 15:42:16 +02:00
James Zern
7f75c91ced webp-container-spec: fix location of informative msg
preprocessing bits are informative, not the filtering bits.

since:
391f9db9 Ordering of description of bits in container spec

Change-Id: I1c0da963074ce9cf4d33a13b4b36c9421b3e3b9d
2023-06-06 22:09:41 -07:00
James Zern
f6499943c4 webp-container-spec: consistently quote FourCCs
from the AUTH48 portion of the RFC review process

Change-Id: I3aad4b32c95517735e98ffa0120228ee24be6a4d
2023-06-06 18:47:20 -07:00
James Zern
49918af32b webp-container-spec: minor wording updates
Mostly grammatical and addition/subtraction of commas from the AUTH48
portion of the RFC review process.

The serial comma changes are based on the Chicago Manual of Style
(CMOS), 17th edition.

Change-Id: Ic75abf2e53e09c8a849e28e9c40e16c127515287
2023-06-05 18:26:34 -07:00
Vincent Rabaud
46bc4fc9d9 Merge "Switch ExtraCost to ints and implement it in SSE." into main 2023-06-01 11:05:12 +00:00
Vincent Rabaud
828b4ce062 Switch ExtraCost to ints and implement it in SSE.
The histograms count the occurrences of len/dist in entropy images.
Those (at most (1<<14) by (1<<14)) are sub-sampled by at least
MIN_HUFFMAN_BITS == 2, hence at most 24 bits in a histogram value.
At most, we multiply by 19 (because the longest histogram is of
size 40 and we do 40>>1, cf code) for the bit cost. So it all fits
in 32 bits.

Change-Id: Ife24b035f54794851ff31f2fac07901f724c6d7f
2023-06-01 10:17:13 +02:00
James Zern
ff6c7f4e71 CONTRIBUTING.md: add C style / cmake-format notes
Change-Id: I54ad0e27341025a6385a736d5a79ab8b6556a6ec
2023-05-30 13:54:12 -07:00
James Zern
dd530437f6 add .cmake-format.py
Created with cmake-format 0.6.13 using:
--dump-config --max-subgroups-hwrap 3 --first-comment-is-literal true

Change-Id: Ica8ca81086dcf466d4ea9693ffcb4e31aa0af002
2023-05-30 13:54:06 -07:00
James Zern
adbe2cb17e cmake,cosmetics: apply cmake-format
using the defaults present in 0.6.13 and setting
--first-comment-is-literal to avoid reflowing the copyright block and
--max-subgroups-hwrap 3 (default is 2) to avoid making some short set()
statements multi-line.

Change-Id: I3d90c025b5b2bb353046f4da19b8e442a044b902
2023-05-30 12:14:28 -07:00
James Zern
15b365083d doc/webp-container-spec: rm future codec comment
From the compression standpoint the file format is fixed at this point.

Change-Id: I788fcf7106e4840bf2f9950dfb099a7bab88b3bf
2023-05-26 15:48:31 -07:00
James Zern
c369c4bf0b doc/webp-lossless-bitstream-spec: improve link text
Reference the section by number, rather than 'this section'. Fixes a
lint warning:

Style notice: Write unique, descriptive link text that makes sense
without the surrounding text. Don't use phrases such as this document,
this article, or click here.
https://developers.google.com/style/link-text?hl=en#write-link-text

Change-Id: Iab33e4980528dddb5eed4404d25a4a746705131a
2023-05-26 15:48:28 -07:00
James Zern
1de35f476b doc/webp-container-spec: don't use 'currently'
Provide examples of formats that WebP performs better than.

https://developers.google.com/style/timeless-documentation

Change-Id: I4ead60be349d8650478788484989bde9ff18f6b6
2023-05-26 15:48:26 -07:00
James Zern
bb06a16ed1 doc/webp-container-spec: prefer present tense
https://developers.google.com/style/tense

Change-Id: I0cd4e1431cddc340adf5634c07f0c60635b3d4f2
2023-05-26 15:48:23 -07:00
James Zern
9f38b71e01 doc/webp-lossless-bitstream-spec: prefer present tense
https://developers.google.com/style/tense

Change-Id: I1151ad0f585afd388920e6910a30aca4c2d0cc32
2023-05-26 15:48:17 -07:00
James Zern
7acb6b829a doc/webp-container-spec: avoid i.e. & e.g.
Using 'that is' or 'for example' is recommended:
https://developers.google.com/style/abbreviations#dont-use

Change-Id: I25b45f5b41687dfbd25a0fbea4978d6bc8e44ad2
2023-05-26 15:48:12 -07:00
James Zern
4967e7cd78 doc/webp-lossless-bitstream-spec: avoid i.e. & e.g.
Using 'that is' or 'for example' is recommended:
https://developers.google.com/style/abbreviations#dont-use

Change-Id: I5d0dad2ee7ae5ebaf73661d5d79a4a2f1dc1802a
2023-05-26 15:48:09 -07:00
Vincent Rabaud
e3366659a0 Merge "Do not find_package image libraries if not needed." into main 2023-05-26 20:55:09 +00:00
Jyrki Alakuijala
428588ef90 clarify single leaf node trees and use of canonical prefix coding
remove AMENDED-notes (the last functional spec change to match with the
implementation is from 2014, other amendments are clarifications)

Bug: webp:581
Change-Id: Ic47739be0fd5a975fd734d6813567ca615304f1d
2023-05-25 17:25:48 -07:00
Vincent Rabaud
709ec152df Do not find_package image libraries if not needed.
This can be tested by running:
cmake ../ -DWEBP_BUILD_ANIM_UTILS=OFF -DWEBP_BUILD_CWEBP=OFF -DWEBP_BUILD_DWEBP=OFF -DWEBP_BUILD_GIF2WEBP=OFF -DWEBP_BUILD_IMG2WEBP=OFF -DWEBP_BUILD_EXTRAS=OFF

Bug: webp:612

Change-Id: Ie06d8f0535676d6d31ff0047ff7a6c026e16118e
2023-05-26 00:14:05 +02:00
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