# US 8,542,730 B2 · Fast macroblock delta QP decision

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

- Number: US 8,542,730 B2
- Document ID: US8542730B2
- Status: Granted
- Kind: B2
- Application number: 12/389,693
- Filed: 2009-02-20
- Published: 2009-08-27
- Granted: 2013-09-24
- Earliest claimed: 2008-02-22
- Assignees: QUALCOMM Incorporated
- Applicants: Yan Ye; Marta Karczewicz; Peisong Chen
- Inventors: Yan Ye; Marta Karczewicz; Peisong Chen
- Web page: https://patentgrep.com/patent/US8542730B2

## CPC

- H04N 19/124: Quantisation
- H04N 19/147: according to rate distortion criteria (rate-distortion as a criterion for motion estimation H04N19/567)
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N 19/196: being specially adapted for the computation of encoding parameters, e.g. by averaging previously computed encoding parameters (processing of motion vectors H04N19/513)
- H04N 19/61: in combination with predictive coding
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

A system and method for encoding multimedia video is described. As video is encoded a quantization parameter is selected for each macroblock. As described herein, the quantization parameter for each macroblock may be selected by limiting the universe of all possible quantization parameters to a particular range of possible quantization parameter values. This increases the speed of video encoding by reducing the number of quantization parameters that are tested for each video macroblock.

## Claims

### Claim 1

A system for encoding video, comprising:
a storage containing a video frame comprising a macroblock, wherein the macroblock comprises a macroblock of a P-slice; and
a processor in communication with the storage, the processor configured to:
determine quantization parameters for a plurality of neighboring macroblocks of the macroblock in the same video frame as the macroblock;
determine an average of the quantization parameters for the neighboring macroblocks;
select a predicted quantization parameter based on the average of the quantization parameters for the neighboring macroblocks;
select a range of quantization parameters for quantizing the macroblock, wherein the range is a subset of possible quantization parameters and the range is based on the value of the predicted quantization parameter, wherein the range of quantization parameters comprises: [QPpred−2, QPpred+1], wherein QPpred is the value of the predicted quantization parameter;
determine a quantization parameter in the range which results in an optimal quantization of the macroblock; and
encode the macroblock using the determined quantization parameter.

### Claim 2 (depends on 1)

The system of claim 1, wherein the processor is configured to determine the quantization parameter comprises a cache of prior motion searches.

### Claim 3 (depends on 1)

The system of claim 1, wherein the processor is configured to determine the quantization parameter comprises a cache of intra mode decision results.

### Claim 4 (depends on 1)

The system of claim 1, wherein the storage comprises dynamic memory.

### Claim 5 (depends on 1)

The system of claim 1, wherein the storage comprises a hard disk.

### Claim 6 (depends on 1)

The system of claim 1, wherein the predicted quantization parameter is selected based on at least a value of a previously determined quantization parameter.

### Claim 7 (depends on 6)

The system of claim 6, wherein the previously determined quantization parameter is a quantization parameter for a preceding macroblock.

### Claim 8 (depends on 1)

The system of claim 1, wherein the average of the quantization parameters is determined using at least an average of quantization parameters of at least two neighboring macroblocks.

### Claim 9 (depends on 1)

The system of claim 1, wherein the average of the quantization parameters is determined using at least an average of quantization parameters of at least three neighboring macroblocks.

### Claim 10 (depends on 1)

The system of claim 1, wherein the average of the quantization parameters is determined using at least an average of quantization parameters of at least four neighboring macroblocks.

### Claim 11 (depends on 1)

The system of claim 1, wherein in an absence of one or more neighboring macroblocks, the predicted quantization parameter is selected based on a default quantization parameter value.

### Claim 12 (depends on 1)

The system of claim 1, wherein all possible quantization parameter values are used in the selection of the predicted quantization parameter when neighboring macroblocks are not available.

### Claim 13 (depends on 1)

The system of claim 1, wherein the quantization module further comprises a buffer storing the previously determined quantization parameter for each block.

### Claim 14 (depends on 1)

The system of claim 1, wherein the system is a cellular telephone.

### Claim 15 (depends on 1)

The system of claim 1, wherein the optimal quantization of the macroblock comprises a lowest rate-distortion cost for the macroblock.

### Claim 16

A system for encoding video, comprising:
means for receiving a video frame comprising a macroblock for quantization, wherein the received macroblock comprises a macroblock of a P-slice;
means for determining quantization parameters for a plurality of neighboring macroblocks of the macroblock in the same video frame as the macroblock;
means for determining an average of the quantization parameters for the neighboring macroblocks;
means for selecting a predicted quantization parameter based on the average of the quantization parameters for the neighboring macroblocks;
means for selecting a range of quantization parameters for quantizing the macroblock, wherein the range is a subset of possible quantization parameters and the range is based on the value of the predicted quantization parameter, wherein the range of quantization parameters comprises: [QPpred−2, QPpred+1], wherein QPpred is the value of the predicted quantization parameter;
means for determining a quantization parameter in the range which results in an optimal quantization of the macroblock; and
means for encoding the macroblock using the determined quantization parameter.

### Claim 17 (depends on 16)

The system of claim 16, wherein the means for selecting the range of quantization parameters comprises a cache of prior motion searches.

### Claim 18 (depends on 16)

The system of claim 16, wherein the means for selecting the range of quantization parameters comprises a cache of intra mode decision results.

### Claim 19 (depends on 16)

The system of claim 16, wherein the means for receiving the video frame comprises an electronic storage.

### Claim 20 (depends on 19)

The system of claim 19, wherein the electronic storage is a computer memory.

### Claim 21 (depends on 16)

The system of claim 16, wherein the predicted quantization parameter is selected based on at least a value of a previously determined quantization parameter.

### Claim 22 (depends on 21)

The system of claim 21, wherein the previously determined quantization parameter is a quantization parameter for a preceding macroblock.

### Claim 23 (depends on 16)

The system of claim 16, wherein the average of the quantization parameters is determined using at least an average of quantization parameters of at least two neighboring macroblocks.

### Claim 24 (depends on 16)

The system of claim 16, wherein the average of the quantization parameters is determined using at least an average of quantization parameters of at least three neighboring macroblocks.

### Claim 25 (depends on 16)

The system of claim 16, wherein the average of the quantization parameters is determined using at least an average of quantization parameters of at least four neighboring macroblocks.

### Claim 26 (depends on 16)

The system of claim 16, wherein in an absence of one or more neighboring macroblocks, the predicted quantization parameter is selected based on a default quantization parameter value.

### Claim 27 (depends on 16)

The system of claim 16, wherein all possible quantization parameter values are used in the selection of the predicted quantization parameter when neighboring macroblocks are not available.

### Claim 28 (depends on 16)

The system of claim 16, wherein the means for selecting comprises at least a part of a quantization parameter optimization module.

### Claim 29 (depends on 16)

The system of claim 16, wherein the means for determining comprises at least a part of a quantization parameter optimization module.

### Claim 30 (depends on 16)

The system of claim 16, wherein the means for encoding the macroblock comprises a video encoder.

### Claim 31 (depends on 16)

The system of claim 16, wherein the optimal quantization of the macroblock comprises a lowest rate-distortion cost for the macroblock.

### Claim 32

A method for encoding video, comprising the steps of:
receiving a video frame comprising a macroblock for quantization, wherein the received macroblock comprises a macroblock of a P-slice;
determining quantization parameters for a plurality of neighboring macroblocks of the macroblock in the same video frame as the macroblock;
determining an average of the quantization parameters for the neighboring macroblocks;
selecting a predicted quantization parameter based on the average of the quantization parameters for the neighboring macroblocks;
selecting a range of quantization parameters for quantizing the macroblock, wherein the range is a subset of possible quantization parameters and the range is based on the value of the predicted quantization parameter, wherein the range of quantization parameters comprises: [QPpred−2, QPpred+1], wherein QPpred is the value of the predicted quantization parameter;
determining a quantization parameter in the range which results in a lowest distortion value for the macroblock; and
encoding the macroblock using the determined quantization parameter.

### Claim 33 (depends on 32)

The method of claim 32, wherein the step of determining the quantization parameter includes the step of caching prior motion searches.

### Claim 34 (depends on 32)

The method of claim 32, wherein the step of determining the quantization parameter includes the step of caching intra mode decision results.

### Claim 35 (depends on 32)

The method of claim 32, further comprising the step of selecting the predicted quantization parameter based on at least a value of a previously determined quantization parameter.

### Claim 36 (depends on 35)

The method of claim 35, wherein the previously determined quantization parameter is a quantization parameter for a preceding macroblock.

### Claim 37 (depends on 32)

The method of claim 32, wherein the average of the quantization parameters is determined using at least an average of quantization parameters for one of at least two neighboring macroblocks, at least three neighboring macroblocks, and at least four neighboring macroblocks.

### Claim 38 (depends on 32)

The method of claim 32, wherein in an absence of one or more neighboring macroblocks, the predicted quantization parameter is selected based on a default quantization parameter value.

### Claim 39

A system for encoding video, comprising:
a storage containing a video frame comprising a macroblock, wherein the macroblock comprises a macroblock of a P-slice; and
a processor in communication with the storage, the processor configured to:
cache prior motion searches;
determine quantization parameters for a plurality of neighboring macroblocks of the macroblock in the same video frame as the macroblock;
determine an average of the quantization parameters for the neighboring macroblocks;
select a predicted quantization parameter based on the average of the quantization parameters for the neighboring macroblocks;
select a range of quantization parameters for quantizing the macroblock, wherein the range is a subset of possible quantization parameters and the range is based on the value of the predicted quantization parameter, wherein the range of quantization parameters comprises: [QPpred−2, QPpred+1], wherein QPpred is the value of the predicted quantization parameter;
determine a quantization parameter which results in an optimal quantization of the macroblock, based at least in part on at least one of the cached prior motion searches; and
encode the macroblock using the determined quantization parameter.

### Claim 40

A system for encoding video, comprising:
a storage containing a video frame comprising a macroblock, wherein the macroblock comprises a macroblock of a P-slice; and
a processor in communication with the storage, the processor configured to:
cache intra mode decision results;
determine quantization parameters for a plurality of neighboring macroblocks of the macroblock in the same video frame as the macroblock;
determine an average of the quantization parameters for the neighboring macroblocks;
select a predicted quantization parameter based on the average of the quantization parameters for the neighboring macroblocks;
select a range of quantization parameters for quantizing the macroblock, wherein the range is a subset of possible quantization parameters and the range is based on the value of the predicted quantization parameter, wherein the range of quantization parameters comprises: [QPpred−2, QPpred+1], wherein QPpred is the value of the predicted quantization parameter;
determine a quantization parameter which results in an optimal quantization of the macroblock, based at least in part on at least one of the cached intra mode decision results; and
encode the macroblock using the determined quantization parameter.

### Claim 41

A non-transitory computer readable storage medium comprising a computer readable program code adapted to be executed to perform a method comprising:
receiving a video frame comprising a macroblock for quantization, wherein the received macroblock comprises a macroblock of a P-slice;
determining quantization parameters for a plurality of neighboring macroblocks of the macroblock in the same video frame as the macroblock;
determining an average of the quantization parameters for the neighboring macroblocks;
selecting a predicted quantization parameter based on the average of the quantization parameters for the neighboring macroblocks;
selecting a range of quantization parameters for quantizing the macroblock, wherein the range is a subset of possible quantization parameters and the range is based on the value of the predicted quantization parameter, wherein the range of quantization parameters comprises: [QPpred−2, QPpred+1], wherein QPpred is the value of the predicted quantization parameter;
determining a quantization parameter in the range which results in a lowest distortion value for the macroblock; and
encoding the macroblock using the determined quantization parameter.

### Claim 42

A system for encoding video, comprising:
a storage containing a video frame comprising a macroblock, wherein the macroblock comprises a macroblock of a B-slice; and
a processor in communication with the storage, the processor configured to:
determine quantization parameters for a plurality of neighboring macroblocks of the macroblock in the same video frame as the macroblock;
determine an average of the quantization parameters for the neighboring macroblocks;
select a predicted quantization parameter based on the average of the quantization parameters for the neighboring macroblocks;
select a range of quantization parameters for quantizing the macroblock, wherein the range is a subset of possible quantization parameters and the range is based on the value of the predicted quantization parameter, wherein the range of quantization parameters comprises: [QPpred−1, QPpred+2], wherein QPpred is the value of the predicted quantization parameter;
determine a quantization parameter in the range which results in an optimal quantization of the macroblock; and
encode the macroblock using the determined quantization parameter.

### Claim 43

A system for encoding video, comprising:
means for receiving a video frame comprising a macroblock for quantization, wherein the received macroblock comprises a macroblock of a B-slice;
means for determining quantization parameters for a plurality of neighboring macroblocks of the macroblock in the same video frame as the macroblock;
means for determining an average of the quantization parameters for the neighboring macroblocks;
means for selecting a predicted quantization parameter based on the average of the quantization parameters for the neighboring macroblocks;
means for selecting a range of quantization parameters for quantizing the macroblock, wherein the range is a subset of possible quantization parameters and the range is based on the value of the predicted quantization parameter, wherein the range of quantization parameters comprises: [QPpred−1, QPpred+2], wherein QPpred is the value of the predicted quantization parameter;
means for determining a quantization parameter in the range which results in an optimal quantization of the macroblock; and
means for encoding the macroblock using the determined quantization parameter.

### Claim 44

A system for encoding video, comprising:
a storage containing a video frame comprising a macroblock, wherein the macroblock comprises a macroblock of a B-slice; and
a processor in communication with the storage, the processor configured to:
cache prior motion searches;
determine quantization parameters for a plurality of neighboring macroblocks of the macroblock in the same video frame as the macroblock;
determine an average of the quantization parameters for the neighboring macroblocks;
select a predicted quantization parameter based on the average of the quantization parameters for the neighboring macroblocks;
select a range of quantization parameters for quantizing the macroblock, wherein the range is a subset of possible quantization parameters and the range is based on the value of the predicted quantization parameter, wherein the range of quantization parameters comprises: [QPpred−2, QPpred+1], wherein QPpred is the value of the predicted quantization parameter;
determine a quantization parameter which results in an optimal quantization of the macroblock, based at least in part on at least one of the cached prior motion searches; and
encode the macroblock using the determined quantization parameter.

### Claim 45

A system for encoding video, comprising:
a storage containing a video frame comprising a macroblock, wherein the macroblock comprises a macroblock of a B-slice; and
a processor in communication with the storage, the processor configured to:
cache prior motion searches;
determine quantization parameters for a plurality of neighboring macroblocks of the macroblock in the same video frame as the macroblock;
determine an average of the quantization parameters for the neighboring macroblocks;
select a predicted quantization parameter based on the average of the quantization parameters for the neighboring macroblocks;
select a range of quantization parameters for quantizing the macroblock, wherein the range is a subset of possible quantization parameters and the range is based on the value of the predicted quantization parameter, wherein the range of quantization parameters comprises: [QPpred−2, QPpred+1], wherein QPpred is the value of the predicted quantization parameter;
determine a quantization parameter which results in an optimal quantization of the macroblock, based at least in part on at least one of the cached intra mode decision results; and
encode the macroblock using the determined quantization parameter.

### Claim 46

A system for encoding video, comprising:
a storage containing a video frame comprising a macroblock, wherein the macroblock comprises a macroblock of a B-slice; and
a processor in communication with the storage, the processor configured to:
cache intra mode decision results;
determine quantization parameters for a plurality of neighboring macroblocks of the macroblock in the same video frame as the macroblock;
determine an average of the quantization parameters for the neighboring macroblocks;
select a predicted quantization parameter based on the average of the quantization parameters for the neighboring macroblocks;
select a range of quantization parameters for quantizing the macroblock, wherein the range is a subset of possible quantization parameters and the range is based on the value of the predicted quantization parameter, wherein the range of quantization parameters comprises: [QPpred−1, QPpred+2], wherein QPpred is the value of the predicted quantization parameter;
determine a quantization parameter which results in an optimal quantization of the macroblock, based at least in part on at least one of the cached intra mode decision results; and
encode the macroblock using the determined quantization parameter.

### Claim 47

A non-transitory computer readable storage medium comprising a computer readable program code adapted to be executed to perform a method comprising:
receiving a video frame comprising a macroblock for quantization, wherein the received macroblock comprises a macroblock of a B-slice;
determining quantization parameters for a plurality of neighboring macroblocks of the macroblock in the same video frame as the macroblock;
determining an average of the quantization parameters for the neighboring macroblocks;
selecting a predicted quantization parameter based on the average of the quantization parameters for the neighboring macroblocks;
selecting a range of quantization parameters for quantizing the macroblock, wherein the range is a subset of possible quantization parameters and the range is based on the value of the predicted quantization parameter, wherein the range of quantization parameters comprises: [QPpred−1, QPpred+2], wherein QPpred is the value of the predicted quantization parameter;
determining a quantization parameter in the range which results in a lowest distortion value for the macroblock; and
encoding the macroblock using the determined quantization parameter.
