# US 11,451,782 B2 · Calculation in matrix-based intra prediction

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

- Number: US 11,451,782 B2
- Document ID: US11451782B2
- Status: Granted
- Kind: B2
- Application number: 17/342,996
- Filed: 2021-06-09
- Published: 2021-09-23
- Granted: 2022-09-20
- Earliest claimed: 2019-04-12
- Assignees: Beijing Bytedance Network Technology Co., Ltd.; Bytedance Inc.
- Applicants: Beijing Bytedance Network Technology Co., Ltd.; Bytedance Inc.
- Inventors: Zhipin Deng; Kai Zhang; Li Zhang; Hongbin Liu; Jizheng Xu
- Web page: https://patentgrep.com/patent/US11451782B2

## CPC

- H04N 19/11: among a plurality of spatial predictive coding modes
- 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/105: Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
- H04N 19/117: Filters, e.g. for pre-processing or post-processing (sub-band filter banks H04N19/635)
- 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/159: Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N 19/186: the unit being a colour or a chrominance component
- H04N 19/593: involving spatial prediction techniques
- H04N 19/60: using transform coding
- H04N 19/70: characterised by syntax aspects related to video coding, e.g. related to compression standards
- H04N 19/82: involving filtering within a prediction loop
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

Devices, systems and methods for digital video coding, which includes matrix-based intra prediction methods for video coding, are described. In a representative aspect, a method for video processing includes performing a conversion between a current video block of a video and a bitstream representation of the current video block using a matrix based intra prediction (MIP) mode in which a prediction block of the current video block is determined by performing, on previously coded samples of the video, a boundary downsampling operation, followed by a matrix vector multiplication operation, and selectively followed by an upsampling operation, where the performing the conversion includes deriving, according to a rule, boundary samples by applying a left bit shift operation or a right bit shift operation on a sum of at least one reference boundary sample, and where the rule determines whether to apply the left bit shift or the right bit shift operation.

## Claims

### Claim 1

A method of video processing, comprising:
performing a conversion between a current video block of a video and a bitstream of the current video block using a matrix based intra prediction (MIP) mode in which prediction samples of the current video block is determined by performing, on reference samples of the current video block, a boundary downsampling operation based on a size of the current video block, followed by a matrix vector multiplication operation, and selectively followed by an upsampling operation;
wherein the prediction samples are determined according to following formulas in the upsampling operation:
predSamples[xHor+dX][yHor]=((upHor−dX)*predSamples[xHor][yHor]+dX*predSamples[xHor+upHor][yHor]+offsetHor)/upHor, and
predSamples[xVer][yVer+dY]=((upVer−dY)*predSamples[xVer][yVer]+dY*predSamples[xVer][yVer+upVer]+offsetVer)/upVer,
wherein offsetHor and offsetVer are integers,
wherein upHor is a function of the current video block width and a pre-defined value based on the current video block size,
wherein upVer is a function of the current video block height and the pre-defined value based on the current video block size;
wherein dX is 1 . . . upHor−1,
wherein dY is 1 . . . upVer−1, and
wherein xHor are positions based on the upHor and yHor are positions based on the upVer.

### Claim 2 (depends on 1)

The method of claim 1, wherein offsetHor=upHor/2, and offsetVer=upVer/2.

### Claim 3 (depends on 1)

The method of claim 1, wherein the boundary downsampling operation includes deriving, according to a rule, boundary samples by applying a left bit shift operation or a right bit shift operation on a sum of at least one reference boundary sample, and wherein the rule determines whether to apply the left bit shift operation or the right bit shift operation.

### Claim 4 (depends on 3)

The method of claim 3, wherein the rule defines that the right bit shift operation is applied in response to a number of shifted bits being greater than zero.

### Claim 5 (depends on 4)

The method of claim 4, wherein the boundary samples redBdryS[x] are calculated using one of following equations:
redBdryS[x]=(Σi=0bDwn−1refS[x*bDwn+i]+(1<<(Log 2(bDwn)−1)))>>Log 2(bDwn), if bDwn>1, or
redBdryS[x]=refS[x] if bDwn=1,
wherein bDwn is equal to a function of the current video block size and a boundary size,
wherein refS [x] indicates a number of reference samples x,
wherein >> indicates the right bit shift operation, and
wherein <<indicates the left bit shift operation.

### Claim 6 (depends on 5)

The method of claim 5, wherein the boundary size is predefined based on the current video block size.

### Claim 7 (depends on 5)

The method of claim 5, wherein bDwn is calculated as bDwn=nTbs/boundarySize, wherein nTbs and boundarySize represent the current video block size and the boundary size, respectively.

### Claim 8 (depends on 1)

The method of claim 1, wherein the MIP mode includes multiple types, and a type index for the current video block is derived excluding referring to type indices of previous video blocks.

### Claim 9 (depends on 8)

The method of claim 8, wherein the type index for the current video block is explicitly included in the bitstream.

### Claim 10 (depends on 1)

The method of claim 1, wherein the conversion includes encoding the current video block into the bitstream.

### Claim 11 (depends on 1)

The method of claim 1, wherein the conversion includes decoding the current video block from the bitstream.

### Claim 12

An apparatus for processing video data comprising a processor and a non-transitory memory with instructions thereon, wherein the instructions upon execution by the processor, cause the processor to:
perform a conversion between a current video block of a video and a bitstream of the current video block using a matrix based intra prediction (MIP) mode in which prediction samples of the current video block is determined by performing, on reference samples of the current video block, a boundary downsampling operation based on a size of the current video block, followed by a matrix vector multiplication operation, and selectively followed by an upsampling operation;
wherein the prediction samples are determined according to following formulas in the upsampling operation:
predSamples[xHor+dX][yHor]=((upHor−dX)*predSamples[xHor][yHor]+dX*predSamples[xHor+upHor][yHor]+offsetHor)/upHor, and
predSamples[xVer][yVer+dY]=((upVer−dY)*predSamples[xVer][yVer]+dY*predSamples[xVer][yVer+upVer]+offsetVer)/upVer,
wherein offsetHor and offsetVer are integers,
wherein upHor is a function of the current video block width and a pre-defined value based on the current video block size,
wherein upVer is a function of the current video block height and the pre-defined value based on the current video block size;
wherein dX is 1 . . . upHor−1,
wherein dY is 1 . . . upVer−1, and
wherein xHor are positions based on the upHor and yHor are positions based on the upVer.

### Claim 13 (depends on 12)

The apparatus of claim 12, wherein offsetHor=upHor/2, and offsetVer=upVer/2.

### Claim 14 (depends on 12)

The apparatus of claim 12, wherein the boundary downsampling operation includes deriving, according to a rule, boundary samples by applying a left bit shift operation or a right bit shift operation on a sum of at least one reference boundary sample, and wherein the rule determines whether to apply the left bit shift operation or the right bit shift operation.

### Claim 15 (depends on 14)

The apparatus of claim 14, wherein the rule defines that the right bit shift operation is applied in response to a number of shifted bits being greater than zero.

### Claim 16 (depends on 15)

The apparatus of claim 15, wherein the boundary samples redBdryS[x] are calculated using one of following equations:
redBdryS[x]=(Σi=0bDwn−1refS[x*bDwn+i]+(1<<(Log 2(bDwn)−1)))>>Log 2(bDwn), if bDwn>1, or
redBdryS[x]=refS[x] if bDwn=1,
wherein bDwn is equal to a function of the current video block size and a boundary size,
wherein refS [x] indicates a number of reference samples x,
wherein >> indicates the right bit shift operation, and
wherein <<indicates the left bit shift operation.

### Claim 17 (depends on 16)

The apparatus of claim 16, wherein the boundary size is predefined based on the current video block size.

### Claim 18 (depends on 16)

The apparatus of claim 16, wherein bDwn is calculated as bDwn=nTbs/boundarySize, wherein nTbs and boundarySize represent the current video block size and the boundary size, respectively.

### Claim 19

A non-transitory computer-readable storage medium storing instructions that cause a processor to:
perform a conversion between a current video block of a video and a bitstream of the current video block using a matrix based intra prediction (MIP) mode in which prediction samples of the current video block is determined by performing, on reference samples of the current video block, a boundary downsampling operation based on a size of the current video block, followed by a matrix vector multiplication operation, and selectively followed by an upsampling operation;
wherein the prediction samples are determined according to following formulas in the upsampling operation:
predSamples[xHor+dX][yHor]=((upHor−dX)*predSamples[xHor][yHor]+dX*predSamples[xHor+upHor][yHor]+offsetHor)/upHor, and
predSamples[xVer][yVer+dY]=((upVer−dY)*predSamples[xVer][yVer]+dY*predSamples[xVer][yVer+upVer]+offsetVer)/upVer,
wherein offsetHor and offsetVer are integers,
wherein upHor is a function of the current video block width and a pre-defined value based on the current video block size,
wherein upVer is a function of the current video block height and the pre-defined value based on the current video block size;
wherein dX is 1 . . . upHor−1,
wherein dY is 1 . . . upVer−1, and
wherein xHor are positions based on the upHor and yHor are positions based on the upVer.

### Claim 20

A non-transitory computer-readable recording medium storing a bitstream of a video which is generated by a method performed by a video processing apparatus, wherein the method comprises:
generating the bitstream for a current video block of the video using a matrix based intra prediction (MIP) mode in which prediction samples of the current video block is determined by performing, on reference samples of the current video block, a boundary downsampling operation based on a size of the current video block, followed by a matrix vector multiplication operation, and selectively followed by an upsampling operation;
wherein the prediction samples are determined according to following formulas in the upsampling operation:
predSamples[xHor+dX][yHor]=((upHor−dX)*predSamples[xHor][yHor]+dX*predSamples[xHor+upHor][yHor]+offsetHor)/upHor, and
predSamples[xVer][yVer+dY]=((upVer−dY)*predSamples[xVer][yVer]+dY*predSamples[xVer][yVer+upVer]+offsetVer)/upVer,
wherein offsetHor and offsetVer are integers,
wherein upHor is a function of the current video block width and a pre-defined value based on the current video block size,
wherein upVer is a function of the current video block height and the pre-defined value based on the current video block size;
wherein dX is 1 . . . upHor−1,
wherein dY is 1 . . . upVer−1, and
wherein xHor are positions based on the upHor and yHor are positions based on the upVer.
