Commit Graph

4089 Commits

Author SHA1 Message Date
Vincent Rabaud
dea3e89983 Split HistogramAdd to only have the high level logic in C.
Change-Id: Ic9eaebf7128ca0215b49d2a13bde1f5b94a28061
2018-10-19 14:03:28 +02:00
Vincent Rabaud
632798ae6f Merge "Fix compilation on windows and clang-cl+ninja." 2018-10-17 13:02:19 +00:00
Yannis Guyon
dc1a9518bc Merge "libwebp: Unicode command tools on Windows" 2018-10-17 11:55:49 +00:00
Yannis Guyon
9cf9841b5e libwebp: Unicode command tools on Windows
Define macros in examples/unicode.h to use Unicode argv
on Windows. Keep char everywhere on Unix since it handles
UTF-8 without any change.

Impact:
 - All fopen () and SHCreateStreamOnFile(),
 - All fprintf() printing file paths,
 - All strcmp() used with "-",
 - File path parsing,
 - Gif reading.

Concerned executables from examples/ and extras/:
  anim_diff, anim_dump, vwebp, vwebp_sdl,
  cwebp, dwebp, gif2webp, img2webp,
  webpmux, webpinfo, webp_quality, get_disto

When compiled on Windows with Unicode enabled, webpmux and
img2webp will not work when used with an argument file and
will print "Reading arguments from a file is a feature
unavailable with Unicode binaries."

BUG=webp:398

Change-Id: Ic55d222a3ce1a715f9c4cce57ecbe2705d5ce317
2018-10-17 13:19:40 +02:00
Pascal Massimino
981794958b remove some minor TODOs
if we didn't do these, they were probably non vital.

Change-Id: I952d2351f5c71934247d4d6631cfdfe070f76bf5
2018-10-17 10:48:19 +02:00
Vincent Rabaud
a376e7b96a Fix compilation on windows and clang-cl+ninja.
Change-Id: I4e468519e1bcb99da5057f3b6646b077a1e0e7f1
2018-10-16 16:20:47 +02:00
Vincent Rabaud
cbf82cc04d Remove AVX2 files.
There is only enc_avx2.c and we never managed to get
something fast enough.

Change-Id: I7465b5d8ccf47d9aa612173b8f80f96060cdb366
2018-10-16 14:12:03 +02:00
Pascal Massimino
5030e90278 Merge "TIFF decoder: remove unused KINV definition" 2018-10-15 18:16:24 +00:00
Vincent Rabaud
ac5433118a Remove a few more useless #defines
Change-Id: I211e9bcb1c37d0ebc108896f109b23ce915e22b4
2018-10-15 16:26:10 +02:00
Pascal Massimino
123d330699 TIFF decoder: remove unused KINV definition
+ some #undef

Change-Id: Ib8b8357ad3a6458ca421a59d9ad625656dd54afe
2018-10-14 08:24:43 +02:00
James Zern
ef1094b0fe Merge "- install pkg-config files during the CMake build" 2018-10-10 03:25:02 +00:00
Yannis Guyon
b911fbc980 libwebp: Remove duplicate GIFDisplayError in anim_util
GIFDisplayError() is already defined exactly the same way
in gifdec. Remove it from anim_util.c and add dependency.

Change-Id: Iec01b41c44d0b61b3a279b8cd754d9917d64f804
2018-10-09 17:29:54 +02:00
Konstantin Ivlev
eee00b6627 - install pkg-config files during the CMake build
Signed-off-by: Konstantin Ivlev <tomskside@gmail.com>
Change-Id: I88b1a22b19dd9ecdb2ae38082fa9580dbc66d98c
2018-10-08 16:02:12 -07:00
Vincent Rabaud
ac3ec8c91d Merge "Clean-up the common sources in dsp." 2018-10-08 15:19:40 +00:00
Vincent Rabaud
3e13da7b4f Clean-up the common sources in dsp.
Change-Id: I1b995e6517e8437127a433dccbb5b2db63e7c3a3
2018-10-08 15:00:01 +02:00
Yannis Guyon
5c395f1d71 libwebp: cmake-format all
https://github.com/cheshirekow/cmake_format
A complete row of # is replaced by only one,
so add a space after the first one to keep it.

Change-Id: I367749353a555c89c717f1939220699e43ecab2c
2018-10-05 14:23:06 +02:00
Yannis Guyon
e7a697297b libwebp: Add extras targets in CMakeLists.txt
To be compiled with Visual Studio on Windows through CMake.
Targets are get_disto, vwebp_sdl, webp_quality.

Change-Id: Idec1e19b61b6a661011effee42f7440264afd3ed
2018-10-04 18:58:43 +02:00
Yannis Guyon
e52485d6db libwebp: Rename macros in webpmux.c
For clarity and to avoid:
  webpmux -info
  ERROR: Too many arguments for '-info'.

Change-Id: Iae8e62ed8997f7a4ea183d1b3505373255c3c73a
2018-10-03 21:39:38 +02:00
Pascal Massimino
92dc0f0937 clean-up MakeInputImageCopy()
use pointer increments.

Change-Id: I269412d41a58ab9ffd7fc0f3d479fe73a3d07b9e
2018-10-02 14:46:35 +00:00
Pascal Massimino
39952de265 VP8IteratorImport: add missing 'const'
Change-Id: I0b259e2979de787b5e4606ae93f23df1b49e4c8f
2018-10-02 14:46:27 +00:00
Pascal Massimino
382af7a2dd clean-up WebPBlendAlpha
use pointers instead of ptr + y * stride
+ misc re-org

Change-Id: I29fca781aa44f3bed3f8c1e956c5387705c80ed1
2018-10-02 13:57:12 +00:00
Yannis Guyon
14d020f6e6 libwebp: Use ExUtilGet*() in anim_diff
Instead of strtod() or strtol().

Change-Id: I320373cd969c6969cf4b1491391a95668d1b0beb
2018-10-02 13:55:57 +02:00
Yannis Guyon
0d92ff25f2 libwebp: remove useless variable in gif2webp
"out" is never used.

Change-Id: I4441308ef2267b2a9443add240d2fccabfb817f6
2018-10-02 11:39:48 +02:00
Yannis Guyon
556cb1b45e Merge "CMake: Set WEBP_BUILD_GIF2WEBP to off" 2018-10-01 13:14:46 +00:00
Yannis Guyon
da26ee49a6 CMake: Set WEBP_BUILD_GIF2WEBP to off
Instead of unsetting WEBP_BUILD_GIF2WEBP,
disable it to keep it displayed in ccmake.
Disable WEBP_BUILD_GIF2WEBP before it's tested.
Do the same for WEBP_BUILD_ANIM_UTILS.

Change-Id: I91920814fbda4825ced9a801bb005f8d44bfe09c
2018-10-01 13:48:22 +02:00
Yannis Guyon
b2a867c038 cwebp: Don't premultiply during -resize if -exact
Fix issue where color data is discarded in fully transparent
areas when -resize -exact.
BUG=webp:397

Change-Id: I58ce8d5ae172d5d0f0138e07c7df3a3c6cbd0019
2018-10-01 10:14:51 +02:00
James Zern
637141bc7c pngdec: fix build w/libpng < 1.4.x
after:
bc5092b1 pngdec: set memory functions

png_alloc_size_t was added in 1.4 use png_size_t in earlier versions

Change-Id: If65ac1c501e2d497b1be480095bf21f06ea7026a
2018-09-28 17:42:27 -07:00
James Zern
bc5092b162 pngdec: set memory functions
use png_create_read_struct_2 to set a malloc function allowing the code
to fail on large allocations while fuzzing

Change-Id: Iaca1b93ecc6570067708f3ae2db07fbca74386ee
2018-09-28 00:35:47 -07:00
Vincent Rabaud
50d8345ae6 Fix CMake math library.
Just in case we have a warning.

Change-Id: I5f2aabf5f4adaaf9ba6c4fbbbf352603259e8081
2018-09-21 15:40:40 +02:00
Vincent Rabaud
6aa3e8aaf3 Fix math library on Visual Studio.
The code was compiled but optimized, and no math function
was used.

Change-Id: Ib2ab262c072761ec41df8f9260a1e0fe57d01cef
2018-09-11 18:28:44 +02:00
Vincent Rabaud
d71df4e2ee Fix math library finding in CMake.
BUG=webp:396

Change-Id: I8ca35573c242cba24f1e82997b4fb289a48a3005
2018-09-03 14:35:50 +00:00
James Zern
de08d72741 cosmetics: normalize include guard comment
Change-Id: I0e08ec604aad8412cfe3d3670d773f4ae5650375
2018-08-22 14:46:53 -07:00
Yannis Guyon
009562b403 vwebp: Fix bug when Dispose then NoBlend frames
The graphical bug happens when there is a frame disposed to background
color, followed by another frame that does not blend, and their areas
don't fully overlap. Only the previous frame clears its part of the
viewport. The fix consists in clearing the screen for the previous and
the current frame if needed.

Change-Id: I3425cf7297f0c7b2cf13a3a61b517cc0b1c031d8
2018-08-03 14:15:13 -07:00
Vincent Rabaud
423f257930 Fix up CMake to create targets.
Change-Id: I4b0b71d0ab7e49e237bd928de690915cc3b86be2
2018-07-25 14:04:18 +02:00
Vincent Rabaud
907208f97e Wait for all threads to be done in DecodeRemaining.
This could lead to a race condition.

BUG=oss-fuzz:9417

Change-Id: Ifef4001115888541cb76095e1c0226487d497b78
2018-07-20 17:03:01 -07:00
Yannis Guyon
4649b3c422 vwebp: Add background color display option
Option -usebgcolor may be used to display ANIM background color (or white if no ANIM chunk), blended on top of checkerboard. By default this is disabled (old behavior) to easily see transparent areas. Spec says that "background color MAY be used", so it's an option.
Key b may be pressed to toggle ANIM background color display. There are visual artifacts (leftovers) when toggling during an animation. This is already the case for rescaling, toggling info etc. (fixing it implies storing viewport render or rendering whole animation from start till current frame).

BUG=webp:394

Change-Id: If9ab898b2eac77226f30f062d522f9861789ef8f
2018-07-20 12:54:30 +02:00
Yannis Guyon
78ad57a36a Fix bad glClearColor parameters
Container spec indicates that background color is written
in BGRA byte order, but glClearColor() parameters are RGBA.
Anyway the checkerboard is displayed right after glClear()
calls so it replaces background color.

In response to webp-discuss/TkLHALGaHaM

Change-Id: Ief5435fadfd6a422b881a9dc240b5e8dc6546e19
2018-07-18 10:50:33 +02:00
Vincent Rabaud
da96d8d9ab Allow for a non-initialized alpha decompressor in DoRemap.
BUG=oss-fuzz:9364

Change-Id: Ib1a1c6b0ccfcc255505f019e3e8fd15db73bc4b6
2018-07-13 22:09:06 +02:00
Pascal Massimino
2563db4759 fix rescaling rounding inaccuracy
We should be using 'floor' when doing the final divide.

-> new MACRO is MULT_FIX_FLOOR()

     XXX*** Mips code is DISABLED for now ***XXX

I'll update and re-enable it in a later
patch, since this code needs some refactoring first.

BUG=oss-fuzz:9179

Change-Id: Ic0693cdca4e71f5beab1029475e35c4d06b12d13
2018-07-10 22:45:50 -07:00
Pascal Massimino
211f37ee63 fix endian problems in pattern copy
CopyBlock8b() was over-using memcpy() of 16b values.

BUG=webp:393

Change-Id: Id56f10d334b9a453fbcf50dabfaa63529bcff7e5
2018-07-10 05:15:26 +00:00
Vincent Rabaud
5f0f5c07c4 Make sure partition #0 is read before VP8 data in IDecode.
Change-Id: Ie0b264b6422774343206ddba3c2820a0cf37ffc0
2018-07-09 20:20:52 +02:00
Pascal Massimino
de98732b04 fix GetColorf() bug
We should only use the lower 8 bits, masking was missing.

Change-Id: I3072168e100b242356ad57b5a73b7f4d6ebfbb9e
2018-07-06 21:25:41 -07:00
Yannis Guyon
4338cd36fe misc fixes in libwebpmux
* Assert chunklist
  * fix potential memory leak and
  * fix null pointer access

There should not be several alpha_ or img_ chunks in SynthesizeBitstream. Use ChunkListDelete in MuxImageRelease to be safe.
A null pointer accessed in WebPMuxPushFrame triggered a harmless runtime error.

Change-Id: I3027f8752093652bd41f55e667d041c0de77ab6e
2018-07-04 19:03:21 +00:00
Pascal Massimino
e00af13ef4 fix signatures after a9ceda7ff1
fixes vs10_x64 build.

Change-Id: I636e6a5bea1239bacdaa4d160be1d645636c3ae8
2018-07-04 06:03:37 +00:00
Vincent Rabaud
a9ceda7ff1 Speed-up chunk list operations.
The chunk list only has two operations: append and set
to one element. The two operations are split and the append
one is sped up by storing the last element.
Corrupted data could make a very long list to search through.

BUG=oss-fuzz:9190

Change-Id: I1aa813ca629df29efaa3b46dbd4c4c42dbeaa34c
2018-07-03 16:36:34 +02:00
Vincent Rabaud
2281bbf6f7 Merge "Better handling of bogus Huffman codes." 2018-07-03 08:33:35 +00:00
Vincent Rabaud
39cb9aad85 Better handling of bogus Huffman codes.
The standard allows for Huffman images with any coefficients.
Hence potentially big memory allocations. The previous workaround
was "trying" things out, the new one is more rigorous and
only allocates what is needed, modifying the Huffman image
to contain the minimal set of coefficients.

BUG=oss-fuzz:8623,oss-fuzz:9111,oss-fuzz:9134

Change-Id: I6a972e90e4ae509c15cb41ee22c58b775fa3f4aa
2018-07-03 10:00:52 +02:00
Pascal Massimino
89cc9d3787 Merge "fix read-overflow while parsing VP8X chunk" 2018-07-03 03:06:42 +00:00
Pascal Massimino
95fd650706 fix read-overflow while parsing VP8X chunk
The available size was not checked before parsing the VP8X data

BUG=oss-fuzz:9100,oss-fuzz:9123

Change-Id: I0143cc4554883c1015e2f084a0e371229e04a8ca
2018-07-03 02:36:25 +00:00
Yannis Guyon
9e729fe19b Fix VP8IoTeardownHook being called twice on worker sync failure
idec_dec.c, DecodeRemaining: Set decoder state to ERROR to prevent VP8ExitCritical to be called again

Change-Id: Id5f893f45c348e1c529680d930e640f780a73d4c
2018-07-02 13:37:46 +02:00