# US 10,321,135 B2 · Method and apparatus for real-time SAO parameter estimation

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

- Number: US 10,321,135 B2
- Document ID: US10321135B2
- Status: Granted
- Kind: B2
- Application number: 15/970,497
- Filed: 2018-05-03
- Published: 2018-09-06
- Granted: 2019-06-11
- Earliest claimed: 2013-07-30
- Assignees: Texas Instruments Incorporated
- Applicants: Texas Instruments Incorporated
- Inventors: Hrushikesh Tukaram Garud; Mihir Narendra Mody; Soyeb Nagori
- Web page: https://patentgrep.com/patent/US10321135B2

## CPC

- H04N 19/147: according to rate distortion criteria (rate-distortion as a criterion for motion estimation H04N19/567)
- H04N 19/117: Filters, e.g. for pre-processing or post-processing (sub-band filter banks H04N19/635)
- H04N 19/149: by estimating the code amount by means of a model, e.g. mathematical model or statistical model
- 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: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

The disclosure provides a sample adaptive offset (SAO) encoder. The SAO encoder includes a statistics collection (SC) block and a rate distortion optimization (RDO) block coupled to the SC block. The SC block receives a set of deblocked pixels and a set of original pixels. The SC block categorizes each deblocked pixel of the set of deblocked pixels in at least one of a plurality of band and edge categories. The SC block estimates an error in each category as difference between a deblocked pixel of the set of deblocked pixels and corresponding original pixel of the set of original pixels. The RDO block determines a set of candidate offsets associated with each category and selects a candidate offset with a minimum RD cost. The minimum RD cost is used by a SAO type block and a decision block to generate final offsets for the SAO encoder.

## Claims

### Claim 1

A method to encode video input data using a sample adaptive offset (SAO) video encoder, the method comprising:
receiving a set of original pixels at a first input of the SAO video encoder;
receiving a set of deblocked pixels at a second input of the SAO video encoder;
for a plurality of categories that includes band categories and edge categories, categorizing each of the deblocked pixels into at least one band category and into at least one edge category;
after categorizing each of the deblocked pixels, for each category:
determining a count of deblocked pixels in the category;
estimating an error based on a difference between a deblocked pixel of the set of deblocked pixels and a corresponding original pixel of the set of original pixels;
determining a set of candidate offsets associated with the category, wherein each candidate offset of the set of candidate offsets is a value ranging from a minimum offset and a maximum offset;
estimating a rate distortion (RD) cost associated with each candidate offset of the set of candidate offsets for the category; and
determining a minimum RD cost of the estimated RD costs for the category; and
using the minimum RD cost for each category to encode the video input data.

### Claim 2 (depends on 1)

The method of claim 1, wherein estimating the RD cost associated with each candidate offset for the category is based upon the count of deblocked pixels in the category and an absolute value of the estimated error for the category.

### Claim 3 (depends on 1)

The method of claim 1, wherein estimating the RD cost associated with each candidate offset for each category is based on bitrate data from a look-up table stored in the SAO video encoder.

### Claim 4 (depends on 1)

The method of claim 1, further comprising, after estimating the error:
determining a sign of the estimated error for each category; and
modifying a sign of a candidate offset corresponding to the estimated RD cost that is determined to be the minimum RD cost based on the sign of the estimated error of the category containing the candidate offset corresponding to the estimated RD cost that is determined to be the minimum RD cost.

### Claim 5 (depends on 1)

The method of claim 1, further comprising, after determining the minimum RD cost for each category:
generating a set of band SAO types, wherein each band SAO type is generated by combining two or more of the band categories;
generating a set of edge SAO types, wherein each edge SAO type is generated by combining two or more of the edge categories;
for each band SAO type, estimating a band cost by summing together the minimum RD cost associated with each band category that is combined to generate the band SAO type;
for each edge SAO type, estimating an edge cost by summing together the minimum RD cost associated with each edge category that is combined to generate the edge SAO type; and
determine a minimum band cost of the estimated band costs;
determine one or more offsets for encoding the video input data based upon:
the minimum band cost;
the candidate offsets associated with each band category that is combined to generate the band SAO type having the estimated band cost that is the minimum band cost;
the edge cost associated with each edge SAO type; and
the candidate offsets associated with each edge category used to generate the edge SAO types.

### Claim 6 (depends on 5)

The method of claim 5, wherein estimating the minimum band cost is performed using bitrate data from a look-up table stored in the SAO video encoder.

### Claim 7 (depends on 5)

The method of claim 5, wherein:
when the set of deblocked pixels corresponds to a luma component of a current largest coding unit (LCU) of the video input data, the minimum band cost is a luma minimum band cost and the edge cost associated with each edge SAO type is a luma edge cost; and
when the set of deblocked pixels corresponds to a chroma component of the current LCU, the minimum band cost is a chroma minimum band cost and the edge cost associated with each edge SAO type is a chroma edge cost.

### Claim 8 (depends on 7)

The method of claim 7, wherein:
when the set of deblocked pixels corresponds to the luma component of the current LCU, the candidate offsets associated with the minimum band cost are candidate offsets corresponding to the luma minimum band cost and the candidate offsets associated with each edge category used to generate the edge SAO types are candidate offsets corresponding to each luma edge cost; and
when the set of deblocked pixels corresponds to the chroma component of the current LCU, the candidate offsets associated with the minimum band cost are candidate offsets corresponding to the chroma minimum band cost and the candidate offsets associated with each edge category used to generate the edge SAO types are candidate offsets corresponding to each chroma edge cost.

### Claim 9 (depends on 8)

The method of claim 8, further comprising:
estimating a left merge cost associated with a current largest coding unit (LCU) based on final offsets corresponding to a final left SAO type associated with a left LCU;
estimating a top merge cost associated with the current LCU based on final offsets corresponding to a final top SAO type associated with a top LCU; and
determining the one or more offsets for encoding the video input data based additionally upon the left merge cost and the top merge cost.

### Claim 10 (depends on 9)

The method of claim 9, wherein:
when the set of deblocked pixels corresponds to the luma component of the current LCU, the left merge cost is a luma left merge cost and the top merge cost is a luma top merge cost; and
when the set of deblocked pixels corresponds to the chroma component of the current LCU, the left merge cost is a chroma left merge cost and the top merge cost is a chroma top merge cost.

### Claim 11 (depends on 9)

The method of claim 9, wherein each of the final left SAO type and the final top SAO type comprises a final luma SAO type and a final chroma SAO type.

### Claim 12 (depends on 10)

The method of claim 10, further comprising:
selecting a minimum of the luma minimum band cost, the luma edge cost associated with each edge SAO type, and a SAO disable cost to generate a best luma cost;
selecting a minimum of the chroma minimum band cost, the chroma edge cost associated with each edge SAO type and the SAO disable cost to generate a best chroma cost;
summing the best luma cost and the best chroma cost to generate a joint cost;
summing the luma left merge cost and the chroma left merge cost to generate a joint left merge cost;
summing the luma top merge cost and the chroma top merge cost to generate a joint top merge cost; and
selecting a minimum of the joint cost, the joint left merge cost and the joint top merge cost to generate a final cost.

### Claim 13 (depends on 12)

The method of claim 12, wherein:
offsets corresponding to the best luma cost are best luma offsets; and
offsets corresponding to the best chroma cost are best chroma offsets.

### Claim 14 (depends on 13)

The method of claim 13, wherein:
the best luma offsets include at least one of offsets corresponding to the SAO disable cost, the candidate offsets corresponding to the luma minimum band cost, and the candidate offsets corresponding to each luma edge cost; and
the best chroma offsets comprise at least one of offsets corresponding to the SAO disable cost, the candidate offsets corresponding to the chroma minimum band cost, and the candidate offsets corresponding to each chroma edge cost.

### Claim 15 (depends on 14)

The method of claim 14, wherein the one or more offsets for encoding the video input data are:
selected as the final offsets corresponding to the final left SAO type associated with the left LCU when the final cost is equal to the joint left merge cost;
selected as the final offsets corresponding to the final top SAO type associated with the top LCU when the final cost is equal to the joint top merge cost; and
selected as the best luma offsets and the best chroma offsets when the final cost is equal to the joint cost.

### Claim 16

A video encoding system comprising:
an input to receive video input data;
a memory to store instructions for encoding the video input data; and
a processor configured to execute the instructions to encode the video input data by:
sorting each deblocked pixel of a set of deblocked pixels into at least one of a plurality of categories and determining an estimated error for each category;
for each category, determining a set of candidate offsets, estimating a rate distortion (RD) cost associated with each candidate offset, and determining a minimum RD cost of the estimated RD costs; and
encoding the video input data based upon the minimum RD cost.

### Claim 17 (depends on 16)

The video encoding system of claim 16, wherein the plurality of categories includes a plurality of edge categories and a plurality of band categories, and wherein each deblocked pixel is sorted into at least one edge category and at least one band category.

### Claim 18 (depends on 16)

The video encoding system of claim 16, wherein the encoding is based on sample adaptive offset (SAO) video encoding.

### Claim 19 (depends on 16)

The video encoding system of claim 16, wherein the processor comprises a digital signal processor.

### Claim 20 (depends on 16)

The video encoding system of claim 16, wherein the processor is configured to execute the instructions to encode the video input data by:
determining a sign of the estimated error in each category; and
modifying a sign of a candidate offset corresponding to the estimated RD cost that is determined to be the minimum RD cost based on the sign of the estimated error of the category containing the candidate offset corresponding to the estimated RD cost that is determined to be the minimum RD cost.
