Commit Graph

4538 Commits

Author SHA1 Message Date
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
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
James Zern
a02978c250 sharpyuv/Makefile.am+cmake: add missing -lm
this lib uses functions from math.h

Change-Id: I316f058c9e42e4888cce0d380472518a77e21517
2022-10-25 15:58:21 -07:00
James Zern
28aedcb9b0 *.pc.in: rename lib_prefix to webp_libname_prefix
this will help avoid any future conflicts with the more generic autoconf
type name

Change-Id: I0311e03a11a541118025c7dbe8309365f6efa847
2022-10-24 16:44:42 -07:00
James Zern
c42e6d5a89 configure.ac: export an empty lib_prefix variable
this fixes the pkg-config files after:
2498209b *.pc.in: add lib prefix to lib names w/MSVC

Change-Id: I1c932103da175ca50826a8801796f0f6ee5ef583
2022-10-24 16:42:37 -07:00
James Zern
dfc843aa63 Merge "*.pc.in: add lib prefix to lib names w/MSVC" into main 2022-10-20 18:25:42 +00:00
James Zern
2498209ba9 *.pc.in: add lib prefix to lib names w/MSVC
this fixes the library names output after:
9ac25bcb3 CMakeLists.txt,win32: match naming convention used by nmake

before this change:
pkg-config --libs --msvc-syntax \
  libwebp libwebpdemux libwebpmux libsharpyuv libwebpdecoder
/libpath:.../lib webpdemux.lib webpmux.lib webp.lib
  sharpyuv.lib webpdecoder.lib

after:
pkg-config --libs --msvc-syntax \
  libwebp libwebpdemux libwebpmux libsharpyuv libwebpdecoder
/libpath:.../lib libwebpdemux.lib libwebpmux.lib libwebp.lib
  libsharpyuv.lib libwebpdecoder.lib

Bug: webp:584
Change-Id: Ic3693b58a40e0ba683333065003b1c00aab0cf48
Fixed: webp:584
2022-10-17 14:07:02 -07:00
James Zern
ac252b6118 Merge "analysis_enc.c: fix a dead store warning" into main 2022-10-17 17:34:34 +00:00
James Zern
5694476244 analysis_enc.c: fix a dead store warning
when threading is disabled; fixes:
src/enc/analysis_enc.c:429:15: warning: Value stored to 'split_row'
during its initialization is never read [deadcode.DeadStores]
    const int split_row = (9 * last_row + 15) >> 4;
              ^~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~

Change-Id: I2b02173bb8c930ed54360cce5c7b88ecce098d83
2022-10-14 19:20:00 -07:00
James Zern
d34f9b99b9 Merge "webp-lossless-bitstream-spec: convert BNF to ABNF" into main 2022-10-15 02:01:48 +00:00
James Zern
dc05b4db2a Merge changes I96bc063c,I45880467,If9e18e5a,I6ee938e4,I0a410b28, ... into main
* changes:
  webp-container-spec: add prose for rendering process
  webp-container-spec: note reserved fields MUST be ignored
  webp-lossless-bitstream-spec: improve 'small' color table stmt
  webp-container-spec: remove redundant sentence
  doc/webp-*: fix some punctuation, grammar
  webp-container-spec: clarify background color note
  webp-container-spec: come too late -> out of order
  webp-container-spec: prefer hex literals
  webp-container-spec: change SHOULD to MUST w/ANIM chunk
  webp-container-spec: add unknown fields MUST be ignored
  webp-container-spec: make padding byte=0 a MUST
  webp-container-spec: update note on trailing data
  webp-container-spec: clarify Chunk Size is in bytes
2022-10-14 04:05:31 +00:00
James Zern
83270c7f89 webp-container-spec: add prose for rendering process
this is given in addition to the pseudocode, which has been corrected in
the process

based on comments in:
https://datatracker.ietf.org/doc/draft-zern-webp/ballot/#draft-zern-webp_lars-eggert

Bug: webp:448
Change-Id: I96bc063c2a71572ff61609a731a9c4e8edc2b971
2022-10-13 19:34:54 -07:00
James Zern
73b19b64fd webp-container-spec: note reserved fields MUST be ignored
based on comments in:
https://datatracker.ietf.org/doc/draft-zern-webp/ballot/#draft-zern-webp_lars-eggert

Bug: webp:448
Change-Id: I45880467d8955389a2ef657beca9d734da223457
2022-10-13 19:34:54 -07:00
James Zern
57101d3fc5 webp-lossless-bitstream-spec: improve 'small' color table stmt
this is defined earlier as 16 or fewer unique values

based on comments from:
https://datatracker.ietf.org/doc/draft-zern-webp/ballot/#draft-zern-webp_lars-eggert

Bug: webp:448
Change-Id: If9e18e5aaec3641e477c2bb68dacc0a4fd029cfb
2022-10-13 19:34:54 -07:00
James Zern
dfd32e4592 webp-container-spec: remove redundant sentence
in the note regarding metadata the possibility of multiple XMP/EXIF
chunks was already covered in the previous sentences.

based on comments from:
https://datatracker.ietf.org/doc/draft-zern-webp/ballot/#draft-zern-webp_lars-eggert

Bug: webp:448
Change-Id: I6ee938e4d95bda1b144d3175fbf9f9296cf23352
2022-10-13 19:34:54 -07:00
James Zern
8a6185dd27 doc/webp-*: fix some punctuation, grammar
based on comments from:
https://datatracker.ietf.org/doc/draft-zern-webp/ballot/#draft-zern-webp_lars-eggert

Bug: webp:448
Change-Id: I0a410b28b7b62fb4552ea3db444743be61469fe8
2022-10-13 19:34:54 -07:00
James Zern
72776530d8 webp-lossless-bitstream-spec: convert BNF to ABNF
this has a better canonical reference [1] and is preferred in IETF docs

[1] https://www.rfc-editor.org/rfc/rfc5234

Bug: webp:448
Change-Id: I3f0bd34d3ca4c62b255d5d6cbae0c55e2940dfb5
2022-10-12 16:55:46 -07:00
James Zern
d992bb08b7 cmake: rename cpufeatures target to cpufeatures-webp
this avoids name clashes with other targets of the same name:
https://github.com/webmproject/sjpeg/pull/117

Change-Id: I520dff992c71f0e737ac4a7e21f9ae80701d052d
2022-10-11 15:52:04 -07:00
James Zern
3ed2b27517 webp-container-spec: clarify background color note
replace ...a transparency value (alpha)... with clearer text

based on comments from:
https://datatracker.ietf.org/doc/draft-zern-webp/ballot/#draft-zern-webp_lars-eggert

Bug: webp:448
Change-Id: I79157b669c4317ebfc4f8434ee38f2666d1559ec
2022-10-11 15:05:33 -07:00
James Zern
951c292d12 webp-container-spec: come too late -> out of order
based on comments from:
https://datatracker.ietf.org/doc/draft-zern-webp/ballot/#draft-zern-webp_lars-eggert

Bug: webp:448
Change-Id: Ie32d5500f3966b3c9f910675fb11d8a2cc60de3c
2022-10-11 15:05:33 -07:00
James Zern
902dd78762 webp-container-spec: prefer hex literals
to ABNF-style values; this makes the doc more consistent with
doc/webp-lossless-bitstream-spec.txt.

based on comments from:
https://datatracker.ietf.org/doc/draft-zern-webp/ballot/#draft-zern-webp_lars-eggert

Bug: webp:448
Change-Id: I751cf0b7f728866ae663beb06e6352e5b3d848b2
2022-10-11 15:05:33 -07:00
James Zern
a8f6b5ee94 webp-container-spec: change SHOULD to MUST w/ANIM chunk
based on comments in:
https://datatracker.ietf.org/doc/draft-zern-webp/ballot/#draft-zern-webp_paul-wouters

Bug: webp:448
Change-Id: I9464dbbd734f1b78b287139eff13b1db8814c8d9
2022-10-11 15:05:33 -07:00
James Zern
1dc594352f webp-container-spec: add unknown fields MUST be ignored
based on comments in:
https://datatracker.ietf.org/doc/draft-zern-webp/ballot/#draft-zern-webp_paul-wouters

Bug: webp:448
Change-Id: I1eccb573b536f931b123261662efad7f92700500
2022-10-11 15:05:33 -07:00
James Zern
280a810f2a webp-container-spec: make padding byte=0 a MUST
this is consistent with the RIFF specification.

based on comments from:
https://datatracker.ietf.org/doc/draft-zern-webp/ballot/#draft-zern-webp_robert-wilton

Bug: webp:448
Change-Id: I7a09177c9ea001b2e8759dcc5102242864c78105
2022-10-11 15:05:33 -07:00
James Zern
41f0bf680b webp-container-spec: update note on trailing data
clarify that the data is after the size specified by the file size in
the header; an alternate way to read the previous statement was that the
data was after the 'WEBP' fourcc.

based on comments from:
https://datatracker.ietf.org/doc/draft-zern-webp/ballot/#draft-zern-webp_robert-wilton

Bug: webp:448
Change-Id: I7c5c5440a94cb817da51fe07d1ccf45d6af0f001
2022-10-11 15:05:33 -07:00
James Zern
6bdd36dbe7 webp-container-spec: clarify Chunk Size is in bytes
based on comments from:
https://datatracker.ietf.org/doc/draft-zern-webp/ballot/#draft-zern-webp_robert-wilton

Bug: webp:448
Change-Id: Idc874e5fa04d3cd122d31b87e833bf9f30ec9d05
2022-10-11 15:05:33 -07:00