Skip to content

Commit

Permalink
remove nightly requirement for now
Browse files Browse the repository at this point in the history
  • Loading branch information
FerrahWolfeh committed Aug 18, 2023
1 parent a753ecb commit f3eec9a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 31 deletions.
9 changes: 1 addition & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ sha2 = { version = "0.10.6", features = ["asm"] }
spinoff = "0.8.0"
once_cell = "1.17.1"
threadpool = "1.8.1"
image = { version = "0.24.6", default-features = false, features = [
image = { version = "0.24.7", default-features = false, features = [
"rgb",
"png",
"jpeg",
Expand All @@ -43,13 +43,6 @@ avif-serialize = "0.8.1"
notify-rust = { version = "4.8.0", features = ["images"] }
thread-priority = "0.13.1"
notify = "6.0.1"


[package.metadata.archlinux_pkgbuild]
arch = ["x86_64", "aarch64"]
makedepends = ["cargo", "nasm", "libwebp", "lcms2"]
pkgrel = 1

[profile.release]
lto = false
opt-level = 3
Expand Down
2 changes: 0 additions & 2 deletions rust-toolchain.toml

This file was deleted.

21 changes: 1 addition & 20 deletions src/encoders/avif/encode.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::simd::u8x32;
use std::time::Instant;

use color_eyre::eyre::Result;
Expand Down Expand Up @@ -225,25 +224,7 @@ impl Encoder {
// Isolate only the alpha channel.
let pixel_alpha = Vec::from_iter(image.iter().map(|pixel| pixel.a));

let (_, sd, _) = pixel_alpha.as_simd::<32>();
let alpha_mask = u8x32::splat(255);

sd.iter().all(|pixel| {
// let cmp = unsafe {
// let alpha_reg = _mm256_loadu_si256(pxl.as_ptr() as *const __m256i);
// let alpha_mask = _mm256_set1_epi8(-1);

// // Whatever happens, this thing generates 4 bytes that I need to check if they are 0b11111111 (-1)
// let alpha_cmp = _mm256_cmpeq_epi8(alpha_reg, alpha_mask);

// // Yup, this is the one. Not sure why I would only want to compare the leftmost bit, but seems faster.
// _mm256_movemask_epi8(alpha_cmp)
// };

// cmp.eq(&-1)

pixel == &alpha_mask
})
pixel_alpha.iter().any(|px| px != &255)
}

#[inline(never)]
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(portable_simd)]
use cli::{commands::Commands, Args};
use color_eyre::eyre::Result;

Expand Down

0 comments on commit f3eec9a

Please sign in to comment.