webm/libwebp.git
31 hours agoupdate NEWS 96/71996/1 master
James Zern [Mon, 13 Oct 2014 15:13:49 +0000 (17:13 +0200)]
update NEWS

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

32 hours 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"

32 hours 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"

33 hours 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

33 hours 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

33 hours 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

33 hours 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

34 hours 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"

34 hours 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

34 hours 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

34 hours 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

37 hours 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

38 hours 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."

47 hours 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

2 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

2 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

2 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

2 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

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

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

2 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

2 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

3 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

4 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

7 days 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"

7 days 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

7 days 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

7 days 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

8 days 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

8 days 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

8 days 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

8 days 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

9 days 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

9 days 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

11 days 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

2 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

2 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

2 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"

2 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

2 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

2 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()"

2 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

2 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

2 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

2 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

3 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."

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

3 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"

3 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

3 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

3 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

3 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

4 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

4 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

4 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

4 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

4 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

4 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"

4 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

4 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

4 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

4 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"

4 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"

4 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

4 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

4 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

4 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

5 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

5 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

5 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

5 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

5 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

6 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

6 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

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

6 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

6 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

6 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

6 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"

6 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"

6 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

6 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()"

6 weeks agogif2webp: Handle frames with missing graphic control extension 43/71543/1
Urvang Joshi [Thu, 11 Sep 2014 21:35:21 +0000 (14:35 -0700)]
gif2webp: Handle frames with missing  graphic control extension

According to the GIF spec (http://www.w3.org/Graphics/GIF/spec-gif89a.txt),
this block is optional, and its scope is only the first graphic rendering block
that follows.

The spec doesn't mention what default values of frame dimensions, offsets,
duration and transparent index to use in such a case, though. So, we use the
defaults used by GIF reader in Chromium:
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageReader.h&l=186

Change-Id: Iecc6967847192483770e85ac15fe2835cd01ce7b

6 weeks agofix loop bug in DispatchAlpha() 41/71541/1
Pascal Massimino [Thu, 11 Sep 2014 20:35:08 +0000 (22:35 +0200)]
fix loop bug in DispatchAlpha()

* We were re-doing most of the work in plain-C as 'left-over'.
* we were always returning has_alpha = true because of a bad mask all_0xff

These bugs were conservative and silent, in the sense that we were 'just' doing
more work than necessary.

Now, the SSE2 version is really 2x faster than the C version.

Change-Id: I6c8132a267fe3c7a3d1fa70e7a5fcd10719543fa

6 weeks agoexamples: warn on invalid numeric parameters 27/71527/3
James Zern [Thu, 11 Sep 2014 06:35:48 +0000 (23:35 -0700)]
examples: warn on invalid numeric parameters

add ExUtilGet[U]Int / ExUtilGetFloat which print an error message on
parse failure.
fixes issue #219.

Change-Id: Ie537f5aebd138925bf1a48289b6b5e261b3af2ca

6 weeks agoMIPS: dspr2: added optimization for TransformOne 28/71528/3
Djordje Pesut [Tue, 2 Sep 2014 12:24:10 +0000 (14:24 +0200)]
MIPS: dspr2: added optimization for TransformOne

added macros for TransformOne, TransformAC3 and TransfromDC

Change-Id: I4341450f443cf46dcf91c0db17bde63c8fb8afee

6 weeks agoSSE2 for inverse Mult(ARGB)Row and ApplyAlphaMultiply 26/71526/1
Pascal Massimino [Thu, 11 Sep 2014 05:58:42 +0000 (07:58 +0200)]
SSE2 for inverse Mult(ARGB)Row and ApplyAlphaMultiply

Change-Id: Iab5c0e4a4d2b31f86736a9b277e62b6e28c3d2b4
WebPMultRow: ~7x faster
WebPMultARGBRow: ~3x faster
ApplyAlphaMultiply: 60% faster

6 weeks agoRemove default initialization of decoder status. 24/71524/1
Vikas Arora [Wed, 10 Sep 2014 21:54:20 +0000 (14:54 -0700)]
Remove default initialization of decoder status.

emove the default initialization of decoder status in the method
VP8LDecodeImage().

Change-Id: Ie6b949606349f4e937c4c1dd2c02ff2a4f86870f

6 weeks agoconfigure: simplify libpng-config invocation 16/71516/1
James Zern [Wed, 10 Sep 2014 05:55:29 +0000 (22:55 -0700)]
configure: simplify libpng-config invocation

use --ldflags over --prefix + --libs combination

based on comment in issue #180.

Change-Id: If2ca06053d5237b6722ddf4117917e5f3c06ab59

6 weeks agoRectify bug in lossless incremental decoding. 11/71511/1
Vikas Arora [Tue, 9 Sep 2014 22:30:47 +0000 (15:30 -0700)]
Rectify bug in lossless incremental decoding.

Handle the corner case when VP8LDecodeImage() method is called with an invalid
header data. The lossless decoding doesn't support incremental mode yet.
Return the error status as BITSTREAM error in case not all pixels are decoded
with the provided bit-stream. Also added asserts in the VP8LDecodeImage() method
to validate the decoder header with appropriate/valid data for huffman trees
(htree_groups_ etc).

Change-Id: Ibac9fcfc4bd0a2c5f624bb9d4a2b9f6459aa19ea

6 weeks agoMIPS: dspr2: added optimization for TransformAC3 01/71501/1
Djordje Pesut [Tue, 2 Sep 2014 12:18:51 +0000 (14:18 +0200)]
MIPS: dspr2: added optimization for TransformAC3

Change-Id: Icd789ee5f6d764297e7dc0a0f8a3bc47ab92ac65

6 weeks agoMIPS: dspr2: added optimization for TransformDC 00/71500/1
Djordje Pesut [Tue, 2 Sep 2014 12:03:13 +0000 (14:03 +0200)]
MIPS: dspr2: added optimization for TransformDC

Change-Id: Iee69758f6442ea9c80ddaa32cea8d00dda4c6252

6 weeks agoMerge "Slightly faster lossless decoding (1%)"
Pascal Massimino [Tue, 9 Sep 2014 10:55:00 +0000 (03:55 -0700)]
Merge "Slightly faster lossless decoding (1%)"

6 weeks agoSlightly faster lossless decoding (1%) 67/71467/5
Pascal Massimino [Sat, 6 Sep 2014 06:26:28 +0000 (08:26 +0200)]
Slightly faster lossless decoding (1%)

-> introduce special case 64b pattern-copy, similar to the 8b one for alpha.
-> use mempcy() for non-overlapping areas
+ cosmetics and homogenezation of the code

Change-Id: I0e65e04b96fec94c009a4614137dfba2a0f98561

6 weeks agoMIPS: dspr2: added optimization for ColorIndexInverseTransforms 43/71443/4
Djordje Pesut [Tue, 2 Sep 2014 14:34:52 +0000 (16:34 +0200)]
MIPS: dspr2: added optimization for ColorIndexInverseTransforms

Change-Id: I5b6094ce489d4f896bc4b8f575142eb3c5054beb

6 weeks agomake VP8LSetBitPos() set br->eos_ flag 83/71483/1
Pascal Massimino [Sat, 6 Sep 2014 06:40:20 +0000 (08:40 +0200)]
make VP8LSetBitPos() set br->eos_ flag

ReadSymbol() finishes with a VP8LSetBitPos() call only and could miss an eos_ during the decode loop.

Things are faster because of inlining too.

Change-Id: I2d2a275f38834ba005bc767d45c5de72d032103e

7 weeks agoLossless decoding: fix eos_ flag condition 69/71469/2
Pascal Massimino [Fri, 5 Sep 2014 18:21:17 +0000 (20:21 +0200)]
Lossless decoding: fix eos_ flag condition

eos_ needs to be set only when superfluous bits have actually
been requested.
Earlier, we were assuming pre-mature end-of-stream to be an error.
Now, more precisely, we mark error when we have encountered end-of-stream *and*
we attempt to read more bits after that.

This handles cases where image data requires no bits to be read

Change-Id: I628e2c39c64f10c443fb51f86b1f5919cc9fd299

7 weeks agofix erroneous dec->status_ setting 68/71468/1
Pascal Massimino [Fri, 5 Sep 2014 17:48:11 +0000 (19:48 +0200)]
fix erroneous dec->status_ setting

We only need to set BITSTREAM_ERROR if !ok.

Change-Id: I5bd13e64797e8bc509477edb29158abb39cb0ee1

7 weeks agoMIPS: dspr2: add some specific mips code to commit I2c3f2b12f8df15b785fad5a9c56316e95... 42/71442/1
Djordje Pesut [Thu, 4 Sep 2014 11:38:15 +0000 (13:38 +0200)]
MIPS: dspr2: add some specific mips code to commit I2c3f2b12f8df15b785fad5a9c56316e954ae0c53

added some C-code tuning also

Change-Id: I67ce70a063ef6b5821b9158a4defd6987eccbb9a

7 weeks agoMerge "further refine the COPY_PATTERN optim for DecodeAlpha"
skal [Thu, 4 Sep 2014 10:43:55 +0000 (03:43 -0700)]
Merge "further refine the COPY_PATTERN optim for DecodeAlpha"