Commit Graph

747 Commits

Author SHA1 Message Date
Urvang Joshi
51bb1e5de7 mux.h: correct WebPDemuxSelectFragment() prototype
This is a correction to the following change:
a00a3daf5b Use 'frgm' instead of 'tile' in
webpmux parameters

Change-Id: I8fa0bce98efdde38827fd25712017a98a6ea7388
2012-11-08 11:04:39 -08:00
Pascal Massimino
22a0fd9d01 Add NEON version of FTransformWHT
Contributed by Wayne Chen (datoudatou at gmail dot com)

Change-Id: I007c21db4eeadbf82b89f0963256f965deda7d90
2012-11-08 08:28:51 -08:00
Urvang Joshi
fa30c86323 Update mux code to match the spec wrt animation
- Allow a duration of 0
- Rename LOOP chunk to ANIM and add the background color field to it.
- Add a disposal method field for each animation frame.
- Modify webpmux.c binary interface to allow the input of background color
  and disposal methods. Also make '-loop' and '-bgcolor' arguments optional
  with some default values.

Change-Id: I807372a61cdb8a0d3080ae3552caf2848070bf4d
2012-11-07 11:43:06 -08:00
Pascal Massimino
d9c5fbefa4 by-pass Analysis pass in case segments=1
10-15% faster encoding.

Almost same output, binary wise. The main difference is
that we can't compute uv_alpha susceptibility, means there
can be subtle differences with different -sns values.

Change-Id: Id1b1a50929bf125b6372212fee1ed75a3bed975f
2012-11-06 22:53:13 -08:00
pascal massimino
d2ad4450ce Merge changes Ibeccffc3,Id1585b16
* changes:
  Use 'frgm' instead of 'tile' in webpmux parameters
  Design change in ANMF and FRGM chunks:
2012-11-06 22:43:43 -08:00
James Zern
5c8be2515d Merge "Chunk fourCCs for XMP/EXIF" 2012-11-06 16:17:32 -08:00
Urvang Joshi
a00a3daf5b Use 'frgm' instead of 'tile' in webpmux parameters
- Also, use the term 'fragments' instead of 'tiling' in code
- This makes code consistent with the spec.

Change-Id: Ibeccffc35db23bbedb88cc5e18e29e51621931f8
2012-11-06 16:09:10 -08:00
Urvang Joshi
81b8a741ed Design change in ANMF and FRGM chunks:
- Make ANMF and FRGM chunks hierarchical so that they encompass all chunks of
  that frame.
- Use this in demuxer: stop parsing a frame if all image data for it isn't
  available yet. Thus, we have a frame-level incremental support; that is,
  all frames that are fully available can be parsed.
- Note: We still keep incremental support for single images - so that they can
  be decoded with incremental decoding.

Change-Id: Id1585b16b06caee1d84009c42a25d2de29fa6135
2012-11-06 16:04:33 -08:00
Urvang Joshi
f903cbab9a Chunk fourCCs for XMP/EXIF
Use separate fourCCs "XMP " and "EXIF" instead of a common "META"
Also, some refactorization in webpmux.c

Change-Id: Iad3337e5c1b81e785c60670ce28b1f536dd7ee31
2012-11-06 14:53:21 -08:00
vikas arora
812933d6ba Tune performance of HistogramCombine
Number of pairs selected are limited between 25% of histogram
images (at start) and number of histogram images left at any iteration.
Increase the range of iter_mult.
Removed min_cluster_size as parameter for tuning HistogramCombine.

Change-Id: Ia4068cd7af4d0f63c5af9001aceda8a40b9de740
2012-11-05 16:45:39 -08:00
James Zern
1c4609b1f8 Merge commit 'v0.2.1'
* commit 'v0.2.1':
  Update ChangeLog
  update NEWS
  bump version to 0.2.1
  libwebp: validate chunk size in ParseOptionalChunks
  cwebp (windows): fix alpha image import on XP
  autoconf/libwebp: enable dll builds for mingw
  [cd]webp: always output windows errors
  fix double to float conversion warning
  cwebp: fix jpg encodes on XP
  VP8LAllocateHistogramSet: fix overflow in size calculation
  GetHistoBits: fix integer overflow
  EncodeImageInternal: fix uninitialized free
  fix the -g/O3 discrepancy for 32bit compile
  fix the BITS=8 case
  Make *InitSSE2() functions be empty on non-SSE2 platform
  make *InitSSE2() functions be empty on non-SSE2 platform
  make VP8DspInitNEON() public

Conflicts:
	src/Makefile.am
	src/dsp/dec_neon.c

Change-Id: Iddc5152e4a6892db96c12d7c3f74adbc85fe6178
2012-11-02 12:20:19 -07:00
Pascal Massimino
e8b41ad136 add NEON asm version for WHT inverse transform
Contributed by Wayne Chen (datoudatou at gmail dot com)

+ some header cleanup
+ remove the NEON suffix in static functions

Change-Id: I75bf5e9b54cf5e1acc53764c6f081d61690f8e3d
2012-11-01 16:31:01 -07:00
pascal massimino
a61a824b3a Merge "Add NULL check in chunk APIs" 2012-10-31 16:07:24 -07:00
Pascal Massimino
0e8b7eedaa fix WebPPictureView() unassigned strides
y_stride/uv_stride/argb_stride were not set properly.

Change-Id: I001b8d46f873ca04b5c68eccd6f232061020f9ec
2012-10-31 16:01:34 -07:00
Pascal Massimino
75e5f17e3b ARM/NEON: 30% encoding speed-up
(implements the backward and forward transforms in the encoder)

original patch by Wayne Chen (datoudatou at gmail dot com)

Change-Id: Ic00f3bffcdf7a924f043006728735c810ee47a57
2012-10-31 14:00:20 -07:00
Urvang Joshi
02b4356875 Add NULL check in chunk APIs
Change-Id: I173ff6c9259111762580c1963ff60e34fd1e9b6b
2012-10-31 13:33:20 -07:00
Urvang Joshi
a077072777 mux struct naming
members of public structs should not have a trailing underscore.

Change-Id: Ieef42e1da115bf42b0ea42159701e32bed7b9f60
2012-10-31 11:37:49 -07:00
pascal massimino
6c66dde80f Merge "Tune Lossless encoder" 2012-10-30 18:27:14 -07:00
vikas arora
ab5ea217f7 Tune Lossless encoder
- Changed the dynamic range where more aggressive
  (BackwardReferencesTraceBackward) heuristic is run from quality > 10
  (instead of quality > 25).
- Limit the backward-ref Window size to 16*width & 256*width for lower
  qualities ([0, 25[ & [25, 50[) respectively, instead of 1M window.
- Evaluate the params for HashChainFindCopy outside this function call
  and pass it, instead of recomputing them for every call.

Change-Id: If9eedfc14b978e7632d7cf69c96186e2910b0554
2012-10-30 17:30:17 -07:00
Urvang Joshi
92f8059ce4 Rename some chunks:
TILE --> FRGM and FRM --> ANMF

Change-Id: I752f90b950413501aecb021a8f57882da0e01484
2012-10-30 15:02:15 -07:00
James Zern
3bb4bbeb60 Merge "Mux API change:" 2012-10-30 14:55:39 -07:00
Urvang Joshi
d0c79f0552 Mux API change:
Create common APIs for image, frame and tile.

Change-Id: I709ad752133094bd5bc89dd9c832ff79802aac68
2012-10-30 14:16:29 -07:00
James Zern
25f585c4f2 bump version to 0.2.1
lib - 0.2.1
libtool - 4.1.0 (compatible release)

Change-Id: Ib6ca47f2008d5c97d818422816ac60d0d0d8cffa
2012-10-29 19:17:17 -07:00
James Zern
fed7c0485a libwebp: validate chunk size in ParseOptionalChunks
the max wasn't checked leading to a rollover case, possibly exploitable.
additionally check the RIFF size early, to avoid similar issues.

pulled from chromium:
 http://codereview.chromium.org/11229048/

Change-Id: I4050b13a7e61ec023c0ef50958c45f651cf34c49
2012-10-29 14:00:33 -07:00
James Zern
b14fea993a autoconf/libwebp: enable dll builds for mingw
Change-Id: Ic1ace62aad1d8de95bc370c6729ded83b7b71f0b
2012-10-29 14:00:24 -07:00
James Zern
d662158010 fix double to float conversion warning
introduced in:
 a792b91 fix the -g/O3 discrepancy for 32bit compile

Change-Id: Ic77d6170a5a91cf58ec10c68656ac61a7c0ee41d
2012-10-29 14:00:14 -07:00
James Zern
734f762a08 VP8LAllocateHistogramSet: fix overflow in size calculation
the multiplications done for total_size would be done with integers,
possibly overflowing, before being promoted to 64-bit for the addition

Change-Id: I32c3a6400fc2ef120c38e01a8693f4cb1727234d
2012-10-29 14:00:05 -07:00
James Zern
f9cb58fbce GetHistoBits: fix integer overflow
huff_image_size was a size_t (=32 bits with 32-bit builds) which could
rollover causing an incorrectly sized allocation and a crash in lossless
encoding.
fixes issue #128

Change-Id: I0f20cee98c29b2b40b02607930b6b7a7ca56996d
2012-10-29 14:00:01 -07:00
James Zern
b30add2017 EncodeImageInternal: fix uninitialized free
on allocation error refs.refs would be uninitialized and free'd, causing
a crash

Change-Id: Idb7daec7aec3e5d769d8103595c28a9d0d0b86f4
2012-10-29 13:59:57 -07:00
skal
3de58d7730 fix the -g/O3 discrepancy for 32bit compile
in debug mode, some float operations see their intermediate
values stored in memory rather than staying in the FPU (which
is 80bit precision).

Several fixes are possible (breaking long calculations into
atomic steps for instance), but simpler of all is just about
turning the cost[] array into float* instead of double*.

The code is a tad faster, and i didn't see any major output
size difference.

Change-Id: I053e6d340850f02761687e072b0782c6734d4bf8
2012-10-29 13:59:52 -07:00
Pascal Massimino
77aa7d50a4 fix the BITS=8 case
spotted by Måns Rullgård (mans at mansr dot com)

Change-Id: I4484b1f00223a0be18cbe924b24a9f5ccffb7ea2
2012-10-29 13:59:48 -07:00
Pascal Massimino
e5970bda8a Make *InitSSE2() functions be empty on non-SSE2 platform
this avoids the '*.o has no symbols' warning messages

Change-Id: Ib47f9faf9073e39293acad6b2f21f21dba8c5378
2012-10-29 13:59:44 -07:00
Pascal Massimino
ef5cc47ee7 make *InitSSE2() functions be empty on non-SSE2 platform
this avoids the '*.o has no symbols' warning messages

Change-Id: I96aad8637fba47fdaa5a12740e3881ed362c805b
2012-10-29 13:59:38 -07:00
Pascal Massimino
c4ea259db4 make VP8DspInitNEON() public
this will avoid the "dec_neon.o has no symbol" warning

no change in binary size observed on linux.

Change-Id: Ifd83dfc6a0c61905481599b06cb5e711f55efa7d
2012-10-29 13:59:31 -07:00
James Zern
30763333f3 libwebp: validate chunk size in ParseOptionalChunks
the max wasn't checked leading to a rollover case, possibly exploitable.
additionally check the RIFF size early, to avoid similar issues.

pulled from chromium:
 http://codereview.chromium.org/11229048/

Change-Id: Ifebc712bf3d3de0129b76ca4c57c68e062abc429
2012-10-22 21:57:59 -07:00
James Zern
704818980f AccumulateLSIM: fix double -> float warnings
Change-Id: I234a5cd09b9351dbbbbc5076be35bb794d1bf890
2012-10-22 18:00:20 -07:00
skal
c6e98658d2 Merge "add EXPERIMENTAL code for YUV-JPEG colorspace" 2012-10-19 12:13:34 -07:00
skal
f0360b4fcf add EXPERIMENTAL code for YUV-JPEG colorspace
This is mostly for experimentation!
Need to define USE_YUVj flag in the code for that.

suggested by benwreder at hotmail dot com

Change-Id: If0b8e2c1863efc08ce097de6de20f4c7efc3f7e8
2012-10-19 20:15:58 +02:00
Pascal Massimino
f86e6abe1f add LSIM metric to WebPPictureDistortion()
LSIM stands for "local similarity": before matching
a compressed pixel to the source, we search around in the source
and minimise the squared error. So, this is close to PSNR calculation,
but mitigates some of its limitations (pure translation and noise for instance).

There's a new -print_lsim option to cwebp too.

Change-Id: Ia38561034c7a90e71d2ea0f55bb1de527eda245b
2012-10-19 06:48:11 -07:00
Vikas Arora
c3aa215afa Speed up HistogramCombine for lower qualities.
Make the heuristic for combining Histograms a function of compression
quality. This change will speed-up compression time for compression
quality less than 75. The compression time/density remains unchanged
for compression quality 75 and higher.

Change-Id: I94513d51078340fbc0737d459fab2cebdd2d6082
2012-10-16 15:45:36 -07:00
James Zern
1765cb1ca5 Merge "autoconf/libwebp: enable dll builds for mingw" 2012-10-09 13:24:25 -07:00
James Zern
a13562e800 autoconf/libwebp: enable dll builds for mingw
Change-Id: I7e0ee9f514a7102ee002c432dfb280187f06a596
2012-10-09 10:53:31 -07:00
skal
9f469b57a9 typo: no_fancy -> no_fancy_upsampling
Change-Id: Ia0cb8c4a5b586861fb89253f59555e555a3a44db
2012-10-09 15:14:24 +02:00
James Zern
e855208c16 fix double to float conversion warning
introduced in:
 a792b91 fix the -g/O3 discrepancy for 32bit compile

Change-Id: I6a77223f237527eda4ee1d6eaa993351bd74f1d6
2012-10-08 18:27:27 -07:00
Vikas Arora
7b3eb372ad Tune lossless compression to get better gains.
Tune compression heuristics to get better gains across wide quality range.

Change-Id: Ic342d4dbcf83fe2086a34e5c184aef0714109430
2012-10-05 09:58:29 -07:00
pascal massimino
ce8bff45bc Merge "VP8LAllocateHistogramSet: fix overflow in size calculation" 2012-10-03 14:57:15 -07:00
pascal massimino
ab5b67a1d0 Merge "EncodeImageInternal: fix uninitialized free" 2012-10-03 14:53:35 -07:00
pascal massimino
7fee5d1231 Merge "GetHistoBits: fix integer overflow" 2012-10-03 14:51:22 -07:00
James Zern
a6ae04d455 VP8LAllocateHistogramSet: fix overflow in size calculation
the multiplications done for total_size would be done with integers,
possibly overflowing, before being promoted to 64-bit for the addition

Change-Id: Id5c127c8a497ce5de89a276c17f36b59eeb67c21
2012-10-03 12:18:00 -07:00
James Zern
80237c4371 GetHistoBits: fix integer overflow
huff_image_size was a size_t (=32 bits with 32-bit builds) which could
rollover causing an incorrectly sized allocation and a crash in lossless
encoding.
fixes issue #128

Change-Id: I175c8c6132ba9792034807c5c1028dfddfeb4ea5
2012-10-03 12:17:52 -07:00
James Zern
8a9972353d EncodeImageInternal: fix uninitialized free
on allocation error refs.refs would be uninitialized and free'd, causing
a crash

Change-Id: I8d77069aadc594758aaa79b2b73376c0107e57e4
2012-10-03 12:17:47 -07:00
skal
0b9e682934 minor cosmetics
spotted in patch #34187

Change-Id: Ia706af6ef7674ec7a1d7250da08f718ed7c09e72
2012-10-03 15:22:33 +02:00
skal
a792b913bd fix the -g/O3 discrepancy for 32bit compile
in debug mode, some float operations see their intermediate
values stored in memory rather than staying in the FPU (which
is 80bit precision).

Several fixes are possible (breaking long calculations into
atomic steps for instance), but simpler of all is just about
turning the cost[] array into float* instead of double*.

The code is a tad faster, and i didn't see any major output
size difference.

Change-Id: Icf1f833e15f8ee4ecc7f9a521d07fdc96ef711aa
2012-10-03 15:15:58 +02:00
Pascal Massimino
73ba4357fe Merge "detect and merge similar segments" 2012-10-02 06:22:23 -07:00
Pascal Massimino
fee6627538 detect and merge similar segments
similar = same quant and filter strength.
This save some bits in the segment map

Change-Id: I6f594474ad82bddf013278d47089e43a02e07e63
2012-10-01 21:18:03 +02:00
James Zern
0c44f41585 src/webp/*.h: don't forward declare enums in C++
Change-Id: I36d3765e94d2b5529b321c186ccee1744785c5b3
fixes:
 error: ISO C++ forbids forward references to 'enum' types
since:
 28d25c8 replace 'typedef struct {} X;" by "typedef struct X X; struct X {};"
2012-09-28 21:21:41 -07:00
skal
931e0ea1d5 Merge "replace 'typedef struct {} X;" by "typedef struct X X; struct X {};"" 2012-09-26 07:13:36 -07:00
skal
8f216f7e60 remove cases of equal comparison for qsort()
Returning 0 (equal) can lead to undefined behaviour.
And, in our cases we'll never have equal keys (added asserts for that)

Change-Id: Ifaf202df321d3f877ad2a03de42e0d6cdd1b2388
2012-09-25 19:03:41 +02:00
skal
28d25c8256 replace 'typedef struct {} X;" by "typedef struct X X; struct X {};"
Change-Id: I937dc8781bc87ef0c4e109d49dc1cf6f18033f12
2012-09-25 18:39:22 +02:00
skal
2afee60a7c speed up for ARM using 8bit for boolean decoder
SBITS=8 is reported 20-30% faster on ARM (where 64bit ops
are expensive).

Also use 32bits for i32.

Change-Id: Id6a7197d805061aeb8832f20432512d0d930ebfa
2012-09-10 23:27:58 +02:00
skal
5725cabac0 new segmentation algorithm
fixes the 'blocky sky problem' (saturation problem: when luma was flat,
chroma noise was taking over, resulting in random segment id assigned.
When just using a common uniform segment was better).

+ side clean-up and readibility/experimentability MACRO'ization
+ added '-map 7' option

Change-Id: I35982a9e43c0fecbfdd7b05e4813e8ba8c121d71
2012-09-04 23:09:15 +02:00
Pascal Massimino
2cf1f81590 Merge "fix the BITS=8 case" 2012-09-03 02:36:03 -07:00
Pascal Massimino
12f78aec48 fix the BITS=8 case
spotted by Måns Rullgård (mans at mansr dot com)
Change-Id: I4720dc2eeb645af894e396739be6fa11b5fe2739
2012-09-03 02:29:14 -07:00
Pascal Massimino
6920c71f0a fix MSVC warnings regarding implicit uint64 to uint32 conversions
Change-Id: I284dae9222a3817bba3c5ba6be271b31b5bf660d
2012-09-01 07:21:45 -07:00
Pascal Massimino
b7c5544216 Merge "Make *InitSSE2() functions be empty on non-SSE2 platform" 2012-08-29 08:26:42 -07:00
Urvang Joshi
1c04a0d438 Common APIs for chunks metadata and color profile.
Change-Id: Ie105ce913c0b56e34cc26fd7ec397103354f268a
2012-08-29 08:21:43 -07:00
pascal massimino
2a3117a1e6 Merge "Create WebPMuxFrameInfo struct for Mux APIs" 2012-08-29 08:19:07 -07:00
Pascal Massimino
5c3a7231ca Make *InitSSE2() functions be empty on non-SSE2 platform
this avoids the '*.o has no symbols' warning messages

Change-Id: I00cf527a9041a810d896bd24b993112af6276323
2012-08-28 11:02:38 -07:00
Pascal Massimino
7c6e60f4bd make *InitSSE2() functions be empty on non-SSE2 platform
this avoids the '*.o has no symbols' warning messages

Change-Id: Idbaa02f5c2f7c632997a26f9507926922d191b6e
2012-08-27 23:40:47 -07:00
Pascal Massimino
c7eb45764f make VP8DspInitNEON() public
this will avoid the "dec_neon.o has no symbol" warning

no change in binary size observed on linux.

Change-Id: Ia27ae2bc5a03d714afa7e46671fdcf4cb630784d
2012-08-27 00:28:13 -07:00
Urvang Joshi
ab3234ae6b Create WebPMuxFrameInfo struct for Mux APIs
Change-Id: I1f3b15d679280b5347124e1d59865a3df089043b
2012-08-23 15:18:51 +05:30
Urvang Joshi
e3990fd8e4 Alignment fixes
Change-Id: I99b570a6621be271abd3df1c3316cdd7286cfe83
2012-08-23 13:22:59 +05:30
James Zern
c655380c36 dec/io.c: cosmetics
- deindent EmitAlphaRGB*
- add some missing consts

Change-Id: I65f88da295e6a0afa383fadc2ef90a40613c2d62
2012-08-15 10:27:54 -07:00
James Zern
fe1958f17d RGBA4444: harmonize lossless/lossy alpha values
lossy was rounding with a bias toward opaque:
[232+, 8] -> [15, 1]
now both paths use the range:
[240+, 16] -> [15, 1]

Change-Id: I3da2063b4959b9e9f45bae09e640acc1f43470c5
2012-08-14 14:02:30 -07:00
James Zern
681cb30ad2 fix RGBA4444 output w/fancy upsampling
compensates for the 1-line delay in the upscaler, outputting the correct
alpha row

Change-Id: Ia9a65bcb3cfa19e42185523cc6e706101a39d45d
2012-08-14 13:11:53 -07:00
James Zern
f06c1d8f7b Merge "Alignment fix" into 0.2.0 2012-08-09 16:09:58 -07:00
Urvang Joshi
f56e98fd11 Alignment fix
Change-Id: Ia5475247f03456b01571ae7531da90f74c068045
2012-08-10 02:10:32 +05:30
Pascal Massimino
6fe843baeb avoid rgb-premultiply if there's only trivial alpha values
With this, MODE_rgbA can safely be used without speed penalty
even in case of pure-lossy alpha-less input.
It's also an optimization when cropping a fully-opaque region from
an image with alpha: premultiply is then skipped

Change-Id: Ibee28c75744f193dacdfccd5a2e7cd1e44604db6
2012-08-09 11:33:29 -07:00
Pascal Massimino
528a11af35 fix the ARGB4444 premultiply arithmetic
* green was not descaled properly
* alpha was over-dithered, making the value '0x0f' not be a fixed point
* alpha value was not restored ok.

Change-Id: Ia4a4d75bdad41257f7c07ef76a487065ac36fede
2012-08-09 11:32:30 -07:00
Urvang Joshi
a0a488554d Lossless decoder fix for a special transform order
Fix the lossless decoder for the case when it has to apply other
inverse transforms before applying Color indexing inverse transform.

The main idea is to make ColorIndexingInverse virtually in-place: we
use the fact that the argb_cache is allocated to accommodate all
*unpacked* pixels of a macro-row, not just *packed* pixels.

Change-Id: I27f11f3043f863dfd753cc2580bc5b36376800c4
2012-08-08 23:52:08 -07:00
Vikas Arora
62dd9bb242 Update encoding heuristic w.r.t palette colors.
Added a threshold of MAX_COLORS_FOR_GRAPH for color-palettes, above
which the graph hint is ignored.

Change-Id: Ia5d7f45e52731b6eaf2806999d6be82861744fd3
2012-08-08 18:57:52 -07:00
Pascal Massimino
6f4272b090 remove unused ApplyInverseTransform()
transforms are only allowed for is_level0

Change-Id: Iec8ce8bdbe024aae6cae2688e2934ab8f445000c
2012-08-07 22:41:25 -07:00
Pascal Massimino
43b0d6107a add support for ARGB -> YUVA conversion for lossless decoder
This was returning an (hard-to-explain) error before.
(through WebPDecodeYUV() for instance).

+ rationalize the incremental API:
-> add WebPINewYUVA
-> deprecated WebPINewYUV
-> add WebPIDecGetYUVA
-> deprecated WebPIDecGetYUV

+ some NULL cosmetics

Change-Id: I39a6bd6018a34294d898b29f6c40e2cf76f1037e
2012-08-03 15:41:01 -07:00
Pascal Massimino
33705ca093 bump version to 0.2.0
Change-Id: I01cb50b9c4c8e9245aede3947481cbbd27d6a19d
2012-08-03 15:41:01 -07:00
Pascal Massimino
c40d7ef125 fix alpha-plane check + add extra checks
Change-Id: I9d8c9743f9d4f3d394544773ed2d0c31a9acf24d
2012-08-03 14:44:35 -07:00
James Zern
a06f802325 MODE_YUVA: set alpha to opaque if the image has none
this change avoids returning uninitialized alpha values when decoding
lossy with alpha to YUVA

Change-Id: I1e02459ac28b36f1f2b422063d057a5faba2f8f2
2012-08-03 12:04:44 -07:00
James Zern
52a87dd7ff Merge "silence one more warning" into 0.2.0 2012-08-02 17:53:04 -07:00
James Zern
3b02309347 silence one more warning
inadvertently added in last warning roundup

Change-Id: I38e6bcfb18c133f2dc2b38cec81e12d2ff556011
2012-08-02 17:50:12 -07:00
Pascal Massimino
f94b04f045 move some RGB->YUV functions to yuv.h
will be needed later

Change-Id: I6b9e460db2d398b9fecd5d3c1bbdb3f2f3d4f5db
2012-08-02 17:23:02 -07:00
James Zern
292ec5cc7d quiet a few 'uninitialized' warnings
spurious in this case, but addresses e.g.,
... potentially uninitialized local variable 'weighted_average' used

Change-Id: Ib99998bf49e4af7a82ee66f13fb850ca5b17dc71
2012-08-02 14:03:30 -07:00
Pascal Massimino
4af3f6c4d3 fix indentation
Change-Id: Ib00b3cdc21ac336a56390f1e71c169e7fd4767a6
2012-08-02 11:55:55 -07:00
Pascal Massimino
323dc4d9b9 remove use of log2(). Use VP8LFastLog2() instead.
Order-by-cost mostly unchanged (up to a scaling constant 1/log(2))
(except for few minor diff in < 2% of cases)

+ remove unused field cost_mode->cache_bits_

Change-Id: I714f8ab12f49a23f5d499a64c741382c9b489a3e
2012-08-02 00:08:58 -07:00
Pascal Massimino
8c515d54ea Merge "harness some malloc/calloc to use WebPSafeMalloc and WebPSafeCalloc" into 0.2.0 2012-08-01 18:16:46 -07:00
James Zern
d4b4bb0248 Merge changes I46090628,I1a41b2ce into 0.2.0
* changes:
  check VP8LBitWriterInit return
  lossless: fix crash on user abort
2012-08-01 13:19:32 -07:00
Pascal Massimino
bff34ac1ca harness some malloc/calloc to use WebPSafeMalloc and WebPSafeCalloc
quite a large security sweep.

Change-Id: If150dfbb46e6e9b56210473a109c8ad6ccd0cea4
2012-08-01 12:06:04 -07:00
Pascal Massimino
a3c063c714 Merge "extra size check for security" into 0.2.0 2012-08-01 12:00:30 -07:00
pascal massimino
5e7963000a Merge "WebPEncode: clear stats at the start of encode" into 0.2.0 2012-08-01 12:00:09 -07:00
Pascal Massimino
f1edf62fae Merge "rationalize use of color-cache" into 0.2.0 2012-08-01 11:55:36 -07:00
Pascal Massimino
c19333173a extra size check for security
no speed diff observed by removing the test before calling BitWriterResize().

+ remove some unnecessary memset() in VP8LBitWriter
+ fix mixed code/variable-decl in BIG_ENDIAN mode

Change-Id: I36be61f83d10a43e4682b680c2dae0e494da4218
2012-08-01 00:37:24 -07:00
Pascal Massimino
906be65744 rationalize use of color-cache
* ~1-4% faster
* if it's not used, don't use it
* remove the special handling of cache_bits = 0
* remove some tests in the loops

Change-Id: I19d87c3ca731052ff532ea8b2d8e89816507b75f
2012-08-01 00:32:12 -07:00