Method and apparatus for intra prediction
Disclosed herein are a method and apparatus for filtering a reference pixel. A method of smoothing a reference pixel may include determining whether or not to perform smoothing on a reference pixel based on the size of a transform block and information about an intra-prediction mode for the transform block and determining a smoothing method by comparing the size of the transform block with the size of a maximum transform block. Accordingly, image coding efficiency can be increased, and picture quality can be improved.
1. An image decoder in which an intra-prediction is performed on a current block, the image decoder comprising:
an intra-prediction unit configured to:
determine whether or not to perform smoothing on a reference pixel of the current block based on a size of a block, a size of a current block, and an intra-prediction mode for the current block, the size of the block being indicated by an encoder and transmitted to the decoder; and
apply a bi-linear smoothing filter having predetermined filtering coefficients to the reference pixel of the current block when it is determined to perform the smoothing on the reference pixel of the current block,
wherein the bi-linear smoothing filter is a filter for calculating a filtered reference pixel,
pF[x][y](x=−1, y=−1 . . . nT*2−1, x=0 . . . nT*2−1, y=−1),
according to the equations:
pF [−1][ nT* 2−1]= pf [−1][ nT* 2−1]
pF[nT* 2−1][−1]= p[nT *2−1][−1]
pF [−1][ y ]=( p [−1][ y+ 1]+2* p [−1][ y]+p [−1][ y −1]+2)>>2 for y=nT* 2 . . . 0
pF [−1][−1]=( p [−1][0]+2* p [−1][−1]+ p [0][−1]+2)>>2
pF[x] [−1]=( p[x− 1][−1]+2* p[x][ −1]+ p[x+ 1][−1]+2)>>2 for x =0 . . . nT* 2−2
2. The image decoder of claim 1 , wherein the current block is a current transform block, the size of the current block is a size of a current transform block, the size of the current transform block is nT, and a reference pixel of the current transform block is p[x][y](x=−1, y=−1 . . . nT*2−1, x=0 . . . nT*2−1, y=−1).
3. An image decoder in which an intra-prediction is performed on a current block, the image decoder comprising:
an intra-prediction unit configured to:
determine whether or not to perform smoothing on a reference pixel of the current block based on a size of a block, a size of a current block, and an intra-prediction mode for the current block, the size of the block being indicated by an encoder and transmitted to the decoder; and
apply a smoothing filter having predetermined filtering coefficients to the reference pixel of the current block when it is determined to perform the smoothing on the reference pixel of the current block,
wherein the smoothing filter is a filter for calculating a filtered reference pixel,
pF[x][y](x=−1, y=−1 . . . nT*2−1, x=0 . . . nT*2−1, y=−1),
according to the equations:
pF [−1] [nT* 2−1]= p [−1] [nT* 2−1]
pF[nT* 2−1][−1]= p[nT* 2−1][−1]
pF [−1][ y ]=( p [−1][ y +1]+2* p [−1][ y]+p [−1][ y −1]+2)>>2 for y=nT* 2−2 . . . 0
pF [−1][−1]=( p [−1][0]+2* p [−1][−1]+ p [0][−1]+2)>>2
pF[x][− 1]=( p[x− 1][−1]+2* p[x][− 1]+ p[x+ 1][−1]+2)>>2 for x= 0 . . . nT* 2−2
4. The image decoder of claim 3 , wherein the current block is a current transform block, the size of the current block is a size of a current transform block, the size of the current transform block is nT, and a reference pixel of the current transform block is p[x][y](x=−1, y=−1 . . . nT*2−1, x=0 . . . nT*2−1, y=−1).