diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c index b2e70f3b..c05f1146 100644 --- a/release/c/wuffs-unsupported-snapshot.c +++ b/release/c/wuffs-unsupported-snapshot.c @@ -10679,7 +10679,7 @@ struct wuffs_handsum__decoder__struct { uint32_t f_quality; uint8_t f_call_sequence; uint16_t f_bit_offset; - uint16_t f_coeffs[40]; + uint16_t f_coeffs[25]; wuffs_base__pixel_swizzler f_swizzler; uint32_t p_decode_image_config; @@ -50344,8 +50344,8 @@ WUFFS_HANDSUM__CLAMP_7[32] WUFFS_BASE__POTENTIALLY_UNUSED = { static const uint8_t WUFFS_HANDSUM__ZIGZAG[2][15] WUFFS_BASE__POTENTIALLY_UNUSED = { { - 0u, 1u, 8u, 16u, 9u, 2u, 3u, 10u, - 17u, 24u, 32u, 25u, 18u, 11u, 4u, + 0u, 1u, 5u, 10u, 6u, 2u, 3u, 7u, + 11u, 15u, 20u, 16u, 12u, 8u, 4u, }, { 0u, 1u, 4u, 8u, 5u, 2u, 3u, 6u, 9u, 12u, 0u, 0u, 0u, 0u, 0u, @@ -51472,7 +51472,7 @@ wuffs_handsum__decoder__decode_block_q0( v_alphas_16 = wuffs_base__utility__sign_extend_rshift_u64(((uint64_t)(((uint64_t)(v_half_alpha_v_16 * v_half_alpha_u_16)) + 32768u)), 16u); v_c_32 = ((uint64_t)(wuffs_base__utility__sign_extend_convert_u32_u64(WUFFS_HANDSUM__COSINES[((((2u * v_x) + 1u) * v_u) & 31u)]) * wuffs_base__utility__sign_extend_convert_u32_u64(WUFFS_HANDSUM__COSINES[((((2u * v_y) + 1u) * v_v) & 31u)]))); v_c_16 = wuffs_base__utility__sign_extend_rshift_u64(((uint64_t)(v_c_32 + 32768u)), 16u); - v_alphas_sum_32 += ((uint64_t)(((uint64_t)(v_alphas_16 * v_c_16)) * wuffs_base__utility__sign_extend_convert_u16_u64(self->private_impl.f_coeffs[((8u * v_v) + v_u)]))); + v_alphas_sum_32 += ((uint64_t)(((uint64_t)(v_alphas_16 * v_c_16)) * wuffs_base__utility__sign_extend_convert_u16_u64(self->private_impl.f_coeffs[((5u * v_v) + v_u)]))); v_u += 1u; } v_v += 1u; diff --git a/std/handsum/decode_handsum.wuffs b/std/handsum/decode_handsum.wuffs index c13e662b..4d836b9b 100644 --- a/std/handsum/decode_handsum.wuffs +++ b/std/handsum/decode_handsum.wuffs @@ -31,7 +31,7 @@ pub struct decoder? implements base.image_decoder( bit_offset : base.u16, - coeffs : array[40] base.u16, + coeffs : array[25] base.u16, swizzler : base.pixel_swizzler, util : base.utility, @@ -370,7 +370,7 @@ pri func decoder.decode_block_q0!(which: base.u32[..= 1], y_offset: base.u32[..= alphas_sum_32 ~mod+= (alphas_16 ~mod* c_16) ~mod* this.util.sign_extend_convert_u16_u64( - a: this.coeffs[(8 * v) + u]) + a: this.coeffs[(5 * v) + u]) u += 1 } @@ -1104,8 +1104,8 @@ pri const CLAMP_7 : roarray[32] base.u8[..= 7] = [ // For commentary on these constants below, see the lib/handsum and // lib/lowleveljpeg Go packages. -pri const ZIGZAG : roarray[2] roarray[15] base.u8[..= 39] = [[ - 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, +pri const ZIGZAG : roarray[2] roarray[15] base.u8[..= 24] = [[ + 0, 1, 5, 10, 6, 2, 3, 7, 11, 15, 20, 16, 12, 8, 4, ],[ 0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 0, 0, 0, 0, 0, ]]