METHOD AND DEVICE FOR SELECTIVELY COMPRESSING VIDEO CODEC

Abstract: A method (100, 200), device (300) and microprocessor (400) are provided for selectively compressing video frames of a motion compensated prediction-based viedo codec based on a predetermined set of compression techniques. An energy estimate of the currrent displaced frame difference, DFD, is used to compute a ratio between the estimate and a historical mean of energy estimates. The ratio is iteratively compared to a predetermined set of thresholds which are associated with the predetermined set of compression techniques. The comparisons are used to choose a technique based on teh thresholds, and a technique is selected to be used for encoding the current DFD.

Description: METHOD AND DEVICE FOR SELECTIVELY COMPRESSING VIDEO CODEC Field of the Invention The present invention relates generally to video codecs, and more particularly to coding efficiency in video codecs. Background of the Invention The field of digital video compression has been dominated by techniques which use motion compensated prediction-based approaches to the problem of compression. Evidence of such domination is seen in the ISO MPEG 1 and 2 standards, the ITU H.261 standard, and the currently emerging ITU H.263 standard. Each of these video compression standards uses block-based motion estimation between video frames, followed by prediction of a frame, or motion compensation, in order to reduce the amount of redundant information before coding. Such an approach leads to a reduction in the bits which are required to effectively code the video information. An important problem in the context of motion compensated video coding is the need to efficiently encode the motion information and the errors in the motion-based prediction. The prediction error between two frames of motion compensated video is referred to as the "Displaced Frame Difference", or DFD. The DFD is generally a nonstationary, high-pass image which consists of error around the edges of moving objects where a motion estimation technique has failed to adequately represent the motion in the video scene. Often, the DFD will also contain regions of large, homogeneous error information. This happens when new objects enter the scene, or when objects are displaced by a large amount of motion between video frames. Different compression techniques provide different levels of efficiency when applied to the problem of encoding the DFD. The classical approach used to encode the DFD information is the use of a block-wise Discrete Cosine Transform (DCT), followed by entropy encoding of the coefficients of the transform. This approach works well when the pixels within each block are well modeled by a first order Markov process. The DCT is close to the optimal transform (the Karhunen-Loeve Transform) in terms of energy compaction capabilities when this first order Markov model is met. However, when this model breaks down, the DCT can become less efficient than some alternative techniques at coding the DFD image. Some of the other approaches that have been successfully applied to encoding the DFD include: vector quantization, wavelets or subband coding, and non- orthogonal Gabor function expansions. Each of these approaches has different coding properties from the DCT, and can be more efficient at coding the DFD under various circumstances. For example, when the DFD has no large homogeneous regions of information, but does consist of perceptually important error information around the edges of significant objects, the Gabor expansion approach can out-perform the DCT in terms of coding efficiency. Characterizing the nature of the DFD in terms of the energy content of the signal in a meaningful way is thus a very important problem. Having such a characterization can lead to more efficient use of the various types of coding tools which already exist. In the context of the Rate Control problem, the allocation of bits across a video sequence with a target output bitrate, such a characteπzation may provide additional useful information for making the allocation of available bits perceptually meaningful. Prior work associated with existing rate control systems has centered largely on allocating bits at a block level to achieve an overall bitrate. Consideration of the global properties of the DFD, however, is not a technique which has been used for selecting from alternative frame-level compression techniques to achieve an overall target bitrate. Thus, there is a need for a method, device and microprocessor for efficient use of multiple coding techniques to compress video sequences having variations in the amount and type of motion between frames in the scene. Brief Description of the Drawings FIG. 1 is a flow chart of a preferred embodiment of steps of a method in accordance with the present invention. FIG. 2 is a flow chart of another preferred embodiment of steps of a method in accordance with the present invention. FIG. 3 is a block diagram of one preferred embodiment of a device in accordance with the present invention. FIG. 4 is a schematic of one preferred embodiment of a microprocessor in accordance with the present invention. Detailed Description of a Preferred Embodiment A video sequence consists of individual images, or frames, of video data which are two dimensional representations of a three dimensional scene. A frame of video at time instant k is represented by the two dimensional signal, f κ (i,j). These frames appear at regularly spaced intervals in time. The displaced frame difference, or DFD, is obtained by taking the difference in intensity values at each pixel in a frame between the current frame, f κ (i,j), and a motion compensated version of the previous frame, fk-ι (i-dx(i,j),j-dy(i,j)), where dx(i,j) and dy(i,j) are the estimated displacements in the x and y directions at pixel (i,j), obtained from a predetermined motion estimation technique. The DFD, which is a prediction error image, may be encoded using a variety of compression techniques, as mentioned above. The present invention provides a method which selects an appropriate coding technique from a predetermined set of candidates for each incoming DFD frame of a video sequence in the encoder. This method leads to the efficient use of the multiple coding techniques to compress video sequences having variations in the amount and type of motion between frames in the scene. FIG. 1 , numeral 100, is a flow diagram of a preferred embodiment of a method for selectively compressing video frames of a motion compensated prediction-based video codec in accordance with the present invention. The first step consists of using the current displaced frame difference, DFD, to compute a current estimate of an energy for the DFD (102). The next step consists of computing a ratio of this energy estimate to a historical mean of energy estimates of previous DFDs (104). The current predetermined threshold is then specified as the first predetermined threshold from a list of thresholds (106). The ratio is then compared to a predetermined threshold according to a predetermined iterative scheme (108). The predetermined iterative scheme consists of repeating a comparison of the ratio to the next current predetermined threshold which is related to a predetermined DFD coding technique. If the ratio exceeds the current predetermined threshold, the corresponding technique is chosen for encoding the current DFD (110). Otherwise, the ratio is compared to the next predetermined threshold (112) which is associated with another coding technique. The process is repeated until the set of potential coding techniques is exhausted. FIG. 2 , numeral 200, is a flow diagram of another preferred embodiment of a method for selectively compressing video frames of a motion compensated prediction-based video codec in accordance with the present invention. The first step consists of weighting the current displaced frame difference to provide a center biased DFD (202). The weighted DFD is the original DFD at a given frame multiplied by a piecewise pyramidal window. This window value is changed depending on the 16x16 macroblock in which the pixels of the DFD reside. The weighted DFD for all channels is given by, Here, DFDk(i,j) refers to the three channel image of the displaced frame difference at Frame k, and the symbol [ J indicates integer truncation. The constants appearing in the weighting function are given here for QCIF resolution video images, which have a support of 176x144 in the Y channel, and 88x72 in the Cr and Cb channels. These constants may be changed to accommodate any image format by appropriate scaling. In the QCIF resolution, a 16x16 macroblock contains 16x16 pixels from the Y channel, and 8x8 pixels from each of the chrominance channels. As a result, the function above describes a window which maps one-to-one onto the pixels of the Y channel. The chrominance pixels in each macroblock are weighted by the same value as the corresponding pixels from the Y channel in that macroblock. The emphasis in this weighting is placed on macroblocks towards the center of the image, which is perceptually important. The next step consists of using the weighted displaced frame difference to compute a current estimate of an energy for the DFD (204). A special, computationally simple estimate is defined here which approximates the average energy in the DFD of a video frame (206). The metric is the sum of absolute values, SOA, of a weighted DFD, measured across the luminance, Y, and chrominance, Cr and Cb, planes of a color video image. The SOA is defined as S* for Frame k in terms of the individual channels of the DFD: Y, Cr,Cb, -l (Λ//2)-l S~ = ∑ DFD Ch k(i =0 with N=144, and M=176 for the QCIF resolution. The next step consists of computing a historical mean of energy estimates of previous DFDs (208). The historical mean is obtained by averaging the past n S/c's. The historical mean is defined as n which as a moving average of the energy changes in the DFDs from frame to frame. The value of n is set to four (210). The history of these changes is tracked over four frames because of the temporal correlation that generally exists over this small range in time. This common trend mean tends to smooth out large variations in the prediction error energy measure. In the next step, the current St. is divided by the current 5* to form an energy ratio (212). The current predetermined threshold is then set equal to the first predetermined threshold, T1 (214). The ratio is then compared to the current predetermined threshold, Tc, according to an iterative scheme (218). The iterative comparison involves repeating a series of steps which test the ratio against predetermined thresholds related to predetermined DFD coding techniques. The iterative comparison consists of: A) where the ratio is greater than the predetermined threshold, selecting a first compression technique (220); B) where the ratio is less than or equal to the predetermined threshold, compare the ratio to a next predetermined threshold (224); C) where the ratio is greater than the next predetermined threshold, selecting a next compression technique (220); D) where the ratio is less than or equal to the next predetermined threshold, repeating steps C and D using successive predetermined thresholds and compression techniques from a predetermined list until the list of the predetermined compression techniques has been exhausted. The predetermined thresholds used are obtained by successively reducing the magnitude of an initial predetermined threshold, T1 (214). The initial value of T is set to 1.00 (216). Each time the ratio is less than the predetermined threshold, the next threshold is computed by reducing T by a factor of 0.75 (222). For example, given a set of three candidate DFD coding techniques whose properties are such that each successive technique is more efficient at coding smaller and more localized prediction error energy than the previous technique, the two predetermined thresholds would be T1 =1.00, T2=0.75. An example of the three DFD encoding techniques would be standard block-based DCT coding, Gabor function expansion and coding, and coding the DFD as entirely zero energy, or no coding, respectively. These threshold comparison tests must be based on a subjective understanding of the importance of the prediction error relative to the overall quality of the scene. Thus, the thresholds may be controlled through an external rate control mechanism, which determines the trade-offs between coding techniques based on their relative rate-distortion characteristics at the individual video frame level. At the beginning of the iterative comparison, a predetermined global motion detection technique is performed (226), and where global motion is detected, a predetermined subset of the predetermined list of compression techniques is selected for use in the iteration. Global motion is detected by determining the number of unrestricted motion vectors pointing outside a video frame in accordance with ITU Draft International Standard H.263, Annex D. Standard macroblock-based motion vectors are obtained by searching for a match over only those blocks which lie within the boundaries of the previous frame. Unrestricted motion vectors are allowed to point outside the boundaries of the previous frame. The matching blocks for those macroblocks are obtained by repeating the border pixels of the previous frame. When there is global motion (especially in the case of camera panning) the vectors pointing outside the borders often provide the best match (in terms of the absolute error measure used to determine a match). When there is no global motion, however, the extended search vectors usually match the standard search vectors, and few are chosen pointing outside the borders. The global motion detection counts the number of vectors which are chosen pointing outside the borders of the previous frame, and compares that number to a predetermined threshold, t. When this number exceeds the predetermined threshold, the frame is said to be a global motion frame. The predetermined threshold, t is set to 15 for QCIF resolution video (228). The detection of global motion causes a reduction in the set of predetermined compression techniques. Those techniques which do not completely update all spatial positions in the image are removed from the set. For example, if three predetermined candidate techniques were DCT, a Gabor based non-orthogonal expansion, and no coding, only the DCT technique would be kept in the set of predetermined techniques. This would result in only one available coding choice in the presence of global motion, for this example. FIG. 3, numeral 300, is a block diagram of one preferred embodiment of a device for selectively compressing video frames of a motion compensated prediction-based video codec in accordance with the present invention. The device comprises an estimation unit (302), a divider (304), a comparator (306), and a controller (308). The estimation unit (302) uses the current displaced frame difference (310) to compute a current estimate of an energy for the displaced frame difference as described in the preferred embodiment of the method described above (200). The divider (304) is coupled to the estimation unit (302), and is used for computing a ratio of the current estimate of an energy for the displaced frame difference (312) to the historical mean (316) as described in the preferred embodiment of the method described above (200). The comparator (306) is coupled to the divider (304), and is used for determining a compression technique by comparing the ratio (314) to a predetermined threshold (318) according to a predetermined iterative scheme that associates a predetermined list of candidate compression techniques with predetermined thresholds as described in the preferred embodiment of the method described above (200). The controller (308) is coupled to the comparator and the divider, and is used for implementing the iterative comparison scheme described in the preferred embodiment of the method above (200). The device outputs a selected DFD coding technique (320). FIG. 4, numeral 400, is a schematic of one preferred embodiment of a microprocessor in accordance with the present invention. The microprocessor comprises an estimation unit (402), a divider (404), a comparator (406), and a controller (408). The estimation unit (402) uses the current DFD (410) to compute a current estimate of an energy for the DFD as described in the preferred embodiment of the method described above (200). The divider (404) is coupled to the estimation unit (402), and is used for computing a ratio of the current estimate of an energy for the DFD (412) to the historical mean (416) as described in the preferred embodiment of the method described above (200). The comparator (406) is coupled to the divider (404), and is used for determining a compression technique by comparing the ratio (414) to a predetermined threshold (418) according to a predetermined iterative scheme that associates a predetermined list of candidate compression techniques with predetermined thresholds as described in the preferred embodiment of the method described above (200). The controller (408) is coupled to the comparator and the divider, and is used for implementing the iterative comparison scheme described in the preferred embodiment of the method above (200). The microprocessor outputs a selected DFD coding technique (420). The method and device may be selected to be embodied in least one of: A) an application specific integrated circuit; B) a field programmable gate array; and C) a microprocessor; and D) a computer-readable memory; arranged and configured for selectively compressing video frames of a motion compensated prediction-based video codec based on predetermined estimated motion between two video frames, a displaced frame difference between the two video frames, and a historical mean of energy estimates of previous displaced frame differences in accordance with the scheme described in greater detail above. Although exemplary embodiments are described above, it will be obvious to those skilled in the art that many alterations and modifications may be made without departing from the invention. Accordingly, it is intended that all such alterations and modifications be included within the spirit and scope of the invention as defined in the appended claims.

Claims: WE CLAIM: 1. A method for selectively compressing video frames of a motion compensated prediction-based video codec based on predetermined estimated motion between two video frames, a displaced frame difference between the two video frames, and a historical mean of energy estimates of previous displaced frame differences, comprising the steps of: 1A) using the displaced frame difference to compute a current estimate of an energy for the displaced frame difference; 1 B) computing a ratio of the current estimate of an energy for the displaced frame difference to the historical mean; and 1 C) determining a compression technique by comparing the ratio to a predetermined threshold according to a predetermined iterative scheme that associates a predetermined list of compression techniques with predetermined thresholds that are stored in memory. 2. The method of claim 1 wherein at least one of 2A-2D: 2A) the displaced frame difference is weighted to provide a center- biased displaced frame difference; 2B) the estimate of the energy for the displaced frame difference is a sum of an absolute value of each pixel of the displaced frame difference; 2C) wherein the predetermined iterative scheme includes: 2C1 ) where the ratio is greater than the predetermined threshold, selecting a first compression technique; 2C2) where the ratio is less than or equal to the predetermined threshold, comparing the ratio to a next predetermined threshold; 2C3) where the ratio is greater than the next predetermined threshold, selecting a next compression technique; 2C4) where the ratio is less than or equal to the next predetermined threshold, repeating steps 2C3 and 2C4 using successive predetermined thresholds and compression techniques from a predetermined list until the list of the predetermined compression techniques has been exhausted; and 2D) wherein the method is a process whose steps are embodied in least one of: 2D1 ) an application specific integrated circuit; 2D2) a field programmable gate array; and 2D3) a microprocessor; and 2D4) a computer-readable memory; arranged and configured for selectively compressing video frames of a motion compensated prediction-based video codec based on predetermined estimated motion between two video frames, a displaced frame difference between the two video frames, and a historical mean of energy estimates of previous displaced frame differences in accordance with the scheme of claim 1. 3. The method of claim 1 wherein the historical mean of energy estimates of previous displaced frame differences is an average of n , n a positive integer, previous estimates of the energy of displaced frame differences, and where selected, wherein n equals 4. 4. The method of claim 1 further including, at a beginning of step 1 C, performing a predetermined global motion detection technique, and where global motion is detected, selecting a predetermined subset of the predetermined list of compression techniques for use in stepl C, and where selected, wherein global motion includes determining a number of unrestricted motion vectors pointing outside a video frame in accordance with H.263 Annex D and where the number of unrestricted motion vectors pointing outside a video frame is greater than a predetermined value, global motion is detected. 5. A device for selectively compressing video frames of a motion compensated prediction-based video codec based on predetermined estimated motion between two video frames, a displaced frame difference between the two video frames, and a historical mean of energy estimates of previous displaced frame differences, comprising: 5A) an estimation unit, for using the displaced frame difference to compute a current estimate of an energy for the displaced frame difference; 5B) a divider, coupled to the estimation unit and to receive a historical mean, for computing a ratio of the current estimate of an energy for the displaced frame difference to the historical mean; and 5C) a comparator, coupled to the divider and to receive predetermined thresholds, for determining a compression technique by comparing the ratio to one predetermined threshold according to a predetermined iterative scheme that associates a predetermined list of candidate compression techniques with predetermined thresholds to provide a selected coding technique; and 5D) a controller, coupled to the comparator and the divider, for implementing the predetermined iterative scheme. 6. The device of claim 5 wherein at least one of 6A-6C: 6A) the displaced frame difference is weighted to provide a center- biased displaced frame difference; 6B) the estimate of the energy for the displaced frame difference is a sum of an absolute value of each pixel of the displaced frame difference; and 6C) wherein the predetermined iterative scheme includes: 6C1 ) where the ratio is greater than the predetermined threshold, selecting a first compression technique; 6C2) where the ratio is less than or equal to the predetermined threshold, comparing the ratio to a next predetermined threshold; 6C3) where the ratio is greater than the next predetermined threshold, selecting a next compression technique; and 6C4) where the ratio is less than or equal to the next predetermined threshold, repeating steps C and D using successive predetermined thresholds and compression techniques from a predetermined list until the list of the predetermined compression techniques has been exhausted. 7. The device of claim 5 wherein the historical mean of energy estimates of previous displaced frame differences is an average of n , n a positive integer, previous estimates of the energy of displaced frame differences, and where selected, wherein n equals 4. 8. The device of claim 5 further including, at a beginning of step C, performing a predetermined global motion detection technique, and where global motion is detected, selecting a predetermined subset of the predetermined list of compression techniques for use in 5C, and where selected, wherein the device is embodied in at least one of: 8A) an application specific integrated circuit; 8B) a field programmable gate array; 8C) a microprocessor; and 8D) a computer-readable memory; arranged and configured for selectively compressing video frames of a motion compensated prediction-based video codec based on predetermined estimated motion between two video frames, a displaced frame difference between the two video frames, and a historical mean of energy estimates of previous displaced frame differences in accordance with the scheme of claim 5. 9. A microprocessor for selectively compressing video frames of a motion compensated prediction-based video codec based on predetermined estimated motion between two video frames, a displaced frame difference between the two video frames, and a historical mean of energy estimates of previous displaced frame differences, preprogrammed with a software program implementing the steps of: 9A) using the displaced frame difference to compute a current estimate of an energy for the displaced frame difference; 9B) computing a ratio of the current estimate of an energy for the displaced frame difference to the historical mean; and 9C) determining a compression technique by comparing the ratio to a predetermined threshold according to a predetermined iterative scheme that associates a predetermined list of candidate compression techniques with predetermined thresholds. 10. The microprocessor of claim 9 wherein at least one of 10A-10E: 10A) the displaced frame difference is weighted to provide a center- biased displaced frame difference; 10B) the estimate of the energy for the displaced frame difference is a sum of an absolute value of each pixel of the displaced frame difference; 10C) the historical mean of energy estimates of previous displaced frame differences is an average of n , n a positive integer, previous estimates of the energy of displaced frame differences, and where selected, where n equals 4; 10D) wherein the predetermined iterative scheme includes: 10D1 ) where the ratio is greater than the predetermined threshold, selecting a first compression technique; 10D2) where the ratio is less than or equal to the predetermined threshold, comparing the ratio to a next predetermined threshold; 10D3) where the ratio is greater than the next predetermined threshold, selecting a next compression technique; and 10D4) where the ratio is less than or equal to the next predetermined threshold, repeating steps 10D3 and 10D4 using successive predetermined thresholds and compression techniques from a predetermined list until the list of the predetermined compression techniques has been exhausted; and 10E) further including, at a beginning of step 9C, performing a predetermined global motion detection technique, and where global motion is detected, selecting a predetermined subset of the predetermined list of compression techniques for use in step 9C.

Inventors: BANHAM MARK R, BRAILEAN JAMES C, KATSAGGELOS AGGELOS K, LEVINE STEPHEN N, SCHUSTER GUIDO M, BANHAM, MARK, R., BRAILEAN, JAMES, C., KATSAGGELOS, AGGELOS, K., LEVINE, STEPHEN, N., SCHUSTER, GUIDO, M.
Applicants: MOTOROLA INC, MOTOROLA INC.
Application year: 1996
Main classification: G06F17
IPC codes: G06T9