webm/libwebp.git
2 days agoExtend MakeARGB32() to accept Alpha channel. 35/70935/1 master
Vikas Arora [Mon, 21 Jul 2014 21:48:22 +0000 (14:48 -0700)]
Extend MakeARGB32() to accept Alpha channel.

Change-Id: I31b8e2d085000e2e3687a373401e4f655f11fc42

2 days agoMerge "use explicit size of kErrorMessages[] arrays"
skal [Mon, 21 Jul 2014 20:37:49 +0000 (13:37 -0700)]
Merge "use explicit size of kErrorMessages[] arrays"

2 days agoMerge "Actuate memory stats for PRINT_MEMORY_INFO"
skal [Mon, 21 Jul 2014 20:31:15 +0000 (13:31 -0700)]
Merge "Actuate memory stats for PRINT_MEMORY_INFO"

2 days agoJPEG decoder: delay conversion to YUV to WebPEncode() call 34/70934/1
skal [Mon, 21 Jul 2014 20:26:22 +0000 (22:26 +0200)]
JPEG decoder: delay conversion to YUV to WebPEncode() call

We store the raw RGB samples decoded from JPEG, and avoid precision loss.

Note that this may increase the encoding time reported by
cwebp -v, since RGB->YUV now occur during WebPEncode call
(in case of lossy), instead of ReadJPEG().
This also increases the memory use, since we're carying the
source ARGB samples around.

Change-Id: Ic2180206cfc9f5574f391e91c3b89b9d81695d01

2 days agouse explicit size of kErrorMessages[] arrays 28/70928/2
skal [Mon, 21 Jul 2014 13:44:43 +0000 (15:44 +0200)]
use explicit size of kErrorMessages[] arrays

Change-Id: If02864e3a07ae37814bf379bf347862cd2871bf4

2 days agoActuate memory stats for PRINT_MEMORY_INFO 27/70927/3
skal [Mon, 21 Jul 2014 12:22:26 +0000 (14:22 +0200)]
Actuate memory stats for PRINT_MEMORY_INFO

Change-Id: If7eac591b5205990ca452ca02b084a908482850a

2 days agoMerge "move WebPPictureInit to picture.c"
James Zern [Mon, 21 Jul 2014 18:47:17 +0000 (11:47 -0700)]
Merge "move WebPPictureInit to picture.c"

3 days agomove WebPPictureInit to picture.c 26/70926/2
skal [Mon, 21 Jul 2014 12:11:58 +0000 (14:11 +0200)]
move WebPPictureInit to picture.c

Change-Id: I4b8c352cfd47256d0c3827334a6942c1caf742f6

3 days agofix configure message for multi-thread 24/70924/1
Pascal Massimino [Mon, 21 Jul 2014 07:21:50 +0000 (00:21 -0700)]
fix configure message for multi-thread

it's not just decoding, but general multi-threading

Change-Id: I9d1b7e14f05b93a0eb92955526b7019c2b0df20c

3 days agoconfigure: check for _beginthreadex 23/70923/1
James Zern [Sun, 20 Jul 2014 21:56:37 +0000 (14:56 -0700)]
configure: check for _beginthreadex

fixes thread support detection in e.g., cross-compiles/mingw installs
without libpthread, the behavior is unchanged in mingw installs with
libpthread. in the latter case although libpthread is detected the
windows api (_beginthreadex) path is being used.

Change-Id: Ie5f39f15f380731a1006a2497496d627f08fa103

6 days agoreorder the YUVA->ARGB and ARGB->YUVA functions correctly 13/70913/2
Pascal Massimino [Fri, 18 Jul 2014 13:20:08 +0000 (06:20 -0700)]
reorder the YUVA->ARGB and ARGB->YUVA functions correctly

+ rework few loops
+ consolidate few error-checks / error-reporting
+ don't modify picture->colorspace in Import() for ARGB output

Change-Id: Iae6da9b50acc738c59b85c3ee64efbaf6af8bffc

7 days agoMerge "extract colorspace code from picture.c into picture_csp.c"
James Zern [Thu, 17 Jul 2014 00:01:28 +0000 (17:01 -0700)]
Merge "extract colorspace code from picture.c into picture_csp.c"

7 days agoextract colorspace code from picture.c into picture_csp.c 41/70841/6
Pascal Massimino [Mon, 14 Jul 2014 09:04:14 +0000 (02:04 -0700)]
extract colorspace code from picture.c into picture_csp.c

had to refactor few functions here and there.

Change-Id: I86fde6fec7c2fc7eb48f0ecf327dbbd2bd40b9d4

8 days agoMerge "configure: check for -Wformat-security"
pascal massimino [Wed, 16 Jul 2014 10:23:29 +0000 (03:23 -0700)]
Merge "configure: check for -Wformat-security"

9 days agoconfigure: check for -Wformat-security 69/70869/1
James Zern [Tue, 15 Jul 2014 05:52:15 +0000 (22:52 -0700)]
configure: check for -Wformat-security

from debian hardening:
https://wiki.debian.org/Hardening#DEB_BUILD_HARDENING_FORMAT_.28gcc.2Fg.2B-.2B-_-Wformat_-Wformat-security_-Werror.3Dformat-security.29

Change-Id: I6729fb92e7286532151c2dde93b876476ed2af96

11 days agosplit monolithic picture.c into picture_{tools,psnr,rescale}.c 38/70838/1
Pascal Massimino [Sat, 12 Jul 2014 16:13:33 +0000 (09:13 -0700)]
split monolithic picture.c into picture_{tools,psnr,rescale}.c

Change-Id: Ia5eb5496e4337e5bac8203872c5b014cad21c4f9

12 days agodec_neon/TransformAC3: initialize vector w/vcreate 24/70824/2
James Zern [Fri, 11 Jul 2014 07:15:02 +0000 (00:15 -0700)]
dec_neon/TransformAC3: initialize vector w/vcreate

replaces {} initialization gnu-ism

Change-Id: I5bedcba1a9c21883207301f07456cc6a843199a0

13 days agogif2webp: Allow single-frame animations 13/70813/1
Urvang Joshi [Thu, 10 Jul 2014 22:21:05 +0000 (15:21 -0700)]
gif2webp: Allow single-frame animations

Some single-frame GIF images have a canvas larger than the frame rectangle. For
such images, we retain the ANMF, ANIM and VP8X chunks in the output WebP file.
This ensures that the full canvas width/height and frame offsets are retained.

Change-Id: I3ebae4893f953984de4072fda0938411de787a29

2 weeks agothread: remove harmless race on status_ in End() 85/70785/2
James Zern [Wed, 9 Jul 2014 02:53:28 +0000 (19:53 -0700)]
thread: remove harmless race on status_ in End()

if a thread was still doing work when End() was called there'd be a race
on worker->status_. in these cases, however, the specific value is
meaningless as it would be >= OK and the thread would have been shut
down properly, but we'll check 'impl_' instead to avoid any potential
TSan/DRD reports.

Change-Id: Ib93cbc226a099f07761f7bad765549dffb8054b1

2 weeks agoMerge "configure: check for __builtin_bswapXX()"
James Zern [Sat, 5 Jul 2014 20:43:43 +0000 (13:43 -0700)]
Merge "configure: check for __builtin_bswapXX()"

2 weeks agoconfigure: check for __builtin_bswapXX() 59/70759/2
James Zern [Fri, 4 Jul 2014 23:56:41 +0000 (16:56 -0700)]
configure: check for __builtin_bswapXX()

defines HAVE_BUILTIN_BSWAP16/32/64
updated endian_inl.h to have a non-configure fallback for gcc and clang
BSwap16() now uses __builtin_bswap16 if available

Change-Id: Ia04ee07b39303c4b247df96d84f298fb8a81f389

2 weeks agoconfigure: fix iOS builds 60/70760/1
James Zern [Sat, 5 Jul 2014 04:48:36 +0000 (21:48 -0700)]
configure: fix iOS builds

possibly other cross-compiles; avoids misusing -mavx2/-msse2 in these
cases by checking the usability of the associated intrinsics header
files.

iosbuild.sh has been broken since at least:
6e61a3a configure: test for -msse2

Change-Id: Ic650d9eec70f6a5de7d89997b3b425a4aa50ccd9

2 weeks agoVP8LFillBitWindow: enable fast path for 32-bit builds 58/70758/2
James Zern [Fri, 4 Jul 2014 20:40:53 +0000 (13:40 -0700)]
VP8LFillBitWindow: enable fast path for 32-bit builds

also reduce the load size from 64 to 32 bits as the top 32 bits are
being shifted away in the operation.

the change is neutral speed-wise on x86_64 as is the change in load size
on x86, but it gives a slight improvement on 32-bit arm.
x86 is improved ~13%, 32-bit arm ~3.7%
aarch64 is untested but will likely benefit as well.

Change-Id: Ibcb02a70f46f2651105d7ab571afe352673bef48

2 weeks agoVP8LFillBitWindow: respect WEBP_FORCE_ALIGNED 57/70757/1
James Zern [Fri, 4 Jul 2014 20:30:32 +0000 (13:30 -0700)]
VP8LFillBitWindow: respect WEBP_FORCE_ALIGNED

Change-Id: I23eddf01590de002efc21d8c7acc545a08fc3e48

2 weeks agoendian_inl.h: implement htoleXX with BSwapXX 54/70754/2
James Zern [Fri, 4 Jul 2014 07:50:34 +0000 (00:50 -0700)]
endian_inl.h: implement htoleXX with BSwapXX

+ s/htole(16|32)/HToLE$1/ to avoid any name conflicts

Change-Id: Ic1c84711557e50f73d83ca5aa2b3992ac6738216

2 weeks agoendian_inl.h: add BSwap16 53/70753/2
James Zern [Fri, 4 Jul 2014 07:41:14 +0000 (00:41 -0700)]
endian_inl.h: add BSwap16

+ use it in VP8LoadNewBytes()

Change-Id: I701d3652dc0cbd553852978702ef68c2657bca1c

2 weeks agoMerge "configure: add --enable-aligned"
James Zern [Fri, 4 Jul 2014 07:12:28 +0000 (00:12 -0700)]
Merge "configure: add --enable-aligned"

2 weeks agoconfigure: add --enable-aligned 52/70752/2
James Zern [Fri, 4 Jul 2014 06:06:06 +0000 (23:06 -0700)]
configure: add --enable-aligned

forces aligned memory reads (via memcpy) in the VP8 bit reader, useful
for platforms that don't support unaligned loads.

Change-Id: Ifa44a9a1677fbdc6a929520f9340b7e3fcbd6692

2 weeks agoMerge "configure: support WIC + OpenGL under mingw64"
James Zern [Fri, 4 Jul 2014 06:24:16 +0000 (23:24 -0700)]
Merge "configure: support WIC + OpenGL under mingw64"

2 weeks agoremove experimental YUV444 YUV422 and YUV400 code 49/70749/4
Pascal Massimino [Thu, 3 Jul 2014 20:20:06 +0000 (13:20 -0700)]
remove experimental YUV444 YUV422 and YUV400 code

(never used)

Change-Id: I12a886703592133939607df05132e9b498f916c1

2 weeks agoconfigure: support WIC + OpenGL under mingw64 51/70751/1
James Zern [Sat, 28 Jun 2014 19:10:31 +0000 (12:10 -0700)]
configure: support WIC + OpenGL under mingw64

fixes issue #211

original patch by grizzly dot nyo at gmail

Change-Id: Ie7bf63d24c112e7e351979da4bebcb690a831c5d

2 weeks agoconfigure.ac: add AC_C_BIGENDIAN 48/70748/3
James Zern [Sat, 28 Jun 2014 19:27:17 +0000 (12:27 -0700)]
configure.ac: add AC_C_BIGENDIAN

this defines WORDS_BIGENDIAN, replacing uses of
__BIG_ENDIAN__/__BYTE_ORDER__ with it

+ fixes lossless BGRA output with big-endian toolchains
  that do not define __BIG_ENDIAN__ (codesourcery mips gcc)

Change-Id: Ieaccd623292d235343b5e34b7a720fc251c432d7

2 weeks agoendian_inl.h: add BSwap64 47/70747/2
James Zern [Thu, 3 Jul 2014 18:21:24 +0000 (11:21 -0700)]
endian_inl.h: add BSwap64

Change-Id: I66672b770500294b8f4ee8fa4bf1dfff1119dbe6

2 weeks agoendian_inl.h: add BSwap32 46/70746/2
James Zern [Thu, 3 Jul 2014 18:21:24 +0000 (11:21 -0700)]
endian_inl.h: add BSwap32

Change-Id: I96e3ae49659307024415d64587e6312888a0070f

2 weeks agoutils: add endian_inl.h 45/70745/2
James Zern [Thu, 3 Jul 2014 17:41:37 +0000 (10:41 -0700)]
utils: add endian_inl.h

moves the following to this header:
- htole*() definitions from bit_writer.c
- __BIG_ENDIAN__ fallback define from bit_reader_inl.h

Change-Id: I7fff59543f08a70bf8f9ddac849b72ed290471b1

3 weeks agoMerge "make alpha-detection loop in IsKeyFrame() in good x/y order"
Pascal Massimino [Thu, 3 Jul 2014 05:38:41 +0000 (22:38 -0700)]
Merge "make alpha-detection loop in IsKeyFrame() in good x/y order"

3 weeks agomake alpha-detection loop in IsKeyFrame() in good x/y order 39/70739/1
Pascal Massimino [Tue, 24 Jun 2014 20:20:29 +0000 (20:20 +0000)]
make alpha-detection loop in IsKeyFrame() in good x/y order

Change-Id: Ifeeb855e66c7b6b849e8584787dc24e7371b1e67

3 weeks agolossless: Remove unaligned read warning 38/70738/1
Vikas Arora [Wed, 2 Jul 2014 20:39:47 +0000 (20:39 +0000)]
lossless: Remove unaligned read warning

(typecast uint32 pointer to uint64).
The proposed change is little (0.05%) slower but avoids uint32 to uint64
pointer conversion.

Change-Id: I6b8828077ea1324fabd04bfa7e7439e324776250

3 weeks agoMerge "configure.ac: add an autoconf version prerequisite"
James Zern [Thu, 3 Jul 2014 02:26:39 +0000 (19:26 -0700)]
Merge "configure.ac: add an autoconf version prerequisite"

3 weeks agoconfigure.ac: add an autoconf version prerequisite 19/70719/1
James Zern [Wed, 2 Jul 2014 03:02:58 +0000 (20:02 -0700)]
configure.ac: add an autoconf version prerequisite

ax_pthread.m4 uses AS_CASE() which was added in 2.60

Change-Id: Ifafe2271a8814c734a20d24048e9b24925e13077

3 weeks agoneon: normalize vdup_n_* usage 97/70697/1
James Zern [Tue, 1 Jul 2014 07:55:05 +0000 (00:55 -0700)]
neon: normalize vdup_n_* usage

with constants, prefer this over vmov_n_* or vcreate_*

Change-Id: Ia84b2a82faea58e2626211a7e2257e0ba4af358a

3 weeks agoMerge changes I0da7b3d3,Idad2f278,I4accc305
James Zern [Tue, 1 Jul 2014 07:48:38 +0000 (00:48 -0700)]
Merge changes I0da7b3d3,Idad2f278,I4accc305

* changes:
  neon: add INIT_VECTOR4
  neon: add INIT_VECTOR3
  neon: add INIT_VECTOR2

3 weeks agoMerge "fix (uncompiled) typo"
skal [Tue, 1 Jul 2014 07:29:19 +0000 (00:29 -0700)]
Merge "fix (uncompiled) typo"

3 weeks agoneon: add INIT_VECTOR4 95/70695/3
James Zern [Sun, 29 Jun 2014 20:40:45 +0000 (13:40 -0700)]
neon: add INIT_VECTOR4

used to initialize NxMx4 vector types
replaces initialization via '{{ }}' gnu-ism.

Change-Id: I0da7b3d321f3d48579b7863fb2e4d3f449ae7f5e

3 weeks agoneon: add INIT_VECTOR3 94/70694/2
James Zern [Sun, 29 Jun 2014 20:40:45 +0000 (13:40 -0700)]
neon: add INIT_VECTOR3

used to initialize NxMx3 vector types
replaces initialization via '{{ }}' gnu-ism.

Change-Id: Idad2f278ab104cf2cc650517194258ce3cfb37b4

3 weeks agoneon: add INIT_VECTOR2 93/70693/2
James Zern [Sun, 29 Jun 2014 20:40:45 +0000 (13:40 -0700)]
neon: add INIT_VECTOR2

used to initialize NxMx2 vector types
replaces initialization via '{{ }}' gnu-ism.

Change-Id: I4accc305c7dd4c886b63c22e38890b629bffb139

3 weeks agoadd WebPMuxSetCanvasSize() to the mux API 76/70676/1
skal [Mon, 30 Jun 2014 05:00:49 +0000 (07:00 +0200)]
add WebPMuxSetCanvasSize() to the mux API

previously, the final canvas size was adjusted tightly from the
animation frames. Now, it can be specified separately (to be larger, in particular).

calling WebPMuxSetCanvasSize(mux, 0, 0) triggers the 'adjust tightly' behaviour.
This can be useful after calling WebPMuxCreate() if further image addition
is expected.

-> Fixed gif2webp accordingly.

also: made WebPMuxAssemble() more robust by systematically zero-ing WebPData.

Change-Id: Ib4f7eac372cf9dbf6e25cd686a77960e386a0b7f

3 weeks agofix (uncompiled) typo 57/70657/1
skal [Fri, 27 Jun 2014 15:02:24 +0000 (17:02 +0200)]
fix (uncompiled) typo

output was not properly descaled when compiled
without USE_GAMMA_COMPRESSION

Change-Id: I5282c9573cfcfbef4be22b6b3cdec7e16cad9c1c

4 weeks agoremove unused 'shift' argument and QFIX2 define 37/70637/2
Pascal Massimino [Thu, 26 Jun 2014 07:12:51 +0000 (00:12 -0700)]
remove unused 'shift' argument and QFIX2 define

this will remove a warning about the shift amount not being
an immediate (=constant).

Change-Id: Ie9a00fefdb9a07ec8994fb113f24234518bc878a
Also: fix the NULL sharpen argument mismatch.

4 weeks agoMerge "VP8LoadNewBytes: use __builtin_bswap32 if available"
pascal massimino [Wed, 25 Jun 2014 09:15:17 +0000 (02:15 -0700)]
Merge "VP8LoadNewBytes: use __builtin_bswap32 if available"

4 weeks agoMerge "Fix handling of weird GIF with canvas dimension 0x0"
skal [Wed, 25 Jun 2014 09:14:54 +0000 (02:14 -0700)]
Merge "Fix handling of weird GIF with canvas dimension 0x0"

4 weeks agoVP8LoadNewBytes: use __builtin_bswap32 if available 27/70627/2
James Zern [Wed, 25 Jun 2014 04:13:42 +0000 (21:13 -0700)]
VP8LoadNewBytes: use __builtin_bswap32 if available

mostly to balance the use of bswap64, some gcc platforms are already
interpreting the default case the same

Change-Id: Icf860f55b3f16bea349a7d721e6d6abeeb4e5cf3

4 weeks agoFix handling of weird GIF with canvas dimension 0x0 17/70617/2
skal [Tue, 24 Jun 2014 15:34:45 +0000 (17:34 +0200)]
Fix handling of weird GIF with canvas dimension 0x0

Similarly to Chrome, we then use the first sub-rectangle
to set the canvas size.

Also: add check for too-large GIF dimensions (>MAX_CANVAS_SIZE)

Change-Id: Idce55f1e6f6982a8f0e082aac540e16b530e023e

4 weeks agoMerge "rename interface -> winterface"
Pascal Massimino [Tue, 24 Jun 2014 07:44:11 +0000 (00:44 -0700)]
Merge "rename interface -> winterface"

4 weeks agoFix logic in the GIF LOOP-detection parsing 09/70609/1
skal [Mon, 23 Jun 2014 21:26:36 +0000 (23:26 +0200)]
Fix logic in the GIF LOOP-detection parsing

We align with Blink/Chromium code by:
  - checking for ANIMEXTS1.0 signature too
  - using ByteCount >= 3 instead of requiring ByteCount==3

Change-Id: Idc484ca62878517df3dccb1fdb3bb45104a5e066
see: http://odur.let.rug.nl/kleiweg/gif/netscape.html

4 weeks agorename interface -> winterface 08/70608/1
Pascal Massimino [Mon, 23 Jun 2014 21:21:22 +0000 (14:21 -0700)]
rename interface -> winterface

to avoid name clash on win32

Change-Id: Ia4ad3d4528df4652bab803f9a9544e21e6c4b177

4 weeks agomake WebPSetWorkerInterface() check its arguments 00/70600/1
skal [Mon, 23 Jun 2014 05:39:56 +0000 (07:39 +0200)]
make WebPSetWorkerInterface() check its arguments

Change-Id: I522c58cfe05e864a50cacb58bdfa14d5369c6d60

4 weeks agoMerge "cosmetics: update thread.h comments"
James Zern [Fri, 20 Jun 2014 06:23:06 +0000 (23:23 -0700)]
Merge "cosmetics: update thread.h comments"

4 weeks agoMerge "dust up the help message"
James Zern [Fri, 20 Jun 2014 06:12:02 +0000 (23:12 -0700)]
Merge "dust up the help message"

4 weeks agodust up the help message 48/70548/3
skal [Wed, 18 Jun 2014 14:45:34 +0000 (16:45 +0200)]
dust up the help message

* try to avoid trailing '.'
* rationalize capitalization

Change-Id: I50939baf01b1ab44d3031eee916ba51f2338af8a

4 weeks agocosmetics: update thread.h comments 77/70577/1
James Zern [Fri, 20 Jun 2014 02:29:41 +0000 (19:29 -0700)]
cosmetics: update thread.h comments

WebPWorker*() are now part of WebPWorkerInterface; refer to them with
unadorned names.

Change-Id: Iae1dd59f1e545cba6dd8c18f26ba60eb9a84419b

5 weeks agoQuantizeBlock SSE2 Optimization: 46/70546/5
levytamar82 [Wed, 18 Jun 2014 11:45:51 +0000 (04:45 -0700)]
QuantizeBlock SSE2 Optimization:

Another store to load forward block was detected coming from the function
FTransform.
FTransform save the output data 4 times 8 bytes each. when this data is
later being loaded by the QuantizeBlock function in one chunk of 16 bytes
that caused a store to load forward block.
The fix was done in the FTransform function where each two consecutive 8 bytes
were merged into one 16 bytes register and saved into the memory.
This fix gives ~21% function level gain and 1.6% user level gain.

Change-Id: Idc27c307d5083f3ebe206d3ca19059e5bd465992

5 weeks agoMerge "webpmux: warn when odd frame offsets are used"
James Zern [Wed, 18 Jun 2014 19:18:09 +0000 (12:18 -0700)]
Merge "webpmux: warn when odd frame offsets are used"

5 weeks agoMerge changes Id8edd3c1,Id418eb96,Ide05e3be
James Zern [Wed, 18 Jun 2014 19:17:15 +0000 (12:17 -0700)]
Merge changes Id8edd3c1,Id418eb96,Ide05e3be

* changes:
  examples/Android.mk: add cwebp
  Android.mk: move dwebp to examples/Android.mk
  Android.mk: add ENABLE_SHARED flag

5 weeks agowebpmux: warn when odd frame offsets are used 41/70541/2
James Zern [Wed, 18 Jun 2014 06:21:49 +0000 (23:21 -0700)]
webpmux: warn when odd frame offsets are used

offsets are stored as (x/2, y/2)

Change-Id: Ic8f727ab7996a84c1f8c57f4f6dbaf8701bf8eae

5 weeks agoMerge "add alpha dithering for lossy"
skal [Wed, 18 Jun 2014 14:32:24 +0000 (07:32 -0700)]
Merge "add alpha dithering for lossy"

5 weeks agoexamples/Android.mk: add cwebp 44/70544/1
James Zern [Wed, 18 Jun 2014 06:37:00 +0000 (23:37 -0700)]
examples/Android.mk: add cwebp

Change-Id: Id8edd3c17d82e4ab0087c315cd3ead1cb285e714

5 weeks agoAndroid.mk: move dwebp to examples/Android.mk 43/70543/1
James Zern [Wed, 18 Jun 2014 06:33:10 +0000 (23:33 -0700)]
Android.mk: move dwebp to examples/Android.mk

this depends on the top-level Android.mk for shared flags

Change-Id: Id418eb9639e839518a921ffcb6a376ce10aafbd2

5 weeks agoAndroid.mk: add ENABLE_SHARED flag 42/70542/1
James Zern [Wed, 18 Jun 2014 06:30:20 +0000 (23:30 -0700)]
Android.mk: add ENABLE_SHARED flag

builds libwebp.so instead of libwebp.a
$ ndk-build ENABLE_SHARED=1

Change-Id: Ide05e3be4f9848852e6d7e9d99abe11344419241

5 weeks agomuxread: fix out of bounds read 27/70527/1
James Zern [Tue, 17 Jun 2014 19:50:12 +0000 (19:50 +0000)]
muxread: fix out of bounds read

ChunkVerifyAndAssign() expects to have at least 8 bytes to work with,
but was only checking for the presence of 4.

Change-Id: I8456b15d872de24a90c1e8fbfba463391ced5c7f

5 weeks agoMakefile.vc: fix CFLAGS assignment w/HAVE_AVX2=1 23/70523/1
James Zern [Tue, 17 Jun 2014 03:23:20 +0000 (20:23 -0700)]
Makefile.vc: fix CFLAGS assignment w/HAVE_AVX2=1

there's no '+=' operator

Change-Id: Icd6fe684bd468827339f0d73643b325c8477d5c5

5 weeks agoadd alpha dithering for lossy 15/68215/6
skal [Fri, 13 Jun 2014 22:06:16 +0000 (00:06 +0200)]
add alpha dithering for lossy

new options:
 dwebp -alpha_dither
 vwebp -noalphadither

When the source was marked as quantized, we use a threshold-averaging
filter to smooth the decoded alpha plane.
Note: this option forces the decoding of alpha data in one pass, and
might slow the decoding a bit.

The new field in WebPDecoderOptions struct is 'alpha_dithering_strength'
(0 by default, means: off). Max strength value is '100'.

Change-Id: I218e21af96360d4781587fede95f8ea4e2b7287a

5 weeks agoMerge "make error-code reporting consistent upon malloc failure"
skal [Fri, 13 Jun 2014 07:25:30 +0000 (00:25 -0700)]
Merge "make error-code reporting consistent upon malloc failure"

5 weeks agomake error-code reporting consistent upon malloc failure 77/70477/3
skal [Fri, 13 Jun 2014 06:45:12 +0000 (08:45 +0200)]
make error-code reporting consistent upon malloc failure

Sometimes, the error-code was not set correctly.
We now return OUT_OF_MEMORY everytimes it's appropriate
(tested using MALLOC_FAIL_AT mechanism)

Took the opportunity to clean-up the code and dust the error
code returned (some were erroneously set to INVALID_CONFIGURATION)

Change-Id: I56f7331e2447557b3dd038e245daace4fc82214c

5 weeks ago**/Makefile.am: remove unused AM_CPPFLAGS 76/70476/2
James Zern [Thu, 12 Jun 2014 06:23:13 +0000 (23:23 -0700)]
**/Makefile.am: remove unused AM_CPPFLAGS

only 1 of <lib>_CPPFLAGS and AM_CPPFLAGS is used, with the former
getting precedence when it's defined. configure's DEFAULT_INCLUDES is
covering what's necessary given the include paths are all source
relative.

Change-Id: I7d14076acd266b28a88a3d92bcc3d7165284d5f3

6 weeks agoAdd an interface abstraction to the WebP worker thread implementation 78/70478/1
skal [Thu, 12 Jun 2014 09:35:44 +0000 (11:35 +0200)]
Add an interface abstraction to the WebP worker thread implementation

This allows custom implementations of threading mecanism.

Patch by Leonhard Gruenschloss.

Change-Id: Id8ea5917acd2f24fa8bce79748d1747de2751614

6 weeks agoMerge "fix orig_rect==NULL case"
Pascal Massimino [Thu, 12 Jun 2014 07:48:30 +0000 (00:48 -0700)]
Merge "fix orig_rect==NULL case"

6 weeks agofix orig_rect==NULL case 75/70475/3
Pascal Massimino [Thu, 12 Jun 2014 06:07:45 +0000 (23:07 -0700)]
fix orig_rect==NULL case

Change-Id: I3bb4fbebf59cba2a67681e74530fc0fe51f1958f

6 weeks agoMerge "configure: move config.h to src/webp/config.h"
James Zern [Thu, 12 Jun 2014 05:52:07 +0000 (22:52 -0700)]
Merge "configure: move config.h to src/webp/config.h"

6 weeks agoproperly report back encoding error code in WebPFrameCacheAddFrame() 70/70470/1
skal [Wed, 11 Jun 2014 21:26:47 +0000 (23:26 +0200)]
properly report back encoding error code in WebPFrameCacheAddFrame()

User-hook can fail but error was not propagated back.

Change-Id: Ic79f9543bf767634a127eccfef90af855ff15c34
Also: some ad-hoc clean-up and API dusting. More to come later...

6 weeks agoconfigure: move config.h to src/webp/config.h 62/70462/2
James Zern [Wed, 11 Jun 2014 00:53:44 +0000 (17:53 -0700)]
configure: move config.h to src/webp/config.h

this change has the side-effect of using directory names in the
include, silencing a lint warning.

Change-Id: Ib91cf63a90534e32fadfa5c2372bfdb29f854d02

6 weeks agoMerge changes I7c675e51,I84f7d785
James Zern [Tue, 10 Jun 2014 23:15:21 +0000 (16:15 -0700)]
Merge changes I7c675e51,I84f7d785

* changes:
  configure: test for -msse2
  rename upsampling_mips32.c to yuv_mips32.c

6 weeks agomakefiles: define WEBP_HAVE_AVX2 when appropriate 42/70442/1
James Zern [Sun, 8 Jun 2014 02:57:51 +0000 (19:57 -0700)]
makefiles: define WEBP_HAVE_AVX2 when appropriate

more precisely: in makefile.unix and Makefile.vc when HAVE_AVX2=1

Change-Id: Ia93f373eef6595c016d650728f4f64f61764cd48

6 weeks agoremove the special casing for res->first in VP8SetResidualCoeffs 32/70432/2
skal [Sun, 8 Jun 2014 04:40:22 +0000 (06:40 +0200)]
remove the special casing for res->first in VP8SetResidualCoeffs

if res->first = 1, coeffs[0]=0 because of quant.c:749 and line
added at quant.c:744
So, no need for the extra case.
Going forward, TrellisQuantizeBlock() should also be calling
a variant of VP8SetResidualCoeffs() to set the 'last' field.

also: fixes a warning for win64
    + slight speed-up

Change-Id: Ib24b611f7396d24aeb5b56dc74d5c39160f048f0

6 weeks agoconfigure: test for -msse2 41/70441/1
James Zern [Sun, 8 Jun 2014 02:44:08 +0000 (19:44 -0700)]
configure: test for -msse2

+ add a WEBP_HAVE_SSE2 to dsp.h

not all 32-bit toolchain configurations will have sse2 enabled by
default

Change-Id: I7c675e511581f93cf55c79f960fa7efa2df4987e

6 weeks agorename upsampling_mips32.c to yuv_mips32.c 40/70440/1
James Zern [Sat, 7 Jun 2014 19:35:47 +0000 (12:35 -0700)]
rename upsampling_mips32.c to yuv_mips32.c

matches yuv_sse2 added in;
bdfeeba dsp/yuv: move sse2 functions to yuv_sse2.c

Change-Id: I84f7d7858ca6851c956e8366a7c76b45070dcbc3

6 weeks agodsp/yuv: move sse2 functions to yuv_sse2.c 28/70428/1
James Zern [Fri, 6 Jun 2014 06:49:59 +0000 (23:49 -0700)]
dsp/yuv: move sse2 functions to yuv_sse2.c

Change-Id: I2f037ff18e7cf07e8801f49b3a89c1e36ef73000

7 weeks agoMerge "configure: set WEBP_HAVE_AVX2 when available"
pascal massimino [Thu, 5 Jun 2014 09:57:42 +0000 (02:57 -0700)]
Merge "configure: set WEBP_HAVE_AVX2 when available"

7 weeks agoMerge "VP8RandomBits2: prevent signed int overflow"
pascal massimino [Thu, 5 Jun 2014 08:46:42 +0000 (01:46 -0700)]
Merge "VP8RandomBits2: prevent signed int overflow"

7 weeks agoVP8RandomBits2: prevent signed int overflow 10/70410/1
James Zern [Thu, 5 Jun 2014 06:09:19 +0000 (23:09 -0700)]
VP8RandomBits2: prevent signed int overflow

'diff' at its largest may be INT_MAX; << 1 of anything at or above
1 << 30 will overflow.

Change-Id: Idb2b5a9b55acc2f6d5e32be8baaebee3f89919ad

7 weeks agoenc_sse2: prevent signed int overflow 11/70411/1
James Zern [Thu, 5 Jun 2014 06:16:58 +0000 (23:16 -0700)]
enc_sse2: prevent signed int overflow

_mm_movemask_epi8 returns a 16-bit mask; << 16 can overflow a signed
int.

Change-Id: Ia0bb0804fe548fb9b0edb3695e82727506066cda

7 weeks agoMerge "real fix for longjmp warning"
skal [Wed, 4 Jun 2014 10:01:40 +0000 (03:01 -0700)]
Merge "real fix for longjmp warning"

7 weeks agoreal fix for longjmp warning 99/70399/1
skal [Wed, 4 Jun 2014 09:02:42 +0000 (11:02 +0200)]
real fix for longjmp warning

the 'volatile' qualifier was at the wrong place

Patch by Paul Pluzhnikov

Change-Id: I26e6f311a0ccd145de640b3505fe92965389c1d9

7 weeks agoconfigure: set WEBP_HAVE_AVX2 when available 98/70398/1
James Zern [Wed, 4 Jun 2014 06:29:23 +0000 (23:29 -0700)]
configure: set WEBP_HAVE_AVX2 when available

this is used to set WEBP_USE_AVX2 in files where the build flag won't be
used, i.e., dsp/enc.c, which enables VP8EncDspInitAVX2() to be called

Change-Id: I362f4ba39ca40d3e07a081292d5f743c649d9d7f

7 weeks agorestore original value_/range_ field order 82/70382/1
skal [Tue, 3 Jun 2014 07:36:56 +0000 (09:36 +0200)]
restore original value_/range_ field order

no speed change, just for coherency

Change-Id: Iaa395bca24f33a14b68ba6920b838ef87d0d0db6

7 weeks agoMerge "remove libwebpdspdecode dep on libwebpdsp_avx2"
James Zern [Tue, 3 Jun 2014 07:28:54 +0000 (00:28 -0700)]
Merge "remove libwebpdspdecode dep on libwebpdsp_avx2"

7 weeks agoremove libwebpdspdecode dep on libwebpdsp_avx2 81/70381/1
James Zern [Tue, 3 Jun 2014 07:05:56 +0000 (00:05 -0700)]
remove libwebpdspdecode dep on libwebpdsp_avx2

it's encode only, libwebpdecoder doesn't need the symbols

Change-Id: I5633dd2017a96e60068ae5384f1ba27898d29f83

7 weeks agoMerge "lossy bit-reader clean-up:"
Pascal Massimino [Tue, 3 Jun 2014 06:53:00 +0000 (23:53 -0700)]
Merge "lossy bit-reader clean-up:"

7 weeks agoMerge "remove unused #include's"
James Zern [Tue, 3 Jun 2014 06:07:20 +0000 (23:07 -0700)]
Merge "remove unused #include's"

7 weeks agoMerge "strong filtering speed-up (~2-3% x86, ~1-2% for NEON)"
James Zern [Tue, 3 Jun 2014 06:06:18 +0000 (23:06 -0700)]
Merge "strong filtering speed-up (~2-3% x86, ~1-2% for NEON)"