Update qoi.h

This commit is contained in:
Ray
2026-03-29 21:21:16 +02:00
parent e5f0c9f8b1
commit 4c79c6837b

4
src/external/qoi.h vendored
View File

@@ -427,7 +427,7 @@ void *qoi_encode(const void *data, const qoi_desc *desc, int *out_len) {
run = 0;
}
index_pos = QOI_COLOR_HASH(px) % 64;
index_pos = QOI_COLOR_HASH(px) & (64 - 1);
if (index[index_pos].v == px.v) {
bytes[p++] = QOI_OP_INDEX | index_pos;
@@ -574,7 +574,7 @@ void *qoi_decode(const void *data, int size, qoi_desc *desc, int channels) {
run = (b1 & 0x3f);
}
index[QOI_COLOR_HASH(px) % 64] = px;
index[QOI_COLOR_HASH(px) & (64 - 1)] = px;
}
pixels[px_pos + 0] = px.rgba.r;