# US 2021/0092382 A1 · Method of context modeling for entropy coding of transform coefficient flags with transform skip, and coding method with the same

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0092382 A1
- Document ID: US20210092382A1
- Status: Published application
- Kind: A1
- Application number: 17/026,141
- Filed: 2020-09-18
- Published: 2021-03-25
- Earliest claimed: 2019-09-19
- Assignees: Tencent America LLC
- Applicants: Tencent America LLC
- Inventors: Cheung AUYEUNG; Xiang LI; Shan LIU
- Web page: https://patentgrep.com/patent/US20210092382A1

## CPC

- H04N 19/13: Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
- H04N 19/103: Selection of coding mode or of prediction mode
- H04N 19/132: Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
- H04N 19/157: Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
- H04N 19/182: the unit being a pixel
- H04N 19/91: Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
- H04N 19/12: Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

A versatile video coning method is provided for an electronic device. The method includes obtaining a video signal; partitioning the video signal into a plurality of coding blocks; generating a residual coding block from each coding block with or without transformation and quantization; splitting the residual coding block into a plurality of sub-blocks and each sub-block into a plurality of pixels; entropy coding a residual symbol level at each pixel in the residual coding block; and outputting a bitstream including entropy coded residual symbol levels. Entropy coding the residual symbol level at each pixel in the residual coding block includes context modeling of the residual symbol level of the pixel in a transform skip mode based on context information of at least three neighboring pixels of the pixel including a first pixel on the left, a second pixel on the above, and a third pixel on the left-above diagonal.

## Claims

### Claim 1

A versatile video coding (VVC) method for an electronic device, comprising:
obtaining a video signal;
partitioning the video signal into a plurality of coding blocks;
generating a residual coding block from each coding block with or without transformation and quantization;
splitting the residual coding block into a plurality of sub-blocks and each sub-block into a plurality of pixels;
entropy coding a residual symbol level at each pixel in the residual coding block; and
outputting a bitstream including entropy coded residual symbol levels,
wherein:
entropy coding the residual symbol level at each pixel in the residual coding block includes context modeling of the residual symbol level of the pixel in a transform skip mode based on context information of at least three neighboring pixels of the pixel including a first pixel on the left, a second pixel on the above, and a third pixel on the left-above diagonal in the residual coding block.

### Claim 2 (depends on 1)

The method of claim 1, wherein context modeling of the residual symbol level of the pixel in the transform skip mode based on the context information of the at least three neighboring pixels of the pixel includes:
scanning each pixel in each sub-block in a current transform block and using the context information of the at least three neighboring pixels of the pixel to code first scanning pass flags in the transform skip mode at each scanning position;
scanning each pixel in each sub-block in the current transform block and using the first scanning pass flags coded in a preceding scanning pass to code second scanning pass flags at each scanning position; and
scanning each pixel in each sub-block in the current transform block and using the first scanning pass flags and the second scanning pass flags coded in preceding scanning passes to code a remaining absolute value abs remainder of the transform coefficient in Golomb-Rice code at each scanning position.

### Claim 3 (depends on 2)

The method of claim 2, wherein:
the first scanning pass flags include a transform coefficient significant flag sig_coeff_flag, a transform coefficient sign flag coeff_sign_flag, a transform coefficient parity flag par_level_flag, and an absolute-level-greater-than-1 flag abs_level_gtx_flag[0]; and
the second scanning pass flags include an absolute-level-greater-than-x flag array abs_level_gtx_flag[i], wherein x=(i<<1)+1 for i=1, 2, 3, and 4.

### Claim 4 (depends on 3)

The method of claim 3, wherein:
the transform coefficient significant flag sig_coeff_flag specifies, for a transform coefficient located within the current transform block, whether a value of the transform coefficient at the location is non-zero, wherein when the value of the transform coefficient is non-zero, the transform coefficient significant flag is 1, and otherwise, the transform coefficient significant flag is 0;
the transform coefficient sign flag coeff_sign_flag specifies whether the sign of the transform coefficient having the non-zero value at the scanning position is negative or not, wherein when the sign is negative, the transform coefficient sign flag is 1, and otherwise, the transform coefficient sign flag is 0;
the transform coefficient level parity flag par_level_flag specifies the parity of a value of the transform coefficient at the scanning position;
the absolute-level-greater-than-1 flag abs_level_gtx_flag[0] specifies whether an absolute value of the transform coefficient at the scanning position is greater than 1, wherein when the absolute value is greater than 1, the absolute-level-greater-than-1 flag is 1, and otherwise, the absolute-level-greater-than-1 flag is 0; and
the absolute-level-greater-than-x flag array abs_level_gtx_flag[i] specifies whether the absolute value of the transform coefficient at the scanning position is greater than x, wherein x=(i<<1)+1 for i=1, 2, 3, and 4, when the absolute value is greater than x, the absolute-level-greater-than-x flag is 1, and otherwise, the absolute-level-greater-than-x flag is 0.

### Claim 5 (depends on 4)

The method of claim 4, wherein coding the transform coefficient significant flag sig_coeff_flag in the transform skip mode includes:
obtaining the transform coefficient significant flag of the first pixel leftSigFlag, the transform coefficient significant flag of the second pixel aboveSigFlag, and the transform coefficient significant flag of the third pixel diagonalSigFlag, wherein when any of the first pixel, the second pixel, the third pixel is not located in a current transform unit, the corresponding transform coefficient significant flag is assigned to a default value of zero;
classifying all possible values of (leftSigFlag, aboveSigFlag, diagonalSigFlag) into p classes with 3<p≤8 and assigning each class with a unique context increment offset number ctxIncOffset, such that 0≤ctxIncOffset≤p;
calculating a context index increment ctxInc, wherein ctxInc=k+ctxIncOffset, and k is a number of contexts of the transform coefficient significant flag in the transform skip mode;
calculating a context model index ctxIdx, wherein ctxIdx=ctxInc+ctxIdxOffset; and
using the context model index ctxIdx to code the transform coefficient significant flag sig_coeff_flag.

### Claim 6 (depends on 4)

The method of claim 4, wherein coding the transform coefficient significant flag sig_coeff_flag in the transform skip mode includes:
obtaining the transform coefficient significant flag of the first pixel leftSigFlag, the transform coefficient significant flag of the second pixel aboveSigFlag, and the transform coefficient significant flag of the third pixel diagonalSigFlag, wherein when any of the first pixel, the second pixel, the third pixel is not located in the current transform unit, the corresponding transform coefficient significant flag is assigned to a default value of zero;
classifying all possible values of (leftSigFlag, aboveSigFlag, diagonalSigFlag) into 4 classes and assigning each class with a unique context increment offset number ctxIncOffset as:
diagonalSigFlag
leftSigFlag
aboveSigFlag
0
1
0
0
0
0
0
1
1
3
1
0
1
3
1
1
2
2;
calculating a sum locNumSig of the leftSigFlag and the aboveSigFlag, wherein locNumSig=leftSigGlag+aboveSigFlag;
calculating a context index increment ctxInc, wherein ctxInc=60+((locNumSig=1)?2*diagnoalSigFlag+locNumSig:locNumSig);
calculating a context model index ctxIdx, wherein ctxIdx=ctxInc+ctxIdxOffset; and
using the context model index to code the transform coefficient significant flag sig_coeff_flag.

### Claim 7 (depends on 4)

The method of claim 4, wherein:
the method is applied to one luma transform unit of a transform unit;

### Claim 8 (depends on 4)

The method of claim 4, wherein:
the method is applied to one luma transform unit and one or more chroma transform units of the transform unit.

### Claim 9 (depends on 4)

The method of claim 4, wherein coding the transform coefficient sign flag coeff_sign_flag in the transform skip mode includes:
obtaining the sign of the transform coefficient of the first pixel leftSign, the sign of the transform coefficient of the second pixel aboveSign, and the sign of the transform coefficient of the third pixel diagSign, wherein when any of the first pixel, the second pixel, the third pixel is not located in the current transform unit, the corresponding sign of the transform coefficient is assigned to a default value of zero;
classifying all possible values of (leftSign, aboveSign, diagSign) into q classes with 3<q≤27 and assigning each class with a unique context increment offset number ctxIncOffset, such that 0≤ctxIncOffset<q;
calculating a context index increment ctxInc, wherein ctxInc=ctxIncOffset+(intra_bdpcm_flag=0?0:n), wherein intra_bdpcm_flag is a flag indicating whether BDPCM is applied to a current luma coding block at a location (x0, y0), i.e., in the transform skip mode, and when intra_bdpcm_flag is not present, it is inferred to be equal to 0;
calculating a context model index ctxIdx, wherein ctxIdx=ctxInc+ctxIdxOffset; and
using the context model index to code the transform coefficient sign flag coeff_sign_flag.

### Claim 10 (depends on 4)

The method of claim 4, wherein coding the transform coefficient sign flag coeff_sign_flag in the transform skip mode includes:
obtaining the sign of the transform coefficient of the first pixel leftSign, the sign of the transform coefficient of the second pixel aboveSign, and the sign of the transform coefficient of the third pixel diagSign, wherein when any of the first pixel, the second pixel, the third pixel is not located in the current transform unit, the corresponding sign of the transform coefficient is assigned to a default value of zero;
classifying all possible values of (leftSign, aboveSign, diagSign) into 5 classes and assigning each class with a unique context increment offset number ctxIncOffset as:
diagSign
(leftSign, aboveSign),
−1
0
1
(−1, −1), (−1, 0), (0, −1)
2
2
4
(−1, 1), (1, −1)
3
0
4
(0, 0)
4
0
3
(1, 1), (1, 0), (0, 1)
3
1
1;
calculating a context index increment ctxInc, wherein ctxInc=ctxIncOffset+(intra_bdpcm_flag=0?0:5), wherein intra_bdpcm_flag is a flag indicating whether BDPCM is applied to a current luma coding block at a location (x0, y0), i.e., in the transform skip mode, and when intra bdpcm_flag is not present, it is inferred to be equal to 0;
calculating a context model index ctxIdx, wherein ctxIdx=ctxInc+ctxIdxOffset; and
using the context model index to code the transform coefficient sign flag coeff_sign_flag.

### Claim 11 (depends on 4)

The method of claim 4, wherein coding the transform coefficient sign flag coeff_sign_flag in the transform skip mode includes:
obtaining the sign of the transform coefficient of the first pixel leftSign, the sign of the transform coefficient of the second pixel aboveSign, and the sign of the transform coefficient of the third pixel diagSign, wherein when any of the first pixel, the second pixel, the third pixel is not located in the current transform unit, the corresponding sign of the transform coefficient is assigned to a default value of zero;
classifying all possible values of (leftSign, aboveSign, diagSign) into 5 classes and assigning each class with a unique context increment offset number ctxIncOffset as:
diagSign
leftSign + aboveSign
−1
0
1
−2, −1
2
2
4
0
3
0
4
1, 2
3
1
1;
calculating a context index increment ctxInc, wherein ctxInc=ctxIncOffset+(intra_bdpcm_flag=0?0:5), wherein intra_bdpcm_flag is a flag indicating whether BDPCM is applied to a current luma coding block at a location (x0, y0), i.e., in the transform skip mode, and when intra_bdpcm_flag is not present, it is inferred to be equal to 0;
calculating a context model index ctxIdx, wherein ctxIdx=ctxInc+ctxIdxOffset; and
using the context model index to code the transform coefficient sign flag coeff_sign_flag.

### Claim 12 (depends on 4)

The method of claim 4, wherein coding the transform coefficient sign flag coeff_sign_flag includes:
obtaining the sign of the transform coefficient of the first pixel leftSign, the sign of the transform coefficient of the second pixel aboveSign, and the sign of the transform coefficient of the third pixel diagSign, wherein when any of the first pixel, the second pixel, the third pixel is not located in the current transform unit, the corresponding sign of the transform coefficient is assigned to a default value of zero;
classifying all possible values of (leftSign, aboveSign, diagSign) into 5 classes and assigning each class with a unique context increment offset number ctxIncOffset as:
diagSign
leftsign + aboveSign
−1
0
1
−2, −1
2
2
4
0
4
0
3
1, 2
3
1
1;
calculating a context index increment ctxInc, wherein ctxInc=ctxIncOffset+(intra_bdpcm_flag=0?0:5), wherein intra_bdpcm_flag is a flag indicating whether BDPCM is applied to a current luma coding block at a location (x0, y0), i.e., in the transform skip mode, and when intra_bdpcm_flag is not present, it is inferred to be equal to 0;
calculating a context model index (ctxIdx), wherein ctxIdx=ctxInc+ctxIdxOffset; and
using the context model index to code the transform coefficient sign flag coeff_sign_flag.

### Claim 13 (depends on 1)

The method of claim 1, wherein:
the plurality of sub-blocks are 4×4 or 2×2 sub-blocks.

### Claim 14

A versatile video coding (VVC) system, comprising an electronic device configured to perform:
obtaining a video signal;
partitioning the video signal into a plurality of coding blocks;
generating a residual coding block from each coding block with or without transformation and quantization;
splitting each residual coding block into a plurality of sub-blocks and each sub-block into a plurality of pixels;
entropy coding a residual symbol level at each pixel in each residual coding block; and
outputting a bitstream including entropy coded residual symbol levels, wherein:
entropy coding the residual symbol level at each pixel in the residual coding block includes context modeling of the residual symbol level of the pixel in a transform skip mode based on context information of at least three neighboring pixels of the pixel including a first pixel on the left, a second pixel on the above, and a third pixel on the left-above diagonal in the residual coding block.

### Claim 15 (depends on 14)

The system of claim 14, wherein context modeling of the residual symbol level of the pixel in the transform skip mode based on the context information of the at least three neighboring pixels of the pixel includes:
scanning each pixel in each sub-block in the current transform block and using the context information of the at least three neighboring pixels of the pixel to code first scanning pass flags in the transform skip mode at each scanning position;
scanning each pixel in each sub-block in the current transform block and using the first scanning pass flags coded in a preceding scanning pass to code second scanning pass flags at each scanning position; and
scanning each pixel in each sub-block in the current transform block and using the first scanning pass flags and the second scanning pass flags coded in preceding scanning passes to code a remaining absolute value abs remainder of the transform coefficient in Golomb-Rice code at each scanning position.

### Claim 16 (depends on 15)

The system of claim 15, wherein:
the first scanning pass flags include a transform coefficient significant flag sig_coeff_flag, a transform coefficient sign flag coeff_sign_flag, a transform coefficient parity flag par_level_flag, and an absolute-level-greater-than-1 flag abs_level_gtx_flag[0]; and
the second scanning pass flags include an absolute-level-greater-than-x flag array abs_level_gtx_flag[i], wherein x=(i<<1)+1 for i=1, 2, 3, and 4.

### Claim 17 (depends on 16)

The system of claim 16, wherein:
the transform coefficient significant flag sig_coeff_flag specifies, for a transform coefficient located within the current transform block, whether a value of the transform coefficient at the location is non-zero, wherein when the value of the transform coefficient is non-zero, the transform coefficient significant flag is 1, and otherwise, the transform coefficient significant flag is 0;
the transform coefficient sign flag coeff_sign_flag specifies whether the sign of the transform coefficient having the non-zero value at the scanning position is negative or not, wherein when the sign is negative, the transform coefficient sign flag is 1, and otherwise, the transform coefficient sign flag is 0;
the transform coefficient level parity flag par_level_flag specifies the parity of a value of the transform coefficient at the scanning position;
the absolute-level-greater-than-1 flag abs_level_gtx_flag[0] specifies whether an absolute value of the transform coefficient at the scanning position is greater than 1, wherein when the absolute value is greater than 1, the absolute-level-greater-than-1 flag is 1, and otherwise, the absolute-level-greater-than-1 flag is 0; and
the absolute-level-greater-than-x flag array abs_level_gtx_flag[i] specifies whether the absolute value of the transform coefficient at the scanning position is greater than x, wherein x=(i<<1)+1 for i=1, 2, 3, and 4, when the absolute value is greater than x, the absolute-level-greater-than-x flag is 1, and otherwise, the absolute-level-greater-than-x flag is 0.
