From 4f9f00ccf4fe1d754be1589216e228215713ea5d Mon Sep 17 00:00:00 2001 From: Vincent Rabaud Date: Thu, 4 Jun 2020 18:03:57 +0200 Subject: [PATCH] Use spatial predictors on top of palette no matter what. This is fixing another inefficiency found by the pingo image optimizer. Change-Id: Icecb0d39fcbd17b403667e8e2095c7705b1dd493 --- src/enc/vp8l_enc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/enc/vp8l_enc.c b/src/enc/vp8l_enc.c index a44bb87f..ce3d0355 100644 --- a/src/enc/vp8l_enc.c +++ b/src/enc/vp8l_enc.c @@ -406,10 +406,9 @@ static int EncoderAnalyze(VP8LEncoder* const enc, // Go brute force on all transforms. *crunch_configs_size = 0; for (i = 0; i < kNumEntropyIx; ++i) { - // We can only apply a spatial transform on top of palettization if the - // palette is full. - if ((i != kPalette && i != kPaletteAndSpatial) || - (use_palette && (i == kPalette || enc->palette_size_ == 256))) { + // We can only apply kPalette or kPaletteAndSpatial if we can indeed use + // a palette. + if ((i != kPalette && i != kPaletteAndSpatial) || use_palette) { assert(*crunch_configs_size < CRUNCH_CONFIGS_MAX); crunch_configs[(*crunch_configs_size)++].entropy_idx_ = i; }