Skip to main content

SimdOps

Trait SimdOps 

Source
pub trait SimdOps: Send + Sync {
Show 28 methods // Required methods fn name(&self) -> &'static str; fn is_available(&self) -> bool; fn add_i16x8(&self, a: I16x8, b: I16x8) -> I16x8; fn sub_i16x8(&self, a: I16x8, b: I16x8) -> I16x8; fn mul_i16x8(&self, a: I16x8, b: I16x8) -> I16x8; fn add_i32x4(&self, a: I32x4, b: I32x4) -> I32x4; fn sub_i32x4(&self, a: I32x4, b: I32x4) -> I32x4; fn min_i16x8(&self, a: I16x8, b: I16x8) -> I16x8; fn max_i16x8(&self, a: I16x8, b: I16x8) -> I16x8; fn clamp_i16x8(&self, v: I16x8, min: i16, max: i16) -> I16x8; fn min_u8x16(&self, a: U8x16, b: U8x16) -> U8x16; fn max_u8x16(&self, a: U8x16, b: U8x16) -> U8x16; fn clamp_u8x16(&self, v: U8x16, min: u8, max: u8) -> U8x16; fn horizontal_sum_i16x8(&self, v: I16x8) -> i32; fn horizontal_sum_i32x4(&self, v: I32x4) -> i32; fn sad_u8x16(&self, a: U8x16, b: U8x16) -> u32; fn sad_8(&self, a: &[u8], b: &[u8]) -> u32; fn sad_16(&self, a: &[u8], b: &[u8]) -> u32; fn widen_low_u8_to_i16(&self, v: U8x16) -> I16x8; fn widen_high_u8_to_i16(&self, v: U8x16) -> I16x8; fn narrow_i32x4_to_i16x8(&self, low: I32x4, high: I32x4) -> I16x8; fn madd_i16x8(&self, a: I16x8, b: I16x8, c: I16x8) -> I16x8; fn pmaddwd(&self, a: I16x8, b: I16x8) -> I32x4; fn shr_i16x8(&self, v: I16x8, shift: u32) -> I16x8; fn shl_i16x8(&self, v: I16x8, shift: u32) -> I16x8; fn shr_i32x4(&self, v: I32x4, shift: u32) -> I32x4; fn shl_i32x4(&self, v: I32x4, shift: u32) -> I32x4; fn avg_u8x16(&self, a: U8x16, b: U8x16) -> U8x16;
}
Expand description

Core SIMD operations trait.

This trait defines the fundamental SIMD operations needed for video codec implementations. All operations are designed to map efficiently to hardware SIMD instructions.

Required Methods§

Source

fn name(&self) -> &'static str

Get the name of this SIMD implementation.

Source

fn is_available(&self) -> bool

Check if this implementation is available on the current CPU.

Source

fn add_i16x8(&self, a: I16x8, b: I16x8) -> I16x8

Element-wise addition of two i16x8 vectors.

Source

fn sub_i16x8(&self, a: I16x8, b: I16x8) -> I16x8

Element-wise subtraction of two i16x8 vectors.

Source

fn mul_i16x8(&self, a: I16x8, b: I16x8) -> I16x8

Element-wise multiplication of two i16x8 vectors.

Source

fn add_i32x4(&self, a: I32x4, b: I32x4) -> I32x4

Element-wise addition of two i32x4 vectors.

Source

fn sub_i32x4(&self, a: I32x4, b: I32x4) -> I32x4

Element-wise subtraction of two i32x4 vectors.

Source

fn min_i16x8(&self, a: I16x8, b: I16x8) -> I16x8

Element-wise minimum of two i16x8 vectors.

Source

fn max_i16x8(&self, a: I16x8, b: I16x8) -> I16x8

Element-wise maximum of two i16x8 vectors.

Source

fn clamp_i16x8(&self, v: I16x8, min: i16, max: i16) -> I16x8

Element-wise clamp of i16x8 vector.

Source

fn min_u8x16(&self, a: U8x16, b: U8x16) -> U8x16

Element-wise minimum of two u8x16 vectors.

Source

fn max_u8x16(&self, a: U8x16, b: U8x16) -> U8x16

Element-wise maximum of two u8x16 vectors.

Source

fn clamp_u8x16(&self, v: U8x16, min: u8, max: u8) -> U8x16

Element-wise clamp of u8x16 vector.

Source

fn horizontal_sum_i16x8(&self, v: I16x8) -> i32

Horizontal sum of all elements in an i16x8 vector.

Source

fn horizontal_sum_i32x4(&self, v: I32x4) -> i32

Horizontal sum of all elements in an i32x4 vector.

Source

fn sad_u8x16(&self, a: U8x16, b: U8x16) -> u32

Sum of absolute differences between two u8x16 vectors.

Computes: sum(|a[i] - b[i]|) for all i

Source

fn sad_8(&self, a: &[u8], b: &[u8]) -> u32

Sum of absolute differences for 8 bytes.

Source

fn sad_16(&self, a: &[u8], b: &[u8]) -> u32

Sum of absolute differences for 16 bytes.

Source

fn widen_low_u8_to_i16(&self, v: U8x16) -> I16x8

Widen u8x16 low half to i16x8.

Source

fn widen_high_u8_to_i16(&self, v: U8x16) -> I16x8

Widen u8x16 high half to i16x8.

Source

fn narrow_i32x4_to_i16x8(&self, low: I32x4, high: I32x4) -> I16x8

Narrow two i32x4 to i16x8 with saturation.

Source

fn madd_i16x8(&self, a: I16x8, b: I16x8, c: I16x8) -> I16x8

Multiply and add: a * b + c for i16x8.

Source

fn pmaddwd(&self, a: I16x8, b: I16x8) -> I32x4

Multiply pairs and add adjacent results (pmaddwd equivalent).

Multiplies pairs of i16 elements and adds adjacent products: result[0] = a[0]*b[0] + a[1]*b[1] result[1] = a[2]*b[2] + a[3]*b[3] etc.

Source

fn shr_i16x8(&self, v: I16x8, shift: u32) -> I16x8

Arithmetic right shift of i16x8 by immediate.

Source

fn shl_i16x8(&self, v: I16x8, shift: u32) -> I16x8

Logical left shift of i16x8 by immediate.

Source

fn shr_i32x4(&self, v: I32x4, shift: u32) -> I32x4

Arithmetic right shift of i32x4 by immediate.

Source

fn shl_i32x4(&self, v: I32x4, shift: u32) -> I32x4

Logical left shift of i32x4 by immediate.

Source

fn avg_u8x16(&self, a: U8x16, b: U8x16) -> U8x16

Average of two u8x16 vectors (rounding up).

Implementors§