complete dct algorithm