https://github.com/wx257osn2/qoi-benchmark
Cross-language benchmark for QOI (Quite OK Image Format) implementations
https://github.com/wx257osn2/qoi-benchmark
benchmark qoi
Last synced: 4 months ago
JSON representation
Cross-language benchmark for QOI (Quite OK Image Format) implementations
- Host: GitHub
- URL: https://github.com/wx257osn2/qoi-benchmark
- Owner: wx257osn2
- License: mit
- Created: 2022-02-23T06:39:51.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-03-01T20:08:04.000Z (4 months ago)
- Last Synced: 2025-03-01T20:38:09.780Z (4 months ago)
- Topics: benchmark, qoi
- Language: C++
- Homepage:
- Size: 74.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QOI Benchmark
Cross-language benchmark for [QOI](https://github.com/phoboslab/qoi) implementations
## Implementations
- [`qoi`](https://github.com/phoboslab/qoi)
- [`qoixx`](https://github.com/wx257osn2/qoixx)
- [`qoi-rust`](https://github.com/aldanor/qoi-rust)
- [`rapid-qoi`](https://github.com/zakarumych/rapid-qoi)
- [`qoi-fu`](https://github.com/pfusik/qoi-fu)
- `qoi-fu_cxx` : implementation transpiled to C++
- [`qoipp`](https://github.com/mrizaln/qoipp)## Usage
- Use Docker
- ```console
host$ curl https://qoiformat.org/benchmark/qoi_benchmark_suite.tar | tar x
host$ ./docker/build.bash
host$ ./docker/bash
docker$ make
docker$ benchmark/bin/qoibench 20 images
```
- On Host
- Prerequisites:
- `gcc` for `qoi`
- `g++` supporting `-std=c++2a` for `qoixx` and `qoi-fu_cxx`
- `cargo` and Rust toolchains for `qoi-rust` and `rapid-qoi`
- `make`
- ```console
$ make
$ benchmark/bin/qoibench 20 /path/to/image/directory
```## How to add my implementation?
You can add your own QOI implementation in this project.
If you want it, you need to implement C interface as same as [original implementaion](https://github.com/phoboslab/qoi).
More concretely, you should implement below functions:```c
void* your_own_qoi_encode(const void* data, const qoi_desc* desc, int* out_len);
void* your_own_qoi_decode(const void* data, int size, qoi_desc* desc, int channels); // it's OK that the last argument doesn't work. In this project channels is same as desc.channels.void your_own_qoi_free(void* ptr); // provide appropriate deallocation method corresponding to allocation method you used in encode/decode
```Then, create static library (`libyour_own_qoi.a`) with your implementations.
Finally, add new entry about your implementation in [`benchmark/include/implementations.hpp`](https://github.com/wx257osn2/qoi-benchmark/blob/master/benchmark/include/implementations.hpp).The example is [here](https://github.com/wx257osn2/qoi-benchmark/commit/34fb816c61020cd67eece14df26ccf0f3997e11a).
## License
MIT