Commit Graph

3750 Commits

Author SHA1 Message Date
hui su
3ebe1c0003 AnimEncoder: avoid freeing uninitialized memory pointer.
In GenerateCandidates(), when candidate_ll->evaluate_ and
candidate_lossy->evaluate_ are both true, if lossless encoding
exits on error, candidate_ll->evaluate_ would not be correctly
reset. This will cause freeing uninitialized memory pointer in
SetFrame().

BUG=webp:322

Change-Id: I481b49a186e4fa3607ce71b4543a481083edf444
2016-12-13 17:39:16 -08:00
Pascal Massimino
df780e0eac fix a potential overflow with MALLOC_LIMIT
BUG=webp:321

Change-Id: Iab89dfe167fb394fcdffd3b2732d4ac9bef764b0
(cherry picked from commit 76bbcf2ed6)
2016-12-13 16:15:28 -08:00
Pascal Massimino
58fc507842 Merge "PredictorSub: implement fully-SSE2 version" 2016-12-13 11:03:13 +00:00
Pascal Massimino
9cc421675b PredictorSub: implement fully-SSE2 version
and inline the C-version too.

Predictor #13 is still a hard one.

Change-Id: Iedecfb5cbf216da4e28ccfdd0810286133f42331
2016-12-13 02:19:35 -08:00
Pascal Massimino
0aa1f35c0f remove dependency of imageio/ to stopwatch.h
Change-Id: I9b8e3909e97a26644b5ba6cbd9b29b8ef1727ba7
2016-12-12 22:49:19 -08:00
Pascal Massimino
cb9ec84b54 Merge "remove the dependency to stop_watch.[ch] in imageio" 2016-12-13 06:48:07 +00:00
Pascal Massimino
dc0c01fbd3 Merge "anim_util: quiet implicit conv warnings in 32-bit" 2016-12-13 06:14:56 +00:00
Pascal Massimino
827d3c5038 Merge "fix a potential overflow with MALLOC_LIMIT" 2016-12-13 06:10:56 +00:00
James Zern
1e2e25b0d4 anim_util: quiet implicit conv warnings in 32-bit
the sizes are already validated by CheckSizeForOverflow(), add casts to
size_t to avoid -Wshorten-64-to-32

Change-Id: Ida9102c2104f4a334a0ad16d6e01a12bedfd4eec
2016-12-12 19:06:14 -08:00
James Zern
218460cdd7 bump version to 0.5.2
libwebp{,decoder} - 0.5.2
libwebp libtool - 6.2.0
libwebpdecoder libtool - 2.2.0

mux - 0.3.2
libtool - 2.2.0

demux - 0.3.1
libtool - 2.1.0

Change-Id: Idf199415c325e6e9d157459a4e016ebba88c3f34
2016-12-12 17:36:12 -08:00
James Zern
de7d654d0d update AUTHORS & .mailmap
Change-Id: If4d71ede51f91959e4990f3455c781a8bcf4d373
2016-12-12 17:36:09 -08:00
Pascal Massimino
273367c130 Merge "dsp/lossless.c,cosmetics: fix indent" 2016-12-12 22:30:45 +00:00
Pascal Massimino
76bbcf2ed6 fix a potential overflow with MALLOC_LIMIT
BUG=webp:321

Change-Id: Iab89dfe167fb394fcdffd3b2732d4ac9bef764b0
2016-12-12 13:40:40 -08:00
Pascal Massimino
8ac1abfe13 Merge "jpegdec: correct ContextFill signature" 2016-12-12 21:07:18 +00:00
Pascal Massimino
cb215aed5c remove the dependency to stop_watch.[ch] in imageio
Passing the 'verbose' flag to DecodeWebP() wasn't mandated,
and was creating a forced dependency between imageio/ and examples/

Change-Id: Ib3d3f381a7b699df369a97cfb44360580422df11
2016-12-12 22:01:36 +01:00
James Zern
2423017a28 dsp/lossless.c,cosmetics: fix indent
after:
fbba5bc optimize predictor #1 in plain-C For some reason, gcc has hard
time inlining this one...

Change-Id: I2e2416593acd4c9d14958d8757bfd284d999100b
2016-12-12 12:53:23 -08:00
James Zern
74a12b10d9 iosbuild.sh: add WebPDecoder.framework + encoder
WebPDecoder.framework replaces WebP.framework as the decode-only
framework.
WebP.framework now includes the full library allowing for use of the
encoder.

BUG=webp:307

Change-Id: Ic8139f201576bf94b0d4a31cb7cad0655cd8ba97
(cherry picked from commit 1d5046d1f9)
2016-12-12 12:50:49 -08:00
James Zern
a9cc762196 Merge "iosbuild.sh: add WebPDecoder.framework + encoder" 2016-12-12 20:49:39 +00:00
Pascal Massimino
fbba5bc2c1 optimize predictor #1 in plain-C
For some reason, gcc has hard time inlining this one...

Also optimize predictor #0 and #1 for encoding, so we don't have to
call the generic pointers VP8LPredictors[...]

Change-Id: I1ff31e3b83874b53f84fe23487f644619fd61db9
2016-12-12 17:41:36 +01:00
Pascal Massimino
9ae0b3f65a Merge "SSE2: slightly (~2%) faster Predictor #1" 2016-12-12 14:46:21 +00:00
Pascal Massimino
c1f97bd758 SSE2: slightly (~2%) faster Predictor #1
by removing a load from memory

Change-Id: If6c4aa7fb99309d09f943393ec772891449971f0
2016-12-12 02:24:38 -08:00
Pascal Massimino
ea664b8995 SSE2: 10% faster Predictor #11
Change-Id: I14ae5f6603071b86dfdbe8e6f7dfdbe5d8510185
2016-12-12 02:20:41 -08:00
Hui Su
be7dcc088c AnimEncoder: Correctly skip a frame when sub-rectangle is empty.
Change-Id: I0d288bd9561b48cf5a1eae92a1b7106ba44c664e
(cherry picked from commit 1cc79e92ac)
2016-12-09 20:22:31 -08:00
Hui Su
408858308a Fix assertions in WebPRescalerExportRow()
Change-Id: I25711dd54e71c90a25f7b18e0ef9155e8151a15e
(cherry picked from commit 27b5d991e2)
2016-12-09 20:22:25 -08:00
James Zern
1d5046d1f9 iosbuild.sh: add WebPDecoder.framework + encoder
WebPDecoder.framework replaces WebP.framework as the decode-only
framework.
WebP.framework now includes the full library allowing for use of the
encoder.

BUG=webp:307

Change-Id: Ic8139f201576bf94b0d4a31cb7cad0655cd8ba97
2016-12-09 19:08:53 -08:00
James Zern
cec7201447 jpegdec: correct ContextFill signature
fill_input_buffer returns a boolean

Change-Id: I208a1a862fa6c57cb5b73568b84055f734c1c36f
2016-12-09 18:20:25 -08:00
Pascal Massimino
8f38c72e11 fix a typo in WebPPictureYUVAToARGB's doc
method -> colorspace

Change-Id: I5c9a2ccc909c967a936758dde2cfce92eb95462a
(cherry picked from commit dc789ada44)
2016-12-09 17:27:59 -08:00
Pascal Massimino
33ca93f909 systematically call WebPDemuxReleaseIterator() on dec->prev_iter_
Change-Id: I4a767134dcc52a7ee7c3bc5deb91012eaf7b6512
(cherry picked from commit aaf2a6a698)
2016-12-09 17:27:54 -08:00
Pascal Massimino
76e190735b doc: use two's complement explicitly for uint8->int8 conversion
BUG=webp:225

Change-Id: I6bad131e275dbd992484e95a1b834010121281b8
(cherry picked from commit 13ae011e4c)
2016-12-09 17:27:50 -08:00
hui su
f91ba96306 Anim_encoder: correctly handle enc->prev_candidate_undecided_
Set enc->prev_candidate_undecided_ as 0 when a frame is not chosen
as a possible keyframe, so that the dispose method can be
dispose-to-background.

Change-Id: If2899f5dbc06fb53705fb8240072ab6440a6de12
(cherry picked from commit 29fedbf58b)
2016-12-09 16:58:28 -08:00
Pascal Massimino
25d74e652e WebPPictureDistortion(): free() -> WebPSafeFree()
missed one!

Change-Id: I643170451b3ac07c748b70a9abfe8af17a716b24
(cherry picked from commit 32dead4ee3)
2016-12-09 16:58:19 -08:00
James Zern
03f1c00877 mux/Makefile.am: add missing -lm
+ libwebpmux.pc

anim_encode.c relies on functions from math.h

BUG=webp:306

Change-Id: I3a8eb48febfd52bfbeb04f4dc615ccbed72926f7
(cherry picked from commit aaf2530cc3)
2016-12-09 15:03:08 -08:00
Pascal Massimino
58410cd6dc fix bug in RefineUsingDistortion()
When try_both_modes=0 (that is: -m 0 or -m 1), and the mode is i4,
we were still sometimes falling back to (unexplored, uninitialized) i16 mode,
which resulted in a enc/dec mismatch.
This was mainly occurring for large images (when bit_limit is low enough)

We disable the fall-back by disabling bit_limit using a large MAX_COST threshold.

Change-Id: I0c60257595812bd813b239ff4c86703ddf63cbf8
(cherry picked from commit 0a3838ca77)
2016-12-08 15:48:16 -08:00
Pascal Massimino
e168af8c6c fix filtering auto-adjustment
the min-distortion was quite too low. And we were also
considering the fully skipped macroblocks (nz=0) in the stats.
We need to have at least *some* non-zero dc coeffs (nz=0x100XXXX).

Fix also two typos in StoreMaxDelta: the v0/v1 comparison was wrong,
and the DCs[] coeffs are actually already in ZigZag order.

Change-Id: I602aaa74b36f7ce80017e506212c7d6fd9deba1f
(cherry picked from commit e4cd4daf74)
2016-12-08 15:48:08 -08:00
Pascal Massimino
ed9dec41a5 fix doc and code snippet for WebPINewDecoder() doc
Change-Id: I1a75fdf60f0b9f1816be28f22613438bfe21752b
(cherry picked from commit e715285611)
2016-12-08 15:48:04 -08:00
Pascal Massimino
3c49178f7d prevent 32b overflow for very large canvas_width / height
some multiplies here and there needed some extra checks
and error reporting. Even if width * height is guaranteed
to be < 2**32, we were multiplying by num_channels and
triggering a 32b overflow.
Some multiplies were not using size_t or uint64_t, additionally.

Change-Id: If2a35b94c8af204135f4b88a7fd63850aa381bbf
(cherry picked from commit 1c36440094)
2016-12-08 15:27:51 -08:00
Pascal Massimino
9595f29010 fix anim_util.c compilation when HAVE_GIF is not defined.
Change-Id: I1a4f13a5799c020fb4b3ade3c7336f049443ab62
(cherry picked from commit 1effde7bcd)
2016-12-08 15:27:46 -08:00
hui su
7ec9552c22 Make gif transparent color to be transparent black
Change it from transparent white to transparent black, which matches
the transparent color assumed in Webp dispose-to-background method.

Also pre-multiply background colors before comparison in anim_diff,
just as what is done with regular pixel values.

Change-Id: I5a790522df21619c666ce499f73e42294ed276f2
(cherry picked from commit 43bd895879)
2016-12-08 15:27:40 -08:00
Pascal Massimino
b3fb8bb602 slightly faster Predictor #11 in NEON
(+some slight modifications on Predictor #12)

Change-Id: Ic2132dcd83d961cd069fa01ca1670e35e35274e2
2016-12-08 07:32:51 -08:00
Vincent Rabaud
9871335fc8 Add a CMake option for WEBP_SWAP_16BIT_CSP.
Change-Id: I79ed6cbce9563bf7ca97fc2e10ec3e75b6b8ab5b
(cherry picked from commit 7b54e26bac)
2016-12-07 23:41:36 -08:00
Vincent Rabaud
0ae32226ce Fix missing cpu-features for Android.
Change-Id: Ief13b7c63b96194970b00a5732aa080f794e7ae6
(cherry picked from commit d2223d8d6c)
2016-12-07 23:41:28 -08:00
James Zern
ab4c8056e0 cpu.cmake: improve webp_check_compiler_flag output
WEBP_HAVE_FLAG_LOCAL -> WEBP_HAVE_FLAG_${WEBP_SIMD_FLAG} this will
include the flag being tested in the output:
-- Performing Test WEBP_HAVE_FLAG_NEON

Change-Id: I1c0a143a857b16e4eb1fcf8b23c176380a5fef29
(cherry picked from commit ee1057e3b1)
2016-12-07 23:41:23 -08:00
Vincent Rabaud
eec5fa3a95 Provide support for CMake on Android studio 2.2.
Change-Id: Ib3508c20a220b29d42f963cf154cd9ab5236ed6e
(cherry picked from commit a80e8cfdf2)
2016-12-07 23:41:17 -08:00
Vincent Rabaud
004d569086 Split the main CMake file.
This will well isolate contributions for original code,
generated code and SIMD (especially for Android).

Change-Id: Ie47664decc7f43c2f57260a72cab951c347281a7
(cherry picked from commit 6c62841076)
2016-12-07 23:41:08 -08:00
James Zern
4fe5d588bf Android.mk: use -fvisibility=hidden
brings the final libwebp.so size down 16/20K with arm64/armv7 builds
using ndk-r13

Change-Id: I20d8aba61d6b692b0fc32f4b271e2f9872f03c28
(cherry picked from commit de568abfdb)
2016-12-07 18:34:46 -08:00
James Zern
bd63a31aab vwebp: ensure setenv() is available in stdlib.h
quiets a -Wimplicit-function-declaration with some configurations of gcc
(-std=c99).
_POSIX_C_SOURCE is preferred over _BSD_SOURCE with newer versions of
glibc

Change-Id: I378bffb13ba52ff5c4bad1433090dcc387e5d507
(cherry picked from commit bfab894739)
2016-12-07 18:30:54 -08:00
Pascal Massimino
363a568131 vwebp: handle window resizing properly
The image is scaled to fit the whole viewport.
Avoid some oddities with offsets, etc.

removes some TODO.

Change-Id: I52fae9ca80a2feed234f32261c7f6358d7594e21
(cherry picked from commit 9310d19258)
2016-12-07 18:30:49 -08:00
James Zern
a0d2753fcb lower WEBP_MAX_ALLOCABLE_MEMORY default
restrict to 2^34 for 64-bit targets, < 2^32 for 32-bit

Change-Id: Iff4ce40ae2c3c7fc119f018c2128dbe8f744341f
(cherry picked from commit b8384b53d6)
2016-12-07 18:30:44 -08:00
Pascal Massimino
31fe11a57a fix infinite loop in case of PARTITION0 overflow
max_i4_header_bits_ could drop to zero for difficult image and trigger
a loop. Surprisingly, StatLoop() didn't have this bug.

Change-Id: Idc0f9eadef30a2b2f02041b994f25def30901e36
(cherry picked from commit 21e7537abe)
2016-12-07 18:30:39 -08:00
hui su
532215dd29 Change the rule of picking UV mode in MBAnalyzeBestUVMode()
Pick the mode with the smallest alpha.
It only affects m0, in which case the mode decision is not re-examined
later in VP8Decimate(). Tests on some natural content png images show
PSNR increase as well as visual quality improvement.

Change-Id: Iea997e718cd7477160fa05eb7cfb35f4cec2fa9a
(cherry picked from commit 1377ac2ec1)
2016-12-07 18:30:33 -08:00