A quantization unit 135 may quantize values which are transformed into a frequency domain in a transform unit 130. According to a block or according to image importance, a quantization coefficient may be changed. A value calculated in a quantization unit 135 may be provided to a dequantization unit 140 and a rearrangement unit 160.
A rearrangement unit 160 may perform rearrangement of a coefficient value for a quantized residual value.
A rearrangement unit 160 may change two-dimensional block-shaped coefficients into a one-dimensional vector shape through a coefficient scanning method. For example, in a rearrangement unit 160, a DC coefficient to a coefficient in a high frequency domain may be scanned by using a predetermined scanning type and may be changed into a one-dimensional vector shape.
An entropy encoding unit 165 may perform entropy encoding based on values calculated by a rearrangement unit 160. For example, entropy encoding may use various encoding methods such as Exponential Golomb, CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-Adaptive Binary Arithmetic Coding).
An entropy encoding unit 165 may encode various information such as residual value coefficient information and block type information of a coding unit, prediction mode information, partitioning unit information, prediction unit information and transmission unit information, motion vector information, reference frame information, interpolation information of a block, filtering information, etc. from a rearrangement unit 160 and a prediction unit 120 and 125.
In an entropy encoding unit 165, a coefficient value of a coding unit input in a rearrangement unit 160 may be entropy-encoded.