Speedup Alpha plane encoding.

Disable costly 'BackwardReferencesTraceBackwards' for encoding Alpha plane.
Increase the threshold for triggering 'BackwardReferencesTraceBackwards' to
quality 25 and above. Also lower the Alpha quality (at method 3) to be
lesser than this threshold (25).

Change-Id: Ic29fb2e6943472c564223df9fe099b19ccda0f31
Speed up HashChainFindCopy function.

Speed up HashChainFindCopy by optimizing on number of calls to
FindMatchLength method.
This change speeds up the lossless & lossy (Alpha) encoding by 20%
without loss of compression density.
At method=3, lossy (Alpha) compression speed (and density) remains
unchanged, as at that settings, the costly Backward Refs method is not
called

Change-Id: Ia1797148e9e4ee2787011837fa248afbae2242cb
Support for unknown chunks in mux library

WebPMuxSetChunk/WebPMuxGetChunk/WebPMuxDeleteChunk now correctly handle
unknown chunks.

Change-Id: I2b75106ef08260f2bce03eb1782924b620643746
Decoder: handle fragments case correctly too.

Exit early from ParseHeaderInternal() in case of fragmented image too.

Change-Id: I3e24be2c869cc2d87c43b705257f21be81127dbd
Demux: WebPIterator now also denotes if the frame has alpha.

Change-Id: Ia300385a49c1ee5afa8f114f2560ee8d1c7664bb
Stricter check for presence of alpha when writing lossless images

Earlier, all lossless images were assumed to contain alpha.
Now, we use the 'alpha_is_used' bit from the VP8L bitstream to determine
the
same.

Detecting an absence of alpha can sometimes lead to much more efficient
rendering, especially for animated images.

Related: refine mux code to read width/height/has_alpha information only
once
per frame/fragment. This avoid frequent calls to VP8(L)GetInfo().

Change-Id: I4e0eef4db7d94425396c7dff6ca5599d5bca8297
WebPMuxSetChunk: remove unused variable

and unnecessary call to ChunkGetIndexFromFourCC()

Change-Id: Ic1ed53750a3be43df827a6fb9a4b9ff3eb25c6c7
Mux: support parsing unknown chunks within a frame/fragment.

Change-Id: I9b4dc36c5ccc4b46f60cd64c1ee21008e20c8b95
Merge changes I9b4dc36c,I4e0eef4d

* changes:
  Mux: support parsing unknown chunks within a frame/fragment.
  Stricter check for presence of alpha when writing lossless images
fix rescaling-with-alpha inaccuracy

(still missing YUVA decoding case for now)

https://code.google.com/p/webp/issues/detail?id=160

Change-Id: If723b4a5c0a303d0853ec9d839f995adce056095
Demux: A new state WEBP_DEMUX_PARSE_ERROR

WebPDemuxPartial() returns NULL for both of the following cases:
- There was a parsing error.
- It doesn't have enough data to start parsing.

Now, one can differentiate between these two cases by checking the value
of 'state' returned by WebPDemuxPartial().

Change-Id: Ia2377f0c516b3fcfae475c0662c4932d2eddcd0b
fix indent

Change-Id: I7f226ec4276e5e1b46896086a7d96cb67f36de6a
Merge "fix indent"
thread.c: drop WebPWorker prefix from static funcs

Change-Id: I7cd39c9e41bbf11157c488aff18631ef17fde464
thread.h: #ifdef when checking WEBP_USE_THREAD

prevents a warning with -Wundef and is consistent with thread.c

Change-Id: I60fa337c3b9daeea7302e86802402cb943cdb262
cosmetics: thread.c: drop a redundant comment

+ fix #if/#else/#endif comment

Change-Id: I76bfd3b123ed181897ed0feba721d5c1a3a2b0d7
Merge "cosmetics: thread.c: drop a redundant comment"
VP8EncIterator clean-up

- remove unused fields from iterator
- introduce VP8IteratorSetRow() too
- rename 'done_' to 'countdown_'
- bring y_left_/u_left_/v_left_ from VP8Encoder

Change-Id: Idc1c15743157936e4cbb7002ebb5cc3c90e7f92a
Merge "VP8EncIterator clean-up"
add WebPWorkerExecute() for convenient bypass

This is mainly for re-using the worker structs without using the
thread.

Change-Id: I8e1be29e53874ef425b15c192fb68036b4c0a359