Multi-level significance maps for encoding and decoding
Methods of encoding and decoding for video data are described in which multi-level significance maps are used in the encoding and decoding processes. The significant-coefficient flags that form the significance map are grouped into contiguous groups, and a significant-coefficient-group flag signifies for each group whether that group contains no non-zero significant-coefficient flags. If there are no non-zero significant-coefficient flags in the group, then the significant-coefficient-group flag is set to zero. The set of significant-coefficient-group flags is encoded in the bitstream. Any significant-coefficient flags that fall within a group that has a significant-coefficient-group flag that is non-zero are encoded in the bitstream, whereas significant-coefficient flags that fall within a group that has a significant-coefficient-group flag that is zero are not encoded in the bitstream.
1 . An encoding apparatus comprising at least one processor, the at least one processor configured to:
determine, for a first block within a transform unit, that the first block is not a block that contains a position of a DC coefficient in the transform unit;
in response to the determination that the first block is not the block that contains the position of the DC coefficient in the transform unit:
encode, into a bitstream, a significant-coefficient group flag (significant-CG flag) indicating that the first block has at least one non-zero coefficient, by determining a context for the significant-CG flag to be either a first context or a second context, based on values of significant-CG flags corresponding to two blocks which are, respectively, adjacent to the right and below the first block, and wherein the context is determined to be the first context when the values of significant-CG flags of the two blocks are both zero and the context is determined to be the second context otherwise;
encode, for each position in the first block other than a (0,0) position in the first block, a significant-coefficient flag into the bitstream, the significant-coefficient flag indicating whether a coefficient at the respective position in the first block is non-zero;
determine whether any coefficient not at the (0,0) position is non-zero;
in response to a determination that at least one coefficient not at the (0,0) position is non-zero, encode, into the bitstream, a significant-coefficient flag indicating whether a coefficient at the (0,0) position is non-zero; and
in response to a determination that all coefficients not at the (0,0) position are zero, not encode a significant-coefficient flag for the (0,0) position; and
determine, for a second block within the transform unit, that the second block is the block that contains the position of the DC coefficient in the transform unit,
in response to the determination that the second block is the block that contains the position of the DC coefficient in the transform unit:
not encode a significant-CG flag; and
encode, for each position in the second block, a significant-coefficient flag into the bitstream, the significant-coefficient flag indicating whether a coefficient at the respective position in the second block is non-zero.
2 . The encoding apparatus of claim 1 , the at least one processor further configured to:
for the first block within the transform unit:
determine whether any coefficient not at the (0,0) position is non-zero by checking the respective significant-coefficient flag.
3 . The encoding apparatus of claim 1 , the at least one processor further configured to:
for a third block within the transform unit, that contains a position of a last non-zero coefficient in the transform unit:
not encode a significant-CG flag;
encode, for at least one position in the third block that is not the position of the last non-zero coefficient in the transform unit, a significant-coefficient flag into the bitstream, the significant-coefficient flag indicating whether a coefficient at the respective position in the third block is non-zero; and
not encode a significant-coefficient flag for the position of the last non-zero coefficient in the transform unit.
4 . A video encoding method comprising:
determining, for a first block within a transform unit, that the first block is not a block that contains a position of a DC coefficient in the transform unit;
in response to the determination that the first block is not the block that contains the position of the DC coefficient in the transform unit:
encoding, into a bitstream, a significant-coefficient group flag (significant-CG flag) indicating that the first block has at least one non-zero coefficient by determining a context for the significant-CG flag to be either a first context or a second context, based on values of significant-CG flags corresponding to two blocks which are, respectively, adjacent to the right and below the first block, and wherein the context is determined to be the first context when the values of significant-CG flags of the two blocks are both zero and the context is determined to be the second context otherwise;
encoding, for each position in the first block other than a (0,0) position in the first block, a significant-coefficient flag into the bitstream, the significant-coefficient flag indicating whether a coefficient at the respective position in the first block is non-zero;
determining whether any coefficient not at the (0,0) position is non-zero;
in response to a determination that at least one coefficient not at the (0,0) position is non-zero, encoding, into the bitstream, a significant-coefficient flag indicating whether a coefficient at the (0,0) position is non-zero; and
in response to a determination that all coefficients not at the (0,0) position are zero, not encoding a significant-coefficient flag for the (0,0) position; and
determining, for a second block within the transform unit, that the second block is the block that contains the position of the DC coefficient in the transform unit;
in response to the determination that the second block is the block that contains the position of the DC coefficient in the transform unit:
not encoding a significant-CG flag; and
encoding, for each position in the second block, a significant-coefficient flag into the bitstream, the significant-coefficient flag indicating whether a coefficient at the respective position in the second block is non-zero.
5 . The video encoding method of claim 4 , further comprising:
for the first block within the transform unit:
determining whether any coefficient not at the (0,0) position is non-zero by checking the respective significant-coefficient flag.
6 . The video encoding method of claim 4 , further comprising:
for a third block within the transform unit, that contains a position of a last non-zero coefficient in the transform unit:
not encoding a significant-CG flag;
encoding, for at least one position in the third block that is not the position of the last non-zero coefficient in the transform unit, a significant-coefficient flag into the bitstream, the significant-coefficient flag indicating whether a coefficient at the respective position in the third block is non-zero; and
not encoding a significant-coefficient flag for the position of the last non-zero coefficient in the transform unit.
7 . A decoding apparatus comprising at least one processor, the at least one processor configured to:
determine, for a first block within a transform unit, that the first block is not a block that contains a position of a DC coefficient in the transform unit;
in response to the determination that the first block is not the block that contains the position of the DC coefficient in the transform unit:
decode a significant-coefficient group flag (significant-CG flag) indicating that the first block has at least one non-zero coefficient by determining a context for the significant-CG flag to be either a first context or a second context, based on values of significant-CG flags corresponding to two blocks which are, respectively, adjacent to the right and below the first block, and wherein the context is determined to be the first context when the values of significant-CG flags of the two blocks are both zero and the context is determined to be the second context otherwise;
decode, for each position in the first block other than a (0,0) position in the first block, a significant-coefficient flag indicating whether a coefficient at the respective position in the first block is non-zero;
determine whether any coefficient not at the (0,0) position is non-zero;
in response to a determination that at least one coefficient not at the (0,0) position is non-zero, decode a significant-coefficient flag indicating whether a coefficient at the (0,0) position is non-zero; and
in response to a determination that all coefficients not at the (0,0) position are zero, not decode a significant-coefficient flag for the (0,0) position and infer that a coefficient at the (0,0) position is non-zero; and
determine for a second block within the transform unit, that the second block is the block that contains the position of the DC coefficient in the transform unit;
in response to the determination that the second block is the block that contains the position of the DC coefficient in the transform unit:
not decode a significant-CG flag; and
decode, for each position in the second block, a significant-coefficient flag indicating whether a coefficient at the respective position in the second block is non-zero.
8 . The decoding apparatus of claim 7 , the at least one processor further configured to: for the first block within the transform unit:
determine whether any coefficient not at the (0,0) position is non-zero by checking the respective significant-coefficient flag.
9 . The decoding apparatus of claim 7 , the at least one processor further configured to: for a third block within the transform unit, that contains a position of a last non-zero coefficient in the transform unit:
not decode a significant-CG flag;
decode, for at least one position in the third block that is not the position of the last non-zero coefficient in the transform unit, a significant-coefficient flag, the significant-coefficient flag indicating whether a coefficient at the respective position in the third block is non-zero; and
not decode a significant-coefficient flag for the position of the last non-zero coefficient in the transform unit.
10 . A video decoding method comprising:
determining, for a first block within a transform unit, that the first block is not a block that contains a position of a DC coefficient in the transform unit;
in response to the determination that the first block is not the block that contains the position of the DC coefficient in the transform unit:
decoding a significant-coefficient group flag (significant-CG flag) indicating that the first block has at least one non-zero coefficient by determining a context for the significant-CG flag to be either a first context or a second context, based on values of significant-CG flags corresponding to two blocks which are, respectively, adjacent to the right and below the first block, and wherein the context is determined to be the first context when the values of significant-CG flags of the two blocks are both zero and the context is determined to be the second context otherwise;
decoding, for each position in the first block other than a (0,0) position in the first block, a significant-coefficient flag indicating whether a coefficient at the respective position in the first block is non-zero;
determining whether any coefficient not at the (0,0) position is non-zero;
in response to a determination that at least one coefficient not at the (0,0) position is non-zero, decoding a significant-coefficient flag indicating whether a coefficient at the (0,0) position is non-zero; and
in response to a determination that all coefficients not at the (0,0) position are zero, not decoding a significant-coefficient flag for the (0,0) position, and inferring that a coefficient at the (0,0) position is non-zero; and
determining, for a second block within the transform unit, that the second block is the block that contains the position of the DC coefficient in the transform unit;
in response to the determination that the second block is the block that contains the position of the DC coefficient in the transform unit:
not decoding a significant-CG flag; and
decoding, for each position in the second block, a significant-coefficient flag indicating whether a coefficient at the respective position in the second block is non-zero.
11 . The decoding method of claim 10 , further comprising:
for the first block within the transform unit:
determining whether any coefficient not at the (0,0) position is non-zero by checking the respective significant-coefficient flag.
12 . The decoding method of claim 10 , further comprising:
for a third block within the transform unit, that contains a position of a last non-zero coefficient in the transform unit:
not decoding a significant-CG flag;
decoding, for at least one position in the third block that is not the position of the last non-zero coefficient in the transform unit, a significant-coefficient flag, the significant-coefficient flag indicating whether a coefficient at the respective position in the third block is non-zero; and
not decoding a significant-coefficient flag for the position of the last non-zero coefficient in the transform unit.