Skip to main content

filter_symmetric_row

Function filter_symmetric_row 

Source
fn filter_symmetric_row<T, F, const N: usize>(
    arena: &[T],
    dst_row: &mut [T],
    scanned_kernel: &[F],
)
where T: Copy + AsPrimitive<F> + Default, F: ToStorage<T> + Mul<Output = F> + MulAdd<F, Output = F> + Default + Add<F, Output = F> + Copy + 'static, i32: AsPrimitive<F>,
Expand description

Performs horizontal convolution for row

Common convolution formula O(x,y)=∑K(k)⋅I(x+k,y); where sums goes from 0…R when filter is symmetric that we can half kernel reads by using formula O(x,y)=(∑K(k)⋅(I(x+k,y) + I(x+(R-k),y))) + K(R/2)⋅I(x+R/2,y); where sums goes from 0…R/2