summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2021-03-31 21:17:58 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2021-03-31 21:17:58 +0100
commitd59e5eb2ec7db3009c6a7054c84dcae9273038c5 (patch)
treef20524b53bdc1bd56f2f26fa674939014282e8a9
parente708ae66a41c5f5eccc043bcf02bd0dccb132403 (diff)
downloadlibnsgif-d59e5eb2ec7db3009c6a7054c84dcae9273038c5.tar.gz
libnsgif-d59e5eb2ec7db3009c6a7054c84dcae9273038c5.tar.bz2
lzw: Rename minimum_code_size to match what it's called in spec.
-rw-r--r--src/lzw.c10
-rw-r--r--src/lzw.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/lzw.c b/src/lzw.c
index 8b3e472..8f2d5f2 100644
--- a/src/lzw.c
+++ b/src/lzw.c
@@ -269,13 +269,13 @@ lzw_result lzw_decode_init(
const uint8_t *compressed_data,
uint32_t compressed_data_len,
uint32_t compressed_data_pos,
- uint8_t code_size,
+ uint8_t minimum_code_size,
const uint8_t ** const stack_base_out,
const uint8_t ** const stack_pos_out)
{
struct lzw_dictionary_entry *table = ctx->table;
- if (code_size >= LZW_CODE_MAX) {
+ if (minimum_code_size >= LZW_CODE_MAX) {
return LZW_BAD_ICODE;
}
@@ -288,10 +288,10 @@ lzw_result lzw_decode_init(
ctx->input.sb_bit_count = 0;
/* Initialise the dictionary building context */
- ctx->initial_code_size = code_size + 1;
+ ctx->initial_code_size = minimum_code_size + 1;
- ctx->clear_code = (1 << code_size) + 0;
- ctx->eoi_code = (1 << code_size) + 1;
+ ctx->clear_code = (1 << minimum_code_size) + 0;
+ ctx->eoi_code = (1 << minimum_code_size) + 1;
/* Initialise the standard dictionary entries */
for (uint32_t i = 0; i < ctx->clear_code; ++i) {
diff --git a/src/lzw.h b/src/lzw.h
index 385b425..888526e 100644
--- a/src/lzw.h
+++ b/src/lzw.h
@@ -65,7 +65,7 @@ void lzw_context_destroy(
* \param[in] compressed_data_len Byte length of compressed data.
* \param[in] compressed_data_pos Start position in data. Must be position
* of a size byte at sub-block start.
- * \param[in] code_size The initial LZW code size to use.
+ * \param[in] minimum_code_size The LZW Minimum Code Size.
* \param[out] stack_base_out Returns base of decompressed data stack.
* \param[out] stack_pos_out Returns current stack position.
* There are `stack_pos_out - stack_base_out`
@@ -77,7 +77,7 @@ lzw_result lzw_decode_init(
const uint8_t *compressed_data,
uint32_t compressed_data_len,
uint32_t compressed_data_pos,
- uint8_t code_size,
+ uint8_t minimum_code_size,
const uint8_t ** const stack_base_out,
const uint8_t ** const stack_pos_out);