A method of decoding a video for compensating for a pixel value, the method comprising: obtaining, from a bitstream, information about pixel value compensation and a compensation value; extracting encoded image data from a bitstream by parsing the bitstream of an encoded image; decoding the extracted image data and performing deblocking-filtering on the decoded image data; determining a pixel group comprising a current pixel to be compensated for, by using the extracted compensation value, from among pixels of the deblocking-filtered image; and compensating for an error between the current pixel of the determined pixel group and a corresponding original pixel by using the extracted compensation value, wherein the compensating for an error comprising: when the information about pixel value compensation indicates a first type regarding bands of pixel values, determining a band comprising a pixel value of a current pixel of the determined pixel group; and adding, to the pixel value of the current pixel, the compensation value corresponding to the band, and wherein a total range of values of the pixels is from 0 to a maximum value of the values of the pixels, and a section corresponding to the total range of values of the pixels is uniformly split into a plurality of bands, the band is one of a plurality of bands, and the compensation value correspond to the band among the plurality of bands, and wherein the compensating for an error comprising: when the information about pixel value compensation indicates the second type regarding edge value levels, determining an edge value level of the current pixel by comparing the pixel value of the current pixel to pixel values of neighboring pixels (31, 32, 33, 34, 35, 36 and 37), in the deblocking-filtered image; and adding, to the pixel value of the current pixel, the compensation value corresponding to the edge value level, and the edge value level is one of a plurality of edge value levels. obtaining, from a bitstream, information about pixel value compensation and a compensation value; extracting encoded image data from a bitstream by parsing the bitstream of an encoded image; decoding the extracted image data and performing deblocking-filtering on the decoded image data; determining a pixel group comprising a current pixel to be compensated for, by using the extracted compensation value, from among pixels of the deblocking-filtered image; and compensating for an error between the current pixel of the determined pixel group and a corresponding original pixel by using the extracted compensation value, wherein the compensating for an error comprising: when the information about pixel value compensation indicates a first type regarding bands of pixel values, determining a band comprising a pixel value of a current pixel of the determined pixel group; and adding, to the pixel value of the current pixel, the compensation value corresponding to the band, and when the information about pixel value compensation indicates a first type regarding bands of pixel values, determining a band comprising a pixel value of a current pixel of the determined pixel group; and adding, to the pixel value of the current pixel, the compensation value corresponding to the band, and wherein a total range of values of the pixels is from 0 to a maximum value of the values of the pixels, and a section corresponding to the total range of values of the pixels is uniformly split into a plurality of bands, the band is one of a plurality of bands, and the compensation value correspond to the band among the plurality of bands, and wherein the compensating for an error comprising: when the information about pixel value compensation indicates the second type regarding edge value levels, determining an edge value level of the current pixel by comparing the pixel value of the current pixel to pixel values of neighboring pixels (31, 32, 33, 34, 35, 36 and 37), in the deblocking-filtered image; and adding, to the pixel value of the current pixel, the compensation value corresponding to the edge value level, and when the information about pixel value compensation indicates the second type regarding edge value levels, determining an edge value level of the current pixel by comparing the pixel value of the current pixel to pixel values of neighboring pixels (31, 32, 33, 34, 35, 36 and 37), in the deblocking-filtered image; and adding, to the pixel value of the current pixel, the compensation value corresponding to the edge value level, and the edge value level is one of a plurality of edge value levels.