Update qoi.h
This commit is contained in:
parent
e5f0c9f8b1
commit
4c79c6837b
4
src/external/qoi.h
vendored
4
src/external/qoi.h
vendored
|
|
@ -427,7 +427,7 @@ void *qoi_encode(const void *data, const qoi_desc *desc, int *out_len) {
|
||||||
run = 0;
|
run = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
index_pos = QOI_COLOR_HASH(px) % 64;
|
index_pos = QOI_COLOR_HASH(px) & (64 - 1);
|
||||||
|
|
||||||
if (index[index_pos].v == px.v) {
|
if (index[index_pos].v == px.v) {
|
||||||
bytes[p++] = QOI_OP_INDEX | index_pos;
|
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);
|
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;
|
pixels[px_pos + 0] = px.rgba.r;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user