From a325e533f4f4a00a49f834ad874ea89cbf867e8a Mon Sep 17 00:00:00 2001 From: pete Date: Tue, 12 Jan 2021 18:48:18 +0000 Subject: [PATCH] Change quantization_mode_table to use int8_t --- Source/astcenc_internal.h | 2 +- Source/astcenc_quantization.cpp | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Source/astcenc_internal.h b/Source/astcenc_internal.h index c353502..e3646fb 100644 --- a/Source/astcenc_internal.h +++ b/Source/astcenc_internal.h @@ -785,7 +785,7 @@ int is_legal_3d_block_size( extern const uint8_t color_quantization_tables[21][256]; extern const uint8_t color_unquantization_tables[21][256]; -extern int quantization_mode_table[17][128]; +extern int8_t quantization_mode_table[17][128]; void encode_ise( int quantization_level, diff --git a/Source/astcenc_quantization.cpp b/Source/astcenc_quantization.cpp index 7ce26b0..d428e00 100644 --- a/Source/astcenc_quantization.cpp +++ b/Source/astcenc_quantization.cpp @@ -533,11 +533,10 @@ const uint8_t color_unquantization_tables[21][256] = { } }; -// quantization_mode_table[integercount/2][bits] gives -// us the quantization level for a given integer count and number of bits that -// the integer may fit into. This is needed for color decoding, -// and for the color encoding. -int quantization_mode_table[17][128]; +// The quantization_mode_table[integercount/2][bits] gives us the quantization +// level for a given integer count and number of bits that the integer may fit +// into. This is needed for color decoding, and for the color encoding. +int8_t quantization_mode_table[17][128]; void build_quantization_mode_table() { @@ -553,7 +552,7 @@ void build_quantization_mode_table() { for (int j = 1; j <= 16; j++) { - int p = compute_ise_bitcount(2 * j, (quantization_method) i); + int p = compute_ise_bitcount(2 * j, (quantization_method)i); if (p < 128) { quantization_mode_table[j][p] = i;