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:
Vincent Rabaud 2021-04-23 17:43:36 +02:00
parent 8933bac212
commit 8fdaecb09d

View File

@ -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_;