The method and apparatus encodes and decodes video by determining whether to use a discrete cosine transform (DCT) and a discrete sine transform (DST) for horizontal and vertical transforms, respectively. During encoding, intra-prediction is based on the internal prediction mode determined for M × N sized input image blocks to obtain an M × N sized intra-prediction residue matrix (E). Is performed. Based on the inner prediction mode, each of the horizontal transform and the vertical transform is performed using one of DCT and DST according to the inner prediction mode. During decoding, the internal prediction mode is determined from the input video bit stream. A transform coefficient matrix of size M × N of error residuals is obtained from the video stream by an inverse quantizer. Based on the internal prediction mode, one of DCT and DST is performed for inverse horizontal transformation and inverse vertical transformation, respectively.
展开▼