From a6a09b32962ba6ba1cd04b4fb421c456ce0f2ec0 Mon Sep 17 00:00:00 2001 From: James Zern Date: Mon, 10 Apr 2023 17:18:52 -0700 Subject: [PATCH] webp-lossless-bitstream-spec: fix 2 code typos - add missing '(' in DIV_ROUND_UP - in 6.2.2, rename 'pos' variable reference to match definition ('position') spotted by thakis@ Change-Id: Ida3ed281c2c753ebbb0e1eb3c4ed04dadc79ca24 --- doc/webp-lossless-bitstream-spec.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/webp-lossless-bitstream-spec.txt b/doc/webp-lossless-bitstream-spec.txt index 563426d4..a5daad49 100644 --- a/doc/webp-lossless-bitstream-spec.txt +++ b/doc/webp-lossless-bitstream-spec.txt @@ -241,7 +241,7 @@ two-dimensionally. int size_bits = ReadBits(3) + 2; int block_width = (1 << size_bits); int block_height = (1 << size_bits); -#define DIV_ROUND_UP(num, den) ((num) + (den) - 1) / (den)) +#define DIV_ROUND_UP(num, den) (((num) + (den) - 1) / (den)) int block_xsize = DIV_ROUND_UP(image_width, 1 << size_bits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1008,7 +1008,7 @@ codes to be used as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ int position = (y >> prefix_bits) * prefix_xsize + (x >> prefix_bits); -int meta_prefix_code = (entropy_image[pos] >> 8) & 0xffff; +int meta_prefix_code = (entropy_image[position] >> 8) & 0xffff; PrefixCodeGroup prefix_group = prefix_code_groups[meta_prefix_code]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~