Commit Graph

3761 Commits

Author SHA1 Message Date
James Zern
08ea9ecde3 imageio: add ability restrict max image size
WEBP_MAX_IMAGE_SIZE can be defined to control this limit.
Set it to 1.5GiB w/--config=asan-fuzzer to avoid OOM with large resolution
images. This limit leaves some headroom over the single image max of 2^14 *
2^14 * 4

BUG=webp:355

Change-Id: I4d48eb0a063638297a842582e0229dfd5a54df5f
2017-08-08 07:02:02 -07:00
James Zern
6f9daa4a3a jpegdec,ReadError: fix leaks on error
everything post jpeg decoder creation should go through the error path
to ensure it's cleaned up properly

Change-Id: If78b4529e40797c67c3d0e624af1c036badea674
2017-08-08 07:02:00 -07:00
skal
a0f72a4fe0 VP8LTransformColorFunc: drop an non-respected 'const' from the signature.
BUG=webp:355

Change-Id: Ie99bf377a55db2950bfbac9423bfe0967623ea5d
2017-08-07 19:05:01 -07:00
Pascal Massimino
8c934902cd Merge "Lossess dec: harmonize the function suffixes" 2017-08-08 02:04:10 +00:00
skal
622242aaba Lossess dec: harmonize the function suffixes
BUG=webp:355

Change-Id: I445d64df6aa2e347f41e7af306be12a77e2ac6a5
2017-08-07 18:22:41 -07:00
skal
1411f02761 Lossless Enc: harmonize the function suffixes
BUG=webp:355

Change-Id: I8baf506bd2a27095b956ef22a862b071f60c0d72
2017-08-07 18:02:07 -07:00
Vincent Rabaud
24ad2e3c99 add const to two variables
Change-Id: I97374ccbf118baa59425346ffc439036a4482bf4
2017-08-07 23:02:15 +02:00
Pascal Massimino
46efe062b8 Merge "Allow the lossless cruncher to work for alpha." 2017-08-07 21:00:02 +00:00
Vincent Rabaud
8c3f9a4706 Speed-up LZ77.
No need to look for a bigger maximum reach if we reach the end
of the image.

Change-Id: I56b166f9266f15cdff5aa59a75559972db19858f
2017-08-07 21:01:27 +02:00
Vincent Rabaud
1aef4c710b Allow the lossless cruncher to work for alpha.
Change-Id: I7185e75404fae8c739e0536026f4687d25decad7
2017-08-07 20:58:05 +02:00
Vincent Rabaud
b8821dbd81 Improve the box LZ77 speed.
For a pixel, we look for the longest match starting in a window around it.
For the following pixel, the previous result can be used and smaller
search window is used.

Change-Id: Ice16f9a7c8754099d068380848f0d77de3f756ac
2017-08-06 20:15:20 +02:00
James Zern
7beed2807b add missing ()s to macro parameters
BUG=webp:355

Change-Id: I616c6d3540d6551edd1b1cfdb5bffcf0a044c90f
2017-08-04 17:02:53 -07:00
James Zern
6473d20b3e Merge "fix Android standalone toolchain build" 2017-08-04 18:25:21 +00:00
James Zern
dcefed950b Merge "build.gradle: fix arm64 build" 2017-08-03 02:21:26 +00:00
James Zern
0c83a8bc69 Merge "yuv: harmonize suffix naming" 2017-08-02 06:35:36 +00:00
James Zern
c6d1db4b36 fix Android standalone toolchain build
add a check for cpu-features.h and rework some of the ifdef's around
android + neon. for android builds with cpu-features enabled the
*_neon.c files will still need to be flagged correctly (with e.g.,
.c.neon in Android.mk) to properly build them.

BUG=webp:353

Change-Id: I905ce305af0a204e560b915d8665093a3edaceb9
2017-08-01 22:59:03 -07:00
skal
663a6d9d2e unify the ALTERNATE_CODE flag usage
Pattern is now:
 #if !defined(FLAG)
 #define FLAG 0   // ALTERNATE_CODE
 #endif
...
 #if (FLAG == 1)
 ...
 #else
  ...
 #endif    // FLAG
...

Removed some unused code / flags:
  WEBP_YUV_USE_TABLE, WEBP_REFERENCE_IMPLEMENTATION,
  experimental code,  VP8YUVInit(), ...

BUG=webp:355

Change-Id: I98deb9189446a4cfd665c13ea8aa1ce6a308c63f
2017-08-01 20:49:29 -07:00
skal
73ea9f2702 yuv: harmonize suffix naming
BUG=webp:355

Change-Id: I403c4b3cdfc55b3b1648f98a1d189326a3e660a3
2017-08-01 20:40:00 -07:00
James Zern
c71b68ac45 build.gradle: fix arm64 build
only armv7-a uses .c.neon, arm64 has NEON by default; this matches the
Android.mk

Change-Id: Iee2bcf6a532cf54e31866d9db6923c3f0a1d88ba
2017-08-01 18:31:13 -07:00
skal
c4568b47fd Rescaler: harmonize the suffix naming
BUG=webp:355

Change-Id: I7720502c62f96c780793d3d881eac7b3afae1418
2017-08-01 23:49:44 +00:00
Pascal Massimino
6cb13b0532 Merge "alpha_processing: harmonize the naming suffixes to be _C()" 2017-08-01 03:38:03 +00:00
James Zern
83a3e69a20 Merge "simplify WEBP_EXTERN macro" 2017-08-01 03:29:12 +00:00
Pascal Massimino
7295fde2e6 Merge "filters: harmonize the suffixes naming to _SSE2(), _C(), etc." 2017-08-01 01:55:48 +00:00
James Zern
8e42ba4c80 simplify WEBP_EXTERN macro
including the type in the macro doesn't bring much benefit to ordering,
current platforms work with a prefix, this would be insufficient if the
attribute needed to follow the function prototype. this form makes it
easier to override on the command line.

BUG=webp:355

Change-Id: Iba41ec0bb319403054be0e899c4cc472dd932fd9
2017-07-31 18:27:52 -07:00
skal
331ab34bcd cost*.c: harmonize the suffix namings
BUG=webp:355

Change-Id: Ic2e60eaab71cdffe1ebf93fc36aaa3eb25bbf08d
2017-07-31 17:18:32 -07:00
skal
b161f670f8 filters: harmonize the suffixes naming to _SSE2(), _C(), etc.
BUG=webp:355

Change-Id: I28f464eb13444c3046332cdda3c547f81700ecf4
2017-08-01 00:09:05 +00:00
skal
dec5e4d330 alpha_processing: harmonize the naming suffixes to be _C()
BUG=webp:355

Change-Id: Iae8221cd34957764ead21aa46abfc320e5514a4b
2017-07-31 23:34:24 +00:00
skal
6878d42720 fix memory leak in SDL_Init()
we use a static guard to only call SDL_Init() once.

Another option would be to call SDL_Quit(), but it doesn't seem to be
doing anything.

Also, fix the HTML code and add 'use strict' directive.

BUG=webp:354

Change-Id: I3c6421e2c1c8cc200556cd4092a0ead9a8b054ef
2017-07-31 12:47:02 -07:00
Pascal Massimino
461ae5551b Merge "configure: fix warnings in sdl check" 2017-07-18 07:48:34 +00:00
James Zern
62486a2206 configure: test for -Wundef
Change-Id: Ia4bcde5276ae9572c5b3152e578d59a4e3552988
2017-07-11 16:12:36 -07:00
James Zern
92982609bc dsp.h: fix -Wundef w/__mips_dsp_rev
Change-Id: I552a543c7b039774041b43ace75b0cbea566b119
2017-07-11 16:12:32 -07:00
James Zern
0265cede89 configure: fix warnings in sdl check
correct shell syntax, drop trailing ','

Change-Id: I0535bdf92f03e17902a844d8e7d742b351ce4822
2017-07-11 15:38:18 -07:00
James Zern
88c73d8a7a backward_references_enc.h: fix WINDOW_SIZE_BITS check
this check was relocated in:
b903b80c Split cost-based backward references in its own file.

quiets -Wundef

Change-Id: I7f7a4773fb8cc77ca9f671b11f50d5db2275d415
2017-07-11 15:36:14 -07:00
James Zern
4ea49f6b82 rescaler_sse2.c: fix WEBP_RESCALER_FIX -> _RFIX typo
quiets -Wundef

Change-Id: I8f1facf401b6f1ab393005c93086ac3e2ae354d5
2017-07-11 15:35:27 -07:00
Vincent Rabaud
1b526638b8 Clean-up some CMake
- some image libraries define _INCLUDE_DIR and not INCLUDE_DIRS.
- CMakePushCheckState is a non-destructive way of changing the
CMAKE_REQUIRED_* variables.

Change-Id: I7d318a0ddf9754a5c047f47ba1713f9f94e1ec1c
2017-07-10 16:29:33 +02:00
James Zern
87f57a4b62 Merge "cmake: fix gif lib detection when cross compiling" 2017-07-07 07:55:48 +00:00
James Zern
b34a9db1a1 cosmetics,dec_sse2: remove some redundant comments
Change-Id: I5a59d6dde9b6638b318f36d51d0d53870a3de273
2017-07-06 23:19:18 -07:00
James Zern
471c5755fc cmake: fix gif lib detection when cross compiling
GIF find_package only locates the header and library, it doesn't fail
compile tests when detecting the version, but falls back to 3 (as of at
least cmake 3.7.2). Make sure the library links to avoid incorrect
detection when cross compiling.

Change-Id: I0224180bbdf800ab261a9333236730b23c006e69
2017-07-06 15:33:31 -07:00
James Zern
c793417a3c cmake: disable gif2webp if gif lib isn't found
Change-Id: I218d5c0e3f4a82905c743705382cf02d26b29e6d
2017-07-06 15:33:01 -07:00
James Zern
dcbc1c881a cmake: split gif detection from IMG deps
gifdec isn't part of imageio lib, it's only used by gif2webp.

Change-Id: I70bff378a32f8fb2ebb8a5a7701049ffff7f7992
2017-07-06 15:32:55 -07:00
James Zern
66ad84f0f9 Merge "muxread: remove unreachable code" 2017-07-05 23:48:45 +00:00
Pascal Massimino
50ec3ab790 muxread: remove unreachable code
IDX_UNKNOWN chunks are handled separately in WebPMuxGetChunk()

Change-Id: Iaa0d3a1cd1080264c27671637551f52f71d73b07
2017-07-05 15:47:50 -07:00
hui su
7d67a1646d Lossy encoding: smoothen transparent areas to improve compression
If "exact" is false, we can modify the luma samples in fully transparent
areas to facilitate lossy compression. Experiments on some PNG images
show compression improvement of more than 20%.

Change-Id: I1a728cfa920a6652bc1f600d87c01f7f648c4942
2017-07-05 10:03:01 -07:00
James Zern
e50650c77f Merge "fix signature for DISABLE_TOKEN_BUFFER compilation" 2017-07-02 07:33:52 +00:00
Pascal Massimino
671d2567d4 fix signature for DISABLE_TOKEN_BUFFER compilation
Change-Id: Idb7aa2503c7870ef3b15a23325832428d47ae7c6
2017-07-01 14:46:28 -07:00
James Zern
d67555809f cpu.cmake: use unique flag to test simd disable flags
this avoids the result being cached in a common variable causing
potentially incorrect results in future tests and improves the logging
output

BUG=webp:351

Change-Id: I4b3110beec38f505fc8f835c3ea689a7d81a36bb
2017-06-28 19:13:34 -07:00
Vincent Rabaud
28914528e1 Merge "Remove the argb* files." 2017-06-25 15:57:17 +00:00
Vincent Rabaud
8acb4942f7 Remove the argb* files.
Half of the functionality was duplicated.
The rest is about the alpha channel handling so we
might as well put it in the appropriate file.

Change-Id: I8d5ef0afce82cc4842ab7132fd97995c42e6140a
2017-06-25 14:44:33 +02:00
James Zern
3b62347b0f README: correct cmake invocation note
the default invocation given generates makefiles, not a configure script

Change-Id: Ia65b120289b497c2f2981fec330456682d11162a
2017-06-21 16:36:09 -07:00
Vincent Rabaud
7ca0df1363 Have the SSE2 version of PackARGB use common code.
The common code actually got sped-up by 25% by using the code
from PackARGB.

Change-Id: I94be6ccff2bfe02fff13c8e2698669e6a0d8fc74
2017-06-20 17:41:14 +02:00