webm/libwebp.git
19 hours agoMerge "webp/types.h: use inline for clang++/-std=c++11" master
James Zern [Fri, 31 Oct 2014 10:53:06 +0000 (03:53 -0700)]
Merge "webp/types.h: use inline for clang++/-std=c++11"

32 hours agogif2webp: Add '-min-size' option to get best compression. 50/72050/1
Urvang Joshi [Thu, 30 Oct 2014 22:17:09 +0000 (15:17 -0700)]
gif2webp: Add '-min-size' option to get best compression.

This disables key-frame insertion and tries both dispose methods for
each frame.

Change-Id: Ib167747198fd1d98cb93321f76826e91228f24d8

36 hours agoSpeed up BackwardReferences 47/72047/1
Vikas Arora [Thu, 30 Oct 2014 17:53:15 +0000 (10:53 -0700)]
Speed up BackwardReferences

Speed up BackwardReferencesHashChainDistanceOnly method by:
1.) Remove for loop for shortmax code path.
2.) Execute the shortmax code path after regular call to
HashChainFindCopy, only if HashChainFindCopy() returns length > 2 (MIN_LENGTH).
3.) Also for shortmax, call method HashChainFindOffset (for length = 2),
instead of expensive method HashChainFindCopy().
4.) Handling first pixel (i==0) outside main loop and removing one if
condition (i > 0) per pixel.
5.) Handle the last pixel outside the main 'for' loop.

Overall compression speedup observed is around 5% (+/- noise).

Change-Id: Ifa30c4035f8d26e6e43e3c4881244d777961c22b

40 hours agowebp/types.h: use inline for clang++/-std=c++11 44/72044/2
James Zern [Thu, 30 Oct 2014 13:49:31 +0000 (14:49 +0100)]
webp/types.h: use inline for clang++/-std=c++11

at least clang 3.[45] in c++ mode with -std=c++11 define __STRICT_ANSI__
this change set WEBP_INLINE to inline for c++/non-strict-ansi/> c99

fixes crbug.com/428383

Change-Id: Ief2b934353c336a75865c73c90cc3dc5e4f83913

43 hours agoEnable entropy based merge histo for (q<100) 37/72037/3
Vikas Arora [Wed, 29 Oct 2014 21:52:43 +0000 (14:52 -0700)]
Enable entropy based merge histo for (q<100)

Enable bin-partition entropy based heuristic for merging histograms
for higher (q >= 90) qualities as well. Keep the old behavior at the
maximum quality level (q==100).

This speeds up the compression between Q=90-99 (method=4) by factor 5-7X
and with loss of 0.5-0.8% in the compression density.

Change-Id: I011182cb8ae5403c565a150362bc302630b3f330

44 hours agofilters_mips_dsp_r2.c: disable unfilters 43/72043/1
James Zern [Thu, 30 Oct 2014 10:08:05 +0000 (11:08 +0100)]
filters_mips_dsp_r2.c: disable unfilters

the output does not match the C-code.

Change-Id: Ie7b7387478a6b5c3f08691628ae00f059cf6d899

2 days agoMIPS: dspr2: Added optimization for function ClampedAddSubtractFull 34/72034/3
Djordje Pesut [Wed, 29 Oct 2014 10:42:30 +0000 (11:42 +0100)]
MIPS: dspr2: Added optimization for function ClampedAddSubtractFull

Change-Id: Iee98eaf007158f44a299dd5ba8d972d0d4108380

2 days agoMIPS: dspr2: added optimization for function ClampedAddSubtractHalf 32/72032/2
Djordje Pesut [Fri, 10 Oct 2014 08:35:43 +0000 (10:35 +0200)]
MIPS: dspr2: added optimization for function ClampedAddSubtractHalf

Change-Id: Iec22e897a4f56e79c18ec00f8caa9cefac67f186

3 days agoMIPS: dspr2: added optimization for ITransform 15/72015/5
Djordje Pesut [Fri, 10 Oct 2014 10:31:00 +0000 (12:31 +0200)]
MIPS: dspr2: added optimization for ITransform

Change-Id: I3534fca143535c53d18a3749b3a1b0c8a7563463

4 days agogif2webp: Use the default hint instead of WEBP_HINT_GRAPH. 24/72024/1
Urvang Joshi [Mon, 27 Oct 2014 23:41:39 +0000 (16:41 -0700)]
gif2webp: Use the default hint instead of WEBP_HINT_GRAPH.

This is much faster and the compression is slightly better too.

Change-Id: Ibf0d10eea83bfabfcc44ee497074767462ff41b1

4 days agoIncrease the MAX_COLOR_CACHE_BITS from 9 to 10. 21/72021/1
Vikas Arora [Mon, 27 Oct 2014 21:18:07 +0000 (14:18 -0700)]
Increase the MAX_COLOR_CACHE_BITS from 9 to 10.

The Maximum allowed limit is 11.
The Q=25 and below is not impacted as cache bits are forced to 0.
This saves 0.05% - 0.1% bytes for other quality with almost same compression
speed (+/- 2-3%, that's more of a noise).

Change-Id: Icf972a98f298c89e140e37a627baf709134be9a0

4 days agoChange the logic adjusting the Histogram bits. 17/72017/1
Vikas Arora [Mon, 27 Oct 2014 16:56:24 +0000 (09:56 -0700)]
Change the logic adjusting the Histogram bits.

Updated the logic to limit the Histogram size to a constant, instead of
computing the same based on the Histogram size (that's variable size based on
the cache bits) for the maximum possible cache bits. The actual cache bits may
be lower than the maximum.
Note: The constant 2600 is 16MB/Sizeof(HistogramSize(MAX_COLOR_CACHE_BITS)).

The compression density remains the same with this change, with little faster
compression speed.

Change-Id: I3149894962852e9dad2501b9aa16bb847a20fd86

4 days agoMerge "Fix bug in VP8LCalculateEstimateForCacheSize."
pascal massimino [Mon, 27 Oct 2014 09:31:10 +0000 (02:31 -0700)]
Merge "Fix bug in VP8LCalculateEstimateForCacheSize."

5 days agoFix bug in VP8LCalculateEstimateForCacheSize. 98/71998/3
Vikas Arora [Thu, 23 Oct 2014 16:01:46 +0000 (09:01 -0700)]
Fix bug in VP8LCalculateEstimateForCacheSize.

The method VP8LCalculateEstimateForCacheSize is not evaluating the all possible
range for cache_bits.
Also added a small penality for choosing the larger cache-size. This is done to
strike a balance between additional memory/CPU cost (with larger cache-size) and
byte savings from smaller WebP lossless files.

This change saves about 0.07% bytes and speeds up compression by 8% (default
settings). There's small speedup at Q=50 along with byte savings as well.
Compression at Quality=25 is not effected by this change.

Change-Id: Id8f87dee6b5bccb2baa6dbdee479ee9cda8f4f77

5 days agoMerge "dec_neon: add RD4 intra predictor"
pascal massimino [Sun, 26 Oct 2014 20:55:03 +0000 (13:55 -0700)]
Merge "dec_neon: add RD4 intra predictor"

5 days agoMerge "Makefile.vc: add a 'legacy' RTLIBCFG option"
pascal massimino [Sun, 26 Oct 2014 20:54:36 +0000 (13:54 -0700)]
Merge "Makefile.vc: add a 'legacy' RTLIBCFG option"

7 days agodec_neon: add RD4 intra predictor 13/72013/1
James Zern [Fri, 24 Oct 2014 19:22:07 +0000 (21:22 +0200)]
dec_neon: add RD4 intra predictor

based on the SSE2 version; a bit rough around the loads, but still ~38%
faster.

Change-Id: I22426d939a7354cbc9a85ca8c68235d6081b882f

8 days agoupdate NEWS 96/71996/1
James Zern [Mon, 13 Oct 2014 15:13:49 +0000 (17:13 +0200)]
update NEWS

Change-Id: Ib9b48e3611b77214bc875524249366ff62451c1b
(cherry picked from commit 0c1b98d28c1dec2ea45c101fca979b31b8db1e5b)

8 days agoMerge "dec_neon: DC4: use pair-wise adds for top row"
James Zern [Thu, 23 Oct 2014 15:08:34 +0000 (08:08 -0700)]
Merge "dec_neon: DC4: use pair-wise adds for top row"

8 days agoMakefile.vc: add a 'legacy' RTLIBCFG option 95/71995/1
James Zern [Thu, 23 Oct 2014 14:57:34 +0000 (07:57 -0700)]
Makefile.vc: add a 'legacy' RTLIBCFG option

disables buffer security checks (/GS-) and any machine optimizations
(e.g., sse2)

fixes issue #228

Change-Id: I81fa483dc1654199b2017626320383d2d63317dc

8 days agoMerge "dsp/dec_{neon,sse2}: VE4: normalize variable names"
pascal massimino [Thu, 23 Oct 2014 14:29:27 +0000 (07:29 -0700)]
Merge "dsp/dec_{neon,sse2}: VE4: normalize variable names"

8 days agodsp/dec_{neon,sse2}: VE4: normalize variable names 94/71994/1
James Zern [Thu, 23 Oct 2014 14:04:13 +0000 (16:04 +0200)]
dsp/dec_{neon,sse2}: VE4: normalize variable names

use '0' rather than '_' when dealing with variables that result from a
shift

Change-Id: I29280c0dead645ce39dc4bb42c3e19929b302fd4

8 days agodec_neon: DC4: use pair-wise adds for top row 93/71993/2
James Zern [Thu, 23 Oct 2014 13:01:50 +0000 (15:01 +0200)]
dec_neon: DC4: use pair-wise adds for top row

reduces load count, slightly faster

Change-Id: I880340ef8ef75ce4ce321c330f56f86b758bda08

8 days agoUnify the API between VP8BitWriter and VP8LBitWriter 92/71992/1
Pascal Massimino [Thu, 23 Oct 2014 13:35:16 +0000 (15:35 +0200)]
Unify the API between VP8BitWriter and VP8LBitWriter

BitReader will be next...

Change-Id: Icd9e7ab2e3890131e664c0523627d9b8c5399a74

8 days agoMerge changes I2e06907b,Ia9ed4ca6,I782282ff
pascal massimino [Thu, 23 Oct 2014 13:31:54 +0000 (06:31 -0700)]
Merge changes I2e06907b,Ia9ed4ca6,I782282ff

* changes:
  dec_neon: add DC4 intra predictor
  dec_neon: add TM4 intra predictor
  dec_neon: add LD4 intra predictor

8 days agoMerge "dec_neon: add VE4 intra predictor"
pascal massimino [Thu, 23 Oct 2014 12:38:41 +0000 (05:38 -0700)]
Merge "dec_neon: add VE4 intra predictor"

8 days agodec_neon: add DC4 intra predictor 83/71983/3
James Zern [Wed, 22 Oct 2014 15:02:28 +0000 (17:02 +0200)]
dec_neon: add DC4 intra predictor

~70% faster

Change-Id: I2e06907b8d69be71a8c5581832c931923c24bab0

8 days agodec_neon: add TM4 intra predictor 82/71982/3
James Zern [Wed, 22 Oct 2014 09:56:22 +0000 (11:56 +0200)]
dec_neon: add TM4 intra predictor

~21% faster

Change-Id: Ia9ed4ca650f9d544821fa1faf3173611806a272a

8 days agodec_neon: add LD4 intra predictor 81/71981/4
James Zern [Wed, 22 Oct 2014 18:43:36 +0000 (20:43 +0200)]
dec_neon: add LD4 intra predictor

based on SSE2 version, ~55% faster

Change-Id: I782282ffc31dcf238890b3ba0decccf1d793dad0

8 days agodec_neon: add VE4 intra predictor 80/71980/2
James Zern [Tue, 21 Oct 2014 16:06:08 +0000 (18:06 +0200)]
dec_neon: add VE4 intra predictor

based on SSE2 version, ~59% faster

Change-Id: Iaa2181eb51bd975de0e9fe5c7b66ed18188f0e3b

8 days agoMerge "Modify CostModel to allocate optimal memory."
James Zern [Thu, 23 Oct 2014 09:00:39 +0000 (02:00 -0700)]
Merge "Modify CostModel to allocate optimal memory."

9 days agogif2webp: Support GIF_DISPOSE_RESTORE_PREVIOUS 90/71990/1
Urvang Joshi [Thu, 23 Oct 2014 00:02:07 +0000 (17:02 -0700)]
gif2webp: Support GIF_DISPOSE_RESTORE_PREVIOUS

Tweaked the gif2webp_util API to support this.

Requested in: https://code.google.com/p/webp/issues/detail?id=144

Change-Id: I0e8c4edc39227355cd8d3acc55795186e25d0c3a

9 days agogif2webp: Handle frames with odd offsets + disposal to background. 88/71988/1
Urvang Joshi [Wed, 22 Oct 2014 22:43:26 +0000 (15:43 -0700)]
gif2webp: Handle frames with odd offsets + disposal to background.

Snapping odd offsets in GIF to even offsets in WebP was causing extra row/column
being disposed in such cases.

Code is rewritten to maintain previous and current canvas (it used to maintain
previous canvas and current frame earlier). And we recompute change rectangles
as those from GIF may no longer apply.
Also, this renders methods like ReduceTransparency() and ConvertToKeyFrame()
redundant, as internally maintained current canvas is always independent of
previous canvases.

Disposal method choice: we pick the disposal method that results in the smallest
change rectangle.

Change-Id: Ic31186d98fe1a2a790a89d1571b17e3abd127e79

9 days agoModify CostModel to allocate optimal memory. 79/71979/3
Vikas Arora [Wed, 22 Oct 2014 18:14:37 +0000 (11:14 -0700)]
Modify CostModel to allocate optimal memory.

Change-Id: I7d52675d28bfc109d4e901581fc24cd36fcb79ee

9 days agoimplement VE4/HE4/RD4/... in SSE2 72/71972/2
Pascal Massimino [Wed, 22 Oct 2014 16:25:36 +0000 (18:25 +0200)]
implement VE4/HE4/RD4/... in SSE2

(30% faster prediction functions, but overall speed-up is ~1% only)

Change-Id: I2c6e7074aa26a2359c9198a9015e5cbe143c2765

9 days agomake VP8PredLuma4[] non-const and initialize array in VP8DspInit() 73/71973/1
Pascal Massimino [Wed, 22 Oct 2014 16:14:20 +0000 (18:14 +0200)]
make VP8PredLuma4[] non-const and initialize array in VP8DspInit()

also convert 'type *dst' to 'type* dst'

Change-Id: I41ab66ad15b548cc45d1cb8b10bbca4fe1528cae

9 days agoMerge "PrintReg: output to stderr"
pascal massimino [Wed, 22 Oct 2014 15:55:10 +0000 (08:55 -0700)]
Merge "PrintReg: output to stderr"

9 days agoMerge "stopwatch.h: fix includes"
pascal massimino [Wed, 22 Oct 2014 15:28:55 +0000 (08:28 -0700)]
Merge "stopwatch.h: fix includes"

9 days agoPrintReg: output to stderr 71/71971/1
James Zern [Wed, 22 Oct 2014 15:28:19 +0000 (17:28 +0200)]
PrintReg: output to stderr

allows use of '-o -' while testing

Change-Id: Ibc02d7cede2df4eb8be0a28c0ca4bf5e91864191

9 days agostopwatch.h: fix includes 70/71970/1
James Zern [Wed, 22 Oct 2014 15:25:41 +0000 (17:25 +0200)]
stopwatch.h: fix includes

WEBP_INLINE -> webp/types.h
memcpy -> string.h

Change-Id: Iab2ea8b553dc98be75eede751de62ab0292d1f97

10 days agoOptimize BackwardReferenceHashChainFollowPath. 59/71959/2
Vikas Arora [Tue, 21 Oct 2014 06:44:01 +0000 (23:44 -0700)]
Optimize BackwardReferenceHashChainFollowPath.

Instead of calling HashChainFindMethod, call a new (subset) method
HashChainFindOffset to get the offset/distance for a given length.

The encoding is tad faster at default compression

                       Before              After
                     bpp/rate            bpp/rate
442 Palette     0.2720/5.270 MP/s      0.2720/5.790 MP/s
558 non-palette 3.7607/0.797 MP/s      3.7607/0.816 MP/s

Change-Id: If4041a9c18f7e972f49fcbab8c3e2f013d8bf1cf

11 days agoenc/backward_references.c: fix indent 44/71944/1
James Zern [Mon, 20 Oct 2014 09:35:20 +0000 (11:35 +0200)]
enc/backward_references.c: fix indent

reindent after c24f895

Change-Id: I55adcbef21ea3fdaded84b138745515596191a09

2 weeks agoMerge "sync version numbers to 0.4.2 release"
James Zern [Fri, 17 Oct 2014 18:47:30 +0000 (11:47 -0700)]
Merge "sync version numbers to 0.4.2 release"

2 weeks agosync version numbers to 0.4.2 release 37/71937/1
James Zern [Fri, 17 Oct 2014 17:49:30 +0000 (19:49 +0200)]
sync version numbers to 0.4.2 release

libwebp{,decoder} - 0.4.2
libwebp libtool - 5.2.0
libwebpdecoder libtool - 1.2.0

mux/demux - 0.2.2
libtool - 1.2.0

(cherry picked from commit eec5f5f12179a4d950fc27aef1c70f087beade59)
(cherry picked from commit 857578a811ea96abfa3235e4e47dd1ab4726e655)

Change-Id: Ie9d10c68e28083674a8865ad8447b1a70dcea95d

2 weeks agoSimplify and speedup Backward refs computation. 33/71933/1
Vikas Arora [Fri, 17 Oct 2014 16:20:02 +0000 (09:20 -0700)]
Simplify and speedup Backward refs computation.

Updated VP8LGetBackwardReferences and HashChainFindCopy method with following:
- Remove the recursive CostModelBuild.
- Reuse the lz77 backward refs in CostModelBuild, instead of evaluating it
  again (as it was done for recursion_level=0).
- Consolidated the Match-length logic inside FindMatchLength method.
- Removed the logic for altering best_length/val based on the 2D distance.
  The additional 162 value (+= 9 * 9 + 9 * 9 - y * y - x * x) can't change the
  best_val eval computation to choose a different curr_length, as best_val was
  set to 'curr_length << 16'.

  Following is the impact on the compression speed/density at default & max
  quality, overall this speeds up compression by 5-15% (q=100 -> 75) with a tad
  drop (0.02-0.03%) in compression density for the non-palette images.

                  Before                After
                bpp/Rate(MP/s)        bpp/Rate(MP/s)
q=75 (def)
All 1000        2.4492/1.049 MP/s     2.4498/1.230 MP/s
Palette         0.2719/5.060 MP/s     0.2719/6.110 MP/s
non-Palette     3.7597/0.732 MP/s     3.7607/0.840 MP/s

q=100
All 1000        2.4134/0.125 MP/s     2.4142/0.131 MP/s
Palette         0.2692/2.585 MP/s     0.2692/2.885 MP/s
non-Palette     3.7040/0.079 MP/s     3.7053/0.083 MP/s

Change-Id: I27a5eff3356d876c3e949fd32262244b25678b7a

2 weeks agofix shared object build with -fvisibility=hidden 69/71569/3
James Zern [Sat, 13 Sep 2014 04:07:19 +0000 (21:07 -0700)]
fix shared object build with -fvisibility=hidden

set WEBP_EXTERN to visibility=default
+ explicitly mark VP8GetCPUInfo as it's referenced within the examples

Change-Id: Ie3d2b15088e888f0b55203b205993eba75899d99

2 weeks agoWEBP_TSAN_IGNORE_FUNCTION: fix gcc compat warning 19/71919/1
James Zern [Thu, 16 Oct 2014 16:06:43 +0000 (18:06 +0200)]
WEBP_TSAN_IGNORE_FUNCTION: fix gcc compat warning

move the attribute to the front of the function to quiet clang warning:
GCC does not allow no_sanitize_thread attribute in this position on a
function definition

Change-Id: Ie4cc6e35a07bd00eab67d9cd6801bd2be9cfe676

2 weeks agoadd code for testing random incremental decoding in dwebp 17/71917/1
Pascal Massimino [Thu, 16 Oct 2014 15:01:32 +0000 (17:01 +0200)]
add code for testing random incremental decoding in dwebp

(protected with WEBP_EXPERIMENTAL_FEATURES flag)

Change-Id: I6cc2488810ce2ccd5d45882bd12f34a3d0c8eab8

2 weeks agomark some init function as being safe for thread_sanitizer. 15/71915/1
Pascal Massimino [Thu, 16 Oct 2014 14:34:07 +0000 (16:34 +0200)]
mark some init function as being safe for thread_sanitizer.

introduces the macro WEBP_TSAN_IGNORE_FUNCTION

Change-Id: I3de2b6c1a2076fba4da7ae50322551e026b2082b

2 weeks agobit_reader.h: cosmetics: fix a typo 06/71906/1
James Zern [Thu, 16 Oct 2014 08:51:57 +0000 (10:51 +0200)]
bit_reader.h: cosmetics: fix a typo

Change-Id: I1ba09124700b3120f18eb3705eb5ba805feb2ca0

2 weeks agoImproved near-lossless mode. 89/71889/2
Pascal Massimino [Wed, 15 Oct 2014 12:28:19 +0000 (14:28 +0200)]
Improved near-lossless mode.

Compared to previous mode it gives another 10-30% improvement in compression keeping comparable PSNR on corresponding quality settings.

Still protected by the WEBP_EXPERIMENTAL_FEATURES flag.

Change-Id: I4821815b9a508f4f38c98821acaddb74c73c60ac

2 weeks agoenc_mips32: workaround gcc-4.9 bug 93/71893/2
James Zern [Wed, 15 Oct 2014 17:08:29 +0000 (19:08 +0200)]
enc_mips32: workaround gcc-4.9 bug

avoids an ICE with NDK r10b + NDK_TOOLCHAIN_VERSION=4.9

In function 'SSE16x16':
enc_mips32.c (684) internal compiler error: Segmentation fault

Change-Id: I1a3d33c0a9534c97633ab93bcdf9bf59d3a7e473

2 weeks agoenc/vp8l.c: fix indent 10/71810/1
James Zern [Mon, 13 Oct 2014 09:33:23 +0000 (11:33 +0200)]
enc/vp8l.c: fix indent

reindent after ca00502

Change-Id: I8c88dbc11dc96c117531b17682b764a235ef23bb

3 weeks agoEvaluate non-palette compression for palette image 96/71796/1
Vikas Arora [Fri, 10 Oct 2014 18:50:52 +0000 (11:50 -0700)]
Evaluate non-palette compression for palette image

Evaluate if for Palette images (num_colors <= 256), non-palette
compression path (Subtract green, predictor transform etc) yield an
optimal compression density.

This change reduces the WebP file (for palette images) size by 0.4% with
drop of 3-5% in compression speed.

Change-Id: I1ad66fa94db4fd7ba7bc215763791ef662cd4f42

3 weeks agoAssignSegments: quiet -Warray-bounds warning 90/71790/2
James Zern [Thu, 25 Sep 2014 06:51:46 +0000 (23:51 -0700)]
AssignSegments: quiet -Warray-bounds warning

the number of segments are previously validated, but an explicit check
is needed to avoid a warning under gcc-4.9

Change-Id: Ifa7c0dd7f3f075b3860fa8ec176d2c98ff54fcea

3 weeks agoMerge "enc_neon: initialize vectors w/vdup_n_u32"
pascal massimino [Thu, 9 Oct 2014 19:23:18 +0000 (12:23 -0700)]
Merge "enc_neon: initialize vectors w/vdup_n_u32"

3 weeks ago1-3% faster encoding optimizing SSE_NxN functions 80/71780/1
Pascal Massimino [Thu, 9 Oct 2014 14:20:00 +0000 (07:20 -0700)]
1-3% faster encoding optimizing SSE_NxN functions

got rid of the |a-b|^|b-a| method and went back
to just (a-b)^2 instead.

quality | size(bytes) after/before | time (ms) after/before

Change-Id: Ia3e0e6507b3f903deb1e182f78dad6df07380fd0

3 weeks agoenc_neon: initialize vectors w/vdup_n_u32 79/71779/1
James Zern [Thu, 9 Oct 2014 10:35:41 +0000 (12:35 +0200)]
enc_neon: initialize vectors w/vdup_n_u32

replaces {} initialization gnu-ism

Change-Id: I5a7b2d4246f0205e4bfb7f4b77d720c47d8674ec

3 weeks agoMerge "Fix return code of EncodeImageInternal()"
Pascal Massimino [Wed, 8 Oct 2014 06:49:29 +0000 (23:49 -0700)]
Merge "Fix return code of EncodeImageInternal()"

3 weeks agoFix return code of EncodeImageInternal() 67/71767/1
Pascal Massimino [Tue, 7 Oct 2014 14:24:16 +0000 (16:24 +0200)]
Fix return code of EncodeImageInternal()

It was returning 'VP8_ENC_OK' in case of memory error.

Change-Id: I184a3e29c9f1b863637cacbe389b058d75c3dbf8

3 weeks agooptimize palette ordering 49/71749/2
Pascal Massimino [Wed, 8 Oct 2014 06:42:36 +0000 (08:42 +0200)]
optimize palette ordering

We compact the palette by weighted distance, favoring the green channel.

Average gain on paletted file is ~0.5%, with gain up to 6-7% on some favorable cases.
Encoding speed is unaffected.

Disabled for alpha (or any single-channel input)

Also: always use quality=20 for EncodePalette() since it
doesn't make any real difference.

Change-Id: I19fb14316a366f139a941b45aef5663a33c905e1

3 weeks agodon't set the alpha value for histogram index image 66/71766/1
Pascal Massimino [Wed, 8 Oct 2014 06:24:19 +0000 (08:24 +0200)]
don't set the alpha value for histogram index image

This leads to tiny extra compression (~few bytes per file) for free

Change-Id: Ia4d8cef3de4365e32eacefd69a57689c80042a23

3 weeks agoadd WebPDispatchAlphaToGreen() to dsp 42/71742/1
Pascal Massimino [Mon, 6 Oct 2014 21:15:44 +0000 (23:15 +0200)]
add WebPDispatchAlphaToGreen() to dsp

SSE2 version is 2.1x faster

This is used to transfer the alpha plane to green channel before lossless compression.

Change-Id: I01d9df0051c183b1ff5d6eb69961d4f43e33141a

4 weeks agoMerge "Change Entropy based Histogram Combine heuristic."
pascal massimino [Wed, 1 Oct 2014 06:50:51 +0000 (23:50 -0700)]
Merge "Change Entropy based Histogram Combine heuristic."

4 weeks agoMerge "iosbuild: cleanup"
James Zern [Tue, 30 Sep 2014 23:26:30 +0000 (16:26 -0700)]
Merge "iosbuild: cleanup"

4 weeks agoMerge "iosbuild: output autoconf req. on failure"
James Zern [Tue, 30 Sep 2014 23:25:32 +0000 (16:25 -0700)]
Merge "iosbuild: output autoconf req. on failure"

4 weeks agoChange Entropy based Histogram Combine heuristic. 93/71693/1
Vikas Arora [Tue, 30 Sep 2014 20:40:38 +0000 (13:40 -0700)]
Change Entropy based Histogram Combine heuristic.

Don't combine the Histograms that have trivial (single valued A, R & B)
  symbols.
Following is the compression savings data along with compression time (before
& after) per image.
                     Before             After
                     bpp, rate(MP/s)    bpp, rate(MP/s)
Q=25, method = 4     2.508, 1.807       2.499, 1.916
Q=50, method = 4     2.460, 1.488       2.456, 1.512
Q=75, method = 4     2.452, 1.078       2.450, 1.092
Q=25, method = 5     2.505, 1.398       2.496, 1.383
Q=50, method = 5     2.458, 1.170       2.453, 1.143
Q=75, method = 5     2.453, 0.886       2.450, 0.855

This change provides 0.1-0.4% compression gains and speeds up the lossless
compression for the default method=4 (the drop in compression speed is between 1-3.5% for method=5).

Change-Id: Idfd88c2092f37afacd26a97097b3053f8183953a

4 weeks agofix MSVC float->int conversion warning 83/71683/1
Pascal Massimino [Sat, 27 Sep 2014 07:36:01 +0000 (00:36 -0700)]
fix MSVC float->int conversion warning

+ add a clarifying comment

Change-Id: I8ac1df1de2e5277f2d968dec489546e680bb5e0c

5 weeks agoiosbuild: cleanup 73/71673/2
James Zern [Sat, 27 Sep 2014 02:28:45 +0000 (19:28 -0700)]
iosbuild: cleanup

- s/declare -r/readonly/
- remove unnecessary build variables
- echo configure line

Change-Id: I4489d8413934dcec57d60abf136a72d08fa0fd99

5 weeks agoiosbuild: output autoconf req. on failure 72/71672/2
James Zern [Fri, 26 Sep 2014 06:44:45 +0000 (23:44 -0700)]
iosbuild: output autoconf req. on failure

Change-Id: I2a6d80cf22f5b58e80345a411c48f047fecdbb47

5 weeks agoHistoHeapInit: correct positions allocation size 80/71680/1
James Zern [Fri, 26 Sep 2014 18:21:19 +0000 (11:21 -0700)]
HistoHeapInit: correct positions allocation size

Change-Id: I1879fd48bee3aea6f0504926d7030b504dd9be07

5 weeks agolossless: entropy clustering for high qualities. 75/71675/1
Pascal Massimino [Fri, 26 Sep 2014 13:26:56 +0000 (15:26 +0200)]
lossless: entropy clustering for high qualities.

Tested on 1000 pngs corpus with quality 90-100 it gives ~0.15% improvement
in compression density and ~7% speed up.

Change-Id: I460f56c96707edb3c1f0b51a024e5122e10458df

5 weeks agofix type warning for VS9_x64 71/71671/2
Pascal Massimino [Fri, 26 Sep 2014 06:09:35 +0000 (23:09 -0700)]
fix type warning for VS9_x64

Error report was:
src\utils\color_cache.c(48) : warning C4334: '<<' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)

Change-Id: I93463ba7cd94faf1cf04986acbfaa06b62700d26

5 weeks agoiosbuild: make iOS 6 the minimum requirement 60/71660/1
James Zern [Thu, 25 Sep 2014 02:42:53 +0000 (19:42 -0700)]
iosbuild: make iOS 6 the minimum requirement

iOS 5 support isn't available in the Xcode 6 install; iOS 6 covers
phones starting at the 3GS, so should be a reasonable base line

Change-Id: Ie5603c9e30cb52114b372509e183febbf679a69a

5 weeks agoRemove unused VP8LDecoder member variable 54/71654/1
Vikas Arora [Wed, 24 Sep 2014 18:58:51 +0000 (11:58 -0700)]
Remove unused VP8LDecoder member variable

Remove the unused VP8LDecoder member variable (last_cached_)

Change-Id: I4a7d2f1b72d166efb978850e061dc69c8509e224

5 weeks agoMerge "rewrite Disto4x4 in enc_neon.c with intrinsic"
James Zern [Wed, 24 Sep 2014 17:51:47 +0000 (10:51 -0700)]
Merge "rewrite Disto4x4 in enc_neon.c with intrinsic"

5 weeks agoadd lossless incremental decoding support 29/71629/4
Pascal Massimino [Wed, 24 Sep 2014 07:38:52 +0000 (09:38 +0200)]
add lossless incremental decoding support

* We don't need to change DecodeAlpha, since incremental
decoding is not useful for Alpha (we already decode
progressively along the RGB)
* Similarly, we don't do incremental decoding for level>0 planes:
   the metadata don't turn into visible pixel (only the ones in level0), so...
(No visible speed change)

Change-Id: I2fd4b9ba227561a7dbede647686584b752be7baa

5 weeks agorewrite Disto4x4 in enc_neon.c with intrinsic 62/71462/9
Yang Zhang [Thu, 4 Sep 2014 09:20:52 +0000 (17:20 +0800)]
rewrite Disto4x4 in enc_neon.c with intrinsic

Performance test:
Platform: A9
Input data: bryce.yuv  11158x2156
performance of assembly is the base. Less ratio is better.
|toolchain |assembly |intrinsic |
|gcc4.6    |100%     |97.15%    |
|gcc4.8    |100%     |95.51     |

Change-Id: Idc2446685acdeb58a4dbdcdae533c68a83a1b879

5 weeks agoMIPS: dspr2: added optimization for function FilterLoop24 39/71639/2
Djordje Pesut [Fri, 19 Sep 2014 10:13:31 +0000 (12:13 +0200)]
MIPS: dspr2: added optimization for function FilterLoop24

affected functions: VFilter16i, HFilter16i, VFilter8i and HFilter8i

Change-Id: I5d2bc7716e60e048a33d630fe4a86011bfb6d42e

5 weeks agoMerge "prepare VP8LDecodeImage for incremental decode"
skal [Tue, 23 Sep 2014 07:31:27 +0000 (00:31 -0700)]
Merge "prepare VP8LDecodeImage for incremental decode"

5 weeks agoMerge "MIPS: dspr2: added optimization for function FilterLoop26"
pascal massimino [Tue, 23 Sep 2014 07:17:25 +0000 (00:17 -0700)]
Merge "MIPS: dspr2: added optimization for function FilterLoop26"

5 weeks agoprepare VP8LDecodeImage for incremental decode 38/71638/1
skal [Tue, 23 Sep 2014 07:13:52 +0000 (00:13 -0700)]
prepare VP8LDecodeImage for incremental decode

- don't call VP8LClear() when there's no error (and let the caller do it)
- only initialize output once if state_ is not READ_DATA
- don't over-set dec->status_ = READ_DATA
- don't re-set dec->status_ if DecodeImageStream() fails
- remove unneeded dec->action_ field
- make ReadImageInfo() check br->eos_
- use ErrorStatusLossless() more consistently

Change-Id: Ica6e4b1c82e3fce8b1ce0274def551a886b73b0b

5 weeks agoremove br->error_ field 37/71637/1
skal [Tue, 23 Sep 2014 07:04:58 +0000 (00:04 -0700)]
remove br->error_ field

it's somewhat redundant with br->eos_

also make the status-check coherent.

Change-Id: I98e755e037d45acb0760baf2344bf11fb5fb5cda

5 weeks agoMIPS: dspr2: added optimization for function FilterLoop26 36/71636/1
Djordje Pesut [Fri, 19 Sep 2014 10:04:27 +0000 (12:04 +0200)]
MIPS: dspr2: added optimization for function FilterLoop26

affected functions: VFilter16, HFilter16, VFilter8 and HFilter8

Change-Id: Ib2fc41aaa00b10c2906d689bdc5a10f4568e70a8

5 weeks agoiobuild.sh: only install .h files in Headers 35/71635/1
James Zern [Tue, 23 Sep 2014 00:28:51 +0000 (17:28 -0700)]
iobuild.sh: only install .h files in Headers

cp * -> cp *.h; avoids picking up autoconf files

Change-Id: I57c04562d554431ddf4605af65077f32d90ac58e

6 weeks agoPremultiply with alpha during U/V downsampling 55/71555/7
skal [Fri, 19 Sep 2014 06:40:34 +0000 (23:40 -0700)]
Premultiply with alpha during U/V downsampling

This prevents the 'alpha-leak' reported in issue #220

Speed-diff is kept minimal.

Change-Id: I1976de5e6de7cfcec89a54df9233c1a6586a5846

6 weeks agogif2webp: Background color correction 12/71612/1
Urvang Joshi [Thu, 18 Sep 2014 22:07:28 +0000 (15:07 -0700)]
gif2webp: Background color correction

For some GIF images, the first frame is missing the corresponding
graphic control extension. For such cases, we were never calling
GetBackgroundColor(), and default background color value (white) was being used
incorrectly.
So, we call GetBackgroundColor() when we encounter the first image
descriptor instead, to make sure that it is always called.

Change-Id: I00fc8e943d8a0c1578dcd718f3e74dec7de4ed61

6 weeks agoAmend the lossless spec according to issue #205, #206 and #224 05/71605/1
Pascal Massimino [Thu, 18 Sep 2014 06:21:02 +0000 (08:21 +0200)]
Amend the lossless spec according to issue #205, #206 and #224

http://code.google.com/p/webp/issues/detail?id=205 <- Select()
http://code.google.com/p/webp/issues/detail?id=206 <- out-of-bound colormap index
http://code.google.com/p/webp/issues/detail?id=224 <- version number MUST be 0

Change-Id: I56a575529862dfc8ad189ddcfc47ef59a58f273d

6 weeks agoRecord the lossless size stats. 01/71601/3
Vikas Arora [Wed, 17 Sep 2014 21:11:52 +0000 (14:11 -0700)]
Record the lossless size stats.

Record and show the lossless header and image data sizes in the cwebp.

Change-Id: I08f19693cb7a756b6fdce5b55d71f5367b5f02fc

6 weeks agoAdd a WebPExtractAlpha function to dsp 72/71572/2
Pascal Massimino [Mon, 15 Sep 2014 06:11:36 +0000 (08:11 +0200)]
Add a WebPExtractAlpha function to dsp

This is the opposite of WebPDispatchAlpha

+ Implement the SSE2 version

Change-Id: I0c297309255f508c5261da8aad01f7e57f924d6c

7 weeks agofix indent after I0204949917836f74c0eb4ba5a7f4052a4797833b 57/71557/1
Pascal Massimino [Fri, 12 Sep 2014 17:59:53 +0000 (19:59 +0200)]
fix indent after I0204949917836f74c0eb4ba5a7f4052a4797833b

Change-Id: I5d9e5d0a2ad2cefd8c539571d2eaee948da60ad5

7 weeks agoOptimize lossless decoding for trivial(ARB) codes. 56/71556/1
Vikas Arora [Fri, 12 Sep 2014 16:06:35 +0000 (09:06 -0700)]
Optimize lossless decoding for trivial(ARB) codes.

Optimize the decoding for region that have trivial literal codes.
The trivial literal is defined as huffman image with Red, Blue and Alpha
huffman trees with only single code values.
This speeds up lossless decoding by 3%

Change-Id: I0204949917836f74c0eb4ba5a7f4052a4797833b

7 weeks agoMerge "webpmux: simplify InitializeConfig()"
James Zern [Fri, 12 Sep 2014 07:43:06 +0000 (00:43 -0700)]
Merge "webpmux: simplify InitializeConfig()"

7 weeks agowebpmux: simplify InitializeConfig() 54/71554/2
James Zern [Fri, 12 Sep 2014 07:03:28 +0000 (00:03 -0700)]
webpmux: simplify InitializeConfig()

put WebPMuxConfig on the stack in main() rather than allocating it in
InitializeConfig(); removes a level of indirection there.

Change-Id: I81d386f7472ebbd322dd3fdbfda9d78dbeb62a66

7 weeks agowebpmux: fix indent 53/71553/2
James Zern [Fri, 12 Sep 2014 06:53:05 +0000 (23:53 -0700)]
webpmux: fix indent

+ remove unnecessary cast

Change-Id: I2070fbe6aeda49f5790c69390e5b539a2c1a5616

7 weeks agowebpmux: fix exit status on numeric value parse error 51/71551/2
James Zern [Fri, 12 Sep 2014 06:36:12 +0000 (23:36 -0700)]
webpmux: fix exit status on numeric value parse error

in most cases 'ok' is set via a goto macro

Change-Id: I17c832446bf3e716d3bcd323dbcc72bec544029c

7 weeks agoMerge "webpmux: fix loop_count range check"
pascal massimino [Fri, 12 Sep 2014 06:02:37 +0000 (23:02 -0700)]
Merge "webpmux: fix loop_count range check"

7 weeks agoMerge "examples: warn on invalid numeric parameters"
pascal massimino [Fri, 12 Sep 2014 06:02:18 +0000 (23:02 -0700)]
Merge "examples: warn on invalid numeric parameters"

7 weeks agowebpmux: fix loop_count range check 44/71544/1
James Zern [Thu, 11 Sep 2014 22:26:11 +0000 (15:26 -0700)]
webpmux: fix loop_count range check

explicitly check [0, 65535], the use of 'long' was removed in a prior
commit

Change-Id: I70d5bf286908459b5d4d619c657853f0e833b6ea

7 weeks agoMerge "fix loop bug in DispatchAlpha()"
Pascal Massimino [Thu, 11 Sep 2014 21:48:19 +0000 (14:48 -0700)]
Merge "fix loop bug in DispatchAlpha()"