mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-18 14:59:48 +02:00
Compare commits
36 Commits
webp-rfc96
...
1d86819f49
Author | SHA1 | Date | |
---|---|---|---|
1d86819f49 | |||
743a5f092d | |||
565da14882 | |||
319860e919 | |||
815fc1e110 | |||
980b708e2c | |||
73b728cbb9 | |||
6a22b6709c | |||
7ed2b10ef0 | |||
654bfb040c | |||
f8f2410710 | |||
2af6c034ac | |||
a4d7a71533 | |||
c3d85ce4cf | |||
ad14e811cf | |||
74cd026edb | |||
a027aa93de | |||
25e17c686f | |||
aa2684fccc | |||
369238461b | |||
ceea8ff6b3 | |||
e4f7a9f0c7 | |||
1b4c967fbb | |||
9e5ecfaf00 | |||
da0d9c7d4e | |||
fcff86c71b | |||
b76c4a8416 | |||
306335198d | |||
4c85d860ea | |||
0ab789e067 | |||
0323645066 | |||
61e2cfdadd | |||
7bda3deb89 | |||
2ddaaf0aa5 | |||
a3ba6f19e9 | |||
f999d94f4a |
3
AUTHORS
3
AUTHORS
@ -11,11 +11,13 @@ Contributors:
|
|||||||
- Christopher Degawa (ccom at randomderp dot com)
|
- Christopher Degawa (ccom at randomderp dot com)
|
||||||
- Clement Courbet (courbet at google dot com)
|
- Clement Courbet (courbet at google dot com)
|
||||||
- Djordje Pesut (djordje dot pesut at imgtec dot com)
|
- Djordje Pesut (djordje dot pesut at imgtec dot com)
|
||||||
|
- Frank (1433351828 at qq dot com)
|
||||||
- Frank Barchard (fbarchard at google dot com)
|
- Frank Barchard (fbarchard at google dot com)
|
||||||
- Hui Su (huisu at google dot com)
|
- Hui Su (huisu at google dot com)
|
||||||
- H. Vetinari (h dot vetinari at gmx dot com)
|
- H. Vetinari (h dot vetinari at gmx dot com)
|
||||||
- Ilya Kurdyukov (jpegqs at gmail dot com)
|
- Ilya Kurdyukov (jpegqs at gmail dot com)
|
||||||
- Ingvar Stepanyan (rreverser at google dot com)
|
- Ingvar Stepanyan (rreverser at google dot com)
|
||||||
|
- Istvan Stefan (Istvan dot Stefan at arm dot com)
|
||||||
- James Zern (jzern at google dot com)
|
- James Zern (jzern at google dot com)
|
||||||
- Jan Engelhardt (jengelh at medozas dot de)
|
- Jan Engelhardt (jengelh at medozas dot de)
|
||||||
- Jehan (jehan at girinstud dot io)
|
- Jehan (jehan at girinstud dot io)
|
||||||
@ -62,6 +64,7 @@ Contributors:
|
|||||||
- Vincent Rabaud (vrabaud at google dot com)
|
- Vincent Rabaud (vrabaud at google dot com)
|
||||||
- Vlad Tsyrklevich (vtsyrklevich at chromium dot org)
|
- Vlad Tsyrklevich (vtsyrklevich at chromium dot org)
|
||||||
- Wan-Teh Chang (wtc at google dot com)
|
- Wan-Teh Chang (wtc at google dot com)
|
||||||
|
- wrv (wrv at utexas dot edu)
|
||||||
- Yang Zhang (yang dot zhang at arm dot com)
|
- Yang Zhang (yang dot zhang at arm dot com)
|
||||||
- Yannis Guyon (yguyon at google dot com)
|
- Yannis Guyon (yguyon at google dot com)
|
||||||
- Zhi An Ng (zhin at chromium dot org)
|
- Zhi An Ng (zhin at chromium dot org)
|
||||||
|
@ -9,11 +9,7 @@
|
|||||||
if(APPLE)
|
if(APPLE)
|
||||||
cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.17)
|
||||||
else()
|
else()
|
||||||
cmake_minimum_required(VERSION 3.7)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
endif()
|
|
||||||
|
|
||||||
if(POLICY CMP0072)
|
|
||||||
cmake_policy(SET CMP0072 NEW)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
project(WebP C)
|
project(WebP C)
|
||||||
@ -567,7 +563,8 @@ if(WEBP_BUILD_GIF2WEBP)
|
|||||||
add_executable(gif2webp ${GIF2WEBP_SRCS})
|
add_executable(gif2webp ${GIF2WEBP_SRCS})
|
||||||
target_link_libraries(gif2webp exampleutil imageioutil webp libwebpmux
|
target_link_libraries(gif2webp exampleutil imageioutil webp libwebpmux
|
||||||
${WEBP_DEP_GIF_LIBRARIES})
|
${WEBP_DEP_GIF_LIBRARIES})
|
||||||
target_include_directories(gif2webp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
|
target_include_directories(gif2webp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
install(TARGETS gif2webp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install(TARGETS gif2webp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
138
ChangeLog
138
ChangeLog
@ -1,3 +1,141 @@
|
|||||||
|
c3d85ce4 update NEWS
|
||||||
|
ad14e811 tests/fuzzer/*: add missing <string_view> include
|
||||||
|
74cd026e fuzz_utils.cc: fix build error w/WEBP_REDUCE_SIZE
|
||||||
|
a027aa93 mux_demux_api_fuzzer.cc: fix -Wshadow warning
|
||||||
|
25e17c68 update ChangeLog (tag: v1.5.0-rc1)
|
||||||
|
aa2684fc update NEWS
|
||||||
|
36923846 bump version to 1.5.0
|
||||||
|
ceea8ff6 update AUTHORS
|
||||||
|
e4f7a9f0 img2webp: add a warning for unused options
|
||||||
|
1b4c967f Merge "Properly check the data size against the end of the RIFF chunk" into main
|
||||||
|
9e5ecfaf Properly check the data size against the end of the RIFF chunk
|
||||||
|
da0d9c7d examples: exit w/failure w/no args
|
||||||
|
fcff86c7 {gif,img}2webp: sync -m help w/cwebp
|
||||||
|
b76c4a84 man/img2webp.1: sync -m text w/cwebp.1 & gif2webp.1
|
||||||
|
30633519 muxread: fix reading of buffers > riff size
|
||||||
|
4c85d860 yuv.h: update RGB<->YUV coefficients in comment
|
||||||
|
0ab789e0 Merge changes I6dfedfd5,I2376e2dc into main
|
||||||
|
03236450 {ios,xcframework}build.sh: fix compilation w/Xcode 16
|
||||||
|
61e2cfda rework AddVectorEq_SSE2
|
||||||
|
7bda3deb rework AddVector_SSE2
|
||||||
|
2ddaaf0a Fix variable names in SharpYuvComputeConversionMatrix
|
||||||
|
a3ba6f19 Makefile.vc: fix gif2webp link error
|
||||||
|
f999d94f gif2webp: add -sharp_yuv/-near_lossless
|
||||||
|
dfdcb7f9 Merge "lossless.h: fix function declaration mismatches" into main (tag: webp-rfc9649)
|
||||||
|
78ed6839 fix overread in Intra4Preds_NEON
|
||||||
|
d516a68e lossless.h: fix function declaration mismatches
|
||||||
|
87406904 Merge "Improve documentation of SharpYuvConversionMatrix." into main
|
||||||
|
fdb229ea Merge changes I07a7e36a,Ib29980f7,I2316122d,I2356e314,I32b53dd3, ... into main
|
||||||
|
0c3cd9cc Improve documentation of SharpYuvConversionMatrix.
|
||||||
|
169dfbf9 disable Intra4Preds_NEON
|
||||||
|
2dd5eb98 dsp/yuv*: use WEBP_RESTRICT qualifier
|
||||||
|
23bbafbe dsp/upsampling*: use WEBP_RESTRICT qualifier
|
||||||
|
35915b38 dsp/rescaler*: use WEBP_RESTRICT qualifier
|
||||||
|
a32b436b dsp/lossless*: use WEBP_RESTRICT qualifier
|
||||||
|
04d4b4f3 dsp/filters*: use WEBP_RESTRICT qualifier
|
||||||
|
b1cb37e6 dsp/enc*: use WEBP_RESTRICT qualifier
|
||||||
|
201894ef dsp/dec*: use WEBP_RESTRICT qualifier
|
||||||
|
02eac8a7 dsp/cost*: use WEBP_RESTRICT qualifier
|
||||||
|
84b118c9 Merge "webp-container-spec: normalize notes & unknown chunk link" into main
|
||||||
|
052cf42f webp-container-spec: normalize notes & unknown chunk link
|
||||||
|
220ee529 Search for best predictor transform bits
|
||||||
|
78619478 Try to reduce the sampling for the entropy image
|
||||||
|
14f09ab7 webp-container-spec: reorder chunk size - N text
|
||||||
|
a78c5356 Remove a useless malloc for entropy image
|
||||||
|
bc491763 Merge "Refactor predictor finding" into main
|
||||||
|
34f92238 man/{cwebp,img2webp}.1: rm 'if needed' from -sharp_yuv
|
||||||
|
367ca938 Refactor predictor finding
|
||||||
|
a582b53b webp-lossless-bitstream-spec: clarify some text
|
||||||
|
0fd25d84 Merge "anim_encode.c: fix function ref in comment" into main
|
||||||
|
f8882913 anim_encode.c: fix function ref in comment
|
||||||
|
40e4ca60 specs_generation.md: update kramdown command line
|
||||||
|
57883c78 img2webp: add -exact/-noexact per-frame options
|
||||||
|
1c8eba97 img2webp,cosmetics: add missing '.' spacers to help
|
||||||
|
2e81017c Convert predictor_enc.c to fixed point
|
||||||
|
94de6c7f Merge "Fix fuzztest link errors w/-DBUILD_SHARED_LIBS=1" into main
|
||||||
|
51d9832a Fix fuzztest link errors w/-DBUILD_SHARED_LIBS=1
|
||||||
|
7bcb36b8 Merge "Fix static overflow warning." into main
|
||||||
|
8e0cc14c Fix static overflow warning.
|
||||||
|
cea68462 README.md: add security report note
|
||||||
|
615e5874 Merge "make VP8LPredictor[01]_C() static" into main
|
||||||
|
233e86b9 Merge changes Ie43dc5ef,I94cd8bab into main
|
||||||
|
1a29fd2f make VP8LPredictor[01]_C() static
|
||||||
|
dd9d3770 Do*Filter_*: remove row & num_rows parameters
|
||||||
|
ab451a49 Do*Filter_C: remove dead 'inverse' code paths
|
||||||
|
f9a480f7 {TrueMotion,TM16}_NEON: remove zero extension
|
||||||
|
04834aca Merge changes I25c30a9e,I0a192fc6,I4cf89575 into main
|
||||||
|
39a602af webp-lossless-bitstream-spec: normalize predictor transform ref
|
||||||
|
f28c837d Merge "webp-container-spec: align anim pseudocode w/prose" into main
|
||||||
|
74be8e22 Fix implicit conversion issues
|
||||||
|
0c01db7c Merge "Increase the transform bits if possible." into main
|
||||||
|
f2d6dc1e Increase the transform bits if possible.
|
||||||
|
caa19e5b update link to issue tracker
|
||||||
|
c9dd9bd4 webp-container-spec: align anim pseudocode w/prose
|
||||||
|
8a7c8dc6 WASM: Enable VP8L_USE_FAST_LOAD
|
||||||
|
f0c53cd9 WASM: don't use USE_GENERIC_TREE
|
||||||
|
eef903d0 WASM: Enable 64-bit BITS caching
|
||||||
|
6296cc8d iterator_enc: make VP8IteratorReset() static
|
||||||
|
fbd93896 histogram_enc: make VP8LGetHistogramSize static
|
||||||
|
cc7ff545 cost_enc: make VP8CalculateLevelCosts[] static
|
||||||
|
4e2828ba vp8l_dec: make VP8LClear() static
|
||||||
|
d742b24a Intra16Preds_NEON: fix truemotion saturation
|
||||||
|
c7bb4cb5 Intra4Preds_NEON: fix truemotion saturation
|
||||||
|
952a989b Merge "Remove TODO now that log is using fixed point." into main
|
||||||
|
dde11574 Remove TODO now that log is using fixed point.
|
||||||
|
a1ca153d Fix hidden myerr in my_error_exit
|
||||||
|
3bd94202 Merge changes Iff6e47ed,I24c67cd5,Id781e761 into main
|
||||||
|
d27d246e Merge "Convert VP8LFastSLog2 to fixed point" into main
|
||||||
|
4838611f Disable msg_code use in fuzzing mode
|
||||||
|
314a142a Use QuantizeBlock_NEON for VP8EncQuantizeBlockWHT on Arm
|
||||||
|
3bfb05e3 Add AArch64 Neon implementation of Intra16Preds
|
||||||
|
baa93808 Add AArch64 Neon implementation of Intra4Preds
|
||||||
|
41a5e582 Fix errors when compiling code as C++
|
||||||
|
fb444b69 Convert VP8LFastSLog2 to fixed point
|
||||||
|
c1c89f51 Fix WEBP_NODISCARD comment and C++ version
|
||||||
|
66408c2c Switch the histogram_enc.h API to fixed point
|
||||||
|
ac1e410d Remove leftover tiff dep
|
||||||
|
b78d3957 Disable TIFF on fuzztest.
|
||||||
|
cff21a7d Do not build statically on oss-fuzz.
|
||||||
|
6853a8e5 Merge "Move more internal fuzzers to public." into main
|
||||||
|
9bc09db4 Merge "Convert VP8LFastLog2 to fixed point" into main
|
||||||
|
0a9f1c19 Convert VP8LFastLog2 to fixed point
|
||||||
|
db0cb9c2 Move more internal fuzzers to public.
|
||||||
|
ff2b5b15 Merge "advanced_api_fuzzer.cc: use crop dims in OOM check" into main
|
||||||
|
c4af79d0 Put 0 at the end of a palette and do not store it.
|
||||||
|
0ec80aef Delete last references to delta palettization
|
||||||
|
96d79f84 advanced_api_fuzzer.cc: use crop dims in OOM check
|
||||||
|
c35c7e02 Fix huffman fuzzer to not leak.
|
||||||
|
f2fe8dec Bump fuzztest dependency.
|
||||||
|
9ce982fd Fix fuzz tests to work on oss-fuzz
|
||||||
|
3ba8af1a Do not escape quotes anymore in build.sh
|
||||||
|
ea0e121b Allow centipede to be used as a fuzzing engine.
|
||||||
|
27731afd make VP8I4ModeOffsets & VP8MakeIntra4Preds static
|
||||||
|
ddd6245e oss-fuzz/build.sh: use heredoc for script creation
|
||||||
|
50074930 oss-fuzz/build.sh,cosmetics: fix indent
|
||||||
|
20e92f7d Limit the possible fuzz engines.
|
||||||
|
4f200de5 Switch public fuzz tests to fuzztest.
|
||||||
|
64186bb3 Add huffman_fuzzer to .gitignore
|
||||||
|
0905f61c Move build script from oss-fuzz repo to here.
|
||||||
|
e8678758 Fix link to Javascript documentation
|
||||||
|
5e5b8f0c Fix SSE2 Transform_AC3 function name
|
||||||
|
45129ee0 Revert "Check all the rows."
|
||||||
|
ee26766a Check all the rows.
|
||||||
|
7ec51c59 Increase the transform bits if possible.
|
||||||
|
3cd16fd3 Revert "Increase the transform bits if possible."
|
||||||
|
971a03d8 Increase the transform bits if possible.
|
||||||
|
1bf198a2 Allow transform_bits to be different during encoding.
|
||||||
|
1e462ca8 Define MAX_TRANSFORM_BITS according to the specification.
|
||||||
|
64d1ec23 Use (MIN/NUM)_(TRANSFORM/HUFFMAN)_BITS where appropriate
|
||||||
|
a90160e1 Refactor histograms in predictors.
|
||||||
|
a7aa7525 Fix some function declarations
|
||||||
|
68ff4e1e Merge "jpegdec: add a hint for EOF/READ errors" into main
|
||||||
|
79e7968a jpegdec: add a hint for EOF/READ errors
|
||||||
|
d33455cd man/*: s/BUGS/REPORTING BUGS/
|
||||||
|
a67ff735 normalize example exit status
|
||||||
|
edc28909 upsampling_{neon,sse41}: fix int sanitizer warning
|
||||||
|
3cada4ce ImgIoUtilReadFile: check ftell() return
|
||||||
|
dc950585 Merge tag 'v1.4.0'
|
||||||
|
845d5476 update ChangeLog (tag: v1.4.0, origin/1.4.0)
|
||||||
8a6a55bb update NEWS
|
8a6a55bb update NEWS
|
||||||
cf7c5a5d provide a way to opt-out/override WEBP_NODISCARD
|
cf7c5a5d provide a way to opt-out/override WEBP_NODISCARD
|
||||||
cc34288a update ChangeLog (tag: v1.4.0-rc1)
|
cc34288a update ChangeLog (tag: v1.4.0-rc1)
|
||||||
|
@ -393,7 +393,7 @@ $(DIRBIN)\dwebp.exe: $(IMAGEIO_UTIL_OBJS)
|
|||||||
$(DIRBIN)\dwebp.exe: $(LIBWEBPDEMUX)
|
$(DIRBIN)\dwebp.exe: $(LIBWEBPDEMUX)
|
||||||
$(DIRBIN)\gif2webp.exe: $(DIROBJ)\examples\gif2webp.obj $(EX_GIF_DEC_OBJS)
|
$(DIRBIN)\gif2webp.exe: $(DIROBJ)\examples\gif2webp.obj $(EX_GIF_DEC_OBJS)
|
||||||
$(DIRBIN)\gif2webp.exe: $(EX_UTIL_OBJS) $(IMAGEIO_UTIL_OBJS) $(LIBWEBPMUX)
|
$(DIRBIN)\gif2webp.exe: $(EX_UTIL_OBJS) $(IMAGEIO_UTIL_OBJS) $(LIBWEBPMUX)
|
||||||
$(DIRBIN)\gif2webp.exe: $(LIBWEBP)
|
$(DIRBIN)\gif2webp.exe: $(LIBWEBP) $(LIBSHARPYUV)
|
||||||
$(DIRBIN)\vwebp.exe: $(DIROBJ)\examples\vwebp.obj $(EX_UTIL_OBJS)
|
$(DIRBIN)\vwebp.exe: $(DIROBJ)\examples\vwebp.obj $(EX_UTIL_OBJS)
|
||||||
$(DIRBIN)\vwebp.exe: $(IMAGEIO_UTIL_OBJS) $(LIBWEBPDEMUX) $(LIBWEBP)
|
$(DIRBIN)\vwebp.exe: $(IMAGEIO_UTIL_OBJS) $(LIBWEBPDEMUX) $(LIBWEBP)
|
||||||
$(DIRBIN)\vwebp_sdl.exe: $(DIROBJ)\extras\vwebp_sdl.obj
|
$(DIRBIN)\vwebp_sdl.exe: $(DIROBJ)\extras\vwebp_sdl.obj
|
||||||
|
22
NEWS
22
NEWS
@ -1,3 +1,25 @@
|
|||||||
|
- 12/19/2024 version 1.5.0
|
||||||
|
This is a binary compatible release.
|
||||||
|
API changes:
|
||||||
|
- `cross_color_transform_bits` added to WebPAuxStats
|
||||||
|
* minor lossless encoder speed and compression improvements
|
||||||
|
* lossless encoding does not use floats anymore
|
||||||
|
* additional Arm optimizations for lossy & lossless + general code generation
|
||||||
|
improvements
|
||||||
|
* improvements to WASM performance (#643)
|
||||||
|
* improvements and corrections in webp-container-spec.txt and
|
||||||
|
webp-lossless-bitstream-spec.txt (#646, #355607636)
|
||||||
|
* further security related hardening and increased fuzzing coverage w/fuzztest
|
||||||
|
(oss-fuzz: #382816119, #70112, #70102, #69873, #69825, #69508, #69208)
|
||||||
|
* miscellaneous warning, bug & build fixes (#499, #562, #381372617,
|
||||||
|
#381109771, #42340561, #375011696, #372109644, chromium: #334120888)
|
||||||
|
Tool updates:
|
||||||
|
* gif2webp: add -sharp_yuv & -near_lossless
|
||||||
|
* img2webp: add -exact & -noexact
|
||||||
|
* exit codes normalized; running an example program with no
|
||||||
|
arguments will output its help and exit with an error (#42340557,
|
||||||
|
#381372617)
|
||||||
|
|
||||||
- 4/12/2024: version 1.4.0
|
- 4/12/2024: version 1.4.0
|
||||||
This is a binary compatible release.
|
This is a binary compatible release.
|
||||||
* API changes:
|
* API changes:
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
\__\__/\____/\_____/__/ ____ ___
|
\__\__/\____/\_____/__/ ____ ___
|
||||||
/ _/ / \ \ / _ \/ _/
|
/ _/ / \ \ / _ \/ _/
|
||||||
/ \_/ / / \ \ __/ \__
|
/ \_/ / / \ \ __/ \__
|
||||||
\____/____/\_____/_____/____/v1.4.0
|
\____/____/\_____/_____/____/v1.5.0
|
||||||
```
|
```
|
||||||
|
|
||||||
WebP codec is a library to encode and decode images in WebP format. This package
|
WebP codec is a library to encode and decode images in WebP format. This package
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
AC_INIT([libwebp], [1.4.0],
|
AC_INIT([libwebp], [1.5.0],
|
||||||
[https://issues.webmproject.org],,
|
[https://issues.webmproject.org],,
|
||||||
[https://developers.google.com/speed/webp])
|
[https://developers.google.com/speed/webp])
|
||||||
AC_CANONICAL_HOST
|
AC_CANONICAL_HOST
|
||||||
|
@ -324,7 +324,7 @@ Per-frame options (only used for subsequent images input):
|
|||||||
-lossless ............ use lossless mode (default)
|
-lossless ............ use lossless mode (default)
|
||||||
-lossy ............... use lossy mode
|
-lossy ............... use lossy mode
|
||||||
-q <float> ........... quality
|
-q <float> ........... quality
|
||||||
-m <int> ............. method to use
|
-m <int> ............. compression method (0=fast, 6=slowest), default=4
|
||||||
-exact, -noexact ..... preserve or alter RGB values in transparent area
|
-exact, -noexact ..... preserve or alter RGB values in transparent area
|
||||||
(default: -noexact, may cause artifacts
|
(default: -noexact, may cause artifacts
|
||||||
with lossy animations)
|
with lossy animations)
|
||||||
@ -354,8 +354,12 @@ Options:
|
|||||||
-lossy ................. encode image using lossy compression
|
-lossy ................. encode image using lossy compression
|
||||||
-mixed ................. for each frame in the image, pick lossy
|
-mixed ................. for each frame in the image, pick lossy
|
||||||
or lossless compression heuristically
|
or lossless compression heuristically
|
||||||
|
-near_lossless <int> ... use near-lossless image preprocessing
|
||||||
|
(0..100=off), default=100
|
||||||
|
-sharp_yuv ............. use sharper (and slower) RGB->YUV conversion
|
||||||
|
(lossy only)
|
||||||
-q <float> ............. quality factor (0:small..100:big)
|
-q <float> ............. quality factor (0:small..100:big)
|
||||||
-m <int> ............... compression method (0=fast, 6=slowest)
|
-m <int> ............... compression method (0=fast, 6=slowest), default=4
|
||||||
-min_size .............. minimize output size (default:off)
|
-min_size .............. minimize output size (default:off)
|
||||||
lossless compression by default; can be
|
lossless compression by default; can be
|
||||||
combined with -q, -m, -lossy or -mixed
|
combined with -q, -m, -lossy or -mixed
|
||||||
|
@ -67,7 +67,7 @@ dwebp_LDADD += ../src/libwebp.la
|
|||||||
dwebp_LDADD +=$(PNG_LIBS) $(JPEG_LIBS)
|
dwebp_LDADD +=$(PNG_LIBS) $(JPEG_LIBS)
|
||||||
|
|
||||||
gif2webp_SOURCES = gif2webp.c gifdec.c gifdec.h
|
gif2webp_SOURCES = gif2webp.c gifdec.c gifdec.h
|
||||||
gif2webp_CPPFLAGS = $(AM_CPPFLAGS) $(GIF_INCLUDES)
|
gif2webp_CPPFLAGS = $(AM_CPPFLAGS) $(GIF_INCLUDES) -I$(top_srcdir)
|
||||||
gif2webp_LDADD =
|
gif2webp_LDADD =
|
||||||
gif2webp_LDADD += libexample_util.la
|
gif2webp_LDADD += libexample_util.la
|
||||||
gif2webp_LDADD += ../imageio/libimageio_util.la
|
gif2webp_LDADD += ../imageio/libimageio_util.la
|
||||||
|
@ -771,6 +771,7 @@ void GetDiffAndPSNR(const uint8_t rgba1[], const uint8_t rgba2[],
|
|||||||
*psnr = 99.; // PSNR when images are identical.
|
*psnr = 99.; // PSNR when images are identical.
|
||||||
} else {
|
} else {
|
||||||
sse /= stride * height;
|
sse /= stride * height;
|
||||||
|
assert(sse != 0.0);
|
||||||
*psnr = 4.3429448 * log(255. * 255. / sse);
|
*psnr = 4.3429448 * log(255. * 255. / sse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -698,7 +698,7 @@ int main(int argc, const char* argv[]) {
|
|||||||
|
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
HelpShort();
|
HelpShort();
|
||||||
FREE_WARGV_AND_RETURN(EXIT_SUCCESS);
|
FREE_WARGV_AND_RETURN(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (c = 1; c < argc; ++c) {
|
for (c = 1; c < argc; ++c) {
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <gif_lib.h>
|
#include <gif_lib.h>
|
||||||
|
#include "sharpyuv/sharpyuv.h"
|
||||||
#include "webp/encode.h"
|
#include "webp/encode.h"
|
||||||
#include "webp/mux.h"
|
#include "webp/mux.h"
|
||||||
#include "../examples/example_util.h"
|
#include "../examples/example_util.h"
|
||||||
@ -70,8 +71,14 @@ static void Help(void) {
|
|||||||
printf(" -lossy ................. encode image using lossy compression\n");
|
printf(" -lossy ................. encode image using lossy compression\n");
|
||||||
printf(" -mixed ................. for each frame in the image, pick lossy\n"
|
printf(" -mixed ................. for each frame in the image, pick lossy\n"
|
||||||
" or lossless compression heuristically\n");
|
" or lossless compression heuristically\n");
|
||||||
|
printf(" -near_lossless <int> ... use near-lossless image preprocessing\n"
|
||||||
|
" (0..100=off), default=100\n");
|
||||||
|
printf(" -sharp_yuv ............. use sharper (and slower) RGB->YUV "
|
||||||
|
"conversion\n"
|
||||||
|
" (lossy only)\n");
|
||||||
printf(" -q <float> ............. quality factor (0:small..100:big)\n");
|
printf(" -q <float> ............. quality factor (0:small..100:big)\n");
|
||||||
printf(" -m <int> ............... compression method (0=fast, 6=slowest)\n");
|
printf(" -m <int> ............... compression method (0=fast, 6=slowest), "
|
||||||
|
"default=4\n");
|
||||||
printf(" -min_size .............. minimize output size (default:off)\n"
|
printf(" -min_size .............. minimize output size (default:off)\n"
|
||||||
" lossless compression by default; can be\n"
|
" lossless compression by default; can be\n"
|
||||||
" combined with -q, -m, -lossy or -mixed\n"
|
" combined with -q, -m, -lossy or -mixed\n"
|
||||||
@ -151,7 +158,7 @@ int main(int argc, const char* argv[]) {
|
|||||||
|
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
Help();
|
Help();
|
||||||
FREE_WARGV_AND_RETURN(EXIT_SUCCESS);
|
FREE_WARGV_AND_RETURN(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (c = 1; c < argc; ++c) {
|
for (c = 1; c < argc; ++c) {
|
||||||
@ -166,6 +173,10 @@ int main(int argc, const char* argv[]) {
|
|||||||
} else if (!strcmp(argv[c], "-mixed")) {
|
} else if (!strcmp(argv[c], "-mixed")) {
|
||||||
enc_options.allow_mixed = 1;
|
enc_options.allow_mixed = 1;
|
||||||
config.lossless = 0;
|
config.lossless = 0;
|
||||||
|
} else if (!strcmp(argv[c], "-near_lossless") && c < argc - 1) {
|
||||||
|
config.near_lossless = ExUtilGetInt(argv[++c], 0, &parse_error);
|
||||||
|
} else if (!strcmp(argv[c], "-sharp_yuv")) {
|
||||||
|
config.use_sharp_yuv = 1;
|
||||||
} else if (!strcmp(argv[c], "-loop_compatibility")) {
|
} else if (!strcmp(argv[c], "-loop_compatibility")) {
|
||||||
loop_compatibility = 1;
|
loop_compatibility = 1;
|
||||||
} else if (!strcmp(argv[c], "-q") && c < argc - 1) {
|
} else if (!strcmp(argv[c], "-q") && c < argc - 1) {
|
||||||
@ -226,10 +237,13 @@ int main(int argc, const char* argv[]) {
|
|||||||
} else if (!strcmp(argv[c], "-version")) {
|
} else if (!strcmp(argv[c], "-version")) {
|
||||||
const int enc_version = WebPGetEncoderVersion();
|
const int enc_version = WebPGetEncoderVersion();
|
||||||
const int mux_version = WebPGetMuxVersion();
|
const int mux_version = WebPGetMuxVersion();
|
||||||
|
const int sharpyuv_version = SharpYuvGetVersion();
|
||||||
printf("WebP Encoder version: %d.%d.%d\nWebP Mux version: %d.%d.%d\n",
|
printf("WebP Encoder version: %d.%d.%d\nWebP Mux version: %d.%d.%d\n",
|
||||||
(enc_version >> 16) & 0xff, (enc_version >> 8) & 0xff,
|
(enc_version >> 16) & 0xff, (enc_version >> 8) & 0xff,
|
||||||
enc_version & 0xff, (mux_version >> 16) & 0xff,
|
enc_version & 0xff, (mux_version >> 16) & 0xff,
|
||||||
(mux_version >> 8) & 0xff, mux_version & 0xff);
|
(mux_version >> 8) & 0xff, mux_version & 0xff);
|
||||||
|
printf("libsharpyuv: %d.%d.%d\n", (sharpyuv_version >> 24) & 0xff,
|
||||||
|
(sharpyuv_version >> 16) & 0xffff, sharpyuv_version & 0xff);
|
||||||
FREE_WARGV_AND_RETURN(EXIT_SUCCESS);
|
FREE_WARGV_AND_RETURN(EXIT_SUCCESS);
|
||||||
} else if (!strcmp(argv[c], "-quiet")) {
|
} else if (!strcmp(argv[c], "-quiet")) {
|
||||||
quiet = 1;
|
quiet = 1;
|
||||||
|
@ -62,7 +62,8 @@ static void Help(void) {
|
|||||||
printf(" -lossless ............ use lossless mode (default)\n");
|
printf(" -lossless ............ use lossless mode (default)\n");
|
||||||
printf(" -lossy ............... use lossy mode\n");
|
printf(" -lossy ............... use lossy mode\n");
|
||||||
printf(" -q <float> ........... quality\n");
|
printf(" -q <float> ........... quality\n");
|
||||||
printf(" -m <int> ............. method to use\n");
|
printf(" -m <int> ............. compression method (0=fast, 6=slowest), "
|
||||||
|
"default=4\n");
|
||||||
printf(" -exact, -noexact ..... preserve or alter RGB values in transparent "
|
printf(" -exact, -noexact ..... preserve or alter RGB values in transparent "
|
||||||
"area\n"
|
"area\n"
|
||||||
" (default: -noexact, may cause artifacts\n"
|
" (default: -noexact, may cause artifacts\n"
|
||||||
@ -150,6 +151,7 @@ int main(int argc, const char* argv[]) {
|
|||||||
WebPData webp_data;
|
WebPData webp_data;
|
||||||
int c;
|
int c;
|
||||||
int have_input = 0;
|
int have_input = 0;
|
||||||
|
int last_input_index = 0;
|
||||||
CommandLineArguments cmd_args;
|
CommandLineArguments cmd_args;
|
||||||
int ok;
|
int ok;
|
||||||
|
|
||||||
@ -228,6 +230,8 @@ int main(int argc, const char* argv[]) {
|
|||||||
}
|
}
|
||||||
if (!have_input) {
|
if (!have_input) {
|
||||||
fprintf(stderr, "No input file(s) for generating animation!\n");
|
fprintf(stderr, "No input file(s) for generating animation!\n");
|
||||||
|
ok = 0;
|
||||||
|
Help();
|
||||||
goto End;
|
goto End;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -276,6 +280,7 @@ int main(int argc, const char* argv[]) {
|
|||||||
// read next input image
|
// read next input image
|
||||||
pic.use_argb = 1;
|
pic.use_argb = 1;
|
||||||
ok = ReadImage((const char*)GET_WARGV_SHIFTED(argv, c), &pic);
|
ok = ReadImage((const char*)GET_WARGV_SHIFTED(argv, c), &pic);
|
||||||
|
last_input_index = c;
|
||||||
if (!ok) goto End;
|
if (!ok) goto End;
|
||||||
|
|
||||||
if (enc == NULL) {
|
if (enc == NULL) {
|
||||||
@ -314,6 +319,13 @@ int main(int argc, const char* argv[]) {
|
|||||||
++pic_num;
|
++pic_num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (c = last_input_index + 1; c < argc; ++c) {
|
||||||
|
if (argv[c] != NULL) {
|
||||||
|
fprintf(stderr, "Warning: unused option [%s]!"
|
||||||
|
" Frame options go before the input frame.\n", argv[c]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// add a last fake frame to signal the last duration
|
// add a last fake frame to signal the last duration
|
||||||
ok = ok && WebPAnimEncoderAdd(enc, NULL, timestamp_ms, NULL);
|
ok = ok && WebPAnimEncoderAdd(enc, NULL, timestamp_ms, NULL);
|
||||||
ok = ok && WebPAnimEncoderAssemble(enc, &webp_data);
|
ok = ok && WebPAnimEncoderAssemble(enc, &webp_data);
|
||||||
|
@ -568,7 +568,7 @@ int main(int argc, char* argv[]) {
|
|||||||
if (kParams.file_name == NULL) {
|
if (kParams.file_name == NULL) {
|
||||||
printf("missing input file!!\n");
|
printf("missing input file!!\n");
|
||||||
Help();
|
Help();
|
||||||
FREE_WARGV_AND_RETURN(EXIT_SUCCESS);
|
FREE_WARGV_AND_RETURN(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ImgIoUtilReadFile(kParams.file_name,
|
if (!ImgIoUtilReadFile(kParams.file_name,
|
||||||
|
@ -1132,7 +1132,7 @@ int main(int argc, const char* argv[]) {
|
|||||||
|
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
Help();
|
Help();
|
||||||
FREE_WARGV_AND_RETURN(EXIT_SUCCESS);
|
FREE_WARGV_AND_RETURN(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse command-line input.
|
// Parse command-line input.
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include "webp/types.h"
|
#include "webp/types.h"
|
||||||
|
|
||||||
#define XTRA_MAJ_VERSION 1
|
#define XTRA_MAJ_VERSION 1
|
||||||
#define XTRA_MIN_VERSION 4
|
#define XTRA_MIN_VERSION 5
|
||||||
#define XTRA_REV_VERSION 0
|
#define XTRA_REV_VERSION 0
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
@ -57,6 +57,12 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
INIT_WARGV(argc, argv);
|
INIT_WARGV(argc, argv);
|
||||||
|
|
||||||
|
if (argc == 1) {
|
||||||
|
fprintf(stderr, "Usage: %s [-h] image.webp [more_files.webp...]\n",
|
||||||
|
argv[0]);
|
||||||
|
goto Error;
|
||||||
|
}
|
||||||
|
|
||||||
for (c = 1; c < argc; ++c) {
|
for (c = 1; c < argc; ++c) {
|
||||||
const char* file = NULL;
|
const char* file = NULL;
|
||||||
const uint8_t* webp = NULL;
|
const uint8_t* webp = NULL;
|
||||||
|
@ -139,6 +139,8 @@ static const struct {
|
|||||||
{ "Raw profile type xmp", ProcessRawProfile, METADATA_OFFSET(xmp) },
|
{ "Raw profile type xmp", ProcessRawProfile, METADATA_OFFSET(xmp) },
|
||||||
// Exiftool puts exif data in APP1 chunk, too.
|
// Exiftool puts exif data in APP1 chunk, too.
|
||||||
{ "Raw profile type APP1", ProcessRawProfile, METADATA_OFFSET(exif) },
|
{ "Raw profile type APP1", ProcessRawProfile, METADATA_OFFSET(exif) },
|
||||||
|
// ImageMagick uses lowercase app1.
|
||||||
|
{ "Raw profile type app1", ProcessRawProfile, METADATA_OFFSET(exif) },
|
||||||
// XMP Specification Part 3, Section 3 #PNG
|
// XMP Specification Part 3, Section 3 #PNG
|
||||||
{ "XML:com.adobe.xmp", MetadataCopy, METADATA_OFFSET(xmp) },
|
{ "XML:com.adobe.xmp", MetadataCopy, METADATA_OFFSET(xmp) },
|
||||||
{ NULL, NULL, 0 },
|
{ NULL, NULL, 0 },
|
||||||
@ -159,6 +161,20 @@ static int ExtractMetadataFromPNG(png_structp png,
|
|||||||
png_textp text = NULL;
|
png_textp text = NULL;
|
||||||
const png_uint_32 num = png_get_text(png, info, &text, NULL);
|
const png_uint_32 num = png_get_text(png, info, &text, NULL);
|
||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
|
|
||||||
|
#ifdef PNG_eXIf_SUPPORTED
|
||||||
|
// Look for an 'eXIf' tag. Preference is given to this tag as it's newer
|
||||||
|
// than the TextualData tags.
|
||||||
|
{
|
||||||
|
png_bytep exif;
|
||||||
|
png_uint_32 len;
|
||||||
|
|
||||||
|
if (png_get_eXIf_1(png, info, &len, &exif) == PNG_INFO_eXIf) {
|
||||||
|
if (!MetadataCopy((const char*)exif, len, &metadata->exif)) return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // PNG_eXIf_SUPPORTED
|
||||||
|
|
||||||
// Look for EXIF / XMP metadata.
|
// Look for EXIF / XMP metadata.
|
||||||
for (i = 0; i < num; ++i, ++text) {
|
for (i = 0; i < num; ++i, ++text) {
|
||||||
int j;
|
int j;
|
||||||
@ -192,6 +208,7 @@ static int ExtractMetadataFromPNG(png_structp png,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef PNG_iCCP_SUPPORTED
|
||||||
// Look for an ICC profile.
|
// Look for an ICC profile.
|
||||||
{
|
{
|
||||||
png_charp name;
|
png_charp name;
|
||||||
@ -208,6 +225,7 @@ static int ExtractMetadataFromPNG(png_structp png,
|
|||||||
if (!MetadataCopy((const char*)profile, len, &metadata->iccp)) return 0;
|
if (!MetadataCopy((const char*)profile, len, &metadata->iccp)) return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // PNG_iCCP_SUPPORTED
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ DEMUXLIBLIST=''
|
|||||||
if [[ -z "${SDK}" ]]; then
|
if [[ -z "${SDK}" ]]; then
|
||||||
echo "iOS SDK not available"
|
echo "iOS SDK not available"
|
||||||
exit 1
|
exit 1
|
||||||
elif [[ ${SDK%%.*} -gt 8 ]]; then
|
elif [[ ${SDK%%.*} -gt 8 && "${XCODE%%.*}" -lt 16 ]]; then
|
||||||
EXTRA_CFLAGS="-fembed-bitcode"
|
EXTRA_CFLAGS="-fembed-bitcode"
|
||||||
elif [[ ${SDK%%.*} -le 6 ]]; then
|
elif [[ ${SDK%%.*} -le 6 ]]; then
|
||||||
echo "You need iOS SDK version 6.0 or above"
|
echo "You need iOS SDK version 6.0 or above"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.\" Hey, EMACS: -*- nroff -*-
|
.\" Hey, EMACS: -*- nroff -*-
|
||||||
.TH GIF2WEBP 1 "July 18, 2024"
|
.TH GIF2WEBP 1 "November 4, 2024"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
gif2webp \- Convert a GIF image to WebP
|
gif2webp \- Convert a GIF image to WebP
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -39,6 +39,18 @@ Encode the image using lossy compression.
|
|||||||
Mixed compression mode: optimize compression of the image by picking either
|
Mixed compression mode: optimize compression of the image by picking either
|
||||||
lossy or lossless compression for each frame heuristically.
|
lossy or lossless compression for each frame heuristically.
|
||||||
.TP
|
.TP
|
||||||
|
.BI \-near_lossless " int
|
||||||
|
Specify the level of near\-lossless image preprocessing. This option adjusts
|
||||||
|
pixel values to help compressibility, but has minimal impact on the visual
|
||||||
|
quality. It triggers lossless compression mode automatically. The range is 0
|
||||||
|
(maximum preprocessing) to 100 (no preprocessing, the default). The typical
|
||||||
|
value is around 60. Note that lossy with \fB\-q 100\fP can at times yield
|
||||||
|
better results.
|
||||||
|
.TP
|
||||||
|
.B \-sharp_yuv
|
||||||
|
Use more accurate and sharper RGB->YUV conversion. Note that this process is
|
||||||
|
slower than the default 'fast' RGB->YUV conversion.
|
||||||
|
.TP
|
||||||
.BI \-q " float
|
.BI \-q " float
|
||||||
Specify the compression factor for RGB channels between 0 and 100. The default
|
Specify the compression factor for RGB channels between 0 and 100. The default
|
||||||
is 75.
|
is 75.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.\" Hey, EMACS: -*- nroff -*-
|
.\" Hey, EMACS: -*- nroff -*-
|
||||||
.TH IMG2WEBP 1 "September 17, 2024"
|
.TH IMG2WEBP 1 "November 26, 2024"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
img2webp \- create animated WebP file from a sequence of input images.
|
img2webp \- create animated WebP file from a sequence of input images.
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -88,6 +88,10 @@ Specify the compression factor between 0 and 100. The default is 75.
|
|||||||
Specify the compression method to use. This parameter controls the
|
Specify the compression method to use. This parameter controls the
|
||||||
trade off between encoding speed and the compressed file size and quality.
|
trade off between encoding speed and the compressed file size and quality.
|
||||||
Possible values range from 0 to 6. Default value is 4.
|
Possible values range from 0 to 6. Default value is 4.
|
||||||
|
When higher values are used, the encoder will spend more time inspecting
|
||||||
|
additional encoding possibilities and decide on the quality gain.
|
||||||
|
Lower value can result in faster processing time at the expense of
|
||||||
|
larger file size and lower compression quality.
|
||||||
.TP
|
.TP
|
||||||
.B \-exact, \-noexact
|
.B \-exact, \-noexact
|
||||||
Preserve or alter RGB values in transparent area. The default is
|
Preserve or alter RGB values in transparent area. The default is
|
||||||
|
@ -33,7 +33,7 @@ libsharpyuv_la_SOURCES += sharpyuv_gamma.c sharpyuv_gamma.h
|
|||||||
libsharpyuv_la_SOURCES += sharpyuv.c sharpyuv.h
|
libsharpyuv_la_SOURCES += sharpyuv.c sharpyuv.h
|
||||||
|
|
||||||
libsharpyuv_la_CPPFLAGS = $(AM_CPPFLAGS)
|
libsharpyuv_la_CPPFLAGS = $(AM_CPPFLAGS)
|
||||||
libsharpyuv_la_LDFLAGS = -no-undefined -version-info 1:0:1 -lm
|
libsharpyuv_la_LDFLAGS = -no-undefined -version-info 1:1:1 -lm
|
||||||
libsharpyuv_la_LIBADD =
|
libsharpyuv_la_LIBADD =
|
||||||
libsharpyuv_la_LIBADD += libsharpyuv_sse2.la
|
libsharpyuv_la_LIBADD += libsharpyuv_sse2.la
|
||||||
libsharpyuv_la_LIBADD += libsharpyuv_neon.la
|
libsharpyuv_la_LIBADD += libsharpyuv_neon.la
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 0,0,4,0
|
FILEVERSION 0,0,4,1
|
||||||
PRODUCTVERSION 0,0,4,0
|
PRODUCTVERSION 0,0,4,1
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
@ -24,12 +24,12 @@ BEGIN
|
|||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Google, Inc."
|
VALUE "CompanyName", "Google, Inc."
|
||||||
VALUE "FileDescription", "libsharpyuv DLL"
|
VALUE "FileDescription", "libsharpyuv DLL"
|
||||||
VALUE "FileVersion", "0.4.0"
|
VALUE "FileVersion", "0.4.1"
|
||||||
VALUE "InternalName", "libsharpyuv.dll"
|
VALUE "InternalName", "libsharpyuv.dll"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2024"
|
VALUE "LegalCopyright", "Copyright (C) 2024"
|
||||||
VALUE "OriginalFilename", "libsharpyuv.dll"
|
VALUE "OriginalFilename", "libsharpyuv.dll"
|
||||||
VALUE "ProductName", "SharpYuv Library"
|
VALUE "ProductName", "SharpYuv Library"
|
||||||
VALUE "ProductVersion", "0.4.0"
|
VALUE "ProductVersion", "0.4.1"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
@ -52,7 +52,7 @@ extern "C" {
|
|||||||
// SharpYUV API version following the convention from semver.org
|
// SharpYUV API version following the convention from semver.org
|
||||||
#define SHARPYUV_VERSION_MAJOR 0
|
#define SHARPYUV_VERSION_MAJOR 0
|
||||||
#define SHARPYUV_VERSION_MINOR 4
|
#define SHARPYUV_VERSION_MINOR 4
|
||||||
#define SHARPYUV_VERSION_PATCH 0
|
#define SHARPYUV_VERSION_PATCH 1
|
||||||
// Version as a uint32_t. The major number is the high 8 bits.
|
// Version as a uint32_t. The major number is the high 8 bits.
|
||||||
// The minor number is the middle 8 bits. The patch number is the low 16 bits.
|
// The minor number is the middle 8 bits. The patch number is the low 16 bits.
|
||||||
#define SHARPYUV_MAKE_VERSION(MAJOR, MINOR, PATCH) \
|
#define SHARPYUV_MAKE_VERSION(MAJOR, MINOR, PATCH) \
|
||||||
|
@ -22,16 +22,16 @@ void SharpYuvComputeConversionMatrix(const SharpYuvColorSpace* yuv_color_space,
|
|||||||
const float kr = yuv_color_space->kr;
|
const float kr = yuv_color_space->kr;
|
||||||
const float kb = yuv_color_space->kb;
|
const float kb = yuv_color_space->kb;
|
||||||
const float kg = 1.0f - kr - kb;
|
const float kg = 1.0f - kr - kb;
|
||||||
const float cr = 0.5f / (1.0f - kb);
|
const float cb = 0.5f / (1.0f - kb);
|
||||||
const float cb = 0.5f / (1.0f - kr);
|
const float cr = 0.5f / (1.0f - kr);
|
||||||
|
|
||||||
const int shift = yuv_color_space->bit_depth - 8;
|
const int shift = yuv_color_space->bit_depth - 8;
|
||||||
|
|
||||||
const float denom = (float)((1 << yuv_color_space->bit_depth) - 1);
|
const float denom = (float)((1 << yuv_color_space->bit_depth) - 1);
|
||||||
float scale_y = 1.0f;
|
float scale_y = 1.0f;
|
||||||
float add_y = 0.0f;
|
float add_y = 0.0f;
|
||||||
float scale_u = cr;
|
float scale_u = cb;
|
||||||
float scale_v = cb;
|
float scale_v = cr;
|
||||||
float add_uv = (float)(128 << shift);
|
float add_uv = (float)(128 << shift);
|
||||||
assert(yuv_color_space->bit_depth >= 8);
|
assert(yuv_color_space->bit_depth >= 8);
|
||||||
|
|
||||||
@ -60,6 +60,10 @@ void SharpYuvComputeConversionMatrix(const SharpYuvColorSpace* yuv_color_space,
|
|||||||
|
|
||||||
// Matrices are in YUV_FIX fixed point precision.
|
// Matrices are in YUV_FIX fixed point precision.
|
||||||
// WebP's matrix, similar but not identical to kRec601LimitedMatrix
|
// WebP's matrix, similar but not identical to kRec601LimitedMatrix
|
||||||
|
// Derived using the following formulas:
|
||||||
|
// Y = 0.2569 * R + 0.5044 * G + 0.0979 * B + 16
|
||||||
|
// U = -0.1483 * R - 0.2911 * G + 0.4394 * B + 128
|
||||||
|
// V = 0.4394 * R - 0.3679 * G - 0.0715 * B + 128
|
||||||
static const SharpYuvConversionMatrix kWebpMatrix = {
|
static const SharpYuvConversionMatrix kWebpMatrix = {
|
||||||
{16839, 33059, 6420, 16 << 16},
|
{16839, 33059, 6420, 16 << 16},
|
||||||
{-9719, -19081, 28800, 128 << 16},
|
{-9719, -19081, 28800, 128 << 16},
|
||||||
|
@ -36,7 +36,7 @@ libwebp_la_LIBADD += utils/libwebputils.la
|
|||||||
# other than the ones listed on the command line, i.e., after linking, it will
|
# other than the ones listed on the command line, i.e., after linking, it will
|
||||||
# not have unresolved symbols. Some platforms (Windows among them) require all
|
# not have unresolved symbols. Some platforms (Windows among them) require all
|
||||||
# symbols in shared libraries to be resolved at library creation.
|
# symbols in shared libraries to be resolved at library creation.
|
||||||
libwebp_la_LDFLAGS = -no-undefined -version-info 8:9:1
|
libwebp_la_LDFLAGS = -no-undefined -version-info 8:10:1
|
||||||
libwebpincludedir = $(includedir)/webp
|
libwebpincludedir = $(includedir)/webp
|
||||||
pkgconfig_DATA = libwebp.pc
|
pkgconfig_DATA = libwebp.pc
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ if BUILD_LIBWEBPDECODER
|
|||||||
libwebpdecoder_la_LIBADD += dsp/libwebpdspdecode.la
|
libwebpdecoder_la_LIBADD += dsp/libwebpdspdecode.la
|
||||||
libwebpdecoder_la_LIBADD += utils/libwebputilsdecode.la
|
libwebpdecoder_la_LIBADD += utils/libwebputilsdecode.la
|
||||||
|
|
||||||
libwebpdecoder_la_LDFLAGS = -no-undefined -version-info 4:9:1
|
libwebpdecoder_la_LDFLAGS = -no-undefined -version-info 4:10:1
|
||||||
pkgconfig_DATA += libwebpdecoder.pc
|
pkgconfig_DATA += libwebpdecoder.pc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -26,10 +26,9 @@ static const uint8_t kModeBpp[MODE_LAST] = {
|
|||||||
4, 4, 4, 2, // pre-multiplied modes
|
4, 4, 4, 2, // pre-multiplied modes
|
||||||
1, 1 };
|
1, 1 };
|
||||||
|
|
||||||
// Check that webp_csp_mode is within the bounds of WEBP_CSP_MODE.
|
|
||||||
// Convert to an integer to handle both the unsigned/signed enum cases
|
// Convert to an integer to handle both the unsigned/signed enum cases
|
||||||
// without the need for casting to remove type limit warnings.
|
// without the need for casting to remove type limit warnings.
|
||||||
static int IsValidColorspace(int webp_csp_mode) {
|
int IsValidColorspace(int webp_csp_mode) {
|
||||||
return (webp_csp_mode >= MODE_RGB && webp_csp_mode < MODE_LAST);
|
return (webp_csp_mode >= MODE_RGB && webp_csp_mode < MODE_LAST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,4 +51,7 @@ enum { MB_FEATURE_TREE_PROBS = 3,
|
|||||||
NUM_PROBAS = 11
|
NUM_PROBAS = 11
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Check that webp_csp_mode is within the bounds of WEBP_CSP_MODE.
|
||||||
|
int IsValidColorspace(int webp_csp_mode);
|
||||||
|
|
||||||
#endif // WEBP_DEC_COMMON_DEC_H_
|
#endif // WEBP_DEC_COMMON_DEC_H_
|
||||||
|
@ -12,7 +12,9 @@
|
|||||||
// Author: Skal (pascal.massimino@gmail.com)
|
// Author: Skal (pascal.massimino@gmail.com)
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "src/dec/vp8i_dec.h"
|
#include "src/dec/vp8i_dec.h"
|
||||||
#include "src/dec/webpi_dec.h"
|
#include "src/dec/webpi_dec.h"
|
||||||
#include "src/dsp/dsp.h"
|
#include "src/dsp/dsp.h"
|
||||||
@ -25,9 +27,9 @@
|
|||||||
static int EmitYUV(const VP8Io* const io, WebPDecParams* const p) {
|
static int EmitYUV(const VP8Io* const io, WebPDecParams* const p) {
|
||||||
WebPDecBuffer* output = p->output;
|
WebPDecBuffer* output = p->output;
|
||||||
const WebPYUVABuffer* const buf = &output->u.YUVA;
|
const WebPYUVABuffer* const buf = &output->u.YUVA;
|
||||||
uint8_t* const y_dst = buf->y + (size_t)io->mb_y * buf->y_stride;
|
uint8_t* const y_dst = buf->y + (ptrdiff_t)io->mb_y * buf->y_stride;
|
||||||
uint8_t* const u_dst = buf->u + (size_t)(io->mb_y >> 1) * buf->u_stride;
|
uint8_t* const u_dst = buf->u + (ptrdiff_t)(io->mb_y >> 1) * buf->u_stride;
|
||||||
uint8_t* const v_dst = buf->v + (size_t)(io->mb_y >> 1) * buf->v_stride;
|
uint8_t* const v_dst = buf->v + (ptrdiff_t)(io->mb_y >> 1) * buf->v_stride;
|
||||||
const int mb_w = io->mb_w;
|
const int mb_w = io->mb_w;
|
||||||
const int mb_h = io->mb_h;
|
const int mb_h = io->mb_h;
|
||||||
const int uv_w = (mb_w + 1) / 2;
|
const int uv_w = (mb_w + 1) / 2;
|
||||||
@ -42,7 +44,7 @@ static int EmitYUV(const VP8Io* const io, WebPDecParams* const p) {
|
|||||||
static int EmitSampledRGB(const VP8Io* const io, WebPDecParams* const p) {
|
static int EmitSampledRGB(const VP8Io* const io, WebPDecParams* const p) {
|
||||||
WebPDecBuffer* const output = p->output;
|
WebPDecBuffer* const output = p->output;
|
||||||
WebPRGBABuffer* const buf = &output->u.RGBA;
|
WebPRGBABuffer* const buf = &output->u.RGBA;
|
||||||
uint8_t* const dst = buf->rgba + (size_t)io->mb_y * buf->stride;
|
uint8_t* const dst = buf->rgba + (ptrdiff_t)io->mb_y * buf->stride;
|
||||||
WebPSamplerProcessPlane(io->y, io->y_stride,
|
WebPSamplerProcessPlane(io->y, io->y_stride,
|
||||||
io->u, io->v, io->uv_stride,
|
io->u, io->v, io->uv_stride,
|
||||||
dst, buf->stride, io->mb_w, io->mb_h,
|
dst, buf->stride, io->mb_w, io->mb_h,
|
||||||
@ -57,7 +59,7 @@ static int EmitSampledRGB(const VP8Io* const io, WebPDecParams* const p) {
|
|||||||
static int EmitFancyRGB(const VP8Io* const io, WebPDecParams* const p) {
|
static int EmitFancyRGB(const VP8Io* const io, WebPDecParams* const p) {
|
||||||
int num_lines_out = io->mb_h; // a priori guess
|
int num_lines_out = io->mb_h; // a priori guess
|
||||||
const WebPRGBABuffer* const buf = &p->output->u.RGBA;
|
const WebPRGBABuffer* const buf = &p->output->u.RGBA;
|
||||||
uint8_t* dst = buf->rgba + (size_t)io->mb_y * buf->stride;
|
uint8_t* dst = buf->rgba + (ptrdiff_t)io->mb_y * buf->stride;
|
||||||
WebPUpsampleLinePairFunc upsample = WebPUpsamplers[p->output->colorspace];
|
WebPUpsampleLinePairFunc upsample = WebPUpsamplers[p->output->colorspace];
|
||||||
const uint8_t* cur_y = io->y;
|
const uint8_t* cur_y = io->y;
|
||||||
const uint8_t* cur_u = io->u;
|
const uint8_t* cur_u = io->u;
|
||||||
@ -128,7 +130,7 @@ static int EmitAlphaYUV(const VP8Io* const io, WebPDecParams* const p,
|
|||||||
const WebPYUVABuffer* const buf = &p->output->u.YUVA;
|
const WebPYUVABuffer* const buf = &p->output->u.YUVA;
|
||||||
const int mb_w = io->mb_w;
|
const int mb_w = io->mb_w;
|
||||||
const int mb_h = io->mb_h;
|
const int mb_h = io->mb_h;
|
||||||
uint8_t* dst = buf->a + (size_t)io->mb_y * buf->a_stride;
|
uint8_t* dst = buf->a + (ptrdiff_t)io->mb_y * buf->a_stride;
|
||||||
int j;
|
int j;
|
||||||
(void)expected_num_lines_out;
|
(void)expected_num_lines_out;
|
||||||
assert(expected_num_lines_out == mb_h);
|
assert(expected_num_lines_out == mb_h);
|
||||||
@ -181,8 +183,8 @@ static int EmitAlphaRGB(const VP8Io* const io, WebPDecParams* const p,
|
|||||||
(colorspace == MODE_ARGB || colorspace == MODE_Argb);
|
(colorspace == MODE_ARGB || colorspace == MODE_Argb);
|
||||||
const WebPRGBABuffer* const buf = &p->output->u.RGBA;
|
const WebPRGBABuffer* const buf = &p->output->u.RGBA;
|
||||||
int num_rows;
|
int num_rows;
|
||||||
const size_t start_y = GetAlphaSourceRow(io, &alpha, &num_rows);
|
const int start_y = GetAlphaSourceRow(io, &alpha, &num_rows);
|
||||||
uint8_t* const base_rgba = buf->rgba + start_y * buf->stride;
|
uint8_t* const base_rgba = buf->rgba + (ptrdiff_t)start_y * buf->stride;
|
||||||
uint8_t* const dst = base_rgba + (alpha_first ? 0 : 3);
|
uint8_t* const dst = base_rgba + (alpha_first ? 0 : 3);
|
||||||
const int has_alpha = WebPDispatchAlpha(alpha, io->width, mb_w,
|
const int has_alpha = WebPDispatchAlpha(alpha, io->width, mb_w,
|
||||||
num_rows, dst, buf->stride);
|
num_rows, dst, buf->stride);
|
||||||
@ -205,8 +207,8 @@ static int EmitAlphaRGBA4444(const VP8Io* const io, WebPDecParams* const p,
|
|||||||
const WEBP_CSP_MODE colorspace = p->output->colorspace;
|
const WEBP_CSP_MODE colorspace = p->output->colorspace;
|
||||||
const WebPRGBABuffer* const buf = &p->output->u.RGBA;
|
const WebPRGBABuffer* const buf = &p->output->u.RGBA;
|
||||||
int num_rows;
|
int num_rows;
|
||||||
const size_t start_y = GetAlphaSourceRow(io, &alpha, &num_rows);
|
const int start_y = GetAlphaSourceRow(io, &alpha, &num_rows);
|
||||||
uint8_t* const base_rgba = buf->rgba + start_y * buf->stride;
|
uint8_t* const base_rgba = buf->rgba + (ptrdiff_t)start_y * buf->stride;
|
||||||
#if (WEBP_SWAP_16BIT_CSP == 1)
|
#if (WEBP_SWAP_16BIT_CSP == 1)
|
||||||
uint8_t* alpha_dst = base_rgba;
|
uint8_t* alpha_dst = base_rgba;
|
||||||
#else
|
#else
|
||||||
@ -271,9 +273,9 @@ static int EmitRescaledYUV(const VP8Io* const io, WebPDecParams* const p) {
|
|||||||
static int EmitRescaledAlphaYUV(const VP8Io* const io, WebPDecParams* const p,
|
static int EmitRescaledAlphaYUV(const VP8Io* const io, WebPDecParams* const p,
|
||||||
int expected_num_lines_out) {
|
int expected_num_lines_out) {
|
||||||
const WebPYUVABuffer* const buf = &p->output->u.YUVA;
|
const WebPYUVABuffer* const buf = &p->output->u.YUVA;
|
||||||
uint8_t* const dst_a = buf->a + (size_t)p->last_y * buf->a_stride;
|
uint8_t* const dst_a = buf->a + (ptrdiff_t)p->last_y * buf->a_stride;
|
||||||
if (io->a != NULL) {
|
if (io->a != NULL) {
|
||||||
uint8_t* const dst_y = buf->y + (size_t)p->last_y * buf->y_stride;
|
uint8_t* const dst_y = buf->y + (ptrdiff_t)p->last_y * buf->y_stride;
|
||||||
const int num_lines_out = Rescale(io->a, io->width, io->mb_h, p->scaler_a);
|
const int num_lines_out = Rescale(io->a, io->width, io->mb_h, p->scaler_a);
|
||||||
assert(expected_num_lines_out == num_lines_out);
|
assert(expected_num_lines_out == num_lines_out);
|
||||||
if (num_lines_out > 0) { // unmultiply the Y
|
if (num_lines_out > 0) { // unmultiply the Y
|
||||||
@ -362,7 +364,7 @@ static int ExportRGB(WebPDecParams* const p, int y_pos) {
|
|||||||
const WebPYUV444Converter convert =
|
const WebPYUV444Converter convert =
|
||||||
WebPYUV444Converters[p->output->colorspace];
|
WebPYUV444Converters[p->output->colorspace];
|
||||||
const WebPRGBABuffer* const buf = &p->output->u.RGBA;
|
const WebPRGBABuffer* const buf = &p->output->u.RGBA;
|
||||||
uint8_t* dst = buf->rgba + (size_t)y_pos * buf->stride;
|
uint8_t* dst = buf->rgba + (ptrdiff_t)y_pos * buf->stride;
|
||||||
int num_lines_out = 0;
|
int num_lines_out = 0;
|
||||||
// For RGB rescaling, because of the YUV420, current scan position
|
// For RGB rescaling, because of the YUV420, current scan position
|
||||||
// U/V can be +1/-1 line from the Y one. Hence the double test.
|
// U/V can be +1/-1 line from the Y one. Hence the double test.
|
||||||
@ -389,14 +391,14 @@ static int EmitRescaledRGB(const VP8Io* const io, WebPDecParams* const p) {
|
|||||||
while (j < mb_h) {
|
while (j < mb_h) {
|
||||||
const int y_lines_in =
|
const int y_lines_in =
|
||||||
WebPRescalerImport(p->scaler_y, mb_h - j,
|
WebPRescalerImport(p->scaler_y, mb_h - j,
|
||||||
io->y + (size_t)j * io->y_stride, io->y_stride);
|
io->y + (ptrdiff_t)j * io->y_stride, io->y_stride);
|
||||||
j += y_lines_in;
|
j += y_lines_in;
|
||||||
if (WebPRescaleNeededLines(p->scaler_u, uv_mb_h - uv_j)) {
|
if (WebPRescaleNeededLines(p->scaler_u, uv_mb_h - uv_j)) {
|
||||||
const int u_lines_in = WebPRescalerImport(
|
const int u_lines_in = WebPRescalerImport(
|
||||||
p->scaler_u, uv_mb_h - uv_j, io->u + (size_t)uv_j * io->uv_stride,
|
p->scaler_u, uv_mb_h - uv_j, io->u + (ptrdiff_t)uv_j * io->uv_stride,
|
||||||
io->uv_stride);
|
io->uv_stride);
|
||||||
const int v_lines_in = WebPRescalerImport(
|
const int v_lines_in = WebPRescalerImport(
|
||||||
p->scaler_v, uv_mb_h - uv_j, io->v + (size_t)uv_j * io->uv_stride,
|
p->scaler_v, uv_mb_h - uv_j, io->v + (ptrdiff_t)uv_j * io->uv_stride,
|
||||||
io->uv_stride);
|
io->uv_stride);
|
||||||
(void)v_lines_in; // remove a gcc warning
|
(void)v_lines_in; // remove a gcc warning
|
||||||
assert(u_lines_in == v_lines_in);
|
assert(u_lines_in == v_lines_in);
|
||||||
@ -409,7 +411,7 @@ static int EmitRescaledRGB(const VP8Io* const io, WebPDecParams* const p) {
|
|||||||
|
|
||||||
static int ExportAlpha(WebPDecParams* const p, int y_pos, int max_lines_out) {
|
static int ExportAlpha(WebPDecParams* const p, int y_pos, int max_lines_out) {
|
||||||
const WebPRGBABuffer* const buf = &p->output->u.RGBA;
|
const WebPRGBABuffer* const buf = &p->output->u.RGBA;
|
||||||
uint8_t* const base_rgba = buf->rgba + (size_t)y_pos * buf->stride;
|
uint8_t* const base_rgba = buf->rgba + (ptrdiff_t)y_pos * buf->stride;
|
||||||
const WEBP_CSP_MODE colorspace = p->output->colorspace;
|
const WEBP_CSP_MODE colorspace = p->output->colorspace;
|
||||||
const int alpha_first =
|
const int alpha_first =
|
||||||
(colorspace == MODE_ARGB || colorspace == MODE_Argb);
|
(colorspace == MODE_ARGB || colorspace == MODE_Argb);
|
||||||
@ -437,7 +439,7 @@ static int ExportAlpha(WebPDecParams* const p, int y_pos, int max_lines_out) {
|
|||||||
static int ExportAlphaRGBA4444(WebPDecParams* const p, int y_pos,
|
static int ExportAlphaRGBA4444(WebPDecParams* const p, int y_pos,
|
||||||
int max_lines_out) {
|
int max_lines_out) {
|
||||||
const WebPRGBABuffer* const buf = &p->output->u.RGBA;
|
const WebPRGBABuffer* const buf = &p->output->u.RGBA;
|
||||||
uint8_t* const base_rgba = buf->rgba + (size_t)y_pos * buf->stride;
|
uint8_t* const base_rgba = buf->rgba + (ptrdiff_t)y_pos * buf->stride;
|
||||||
#if (WEBP_SWAP_16BIT_CSP == 1)
|
#if (WEBP_SWAP_16BIT_CSP == 1)
|
||||||
uint8_t* alpha_dst = base_rgba;
|
uint8_t* alpha_dst = base_rgba;
|
||||||
#else
|
#else
|
||||||
@ -476,7 +478,7 @@ static int EmitRescaledAlphaRGB(const VP8Io* const io, WebPDecParams* const p,
|
|||||||
int lines_left = expected_num_out_lines;
|
int lines_left = expected_num_out_lines;
|
||||||
const int y_end = p->last_y + lines_left;
|
const int y_end = p->last_y + lines_left;
|
||||||
while (lines_left > 0) {
|
while (lines_left > 0) {
|
||||||
const int64_t row_offset = (int64_t)scaler->src_y - io->mb_y;
|
const int64_t row_offset = (ptrdiff_t)scaler->src_y - io->mb_y;
|
||||||
WebPRescalerImport(scaler, io->mb_h + io->mb_y - scaler->src_y,
|
WebPRescalerImport(scaler, io->mb_h + io->mb_y - scaler->src_y,
|
||||||
io->a + row_offset * io->width, io->width);
|
io->a + row_offset * io->width, io->width);
|
||||||
lines_left -= p->emit_alpha_row(p, y_end - lines_left, lines_left);
|
lines_left -= p->emit_alpha_row(p, y_end - lines_left, lines_left);
|
||||||
|
@ -32,7 +32,7 @@ extern "C" {
|
|||||||
|
|
||||||
// version numbers
|
// version numbers
|
||||||
#define DEC_MAJ_VERSION 1
|
#define DEC_MAJ_VERSION 1
|
||||||
#define DEC_MIN_VERSION 4
|
#define DEC_MIN_VERSION 5
|
||||||
#define DEC_REV_VERSION 0
|
#define DEC_REV_VERSION 0
|
||||||
|
|
||||||
// YUV-cache parameters. Cache is 32-bytes wide (= one cacheline).
|
// YUV-cache parameters. Cache is 32-bytes wide (= one cacheline).
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
// Jyrki Alakuijala (jyrki@google.com)
|
// Jyrki Alakuijala (jyrki@google.com)
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "src/dec/alphai_dec.h"
|
#include "src/dec/alphai_dec.h"
|
||||||
@ -624,8 +625,8 @@ static int EmitRescaledRowsRGBA(const VP8LDecoder* const dec,
|
|||||||
int num_lines_in = 0;
|
int num_lines_in = 0;
|
||||||
int num_lines_out = 0;
|
int num_lines_out = 0;
|
||||||
while (num_lines_in < mb_h) {
|
while (num_lines_in < mb_h) {
|
||||||
uint8_t* const row_in = in + (uint64_t)num_lines_in * in_stride;
|
uint8_t* const row_in = in + (ptrdiff_t)num_lines_in * in_stride;
|
||||||
uint8_t* const row_out = out + (uint64_t)num_lines_out * out_stride;
|
uint8_t* const row_out = out + (ptrdiff_t)num_lines_out * out_stride;
|
||||||
const int lines_left = mb_h - num_lines_in;
|
const int lines_left = mb_h - num_lines_in;
|
||||||
const int needed_lines = WebPRescaleNeededLines(dec->rescaler, lines_left);
|
const int needed_lines = WebPRescaleNeededLines(dec->rescaler, lines_left);
|
||||||
int lines_imported;
|
int lines_imported;
|
||||||
@ -827,7 +828,7 @@ static void ProcessRows(VP8LDecoder* const dec, int row) {
|
|||||||
if (WebPIsRGBMode(output->colorspace)) { // convert to RGBA
|
if (WebPIsRGBMode(output->colorspace)) { // convert to RGBA
|
||||||
const WebPRGBABuffer* const buf = &output->u.RGBA;
|
const WebPRGBABuffer* const buf = &output->u.RGBA;
|
||||||
uint8_t* const rgba =
|
uint8_t* const rgba =
|
||||||
buf->rgba + (int64_t)dec->last_out_row_ * buf->stride;
|
buf->rgba + (ptrdiff_t)dec->last_out_row_ * buf->stride;
|
||||||
const int num_rows_out =
|
const int num_rows_out =
|
||||||
#if !defined(WEBP_REDUCE_SIZE)
|
#if !defined(WEBP_REDUCE_SIZE)
|
||||||
io->use_scaling ?
|
io->use_scaling ?
|
||||||
|
@ -13,13 +13,15 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "src/dec/common_dec.h"
|
||||||
#include "src/dec/vp8_dec.h"
|
#include "src/dec/vp8_dec.h"
|
||||||
#include "src/dec/vp8i_dec.h"
|
#include "src/dec/vp8i_dec.h"
|
||||||
#include "src/dec/vp8li_dec.h"
|
#include "src/dec/vp8li_dec.h"
|
||||||
#include "src/dec/webpi_dec.h"
|
#include "src/dec/webpi_dec.h"
|
||||||
|
#include "src/utils/rescaler_utils.h"
|
||||||
#include "src/utils/utils.h"
|
#include "src/utils/utils.h"
|
||||||
#include "src/webp/mux_types.h" // ALPHA_FLAG
|
|
||||||
#include "src/webp/decode.h"
|
#include "src/webp/decode.h"
|
||||||
|
#include "src/webp/mux_types.h" // ALPHA_FLAG
|
||||||
#include "src/webp/types.h"
|
#include "src/webp/types.h"
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@ -747,6 +749,61 @@ int WebPInitDecoderConfigInternal(WebPDecoderConfig* config,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int WebPCheckCropDimensionsBasic(int x, int y, int w, int h) {
|
||||||
|
return !(x < 0 || y < 0 || w <= 0 || h <= 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int WebPValidateDecoderConfig(const WebPDecoderConfig* config) {
|
||||||
|
const WebPDecoderOptions* options;
|
||||||
|
if (config == NULL) return 0;
|
||||||
|
if (!IsValidColorspace(config->output.colorspace)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
options = &config->options;
|
||||||
|
// bypass_filtering, no_fancy_upsampling, use_cropping, use_scaling,
|
||||||
|
// use_threads, flip can be any integer and are interpreted as boolean.
|
||||||
|
|
||||||
|
// Check for cropping.
|
||||||
|
if (options->use_cropping && !WebPCheckCropDimensionsBasic(
|
||||||
|
options->crop_left, options->crop_top,
|
||||||
|
options->crop_width, options->crop_height)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
// Check for scaling.
|
||||||
|
if (options->use_scaling &&
|
||||||
|
(options->scaled_width < 0 || options->scaled_height < 0 ||
|
||||||
|
(options->scaled_width == 0 && options->scaled_height == 0))) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// In case the WebPBitstreamFeatures has been filled in, check further.
|
||||||
|
if (config->input.width > 0 || config->input.height > 0) {
|
||||||
|
int scaled_width = options->scaled_width;
|
||||||
|
int scaled_height = options->scaled_height;
|
||||||
|
if (options->use_cropping &&
|
||||||
|
!WebPCheckCropDimensions(config->input.width, config->input.height,
|
||||||
|
options->crop_left, options->crop_top,
|
||||||
|
options->crop_width, options->crop_height)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (options->use_scaling && !WebPRescalerGetScaledDimensions(
|
||||||
|
config->input.width, config->input.height,
|
||||||
|
&scaled_width, &scaled_height)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for dithering.
|
||||||
|
if (options->dithering_strength < 0 || options->dithering_strength > 100 ||
|
||||||
|
options->alpha_dithering_strength < 0 ||
|
||||||
|
options->alpha_dithering_strength > 100) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
VP8StatusCode WebPGetFeaturesInternal(const uint8_t* data, size_t data_size,
|
VP8StatusCode WebPGetFeaturesInternal(const uint8_t* data, size_t data_size,
|
||||||
WebPBitstreamFeatures* features,
|
WebPBitstreamFeatures* features,
|
||||||
int version) {
|
int version) {
|
||||||
@ -806,8 +863,8 @@ VP8StatusCode WebPDecode(const uint8_t* data, size_t data_size,
|
|||||||
|
|
||||||
int WebPCheckCropDimensions(int image_width, int image_height,
|
int WebPCheckCropDimensions(int image_width, int image_height,
|
||||||
int x, int y, int w, int h) {
|
int x, int y, int w, int h) {
|
||||||
return !(x < 0 || y < 0 || w <= 0 || h <= 0 ||
|
return WebPCheckCropDimensionsBasic(x, y, w, h) &&
|
||||||
x >= image_width || w > image_width || w > image_width - x ||
|
!(x >= image_width || w > image_width || w > image_width - x ||
|
||||||
y >= image_height || h > image_height || h > image_height - y);
|
y >= image_height || h > image_height || h > image_height - y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,6 @@ noinst_HEADERS =
|
|||||||
noinst_HEADERS += ../webp/format_constants.h
|
noinst_HEADERS += ../webp/format_constants.h
|
||||||
|
|
||||||
libwebpdemux_la_LIBADD = ../libwebp.la
|
libwebpdemux_la_LIBADD = ../libwebp.la
|
||||||
libwebpdemux_la_LDFLAGS = -no-undefined -version-info 2:15:0
|
libwebpdemux_la_LDFLAGS = -no-undefined -version-info 2:16:0
|
||||||
libwebpdemuxincludedir = $(includedir)/webp
|
libwebpdemuxincludedir = $(includedir)/webp
|
||||||
pkgconfig_DATA = libwebpdemux.pc
|
pkgconfig_DATA = libwebpdemux.pc
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include "src/webp/format_constants.h"
|
#include "src/webp/format_constants.h"
|
||||||
|
|
||||||
#define DMUX_MAJ_VERSION 1
|
#define DMUX_MAJ_VERSION 1
|
||||||
#define DMUX_MIN_VERSION 4
|
#define DMUX_MIN_VERSION 5
|
||||||
#define DMUX_REV_VERSION 0
|
#define DMUX_REV_VERSION 0
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,0,4,0
|
FILEVERSION 1,0,5,0
|
||||||
PRODUCTVERSION 1,0,4,0
|
PRODUCTVERSION 1,0,5,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
@ -24,12 +24,12 @@ BEGIN
|
|||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Google, Inc."
|
VALUE "CompanyName", "Google, Inc."
|
||||||
VALUE "FileDescription", "libwebpdemux DLL"
|
VALUE "FileDescription", "libwebpdemux DLL"
|
||||||
VALUE "FileVersion", "1.4.0"
|
VALUE "FileVersion", "1.5.0"
|
||||||
VALUE "InternalName", "libwebpdemux.dll"
|
VALUE "InternalName", "libwebpdemux.dll"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2024"
|
VALUE "LegalCopyright", "Copyright (C) 2024"
|
||||||
VALUE "OriginalFilename", "libwebpdemux.dll"
|
VALUE "OriginalFilename", "libwebpdemux.dll"
|
||||||
VALUE "ProductName", "WebP Image Demuxer"
|
VALUE "ProductName", "WebP Image Demuxer"
|
||||||
VALUE "ProductVersion", "1.4.0"
|
VALUE "ProductVersion", "1.5.0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
@ -945,6 +945,18 @@ static int Quantize2Blocks_NEON(int16_t in[32], int16_t out[32],
|
|||||||
vst1q_u8(dst, r); \
|
vst1q_u8(dst, r); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
static WEBP_INLINE uint8x16x4_t Vld1qU8x4(const uint8_t* ptr) {
|
||||||
|
#if LOCAL_CLANG_PREREQ(3, 4) || LOCAL_GCC_PREREQ(9, 4) || defined(_MSC_VER)
|
||||||
|
return vld1q_u8_x4(ptr);
|
||||||
|
#else
|
||||||
|
uint8x16x4_t res;
|
||||||
|
INIT_VECTOR4(res,
|
||||||
|
vld1q_u8(ptr + 0 * 16), vld1q_u8(ptr + 1 * 16),
|
||||||
|
vld1q_u8(ptr + 2 * 16), vld1q_u8(ptr + 3 * 16));
|
||||||
|
return res;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static void Intra4Preds_NEON(uint8_t* WEBP_RESTRICT dst,
|
static void Intra4Preds_NEON(uint8_t* WEBP_RESTRICT dst,
|
||||||
const uint8_t* WEBP_RESTRICT top) {
|
const uint8_t* WEBP_RESTRICT top) {
|
||||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13
|
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13
|
||||||
@ -971,9 +983,9 @@ static void Intra4Preds_NEON(uint8_t* WEBP_RESTRICT dst,
|
|||||||
30, 30, 30, 30, 0, 0, 0, 0, 21, 22, 23, 24, 16, 16, 16, 16
|
30, 30, 30, 30, 0, 0, 0, 0, 21, 22, 23, 24, 16, 16, 16, 16
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint8x16x4_t lookup_avgs1 = vld1q_u8_x4(kLookupTbl1);
|
const uint8x16x4_t lookup_avgs1 = Vld1qU8x4(kLookupTbl1);
|
||||||
const uint8x16x4_t lookup_avgs2 = vld1q_u8_x4(kLookupTbl2);
|
const uint8x16x4_t lookup_avgs2 = Vld1qU8x4(kLookupTbl2);
|
||||||
const uint8x16x4_t lookup_avgs3 = vld1q_u8_x4(kLookupTbl3);
|
const uint8x16x4_t lookup_avgs3 = Vld1qU8x4(kLookupTbl3);
|
||||||
|
|
||||||
const uint8x16_t preload = vld1q_u8(top - 5);
|
const uint8x16_t preload = vld1q_u8(top - 5);
|
||||||
uint8x16x2_t qcombined;
|
uint8x16x2_t qcombined;
|
||||||
|
@ -175,64 +175,102 @@ static void CollectColorRedTransforms_SSE2(const uint32_t* WEBP_RESTRICT argb,
|
|||||||
|
|
||||||
// Note we are adding uint32_t's as *signed* int32's (using _mm_add_epi32). But
|
// Note we are adding uint32_t's as *signed* int32's (using _mm_add_epi32). But
|
||||||
// that's ok since the histogram values are less than 1<<28 (max picture size).
|
// that's ok since the histogram values are less than 1<<28 (max picture size).
|
||||||
#define LINE_SIZE 16 // 8 or 16
|
|
||||||
static void AddVector_SSE2(const uint32_t* WEBP_RESTRICT a,
|
static void AddVector_SSE2(const uint32_t* WEBP_RESTRICT a,
|
||||||
const uint32_t* WEBP_RESTRICT b,
|
const uint32_t* WEBP_RESTRICT b,
|
||||||
uint32_t* WEBP_RESTRICT out, int size) {
|
uint32_t* WEBP_RESTRICT out, int size) {
|
||||||
int i;
|
int i = 0;
|
||||||
for (i = 0; i + LINE_SIZE <= size; i += LINE_SIZE) {
|
int aligned_size = size & ~15;
|
||||||
|
// Size is, at minimum, NUM_DISTANCE_CODES (40) and may be as large as
|
||||||
|
// NUM_LITERAL_CODES (256) + NUM_LENGTH_CODES (24) + (0 or a non-zero power of
|
||||||
|
// 2). See the usage in VP8LHistogramAdd().
|
||||||
|
assert(size >= 16);
|
||||||
|
assert(size % 2 == 0);
|
||||||
|
|
||||||
|
do {
|
||||||
const __m128i a0 = _mm_loadu_si128((const __m128i*)&a[i + 0]);
|
const __m128i a0 = _mm_loadu_si128((const __m128i*)&a[i + 0]);
|
||||||
const __m128i a1 = _mm_loadu_si128((const __m128i*)&a[i + 4]);
|
const __m128i a1 = _mm_loadu_si128((const __m128i*)&a[i + 4]);
|
||||||
#if (LINE_SIZE == 16)
|
|
||||||
const __m128i a2 = _mm_loadu_si128((const __m128i*)&a[i + 8]);
|
const __m128i a2 = _mm_loadu_si128((const __m128i*)&a[i + 8]);
|
||||||
const __m128i a3 = _mm_loadu_si128((const __m128i*)&a[i + 12]);
|
const __m128i a3 = _mm_loadu_si128((const __m128i*)&a[i + 12]);
|
||||||
#endif
|
|
||||||
const __m128i b0 = _mm_loadu_si128((const __m128i*)&b[i + 0]);
|
const __m128i b0 = _mm_loadu_si128((const __m128i*)&b[i + 0]);
|
||||||
const __m128i b1 = _mm_loadu_si128((const __m128i*)&b[i + 4]);
|
const __m128i b1 = _mm_loadu_si128((const __m128i*)&b[i + 4]);
|
||||||
#if (LINE_SIZE == 16)
|
|
||||||
const __m128i b2 = _mm_loadu_si128((const __m128i*)&b[i + 8]);
|
const __m128i b2 = _mm_loadu_si128((const __m128i*)&b[i + 8]);
|
||||||
const __m128i b3 = _mm_loadu_si128((const __m128i*)&b[i + 12]);
|
const __m128i b3 = _mm_loadu_si128((const __m128i*)&b[i + 12]);
|
||||||
#endif
|
|
||||||
_mm_storeu_si128((__m128i*)&out[i + 0], _mm_add_epi32(a0, b0));
|
_mm_storeu_si128((__m128i*)&out[i + 0], _mm_add_epi32(a0, b0));
|
||||||
_mm_storeu_si128((__m128i*)&out[i + 4], _mm_add_epi32(a1, b1));
|
_mm_storeu_si128((__m128i*)&out[i + 4], _mm_add_epi32(a1, b1));
|
||||||
#if (LINE_SIZE == 16)
|
|
||||||
_mm_storeu_si128((__m128i*)&out[i + 8], _mm_add_epi32(a2, b2));
|
_mm_storeu_si128((__m128i*)&out[i + 8], _mm_add_epi32(a2, b2));
|
||||||
_mm_storeu_si128((__m128i*)&out[i + 12], _mm_add_epi32(a3, b3));
|
_mm_storeu_si128((__m128i*)&out[i + 12], _mm_add_epi32(a3, b3));
|
||||||
#endif
|
i += 16;
|
||||||
|
} while (i != aligned_size);
|
||||||
|
|
||||||
|
if ((size & 8) != 0) {
|
||||||
|
const __m128i a0 = _mm_loadu_si128((const __m128i*)&a[i + 0]);
|
||||||
|
const __m128i a1 = _mm_loadu_si128((const __m128i*)&a[i + 4]);
|
||||||
|
const __m128i b0 = _mm_loadu_si128((const __m128i*)&b[i + 0]);
|
||||||
|
const __m128i b1 = _mm_loadu_si128((const __m128i*)&b[i + 4]);
|
||||||
|
_mm_storeu_si128((__m128i*)&out[i + 0], _mm_add_epi32(a0, b0));
|
||||||
|
_mm_storeu_si128((__m128i*)&out[i + 4], _mm_add_epi32(a1, b1));
|
||||||
|
i += 8;
|
||||||
}
|
}
|
||||||
for (; i < size; ++i) {
|
|
||||||
out[i] = a[i] + b[i];
|
size &= 7;
|
||||||
|
if (size == 4) {
|
||||||
|
const __m128i a0 = _mm_loadu_si128((const __m128i*)&a[i]);
|
||||||
|
const __m128i b0 = _mm_loadu_si128((const __m128i*)&b[i]);
|
||||||
|
_mm_storeu_si128((__m128i*)&out[i], _mm_add_epi32(a0, b0));
|
||||||
|
} else if (size == 2) {
|
||||||
|
const __m128i a0 = _mm_loadl_epi64((const __m128i*)&a[i]);
|
||||||
|
const __m128i b0 = _mm_loadl_epi64((const __m128i*)&b[i]);
|
||||||
|
_mm_storel_epi64((__m128i*)&out[i], _mm_add_epi32(a0, b0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AddVectorEq_SSE2(const uint32_t* WEBP_RESTRICT a,
|
static void AddVectorEq_SSE2(const uint32_t* WEBP_RESTRICT a,
|
||||||
uint32_t* WEBP_RESTRICT out, int size) {
|
uint32_t* WEBP_RESTRICT out, int size) {
|
||||||
int i;
|
int i = 0;
|
||||||
for (i = 0; i + LINE_SIZE <= size; i += LINE_SIZE) {
|
int aligned_size = size & ~15;
|
||||||
|
// Size is, at minimum, NUM_DISTANCE_CODES (40) and may be as large as
|
||||||
|
// NUM_LITERAL_CODES (256) + NUM_LENGTH_CODES (24) + (0 or a non-zero power of
|
||||||
|
// 2). See the usage in VP8LHistogramAdd().
|
||||||
|
assert(size >= 16);
|
||||||
|
assert(size % 2 == 0);
|
||||||
|
|
||||||
|
do {
|
||||||
const __m128i a0 = _mm_loadu_si128((const __m128i*)&a[i + 0]);
|
const __m128i a0 = _mm_loadu_si128((const __m128i*)&a[i + 0]);
|
||||||
const __m128i a1 = _mm_loadu_si128((const __m128i*)&a[i + 4]);
|
const __m128i a1 = _mm_loadu_si128((const __m128i*)&a[i + 4]);
|
||||||
#if (LINE_SIZE == 16)
|
|
||||||
const __m128i a2 = _mm_loadu_si128((const __m128i*)&a[i + 8]);
|
const __m128i a2 = _mm_loadu_si128((const __m128i*)&a[i + 8]);
|
||||||
const __m128i a3 = _mm_loadu_si128((const __m128i*)&a[i + 12]);
|
const __m128i a3 = _mm_loadu_si128((const __m128i*)&a[i + 12]);
|
||||||
#endif
|
|
||||||
const __m128i b0 = _mm_loadu_si128((const __m128i*)&out[i + 0]);
|
const __m128i b0 = _mm_loadu_si128((const __m128i*)&out[i + 0]);
|
||||||
const __m128i b1 = _mm_loadu_si128((const __m128i*)&out[i + 4]);
|
const __m128i b1 = _mm_loadu_si128((const __m128i*)&out[i + 4]);
|
||||||
#if (LINE_SIZE == 16)
|
|
||||||
const __m128i b2 = _mm_loadu_si128((const __m128i*)&out[i + 8]);
|
const __m128i b2 = _mm_loadu_si128((const __m128i*)&out[i + 8]);
|
||||||
const __m128i b3 = _mm_loadu_si128((const __m128i*)&out[i + 12]);
|
const __m128i b3 = _mm_loadu_si128((const __m128i*)&out[i + 12]);
|
||||||
#endif
|
|
||||||
_mm_storeu_si128((__m128i*)&out[i + 0], _mm_add_epi32(a0, b0));
|
_mm_storeu_si128((__m128i*)&out[i + 0], _mm_add_epi32(a0, b0));
|
||||||
_mm_storeu_si128((__m128i*)&out[i + 4], _mm_add_epi32(a1, b1));
|
_mm_storeu_si128((__m128i*)&out[i + 4], _mm_add_epi32(a1, b1));
|
||||||
#if (LINE_SIZE == 16)
|
|
||||||
_mm_storeu_si128((__m128i*)&out[i + 8], _mm_add_epi32(a2, b2));
|
_mm_storeu_si128((__m128i*)&out[i + 8], _mm_add_epi32(a2, b2));
|
||||||
_mm_storeu_si128((__m128i*)&out[i + 12], _mm_add_epi32(a3, b3));
|
_mm_storeu_si128((__m128i*)&out[i + 12], _mm_add_epi32(a3, b3));
|
||||||
#endif
|
i += 16;
|
||||||
|
} while (i != aligned_size);
|
||||||
|
|
||||||
|
if ((size & 8) != 0) {
|
||||||
|
const __m128i a0 = _mm_loadu_si128((const __m128i*)&a[i + 0]);
|
||||||
|
const __m128i a1 = _mm_loadu_si128((const __m128i*)&a[i + 4]);
|
||||||
|
const __m128i b0 = _mm_loadu_si128((const __m128i*)&out[i + 0]);
|
||||||
|
const __m128i b1 = _mm_loadu_si128((const __m128i*)&out[i + 4]);
|
||||||
|
_mm_storeu_si128((__m128i*)&out[i + 0], _mm_add_epi32(a0, b0));
|
||||||
|
_mm_storeu_si128((__m128i*)&out[i + 4], _mm_add_epi32(a1, b1));
|
||||||
|
i += 8;
|
||||||
}
|
}
|
||||||
for (; i < size; ++i) {
|
|
||||||
out[i] += a[i];
|
size &= 7;
|
||||||
|
if (size == 4) {
|
||||||
|
const __m128i a0 = _mm_loadu_si128((const __m128i*)&a[i]);
|
||||||
|
const __m128i b0 = _mm_loadu_si128((const __m128i*)&out[i]);
|
||||||
|
_mm_storeu_si128((__m128i*)&out[i], _mm_add_epi32(a0, b0));
|
||||||
|
} else if (size == 2) {
|
||||||
|
const __m128i a0 = _mm_loadl_epi64((const __m128i*)&a[i]);
|
||||||
|
const __m128i b0 = _mm_loadl_epi64((const __m128i*)&out[i]);
|
||||||
|
_mm_storel_epi64((__m128i*)&out[i], _mm_add_epi32(a0, b0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#undef LINE_SIZE
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Entropy
|
// Entropy
|
||||||
|
@ -11,15 +11,15 @@
|
|||||||
//
|
//
|
||||||
// The exact naming is Y'CbCr, following the ITU-R BT.601 standard.
|
// The exact naming is Y'CbCr, following the ITU-R BT.601 standard.
|
||||||
// More information at: https://en.wikipedia.org/wiki/YCbCr
|
// More information at: https://en.wikipedia.org/wiki/YCbCr
|
||||||
// Y = 0.2569 * R + 0.5044 * G + 0.0979 * B + 16
|
// Y = 0.2568 * R + 0.5041 * G + 0.0979 * B + 16
|
||||||
// U = -0.1483 * R - 0.2911 * G + 0.4394 * B + 128
|
// U = -0.1482 * R - 0.2910 * G + 0.4392 * B + 128
|
||||||
// V = 0.4394 * R - 0.3679 * G - 0.0715 * B + 128
|
// V = 0.4392 * R - 0.3678 * G - 0.0714 * B + 128
|
||||||
// We use 16bit fixed point operations for RGB->YUV conversion (YUV_FIX).
|
// We use 16bit fixed point operations for RGB->YUV conversion (YUV_FIX).
|
||||||
//
|
//
|
||||||
// For the Y'CbCr to RGB conversion, the BT.601 specification reads:
|
// For the Y'CbCr to RGB conversion, the BT.601 specification reads:
|
||||||
// R = 1.164 * (Y-16) + 1.596 * (V-128)
|
// R = 1.164 * (Y-16) + 1.596 * (V-128)
|
||||||
// G = 1.164 * (Y-16) - 0.813 * (V-128) - 0.391 * (U-128)
|
// G = 1.164 * (Y-16) - 0.813 * (V-128) - 0.392 * (U-128)
|
||||||
// B = 1.164 * (Y-16) + 2.018 * (U-128)
|
// B = 1.164 * (Y-16) + 2.017 * (U-128)
|
||||||
// where Y is in the [16,235] range, and U/V in the [16,240] range.
|
// where Y is in the [16,235] range, and U/V in the [16,240] range.
|
||||||
//
|
//
|
||||||
// The fixed-point implementation used here is:
|
// The fixed-point implementation used here is:
|
||||||
|
@ -32,7 +32,7 @@ extern "C" {
|
|||||||
|
|
||||||
// version numbers
|
// version numbers
|
||||||
#define ENC_MAJ_VERSION 1
|
#define ENC_MAJ_VERSION 1
|
||||||
#define ENC_MIN_VERSION 4
|
#define ENC_MIN_VERSION 5
|
||||||
#define ENC_REV_VERSION 0
|
#define ENC_REV_VERSION 0
|
||||||
|
|
||||||
enum { MAX_LF_LEVELS = 64, // Maximum loop filter level
|
enum { MAX_LF_LEVELS = 64, // Maximum loop filter level
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,0,4,0
|
FILEVERSION 1,0,5,0
|
||||||
PRODUCTVERSION 1,0,4,0
|
PRODUCTVERSION 1,0,5,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
@ -24,12 +24,12 @@ BEGIN
|
|||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Google, Inc."
|
VALUE "CompanyName", "Google, Inc."
|
||||||
VALUE "FileDescription", "libwebp DLL"
|
VALUE "FileDescription", "libwebp DLL"
|
||||||
VALUE "FileVersion", "1.4.0"
|
VALUE "FileVersion", "1.5.0"
|
||||||
VALUE "InternalName", "libwebp.dll"
|
VALUE "InternalName", "libwebp.dll"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2024"
|
VALUE "LegalCopyright", "Copyright (C) 2024"
|
||||||
VALUE "OriginalFilename", "libwebp.dll"
|
VALUE "OriginalFilename", "libwebp.dll"
|
||||||
VALUE "ProductName", "WebP Image Codec"
|
VALUE "ProductName", "WebP Image Codec"
|
||||||
VALUE "ProductVersion", "1.4.0"
|
VALUE "ProductVersion", "1.5.0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,0,4,0
|
FILEVERSION 1,0,5,0
|
||||||
PRODUCTVERSION 1,0,4,0
|
PRODUCTVERSION 1,0,5,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
@ -24,12 +24,12 @@ BEGIN
|
|||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Google, Inc."
|
VALUE "CompanyName", "Google, Inc."
|
||||||
VALUE "FileDescription", "libwebpdecoder DLL"
|
VALUE "FileDescription", "libwebpdecoder DLL"
|
||||||
VALUE "FileVersion", "1.4.0"
|
VALUE "FileVersion", "1.5.0"
|
||||||
VALUE "InternalName", "libwebpdecoder.dll"
|
VALUE "InternalName", "libwebpdecoder.dll"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2024"
|
VALUE "LegalCopyright", "Copyright (C) 2024"
|
||||||
VALUE "OriginalFilename", "libwebpdecoder.dll"
|
VALUE "OriginalFilename", "libwebpdecoder.dll"
|
||||||
VALUE "ProductName", "WebP Image Decoder"
|
VALUE "ProductName", "WebP Image Decoder"
|
||||||
VALUE "ProductVersion", "1.4.0"
|
VALUE "ProductVersion", "1.5.0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
@ -17,6 +17,6 @@ noinst_HEADERS =
|
|||||||
noinst_HEADERS += ../webp/format_constants.h
|
noinst_HEADERS += ../webp/format_constants.h
|
||||||
|
|
||||||
libwebpmux_la_LIBADD = ../libwebp.la
|
libwebpmux_la_LIBADD = ../libwebp.la
|
||||||
libwebpmux_la_LDFLAGS = -no-undefined -version-info 4:0:1 -lm
|
libwebpmux_la_LDFLAGS = -no-undefined -version-info 4:1:1 -lm
|
||||||
libwebpmuxincludedir = $(includedir)/webp
|
libwebpmuxincludedir = $(includedir)/webp
|
||||||
pkgconfig_DATA = libwebpmux.pc
|
pkgconfig_DATA = libwebpmux.pc
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,0,4,0
|
FILEVERSION 1,0,5,0
|
||||||
PRODUCTVERSION 1,0,4,0
|
PRODUCTVERSION 1,0,5,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
@ -24,12 +24,12 @@ BEGIN
|
|||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Google, Inc."
|
VALUE "CompanyName", "Google, Inc."
|
||||||
VALUE "FileDescription", "libwebpmux DLL"
|
VALUE "FileDescription", "libwebpmux DLL"
|
||||||
VALUE "FileVersion", "1.4.0"
|
VALUE "FileVersion", "1.5.0"
|
||||||
VALUE "InternalName", "libwebpmux.dll"
|
VALUE "InternalName", "libwebpmux.dll"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2024"
|
VALUE "LegalCopyright", "Copyright (C) 2024"
|
||||||
VALUE "OriginalFilename", "libwebpmux.dll"
|
VALUE "OriginalFilename", "libwebpmux.dll"
|
||||||
VALUE "ProductName", "WebP Image Muxer"
|
VALUE "ProductName", "WebP Image Muxer"
|
||||||
VALUE "ProductVersion", "1.4.0"
|
VALUE "ProductVersion", "1.5.0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
@ -28,7 +28,7 @@ extern "C" {
|
|||||||
// Defines and constants.
|
// Defines and constants.
|
||||||
|
|
||||||
#define MUX_MAJ_VERSION 1
|
#define MUX_MAJ_VERSION 1
|
||||||
#define MUX_MIN_VERSION 4
|
#define MUX_MIN_VERSION 5
|
||||||
#define MUX_REV_VERSION 0
|
#define MUX_REV_VERSION 0
|
||||||
|
|
||||||
// Chunk object.
|
// Chunk object.
|
||||||
|
@ -223,11 +223,13 @@ WebPMux* WebPMuxCreateInternal(const WebPData* bitstream, int copy_data,
|
|||||||
// Note this padding is historical and differs from demux.c which does not
|
// Note this padding is historical and differs from demux.c which does not
|
||||||
// pad the file size.
|
// pad the file size.
|
||||||
riff_size = SizeWithPadding(riff_size);
|
riff_size = SizeWithPadding(riff_size);
|
||||||
if (riff_size < CHUNK_HEADER_SIZE) goto Err;
|
// Make sure the whole RIFF header is available.
|
||||||
|
if (riff_size < RIFF_HEADER_SIZE) goto Err;
|
||||||
if (riff_size > size) goto Err;
|
if (riff_size > size) goto Err;
|
||||||
// There's no point in reading past the end of the RIFF chunk.
|
// There's no point in reading past the end of the RIFF chunk. Note riff_size
|
||||||
if (size > riff_size + CHUNK_HEADER_SIZE) {
|
// includes CHUNK_HEADER_SIZE after SizeWithPadding().
|
||||||
size = riff_size + CHUNK_HEADER_SIZE;
|
if (size > riff_size) {
|
||||||
|
size = riff_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
end = data + size;
|
end = data + size;
|
||||||
|
@ -15,6 +15,8 @@
|
|||||||
#include "src/webp/config.h"
|
#include "src/webp/config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
#include "src/dsp/cpu.h"
|
#include "src/dsp/cpu.h"
|
||||||
#include "src/utils/bit_reader_inl_utils.h"
|
#include "src/utils/bit_reader_inl_utils.h"
|
||||||
#include "src/utils/utils.h"
|
#include "src/utils/utils.h"
|
||||||
@ -25,11 +27,12 @@
|
|||||||
void VP8BitReaderSetBuffer(VP8BitReader* const br,
|
void VP8BitReaderSetBuffer(VP8BitReader* const br,
|
||||||
const uint8_t* const start,
|
const uint8_t* const start,
|
||||||
size_t size) {
|
size_t size) {
|
||||||
br->buf_ = start;
|
if (start != NULL) {
|
||||||
br->buf_end_ = start + size;
|
br->buf_ = start;
|
||||||
br->buf_max_ =
|
br->buf_end_ = start + size;
|
||||||
(size >= sizeof(lbit_t)) ? start + size - sizeof(lbit_t) + 1
|
br->buf_max_ =
|
||||||
: start;
|
(size >= sizeof(lbit_t)) ? start + size - sizeof(lbit_t) + 1 : start;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VP8InitBitReader(VP8BitReader* const br,
|
void VP8InitBitReader(VP8BitReader* const br,
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define WEBP_DECODER_ABI_VERSION 0x0209 // MAJOR(8b) + MINOR(8b)
|
#define WEBP_DECODER_ABI_VERSION 0x0210 // MAJOR(8b) + MINOR(8b)
|
||||||
|
|
||||||
// Note: forward declaring enumerations is not allowed in (strict) C and C++,
|
// Note: forward declaring enumerations is not allowed in (strict) C and C++,
|
||||||
// the types are left here for reference.
|
// the types are left here for reference.
|
||||||
@ -451,7 +451,9 @@ struct WebPDecoderOptions {
|
|||||||
// Will be snapped to even values.
|
// Will be snapped to even values.
|
||||||
int crop_width, crop_height; // dimension of the cropping area
|
int crop_width, crop_height; // dimension of the cropping area
|
||||||
int use_scaling; // if true, scaling is applied _afterward_
|
int use_scaling; // if true, scaling is applied _afterward_
|
||||||
int scaled_width, scaled_height; // final resolution
|
int scaled_width, scaled_height; // final resolution. if one is 0, it is
|
||||||
|
// guessed from the other one to keep the
|
||||||
|
// original ratio.
|
||||||
int use_threads; // if true, use multi-threaded decoding
|
int use_threads; // if true, use multi-threaded decoding
|
||||||
int dithering_strength; // dithering strength (0=Off, 100=full)
|
int dithering_strength; // dithering strength (0=Off, 100=full)
|
||||||
int flip; // if true, flip output vertically
|
int flip; // if true, flip output vertically
|
||||||
@ -479,6 +481,11 @@ WEBP_NODISCARD static WEBP_INLINE int WebPInitDecoderConfig(
|
|||||||
return WebPInitDecoderConfigInternal(config, WEBP_DECODER_ABI_VERSION);
|
return WebPInitDecoderConfigInternal(config, WEBP_DECODER_ABI_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns true if 'config' is non-NULL and all configuration parameters are
|
||||||
|
// within their valid ranges.
|
||||||
|
WEBP_NODISCARD WEBP_EXTERN int WebPValidateDecoderConfig(
|
||||||
|
const WebPDecoderConfig* config);
|
||||||
|
|
||||||
// Instantiate a new incremental decoder object with the requested
|
// Instantiate a new incremental decoder object with the requested
|
||||||
// configuration. The bitstream can be passed using 'data' and 'data_size'
|
// configuration. The bitstream can be passed using 'data' and 'data_size'
|
||||||
// parameter, in which case the features will be parsed and stored into
|
// parameter, in which case the features will be parsed and stored into
|
||||||
|
@ -76,9 +76,8 @@ int CropOrScale(WebPPicture* const pic, const CropOrScaleParams& params) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else // defined(WEBP_REDUCE_SIZE)
|
#else // defined(WEBP_REDUCE_SIZE)
|
||||||
(void)data;
|
(void)pic;
|
||||||
(void)size;
|
(void)params;
|
||||||
(void)bit_pos;
|
|
||||||
#endif // !defined(WEBP_REDUCE_SIZE)
|
#endif // !defined(WEBP_REDUCE_SIZE)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <string_view>
|
||||||
|
|
||||||
#include "imageio/image_dec.h"
|
#include "imageio/image_dec.h"
|
||||||
#include "imageio/metadata.h"
|
#include "imageio/metadata.h"
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
void MuxDemuxApiTest(std::string_view data_in, bool mux) {
|
void MuxDemuxApiTest(std::string_view data_in, bool use_mux_api) {
|
||||||
const size_t size = data_in.size();
|
const size_t size = data_in.size();
|
||||||
WebPData webp_data;
|
WebPData webp_data;
|
||||||
WebPDataInit(&webp_data);
|
WebPDataInit(&webp_data);
|
||||||
@ -34,7 +34,7 @@ void MuxDemuxApiTest(std::string_view data_in, bool mux) {
|
|||||||
// Extracted chunks and frames are not processed or decoded,
|
// Extracted chunks and frames are not processed or decoded,
|
||||||
// which is already covered extensively by the other fuzz targets.
|
// which is already covered extensively by the other fuzz targets.
|
||||||
|
|
||||||
if (mux) {
|
if (use_mux_api) {
|
||||||
// Mux API
|
// Mux API
|
||||||
WebPMux* mux = WebPMuxCreate(&webp_data, size & 2);
|
WebPMux* mux = WebPMuxCreate(&webp_data, size & 2);
|
||||||
if (!mux) return;
|
if (!mux) return;
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <string_view>
|
||||||
|
|
||||||
#include "src/webp/mux_types.h"
|
#include "src/webp/mux_types.h"
|
||||||
#include "tests/fuzzer/fuzz_utils.h"
|
#include "tests/fuzzer/fuzz_utils.h"
|
||||||
|
@ -172,7 +172,9 @@ for (( i = 0; i < $NUM_PLATFORMS; ++i )); do
|
|||||||
CFLAGS="-pipe -isysroot ${SDKROOT} -O3 -DNDEBUG"
|
CFLAGS="-pipe -isysroot ${SDKROOT} -O3 -DNDEBUG"
|
||||||
case "${PLATFORM}" in
|
case "${PLATFORM}" in
|
||||||
iPhone*)
|
iPhone*)
|
||||||
CFLAGS+=" -fembed-bitcode"
|
if [[ "${XCODE%%.*}" -lt 16 ]]; then
|
||||||
|
CFLAGS+=" -fembed-bitcode"
|
||||||
|
fi
|
||||||
CFLAGS+=" -target ${ARCH}-apple-ios${IOS_MIN_VERSION}"
|
CFLAGS+=" -target ${ARCH}-apple-ios${IOS_MIN_VERSION}"
|
||||||
[[ "${PLATFORM}" == *Simulator* ]] && CFLAGS+="-simulator"
|
[[ "${PLATFORM}" == *Simulator* ]] && CFLAGS+="-simulator"
|
||||||
;;
|
;;
|
||||||
|
Reference in New Issue
Block a user