Refactor filter transforms for speed

Around 5x speedup for 1-D transforms.