Solved memory issue in fdct3d_forward