1. A method of encoding a video, which performs deblocking filtering based on coding units, the method comprising: splitting one picture into at least one maximum coding unit that is a data unit having a maximum size; determining a plurality of coding units that are hierarchically configured according to depths indicating a number of times the at least one maximum coding unit is spatially spilt, and a plurality of prediction units and a plurality of transformation units respectively for prediction and transformation of the plurality of coding units; determining a filtering boundary on which deblocking filtering is to be performed based on at least one data unit from among the plurality of coding units, the plurality of prediction units, and the plurality of transformation units; determining filtering strength at the filtering boundary based on a prediction mode of a coding unit to which pixels adjacent to the filtering boundary belong from among the plurality of coding units, and transformation coefficient values of the pixels adjacent to the filtering boundary; and performing deblocking filtering on the filtering boundary based on the determined filtering strength.