# US 2008/0187046 A1 · Motion vector refinement for MPEG-2 to H.264 video transcoding

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

- Number: US 2008/0187046 A1
- Document ID: US20080187046A1
- Status: Published application
- Kind: A1
- Application number: 11/703,482
- Filed: 2007-02-07
- Published: 2008-08-07
- Earliest claimed: 2007-02-07
- Assignees: LSI Logic Corporation
- Inventors: Anthony Peter Joch; Michael D. Gallant
- Web page: https://patentgrep.com/patent/US20080187046A1

## CPC

- H04N 19/40: using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream
- H04N 19/513: Processing of motion vectors
- H04N 19/523: with sub-pixel accuracy
- H04N 19/56: Motion estimation with initialisation of the vector search, e.g. estimating a good candidate to initiate a search
- H04N 19/61: in combination with predictive coding
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

A method for transcoding is disclosed. The method generally includes the steps of (A) generating a decoded frame by decoding an input video stream in an MPEG-2 format, the decoded frame including a plurality of decoded macroblocks; (B) determining a current search center to be used in encoding a current macroblock into an H.264 format, the current macroblock corresponding to a pair of the decoded macroblocks on consecutive macroblock rows, wherein when (i) the encoding uses a predictive field mode and (ii) a current field being encoded comprises a second field of a current frame and has a first field of the current frame as a reference field, the current search center comprises a temporally scaled version of a decoded motion vector from one of an upper macroblock of the pair and a lower macroblock in the pair; (C) generating a refined motion vector by searching in a temporal search direction about the current search center; and (D) generating an output video stream in the H.264 format by the encoding of the current macroblock based on the refined motion vector.

## Claims

### Claim 1

A method for transcoding, comprising the steps of:
(A) generating a decoded frame by decoding an input video stream in an MPEG-2 format, said decoded frame including a plurality of decoded macroblocks;
(B) determining a current search center to be used in encoding a current macroblock into an H.264 format, said current macroblock corresponding to a pair of said decoded macroblocks on consecutive macroblock rows, wherein when (i) said encoding uses a predictive field mode and (ii) a current field being encoded comprises a second field of a current frame and has a first field of said current frame as a reference field, said current search center comprises a temporally scaled version of a decoded motion vector from one of an upper macroblock of said pair and a lower macroblock in said pair;
(C) generating a refined motion vector by searching in a temporal search direction about said current search center; and
(D) generating an output video stream in said H.264 format by said encoding of said current macroblock based on said refined motion vector.

### Claim 2 (depends on 1)

The method according to claim 1, wherein in step (B) when (i) said upper macroblock has at least one motion vector matching said temporal search direction, (ii) said lower macroblock has no motion vectors matching said temporal search direction and (iii) said upper macroblock has a field motion compensation, said current search center comprises a field motion vector of said upper macroblock that matches a polarity of said encoding and said temporal search direction.

### Claim 3 (depends on 1)

The method according to claim 1, wherein in step (B) when (i) said upper macroblock has at least one motion vector matching said temporal search direction, (ii) said lower macroblock has no motion vectors matching said temporal search direction and (iii) said upper macroblock has a frame motion compensation, said current search center comprises a vertically scaled version of a frame motion vector of said upper macroblock.

### Claim 4 (depends on 1)

The method according to claim 1, wherein in step (B) when (i) said upper macroblock has no motion vectors matching said temporal search direction, (ii) said lower macroblock has at least one motion vector matching said temporal search direction and (iii) said lower macroblock has a field motion compensation, said current search center comprises a field motion vector of said lower macroblock that matches a polarity of said encoding and said temporal search direction.

### Claim 5 (depends on 1)

The method according to claim 1, wherein in step (B) when (i) said upper macroblock has no motion vectors matching said temporal search direction, (ii) said lower macroblock has at least one motion vector matching said temporal search direction and (iii) said lower macroblock has a field motion compensation, said current search center comprises a vertically scaled version of a frame motion vector of said lower macroblock.

### Claim 6 (depends on 1)

The method according to claim 1, wherein in step (B) when (i) said upper macroblock has at least one first motion vector matching said temporal search direction, (ii) said lower macroblock has at least one second motion vector matching said temporal search direction and (iii) said upper macroblock has a field motion compensation, said current search center comprises a field motion vector of said upper macroblock that matches a polarity of said encoding and said temporal search direction.

### Claim 7 (depends on 1)

The method according to claim 1, wherein in step (B) when (i) said upper macroblock has at least one first motion vector matching said temporal search direction, (ii) said lower macroblock has at least one second motion vector matching said temporal search direction, (iii) said upper macroblock has a frame motion compensation and (iv) said lower macroblock has a field motion compensation, said current search center comprises a field motion vector of said lower macroblock that matches a polarity of said encoding and said temporal search direction.

### Claim 8 (depends on 1)

The method according to claim 1, wherein in step (B) when (i) said upper macroblock has at least one first motion vector matching said temporal search direction, (ii) said lower macroblock has at least one second motion vector matching said temporal search direction, (iii) said upper macroblock has a frame motion compensation and (iv) said lower macroblock has said frame motion compensation, said current search center comprises a vertically scaled version of a frame motion vector from one of said upper macroblock and said lower macroblock.

### Claim 9 (depends on 1)

The method according to claim 1, wherein in step (B) when said upper macroblock (i) has a motion vector in an opposite direction of said temporal search direction, (ii) is not intra coded and (iii) has a field motion compensation, said current search center comprises a mirrored version of said motion vector.

### Claim 10 (depends on 1)

The method according to claim 1, wherein in step (B) when said lower macroblock (i) has a motion vector in an opposite direction of said temporal search direction, (ii) is not intra coded and (iii) has a field motion compensation, said current search center comprises a mirrored version of said motion vector.

### Claim 11 (depends on 1)

The method according to claim 1, wherein in step (B) when (i) said upper macroblock has an intra-prediction and (ii) said lower macroblock has said intra-prediction, said current search center comprises a previously determined search center.

### Claim 12

A system comprising:
a decoder configured to generate a decoded frame by decoding an input video stream in an MPEG-2 format, said decoded frame including a plurality of decoded macroblocks; and
an encoder configured to (i) determine a current search center to be used in encoding a current macroblock into an H.264 format, said current macroblock corresponding to a pair of said decoded macroblocks on consecutive macroblock rows, wherein when (a) said encoding uses a predictive field mode and (b) a current field being encoded comprises a second field of a current frame and has a first field of said current frame as a reference field, said current search center comprises a temporally scaled version of a decoded motion vector from one of an upper macroblock of said pair and a lower macroblock in said pair, (ii) generate a refined motion vector by searching in a temporal search direction about said current search center and (iii) generate an output video stream in said H.264 format by said encoding of said current macroblock based on said refined motion vector.

### Claim 13

A method for transcoding, comprising the steps of:
(A) generating a decoded frame by decoding an input video stream in an MPEG-2 format, said decoded frame including a plurality of decoded macroblocks;
(B) determining a current search center to be used in encoding a current macroblock into an H.264 format, said current macroblock corresponding to a particular one said decoded macroblocks, wherein when said particular macroblock has an intra-prediction, said current search center comprises a previously determined search center that temporally matches a temporal search direction;
(C) generating a refined motion vector by searching in said temporal search direction about said current search center; and
(D) generating an output video stream in said H.264 format by said encoding of said current macroblock based on said refined motion vector.

### Claim 14 (depends on 13)

The method according to claim 13, wherein in step (B) when said particular macroblock has (i) at least one motion vector matching said temporal search direction and (ii) and a frame motion compensation, said current search center comprises a frame motion vector of said particular macroblock.

### Claim 15 (depends on 13)

The method according to claim 13, wherein in step (B) when said particular macroblock has (i) at least one motion vector matching said temporal search direction and (ii) and a field motion compensation, said current search center comprises a vertically scaled version of a field motion vector of a top field of said particular macroblock.

### Claim 16 (depends on 13)

The method according to claim 13, wherein in step (B) when said particular macroblock has (i) no motion vectors matching said temporal search direction, (ii) at least one motion vector opposite said temporal search direction and (iii) a frame motion compensation, said current search center comprises a mirrored version of a frame motion vector of said particular macroblock.

### Claim 17 (depends on 13)

The method according to claim 13, wherein in step (B) when said particular macroblock has (i) no motion vectors matching said temporal search direction, (ii) at least one motion vector opposite said temporal search direction and (iii) a field motion compensation, said current search center comprises a scaled and mirrored version of a field motion vector of a top field of said particular macroblock.

### Claim 18 (depends on 13)

The method according to claim 13, wherein said previously determined search center is spatially adjoining said particular macroblock.

### Claim 19 (depends on 13)

The method according to claim 13, wherein said encoding into said H.264 format utilizes macroblock adaptive field/frame encoding.

### Claim 20

A system comprising:
a decoder configured to generate a decoded frame by decoding an input video stream in an MPEG-2 format, said decoded frame including a plurality of decoded macroblocks; and
an encoder configured to (i) determine a current search center to be used in encoding a current macroblock into an H.264 format, said current macroblock corresponding to a particular one said decoded macroblocks, wherein when said particular macroblock has an intra-prediction, said current search center comprises a previously determined search center that temporally matches a temporal search direction, (ii) generate a refined motion vector by searching in said temporal search direction about said current search center and (iii) generate an output video stream in said H.264 format by said encoding of said current macroblock based on said refined motion vector.
