1. An apparatus for filtering a pixel of an image using a filtering coefficient, comprising: a decoder, the decoder configured to obtain a pixel value difference between two successive pixels, the two successive pixels being on a block boundary, and the decoder configured to calculate the filtering coefficient based on the pixel value difference, and obtain four successive filtered pixel values based on the filtering coefficient, the four successive pixels including the two successive pixels used in the obtaining a pixel value difference, two of the four successive pixels being included in a first block and two of the four successive pixels being included in a second block.