# US 2006/0039470 A1 · Adaptive motion estimation and mode decision apparatus and method for H.264 video codec

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

- Number: US 2006/0039470 A1
- Document ID: US20060039470A1
- Status: Published application
- Kind: A1
- Application number: 10/976,781
- Filed: 2004-11-01
- Published: 2006-02-23
- Earliest claimed: 2004-08-19
- Assignees: Korea Electronics Technology Institute
- Inventors: Yong-Hwan Kim; Je-Woo Kim; Hyeok-Koo Jung; Joonki Paik
- Web page: https://patentgrep.com/patent/US20060039470A1

## CPC

- H04N 19/567: Motion estimation based on rate distortion criteria
- H04N 19/57: Motion estimation characterised by a search window with variable size or shape
- H04N 5/145: {Movement estimation (for video coding H04N19/51)}
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

Disclosed herein is an adaptive motion estimation and mode decision apparatus and method for an H.264 video codec. The apparatus includes a background image detection unit, an inter mode inspection unit, an intra mode inspection unit and a mode inspection skip unit. The background image detection unit inspects whether a fixed background or slowly and regularly moving block exists, and skips the step of dividing a first corresponding macroblock into smaller sized blocks and performing block mode inspection. The inter mode inspection unit inspects whether an irregularly or fast moving macroblock exists, and determines whether to divide a corresponding macroblock into smaller sized blocks and to perform block mode inspection on the smaller sized blocks. The intra mode inspection unit performs AZCB inspection on the macroblocks, and determines whether to divide a corresponding macroblock into smaller sized blocks block and to perform mode inspection on the smaller sized blocks. The mode inspection skip unit skips the block mode inspection for the smaller sized blocks.

## Claims

### Claim 1

An adaptive motion estimation and mode decision apparatus for an H.264 video codec, comprising:
a background image detection unit for inspecting whether a macroblock corresponding to a fixed background or slowly and regularly moving image exists, and skipping the step of dividing a corresponding macroblock into smaller sized blocks and performing block mode inspection;
an inter mode inspection unit for inspecting whether an irregularly or fast moving macroblock exists by performing All Zero Coefficients Block (AZCB) inspection for an inter mode on macroblocks other than the macroblock detected by the background image detection unit, and determining whether to divide a corresponding macroblock into smaller sized blocks and to perform block mode inspection on the smaller sized blocks;
an intra mode inspection unit for performing AZCB inspection for an intra mode on the macroblocks and determining whether to divide a corresponding macroblock into smaller sized blocks block and to perform mode inspection on the smaller sized blocks; and
a mode inspection skip unit for skipping the block mode inspection for the smaller sized blocks of the macroblock if it is determined that the block mode inspection for the smaller sized blocks of the macroblock will be skipped by the background image detection unit, the inter mode inspection unit and the intra mode inspection unit.

### Claim 2 (depends on 1)

The apparatus as set forth in claim 1, wherein the background image detection unit inspects whether the fixed background or slowly and regularly moving macroblock exists by performing AZCB inspection for a SKIP mode.

### Claim 3 (depends on 1)

The apparatus as set forth in claim 1, wherein the AZCB is generated using quantization or coefficient thresholding technique.

### Claim 4 (depends on 3)

The apparatus as set forth in claim 3, wherein the coefficient thresholding technique generates the AZCB using following Equations,
cc
⁡
(
i
,
j
)
=
{
∞
⁢
⁢
if
⁢
⁢
level
⁡
(
i
,
j
)
>
1
3
⁢
⁢
if
⁢
⁢
level
⁡
(
i
,
j
)
=
1
⁢
⁢
and
⁢
⁢
run_before
=
0
2
⁢
⁢
if
⁢
⁢
level
⁡
(
i
,
j
)
=
1
⁢
⁢
and
⁢
⁢
1
≤
run_before
≤
2
1
⁢
⁢
if
⁢
⁢
level
⁡
(
i
,
j
)
=
1
⁢
⁢
and
⁢
⁢
3
≤
run_before
≤
5
0
⁢
⁢
otherwise
⁢
⁢
and
⁢
⁢
C
⁢
⁢
8
=
∑
i
=
0
3
⁢
⁢
∑
j
=
0
15
⁢
⁢
cc
⁡
(
i
,
j
)
,
⁢
C
⁢
⁢
16
=
∑
i
=
0
3
⁢
⁢
C
⁢
⁢
8
⁢
(
i
)
,
⁢
AZCB
⁡
(
Block
⁢
⁢
8
×
8
)
=
{
1
⁢
⁢
if
⁢
⁢
C
⁢
⁢
8
≤
T
C
⁢
⁢
8
0
⁢
⁢
otherwise
,
⁢
AZCB
⁡
(
Block
⁢
⁢
16
×
16
)
=
{
1
⁢
⁢
if
⁢
⁢
C
⁢
⁢
16
≤
T
C
⁢
⁢
16
0
⁢
⁢
otherwise
,
where cc(i,j) is a coefficient cost function, level(i,j) is an absolute value of the coefficient, run_before is a number of successive zero coefficients located before a coefficient other than zero, TC8 and TC16 are threshold values for determining 8×8 and 16×16 blocks to be the AZCBS, respectively, and C8 and C16 are total coefficient cost values of the 8×8 and 16×16 blocks, respectively.

### Claim 5 (depends on 1)

The apparatus as set forth in claim 1, wherein the inter mode inspection unit performs motion vector search, Rate-Distortion cost (RDcost), and AZCB inspection for a P16×16 mode of the macroblock, performs motion vector search, Rdcost, and AZCB inspection for a P8×8 mode of the macroblock if it is determined that inspection will be required on smaller blocks for the P16×16 mode, and performs the motion vector search and RDcost inspection for a P4×4 mode only if it is determined that inspection will be required on the smaller blocks for the P8×8 mode.

### Claim 6 (depends on 1)

The apparatus as set forth in claim 1, wherein:
if blocks positioned to left, upper, upper right and upper left sides of the corresponding macroblock are all intra mode blocks,
the intra mode inspection unit performs Intra Prediction Mode (IPM), Rdcost, and AZCB inspection for the I16×16 mode of the macroblock in combination with a chroma I8×8 mode i (i=0, 1, 2, 3), and performs IPM, RDcost inspection for an I4×4 mode of the macroblock if it is determined that inspection will be required on the smaller blocks for the I16×16 mode; and
if at least one of the blocks positioned to the left, upper, upper right and upper left sides of the corresponding macroblock is an inter mode block, the intra mode inspection unit obtains an IPM and a CMode from the chroma I8×8 mode of the macroblock, performs IPM, Rdcost, and AZCB inspection for the I16×16 mode in combination with the CMode, and performs IPM and RDcost inspection for the I4×4 mode of the macroblock if it is determined that inspection will be required on the smaller blocks for the I16×16 mode.

### Claim 7 (depends on 6)

The apparatus as set forth in claim 6, wherein the CMode is calculated using a Sum of Absolute Transformed Differences (SATD) method.

### Claim 8 (depends on 1)

The apparatus as set forth in claim 1, wherein the mode inspection skip unit skips block mode inspection for an I4×4 mode that is one of most expensive coding mode in regards to rate and distortion.

### Claim 9 (depends on 1, 2, 3, 4, 5, 6, 7, 8)

An H.264 video coder, including an adaptive motion estimation and mode decision apparatus for the H.264 video codec set forth in any of claims 1 to 8.

### Claim 10

An adaptive motion estimation and mode decision method for an H.264 video codec, comprising the steps of:
(a) calculating an RDcost for a SKIP mode and performing AZCB(SKIP) inspection for TC16=4;
(b) calculating a motion vector and an RDcost for a P16×16 mode and performing AZCB(P16×16) inspection for TC16=5;
(c) inspecting whether C16SKIP is zero;
(d) setting bSkipI4×4, which is a mode skip flag, to TRUE if the C16SKIP is zero, and proceeding to step (o);
(e) calculating motion vectors and RDcosts for P16×8 and P8×16 modes if the C16SKIP is not zero;
(f) inspecting whether a value of an AZCB(P16×8) is one or the value of an AZCB(P8×16) is one;
(g) setting bSkipI4×4 to TRUE if the value of the AZCB(P16×8) or AZCB(P8×16) is one;
(h) inspecting whether a value of an AZCB(SKIP) is one, setting the bSkipI4×4 to TRUE if the value of the AZCB(SKIP) is one, and proceeding to step (O);
(j) inspecting whether a value of an AZCB(P16×16) is one, setting the bSkipI4×4 to TRUE if the value of the AZCB(P16×16) is one, and proceeding to step (O);
(k) calculating motion vectors and RDcosts for P8×8, P8×4 and P4×8 modes, and calculating an AZCB(P8×8) for TC8=1;
(l) inspecting whether a value of the AZCB(P8×8) is one;
(m) calculating a motion vector and an RDcost for the P4×4 mode if the AZCB(P8×8) is not one;
(n) detecting whether a 8×8 block, which has not been inspected, exists;
(o) determining an intra block mode; and
(p) selecting an optimal mode.

### Claim 11 (depends on 10)

The method as set forth in claim 10, wherein the AZCB is generated using following Equations,
cc
⁡
(
i
,
j
)
=
{
∞
⁢
⁢
if
⁢
⁢
level
⁡
(
i
,
j
)
>
1
3
⁢
⁢
if
⁢
⁢
level
⁡
(
i
,
j
)
=
1
⁢
⁢
and
⁢
⁢
run_before
=
0
2
⁢
⁢
if
⁢
⁢
level
⁡
(
i
,
j
)
=
1
⁢
⁢
and
⁢
⁢
1
≤
run_before
≤
2
1
⁢
⁢
if
⁢
⁢
level
⁡
(
i
,
j
)
=
1
⁢
⁢
and
⁢
⁢
3
≤
run_before
≤
5
0
⁢
⁢
otherwise
⁢
⁢
and
⁢
⁢
C
⁢
⁢
8
=
∑
i
=
0
3
⁢
⁢
∑
j
=
0
15
⁢
⁢
cc
⁡
(
i
,
j
)
,
⁢
C
⁢
⁢
16
=
∑
i
=
0
3
⁢
⁢
C
⁢
⁢
8
⁢
(
i
)
,
⁢
AZCB
⁡
(
Block
⁢
⁢
8
×
8
)
=
{
1
⁢
⁢
if
⁢
⁢
C
⁢
⁢
8
≤
T
C
⁢
⁢
8
0
⁢
⁢
otherwise
,
⁢
AZCB
⁡
(
Block
⁢
⁢
16
×
16
)
=
{
1
⁢
⁢
if
⁢
⁢
C
⁢
⁢
16
≤
T
C
⁢
⁢
16
0
⁢
⁢
otherwise
,
where cc(i,j) is a coefficient cost function, level(i,j) is an absolute value of the coefficient, run_before is a number of successive zero coefficients located before a coefficient other than zero, TC8 and TC16 are threshold values for determining 8×8 and 16×16 blocks to be AZCBs, respectively, and C8 and C16 are total coefficient cost values of the 8×8 and 16×16 blocks, respectively.

### Claim 12 (depends on 10)

The method as set forth in claim 10, wherein the step of determining the intra block mode comprises the steps of:
(o-a) inspecting whether blocks positioned to left, upper, upper right and upper left sides of the macroblock are intra mode blocks;
if the blocks positioned to the left, upper, upper right and upper left sides of the macroblock are all intra mode blocks:
(o-b) calculating an IPM and an RDcost in combination with the I16×16 mode and the chroma I8×8 mode i (i=0, 1, 2, 3);
(o-c) inspecting whether the value of the AZCB(I16×16) is one or the bSkipI4×4 is TRUE;
(o-d) calculating the IPM and RDcost in combination with the I4×4 mode and the chroma I8×8 mode i (i=0) if the value of the AZCB(I16×16) is not one and the bSkipI4×4 is not TRUE;
(o-e) increasing a value of i by one, inspecting whether i<4 is true, and proceeding to step (o-b) if i<4;
if one of the blocks positioned on the left, upper, upper right and upper left sides of the macroblock is an inter mode block:
(o-f) calculating an IPM for the chroma I8×8 mode using the SATD method;
(o-g) calculating an IPM and an RDcost for the I16×16 mode using the calculated chroma mode;
(o-h) inspecting whether the value of the AZCB(I161×16) is one or bSkipI4×4 is TRUE; and
(o-i) calculating an IPM and an RDcost for the I4×4 mode if the value of the AZCB(I16×16) is not one and the bSkipI4×4 is not TRUE.

### Claim 13 (depends on 10, 11, 12)

An H.264 video coder, performing motion estimation and mode decision using an adaptive motion estimation and mode decision method for the H.264 video codec set forth in any of claims 10 to 12.

### Claim 14

A computer-readable recording medium storing a program for executing the functions of:
inspecting whether a macroblock corresponding to a fixed background or slowly and regularly moving image exists, and skipping the step of dividing a first corresponding macroblock into smaller sized blocks and performing block mode inspection;
performing AZCB inspection for an inter mode on macroblocks other than the macroblock corresponding to the fixed background or slowly and regularly moving image, determining whether an irregularly or fast moving block exists, and determining whether to divide a corresponding macroblock into smaller sized blocks and to perform the block mode inspection on the smaller sized blocks;
performing AZCB inspection for an intra mode on the macroblocks, determining whether to divide a corresponding macroblock into smaller sized blocks and to perform the block mode inspection on the smaller sized blocks; and
skipping the block mode inspection for the smaller sized blocks of the macroblock if it is determined that the block mode inspection for the smaller sized blocks of the macroblock will be skipped by the above-described functions.
