Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] SIMD-accelerated IDCT #146

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ jobs:
rust: ["1.34.2", stable, beta, nightly]
features: ["", "rayon"]
command: [test, benchmark]
include:
- rust: nightly
features: packed_simd
command: test
- rust: nightly
features: packed_simd
command: benchmark
steps:
- uses: actions/checkout@v2
- run: rustup default ${{ matrix.rust }}
Expand All @@ -24,10 +31,12 @@ jobs:
cargo build --verbose --no-default-features --features "$FEATURES" &&
cargo test --tests --benches --no-default-features --features "$FEATURES"
if: ${{ matrix.command == 'test' }}
continue-on-error: ${{ matrix.rust == 'nightly' }}
env:
FEATURES: ${{ matrix.features }}
- name: benchmark
run: cargo bench --bench decoding_benchmark --no-default-features --features "$FEATURES" -- --warm-up-time 1 --measurement-time 1 --sample-size 25
if: ${{ matrix.command == 'benchmark' }}
continue-on-error: ${{ matrix.rust == 'nightly' }}
env:
FEATURES: ${{ matrix.features }}
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ exclude = ["tests/*"]
[dependencies]
byteorder = "1.0"
rayon = { version = "1.0", optional = true }
simulated_packed_simd = "0.0.1"
packed_simd = { version = "0.3", optional = true }

[dev-dependencies]
png = "0.16"
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,14 @@ fn main() {
}
```

## Performance
This crate uses [rayon](https://github.com/rayon-rs/rayon) to decode images on all available cores by default.
This can be disabled by requiring the dependency with `default-features = false`.

This crate can optionally use [SIMD](https://en.wikipedia.org/wiki/SIMD) instructions
to decode images even faster.
This is not enabled by default because it requires a nightly compiler,
but can be activated with the `packed_simd` feature.

## Requirements
This crate compiles only with rust >= 1.34.
Loading