1. An apparatus for filtering a pixel of an image using horizontal and vertical filtering coefficient, comprising: a decoder, the decoder configured to obtain a first pixel value difference between two successive pixels, the two successive pixels being on a horizontal block boundary, the decoder configured to obtain a second pixel value difference between two successive pixels, the two successive pixels being on a vertical block boundary, the decoder configured to calculate the horizontal filtering coefficient based on the pixel value difference, and calculate the vertical filtering coefficient based on the pixel value difference, and the decoder configured to filter four horizontal successive pixels first based on the horizontal filtering coefficient, two pixels of the four horizontal successive pixels being in a first block and two pixels of the four horizontal successive pixels being in a second block, and the decoder configured to then filter four vertical successive pixels based on the vertical filtering coefficient, two pixels of the four vertical successive pixels being in the first block and two pixels of the four vertical successive pixels being in a third block.