Commit Graph

4513 Commits

Author SHA1 Message Date
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
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
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
James Zern
87e36c485a Merge "webp_js/README.md,cosmetics: reflow some lines" into main 2022-10-10 18:29:48 +00:00
Maryla Ustarroz-Calonge
5b01f32162 Merge "Update Windows makefile to build libsharpyuv library." into main 2022-10-07 13:28:20 +00:00
James Zern
19b1a71c48 webp_js/README.md,cosmetics: reflow some lines
after:
cb90f76b Update wasm instructions.

Change-Id: I8d937d08dba98c23c4a298ba1165e4b1f553fea9
2022-10-06 14:10:03 -07:00
Maryla
780db75618 Update Windows makefile to build libsharpyuv library.
Change-Id: I2d260aa11c06ba1c33e40e94537f5a9afe5d3880
2022-10-05 14:21:35 +02:00
James Zern
e407d4b37c CMakeLists.txt: replace GLUT_glut_LIBRARY w/GLUT::GLUT
GLUT_glut_LIBRARY is a cache variable that is not recommended for use:

from cmake-3.24/Modules/FindGLUT.cmake:
This module may set the following variables depending on platform.
These variables may optionally be set to help this module find the
correct files, but clients should not use these as results:

...

``GLUT_glut_LIBRARY``
  The full path to the glut library.

based on a patch in the Krita and vcpkg projects:
7d51396a7a/3rdparty/ext_webp/0009-glut.patch
https://github.com/microsoft/vcpkg/blob/master/ports/libwebp/0009-glut.patch

Change-Id: If54e26cb1e4e2f582e40eebd7e49d7cc566dbb81
2022-10-04 16:20:11 -07:00
James Zern
abf73d628e Merge "WebPConfig.cmake.in: add find_dependency(Threads)" into main 2022-10-04 22:39:13 +00:00
James Zern
25807fb4cb Merge "cmake: restore compatibility with cmake < 3.12" into main 2022-10-04 21:06:52 +00:00
James Zern
5dbc4bfa1b WebPConfig.cmake.in: add find_dependency(Threads)
when WEBP_USE_THREAD=1; this is necessary after:
0d1b9bc4 WEBP_DEP_LIBRARIES: use Threads::Threads

fixes:
CMake Error at WebPTargets.cmake:76 (set_target_properties):
  The link interface of target "WebP::webp" contains:

    Threads::Threads

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Bug: webp:583
Change-Id: I19633bcceccacb95be06aa9610512127f3c288a6
Fixed: webp:583
2022-10-04 13:01:12 -07:00
Vincent Rabaud
b2a175dd04 Merge "Update wasm instructions." into main 2022-10-04 19:33:17 +00:00
Vincent Rabaud
cb90f76b68 Update wasm instructions.
Also update the quotes in CMake following:
https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-specify-s-options-in-a-cmake-project
https://emscripten.org/docs/getting_started/FAQ.html#why-do-i-get-a-nameerror-or-a-problem-occurred-in-evaluating-content-after-a-s-when-i-use-a-s-option

Change-Id: I9cc0a5aece0019c81e3f435106bf288cd68d0fd0
2022-10-04 16:24:57 +02:00
James Zern
02d1525869 cmake: restore compatibility with cmake < 3.12
since:
bfad7ab5 CMakeLists.txt: correct libwebpmux name in WebPConfig.cmake

replace list(TRANSFORM ...) with string(REGEX REPLACE ...); the former
was added in 3.12, but currently 3.7 is supported

Change-Id: Ie2de2cf083c937ce0bb4d402d6f2452c09de0cea
2022-10-03 18:55:30 -07:00
Jeremy Maitin-Shepard
5ba046e25f CMake: add_definitions -> add_compile_options
`add_definitions` has been superseded by `add_compile_options` and
options added via `add_definitions` can have surprising behavior,
particularly when including `libwebp` as a sub-project via
`FetchContent`.

Change-Id: Icb8478dc92017576028becfd92c4567b4095fa60
2022-10-03 16:48:40 -07:00
James Zern
e68765af42 dsp,neon: use vaddv in a few more places
SumToInt_NEON
horizontal_add_uint32x4

Change-Id: I881831a7b2bab35a1810b0d83fee761470f3e09f
2022-09-12 10:55:58 -07:00
Maryla
e8f83de286 Set libsharpyuv include dir to 'webp' subdirectory.
Change-Id: I57cf12fd3d544485312fb0342aac3dcf5585136f
2022-08-19 10:22:30 +02:00
James Zern
15a91ab179 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: I77ec1f05a819f09c0143d6069c56b6e771ac6a37
2022-08-17 12:46:40 -07:00
James Zern
0dd49d1a3a CMakeLists.txt: set @ONLY in configure_file() calls
this matches the behavior in autoconf and avoids expanding the ${var}
references in the files; the .pc files now match the autoconf install.

pointed out by @kmilos in:
https://github.com/AOMediaCodec/libavif/pull/1035#discussion_r947847183

Change-Id: Ib1950a290b73b7e689658e6c2f25c8784b586180
2022-08-17 12:00:22 -07:00
James Zern
62b1bfe8bd Merge changes I2877e7bb,I777cad70,I15af7d1a,I686e6740,If10538a9, ... into main
* changes:
  picture_csp_enc.c: remove SafeInitSharpYuv
  sharpyuv: prefer webp/types.h
  sharpyuv,SharpYuvInit: add mutex protection when available
  sharyuv_{neon,sse2}.c: merge WEBP_USE_* sections
  add a few missing <stddef.h> includes for NULL
  sharpyuv.h: remove <inttypes.h>
2022-08-17 18:13:09 +00:00
James Zern
95c8fe5f3d Merge changes Iecea3603,I9dc228ab into main
* changes:
  cmake: fix dll exports
  cmake/cpu.cmake: remove unused variable
2022-08-17 18:11:27 +00:00
James Zern
e7c805cfad picture_csp_enc.c: remove SafeInitSharpYuv
thread safety was internalized in:
782ed48c sharpyuv,SharpYuvInit: add mutex protection when available

Change-Id: I2877e7bb78bf89ad7504c33d04b22952c0c0a968
2022-08-12 11:05:57 -07:00
James Zern
6af8845a8f sharpyuv: prefer webp/types.h
this provides better compatibility for older Visual Studio versions;
stdint.h is a part of C99.

this is consistent with the core libwebp library:
8fbb9188 prefer webp/types.h over stdint.h

Change-Id: I777cad70d9a407646c4193db9ca0f09e65d88735
2022-08-12 10:55:39 -07:00
James Zern
639619ce72 cmake: fix dll exports
move WEBP_EXTERN definition from Makefile.vc to webp/types.h using the
existing WEBP_DLL define to control its declaration to
__declspec(dllexport); the same is done for SHARPYUV_EXTERN

Change-Id: Iecea360305bdd19a878255470a00b9dcc344c730
2022-08-11 19:33:37 -07:00
James Zern
782ed48cd3 sharpyuv,SharpYuvInit: add mutex protection when available
this is similar to WEBP_DSP_INIT and avoids the potential for a race in
initializing the function pointers and gamma table

Change-Id: I15af7d1a3e92c42eaa735751ca33eba0d1e83283
2022-08-11 18:58:40 -07:00
James Zern
cad0d5adb6 sharyuv_{neon,sse2}.c: merge WEBP_USE_* sections
Change-Id: I686e6740717902d632fb01f9151e47fd3cb2cf79
2022-08-11 17:48:11 -07:00
James Zern
ef70ee06fa add a few missing <stddef.h> includes for NULL
and remove unused includes in sharpyuv/

Change-Id: If10538a994bd5dc55126f1485f2b163933ad8e91
2022-08-11 17:39:48 -07:00
James Zern
f0f9eda406 sharpyuv.h: remove <inttypes.h>
this hasn't been needed since:
93c54371 sharpyuv: add support for 10/12/16 bit rgb and 10/12 bit yuv.

Change-Id: I02051e8b576d7fd27824e13be0d087dc4e18209e
2022-08-11 17:18:49 -07:00