# US 2022/0286695 A1 · Neural Network-Based In-Loop Filter With Residual Scaling For Video Coding

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

- Number: US 2022/0286695 A1
- Document ID: US20220286695A1
- Status: Published application
- Kind: A1
- Application number: 17/681,427
- Filed: 2022-02-25
- Published: 2022-09-08
- Earliest claimed: 2021-03-04
- Assignees: Lemon Inc.
- Applicants: Lemon Inc.
- Inventors: Yue Li; Li Zhang; Kai Zhang
- Web page: https://patentgrep.com/patent/US20220286695A1

## CPC

- H04N 19/42: characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation (H04N19/635 takes precedence)
- H04N 19/117: Filters, e.g. for pre-processing or post-processing (sub-band filter banks H04N19/635)
- H04N 19/124: Quantisation
- 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/176: the region being a block, e.g. a macroblock
- H04N 19/186: the unit being a colour or a chrominance component
- H04N 19/30: using hierarchical techniques, e.g. scalability (H04N19/63 takes precedence)
- 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

A method implemented by a video coding apparatus. The method includes applying an output of a neural network (NN) filter to an unfiltered sample of a video unit to generate a residual, applying a scaling function to the residual to generate a scaled residual, adding another unfiltered sample to the scaled residual to generate a filtered sample, and converting between a video media file and a bitstream based on the filtered sample that was generated. A corresponding video coding apparatus and non-transitory computer readable medium are also disclosed.

## Claims

### Claim 1

A method implemented by a video coding apparatus, comprising:
applying an output of a neural network (NN) filter to an unfiltered sample of a video unit to generate a residual;
applying a scaling function to the residual to generate a scaled residual;
adding another unfiltered sample to the scaled residual to generate a filtered sample; and
converting between a video media file and a bitstream based on the filtered sample that was generated.

### Claim 2 (depends on 1)

The method of claim 1, further comprising reconstructing the unfiltered sample prior to generating the residual.

### Claim 3 (depends on 1)

The method of claim 1, wherein the filtered sample is generated according to Y=X+F(R), where X represents the unfiltered sample, R represents the residual determined based on the output of the NN filter, F represents the scaling function, and Y represents the filtered sample.

### Claim 4 (depends on 1)

The method of claim 1, wherein the filtered sample is generated according to Y=X+F(R, X), where X represents the unfiltered sample, R represents the residual determined based on the output of the NN filter, F represents the scaling function, and Y represents the filtered sample.

### Claim 5 (depends on 1)

The method of claim 1, wherein the filtered sample is generated according to Y=X+F(R−X), where X represents the unfiltered sample, R represents the residual determined based on the output of the NN filter, F represents the scaling function, and Y represents the filtered sample.

### Claim 6 (depends on 1)

The method of claim 1, wherein the filtered sample is generated according to Y=Clip(X+F(R)), where X represents the unfiltered sample, R represents the residual determined based on the output of the NN filter, F represents the scaling function, Clip represents a clipping function based on a bit depth of the unfiltered sample, and Y represents the filtered sample.

### Claim 7 (depends on 1)

The method of claim 1, wherein the scaling function is based on a linear model according to F(R)=α×R+β, where R represents the residual determined based on the output of the NN filter, F represents the scaling function, and α and β represent a pair of coefficient candidates (α, β).

### Claim 8 (depends on 1)

The method of claim 1, further comprising determining an inference block size to be used when the NN filter is applied to the unfiltered sample.

### Claim 9 (depends on 8)

The method of claim 8, further comprising selecting the inference block size from a plurality of inference block size candidates, wherein each of the plurality of inference block size candidates is based on at least one of a quantization parameter, a slice type, a picture type, a partition tree, and a color component.

### Claim 10 (depends on 1)

The method of claim 1, further comprising parsing the bitstream to obtain an indicator, wherein the indicator indicates which inference block size is to be used when the NN filter is applied to the unfiltered sample.

### Claim 11 (depends on 8)

The method of claim 8, wherein the inference block size has a first value for a first bit rate and a second value for a second bit rate, wherein the first value is higher than the second value, and wherein the first bit rate is lower than the second bit rate.

### Claim 12 (depends on 8)

The method of claim 8, wherein the inference block size has a first value for a first resolution and a second value for a second resolution, wherein the first value is higher than the second value, and wherein the first resolution is higher than the second resolution.

### Claim 13 (depends on 1)

The method of claim 1, wherein the NN filter is one of a plurality of NN filters whose outputs are applied to the unfiltered sample to generate the residual.

### Claim 14 (depends on 13)

The method of claim 13, wherein some of the plurality of NN filters use different inference block sizes when the outputs are applied to the unfiltered sample.

### Claim 15 (depends on 13)

The method of claim 13, wherein the outputs of the plurality of NN filters are individually weighted and applied to the unfiltered sample as a weighted sum.

### Claim 16 (depends on 13)

The method of claim 13, wherein a model and a weight corresponding to each of the plurality of NN filters is signaled in the bitstream.

### Claim 17 (depends on 13)

The method of claim 13, wherein a weight corresponding to each of the plurality of NN filters is based on one or more of a quantization parameter, a slice type, a picture type, a color component, a color format, and a temporal layer.

### Claim 18 (depends on 13)

The method of claim 13, wherein a weight corresponding to each of the plurality of NN filters is based on one or more of an NN filter model, an inference block size, or a spatial location of the unfiltered sample.

### Claim 19

An apparatus for coding 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:
apply an output of a neural network (NN) filter to an unfiltered sample of a video unit to generate a residual;
apply a scaling function to the residual to generate a scaled residual;
add another unfiltered sample to the scaled residual to generate a filtered sample; and
convert between a video media file and a bitstream based on the filtered sample that was generated.

### Claim 20

A non-transitory computer readable medium comprising a computer program product for use by a coding apparatus, the computer program product comprising computer executable instructions stored on the non-transitory computer readable medium that, when executed by one or more processors, cause the coding apparatus to:
apply an output of a neural network (NN) filter to an unfiltered sample of a video unit to generate a residual;
apply a scaling function to the residual to generate a scaled residual;
add another unfiltered sample to the scaled residual to generate a filtered sample; and
convert between a video media file and a bitstream based on the filtered sample that was generated.
