Method and apparatus for performing motion compensation on video data
Abstract
An apparatus and method for performing two-pass real time video compression is provided. Tactical decisions such as encoding and quantization values are determined in software, whereas functional execution steps are performed in hardware. By appropriately apportioning the tasks between software and hardware, the benefits of each type of processing are exploited, while minimizing both hardware complexity and data transfer requirements. One key concept that allows the compression unit to operate in real time is that the architecture and pipelining both allow for B frames to be executed out of order. By buffering B frames, two-pass motion estimation techniques can be performed to tailor bit usage to the requirements of the frame, and therefore provide a more appealing output image.
Claims
exact text as granted — not AI-modified1 . A method for performing motion compensation on video data comprising the steps of:
segmenting a first portion of video data into a first plurality of macroblocks, each macroblock comprising a plurality of pixels; segmenting a second portion of video data into a second plurality of macroblocks, each macroblock comprising a like plurality of pixels; comparing one of said plurality of macroblocks of said first portion of video data to each of said plurality of macroblocks of said second portion of video data; and determining a macroblock of said second portion of video data which most closely matches said macroblock of interest in said first portion of video data.
2 . The method of claim 1 which further comprises the step of calculating a motion vector, for each one of said first plurality of macroblocks, each of said motion vectors representing a change in position of said associated macroblock relative to said determined matching macroblock.
3 . The method of claim 2 wherein the motion vector is calculated by:
calculating a first difference between the horizontal coordinate of a chosen pixel of said macroblock of interest in said first portion of video data and the horizontal coordinate of a corresponding pixel of said matching macroblock in said second portion of video data; and calculating a second difference between the vertical coordinate of a chosen pixel of said macroblock of interest in said first portion of video data and the vertical coordinate of a corresponding pixel of said matching macroblock in said second portion of video data.
4 . The method of claim 3 wherein the motion vector is further calculated by:
generating a plurality of motion compensated pixels of said matching macroblock by adding a vector comprising said first difference as its horizontal value and said second difference as its vertical value, to each pixel coordinate in said matching macroblock.
5 . The method of claim 4 which further comprises filtering said pixels of said macroblock of interest with corresponding plurality of motion compensated pixels of said matching macroblock.
6 . The method of claim 5 , wherein said filtering is performed only if said macroblock of interest has a horizontal and vertical location different than a horizontal and vertical location of said matching macroblock.
7 . The method of claim 5 , wherein said filtering is performed if a cumulative difference of pixel values which comprise said macroblock of interest is different than a cumulative difference of pixel values which comprise said matching macroblock.
8 . An integrated circuit performing motion compensation on video data comprising:
means for storing a plurality of frames of video data; means for partitioning each of said plurality of frames of video data into equivalent sized macroblocks; means for calculating a cumulative difference between pixel values of a first macroblock from a first frame and corresponding pixel values of a second macroblock from a second frame; means for storing said cumulative difference; and means for identifying a closely matching macroblock in said second frame of video data by determining the smallest value of said cumulative difference.
9 . The integrated circuit of claim 8 further comprising:
means for calculating a position difference representing the difference between the position of any pixel of said closely matching macroblock and the position of a corresponding pixel of said first macroblock.
10 . The integrated circuit of claim 9 further comprising:
means for adding said position difference to each pixel in said closely matching macroblock.
11 . The integrated circuit of claim 10 wherein said means for adding generates a plurality of motion compensated pixels; and
further comprising filter means for filtering said pixels of said first macroblock with corresponding plurality of motion compensated pixels of said closely matching macroblock.
12 . The integrated circuit of claim 9 wherein the means for calculating a position difference:
(a) calculates a first difference between a horizontal coordinate of a chosen pixel of said first macroblock and the horizontal coordinate of a corresponding pixel of said closely matching macroblock; and (b) calculates a second difference between the vertical coordinate of a chosen pixel of said first macroblock and the vertical coordinate of a corresponding pixel of said closely matching macroblock.
13 . Computer apparatus for performing motion compensation on video data comprising:
a segmenter segmenting a first portion of video data into a first plurality of macroblocks, each macroblock comprising a plurality of pixels; the segmenter segmenting a second portion of video data into a second plurality of macroblocks, each macroblock comprising a like plurality of pixels; and a processor unit responsive to the segmenter for comparing one of said plurality of macroblocks of said first portion of video data to each of said plurality of macroblocks of said second portion of video data; and determining a macroblock of said second portion of video data which most closely matches said macroblock of interest in said first portion of video data.
14 . Apparatus as claimed in claim 13 wherein the processor unit further calculates a motion vector, for each one of said first plurality of macroblocks, each of said motion vectors representing a change in position of said associated macroblock relative to said determined matching macroblock.
15 . Apparatus as claimed in claim 14 wherein the motion vector is calculated by:
calculating a first difference between the horizontal coordinate of a chosen pixel of said macroblock of interest in said first portion of video data and the horizontal coordinate of a corresponding pixel of said matching macroblock in said second portion of video data; and calculating a second difference between the vertical coordinate of a chosen pixel of said macroblock of interest in said first portion of video data and the vertical coordinate of a corresponding pixel of said matching macroblock in said second portion of video data.
16 . Apparatus as claimed in claim 15 wherein the motion vector is further calculated by:
generating a plurality of motion compensated pixels of said matching macroblock by adding a vector comprising said first difference as its horizontal value and said second difference as its vertical value, to each pixel coordinate in said matching macroblock.
17 . Apparatus as claimed in claim 16 wherein the processor unit further filters said pixels of said macroblock of interest with corresponding plurality of motion compensated pixels of said matching macroblock.
18 . Apparatus as claimed in claim 17 wherein said filtering is performed only if said macroblock of interest has a horizontal and vertical location different than a horizontal and vertical location of said matching macroblock.
19 . Apparatus as claimed in claim 17 wherein said filtering is performed if a cumulative difference of pixel values which comprise said macroblock of interest is different than a cumulative difference of pixel values which comprise said matching macroblock.
20 . Apparatus as claimed in claim 13 wherein the processor unit is part of a video compression decompression unit.Cited by (0)
No later patents cite this yet.
References (0)
No backward citations on record.