dct: move permute transpose into the DCT/DST function

This is in order to match the paper