Merge branch 'main' into dev

# Conflicts:
#	CHANGELOG.md
#	tests/resize_tests.rs
This commit is contained in:
Kirill Kuzminykh
2021-12-14 00:19:29 +03:00
7 changed files with 21 additions and 3 deletions
+4
View File
@@ -4,6 +4,10 @@
- Fixed error in code for convolution U8x4 images with helps of ``SSE4.1`` instructions.
- Fixed error in code for convolution U8 images with helps of ``AVX2`` instructions.
## [0.5.2] - 2021-11-26
- Fixed compile errors on non-x86 architectures.
## [0.5.1] - 2021-11-24
- Fixed compile errors on non-x86 architectures.
Generated
+1 -1
View File
@@ -358,7 +358,7 @@ dependencies = [
[[package]]
name = "fast_image_resize"
version = "0.5.1"
version = "0.5.2"
dependencies = [
"glassbench",
"image",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "fast_image_resize"
version = "0.5.1"
version = "0.5.2"
authors = ["Kirill Kuzminykh <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
+1
View File
@@ -5,6 +5,7 @@ use crate::CpuExtensions;
mod avx2;
mod native;
#[cfg(target_arch = "x86_64")]
mod sse4;
impl Convolution for U8x3 {
+4
View File
@@ -75,11 +75,13 @@ fn multiply_alpha_test(cpu_extensions: CpuExtensions) {
}
}
#[cfg(target_arch = "x86_64")]
#[test]
fn multiply_alpha_avx2_test() {
multiply_alpha_test(CpuExtensions::Avx2);
}
#[cfg(target_arch = "x86_64")]
#[test]
fn multiply_alpha_sse2_test() {
multiply_alpha_test(CpuExtensions::Sse2);
@@ -154,11 +156,13 @@ fn divide_alpha_test(cpu_extensions: CpuExtensions) {
}
}
#[cfg(target_arch = "x86_64")]
#[test]
fn divide_alpha_avx2_test() {
divide_alpha_test(CpuExtensions::Avx2);
}
#[cfg(target_arch = "x86_64")]
#[test]
fn divide_alpha_sse2_test() {
divide_alpha_test(CpuExtensions::Sse2);
+1
View File
@@ -59,6 +59,7 @@ fn resize_image_example() {
.unwrap();
}
#[cfg(target_arch = "x86_64")]
fn main() {
let mut resizer = fr::Resizer::new(fr::ResizeAlg::Convolution(fr::FilterType::Lanczos3));
unsafe {
+9 -1
View File
@@ -181,8 +181,11 @@ fn downscale_test<P: PixelExt>(resize_alg: ResizeAlg, cpu_extensions: CpuExtensi
let ext_name = match cpu_extensions {
CpuExtensions::None => "native",
#[cfg(target_arch = "x86_64")]
CpuExtensions::Sse2 => "sse2",
#[cfg(target_arch = "x86_64")]
CpuExtensions::Sse4_1 => "sse41",
#[cfg(target_arch = "x86_64")]
CpuExtensions::Avx2 => "avx2",
};
@@ -247,7 +250,12 @@ fn downscale_u8() {
let buffer = downscale_test::<P>(ResizeAlg::Nearest, CpuExtensions::None);
assert_eq!(image_checksum::<1>(&buffer), [2920317]);
for cpu_extensions in [CpuExtensions::None, CpuExtensions::Avx2] {
let mut cpu_extensions_vec = vec![CpuExtensions::None];
#[cfg(target_arch = "x86_64")]
{
cpu_extensions_vec.push(CpuExtensions::Avx2);
}
for cpu_extensions in cpu_extensions_vec {
let buffer =
downscale_test::<P>(ResizeAlg::Convolution(FilterType::Lanczos3), cpu_extensions);
assert_eq!(image_checksum::<1>(&buffer), [2923520]);