Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align with KDFS 1.4.0 rounding update #548

Merged
merged 2 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Docs/ChangeLog-5x.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ header. We always recommend rebuilding your client-side code using the
header from the same release to avoid compatibility issues.

* **General:**
* **Change:** Changed sRGB alpha channel endpoint expansion to match the
revised Khronos Data Format Specification (v1.4.0), which reverts an
unintended specification change. Compared to previous releases, this change
can cause LSB bit differences in the alpha channel of compressed images.
* **Feature:** Arm64 builds for Linux added to the GitHub Actions builds, and
Arm64 binaries for NEON, 128-bit SVE 128 and 256-bit SVE added to release
builds.
Expand Down
11 changes: 2 additions & 9 deletions Source/astcenc_color_unquantize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -925,15 +925,8 @@ void unpack_color_endpoints(
alpha_hdr = false;
}

vmask4 mask(true, true, true, false);

vint4 output0rgb = lsl<8>(output0) | vint4(0x80);
vint4 output0a = output0 * 257;
output0 = select(output0a, output0rgb, mask);

vint4 output1rgb = lsl<8>(output1) | vint4(0x80);
vint4 output1a = output1 * 257;
output1 = select(output1a, output1rgb, mask);
output0 = lsl<8>(output0) | vint4(0x80);
output1 = lsl<8>(output1) | vint4(0x80);
}
// An HDR profile decode, but may be using linear LDR endpoints
// Linear LDR 8-bit endpoints are expanded to 16-bit by replication
Expand Down
14 changes: 4 additions & 10 deletions Source/astcenc_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1583,19 +1583,13 @@ static inline vmask4 get_u8_component_mask(
astcenc_profile decode_mode,
const image_block& blk
) {
vmask4 u8_mask(false);
// Decode mode writing to a unorm8 output value
if (blk.decode_unorm8)
// Decode mode or sRGB forces writing to unorm8 output value
if (blk.decode_unorm8 || decode_mode == ASTCENC_PRF_LDR_SRGB)
{
u8_mask = vmask4(true);
}
// SRGB writing to a unorm8 RGB value
else if (decode_mode == ASTCENC_PRF_LDR_SRGB)
{
u8_mask = vmask4(true, true, true, false);
return vmask4(true);
}

return u8_mask;
return vmask4(false);
}

/**
Expand Down
298 changes: 149 additions & 149 deletions Test/Images/Small/astc_reference-main-avx2_fast_results.csv

Large diffs are not rendered by default.

298 changes: 149 additions & 149 deletions Test/Images/Small/astc_reference-main-avx2_fastest_results.csv

Large diffs are not rendered by default.

298 changes: 149 additions & 149 deletions Test/Images/Small/astc_reference-main-avx2_medium_results.csv

Large diffs are not rendered by default.

298 changes: 149 additions & 149 deletions Test/Images/Small/astc_reference-main-avx2_thorough_results.csv

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Test/astc_test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def parse_command_line():
parser.add_argument("--encoder", dest="encoders", default="avx2",
choices=coders, help="test encoder variant")

parser.add_argument("--reference", dest="reference", default="ref-5.0-avx2",
parser.add_argument("--reference", dest="reference", default="ref-main-avx2",
choices=refcoders, help="reference encoder variant")

astcProfile = ["ldr", "ldrs", "hdr", "all"]
Expand Down