def dct_2d(image): return dct(dct(image.T, norm='ortho').T, norm='ortho') def idct_wd(coefficient): return idct(idct(coefficient.T, norm='ortho').T, norm='ortho')