1. Field of the Invention
The present invention relates to a motion vector detecting technique, e.g., a device having a function for detecting an interframe motion vector for coding motion images with an image coding method including an interframe prediction mode, a method thereof, and an image coding device using the motion vector detecting device.
2. Description of the Related Art
The MPEG-4 (Motion Picture Experts Group Phase 4), which is a standard of a compression coding method for motion images, employs motion compensation coding using motion vectors (see Japanese Unexamined Patent Application Publication No. 2003-87799, for example). With the motion vector tracking and detection described in Japanese Unexamined Patent Application Publication No. 2003-87799, tracking and detection of the optimum point is performed as follows. That is to say, first, the sum of the absolute differences is calculated for each search point in a predetermined search pattern including a given search origin. Next, the aforementioned search pattern is shifted such that the search point exhibiting a minimum sum matches the center of the next search pattern. The shifting of the pattern is repeated until the sum of the absolute differences obtained for the center search point is the minimum in those of all the search points in the next pattern thus determined. In this case, the center search point in the pattern thus obtained is determined as the optimum point. The motion vector tracking and detection disclosed in Japanese Unexamined Patent Application Publication No. 2003-87799 proposes a technique for setting a search-termination condition, e.g., limitation of the number of search times for each processing, thereby improving detection efficiency as well as suppressing redundant search for the motion vector.
With the motion vector tracking and detection as described above, tracking and detection are performed while shifting the search point to a next search point adjacent thereto, with a given search origin as a search start point, leading to a problem of long time for detecting the motion vector. On the other hand, with the aforementioned technique wherein search-loop termination conditions are set for reducing search time, in some cases, search is terminated with an undesired local minimum around the search origin, leading to reduced precision of motion-vector detection, resulting in an increased coding amount or reduced image quality.
A first aspect of the present invention relates to a motion vector detecting device. The motion vector detecting device for detecting a motion vector between a first image and a second image serving as a reference image of the first image, includes multiple computation units for computing matching between a block included in the first image and blocks included in the second image, with the multiple computation units computing multiple matching steps at the same time in parallel.
Block matching may be performed between blocks based upon differences in the pixel values of the pixels included in the blocks, for example. The computation unit may compute an indicator wherein the smaller the difference in the pixel value therebetween is, the smaller the indicator is. For example, the computation unit may compute the sum of the squares of the differences in the pixel value of the pixel between the blocks, or may compute the sum of the absolute differences in the pixel value of the pixel therebetween. Such a configuration wherein the multiple computation units execute multiple matching computation steps at the same time reduces a period of time required for detection of the motion vector, thereby improving the processing speed of motion-image coding. Furthermore, such a configuration wherein multiple matching computation steps are executed in parallel reduces a period of time for memory access, thereby having further advantage of reducing the processing time.
With the motion vector detecting device, an arrangement may be made wherein each of the multiple computation units computes matching between the first image and a respective one of multiple blocks each of which is represented by a search point included in a two-dimensional search region having a predetermined pattern, with the motion vector detecting device further including: an evaluation unit for evaluating computation results obtained by the multiple computation units, and detecting a search point which exhibits optimum matching result; and a setting unit for setting search points for which the next matching is to be computed, based upon the evaluation result obtained by the evaluation unit. Such an arrangement wherein computation steps for the search points included in a two-dimensional search region are executed at the same time, and an optimum solution is detected for each search region, enables detection for a wider region in a shorter period of time than with conventional methods wherein the single search point is shifted step by step in a one-dimensional manner. This improves precision of motion-vector detection, as well as reducing processing time, thereby reducing the coding amount, and thereby improving the image quality.
With the motion vector detecting device, an arrangement may be made wherein the setting unit sets the next search region to a region including the search point which exhibits the optimum matching result, with the next search points being set to points included in the search region thus determined. This enables suitable detection while shifting a search region in a direction wherein there is a strong likelihood that the search point which exhibits optimum matching results will be detected, thereby improving precision of motion-vector detection, as well as reducing the processing time.
With the motion vector detecting device, an arrangement may be made wherein the setting unit sets the next search region by shifting the search region in a direction from the center point of the search region toward the search point which exhibits the optimum matching result. Furthermore, an arrangement may be made wherein the setting unit sets the next search region by shifting the search region in a direction from the search point which exhibits the optimum matching result in the previous computation toward the search point which exhibits the optimum matching result in the current computation. This improves precision of motion-vector detection.
An arrangement may be made wherein, in a case wherein the aforementioned evaluation unit has determined that the computation results satisfy predetermined condition as a result of evaluation of the computation results, the evaluation unit determines ending detection. For example, an arrangement may be made wherein, in a case wherein the search point which exhibits the optimum matching result in the previous computation matches the search point which exhibits the optimum matching result in the current computation, the evaluation unit determines ending detection. Furthermore, an arrangement may be made wherein, in a case wherein the indicator calculated in the matching computation is better than a predetermined threshold, the evaluation unit determines ending detection.
An arrangement may be made wherein the setting unit sets the search points based upon any one of: evaluation results evaluated by the evaluation unit in detection even further in the past than the immediately-previous detection; the motion vector of other block in the first image; the motion vector of the image even further in the past or in the future than the first image; and information regarding scrolling of the first image. Furthermore, an arrangement may be made wherein the setting unit determines the shape of the search region based upon any one of: evaluation results evaluated by the evaluation unit; the motion vector of other block in the first image; the motion vector of the image even further in the past or in the future than the first image; and information regarding scrolling of the first image. This enables higher-speed and higher-precision detection of the motion vector.
A second aspect of the present invention relates to an image coding device. The image coding device for coding motion images so as to create a coded data sequence comprises: a motion vector detecting unit for detecting a motion vector between a first image forming the motion images and a second image serving as a reference image of the first image; and a coding unit for coding the first image using the motion vector, with the motion vector detecting unit including multiple computation units for computing matching between the first image and blocks included in the second image, and with the multiple computation units computing multiple matching steps at the same time in parallel.
A third aspect of the present invention relates to a motion vector detecting method. The method for detecting a motion vector between a first image and a second image serving as the first image comprises: computing matching between the first image and multiple blocks, each of which is represented by a respective one of multiple search points included in a two-dimensional search region having a predetermined pattern included in the second image; estimating computation results obtained in the computation step so as to detect a search point which exhibits optimum matching result; and setting search points for the next matching computation based upon detection results obtained in the detection.
Note that any combination of the aforementioned components or any manifestation of the present invention realized by modification of a method, device, system, computer program, and so forth, is effective as an embodiment of the present invention.
Moreover, this summary of the invention does not necessarily describe all necessary features so that the invention may also be sub-combination of these described features.
The invention will now be described based on preferred embodiments which do not intend to limit the scope of the present invention but exemplify the invention. All of the features and the combinations thereof described in the embodiments are not necessarily essential to the invention.
An image coding device according to an embodiment of the present invention performs image coding stipulated by MPEG-4. With the image coding device according to the present embodiment, a motion vector is detected between a coding target image and a reference image by performing multiple block matching steps in parallel, thereby improving the processing speed. Furthermore, the present embodiment proposes a new motion vector detection method with higher detection precision by performing multiple block matching steps at the same time.
The image (which will be referred to as “input image” hereafter) input to the image coding device 10 from an external device is transmitted to the motion vector detecting circuit 24. The motion vector detecting circuit 24 detects a motion vector by making comparison between the input image and an image (which will be referred to as “reference image” hereafter) stored in the frame memory 28 beforehand, serving as a reference for prediction. The motion compensation circuit 26 acquires the quantization step size for quantization of the image, from the coding-amount control circuit 36, and determines quantization coefficients and the prediction mode for the macro block. The motion vector detected by the motion vector detecting circuit 24, and the quantization coefficients and the macro block prediction mode determined by the motion compensation circuit 26, are transmitted to the coding circuit 30. Furthermore, the motion compensation circuit 26 transmits the differences between the predicted values and the actual values for the macro block, which is prediction deviation, to the coding circuit 30.
The coding circuit 30 performs coding of the prediction deviation using quantization coefficients, and transmits the quantized prediction deviation to the output buffer 34. Furthermore, the coding circuit 30 transmits the quantized prediction deviation and the quantization coefficients to the decoding circuit 32. The decoding circuit 32 performs decoding of the quantized prediction deviation based upon the quantization coefficients, creates a decoded image by adding the decoded prediction deviation and the prediction values received from the motion compensation circuit 26, and transmits the decoded image thus created, to the frame memory 28. The decoded image is transmitted to the motion vector detecting circuit 24, and is used as a reference image for coding the following images. The coding-amount control circuit 36 acquires how full the output buffer 34 is, and determines the quantization step size used for the next quantization based upon the degree how full the output buffer 34 is.
The reference-mode selecting circuit 38 selects the reference mode from the intra-frame prediction mode, the forward interframe prediction mode, and the bi-directional interframe prediction mode, and outputs the reference mode information thus determined, to other circuits.
Description will be made regarding a motion vector detecting method according to the present embodiment with reference to
In
While description has been made regarding examples with reference to
The motion vector detecting circuit 24 performs block matching while shifting the search region 116 according to the detection method described above. Upon the (n−1)'th minimum point matching the n'th minimum point, the motion vector detecting circuit 24 determines the macro block represented by the n'th point thus obtained, as the prediction macro block, whereby detection ends. Also, the motion vector detecting circuit 24 may determine ending detection based upon other conditions of ending detection. For example, an arrangement may be made wherein, in the event that the distance between the (n−1)'th minimum point and the n'th minimum point is smaller than a predetermined threshold, the motion vector detecting circuit 24 determines ending detection.
The computation unit 40 computes block matching between the coding target macro block 102 and each of the multiple computation target macro blocks 112 in parallel. The evaluation unit 42 acquires the computation results obtained by the computation unit 40, and evaluates the computation results. The evaluation unit 42 detects the search point which exhibits the minimum difference from the results of block matching for the multiple computation target macro blocks 112 computed by the computation unit 40, and stores the minimum point in memory or the like. The evaluation unit 42 compares the minimum point obtained in the current computation with the minimum point in the previous computation thus stored. In a case wherein the minimum point in the current computation matches that in the previous computation, the evaluation unit 42 determines this point as the prediction macro block, and transmits the prediction macro block thus determined, to the motion compensation circuit 26 and the coding circuit 30. On the other hand, in a case wherein the minimum point in the current computation does not match that in the previous computation, the evaluation unit 42 stores the new minimum point obtained in the current computation, and instructs the position-setting unit 44 to set the next search region 116. Upon reception of the instructions from the evaluation unit 42, the position-setting unit 44 sets the position of the next search region 116 according to the rules described above.
The input image storage unit 50 stores the coding target macro block 102 of the input image. The reference image storage unit 52 stores the computation target macro blocks 112 of the reference image. The aforementioned units may be replaced with the frame memory 28, or may be realized using a part of the frame memory 28. The reference image storage unit 52 may store the pixel values of the region 114 as described with reference to
Each of the difference computation circuits 56a through 56y computes block matching between the coding target macro block 102 and a respective one of the computation target macro blocks 112a through 112y. Each difference computation circuit 56 may calculate the sum of the absolute differences in the pixel value between the coding target macro block 102 and a respective computation target macro block 112, may calculate the sum of the squares of the differences therebetween, or may calculate a desired value which represents the difference between the images. With conventional detection methods, the same pixel values need to be read out for each computation. With the present embodiment, the pixel values required for block matching are supplied to the multiple difference computation circuits 56a through 56y at the same time, thereby greatly suppressing the number of the times of memory access, and thereby improving processing speed.
As described above, description has been made regarding the present invention with reference to the aforementioned embodiments. The above-described embodiments have been described for exemplary purposes only, and are by no means intended to be interpreted restrictively. Rather, it can be readily conceived by those skilled in this art that various modifications may be made by making various combinations of the aforementioned components or the aforementioned processing, which are also encompassed in the technical scope of the present invention.
The motion vector detecting circuit 24 may switch the detection mode between the detection mode according to the present embodiment wherein multiple block matching steps are executed in parallel, and the conventional detection mode. For example, an arrangement may be made wherein, in a case of coding motion images with a large data amount in real time, or with a high frame rate, i.e., in a case which requires high-speed coding processing, multiple difference computation circuits 56 execute block matching in parallel for improving the processing speed. On the other hand, with such an arrangement, in a case of coding motion images with a small data amount, in a case of a mobile device which includes a CPU having relatively low processing performance, or in a case wherein the power consumption of the device should be suppressed, the number of the difference computation circuits 56 which are to be operated is reduced. In order to realize such a technique, the image coding device 10 may include control means for switching the motion-vector detection method, or adjusting the number of the difference computation circuits 56 which are to be operated, based upon information such as the data amount of the motion images, the frame, the processing performance of the device, the operation mode of the device, and so forth.
Number | Date | Country | Kind |
---|---|---|---|
2004-077563 | Mar 2004 | JP | national |
2005-022103 | Jan 2005 | JP | national |