# US 9,357,228 B2 · Motion estimation of images

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

- Number: US 9,357,228 B2
- Document ID: US9357228B2
- Status: Granted
- Kind: B2
- Application number: 13/117,334
- Filed: 2011-05-27
- Published: 2011-12-01
- Granted: 2016-05-31
- Earliest claimed: 2010-05-27
- Assignees: The Hong Kong University of Science and Technology
- Applicants: Oscar Chi Lim Au; Xing Wen; Jiang Xu
- Inventors: Oscar Chi Lim Au; Xing Wen; Jiang Xu
- Web page: https://patentgrep.com/patent/US9357228B2

## CPC

- H04N 19/57: Motion estimation characterised by a search window with variable size or shape
- H04N 19/433: characterised by techniques for memory access
- H04N 19/52: by predictive encoding
- H04N 19/567: Motion estimation based on rate distortion criteria
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

Provided is sub-block motion estimation that includes a full search with a reduced search area around a motion vector predictor. Also provided are a single (or unified) motion vector predictor and a function similar to a rate-distortion cost function. Also provided is a scanning order that can reduce or substantially eliminated redundant data loading and/or that can achieve different data re-use ratio. Further, provided herein is a reconfigurable multi-resolution motion vector re-use hardware architecture based on a single motion vector predictor and a function similar to a rate-distortion cost function. Further, through utilization of the disclosed aspects, only a small number of past motion vectors are propagated and the disclosed aspects can be reconfigured for video with different spatial resolution.

## Claims

### Claim 1

A method, comprising:
dividing, by a system comprising a processor, one or more video frames into a plurality of sub-blocks created from a plurality of macro-blocks;
determining, by the system, a reference frame within the one or more video frames;
defining, by the system, a search area for the plurality of sub-blocks as a function of a plurality of motion vector predictors comprising centering the search area around a location defined in the reference frame; and
searching, by the system, within at least one sub-block of the plurality of sub-blocks for a single motion vector predictor for the plurality of sub-blocks, wherein the searching is based on determining a rate-distortion cost between search points within the plurality of sub-blocks, the searching comprising:
using a first search pattern to search a first sub-block of the plurality of sub-blocks, wherein the search of the first sub-block comprises first stages of searching, and wherein the first stages of searching comprise one or more hierarchical stage of search;
using a set of previously loaded data based on a first data re-use ratio to search the first sub-block, wherein the set of previously loaded data is stored at a shift register array of a set of inter-connected internal adaptive shift registers of the system, wherein each shift register of the set of internal adaptive shift registers is capable of storing a set of previously loaded data associated with a range of sub-block sizes; and
using a second search pattern to search a second sub-block of the plurality of sub-blocks, wherein the first sub-block and the second sub-block are of different sizes and have different shapes, wherein the search of the second sub-block comprises second stages of searching wherein the second stages of searching comprises one or more hierarchical stage of search, wherein the second search pattern re-uses the set of previously loaded data based on a second data re-use ratio to search the second sub-block of the plurality of sub-blocks, and wherein the first data re-use ratio is different from the second data re-use ratio.

### Claim 2 (depends on 1)

The method of claim 1, wherein the determining the rate-distortion cost comprises determining a cost that comprises a first additive element that is a distortion measure between a current sub-block and a candidate reference sub-block and determining a second additive element that is a product of lambda, being a function of at least one of a sub-block size and location, a macro-block location and type, a quantization parameter, a target rate behavior, a buffer condition or a buffer property, and a function of a difference between a candidate motion vector and a motion vector predictor.

### Claim 3 (depends on 2)

The method of claim 2, wherein the determining the second additive element comprises determining the second additive element as a function of motion vectors of a set of neighboring macro-blocks or a set of neighboring sub-blocks corresponding to the first sub-block.

### Claim 4 (depends on 3)

The method of claim 3, further comprising:
determining, by the system, the plurality of motion vector predictors as a function of a plurality of motion vectors of the set of neighboring macro-blocks or the set of neighboring sub-blocks, and wherein the defining the search area comprises identifying a search center as a function of the plurality of motion vector predictors.

### Claim 5 (depends on 4)

The method of claim 4, further comprising assigning, by the system, a motion vector predictor from the plurality of motion vector predictors as a median of a macro-block motion vector on a left macro-block, a top macro-block, and a top-right macro-block.

### Claim 6 (depends on 1)

The method of claim 1, wherein the defining the search area comprises determining a search center as a median of motion vectors of three past neighboring macro-blocks that comprise a first macro-block at a left position, a second macro-block at a top position, and a third macro-block at a top-right position.

### Claim 7 (depends on 6)

The method of claim 6, further comprising determining, by the system, at least one alternative macro-block in response to a determination of one of the first macro-block, the second macro-block, or the third macro-block being unavailable.

### Claim 8 (depends on 7)

The method of claim 7, wherein the determining the at least one alternative macro-block comprises choosing a fourth macro-block at a top-left position.

### Claim 9

A system, comprising:
a processor that executes or facilitates execution of computer executable components stored in a memory, the computer executable components comprising:
a partition component configured to divide a video frame into a plurality of macro-blocks;
a sub-partition component configured to divide the plurality of macro-blocks into a plurality of sub-blocks, wherein a first macro-block of the plurality of macro-blocks is divided into at least two sub-blocks, and wherein the first macro-block and the at least two sub-blocks are of different sizes and different shapes;
a selection component configured to choose a reference frame from the plurality of sub-blocks;
a data processing component configured to use a set of previously loaded data within a set of internal adaptive shift registers of the system based on a first data re-use ratio to search a first block of the at least two sub-blocks, wherein each shift register of the set of internal adaptive shift registers is capable of storing a respective set of previously loaded data associated with the reference frame and further configured to use the set of previously loaded data based on a second data re-use ratio to search a second block of the at least two sub-blocks, wherein the first data re-use ratio and the second data re-use ratio are different;
a classification component configured to define a search area comprising a set of search points, wherein the search area is based on a plurality of motion vector predictors, and wherein the search area is defined to capture different area sizes and area shapes; and
an evaluation component configured to calculate a rate-distortion cost function for selected search points of the set of search points in the search area based on the set of previously loaded data to choose a motion vector for the plurality of sub-blocks.

### Claim 10 (depends on 9)

The system of claim 9, wherein the rate-distortion cost function comprises a first element and a second element, wherein the first element is a distortion measure and the second element is a product of a parameter and a function of a difference between a candidate motion vector and a motion vector predictor of the plurality of motion vectors.

### Claim 11 (depends on 10)

The system of claim 10, wherein the parameter is lambda, which is a function of a sub-block size and location, a macro-block location and type, a quantization parameter, a target rate behavior, a buffer condition and a buffer property.

### Claim 12 (depends on 10)

The system of claim 10, wherein the parameter is approximated by a linear combination of a power-of-2.

### Claim 13 (depends on 10)

The system of claim 10, wherein the motion vector predictor of the second element is a function of motion vectors of past neighboring macro-blocks.

### Claim 14 (depends on 10)

The system of claim 10, wherein the motion vector predictor of the second element is a function of motion vectors of past neighboring macro-blocks on a left, a top, and a top right in relation to a current macro-block.

### Claim 15 (depends on 14)

The system of claim 14, wherein the motion vector predictor of the second element is a median of the motion vectors of past neighboring macro-blocks on the left, the top, and the top right in relation to a current macro-block.

### Claim 16 (depends on 10)

The system of claim 10, wherein the search area corresponds to the candidate motion vector between a current macro-block or a current sub-block and a candidate reference macro-block or a candidate sub-block of a similar size in the reference frame.

### Claim 17 (depends on 9)

The system of claim 9, wherein the search area comprises a search center that is the motion vector predictor.

### Claim 18 (depends on 17)

The system of claim 17, wherein the search center is a median of identified motion vectors of three past neighboring macro-blocks.

### Claim 19 (depends on 18)

The system of claim 18, wherein the three past neighboring macro-blocks comprise a left macro-block, a top macro-block, and a top-right macro-block in relation to a current macro-block.

### Claim 20

A method, comprising:
determining, by a system comprising a processor, a reference frame from a plurality of video frames;
defining, by the system, a search area comprising a plurality of search points in the reference frame, wherein the search area is defined to capture different area sizes and area shapes;
dividing, by the system, the search area into sub-windows comprising a first sub-window of a first size and a first shape, and a second sub-window of a second size and a second shape different from the first size and the first shape;
using, by the system, a set of previously loaded data based on a first data re-use ratio to search the sub-windows, wherein the set of previously loaded data is stored within a set of inter-connected internal adaptive shift registers of the system; and
processing, by the system, the plurality of video frames comprising determining a scanning order among the sub-windows and the sub-windows are scanned at least once and two adjacent sub-windows are adjacent each other, wherein the processing comprises using a first scanning order for the first sub-window and using a second scanning order for the second sub-window, the second scanning order being different from the first scanning order; and
using, by the system, the set of previously loaded data based on a second data re-use ratio to search the second sub-window, wherein the first data re-use ratio and the second data re-use ratio are different.

### Claim 21 (depends on 20)

The method of claim 20, further comprising scanning, by the system, the sub-windows, and wherein the scanning comprises performing a horizontal scan, a vertical scan, or both the horizontal scan and the vertical scan.

### Claim 22 (depends on 20)

The method of claim 20, further comprising before the defining, dividing, by the system, the video frames into blocks that comprise N×N pixels, and wherein the processing further comprises reading N pixels in parallel in one clock cycle and loading the pixels once within the sub-window.

### Claim 23 (depends on 21)

The method of claim 21, wherein the scanning of the sub-windows comprises scanning with at least one snake scan chosen from sixteen different snake scans.

### Claim 24 (depends on 21)

The method of claim 21, wherein the scanning of the sub-windows further comprises:
scanning a first sub-window with a first type of snake scan;
moving to an adjacent search point in a second sub-window; and
scanning the second sub-window with a second type of snake scan.

### Claim 25 (depends on 20)

The method of claim 20, wherein the dividing the search area into sub-windows further comprises dividing the search area into non-overlapping rectangular sub-windows.

### Claim 26 (depends on 21)

The method of claim 21, wherein the scanning of the sub-windows comprises defining a scanning order using a scan that starts from an upper-left corner, an upper-right corner, a lower-left corner, or a lower-right corner of a search window, and wherein the scan is a horizontal scan or a vertical scan.

### Claim 27 (depends on 21)

The method of claim 21, wherein the scanning of the sub-windows comprises dividing the search area into regions and applying a snake scan locally in the regions.

### Claim 28

A system, comprising:
a processor that executes or facilitates execution of computer executable components stored in a memory, the computer executable components comprising:
a selection component configured to identify a reference frame from a set of references based on a first motion vector predictor and a second motion vector predictor of the reference frame;
a designation component configured to define a search area in the reference frame, wherein the search area is configured to capture different area sizes and area shapes;
a sub-partition component configured to divide the search area into a plurality of sub-windows, wherein at least two sub-windows of the plurality of sub-windows comprise different sizes and different shapes, and wherein the reference frame and the at least two sub-windows comprise different sizes and different shapes;
a control unit component that uses a set of previously loaded data corresponding to at least a portion of the reference frame and stored within a set of internal adaptive shift registers of the system to search the at least two windows, wherein each shift register of the set of internal adaptive shift registers stores a subset of the set of previously loaded data; and
a scan component configured to scan the plurality of sub-windows based on a selected scanning order and two adjacent sub-windows in the selected scanning order are spatially close, wherein the selected scanning order for each of the at least two sub-windows is selected based in part on a respective size and a respective shape of the at least two sub-windows, wherein the scan component is configured to perform both a horizontal scan and a vertical scan on the plurality of sub-windows, wherein the set of previously loaded data is used to facilitate the horizontal scan and the vertical scan of the plurality of sub-windows, wherein the set of previously loaded data is used to scan a first sub-window of the two-adjacent sub-windows based on a first data re-use ratio, wherein the set of previously loaded data is re-used to scan a second-sub-window of the two-adjacent sub-windows based on a second data re-use ratio, and wherein the first data re-use ratio is different from the second data re-use ratio.

### Claim 29 (depends on 28)

The system of claim 28, wherein the scan component is configured to perform the horizontal scan in which a first row is scanned horizontally in a first direction and a second row is scanned horizontally in a second direction.

### Claim 30 (depends on 28)

The system of claim 28, wherein the scan component is configured to perform the vertical scan in which a first row is scanned vertically in a first direction and a second row is scanned vertically in a second direction.

### Claim 31 (depends on 28)

The system of claim 28, wherein the scan component is configured to select a scanning order that comprises a snake scan that starts in a upper-left corner, an upper-right corner, a lower-left corner, or a lower-right corner of the search area, wherein the snake scan uses the horizontal scan or the vertical scan.

### Claim 32 (depends on 28)

The system of claim 28, wherein a plurality of points in the search area correspond to a candidate motion vector between a current block and a candidate reference block of a similar size in the reference frame.

### Claim 33 (depends on 28)

The system of claim 28, wherein the sub-partition component is configured to divide the search area into rectangular sub-windows, and wherein a plurality of search points in the search area belong to the plurality of sub-windows.

### Claim 34 (depends on 28)

The system of claim 28, further comprising:
a data bus configured to read N pixels in parallel in one clock cycle, wherein a block of the reference frame comprises N×N pixels; and
a reconfigurable register array configured to store data in a row for use in a next row, wherein the N pixels are loaded once within the plurality of sub-windows.

### Claim 35 (depends on 28)

The system of claim 28, wherein the scan component is configured to select a scanning order from sixteen different snake scans, wherein a first set of the snake scans are for the vertical scan and a second set of the snake scans are for the horizontal scan.

### Claim 36 (depends on 28)

The system of claim 28, wherein the scan component is configured to select a scanning order that divides the search area into regions and a snake scan is applied locally in the regions.

### Claim 37

A method, comprising;
determining, by a system comprising a processor, a plurality of reference frames from a set of video frames;
obtaining, by the system, from the plurality of reference frames, a first motion vector predictor and a second motion vector predictor;
defining, by the system, a search area in the plurality of reference frames, the search area is centered around the first motion vector predictor or the second motion vector predictor wherein the search area is configurable to capture different sizes and shapes, wherein the search area and each reference frame of the plurality of reference frames comprise different sizes and shapes;
using, by the system, a set of previously loaded data corresponding to the plurality of reference frames within a set of internal adaptive shift registers of the system, wherein each shift register of the set of internal adaptive shift registers stores a subset of the set of previously loaded data that corresponds to a reference frame of the plurality of reference frames within a respective shift register of the set of internal adaptive shift registers;
performing, by the system, motion estimation for sub-blocks based on the first motion vector predictor and the second motion vector predictor, wherein the sub-blocks comprise a first sub-block comprising a first size and a first shape and at least a second sub-block comprising a second size and a second shape different from the first size and the first shape wherein the first sub-block and the second sub-block are divisions of a same block, and wherein the performing motion estimation comprises:
performing a first motion estimation scan for the first sub-block,
performing a second motion estimation scan, different from the first motion estimation scan, for at least the second sub-block, wherein the first motion estimation scan and the second motion estimation scan uses the set of previously loaded data to increase a scan speed associated with each respective scan, wherein a first use of the set of previously loaded data for the first motion estimation scan is based on a first data re-use ratio, and wherein a second use of the set of previously loaded data for the second motion estimation scan is based on a second data re-use ratio; and
selecting a motion vector from the sub-blocks in the plurality of reference frames.

### Claim 38 (depends on 37)

The method of claim 37, wherein the obtaining comprises obtaining the first motion vector predictor and the second motion vector predictor based on motion vectors of past blocks.

### Claim 39 (depends on 37)

The method of claim 37, wherein the obtaining the first motion vector predictor or the obtaining the second motion vector predictor comprises obtaining a first median of a first motion vector of a left block, a second median of a second motion vector of a top block, or a third median of a third motion vector of a top-right block in relation to a current block.

### Claim 40 (depends on 37)

The method of claim 37, wherein the performing the first motion estimation or the second motion estimation comprises performing a single motion vector predictor that uses only one of the first motion vector predictor or the second motion vector predictor.

### Claim 41 (depends on 40)

The method of claim 40, further comprising performing, by the system, a location full search motion estimation around the first motion vector predictor or the second motion vector predictor.

### Claim 42 (depends on 37)

The method of claim 37, wherein the performing the motion estimation for the sub-blocks further comprises computing a cost function that comprises multiple additive terms comprising a distortion term and a term that is a product of a lambda parameter, wherein the lambda parameter is a function of at least one of a sub-block size and location, a block location and type, a quantization parameter, a target rate behavior, a buffer condition or a buffer property, and a rate function of encoding the motion vector.

### Claim 43 (depends on 9)

The system of claim 9, further comprising a scan component configured to select a scanning order among the plurality of sub-blocks and is further configured to perform both a horizontal scan and a vertical scan on the plurality of sub-blocks.

### Claim 44 (depends on 1)

The method of claim 1, wherein a different first search pattern corresponds to each respective stage of searching of the one or more hierarchical stage of search.

### Claim 45 (depends on 1)

The method of claim 1, wherein a different second search pattern corresponds to each respective stage of searching of the one or more hierarchical stage of search.
