Revert changes by PR#2930 since it breaks logic of inverse mode.
Merge pull request #2980 from akarsakov:revert_dft_dst_fix