mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 13:48:21 +01:00
Disable cross-color when palette is used.
With palette+predictors, cross-color was forced (because of predictors). No need for cross-color for palettes as R/B==0. This saves 10 bytes per image that uses palette+predictors. Change-Id: If2184d16cdabe1e8498009062284ad3e37ef1342
This commit is contained in:
parent
8933bac212
commit
8fdaecb09d
@ -1571,7 +1571,8 @@ static int EncodeStreamHook(void* input, void* data2) {
|
||||
enc->use_predict_ = (entropy_idx == kSpatial) ||
|
||||
(entropy_idx == kSpatialSubGreen) ||
|
||||
(entropy_idx == kPaletteAndSpatial);
|
||||
if (low_effort) {
|
||||
// When using a palette, R/B==0, hence no need to test for cross-color.
|
||||
if (low_effort || enc->use_palette_) {
|
||||
enc->use_cross_color_ = 0;
|
||||
} else {
|
||||
enc->use_cross_color_ = red_and_blue_always_zero ? 0 : enc->use_predict_;
|
||||
|
Loading…
Reference in New Issue
Block a user