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.