Apparatus and method for coding/decoding image selectively using discrete cosine/sine transform
Disclosed is a data transmission system that transmits data by using a relay. The relay selects a transmission terminal from among a plurality of terminals accessing a base station. A base station transmits base station data to the relay during a first time slot, and the transmission terminal transmits terminal data to the relay. The relay transmits terminal data to the base station during a second time slot, and transmits base station data to the transmission terminal.
1. A method of decoding an image, the method comprising:
determining, based on a CBP (coded block pattern) value, whether or not transform coefficients of a block include at least one non-zero transform coefficient; responsive to the CBP value indicating that the transform coefficients of the block include at least one non-zero transform coefficient,
obtaining the transform coefficients and a first flag bit for the block by entropy-decoding an input bitstream;
dequantizing the transform coefficients of the block to generate dequantized transform coefficients for the block;
determining, based on the first flag bit, whether neither of a first inverse-transform based on a discrete cosine transform (DCT) and a second inverse-transform based on a discrete sine transform (DST) is to be performed on the dequantized transform coefficients for the block;
determining, based on a second flag bit which is different from the first flag bit, a selected inverse-transform with respect to the block, the selected inverse-transform being one of the first inverse-transform based on the discrete cosine transform (DCT) or the second inverse-transform based on the discrete sine transform (DST);
generating a residual image for the block by performing the selected inverse-transform on the dequantized transform coefficients for the block; and
reconstructing the block by adding the residual image and a prediction image for the block,
wherein the determining the selected inverse-transform based on the second flag bit is performed both when the transform coefficients of the block are determined to include at least one non-zero transform coefficient based on the CBP value and when it is determined that one of the first inverse-transform and the second inverse-transform is to be performed based on the first flag bit.
2. The method of claim 1 , wherein the second flag bit is signaled by a unit of a macroblock.
3. The method of claim 2 , wherein the first flag bit is signaled by a unit of a slice.