This application claims priority from Japanese Priority Document No. 2003-373847, filed on Nov. 4, 2003 with the Japanese Patent Office, which document is hereby incorporated by reference.
The present invention relates to a data processing apparatus for generating a motion vector of moving picture data and a method and an encoding device of the same.
In recent years, apparatuses designed based on the MPEG (Moving Picture Experts Group) or other system for handling image data digitally and at that time transmitting and storing information with a high efficiency by compressing the image data by applying a discrete cosine transform or other orthogonal transform and motion compensation utilizing the redundancy peculiar to image information have spread in use for both distribution of information by broadcast stations etc. and reception of information at the general home.
As a follow up to the MPEG system, H.264/AVC (Advanced Video Coding) encoding system for realizing a further higher compression rate has been proposed. The H.264/AVC system, in the same way as the MPEG, performs motion prediction and compensation based on a motion vector. When an encoding device of the H.264/AVC system searches for (generates) a motion vector in a predetermined search range of reference image data in units of motion compensation block data MCB, however, it generates a predictive motion vector PMV by using the motion vectors MV already generated for other motion compensation block data adjacent to the motion compensation block data MCB in question. Then, the encoding device generates the motion vector MV of the motion compensation block data so as to reduce the amount of information of the predictive motion vector PMV.
In a conventional encoding device, however, when generating the predictive motion vector PMV, sometimes the motion vectors of the adjacent other motion compensation block data have not yet been generated due to the timing of the pipeline processing etc. In such case, there are problems that the predictive motion vector PMV cannot be generated and the motion compensation block data cannot be encoded.
The present invention relates to a data processing apparatus for generating a motion vector of moving picture data and a method and an encoding device of the same.
The present invention in an embodiment provides a data processing apparatus which, when generating a motion vector of first motion compensation block data to be processed in moving picture data by using motion vectors of second motion compensation block data having predetermined positional relationships with respect to the first motion compensation block data, is capable of generating the motion vector of the first motion compensation block data even when the motion vectors of the second motion compensation block data are not yet generated and a method and an encoding device of the same.
In an embodiment, a data processing apparatus is provided for generating a motion vector of a first motion compensation block data to be processed in a moving image data by using a motion vector of a second motion compensation block having a predetermined positional relationship between the first motion compensation block data. The data processing apparatus includes a generating mechanism for generating the motion vector of the first motion compensation block data by using a motion vector of a third motion compensation block data which is already generated and has a predetermined relationship of position between the first motion compensation block data in place of the motion vector of the second motion compensation block data when the motion vector of the second motion compensation block data have not been yet generated at the time of generating the motion vector of the first motion compensation block data.
The mode of operation of the data processing apparatus according to an embodiment is as follows. When a motion vector of first motion is generated compensation block data and motion vectors of second motion compensation block data have not been yet generated, it uses the already generated motion vectors of third motion compensation block data which have predetermined positional relationships with respect to the first motion compensation block data in place of the motion vectors of the second motion compensation block data so as to generate the motion vector of the first motion compensation block data.
In another embodiment, a method of data processing is provided for generating a motion vector of a first motion compensation block data to be processed in a moving image data by using a motion vector of a second motion compensation block having a predetermined positional relationship between the first motion compensation block data. The data processing method includes judging whether or not the motion vector of the second motion compensation block data have not been yet generated at the time of generating the motion vector of the first motion compensation block data; generating the motion vector of the first motion compensation block data by using a motion vector of the second motion compensation block data when it decided at the first step that the motion vector of the second motion compensation block data have already been generated; and generating the motion vector of the first motion compensation block data by using a motion vector of a third motion compensation block data which is already generated and has a predetermined relationship of position between the first motion compensation block data in place of the motion vector of the second motion compensation block data when it decided at the first step that the motion vector of the second motion compensation block data have not been yet generated
The mode of operation of the data processing method according to an embodiment is as follows. First, it decides when generating a motion vector of first motion compensation block data whether motion vectors of second motion compensation block data have not yet been generated. Next, when it decided that the motion vectors of the second motion compensation block data have been already generated, it uses the motion vectors of the second motion compensation block data to generate the motion vector of the first motion compensation block data. Next, when it decided that the motion vectors of the second motion compensation block data have not yet been generated, it uses already generated motion vectors of third motion compensation block data which have predetermined positional relationships with respect to the first motion compensation block data in place of the motion vectors of the second motion compensation block data so as to generate the motion vector of the first motion compensation block data.
In yet another embodiment, an encoding device is provided for encoding a moving image including a motion predicting and compensating mechanism for generating a motion vector of a first motion compensation block data in the moving image by using a motion vector of a third motion compensation block data which have already been generated and have a predetermined positional relationship between the first motion compensation block data in place of the motion vector of a second motion compensation block data having a predetermined positional relationship between the first motion compensation block data, when the motion vector of the second motion compensation block data have not been yet generated at the time of generating the motion vector of the first motion compensation block data and generating a predictive image data on the basis of the generated motion vector; and an encoding mechanism for encoding the motion vector generated by the motion predicting and compensation means and a difference between the moving image data and the predictive image data.
The mode of operation of the encoding device according to an embodiment is as follows. First, when a motion predicting and compensating mechanism generates a motion vector of first motion compensation block data in moving picture data and motion vectors of second motion compensation block data which have predetermined positional relationships with respect to the first motion compensation block data have not yet been generated, it uses already generated motion vectors of third motion compensation block data which have predetermined positional relationships with respect to the first motion compensation block data in place of the motion vectors of the second motion compensation block data so as to generate the motion vector of the first motion compensation block data and generates predicted image data based on the motion vector. Next, the encoding mechanism encodes the motor vector generated by the motion predicting and compensating means and the difference between the moving picture data and the predicted image data.
In still yet another embodiment, a data processing apparatus is provided for generating a motion vector of a first motion compensation block data to be processed in a moving image data by using a motion vector of a second motion compensation block having a predetermined positional relationship between the first motion compensation block data. The data processing apparatus includes a thinning mechanism for thinning a first reference image data to generate a second reference image data and a generating means for searching in the second reference image data to generate a first motion vector of the first motion compensation block data and searching in a searching range prescribed by the first motion vector in the first reference image data to generate a second motion vector of the first motion compensation block data, wherein the second motion vector of the first motion compensation block data is generated by using the second motion vector of the second motion compensation block data when the second motion vector have already been generated and generates the second motion vector of the first motion compensation block data by using the first motion vector of the second motion compensation block data.
The mode of operation of the data processing apparatus in an embodiment is as follows. First, a thinning mechanism thins first reference image data of the moving picture data to generate second reference image data. Then, the generating mechanism searches through the second reference image data generated by the thinning means to generate a first motion vector of the first motion compensation block data. Then, the generating mechanism searches through the search range prescribed by the first motion vector in the first reference image data to generate a second motion vector of the first motion compensation block data. At this time, when the second motion vector of the second motion compensation block data has been already generated, the generating mechanism uses the second motion vector to generate the second motion vector of the first motion compensation block data, while when the second motion vector of the second motion compensation block data has not yet been generated, uses the first motion vector of the second motion compensation block data to generate the second motion vector of the first motion compensation block data.
In a further embodiment, a method of data processing is provided for generating a motion vector of a first motion compensation block data to be processed in a moving image data by using a motion vector of a second motion compensation block having a predetermined positional relationship between the first motion compensation block data. The method includes thinning a first reference image data to generate a second reference image data; searching in the second reference image data generate by the first step to generate a first motion vector of the first motion compensation block data; and searching in a searching range prescribed by the first motion vector generated by the second step in the first reference image data to generate a second motion vector of the first motion compensation block data; wherein the second motion vector of the first motion compensation block data is generated by using the second motion vector of the second motion compensation block data when the second motion vector have already been generated and the second motion vector of the first motion compensation block data is generated by using the first motion vector of the second motion compensation block data.
The mode of operation of the data processing method in an embodiment is as follows. First, it thins first reference image data of moving picture data to generate second reference image data. Next, it searches through the second reference image data generated at the first step to generate a first motion vector of the first motion compensation block data. Next, it searches through the search range prescribed by the first motion vector generated at the second step in the first reference image data to generate a second motion vector of the first motion compensation block data. At this time, when the second motion vector of the second motion compensation block data has been already generated at the third step, it uses the second motion vector to generate the second motion vector of the first motion compensation block data, while when the second motion vector of the second motion compensation block data has not yet been generated, it uses the first motion vector of the second motion compensation block data to generate the second motion vector of the first motion compensation block data.
In yet a further embodiment, an encoding device is provided for generating a motion vector of a first motion compensation block data to be processed in a moving image data by using a motion vector of a second motion compensation block having a predetermined positional relationship between the first motion compensation block data and encoding the moving image data by using the motion vector. The encoding device includes a thinning mechanism for thinning a first reference image data to generate a second reference image data; a generating mechanism for searching in the second reference image data to generate a first motion vector of the first motion compensation block data and searching in a searching range prescribed by the first motion vector in the first reference image data to generate a second motion vector of the first motion compensation block data; and a predictive image generating mechanism for generating a predictive image data on the basis of the second motion vector generated by the generating mechanism; and an encoding mechanism for encoding the second motion vector generated by generating mechanism and a difference between the moving image data and the predictive image data by the predictive image generating mechanism; wherein the second motion vector of the first motion compensation block data is generated by using the second motion vector of the second motion compensation block data when the second motion vector have already been generated and generates the second motion vector of the first motion compensation block data by using the first motion vector of the second motion compensation block data.
Additional features and advantages of the present invention are described in, and will be apparent from, the following Detailed Description of the Invention and the figures.
The present invention relates to a data processing apparatus for generating a motion vector of moving picture data and a method and an encoding device of the same.
Below, an explanation will be given of encoding devices of the H.264/AVC system according to embodiments of the present invention.
Below, an embodiment of the present invention will be explained by referring to
Next, an explanation will be given of characteristic features of the motion prediction and compensation circuit 46 by referring to
Below, a detailed explanation will be given of a communication system 1 of the first embodiment.
Below, an explanation will be given of the encoding device 2 shown in
Below, an explanation will be given of the components of the encoding device 2. The A/D conversion circuit 22 converts an original image signal S10 that includes an input analog luminance signal Y and color difference signals Pb and Pr to digital frame data S22 and outputs this to the picture rearrangement buffer 23. The picture rearrangement buffer 23 outputs frame data S23 obtained by rearranging the frame data S22 input from the A/D conversion circuit 22 to the encoding sequence in accordance with GOP (Group Of Pictures) structure comprised of picture types I, P, and B thereof to the processing circuit 24, the intra prediction circuit 41, and the motion prediction and compensation circuit 46.
The processing circuit 24 generates image data S24 indicating the difference between the frame data S23 and the predictive image data PI input from the selection circuit 44 and outputs this to the orthogonal transform circuit 25. The orthogonal transform circuit 25 applies an orthogonal transform such as a discrete cosine transform or Karhunen-Loeve transform to the image data S24 to generate image data (for example DCT coefficient) S25 and outputs this to the quantization circuit 26. The quantization circuit 26 quantizes the image data S25 with a quantization scale input from the rate control circuit 32 to generate image data S26 and outputs this to the reversible encoding circuit 27 and the inverse quantization circuit 29.
The reversible encoding circuit 27 stores the image data obtained by variable length encoding or arithmetic encoding of the image data S26 in the buffer 28. At this time, when the selection data S44 indicates that inter prediction encoding was selected, the reversible encoding circuit 27 encodes the motion vector MV input from the motion prediction and compensation circuit 46 and stores this in the header data.
The image data stored in the buffer 28 is modulated, then transmitted. The inverse quantization circuit 29 generates the signal obtained by inverse quantizing of the image data S26 and outputs this to the inverse orthogonal transform circuit 30. The inverse orthogonal transform circuit 30 outputs the image data generated by applying the inverse transform of the orthogonal transform in the orthogonal transform circuit 25 to the image data input from the inverse quantization circuit 29 to the deblock filter 37. The deblock filter 37 writes the image data cleared of block distortion of the image data input from the inverse orthogonal transform circuit 30 into the frame memories 31 and 45. The rate control circuit 32 generates a quantization scale based on the image data read out from the buffer 23 and outputs this to the quantization circuit 26.
The intra prediction circuit 41 applies intra prediction encoding to each macro block data MB composing the image data read out from the frame memory 45 based on each of the intra prediction modes prescribed in advance by for example H.264/AVC to generate the predictive image and detects difference DIF between the predictive image data and the frame data S23. Then, the intra prediction circuit 41 outputs the predictive image data PI by the intra prediction mode corresponding to the minimum difference among the above differences generated for each of the above plurality of intra prediction modes and the difference DIF to the selection circuit 44.
The selection circuit 44 compares the difference DIF input from the intra prediction circuit 41 and the difference DIF input from the motion prediction and compensation circuit 46. When deciding that the difference DIF input from the intra prediction circuit 41 is smaller by the comparison, the selection circuit 44 selects the predictive image data PI input from the intra prediction circuit 41 and outputs this to the processing circuit 24. When deciding that the difference DIF input from the motion prediction and compensation circuit 46 is smaller by the above comparison, the selection circuit 44 selects the predictive image data PI input from the motion prediction and compensation circuit 46 and outputs this to the processing circuit 24. Further, the selection circuit 44 outputs selection data S44 indicating that the inter prediction encoding was selected to the reversible encoding circuit 27 when selecting the predictive image data PI from the intra prediction circuit 41, while outputs the selection data S44 indicating that the intra prediction encoding was selected to the reversible encoding circuit 27 when selecting the predictive image data PI from the motion prediction and compensation circuit 46.
Below, an explanation will be given of the motion prediction and compensation circuit 46.
The MV generation unit 51 calculates index data SAD in accordance with the sum of differences among pixel data between the designated motion compensation block data MCB and the motion compensation block data MCB in the search range SR of the reference image data REF from the frame memory 31 as shown in
The predictive vector generation unit 52 generates for example the predictive motion vector PMV of the motion compensation block data MCB which is covered by the processing in the MV generation unit 51. Here, an explanation will be given of the predictive motion vector PMV of the motion compensation block data MCB prescribed by the H.264/AVC. In the H.264/AVC, for example the predictive motion vector PMV of the motion compensation block data MCB_E shown in
For example, when the motion vectors MV of the motion compensation block data MCB having the predetermined positional relationships determined in advance with respect to the motion compensation block data MCB for which the predictive motion vector PMV is to be generated have not yet been generated, the predictive vector generation unit 52 uses the already generated motion vectors MV of other motion compensation block data MCB in place of the same. Below, a case where for example the motion compensation block data MCB to be generated of the predictive motion vector PMV (hereinafter also referred to as the first motion compensation block data MCB) and the motion compensation block data MCB having predetermined positional relationships determined in advance with respect to the former (hereinafter also referred to as second motion compensation block data MCB) belong to the same macro block data MB will be considered. In this case, when generating the predictive motion vector PMV of the first motion compensation block data MCB, there is possibility that the motion vectors MV of the second motion compensation block data MCB have not yet been generated. Namely, in the example shown in
In the same way as above, as shown in
The MCB selection unit 53 generates the predetermined index data J2 based on the motion vectors MV input from the MV generation unit 51 and selects the motion vector MV of the motion compensation block data MCB minimizing the index data J2 among the motion compensation block data MCB shown in
The predictive image generation unit 54 generates the predictive image data PI by using the reference image data REF based on the motion vector MV and the data indicating the type of the MCB input from the MCB selection unit 53. Further, the predictive image generation unit 54 generates the difference DIF between the frame data S23 and the predictive image data PI.
Below, an explanation will be given of an example of operation of the motion prediction and compensation circuit 46.
Step ST1
The motion prediction and compensation circuit 46 selects the unprocessed macro block data MB in the frame data S23 input from the picture rearrangement buffer 23 as the processing object.
Step ST2
The motion prediction and compensation circuit 46 designates not designated motion compensation block data MCB among the motion compensation block data MCB shown in
Step ST3
The MV generation unit 51 calculates the index data SAD indicating the sum of differences among pixel data between the motion compensation block data MCB and the motion compensation block data MCB in the search range SR of the reference image data REF from the frame memory 31 as shown in
Step ST4
The predictive vector generation unit 52 calculates the predictive motion vector PMV of the motion compensation block data MCB to be processed based on the already generated motion vectors MV of the other motion compensation block data MCB.
Step ST5
The MV generation unit 51 calculates the information amount data R indicating the amount of information of the difference motion vectors DMV between the predictive vector PMV from the predictive vector generation unit 52 and the motion vectors MV in accordance with the position of the motion compensation block data MCB in the search range SR of the reference image data REF.
Step ST6
The MV generation unit 51 calculates the index data J1 indicating the sum of the index data SAD calculated at step ST3 and the information amount data R calculated at step ST5.
Step ST7
The MV generation unit 51 searches for the motion compensation block data MCB minimizing the index data J1 calculated at step ST6 in the search range SR of the reference image data REF, specifies the motion vector MV in accordance with the position of the found motion compensation block data MCB, and outputs this to the MCB selection unit 53.
Step ST8
The MCB selection unit 53 performs the predetermined processing based on the motion vector MV input at step ST7, calculates the index data J2 indicating the value in accordance with the sum of differences between pixel data of the frame data S23 and the image data obtained by recomposition based on the motion vector MV, and outputs this to the predictive image generation unit 54 together with the motion vector MV.
Step ST9
The MCB selection unit 53 decides whether or not processings of steps ST2 to ST8 were carried out for all motion compensation block data MCB shown in
Step ST10
The MCB selection unit 53 specifies the minimum index data among the index data J2 calculated at step ST8 for all motion compensation block data MCB shown in
Step ST11
The predictive image generation unit 54 decides whether or not processings of all macro block data MB in the frame data S23 input from the picture rearrangement buffer 23 ended. If ended, the routine proceeds to step ST12, when if not, the routine returns to step ST1.
Step ST12
The predictive image generation unit 54 uses the reference image data REF to generate the predictive image data PI based on the motion vector MV and the data indicating the type of the motion compensation block data MCB input from the MCB selection unit 53 for all macro block data MB composing the frame data S23. Further, the predictive image generation unit 54 generates the difference DIF between the frame data S23 and the predictive image data PI and outputs this to the selection circuit 44. Further, the predictive image generation unit 54 outputs the motion vector MV to the reversible encoding circuit 27.
Below, a detailed explanation will be given of an example of operation of the method of generation of the predictive motion vector PMV of step ST4 shown in
Step ST21
The predictive vector generation unit 52 decides whether or not the motion vectors MV of the second motion compensation block data MCB having the predetermined positional relationships determined in advance with respect to the first motion compensation block data MCB for which the predictive motion vector PMV is to be generated have been already generated. When deciding that the motion vectors MV has been already generated, the routine proceeds to step ST22, while when deciding they have not, the routine proceeds to step ST23. In the example shown in
Step ST22
The predictive vector generation unit 52 uses the motion vectors MV of the second motion compensation block data MCB to generate the predictive motion vector PMV of the first motion compensation block data MCB. In the example shown in
Step ST23
The predictive vector generation unit 52 uses the already generated motion vectors MV of the third motion compensation block data MCB in place of the motion vectors MV of the second motion compensation block data MCB to generate the predictive motion vector PMV of the first motion compensation block data MCB. In the example shown in
Below, an explanation will be given of the overall operation of the encoding device 2 shown in
Next, the orthogonal transform circuit 25 applies an orthogonal transform such as a discrete cosine transform or a Karhunen-Loeve transform to the image data S24 to generate the image data S25 and outputs this to the quantization circuit 26. Next, the quantization circuit 26 quantizes the image data S25 and outputs the quantized transform coefficient S26 to the reversible encoding circuit 27 and the inverse quantization circuit 29. Next, the reversible encoding circuit 27 applies reversible encoding such as variable length encoding or arithmetic encoding to the variable coefficient S26 to generate the image data and stores this in the buffer 28. Further, the rate control circuit 32 controls the quantization rate in the quantization circuit 26 based on the image data read out from the buffer 28.
Further, the inverse quantization circuit 29 inversely quantizes the variable coefficient S26 input from the quantization circuit 26 and outputs the inversely quantized variable coefficient to the inverse orthogonal transform circuit 30. The inverse orthogonal transform circuit 30 outputs the frame data generated by applying the inverse transform of the orthogonal transform in the orthogonal transform circuit 25 to the image data input from the inverse quantization circuit 29 to the deblock filter 37. The deblock filter 37 writes the image data cleared of block distortion of the variable coefficient input from the inverse orthogonal transform circuit 30 into the frame memories 31 and 45.
Then, the intra prediction circuit 41 performs the intra prediction coding and outputs the predictive image data PI thereof and the difference DIF to the selection circuit 44. Further, the motion prediction and compensation circuit 46 generates the motion vectors MV as explained by using
As explained above, in the motion prediction and compensation circuit 46 of the encoding device 2, as explained by using
Below, an explanation is provided according to another embodiment of the present invention as illustrated in
The encoding device of the present embodiment is the same as the encoding device 2 of the above first embodiment except for the processing of the motion prediction and compensation circuit 46.
For example, in the example shown in
On the other hand, the predictive vector generation unit 65 uses the full resolution motion vectors MV to generate the predictive motion vector PMV when for example the full resolution motion vectors MV of the motion compensation block data MCB having the predetermined positional relationships determined in advance with respect to the motion compensation block data MCB for which the predictive motion vector PMV is to be generated have been already generated.
Then, the full resolution MV generation unit 64 searches for the full resolution motion vector MV of the motion compensation block data MCB to be processed of the frame data S23 by using the predictive motion vector PMV in the same way as the first embodiment in the search range prescribed by the motion vector MV63 in the reference image data REF.
As explained above, according to an embodiment of the present invention, when the full resolution motion vectors MV of the second motion compensation block data MCB having positional relationships determined in advance with respect to the first motion compensation block data MCB have not yet been generated, the motion prediction and compensation circuit 46a does not make the motion vectors MV “0”, but uses the already generated ¼ resolution motion vector MV63 for the second motion compensation block data to generate the predictive motion vector PMV of the first motion compensation block data MCB. For this reason, according to the motion prediction and compensation circuit 46a, the predictive motion vectors PMV of all motion compensation block data can be generated, and all motion compensation block data can be adequately encoded.
The present invention is not limited to the above embodiments. In the above first embodiment, as shown in
According to an embodiment of the present invention, there can be provided a data processing apparatus which, when generating a motion vector of first motion compensation block data to be processed in moving picture data by using motion vectors of second motion compensation block data having predetermined positional relationships with respect to the first motion compensation block data, is capable of generating the motion vector of the first motion compensation block data even when the motion vectors of the second motion compensation block data are not yet generated and a method and an encoding device of the same.
It should be understood that various changes and modifications to the presently preferred embodiments described herein will be apparent to those skilled in the art. Such changes and modifications can be made without departing from the spirit and scope of the present invention and without diminishing its intended advantages. It is therefore intended that such changes and modifications be covered by the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
2003-373847 | Nov 2003 | JP | national |