yup. imo your method should produce very good results, but it's indeed hard to optimize. i had really rough times trying to optimize this method on a 2d (3x3) deringing filter.. ;) the other thresholding technique u can use is calc the convolution anyway, and apply it only if the final result is inside