1. A method of filtering a pixel of an image using a weighted filtering coefficient, comprising: obtaining a pixel value difference between two successive pixels, the two successive pixels being on a block boundary, calculating the filtering coefficient based on the pixel value difference, weighting the filtering coefficient, and obtaining a filtered pixel value based on the weighted filtering coefficient.