simplify f_inner calculation a little

by incorporating the is_4x4 flag at init

Change-Id: I042e04aacb15181db0bf86f3212c880087519189
filtering: precompute ilimit and hev_threshold

no speed change, just simplifying the logic

Change-Id: I518800494428596733d4fbae69072049828aec3c
rename libwebp.i -> libwebp.swig

.swig provides better tool compatibility

Change-Id: I35587b84dd32e12e8cedad14b36ac518b63896bc
small clean-up in ExpandMatrix()

Change-Id: Ib06cb1658a6548f06bb7320310b3864881b606a7
fast auto-determined filtering strength

kLevelsFromDelta[sharpness][delta] is an inverse look-up table
that tells the minimum filtering strength needed to trigger the
filtering of a step with amplitude 'delta'. We use this table
in various situations:

a) when computing the initial (/global) filtering
strength for each segment. We look at the quantization
step and deduce the proper filtering strength needed
to result this quantization noise (talking the -f option
into account).

b) during intra16 calculation, when a block ends up
very empty (only DC coeffs are non-zero, all ACs have
vanished). We'll rely on the in-loop filtering to
restore the smoothness (if the source was gradient-like
smooth. That's why we look at the distortion too before
triggering the filtering).

Step b) goes _in addition_ to a), potentially raising
the filtering strength if blockiness is likely.

Change-Id: Icaeca93ef21da195b079e6587a44d9edfc8e9efa
Merge "fast auto-determined filtering strength"
swig: add basic go bindings

WebPGetDecoderVersion
WebPGetInfo

Change-Id: Icb66207c2f492c9d20642544c0b31cc92b91cdcc
Merge "rename libwebp.i -> libwebp.swig"
Merge "swig: add basic go bindings"
extract random utils to their own file util/random.[ch]

they'll be used for decoding too, probably.

Change-Id: Id9cbb250c74fc0e876d4ea46b1b3dbf8356d6725
Merge "extract random utils to their own file util/random.[ch]"
make use of 'extern' consistent in function declarations

Change-Id: I18e050db3111e52acfe97da09cdf1860f3e15936
add helpful PrintBlockInfo() function

(protected under a DEBUG_BLOCK compile flag)

Change-Id: Icb8da02dbd00e5cf856c314943c212f1c9578d9b
tune quantization biases toward higher precision

* raise U/V quantization bias to more neutral values
* also raise the non-zero AC bias for Y1/Y2 matrices

(we need all the precision we can for U/V leves, which are often empty)
This will increase quality in the higher range (q >= 90) mostly.
Files size is exacted to raise a little (5-7%). and SSIM accordingly of course.

Change-Id: I8a9ffdb6d8fb6dadb959e3fd392e66dc5aaed64e
VPLBitReader bugfix: Catch error if bit_pos > LBITS too.

Earlier we were only testing for bit_pos == LBITS. But this is not
sufficient,
as bit_pos can jump from < LBITS to > LBITS.

This was resulting in some bit-stream truncation errors not being
caught.

Note: Not a security bug though, as br->pos wasn't incremented in such
cases
and so we weren't reading beyond the buffer.

Change-Id: Idadcdcbc6a5713f8fac3470f907fa37a63074836
Merge "VPLBitReader bugfix: Catch error if bit_pos > LBITS too."
detect flatness in blocks and favor DC prediction

this avoids local-minima that look bad, even if the distortion
looks low (e.g. gradients, sky,...). Mostly visible in the q=50-80 range.
Output size is mostly unchanged.

Change-Id: I425b600ec45420db409911367cda375870bc2c63
add comment about the kLevelsFromDelta[][] LUT generation

Change-Id: Id1a91932bf05aeee421761667af351ef2200c334
Merge "add comment about the kLevelsFromDelta[][] LUT generation"
Merge "detect flatness in blocks and favor DC prediction"