disable near-lossless quantization if palette is used

Change-Id: I3335e8f97f99d6d786e953161adbf246e85d80d3
This commit is contained in:
Pascal Massimino 2016-06-08 11:29:48 +02:00
parent 5f8f998d0e
commit ce3c824712

View File

@ -1021,10 +1021,13 @@ static WebPEncodingError ApplyPredictFilter(const VP8LEncoder* const enc,
const int pred_bits = enc->transform_bits_; const int pred_bits = enc->transform_bits_;
const int transform_width = VP8LSubSampleSize(width, pred_bits); const int transform_width = VP8LSubSampleSize(width, pred_bits);
const int transform_height = VP8LSubSampleSize(height, pred_bits); const int transform_height = VP8LSubSampleSize(height, pred_bits);
// we disable near-lossless quantization if palette is used.
const int near_lossless_strength = enc->use_palette_ ? 100
: enc->config_->near_lossless;
VP8LResidualImage(width, height, pred_bits, low_effort, enc->argb_, VP8LResidualImage(width, height, pred_bits, low_effort, enc->argb_,
enc->argb_scratch_, enc->transform_data_, enc->argb_scratch_, enc->transform_data_,
enc->config_->near_lossless, enc->config_->exact, near_lossless_strength, enc->config_->exact,
used_subtract_green); used_subtract_green);
VP8LPutBits(bw, TRANSFORM_PRESENT, 1); VP8LPutBits(bw, TRANSFORM_PRESENT, 1);
VP8LPutBits(bw, PREDICTOR_TRANSFORM, 2); VP8LPutBits(bw, PREDICTOR_TRANSFORM, 2);