mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-14 05:36:48 +03:00
Fix BC6H_SF decoding error.
Decoding error were caused by additional sign extend call after endpoint transform, according to khronos documentation, you only suppose to sign extend endpoints only once, further calls to sign extend mangles endpoint data.
This commit is contained in:
parent
f58c0ea533
commit
b7715d1600
|
@ -755,13 +755,6 @@ decode_bc6_block(rgb32f *col, const UINT8 *src, int sign) {
|
||||||
endpoints[i + 1] = (endpoints[i + 1] + endpoints[1]) & mask;
|
endpoints[i + 1] = (endpoints[i + 1] + endpoints[1]) & mask;
|
||||||
endpoints[i + 2] = (endpoints[i + 2] + endpoints[2]) & mask;
|
endpoints[i + 2] = (endpoints[i + 2] + endpoints[2]) & mask;
|
||||||
}
|
}
|
||||||
if (sign) {
|
|
||||||
for (i = 3; i < numep; i += 3) {
|
|
||||||
bc6_sign_extend(&endpoints[i + 0], info->rb);
|
|
||||||
bc6_sign_extend(&endpoints[i + 1], info->gb);
|
|
||||||
bc6_sign_extend(&endpoints[i + 2], info->bb);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for (i = 0; i < numep; i++) {
|
for (i = 0; i < numep; i++) {
|
||||||
ueps[i] = bc6_unquantize(endpoints[i], info->epb, sign);
|
ueps[i] = bc6_unquantize(endpoints[i], info->epb, sign);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user