From 05b72d4205491a9f54ff5449d54f407a91689e8e Mon Sep 17 00:00:00 2001 From: James Zern Date: Wed, 28 Apr 2021 15:09:34 -0700 Subject: [PATCH] vp8l_enc.c: normalize index types fixes conversion warnings in visual studio after: b1674240 Add modified Zeng's method to palette sorting. src\enc\vp8l_enc.c(296) : warning C4244: '=' : conversion from 'const uint16_t' to 'uint8_t', possible loss of data src\enc\vp8l_enc.c(299) : warning C4244: '=' : conversion from 'const uint16_t' to 'uint8_t', possible loss of data Change-Id: I981b1ba4912edbbafbd49f1f5b1043bf12266920 --- src/enc/vp8l_enc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/enc/vp8l_enc.c b/src/enc/vp8l_enc.c index fd3ce3b9..9ed6ea2a 100644 --- a/src/enc/vp8l_enc.c +++ b/src/enc/vp8l_enc.c @@ -230,7 +230,7 @@ static WebPEncodingError CoOccurrenceBuild(const WebPPicture* const pic, } struct Sum { - uint16_t index; + uint8_t index; uint32_t sum; }; @@ -282,7 +282,7 @@ static WebPEncodingError PaletteSortModifiedZeng( } while (num_sums > 0) { - const uint16_t best_index = best_sum->index; + const uint8_t best_index = best_sum->index; // Compute delta to know if we need to prepend or append the best index. int32_t delta = 0; const int32_t n = num_colors - num_sums;