Commit Graph

4124 Commits

Author SHA1 Message Date
James Zern
7b968cc2d5 update AUTHORS
Change-Id: Ic19305928b563110093254e6177f22bbd65b0827
2019-07-04 10:42:46 -07:00
Pascal Massimino
9d6988f44d Fix the oscillating prediction problem at low quality
For some exact resonance the over-quantization was exactly
compensating the under-quantization, leading to resonance
and strange patterns.

-> we special-handle the very flat blocks, hopefully for the
greater good (and not just the bad-resonance case).

For 'fast mode' (-m 3 or less), we just pay special attention
to the border of the image, where the oscillation / instability
usually starts. For the inner part of the image, since we're not
doing rd-opt, it's harder to fix anything.

Overall, on 'regular' images, the change is written the noise,
often leading to overall faster encoding (because of the short-cut).

BUG=webp:432

Change-Id: Ifaa8286499add80fd77daecf8e347abbff7c3a15
2019-07-03 08:40:41 -07:00
James Zern
312f74d010 makefile.unix: allow *_LIBS to be overridden w/EXTRA_LIBS
previously setting EXTRA_LIBS on the command line would skip any
per-target updates. this allows both EXTRA_LIBS and [CD]WEBP_LIBS,
GL_LIBS to be set together avoiding the need to add unnecessary
dependencies to EXTRA_LIBS which affects all targets.

Change-Id: I63bbc14f0ac0cd04aa50c5d5047060ac57d0c9dc
2019-07-01 19:49:18 -07:00
James Zern
92dbf23775 filters_sse2,cosmetics: shorten some long lines
Change-Id: Ifd8ddec50821aba175d41237df18e41b9ac6c7d4
2019-07-01 12:17:43 -07:00
James Zern
a277d197a2 filters_sse2.c: quiet integer sanitizer warnings
missed in a788b49

with clang7+ quiets conversion warnings like:
implicit conversion from type 'int' of value -114 (32-bit, signed) to
type 'uint8_t' (aka 'unsigned char') changed the value to 142 (8-bit,
unsigned)

Change-Id: I52dcd9cd613107f5424177c277785b92430bffb7
2019-07-01 11:16:50 -07:00
Vincent Rabaud
804540f183 Fix cpufeatures in CMake.
cpufeatures was not installed even though WebP depends on it on Android.

BUG=webp:415

Change-Id: Iba00001534ceedbf65fbb42244a6c1341eb65134
2019-07-01 10:48:54 +02:00
Vincent Rabaud
bf00c15b23 Add CMake option for bittrace.
Change-Id: I9f09eb2c0afdac41e94bc10dfedd1fd004c45731
2019-07-01 10:48:54 +02:00
James Zern
a788b49897 filters_sse2.c: quiet integer sanitizer warnings
with clang7+ quiets conversion warnings like:
implicit conversion from type 'int' of value -114 (32-bit, signed) to
type 'uint8_t' (aka 'unsigned char') changed the value to 142 (8-bit,
unsigned)

Change-Id: I7f08a836ddcf777454dfd5b877a81b62b2abac86
2019-06-28 23:22:49 -07:00
James Zern
e6a92c5e15 filters.c: quiet integer sanitizer warnings
with clang7+ quiets conversion warnings like:
implicit conversion from type 'int' of value -12 (32-bit, signed) to
type 'uint8_t' (aka 'unsigned char') changed the value to 244 (8-bit,
unsigned)

Change-Id: I053c92301e55dcb0cae89a7733636283da942176
2019-06-28 23:16:28 -07:00
James Zern
ec1cc40a59 lossless.c: remove U32 -> S8 conversion warnings
Change-Id: Ica2664ea087254959391275654412141ed9472df
2019-06-28 01:34:55 -07:00
Pascal Massimino
1106478f42 remove conversion U32 -> S8 warnings
using an inline U32ToS8() function

Change-Id: I45f535c6c9b5de33d69acc17b466e183fcc19a63
2019-06-24 16:42:42 -07:00
Skal
812a6b49fc lossless_enc: fix some conversion warning
object code is unchanged.

Change-Id: I40fc16056c0ab44c5c57ef6b02af14be767abe87
2019-06-24 16:16:18 +02:00
James Zern
4627c1c91b lossless_enc,TransformColorBlue: quiet uint32_t conv warning
no change in object code

from clang-7 integer sanitizer:
implicit conversion from type 'uint32_t' (aka 'unsigned int') of value
1955895199 (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char')
changed the value to 159 (8-bit, unsigned)

Change-Id: I0c3022339e34b9c9af03167ab827ade677973644
2019-06-20 23:06:13 -07:00
James Zern
c84673a62f lossless_enc_sse{2,41}: quiet signed conv warnings
_mm_set1_epi16 takes a short argument

from clang-7 integer sanitizer:
implicit conversion from type 'int' of value 65280 (32-bit, signed) to
type 'short' changed the value to -256 (16-bit, signed)

Change-Id: Iad64f6209a8c130a7df67515451ded45b3f91702
2019-06-15 00:22:03 -07:00
James Zern
776a775709 dec_sse2: quiet signed conv warnings
_mm_set1_epi8() takes a char argument
_mm_insert_epi16 takes a short argument

from clang-7 integer sanitizer:
implicit conversion from type 'int' of value 189 (32-bit, signed) to
type 'char' changed the value to -67 (8-bit, signed)
implicit conversion from type 'int' of value 128 (32-bit, signed) to
type 'char' changed the value to -128 (8-bit, signed)
implicit conversion from type 'int' of value 33909 (32-bit, signed) to
type 'short' changed the value to -31627 (16-bit, signed)

Change-Id: Id6b191b2c06881e27d447eeb1ff5bb2c1857b6ba
2019-06-14 01:00:20 -07:00
James Zern
bd39c063ce Merge "thread_utils: release mutex before signaling" 2019-06-12 06:15:22 +00:00
James Zern
0550576faa Merge "(alpha_processing,enc}_sse2: quiet signed conv warnings" 2019-06-11 17:42:04 +00:00
James Zern
6682f2c415 thread_utils: release mutex before signaling
holding the associated mutex while signaling a condition variable isn't
necessary and in some implementations will reduce performance as the
woken thread may test the mutex, fail and go back to sleep.

Change-Id: Id685a47b0c76fc4a1c5acedcb6623e8c55056415
2019-06-10 23:09:56 -07:00
James Zern
e78dea7587 (alpha_processing,enc}_sse2: quiet signed conv warnings
_mm_set1_epi8() takes a char argument
_mm_insert_epi16 takes a short argument

from clang-7 integer sanitizer:
implicit conversion from type 'int' of value 255 (32-bit, signed) to
type 'char' changed the value to -1 (8-bit, signed)
implicit conversion from type 'int' of value 33153 (32-bit, signed) to
type 'short' changed the value to -32383 (16-bit, signed)

Change-Id: Ic88c8ef3d00146d34f53a560582db673f818370d
2019-06-10 14:23:58 -07:00
Aidan O'Loan
9acf18ba46 iosbuild.sh: add WebP{Demux,Mux}.framework
Change-Id: I2c16475a7bf9f63d07f4298df7c68859226669d5
2019-06-10 11:51:21 -07:00
Pascal Massimino
b9be7e65f8 vwebp: remove the -fit option (and make it default)
BUG=webp:433

Change-Id: I18476ba0ada0184d4d9e94060d601002bfa006da
2019-06-05 21:43:23 +02:00
James Zern
1394a2bb86 Merge "README.webp_js: update Emscripten.cmake note" 2019-05-31 08:40:50 +00:00
James Zern
dd3e7f8a2f README.webp_js: update Emscripten.cmake note
recent versions of the sdk don't set the EMSCRIPTEN environment
variable; provide a workaround.

Change-Id: I1c4991cda0261a51201d27723eb69f48422c47a0
2019-05-31 01:05:55 -07:00
James Zern
32cf880132 predictor_enc,GetBestGreenRedToBlue: quiet implicit conv warnings
no change in object code

from clang-7 -fsanitize=implicit-integer-truncation
implicit conversion from type 'int' of value -16 (32-bit, signed) to
type 'uint8_t' (aka 'unsigned char') changed the value to 240 (8-bit,
unsigned)

Change-Id: Ia7cbaad247ab22b505b7f98b1247219c024f6db0
2019-05-31 00:06:23 -07:00
Pascal Massimino
e1c8acb5bd Merge "vwebp: add a -fit option" 2019-05-29 08:27:48 +00:00
Pascal Massimino
cbd23dd5b4 vwebp: add a -fit option
This is to make the initial window be rescaled in case the image
dimension is too large to fit the display.

BUG=webp:433

Change-Id: Ib04c12962bc8c26e74c8a6193829214da636ebde
2019-05-29 08:39:47 +02:00
James Zern
2e672351aa bit_writer_utils,Flush: quiet implicit conversion warnings
no change in object code

from clang-7 -fsanitize=implicit-integer-truncation
implicit conversion from type 'int32_t' (aka 'int') of value 287
(32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the
value to 31 (8-bit, unsigned)

Change-Id: I692368bcc2f41412697b8ae51e53078831072891
2019-05-25 12:31:09 -07:00
James Zern
1326988d10 swig: update libwebp_python_wrap.c
regenerated with swig 3.0.10

matches the version used to update libwebp.py in:
0e7f8548 update generated swig files

Change-Id: I976a1a6b673c8174db5e97e8316c59970582e565
2019-04-18 15:30:11 -07:00
Skal
0e7f854897 update generated swig files
regenerated with swig 3.0.10

Change-Id: Ib3a26f6ab4ba0d4a4dfbb15b89be155998f94ad9
2019-04-18 06:47:52 +02:00
James Zern
17ed143879 Merge "PutLE{16,24}: quiet implicit conversion warnings" 2019-04-05 02:03:05 +00:00
James Zern
24686538be PutLE{16,24}: quiet implicit conversion warnings
no change in object code

from clang-7 -fsanitize=implicit-integer-truncation
implicit conversion from type 'int' of value 39736 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 56 (8-bit, unsigned)

Change-Id: I0ecf24c5b1b11e056c58b3b85ea529c30cdadf57
2019-04-03 22:45:59 -07:00
Pascal Massimino
153bb3a0ef fix some clang-7 warnings:
"implicit conversion from type 'uint32_t' (aka 'unsigned int') of value xxxxx (32-bit, unsigned) to type 'uint8_t' (aka 'unsigned char') changed the value to xx (8-bit, unsigned)"

and same with signed -> unsigned conversion with truncation.

Change-Id: I50cae41a9ce7edcfcc814cc3ee2556b927064f43
2019-04-03 21:25:07 +00:00
Pascal Massimino
ab2dc8939f Rescaler: fix rounding error
We saturate the result to [0..255]
It's the easiest and safest, given the wide variety of scaling
range we cover: we're not using floats, so precision is always
an issue at one end or the other of the scaling spectrum.

we also use:
  round(a - floor(b))
instead of:
  floor(a - round(b))
to handle difficult cases (ratio ~= .99, e.g.)

MIPS code is still disabled (and wrong)

Change-Id: I18d3f5ddc4c524879c257b928329b1c648fa7fb5
2019-03-30 06:43:55 +00:00
James Zern
aa65f89a8f HistogramCombineStochastic: fix free of uninit value
previously if the mappings allocation failed histo_queue->queue would be
uninitialized; split the conditionals

Change-Id: I1b50b987e734393893dc8a83a3f314522ccd0c83
2019-03-29 23:31:02 -07:00
James Zern
af0bac643a Merge "encode.h: mention 'exact' default in WebPEncodeLossless*" 2019-03-18 18:04:55 +00:00
James Zern
6d2e11ec8b encode.h: mention 'exact' default in WebPEncodeLossless*
note that config.exact defaults to 0 and point users to WebPEncode() if
the default isn't acceptable.

BUG=webp:424

Change-Id: I179c34649834aeadc1606d0856f33e8255048ea1
2019-03-17 07:02:46 +00:00
James Zern
8c3f04febb AndroidCPUInfo: reorder terms in conditional
'var != constant' is the preferred style for the library

Change-Id: I226e6d5d80dddd0469808136605f49205d238341
2019-03-15 18:12:04 -07:00
Pascal Massimino
fcfd9c71b4 BitTrace: if BITTRACE is > 0, record and print syntax bits used
* Bittrace decoding is ~3x slower.
* Binary is the same byte-wise if BITTRACE=0
* Example output:
=== Bit traces ===
global-header    :    174 bytes   	[ 0.69%] [count:    1850]
segments         :    246 bytes   	[ 0.98%] [count:    3072]
block-size       :    170 bytes   	[ 0.68%] [count:    1536]
pred-modes       :   3829 bytes   	[15.27%] [count:   51458]
pred-modes-uv    :    279 bytes   	[ 1.11%] [count:    2329]
coeffs           :  20370 bytes   	[81.27%] [count:  212914]
Total: 25065 bytes

Change-Id: Ie32569c4e54a7ec13264e68d2dae2ce45c8536cb
2019-03-15 07:23:50 +01:00
Vincent Rabaud
067031eaed Speedups for unused Huffman groups.
If we know a Huffman group is unused, do not build
it: just check that it is valid.

Change-Id: Ie8223fe1afa1e769085a23ab92e730edd9060176
2019-03-11 16:53:06 +01:00
Yannis Guyon
01ac46bae6 libwebp: Display "libjpeg error:" in imageio/jpegdec
For clearer error message in cwebp.

BUG=webp:420

Change-Id: Ie60b53c4c6b77a96f81f3b5cd285b7c7003a1308
2019-03-08 19:09:41 +01:00
Skal
d9a662e1aa WebPRescalerGetScaledDimensions: round scaled dimension up
This is to prevent resizing to dimension 0

+ added some safety checks about src_width > 0 and src_height > 0

BUG=webp:418

Change-Id: Ic04a53ad26455d80538bc8681882a554fca2a340
2019-02-18 14:34:03 +01:00
Yannis Guyon
62eb3f087a libwebp: Fix missing '{' in README
Change-Id: I205e9dc24450b258b416550cd3f59ce5049546c7
2019-02-15 09:45:34 +01:00
James Zern
e05f785a66 Merge "unicode,INIT_WARGV: add missing cast" 2019-01-25 08:58:32 +00:00
James Zern
63c9a69fbd tag the VP8LHashPix() function for potential uint roll-over
BUG=webp:412

Change-Id: I10af39b774ef8e5d138670ddeaca4e15eade4ff6
2019-01-24 16:45:02 -08:00
James Zern
2b7214ab99 unicode,INIT_WARGV: add missing cast
CommandLineToArgvW() returns a LPWSTR*, storing to const LPWSTR* is
incorrect without a cast; fixes gcc -Wincompatible-pointer-types
and clang(-cl) -Wincompatible-pointer-types-discads-qualifiers warnings

Change-Id: Iad5b49c4862c7be68251272e50d3c751099559bc
2019-01-24 07:08:55 +00:00
Skal
bf424b46a3 tag the GetPixPairHash64() function for potential uint roll-over
BUG=webp:412

Change-Id: I448583d72378afc0c6fabec45d4f8a2d6164ab15
2019-01-23 21:29:54 +01:00
Vincent Rabaud
7d05d6ca91 Have the color cache computation be u32-bit only.
BUG=webp:412

Change-Id: I18a3acb1b7f5d64f538b5c27521bc9e8dd599f5e
2019-01-23 11:49:08 +01:00
Vincent Rabaud
6bcf876980 Remove BINARYEN_METHOD in wasm settings.
This was removed according to https://kripken.github.io/emscripten-site/docs/compiling/WebAssembly.html#debugging

BUG=webp:413

Change-Id: If8f1a3f1260d34cdd2b937b286e4c57fb48ed828
2019-01-23 11:12:26 +01:00
James Zern
2b98df90cb update ChangeLog
Change-Id: I805c2c1791f74771d3355f8143e3a697c72b39cd
2019-01-14 20:38:05 -08:00
James Zern
61e372b7e3 update NEWS
Change-Id: I179bf63a718221dab4b4335fdccd78e9b36242c7
2019-01-14 20:24:07 -08:00