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
This commit is contained in:
James Zern 2021-04-28 15:09:34 -07:00
parent b6513fbaa8
commit 05b72d4205

View File

@ -230,7 +230,7 @@ static WebPEncodingError CoOccurrenceBuild(const WebPPicture* const pic,
} }
struct Sum { struct Sum {
uint16_t index; uint8_t index;
uint32_t sum; uint32_t sum;
}; };
@ -282,7 +282,7 @@ static WebPEncodingError PaletteSortModifiedZeng(
} }
while (num_sums > 0) { 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. // Compute delta to know if we need to prepend or append the best index.
int32_t delta = 0; int32_t delta = 0;
const int32_t n = num_colors - num_sums; const int32_t n = num_colors - num_sums;