Split DCT-II and DCT-III in different functions, they do not share any code.