pub fn multi_packed_sum_abs_diff_u8_m128i<const IMM: i32>(
    a: m128i,
    b: m128i
) -> m128i
Available with target feature sse4.1 only.
Expand description

Computes eight u16 “sum of absolute difference” values according to the bytes selected.

  • a can be 0 or 1, and specifies to skip the first fur $a values or not.
  • b can be 0, 1, 2, or 3 and specifies to skip the first four times that many values in $b.

This is used for some HD codec thing, and I don’t really get what the point is, but I’m sure someone uses it. If you can write better docs about what this does please file a PR.

let a = m128i::from([0_u8, 1, 56, 3, 255, 5, 127, 7, 128, 9, 100, 101, 123, 13, 154, 125]);
let b = m128i::from([12_u8, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);
//
let c: [u16; 8] = multi_packed_sum_abs_diff_u8_m128i::<0b00_00>(a, b).into();
assert_eq!(c, [66, 319, 301, 390, 376, 263, 253, 236]);
//
let c: [u16; 8] = multi_packed_sum_abs_diff_u8_m128i::<0b00_01>(a, b).into();
assert_eq!(c, [62, 305, 305, 372, 372, 245, 249, 222]);
//
let c: [u16; 8] = multi_packed_sum_abs_diff_u8_m128i::<0b00_10>(a, b).into();
assert_eq!(c, [70, 305, 305, 372, 372, 241, 241, 210]);
//
let c: [u16; 8] = multi_packed_sum_abs_diff_u8_m128i::<0b00_11>(a, b).into();
assert_eq!(c, [78, 305, 305, 372, 372, 241, 241, 210]);
//
let c: [u16; 8] = multi_packed_sum_abs_diff_u8_m128i::<0b01_00>(a, b).into();
assert_eq!(c, [376, 263, 253, 236, 320, 321, 319, 373]);
//
let c: [u16; 8] = multi_packed_sum_abs_diff_u8_m128i::<0b01_01>(a, b).into();
assert_eq!(c, [372, 245, 249, 222, 316, 311, 315, 369]);
//
let c: [u16; 8] = multi_packed_sum_abs_diff_u8_m128i::<0b01_10>(a, b).into();
assert_eq!(c, [372, 241, 241, 210, 300, 295, 299, 353]);
//
let c: [u16; 8] = multi_packed_sum_abs_diff_u8_m128i::<0b01_11>(a, b).into();
assert_eq!(c, [372, 241, 241, 210, 292, 285, 287, 339]);