Method and apparatus for CABAC-based entropy coding
A picture decoding method performed by a decoding device according to an embodiment of the present disclosure comprises the steps of: deriving a context index for a split flag syntax element on the basis of split availability information of a current block; determining a context model on the basis of the derived context index; decoding a value of the split flag syntax element on the basis of a CABAC, using the determined context model; deriving a current coding unit from the current block on the basis of the value of the split flag syntax element; deriving a predicted block on the basis of inter prediction or intra prediction for the current coding unit; and generating a reconstructed block on the basis of the predicted block.
1. An image decoding method performed by a decoding apparatus, the method comprising:
deriving a context index for a split flag syntax element based on split availability information of a current block;
determining a context model based on the derived context index;
decoding a value of the split flag syntax element based on context-based adaptive binary arithmetic coding (CABAC) by using the determined context model;
deriving a current coding unit from the current block based on the value of the split flag syntax element;
deriving a predicted block based on inter-prediction or intra-prediction for the current coding unit; and
generating a reconstructed block based on the predicted block,
wherein the split flag syntax element comprises: a directional split flag representing whether the current block is to be vertically split,
wherein the split availability information comprises: a binary tree (BT) horizontal split available flag information related to whether the current block is allowed to be horizontally split based on a BT structure, a ternary tree (TT) horizontal split available flag information related to whether the current block is allowed to be horizontally split based on a TT structure, a BT vertical split available flag information related to whether the current block is allowed to be vertically split based on the BT structure, and a TT vertical split available flag information related to whether the current block is allowed to be vertically split based on the TT structure,
wherein the context index for the directional split flag is derived based on a first value and a second value,
wherein the first value is derived based on a value of the BT horizontal split available flag information and a value of the TT horizontal split available flag information, and
wherein the second value is derived based on a value of the BT vertical split available flag information and a value of the TT vertical split available flag information.
2. An image encoding method performed by an encoding apparatus, the method comprising:
deriving a split flag syntax element representing a split structure of a current block;
deriving a context index for the split flag syntax element based on split availability information of the current block;
determining a context model based on the derived context index; and
encoding a value of the split flag syntax element based on CABAC using the determined context model,
wherein the split flag syntax element comprises: a directional split flag representing whether the current block is vertically split,
wherein the split availability information comprises: a BT horizontal split available flag information related to whether the current block is allowed to be horizontally split based on a BT structure, a TT horizontal split available flag information related to whether the current block is allowed to be horizontally split based on a TT structure, a BT vertical split available flag information related to whether the current block is allowed to be vertically split based on the BT structure, and a TT vertical split available flag information related to whether the current block is allowed to be vertically split based on the TT structure,
wherein the context index for the directional split flag is derived based on a first value and a second value,
wherein the first value is derived based on a value of the BT horizontal split available flag information and a value of the TT horizontal split available flag information, and
wherein the second value is derived based on a value of the BT vertical split available flag information and a value of the TT vertical split available flag information.
3. A transmission method of data for image, the transmission method comprising:
generating a bitstream, wherein the bitstream is generated by performing deriving a split flag syntax element representing a split structure of a current block, deriving a context index for the split flag syntax element based on split availability information of the current block, determining a context model based on the derived context index, and generating the bitstream by encoding a value of the split flag syntax element based on CABAC using the determined context model; and
transmitting the data comprising the bitstream,
wherein the split flag syntax element comprises: a directional split flag representing whether the current block is vertically split,
wherein the split availability information comprises: a BT horizontal split available flag information related to whether the current block is allowed to be horizontally split based on a BT structure, a TT horizontal split available flag information related to whether the current block is allowed to be horizontally split based on a TT structure, a BT vertical split available flag information related to whether the current block is allowed to be vertically split based on the BT structure, and a TT vertical split available flag information related to whether the current block is allowed to be vertically split based on the TT structure,
wherein the context index for the directional split flag is derived based on a first value and a second value,
wherein the first value is derived based on a value of the BT horizontal split available flag information and a value of the TT horizontal split available flag information, and
wherein the second value is derived based on a value of the BT vertical split available flag information and a value of the TT vertical split available flag information.