1. A method for decoding a video, the method comprising: obtaining transformed coefficients of a block from a bitstream; generating inverse-quantized transformed coefficients by performing inverse-quantization and a first clipping on the transformed coefficients; generating sample values by performing vertical inverse-transformation and a second clipping on the inverse-quantized transformed coefficients; and generating residual values by performing horizontal inverse-transformation on the sample values, wherein the first clipping is performed for restricting the inverse-quantized transformed coefficients to a range of a first bitdepth, and the second clipping is performed for restricting the sample values to a range of a second bitdepth.