few % speedup of lossless encoding

mostly visible for method 4 and up

Change-Id: I1561d871bc055ec5f7998eb193d927927d3f2add
demux: (non-exp) fail if the fragmented flag is set

otherwise make sure that all frames are marked as a fragment. there's
still some work to do with validation if fragments are expected to cover
the entire canvas.

Change-Id: Id59e95ac01b9340ba8c6039b0c3b65484b91c42f
demux: cosmetics: remove a useless break

+ reword a comment

Change-Id: I52b64abcde2c8322b59c594f2f75b509ed367bff
demux: strictly enforce the animation flag

if the flag is incorrectly set in a VP8L or VP8/ALPH single image file
the demux will now fail.

Change-Id: Id4d5f2d3f6922a29b442c5d3d0acbe3d679e468a
demux: cosmetics: s/has_frames/is_animation/

animation matches the flag name
s/has_fragments/is_fragmented/ to match.

Change-Id: I86c834e19bab6db6610ea2ccf900ab3ebffafa8a
demux: add a tail pointer for chunks

a large number of non-frame chunks could slow the parse

Change-Id: I181bc73626e92263c3c5b2a6dc2bf6e6a0481d52
demux: split chunk parsing from ParseVP8X

makes the header and chunk parsing portions slightly more digestible

Change-Id: I48968468b2529506b830e96a2f13e8d29976179b
gif2webp: Add a mixed compression mode

When '-mixed' option is given, each frame would be heuristically chosen
to be
encoded using lossy or lossless compression.

The heuristic is based on the number of colors in the image:
- If num_colors <= 31, pick lossless compression
- If num_colors >= 194, pick lossy compression
- Otherwise, try both and pick the one that compresses better.

Change-Id: I908c73493ddc38e8db35b7b1959300569e6d3a97
Merge changes I48968468,I181bc736

* changes:
  demux: split chunk parsing from ParseVP8X
  demux: add a tail pointer for chunks
fix a descaling bug for vertical/horizontal U/V interpolation

RGBToU/V calls expects two extra precision bits, they were only
given one by SUM2H and SUM2H macros.

For rounding coherency, also changed SUM1 macro.

Change-Id: I05f96a46f5d4f17b830d0420eaf79b066cdf78d4
ErrorStatusLossless: correct return type

int -> VP8StatusCode

Change-Id: I8a224a622e98d401a6e401047780fa6b25cb0ae4
idec: add some missing casts

Change-Id: I021a014f1f3a597f37ba8d9f4006c8cb4100723c
enc/vp8l: add a missing cast

Change-Id: I2c1800516eb4573ae2599866ace10017b865f23a
mux: add some missing casts

+ fix a return value
+ fix a param type

Change-Id: I8bb7a4dc4c76b11140f8693c909aeb10f660e6e5
cosmetics: fix some typos

Change-Id: I0d6efebd817815139db5ae87236fd8911df4d53c
Updated iosbuild.sh for XCode 5.x

Change-Id: I4bf545c4f394c28842cbb85ac70214d2e5477ae0
add a -dither dithering option to the decoder

Even at high quality setting, the U/V quantizer step is limited
to 4 which can lead to banding on gradient.
This option allows to selectively apply some randomness to
potentially flattened-out U/V blocks and attenuate the banding.

This option is off by default in 'dwebp', but set to -dither 50
by default in 'vwebp'.

Note: depending on the number of blocks selectively dithered,
we can have up to a 10% slow-down in decoding speed it seems.

Change-Id: Icc2446007f33ddacb60b3a80a9e63f2d5ad162de
Merge "cosmetics: fix some typos"
Merge changes I8bb7a4dc,I2c180051,I021a014f,I8a224a62

* changes:
  mux: add some missing casts
  enc/vp8l: add a missing cast
  idec: add some missing casts
  ErrorStatusLossless: correct return type