Merge tag 'v0.5.1'

libwebp-0.5.1
- 6/14/2016: version 0.5.1
  This is a binary compatible release.
  * miscellaneous bug fixes (issues #280, #289)
  * reverted alpha plane encoding with color cache for compatibility with
    libwebp 0.4.0->0.4.3 (issues #291, #298)
  * lossless encoding performance improvements
  * memory reduction in both lossless encoding and decoding
  * force mux output to be in the extended format (VP8X) when undefined chunks
    are present (issue #294)
  * gradle, cmake build support
  * workaround for compiler bug causing 64-bit decode failures on android
    devices using clang-3.8 in the r11c NDK
  * various WebPAnimEncoder improvements

* tag 'v0.5.1': (30 commits)
  update ChangeLog
  Clarify the expected 'config' lifespan in WebPIDecode()
  update ChangeLog
  Fix corner case in CostManagerInit.
  gif2webp: normalize the number of .'s in the help message
  vwebp: normalize the number of .'s in the help message
  cwebp: normalize the number of .'s in the help message
  fix rescaling bug: alpha plane wasn't filled with 0xff
  Improve lossless compression.
  'our bug tracker' -> 'the bug tracker'
  normalize the number of .'s in the help message
  pngdec,ReadFunc: throw an error on invalid read
  decode.h,WebPGetInfo: normalize function comment
  Inline GetResidual for speed.
  Speed-up uniform-region processing.
  free -> WebPSafeFree()
  DecodeImageData(): change the incorrect assert
  Fix a boundary case in BackwardReferencesHashChainDistanceOnly.
  Make sure to consider small distances in LZ77.
  add some asserts to delimit the perimeter of CostManager's operation
  ...

Change-Id: I44cee79fddd43527062ea9d83be67da42484ebfc
This commit is contained in:
James Zern
2016-07-06 19:30:36 -07:00
27 changed files with 396 additions and 123 deletions

View File

@ -684,14 +684,13 @@ static uint32_t NearLossless(uint32_t value, uint32_t predict,
// Returns the difference between the pixel and its prediction. In case of a
// lossy encoding, updates the source image to avoid propagating the deviation
// further to pixels which depend on the current pixel for their predictions.
static uint32_t GetResidual(int width, int height,
uint32_t* const upper_row,
uint32_t* const current_row,
const uint8_t* const max_diffs,
int mode, VP8LPredictorFunc pred_func,
int x, int y,
int max_quantization,
int exact, int used_subtract_green) {
static WEBP_INLINE uint32_t GetResidual(int width, int height,
uint32_t* const upper_row,
uint32_t* const current_row,
const uint8_t* const max_diffs,
int mode, VP8LPredictorFunc pred_func,
int x, int y, int max_quantization,
int exact, int used_subtract_green) {
const uint32_t predict = Predict(pred_func, x, y, current_row, upper_row);
uint32_t residual;
if (max_quantization == 1 || mode == 0 || y == 0 || y == height - 1 ||