[−][src]Macro safe_arch::multi_packed_sum_abs_diff_u8_m128i
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!(a, b, a 0, b 0).into(); assert_eq!(c, [66, 319, 301, 390, 376, 263, 253, 236]); // let c: [u16; 8] = multi_packed_sum_abs_diff_u8_m128i!(a, b, a 0, b 1).into(); assert_eq!(c, [62, 305, 305, 372, 372, 245, 249, 222]); // let c: [u16; 8] = multi_packed_sum_abs_diff_u8_m128i!(a, b, a 0, b 2).into(); assert_eq!(c, [70, 305, 305, 372, 372, 241, 241, 210]); // let c: [u16; 8] = multi_packed_sum_abs_diff_u8_m128i!(a, b, a 0, b 3).into(); assert_eq!(c, [78, 305, 305, 372, 372, 241, 241, 210]); // let c: [u16; 8] = multi_packed_sum_abs_diff_u8_m128i!(a, b, a 1, b 0).into(); assert_eq!(c, [376, 263, 253, 236, 320, 321, 319, 373]); // let c: [u16; 8] = multi_packed_sum_abs_diff_u8_m128i!(a, b, a 1, b 1).into(); assert_eq!(c, [372, 245, 249, 222, 316, 311, 315, 369]); // let c: [u16; 8] = multi_packed_sum_abs_diff_u8_m128i!(a, b, a 1, b 2).into(); assert_eq!(c, [372, 241, 241, 210, 300, 295, 299, 353]); // let c: [u16; 8] = multi_packed_sum_abs_diff_u8_m128i!(a, b, a 1, b 3).into(); assert_eq!(c, [372, 241, 241, 210, 292, 285, 287, 339]);