Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Actions MergeBot committed Apr 12, 2022
2 parents 0027c08 + e42b0b3 commit 1d35a24
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ implementations listed below.
## Tools

- https://github.com/floooh/qoiview - native QOI viewer
- https://github.com/pfusik/qoi-ci/releases/tag/qoi-ci-1.1.0 - QOI Plugin installer for GIMP, Imagine, Paint.NET and XnView MP
- https://github.com/pfusik/qoi-ci/releases/tag/qoi-ci-1.1.1 - QOI Plugin installer for GIMP, Imagine, Paint.NET and XnView MP
- https://github.com/iOrange/QoiFileTypeNet/releases/tag/v0.2 - QOI Plugin for Paint.NET
- https://github.com/iOrange/QOIThumbnailProvider - Add thumbnails for QOI images in Windows Explorer
- https://github.com/Tom94/tev - another native QOI viewer (allows pixel peeping and comparison with other image formats)
Expand Down Expand Up @@ -81,7 +81,11 @@ implementations listed below.
- https://github.com/LightHouseSoftware/qoiformats (D)
- https://github.com/mhoward540/qoi-nim (Nim)
- https://github.com/wx257osn2/qoixx (C++)
- https://github.com/Tiefseetauchner/lr-paint (Processing)
- https://github.com/amstan/qoi-fpga (FPGA: verilog)
- https://github.com/musabkilic/qoi-decoder (Python)
- https://github.com/mathpn/py-qoi (Python)


## QOI Support in Other Software

Expand Down
22 changes: 10 additions & 12 deletions qoi.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,13 +424,12 @@ void *qoi_encode(const void *data, const qoi_desc *desc, int *out_len) {
channels = desc->channels;

for (px_pos = 0; px_pos < px_len; px_pos += channels) {
px.rgba.r = pixels[px_pos + 0];
px.rgba.g = pixels[px_pos + 1];
px.rgba.b = pixels[px_pos + 2];

if (channels == 4) {
px = *(qoi_rgba_t *)(pixels + px_pos);
}
else {
px.rgba.r = pixels[px_pos + 0];
px.rgba.g = pixels[px_pos + 1];
px.rgba.b = pixels[px_pos + 2];
px.rgba.a = pixels[px_pos + 3];
}

if (px.v == px_prev.v) {
Expand Down Expand Up @@ -598,13 +597,12 @@ void *qoi_decode(const void *data, int size, qoi_desc *desc, int channels) {
index[QOI_COLOR_HASH(px) % 64] = px;
}

pixels[px_pos + 0] = px.rgba.r;
pixels[px_pos + 1] = px.rgba.g;
pixels[px_pos + 2] = px.rgba.b;

if (channels == 4) {
*(qoi_rgba_t*)(pixels + px_pos) = px;
}
else {
pixels[px_pos + 0] = px.rgba.r;
pixels[px_pos + 1] = px.rgba.g;
pixels[px_pos + 2] = px.rgba.b;
pixels[px_pos + 3] = px.rgba.a;
}
}

Expand Down
3 changes: 0 additions & 3 deletions qoibench.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,9 +540,6 @@ void benchmark_directory(const char *path, benchmark_result_t *grand_total) {
rewinddir(dir);
}

float total_percentage = 0;
int total_size = 0;

benchmark_result_t dir_total = {0};

int has_shown_head = 0;
Expand Down

0 comments on commit 1d35a24

Please sign in to comment.