Method and device for arithmetic coding of video, and method and device for arithmetic decoding of video
Methods and apparatuses for arithmetic encoding/decoding of video data. The arithmetic decoding method includes arithmetically decoding prefix bit strings representing a two-dimensional location of a last significant coefficient in a block sequentially by using a context model, arithmetically decoding suffix bit strings in a bypass mode, and performing inverse binarization on the arithmetically decoded prefix bit strings and suffix bit strings to acquire the location of the last significant coefficient in the block.
1. A method for decoding a video, the method comprising:
obtaining a coded block flag indicating whether a transformation block includes at least one non-zero significant transformation coefficient;
when the coded block flag indicates the transformation block includes at least one non-zero significant transformation coefficient, obtaining an x coordinate prefix bitstring of a last significant coefficient in the transformation block by performing context-based-arithmetic decoding on a bitstream,
obtaining a y coordinate prefix bitstring of the last significant coefficient by performing context-based-arithmetic decoding on the bitstream,
obtaining an x coordinate suffix bitstring of the last significant coefficient by performing bypass mode decoding on the bitstream, and
obtaining a y coordinate suffix bitstring of the last significant coefficient by performing bypass mode decoding on the bitstream;
obtaining an inverse-binarized x coordinate prefix and an inverse-binarized y coordinate prefix by performing inverse binarization according to a first binarization method on the x coordinate prefix bitstring and the y coordinate prefix bitstring;
obtaining an inverse-binarized x coordinate suffix and an inverse-binarized y coordinate suffix by performing inverse binarization according to a second binarization method on the x coordinate suffix bitstring and the y coordinate suffix bitstring;
reconstructing an x coordinate of the last significant coefficient based on the inverse-binarized x coordinate prefix and the inverse-binarized x coordinate suffix; and
reconstructing a y coordinate of the last significant coefficient based on the inverse-binarized y coordinate prefix and the inverse-binarized y coordinate suffix;
obtaining, based on the x coordinate and the y coordinate of the last significant coefficient, significant maps of subsets having a predetermined size which are split from the transformation block in a reverse index order of the subsets; and
reconstructing transformation coefficients in the transformation block based on the significant maps,
wherein, after the x coordinate prefix bitstring and the y coordinate prefix bitstring are obtained via the context-based-arithmetic decoding, the x coordinate suffix bitstring and the y coordinate suffix bitstring are obtained via the bypass mode decoding, and
wherein the transformation block is split from coding unit based on a transformation block split information.
2. The method of claim 1 , wherein the x coordinate indicates x-th column (where x is an integer equal to or greater than 0) in the transformation block, and
the y coordinate indicates y-th row (where y is an integer equal or greater than 0) in the transformation block.
3. The method of claim 1 , further comprising:
reconstructing residuals in the transformation block by performing inverse-quantization and inverse-transformation on the reconstructed transformation coefficients.
4. The method of claim 1 , wherein the last significant coefficient is a non-zero transformation coefficient scanned last in a scanning order among transformation coefficients in the transformation block.
5. The method of claim 1 , wherein an origin of the x coordinate and the y coordinate of the last significant coefficient is an upper-leftmost point of the transformation block.