# US 12,120,297 B2 · Sample padding in adaptive loop filtering

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

- Number: US 12,120,297 B2
- Document ID: US12120297B2
- Status: Granted
- Kind: B2
- Application number: 18/155,216
- Filed: 2023-01-17
- Published: 2023-05-18
- Granted: 2024-10-15
- Earliest claimed: 2019-07-11
- Assignees: Beijing Bytedance Network Technology Co., Ltd.; Bytedance Inc.
- Applicants: Beijing Bytedance Network Technology Co., Ltd.; Bytedance Inc.
- Inventors: Li Zhang; Kai Zhang; Hongbin Liu; Yue Wang
- Web page: https://patentgrep.com/patent/US12120297B2

## CPC

- H04N 19/117: Filters, e.g. for pre-processing or post-processing (sub-band filter banks H04N19/635)
- H04N 19/174: the region being a slice, e.g. a line of blocks or a group of blocks
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N 19/182: the unit being a pixel
- H04N 19/82: involving filtering within a prediction loop
- H04N 19/96: Tree coding, e.g. quad-tree coding
- H04N 19/86: involving reduction of coding artifacts, e.g. of blockiness
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

A method of video processing includes determining, for a conversion between a block that is in a video picture of a video and a bitstream representation of the video, a manner of padding a first set of samples located across boundaries of multiple video regions of the video picture for a current sample in an adaptive loop filter process. The method also includes performing the conversion according to the determining.

## Claims

### Claim 1

A method of processing video data, comprising:
determining, for a conversion between a picture of a video comprising one or more coding tree blocks and a bitstream of the video, that a first sample is unavailable in a classification operation for a first filtering process for a current sample of a current coding tree block because the first sample is located in a slice that is different from a slice of the current sample and samples across slices are disallowed in the first filtering process, wherein all slices of the picture are rectangular slices;
applying a padding process for the first sample, wherein a value of the first sample is padded from a second sample which is a nearest available sample located within a same slice of the current sample, wherein the value of the first sample padded from the second sample is used to determine a classification filter index in the classification operation, wherein the classification filter index of a 4×4 region including the current sample is derived based on gradients calculated from a 10×10 region including the 4×4 region, wherein the value of the first sample padded from the second sample is also used in the filter of the first filtering process, and wherein a position of the second sample is determined based on:
when the first sample is unavailable due to a vertical coordinate of the first sample being outside of the same slice of the current sample, clipping the vertical coordinate of the first sample to a new vertical coordinate, which is a nearest vertical position located within the same slice of the current sample; and
when the first sample is unavailable due to a horizontal coordinate of the first sample being outside of the same slice of the current sample, clipping the horizontal coordinate of the first sample to a new horizontal coordinate, which is a nearest horizontal position located within the same slice of the current sample; and
performing the conversion by applying the first filtering process based on the value of the first sample padded from the second sample, wherein the first filtering process comprises:
determining, based on the classification operation, a filtering coefficient set for the current sample;
determining a clipping value set for the current sample; and
applying a filter on the current sample based on the filtering coefficient set and the clipping value set.

### Claim 2 (depends on 1)

The method of claim 1, wherein the padding process is applied in a uniform manner in case the current coding tree block coincides with other type of boundary which is not a slice boundary.

### Claim 3 (depends on 1)

The method of claim 1, wherein the method further comprises determining whether a virtual boundary is enabled for the current coding tree block based on a relationship between a bottom boundary of the current coding tree block and a bottom boundary of the picture.

### Claim 4 (depends on 3)

The method of claim 3, wherein the virtual boundary is enabled in case the bottom boundary of the current coding tree block is not the bottom boundary of the picture.

### Claim 5 (depends on 1)

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

### Claim 6 (depends on 1)

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

### Claim 7

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:
determine, for a conversion between a picture of a video comprising one or more coding tree blocks and a bitstream of the video, that a first sample for a current sample of a current coding tree block is unavailable in a classification operation for a first filtering process for a current sample of a current tree block because the first sample is located in a slice that is different from a slice of the current sample and samples across slices are disallowed in the first filtering process, wherein all slices of the picture are rectangular slices;
apply a padding process for the first sample, wherein a value of the first sample is padded from a second sample which is a nearest available sample located within a same slice of the current sample, wherein the value of the first sample padded from the second sample is used to determine a classification filter index in the classification operation, wherein the classification filter index of a 4×4 region including the current sample is derived based on gradients calculated from a 10×10 region including the 4×4 region, wherein the value of the first sample padded from the second sample is also used in the filter of the first filtering process, and wherein a position of the second sample is determined based on:
when the first sample is unavailable due to a vertical coordinate of the first sample being outside of the same slice of the current sample, clipping the vertical coordinate of the first sample to a new vertical coordinate, which is a nearest vertical position located within the same slice of the current sample; and
when the first sample is unavailable due to a horizontal coordinate of the first sample being outside of the same slice of the current sample, clipping the horizontal coordinate of the first sample to a new horizontal coordinate, which is a nearest horizontal position located within the same slice of the current sample; and
perform the conversion by applying the first filtering process based on the value of the first sample padded from the second sample, wherein the first filtering process comprises:
determining, based on the classification operation, a filtering coefficient set for the current sample;
determining a clipping value set for the current sample; and
applying a filter on the current sample based on the filtering coefficient set and the clipping value set.

### Claim 8 (depends on 7)

The apparatus of claim 7, wherein the padding process is applied in a uniform manner in case the current coding tree block coincides with other type of boundary which is not a slice boundary.

### Claim 9 (depends on 7)

The apparatus of claim 7, wherein the processor is further configured to:
determine whether a virtual boundary is enabled for the current coding tree block based on a relationship between a bottom boundary of the current coding tree block and a bottom boundary of the picture.

### Claim 10 (depends on 9)

The apparatus of claim 9, wherein the virtual boundary is enabled in case the bottom boundary of the current coding tree block is not the bottom boundary of the picture.

### Claim 11 (depends on 7)

The apparatus of claim 7, wherein the conversion includes encoding the video into the bitstream.

### Claim 12 (depends on 7)

The apparatus of claim 7, wherein the conversion includes decoding the video from the bitstream.

### Claim 13

A non-transitory computer-readable storage medium storing instructions that cause a processor to:
determine, for a conversion between a picture of a video comprising one or more coding tree blocks and a bitstream of the video, that a first sample for a current sample of a current coding tree block is unavailable in a classification operation for a first filtering process for a current sample of a current coding tree block because the first sample is located in a slice that is different from a slice of the current sample and samples across slices are disallowed in the first filtering process, wherein all slices of the picture are rectangular slices;
apply a padding process for the first sample, wherein a value of the first sample is padded from a second sample which is a nearest available sample located within a same slice of the current sample, wherein the value of the first sample padded from the second sample is used to determine a classification filter index in the classification operation, wherein the classification filter index of a 4×4 region including the current sample is derived based on gradients calculated from a 10×10 region including the 4×4 region, wherein the value of the first sample padded from the second sample is also used in the filter of the first filtering process, and wherein a position of the second sample is determined based on:
when the first sample is unavailable due to a vertical coordinate of the first sample being outside of the same slice of the current sample, clipping the vertical coordinate of the first sample to a new vertical coordinate, which is a nearest vertical position located within the same slice of the current sample; and
when the first sample is unavailable due to a horizontal coordinate of the first sample being outside of the same slice of the current sample, clipping the horizontal coordinate of the first sample to a new horizontal coordinate, which is a nearest horizontal position located within the same slice of the current sample; and
perform the conversion by applying the first filtering process based on the value of the first sample padded from the second sample, wherein the first filtering process comprises:
determining, based on the classification operation, a filtering coefficient set for the current sample;
determining a clipping value set for the current sample; and
applying a filter on the current sample based on the filtering coefficient set and the clipping value set.

### Claim 14 (depends on 13)

The non-transitory computer-readable storage medium of claim 13, wherein the padding process is applied in a uniform manner in case the current coding tree block coincides with other type of boundary which is not a slice boundary.

### Claim 15 (depends on 13)

The non-transitory computer-readable storage medium of claim 13, wherein the processor is further caused to determine whether a virtual boundary is enabled for the current coding tree block based on a relationship between a bottom boundary of the current coding tree block and a bottom boundary of the picture.

### Claim 16 (depends on 15)

The non-transitory computer-readable storage medium of claim 15, wherein the virtual boundary is enabled in case the bottom boundary of the current coding tree block is not the bottom boundary of the picture.

### Claim 17

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:
determining, for a picture of the video comprising one or more coding tree blocks, that a first sample for a current sample of a current coding tree block is unavailable in a classification operation for a first filtering process for a current sample of a current coding tree block because the first sample is located in a slice that is different from a slice of the current sample and samples across slices are disallowed in the first filtering process, wherein all slices of the picture are rectangular slices;
apply a padding process for the first sample, wherein a value of the first sample is padded from a second sample which is a nearest available sample located within a same slice of the current sample, wherein the value of the first sample padded from the second sample is used to determine a classification filter index in the classification operation, wherein the classification filter index of a 4×4 region including the current sample is derived based on gradients calculated from a 10×10 region including the 4×4 region, wherein the value of the first sample padded from the second sample is also used in the filter of the first filtering process, and wherein a position of the second sample is determined based on:
when the first sample is unavailable due to a vertical coordinate of the first sample being outside of the same slice of the current sample, clipping the vertical coordinate of the first sample to a new vertical coordinate, which is a nearest vertical position located within the same slice with the current sample; and
when the first sample is unavailable due to a horizontal coordinate of the first sample being outside of the same slice of the current sample, clipping the horizontal coordinate of the first sample to a new horizontal coordinate, which is a nearest horizontal position located within the same slice of the current sample; and
generating the bitstream by applying the first filtering process based on the value of the first sample padded from the second sample, wherein the first filtering process comprises:
determining, based on the classification operation, a filtering coefficient set for the current sample;
determining a clipping value set for the current sample; and
applying a filter on the current sample based on the filtering coefficient set and the clipping value set.

### Claim 18 (depends on 17)

The non-transitory computer-readable recording medium of claim 17, wherein the padding process is applied in a uniform manner in case the current coding tree block coincides with other type of boundary which is not a slice boundary.

### Claim 19 (depends on 17)

The non-transitory computer-readable recording medium of claim 17, wherein the method further comprises determining whether a virtual boundary is enabled for the current coding tree block based on a relationship between a bottom boundary of the current coding tree block and a bottom boundary of the picture.

### Claim 20 (depends on 19)

The non-transitory computer-readable recording medium of claim 19, wherein the virtual boundary is enabled in case the bottom boundary of the current coding tree block is not the bottom boundary of the picture.
