The method and apparatus encode and decode video by determining whether to use a discrete cosine transform (DCT) and a discrete sine transform (DST) for each of the horizontal and vertical transforms. During encoding, intra-prediction is based on an intra prediction mode determined for an MxN sized input image block to obtain an intra-prediction residue matrix (M) of size MxN. . Based on the internal prediction mode, each of the horizontal and vertical transforms is performed using one of DCT and DST according to the internal prediction mode. During decoding, the internal prediction mode is determined from the incoming video bit stream. An MxN-wide transform coefficient matrix of error residuals is obtained from the video stream by an inverse quantizer. Based on the internal prediction mode, one of the DCT and the DST is performed for each of the inverse horizontal conversion and the inverse vertical conversion.
展开▼