Method and apparatus for performing two pass quality video compression through pipelining and buffer management
First Claim
1. A method of providing compression of video data input to a video compression/decompression unit (VCDU) coupled to a central processor unit (CPU), said video data comprising a plurality of frames, including predictive frames and bi-directional frames, each of said frames apportioned into a plurality of macroblocks, each of said macroblocks comprising a plurality of pixels, said method comprising the steps of:
- said VCDU comparing each of said frames to other ones of said frames to estimate the motion characteristics of each of said macroblocks of each of said frames;
determining, by said CPU, a coding type for each of said macroblocks of each of said frames responsive to said motion characteristics provided from said VCDU;
said VCDU encoding each of said macroblocks of each of said frames responsive to said coding type determined by said CPU to provide one or more tokens for each of said plurality of frames;
buffering, by said CPU, selected ones of said bi-directional frames and processing the buffered frames out of order in which said plurality of frames initially occur;
translating, by said CPU, said one or more tokens for each of said plurality of frames into a bit stream for storage in a storage device; and
wherein said VCDU and said CPU are connected by an input-output bus and the steps of the VCDU comparing and the CPU determining provide for minimal traffic on the input-output bus while tasks are efficiently apportioned between said VCDU and said CPU.
4 Assignments
0 Petitions
Accused Products
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.
-
Citations
17 Claims
-
1. A method of providing compression of video data input to a video compression/decompression unit (VCDU) coupled to a central processor unit (CPU), said video data comprising a plurality of frames, including predictive frames and bi-directional frames, each of said frames apportioned into a plurality of macroblocks, each of said macroblocks comprising a plurality of pixels, said method comprising the steps of:
-
said VCDU comparing each of said frames to other ones of said frames to estimate the motion characteristics of each of said macroblocks of each of said frames;
determining, by said CPU, a coding type for each of said macroblocks of each of said frames responsive to said motion characteristics provided from said VCDU;
said VCDU encoding each of said macroblocks of each of said frames responsive to said coding type determined by said CPU to provide one or more tokens for each of said plurality of frames;
buffering, by said CPU, selected ones of said bi-directional frames and processing the buffered frames out of order in which said plurality of frames initially occur;
translating, by said CPU, said one or more tokens for each of said plurality of frames into a bit stream for storage in a storage device; and
wherein said VCDU and said CPU are connected by an input-output bus and the steps of the VCDU comparing and the CPU determining provide for minimal traffic on the input-output bus while tasks are efficiently apportioned between said VCDU and said CPU. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
determining at least one motion vector for each of said macroblocks, said at least one motion vector indicating a motion characteristic between said each macroblock and a similar macroblock in a preceding or succeeding frame.
-
-
3. The method according to claim 1, wherein said step of said VCDU comparing each of said frames further comprises the steps of determining energy characteristics of each of said macroblocks.
-
4. The method according to claim 1, wherein said step of said VCDU comparing each of said frames further comprises the steps of:
-
determining a first and second motion vector for each of said macroblocks, said first and second motion vectors indicating a motion characteristic between said each macroblock and a similar macroblock in a preceding and succeeding frame, respectively; and
determining energy characteristics of each of said macroblocks.
-
-
5. The method according to claim 2 wherein said step of said determining, by said CPU, a coding type for each of said macroblocks of each of said frames responsive to said motion characteristics further comprises the steps of:
-
designating each of said macroblocks as either spatial or temporal coding type; and
assigning a quantization value to each of said macroblocks, said quantization value for controlling the number of bits that are to be used to encode the macroblock.
-
-
6. The method according to claim 4 wherein said step of determining, by said CPU, a coding type for each of said macroblocks of each of said frames responsive to said motion characteristics further comprises the steps of:
-
designating each of said macroblocks as either spatial or temporal coding type; and
assigning a quantization value to each of said macroblocks, said quantization value for controlling the number of bits that are to be used to encode the macroblock.
-
-
7. The method according to claim 6, wherein said quantization value is assigned to each of said macroblocks responsive to the energy characteristics of other macroblocks within said associated frame.
-
8. The method according to claim 6, wherein the step of said VCDU encoding each of said macroblocks of each of said frames responsive to said coding type comprises the steps of:
-
responsive to said coding type being a temporal coding type and said macroblock being a reference type macroblock, providing an error macroblock by calculating the difference between the value of pixels within said macroblock and the value of pixels within the macroblock indicated by said first motion vector;
responsive to said coding type being a temporal coding type and said macroblock being a non-reference type macroblock, providing an error macroblock by calculating the difference between the value of pixels within said macroblock and the average of value of pixels within the macroblock indicated by said first motion vector and the value of pixels within the macroblock indicated by said second motion vector.
-
-
9. The method according to claim 8, wherein the step of said VCDU encoding each of said macroblocks further comprises the step of:
applying a discrete cosine transform to either said macroblock, or said error macroblock, responsive to said coding type being either a spatial coding type or a temporal coding type, respectively, to provide a transformed macroblock.
-
10. The method according to claim 9, wherein the step of said VCDU encoding each of said macroblocks further comprises the step of:
quantizing each of the macroblocks by multiplying the quantization value provided from said CPU to each of the entries of said transformed macroblock to provide a quantized macroblock.
-
11. The method according to claim 10, further comprising the step of:
generating one or more tokens for each of said macroblocks, said tokens generated by traversing said quantized macroblock and recording the distance between frequency components in said quantized macroblock.
-
12. The method according to claim 1, wherein the step of translating, by said CPU, said one or more tokens for each of said plurality of frames into a bit stream for storage in a storage device includes the steps of defining, for each unique one of said one or more tokens, a compact code.
-
13. A method of performing decompression of a bit stream representing video data stored in a storage device of a computer system, said computer system including a central processing unit (CPU) and a video compression/decompression unit (VCDU) coupled to said CPU, said video data comprising a plurality of frames, each of said frames apportioned into a plurality of macroblocks, said method comprising the steps of:
-
translating, by said CPU, said bit stream into one or more tokens for each of said plurality of frames;
said VCDU decoding each of said tokens to construct a plurality of macroblocks for each of said frames;
decoding, by said CPU, a coding type for each of said macroblocks of each of said frames, said coding type for indicating how each of said macroblocks is compressed; and
using at least one stored motion vector for each of said macroblocks, and responsive to said coding type of each of said macroblocks, reconstructing each macroblock to provide a restored video image;
wherein said coding types include temporal coding types and spatial coding types, and wherein said step of reconstructing each said macroblock further comprises the step of;
responsive to said coding type being a temporal coding type providing said restored macroblock by adding the contents of each entry of said macroblock to the value of pixels within the macroblock indicated by a first motion vector;
applying an inverse discrete cosine transform to either said constructed macroblock, or said restored macroblock, responsive to said coding type being either a spatial coding type or a temporal coding type, respectively, to provide a reconstructed macroblock for use in said restored video image;
wherein the macroblock is double-buffered between a quantization process and a discrete cosine transform process; and
wherein said VCDU and said CPU are connected by an input-output bus and in a compression process the VCDU compares frames to estimate motion characteristics of macroblocks and the CPU determines code types of the macroblocks based on the motion characteristics from the VCDU, said comparing and determining providing minimal traffic on the input-output bus while tasks are efficiently apportioned between said VCDU and said CPU.
-
-
14. An apparatus for performing compression and decompression of video data input to a video compression/decompression unit (VCDU) coupled via interface means to a central processor unit (CPU), said video data comprising a plurality of frames, including predictive frames and bi-directional frames, each of said frames apportioned into a plurality of macroblocks, each of said macroblocks comprising a plurality of pixels, said VCDU further comprising:
-
motion estimation means, in said VCDU for comparing each of said frames to other ones of said frames to estimate the motion characteristics of each of said macroblocks of each of said frames;
means for encoding each of said macroblocks of each of said frames responsive to a coding type determined by said CPU to provide one or more tokens for each of said plurality of frames;
means for buffering, by said CPU, selected ones of said bi-directional frames and for processing the buffered frames out of order in which said plurality of frames initially occur; and
wherein said interface means comprise an input-output bus and the motion estimation means and means for encoding provide minimal traffic on the input-output bus while each means efficiently apportions tasks between said VCDU and said CPU. - View Dependent Claims (15, 16, 17)
means for determining said coding type for each of said macroblocks of each of said frames responsive to said motion characteristics provided from said VCDU via said interface means; and
translating means for converting said one or more tokens received via said interface means from said VCDU for each of said plurality of frames into a bit stream for storage in a storage device.
-
-
16. The apparatus of claim 14 further comprising:
reconstruction means, in said VCDU for translating said bit stream representing said plurality of frames into frame data.
-
17. The apparatus of claim 16 wherein said motion estimation means is coupled to receive video data from an external device and is further coupled to receive frame data from said reconstruction means.
Specification