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§
Sourcefn is_available(&self) -> bool
fn is_available(&self) -> bool
Check if this implementation is available on the current CPU.
Sourcefn sub_i16x8(&self, a: I16x8, b: I16x8) -> I16x8
fn sub_i16x8(&self, a: I16x8, b: I16x8) -> I16x8
Element-wise subtraction of two i16x8 vectors.
Sourcefn mul_i16x8(&self, a: I16x8, b: I16x8) -> I16x8
fn mul_i16x8(&self, a: I16x8, b: I16x8) -> I16x8
Element-wise multiplication of two i16x8 vectors.
Sourcefn sub_i32x4(&self, a: I32x4, b: I32x4) -> I32x4
fn sub_i32x4(&self, a: I32x4, b: I32x4) -> I32x4
Element-wise subtraction of two i32x4 vectors.
Sourcefn clamp_i16x8(&self, v: I16x8, min: i16, max: i16) -> I16x8
fn clamp_i16x8(&self, v: I16x8, min: i16, max: i16) -> I16x8
Element-wise clamp of i16x8 vector.
Sourcefn horizontal_sum_i16x8(&self, v: I16x8) -> i32
fn horizontal_sum_i16x8(&self, v: I16x8) -> i32
Horizontal sum of all elements in an i16x8 vector.
Sourcefn horizontal_sum_i32x4(&self, v: I32x4) -> i32
fn horizontal_sum_i32x4(&self, v: I32x4) -> i32
Horizontal sum of all elements in an i32x4 vector.
Sourcefn sad_u8x16(&self, a: U8x16, b: U8x16) -> u32
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
Sourcefn widen_low_u8_to_i16(&self, v: U8x16) -> I16x8
fn widen_low_u8_to_i16(&self, v: U8x16) -> I16x8
Widen u8x16 low half to i16x8.
Sourcefn widen_high_u8_to_i16(&self, v: U8x16) -> I16x8
fn widen_high_u8_to_i16(&self, v: U8x16) -> I16x8
Widen u8x16 high half to i16x8.
Sourcefn narrow_i32x4_to_i16x8(&self, low: I32x4, high: I32x4) -> I16x8
fn narrow_i32x4_to_i16x8(&self, low: I32x4, high: I32x4) -> I16x8
Narrow two i32x4 to i16x8 with saturation.
Sourcefn madd_i16x8(&self, a: I16x8, b: I16x8, c: I16x8) -> I16x8
fn madd_i16x8(&self, a: I16x8, b: I16x8, c: I16x8) -> I16x8
Multiply and add: a * b + c for i16x8.
Sourcefn pmaddwd(&self, a: I16x8, b: I16x8) -> I32x4
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.
Sourcefn shr_i16x8(&self, v: I16x8, shift: u32) -> I16x8
fn shr_i16x8(&self, v: I16x8, shift: u32) -> I16x8
Arithmetic right shift of i16x8 by immediate.