# US 12,003,785 B2 · Asymmetric deblocking in a video encoder and/or video decoder

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

- Number: US 12,003,785 B2
- Document ID: US12003785B2
- Status: Granted
- Kind: B2
- Application number: 18/132,889
- Filed: 2023-04-10
- Published: 2023-10-05
- Granted: 2024-06-04
- Earliest claimed: 2018-11-08
- Assignees: Telefonaktiebolaget LM Ericsson (publ)
- Applicants: Telefonaktiebolaget LM Ericsson (publ)
- Inventors: Kenneth Andersson; Jack Enhorn; Zhi Zhang
- Web page: https://patentgrep.com/patent/US12003785B2

## CPC

- H04N 19/117: Filters, e.g. for pre-processing or post-processing (sub-band filter banks H04N19/635)
- H04N 19/865: {with detection of the former encoding block subdivision in decompressed video}
- H04N 19/136: Incoming video signal characteristics or properties
- 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/182: the unit being a pixel
- H04N 19/86: involving reduction of coding artifacts, e.g. of blockiness
- H04N 19/96: Tree coding, e.g. quad-tree coding
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

An asymmetric deblocking method for deblocking a boundary between a P block and a Q block such that 5 samples within the P block and 7 or 3 samples within the Q block are modified. The method includes determining a value refP based on at least p5, determining a value refQ based on at least qx, wherein qx is q3 or q7; determining a value refMiddle based on at least p0 and q0, wherein p0 is directly adjacent to the boundary and q0 is directly adjacent to the boundary; performing a linear interpolation between refP and refMiddle; and performing a linear interpolation between refQ and refMiddle.

## Claims

### Claim 1

A method for filtering sample values, the method comprising:
obtaining a set of sample values, the set of sample values comprising the following sample values: p5, p4, p3, p2, p1, p0, q0, q1, q2, q3, q4, q5, q6, and q7;
determining a value refP, wherein refP is equal to: (p5+p4+1)>>1;
determining a value refQ, wherein
i) when a maximum filter length value (maxLengthQ) is equal to 3, refQ is equal to: (q3+q2+1)>>1, or
ii) when maxLengthQ is equal to 7, refQ is equal to: (q7+q6+1)>>1;
determining a value refMiddle, wherein
i) in the case that refQ is equal to (q3+q2+1)>>1, refMiddle is equal: to (p3+p2+p1+p0+q0+q1+q2+q3+4)>>3, or
ii) in the case that refQ is equal to (q7+q6+1)>>1, refMiddle is equal to: (p5+p4+p3+p2+2*(p1+p0+q0+q1)+q2+q3+q4+q5+8)>>4);
calculating a filtered sample value p0′, wherein p0′ is equal to: (refMiddle*f0+refP*(64−f0)+32)>>6, where f0=58; and
calculating a filtered sample value q0′, wherein q0′ is equal to (refMiddle*g0+refQ*(64−g0)+32)>>6, where g0=59 or g0=53.

### Claim 2 (depends on 1)

The method of claim 1, wherein
sample values p0 to p5 correspond to six samples that are aligned in a row that is orthogonal to a vertical boundary, and
samples q0 to q7 correspond to eight samples that are aligned in the row.

### Claim 3 (depends on 1)

The method of claim 1, wherein
sample values p0 to p5 correspond to six samples that are aligned in a column that is orthogonal to a horizontal boundary, and
samples q0 to q7 correspond to eight samples that are aligned in the column.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
determining that the value p0′ is not less than a first threshold and not greater than a second threshold; and
as a result of determining that the value p0′ is not less than the first threshold and not greater than the second threshold, replacing the value p0 with the value p0′.

### Claim 5 (depends on 4)

The method of claim 4, further comprising:
determining that the value q0′ is not less than a third threshold and not greater than a fourth threshold; and
as a result of determining that the value q0′ is not less than the third threshold and not greater than the fourth threshold, replacing the value q0 with the value q0′.

### Claim 6 (depends on 5)

The method of claim 5, further comprising:
calculating a filtered sample value p1′, wherein p1′ is equal to: (refMiddle*f1+refP*(64−f1)+32)>>6, where f1=45; and
calculating a filtered sample value q1′, wherein q1′ is equal to (refMiddle*g1+refQ*(64−g1)+32)>>6, where g1=50 or g1=32.

### Claim 7 (depends on 6)

The method of claim 6, further comprising:
determining that the value p1′ is not less than the first threshold and not greater than the second threshold; and
as a result of determining that the value p1′ is not less than the first threshold and not greater than the second threshold, replacing the value p1 with the value p1′.

### Claim 8 (depends on 7)

The method of claim 7, further comprising:
determining that the value q1′ is not less than the third threshold and not greater than the fourth threshold; and
as a result of determining that the value q1′ is not less than the third threshold and not greater than the fourth threshold, replacing the value q1 with the value q1′.

### Claim 9 (depends on 1)

The method of claim 1, wherein
obtaining the set of sample values comprising obtaining a matrix of sample values, wherein the matrix of sample values comprise the set of sample values, and
sample value p0 is immediately adjacent to sample value q0 within the matrix of sample values.

### Claim 10 (depends on 1)

A computer program product comprising a non-transitory computer readable medium storing a computer program comprising instructions which when executed by processing circuitry causes the processing circuitry to perform the method of claim 1.

### Claim 11

An apparatus for filtering sample values, the apparatus comprising:
processing circuitry; and
a memory, wherein the apparatus is configured to:
obtain a set of sample values, the set of sample values comprising the following sample values: p5, p4, p3, p2, p1, p0, q0, q1, q2, q3, q4, q5, q6, and q7;
determine a value refP, wherein refP is equal to: (p5+p4+1)>>1;
determine a value refQ, wherein
i) when a maximum filter length value (maxLengthQ) is equal to 3, refQ is equal to: (q3+q2+1)>>1, or
ii) when maxLengthQ is equal to 7, refQ is equal to: (q7+q6+1)>>1;
determine a value refMiddle, wherein
i) in the case that refQ is equal to (q3+q2+1)>>1, refMiddle is equal: to (p3+p2+p1+p0+q0+q1+q2+q3+4)>>3, or
ii) in the case that refQ is equal to (q7+q6+1)>>1, refMiddle is equal to: (p5+p4+p3+p2+2*(p1+p0+q0+q1)+q2+q3+q4+q5+8)>>4);
calculate a filtered sample value p0′, wherein p0′ is equal to: (refMiddle*f0+refP*(64−f0)+32)>>6, where f0=58; and
calculate a filtered sample value q0′, wherein q0′ is equal to (refMiddle*g0+refQ*(64−g0)+32)>>6, where g0=59 or g0=53.

### Claim 12 (depends on 11)

The apparatus of claim 11, wherein
sample values p0 to p5 correspond to six samples that are aligned in a row that is orthogonal to a vertical boundary, and
samples q0 to q7 correspond to eight samples that are aligned in the row.

### Claim 13 (depends on 11)

The apparatus of claim 11, wherein
sample values p0 to p5 correspond to six samples that are aligned in a column that is orthogonal to a horizontal boundary, and
samples q0 to q7 correspond to eight samples that are aligned in the column.

### Claim 14 (depends on 11)

The apparatus of claim 11, wherein the apparatus is further configured to:
determine whether the value p0′ is not less than a first threshold and not greater than a second threshold; and
as a result of determining that the value p0′ is not less than the first threshold and not greater than the second threshold, replace the value p0 with the value p0′.

### Claim 15 (depends on 14)

The apparatus of claim 14, wherein the apparatus is further configured to:
determine whether the value q0′ is not less than a third threshold and not greater than a fourth threshold; and
as a result of determining that the value q0′ is not less than the third threshold and not greater than the fourth threshold, replace the value q0 with the value q0′.

### Claim 16 (depends on 15)

The apparatus of claim 15, wherein the apparatus is further configured to:
calculate a filtered sample value p1′, wherein p1′ is equal to: (refMiddle*f1+refP*(64−f1)+32)>>6, where f1=45; and
calculate a filtered sample value q1′, wherein q1′ is equal to (refMiddle*g1+refQ*(64−g1)+32)>>6, where g1=50 or g1=32.

### Claim 17 (depends on 16)

The apparatus of claim 16, wherein the apparatus is further configured to:
determine whether the value p1′ is not less than the first threshold and not greater than the second threshold; and
as a result of determining that the value p1′ is not less than the first threshold and not greater than the second threshold, replace the value p1 with the value p1′.

### Claim 18 (depends on 17)

The apparatus of claim 17, wherein the apparatus is further configured to:
determine whether the value q1′ is not less than the third threshold and not greater than the fourth threshold; and
as a result of determining that the value q1′ is not less than the third threshold and not greater than the fourth threshold, replace the value q1 with the value q1′.

### Claim 19 (depends on 11)

The apparatus of claim 11, wherein
obtaining the set of sample values comprising obtaining a matrix of sample values, wherein the matrix of sample values comprise the set of sample values, and
sample value p0 is immediately adjacent to sample value q0 within the matrix of sample values.
