1. Field of the Invention
In general, the present invention relates to a motion-vector computation apparatus, a motion-vector computation method and a motion-vector computation program. More particularly, the present invention relates to a motion-vector computation apparatus for computing a motion vector for a frame by taking each of blocks composing the frame as a motion-vector computation unit, relates to a motion-vector computation method adopted by the motion-vector computation apparatus and relates to a motion-vector computation program to be executed by a computer in order to implement the motion-vector computation method.
2. Description of the Related Art
The MPEG (Moving Picture Expert Group) method and the H.264 method have each been known so far as a compression/coding method for compressing and coding moving-picture data. In these compression/coding methods, each of frames composing moving-picture data is divided into a plurality of blocks which are each also referred to as a macro block. In accordance with these compression/coding methods, the macro block is used as a motion-vector computation unit in carrying out an encoding or decoding process on the frames. In a typical decoding process known so far for example, first of all, a motion vector is computed by carrying out prediction processing to predict the motion vector for each of macro block units which compose a frame. Then, the decoding process is carried out to decode the frames in order to produce the moving-picture data on the basis of the computed motion vectors.
For example, there has been known an inter-frame prediction processing apparatus for calculating an address in a memory used for storing a motion vector of a referenced object, reading out the motion vector of the referenced object from the address in the memory and computing a predicted value of the motion vector. For more information on the inter-frame prediction processing apparatus, the reader is advised to refer to documents such as Japanese Patent Laid-Open No. 2008-48289 (FIG. 1).
In accordance with the related-art technology described above, the inter-frame prediction processing apparatus is capable of calculating an address in a memory used for storing a motion vector of a referenced object and reading out the motion vector of the referenced object from the address in the memory. It is thus possible to compute a predicted value of the motion vector at a high speed.
In this case, in accordance with the H.264 method for example, it is possible to select a mode for an encoding process carried out in frame units or a mode for an encoding process carried out in field units. In addition, the H.264 method also offers an MBAFF (Macro Block Adaptive Frame/Field) coding mode in which it is possible to switch the encoding mode from a field prediction mode to a frame prediction mode and vice versa for every macro block pair. A macro block pair is a pair of two macro blocks adjacent to each other in the vertical direction. In the field prediction mode, a macro block on the upper side includes only top fields whereas a macro block on the lower side includes only bottom fields.
In an operation to compute a motion vector for a processing-subject macro block serving as a subject of prediction processing for example, it is necessary to reference motion vectors of surrounding macro blocks which are each also referred to as a referenced macro block. The referenced macro blocks are macro blocks surrounding the processing-subject macro block which serves as a subject of the prediction processing. This macro-block computation operation requires pixels of the processing-subject macro block serving as a subject of the prediction processing and motion vectors of referenced macro blocks adjacent to the processing-subject macro block in the frame structure. Thus, in the MBAFF mode for example, the address of the motion vector to be referenced as the motion vector of a referenced macro block changes in accordance with a combination of the field/frame mode of the processing-subject macro block and the field/frame modes of the surrounding macro blocks.
In addition, in the MBAFF mode, if the structure of a processing-subject macro block is different from the structure of a referenced macro block, it is necessary to carry out a correction process to adjust the value of the Y-axis direction component of the motion vector computed for a referenced macro block to the structure of the processing-subject macro block and, then, carry out prediction processing on the motion vector. In this case, for the motion vector of a certain macro block for example, it is quite within the bounds of possibility that the four referenced macro blocks are referenced, requiring a referencing operation to be carried out up to four times for the four referenced macro blocks respectively. Thus, each time the motion vector of a referenced macro block is referenced, the motion vector referenced as the motion vector of a referenced macro block is subjected to the correction process. As a result, it feared that the efficiency of the processing to predict the motion vector becomes poor.
As described above, in execution of an operation to predict a motion vector in the MBAFF mode, the operation may become complicated in accordance with the aforementioned combination of the field/frame mode of the processing-subject macro block and the field/frame modes of the surrounding macro blocks. Thus, it is important that the speed of the operation to predict a motion vector be increased for any of such combinations.
Addressing the problems described above, inventors of the present invention have proposed a motion-vector computation apparatus capable of computing a motion vector at a high speed in a motion-vector prediction process and proposed a motion-vector computation method to be adopted in the motion-vector computation apparatus.
In order to solve the problems described above, in accordance with a first embodiment of the present invention, there are provided a motion-vector computation apparatus for computing a motion vector, a motion-vector computation method adopted by the motion-vector computation apparatus and a motion-vector computation program to be executed by a computer for implementing the motion-vector computation method. The motion-vector computation apparatus includes a motion-vector correction section configured to correct a referenced motion vector to be used in a process to compute a motion vector of a second macro block pair so as to make the referenced motion vector compatible with a specific structure. The referenced motion vector is one of motion vectors already computed for a first macro block pair. Each of the first and second macro block pairs is a macro block pair having a frame structure or a field structure. The macro block pairs each having a frame structure or a field structure are each a macro block pair obtained as a result of respectively a frame or field encoding process carried out as encoding processing for every macro block pair by switching the encoding processing from the frame encoding process to the field encoding process and vice versa. The specific structure is either the frame structure or the field structure. The motion-vector computation apparatus further includes: a motion-vector holding section configured to store the referenced motion vector corrected to a motion vector compatible with the specific structure at an address determined in accordance with the structure of the first macro block pair; and a motion-vector computation section configured to read out the referenced motion vector from the motion-vector holding section in accordance with the structure of the second macro block pair and compute a motion vector of the second macro block pair on the basis of the referenced motion vector read out from the motion-vector holding section.
Thus, an effect is exhibited by the above configuration in which: the motion-vector correction section corrects the referenced motion vector to be used in a process to compute a motion vector of a second macro block pair so as to make the referenced motion vector compatible with the specific structure which can be a frame or field structure; the motion-vector holding section is used for storing the referenced motion vector corrected to a motion vector compatible with the specific structure at an address determined in accordance with the structure of the first macro block pair; and the motion-vector computation section reads out the referenced motion vector from the motion-vector holding section in accordance with the structure of the second macro block pair and computes a motion vector of the second macro block pair on the basis of the referenced motion vector read out from the motion-vector holding section.
In addition, another effect can be obtained in the first embodiment of the present invention by providing a configuration in which the motion-vector correction section takes the frame structure as the specific structure and corrects the referenced motion vector so as to make the referenced motion vector compatible with the frame structure. That is to say, in the first embodiment of the present invention, it is possible to exhibit the other effect by providing a configuration for correcting the referenced motion vector to a motion vector compatible with the frame structure.
On top of that, a further effect can be obtained in the first embodiment of the present invention by providing a configuration in which, if the first macro block pair has the field structure, the motion-vector correction section corrects the referenced motion vector by doubling the vertical-direction component of the referenced motion vector but, if the first macro block pair is a macro block pair having the frame structure, on the other hand, the motion-vector correction section does not correct the referenced motion vector. That is to say, in the first embodiment of the present invention, it is possible to exhibit the further effect by providing a configuration for doubling the vertical-direction component of the referenced motion vector of a first macro block pair having the field structure and by not correcting the referenced motion vector of a first macro block pair having the frame structure.
In addition, a still further effect can be obtained in the first embodiment of the present invention by providing the motion-vector computation section with: a motion-vector predicted-value computation section configured to compute a predicted value of a motion vector of the second macro block pair on the basis of the referenced motion vector read out from the motion-vector holding section; and a motion-vector predicted-value correction section configured to correct the predicted value of the motion vector so as to make the predicted value of the motion vector compatible with the field structure of the second macro block pair in case the second macro block pair has the field structure.
That is to say, in the first embodiment of the present invention, it is possible to exhibit the still further effect by providing a configuration in which: the motion-vector predicted-value computation section employed in the motion-vector computation section computes a predicted value of a motion vector of the second macro block pair on the basis of the referenced motion vector read out from the motion-vector holding section; and if the second macro block pair has, the motion-vector predicted-value correction section employed in the motion-vector computation section corrects the predicted value of the motion vector of the second macro block pair so as to make the predicted value of the motion vector compatible with the field structure of the second macro block pair.
On top of that, a still further effect can be obtained in the first embodiment of the present invention by providing a configuration in which, if the second macro block pair has the field structure, the motion-vector predicted-value correction section corrects the predicted value of the motion vector by halving the vertical-direction component of the predicted value of the motion vector but, if the second macro block pair has the frame structure, on the other hand, the motion-vector correction section does not correct the predicted value of the motion vector. That is to say, in the first embodiment of the present invention, it is possible to exhibit the still further effect by providing a configuration for halving the vertical-direction component of the predicted value of the motion vector of a second macro block pair having the field structure and by not correcting the predicted value of the motion vector of a second macro block pair having the frame structure.
In addition, a still further effect can be obtained in the first embodiment of the present invention by providing the motion-vector computation apparatus with a parameter determination section configured to determine parameters, which are to be used in deblocking mode processing related to the second macro block pair, on the basis of the referenced motion vectors read out from the motion-vector holding section and on the basis of a motion vector computed for the second macro block pair and corrected so as to make the motion vector compatible with the specific structure. That is to say, in the first embodiment of the present invention, it is possible to exhibit the still further effect by providing a configuration in which the parameter determination section determines parameters, which are to be used in deblocking mode processing to be carried out as processing related to the second macro block pair, on the basis of the referenced motion vectors read out from the motion-vector holding section and on the basis of a motion vector computed by the motion-vector computation section for the second macro block pair and corrected by the motion-vector correction section so as to make the motion vector compatible with the specific structure.
In accordance with the present invention, it is possible to exhibit an excellent effect of providing a high speed at which a process is carried out to compute a motion vector in motion-vector prediction processing.
Preferred embodiments of the present invention are explained in chapters which are arranged in the following order.
This chapter explains control of motion-vector computation. To be more specific, this chapter explains typical computation of a motion vector in the MBAFF mode.
This chapter explains control of motion-vector computation in direct mode processing or explains typical computation of a motion vector in the direct mode.
The arithmetic decoding processing section 110 carries out a CABAC (Context-based Adaptive Binary Arithmetic Coding) process on a stream which is supplied to the arithmetic decoding processing section 110 through a signal line 191. Then, the arithmetic decoding processing section 110 finds a difference value Mvd from a motion vector predicted value Mvp generated by the motion-vector predicted-value correction section 170. Finally, the arithmetic decoding processing section 110 supplies the difference value Mvd from a motion vector predicted value Mvp to the adder 120.
The adder 120 adds a difference value received from the arithmetic decoding processing section 110 as the difference value Mvd from a motion vector predicted value Mvp to the motion vector predicted value Mvp which has been received from the motion-vector predicted-value correction section 170. Then, the adder 120 supplies a sum Mv obtained from the addition as the sum of the difference value Mvd and the motion vector predicted value Mvp and a deblocking mode processing section (not shown in
Mv=Mvp+Mvd
In the following description, the macro block serving as the subject of processing is referred to as a processing-subject macro block.
The motion-vector correction section 130 is a processor for carrying out correction processing on the motion vector Mv received from the adder 120 so as to make the motion vector Mv compatible with a specific structure such as the aforementioned frame structure of the processing-subject macro block. To put it in detail, for a motion vector Mv computed for a processing-subject macro block having a field structure, the value of the Y-axis component of the motion vector Mv is doubled so that the Y-axis component of the motion vector Mv becomes compatible with the frame structure. It is to be noted that the Y-axis component of the motion vector Mv is the component in the vertical direction. For a motion vector Mv computed for a processing-subject macro block having a frame structure, on the other hand, the motion-vector correction section 130 does not carry out the correction processing.
The motion-vector correction section 130 supplies the motion vector Mv compatible with the frame structure to the address conversion section 140, the deblocking mode parameter determination section 181 and the deblocking mode parameter determination section 182. As described above, the correction processing is processing to merely double the value of the Y-axis component of the motion vector Mv. Thus, the motion-vector correction section 130 can be implemented by a 1-bit right-shift processor.
The address conversion section 140 determines an address in the motion-vector buffer 200 to be used as an address at which a motion vector Mv output by the motion-vector correction section 130 is to be stored. The address conversion section 140 then stores the motion vector Mv output by the motion-vector correction section 130 in the motion-vector buffer 200 at the address determined by the address conversion section 140. To put it more concretely, the address conversion section 140 determines the address in accordance with whether the structure of a macro block for which the motion vector Mv has been computed is the frame or field structure. It is to be noted that a method for determining the address will be described later in detail by referring to
The motion-vector buffer 200 is used for storing a motion vector Mv output by the motion-vector correction section 130 at an address which has been determined by the address conversion section 140. A motion vector Mv stored in the motion-vector buffer 200 is read out from the motion-vector buffer 200 and supplied to the motion-vector predicted-value computation section 160, the deblocking mode parameter determination section 181 as well as the deblocking mode parameter determination section 182. To put it more concretely, the motion-vector buffer 200 provides the motion-vector predicted-value computation section 160 with a left upper referenced motion vector MvC which is a motion vector selected among motion vectors Mv stored in the motion-vector buffer 200. In addition, the motion-vector buffer 200 provides the motion-vector predicted-value computation section 160 and the deblocking mode parameter determination section 181 with a left-side referenced motion vector MvA which is also a motion vector selected among motion vectors Mv stored in the motion-vector buffer 200. On top of that, the motion-vector buffer 200 provides the motion-vector predicted-value computation section 160 and the deblocking mode parameter determination section 182 with an upper-side referenced motion vector MvB which is also a motion vector selected among motion vectors Mv stored in the motion-vector buffer 200.
It is to be noted that contents stored in the motion-vector buffer 200 as contents representing the motion vectors Mv will be explained later in detail by referring to
The motion-vector predicted-value computation section 160 computes a predicted value Mvp of a motion vector of a processing-subject macro block on the basis of motion vectors Mv stored in the motion-vector buffer 200. The motion vectors Mv stored in the motion-vector buffer 200 to be used as a basis in the computation of the motion-vector predicted value Mvp are the left upper referenced motion vector MvC, the left-side referenced motion vector MvA and the upper-side referenced motion vector MvB which are each a motion vector selected among motion vectors Mv stored in the motion-vector buffer 200 as described above.
In addition, the motion-vector predicted-value computation section 160 properly changes the motion vectors to be loaded from the motion-vector buffer 200 in accordance with whether the structure of the processing-subject macro block for which the motion vector Mv has been computed is the frame or field structure. Then, from the three motion vectors, that is, the left upper referenced motion vector MvC, the left-side referenced motion vector MvA and the upper-side referenced motion vector MvB, the motion-vector predicted-value computation section 160 selects a median value of the X-axis components of the motion vectors and a median value of Y-axis components of the motion vectors. Subsequently, the motion-vector predicted-value computation section 160 supplies the median values selected thereby to the motion-vector predicted-value correction section 170. Finally, the motion-vector predicted-value correction section 170 computes the motion-vector predicted value Mvp by making use of the median values received from the motion-vector predicted-value computation section 160.
It is to be noted that a method for computing the motion-vector predicted value Mvp will be described later in detail by referring to, among others,
The motion-vector predicted-value correction section 170 is a processor for carrying out a correction process according to the structure of the processing-subject macro block to correct the motion-vector predicted value Mvp which has been received from the motion-vector predicted-value computation section 160. This is because every motion vector Mv stored in the motion-vector buffer 200 is a motion vector compatible with the frame structure. Thus, the motion-vector predicted-value correction section 170 needs to carry out a correction process according to the structure of the processing-subject macro block.
To put it more concretely, if the structure of the processing-subject macro block is the field structure, the motion-vector predicted-value correction section 170 carries out the correction process by doubling the Y-axis component value of the motion-vector predicted value Mvp which has been received from the motion-vector predicted-value computation section 160. In this way, the Y-axis component value of the motion-vector predicted value Mvp is corrected to a value which is compatible with the frame structure.
If the structure of the processing-subject macro block is the frame structure, on the other hand, the motion-vector predicted-value correction section 170 does not carry out the correction process to correct the motion-vector predicted value Mvp which has been received from the motion-vector predicted-value computation section 160.
In either case, the motion-vector predicted-value correction section 170 supplies a motion-vector predicted value Mvp obtained as a result of the correction process according to the processing-subject macro block to the adder 120.
It is to be noted that the arithmetic decoding processing section 110, the adder 120, the motion-vector predicted-value computation section 160 and the motion-vector predicted-value correction section 170 form a typical example of a motion-vector computation section described in a claim appended to this invention specification. That is to say, the arithmetic decoding processing section 110, the adder 120, the motion-vector predicted-value computation section 160 and the motion-vector predicted-value correction section 170 read out a referenced motion vector from the motion-vector buffer 200 in accordance with the structure of the processing-subject macro block and compute the motion vector of the processing-subject macro block on the basis of the referenced motion vector read out from the motion-vector buffer 200.
The deblocking mode parameter determination section 181 is a section for determining a deblock strength parameter BsV of the processing-subject macro block. To put it in detail, the deblocking mode parameter determination section 181 determines a deblock strength parameter BsV of the processing-subject macro block by making use of a motion vector Mv received from the motion-vector correction section 130 and the left-side referenced motion vector MvA read out from the motion-vector buffer 200. The deblocking mode parameter determination section 181 then supplies the deblock strength parameter BsV determined thereby to a deblocking mode processing section not shown in
By the same token, the deblocking mode parameter determination section 182 is a section for determining a deblock strength parameter BsH of the processing-subject macro block. To put it in detail, the deblocking mode parameter determination section 182 determines a deblock strength parameter BsH of the processing-subject macro block by making use of a motion vector Mv received from the motion-vector correction section 130 and the upper-side referenced motion vector MvB read out from the motion-vector buffer 200. The deblocking mode parameter determination section 182 then supplies the deblock strength parameter BsH determined thereby to a deblocking mode processing section not shown in
A method for determining the deblock strength parameters BsV and BsH is explained as follows. Each of the deblock strength parameters BsV and BsH is a deblock parameter between processing-subject macro blocks which each do not have a Luma orthogonal conversion coefficient. The deblock strength parameter BsV is determined on the basis of the absolute value of the difference between the X-axis component of the motion vector Mv and the X-axis component of the left-side referenced motion vector MvA and the absolute value of the difference between the Y-axis component of the motion vector Mv and the Y-axis component of the left-side referenced motion vector MvA. By the same token, the deblock strength parameter BsH is determined on the basis of the absolute value of the difference between the X-axis component of the motion vector Mv and the X-axis component of the upper-side referenced motion vector MvB and the absolute value of the difference between the Y-axis component of the motion vector Mv and the Y-axis component of the upper-side referenced motion vector MvB.
To put it more concretely, if both the relation |MvAx−Mvx|<thx and the relation |MvAy−Mvy|<thy hold true, the deblock strength parameter BsV is set at 0 (that is, BsV=0). If both the relation |MvAx−Mvx|<thx and the relation |MvAy−Mvy|<thy do not hold true, on the other hand, the deblock strength parameter BsV is set at 1 (that is, BsV=1).
In the above relations, notation MvAx denotes the X-axis component of the left-side referenced motion vector MvA, notation MvAy denotes the Y-axis component of the left-side referenced motion vector MvA, notation Mvx denotes the X-axis component of the motion vector Mv, notation Mvy denotes the Y-axis component of the motion vector Mv, notation thx denotes a threshold value set for the X-axis direction whereas notation thy denotes a threshold value set for the Y-axis direction.
By the same token, if both the relation |MvBx−Mvx|<thx and the relation |MvBy−Mvy|<thy hold true, the deblock strength parameter BsH is set at 0 (that is, BsH=0). If both the relation |MvBx−Mvx|<thx and the relation |MvBy−Mvy|<thy do not hold true, on the other hand, the deblock strength parameter BsH is set at 1 (that is, BsH=1).
In the above relations, notation MvBx denotes the X-axis component of the upper-side referenced motion vector MvB whereas notation MvBy denotes the Y-axis component of the upper-side referenced motion vector MvB.
The threshold value thx for the X-axis direction and the threshold value thy for the Y-axis direction are properly changed in accordance with the structure of the processing-subject-macro block. To put it more concretely, if the structure of the processing-subject macro block is the frame structure, the X-axis direction threshold value thx is set at 4 (that is, thx=4) whereas the Y-axis direction threshold value thy is set at 4 (that is, thy=4). If the structure of the processing-subject macro block is the field structure, on the other hand, the X-axis direction threshold value thx is set at 4 (that is, thx=4) whereas the Y-axis direction threshold value thy is set at 2 (that is, thy=2).
As described above, in the first embodiment of the present invention, each of the motion vector Mv output by the motion-vector correction section 130 and the left-side referenced motion vector MvA stored in the motion-vector buffer 200 is a motion vector compatible with the frame structure. In actuality, it is thus unnecessary to change the X-axis direction threshold value thx and the Y-axis direction threshold value thy in accordance with the structure of the processing-subject macro block. That is to say, thx=4 and thy=4 are used in determining the deblock strength parameter BsV and the deblock strength parameter BsH without regard to whether the structure of the processing-subject macro block is the frame or field structure. Thus, each of the deblock strength parameter BsV and the deblock strength parameter BsH can be determined at a high speed.
It is to be noted that each of the deblocking mode parameter determination sections 181 and 182 is a typical example of the parameter determination section described in a claim appended to this invention specification.
The motion-vector storage area 210 shown in
In this case, each of the four upper-side white rectangular blocks in every unit is a storage area used for storing a motion vector Mv of the top field whereas each of the four lower-side hatched rectangular blocks in every unit is a storage area used for storing a motion vector Mv of the bottom field.
In addition, as described above, notation N denotes an integer representing the number of macro blocks which are arranged in the horizontal direction to form a frame on a stream. In this case, the horizontal-direction position of a macro block or the horizontal-direction position of a unit associated with the macro block in the frame can be indicated by notation n where 1≦n≦N. For example, let n (=1) denote the horizontal-direction position of a macro block at the left end of the frame whereas n (=N) denote the horizontal-direction position of a macro block at the right end of the frame. In the frame, the N macro blocks are arranged in the left-to-right order which starts with the macro block positioned at the left end indicated by position 1 and ends at the macro block positioned at the right end indicated by position N. That is to say, the N macro blocks arranged in the left-to-right order to form a line in the frame are located at positions 1 to N respectively. A unit used in the following description represents one of the N macro blocks which are arranged in the left-to-right order to form a line in the frame and located at positions 1 to N respectively. In the following description for example, notation Hbuf[n] denotes a unit representing a specific macro block which is located at position n. The specific macro block located at position n is one the N macro blocks which are arranged in the left-to-right order to form a line in the frame and located at positions 1 to N respectively where 1≦n≦N.
On top of that, in the case of the first embodiment, the motion-vector storage area 210 includes (N+1) successive units where notation N denotes the number of macro blocks arranged in the horizontal direction to form a frame on a stream. Thus, notation Hbuf[−1] denotes a unit representing the leftmost macro block shown in
The motion-vector storage area 220 shown in
In this case, each of the four upper-side white rectangular blocks in the motion-vector storage area 220 is a storage area used for storing a motion vector Mv of the top macro block of the macro block pair whereas each of the four lower-side hatched rectangular blocks in the motion-vector storage area 220 is a storage area used for storing a motion vector Mv of the bottom macro block of the macro block pair. In addition, in the motion-vector storage area 220 shown in
For the motion vectors Mv stored in the motion-vector buffer 200 as described above, the motion-vector correction section 130 carries out correction processing so as to make the Y-axis component of each of the motion vectors Mv compatible with the frame structure. Thus, each of the motion vectors Mv is stored in the motion-vector buffer 200 in a state of being compatible with the frame structure.
Next, the following description explains effects which are exhibited as a result of fixing the Y-axis component of each of the motion vectors Mv stored in the motion-vector buffer 200 in a state of being compatible with the frame structure.
In the motion-vector flows shown in
In motion-vector prediction processing carried out to find a motion vector Mv, a motion-vector predicted value Mvp is computed by making use of three motion vectors which have been calculated for macro blocks surrounding the processing-subject macro block. To put it more concretely, from the three motion vectors, that is, the left upper referenced motion vector MvC, the left-side referenced motion vector MvA and the upper-side referenced motion vector MvB, the motion-vector predicted-value computation section 160 selects a median value of the X-axis components of the left upper referenced motion vector MvC, the left-side referenced motion vector MvA and the upper-side referenced motion vector MvB as well as a median value of Y-axis components of the left upper referenced motion vector MvC, the left-side referenced motion vector MvA and the upper-side referenced motion vector MvB. Subsequently, the motion-vector predicted-value computation section 160 supplies the median values selected thereby to the motion-vector predicted-value correction section 170. Finally, the motion-vector predicted-value correction section 170 computes the motion-vector predicted value Mvp by making use of the median values received from the motion-vector predicted-value computation section 160.
In this case, there may be presumably a case in which, for the three aforementioned motion vectors computed for macro blocks surrounding the processing-subject macro block, the frame and field structures coexist. For such a case in which the frame and field structures coexist as they are, accurate median values cannot be found as a result of the process to select a median value of the X-axis components of the three aforementioned motion vectors and a median value of Y-axis components of the three aforementioned motion vectors. Thus, for a case in which the frame and field structures coexist for the three aforementioned motion vectors computed for the macro blocks surrounding the processing-subject macro block, correction processing is generally carried out in order to make the structures of the motion vectors uniform. Then, a median value of the X-axis components of the three aforementioned motion vectors and a median value of Y-axis components of the three aforementioned motion vectors are selected by making use of the motion vectors which are each obtained as a result of the correction processing.
As described above, there may be presumably a case in which, for the three aforementioned motion vectors computed for macro blocks surrounding the processing-subject macro block, the frame and field structures coexist. For such a case, every time the motion-vector prediction processing is carried out, it is generally necessary to carry out correction processing in order to make the structures of the motion vectors uniform. For example, it is quite within the bounds of possibility that one motion vector is referenced for a plurality of processing-subject macro blocks. If the correction processing is carried out prior to every referencing process on the motion vector referenced for a plurality of processing-subject macro blocks, it is feared that the efficiency of the motion-vector prediction processing deteriorates.
In order to solve the above problem of the deteriorating efficiency of the motion-vector prediction processing, in the first embodiment of the present invention, the value of the Y-axis component of every motion vector Mv to be stored in the motion-vector buffer 200 is corrected in advance so as to make the Y-axis component of every motion vector Mv compatible with the frame structure.
As is obvious from the motion-vector flows shown in
As another example, as is obvious from the motion-vector flows shown in
As explained earlier by referring to
If the structure of the processing-subject macro block is the field structure, on the other hand, as is obvious from the motion-vector flows shown in
The models shown in
The motion-vector flows shown in
It is to be noted that the motion-vector flows shown in
An area 521 enclosed by a dashed line as shown in
Then, after completion of the motion-vector prediction processing carried out on the nth macro block pair, two motion vectors MV stored in a portion 522 of the unit Hbuf[−1] held in the motion-vector storage area 210 are transferred to a portion 523 of the unit Hbuf[n−1] held in the motion-vector storage area 210 as shown in
Subsequently, as shown in
Then, the motion-vector prediction processing is carried out for the (n+1)th macro block pair taken as the processing-subject macro block pair. When the (n+1)th macro block pair is taken as the processing-subject macro block pair, the units Hbuf[n] to Hbuf[n+2] in the motion-vector storage area 210 of the motion-vector buffer 200 become a referenced rectangular area 526 enclosed by a dashed line to serve as an area to be referenced to during the execution of the motion-vector prediction processing. As shown in
The transition described above as a transition of the subject of the motion-vector prediction processing from the nth macro block pair to the (n+1)th macro block pair is carried out in the same way as a transition of the subject of the motion-vector prediction processing from any subsequent macro block pair to a macro block pair immediately following the subsequent macro block pair. In the sequence of macro block pairs shown in
To be more specific, the motion-vector flows in the typical model shown in
As shown in
The motion-vector flows in the typical model shown in
As shown in
To put it more concretely, in the case of a processing-subject macro block pair 300 having the field structure, the lowermost row of the top field of the processing-subject macro block pair 300 includes macro blocks 305 to 308 whereas the lowermost row of the bottom field of the processing-subject macro block pair 300 includes of macro blocks 301 to 304. Each of the motion vectors Mv computed for the macro blocks 305 to 307 and 301 to 303 is a motion vector Mv to be stored in the motion-vector storage area 210. To put it in detail, the motion-vector correction section 130 corrects the motion vectors Mv computed for the macro blocks 305 to 308 and 301 to 304 by doubling the value of the Y-axis component of each of the motion vectors Mv computed for the macro blocks 305 to 308 and 301 to 304. Then, the address conversion section 140 stores the corrected motion vectors Mv computed for the macro blocks 305 to 307 and 301 to 303 in the unit Hbuf[n] of the motion-vector storage area 210 at addresses assigned to the macro blocks 305 to 307 and 301 to 303 respectively.
To be more specific, the corrected motion vector Mv computed for the macro block 301 is stored in a storage area 311 in the unit Hbuf[n]. By the same token, the corrected motion vector Mv computed for the macro block 302 is stored in a storage area 312 in the unit Hbuf[n]. In the same way, the corrected motion vector Mv computed for the macro block 303 is stored in a storage area 313 in the unit Hbuf[n].
Likewise, the corrected motion vector Mv computed for the macro block 305 is stored in a storage area 315 in the unit Hbuf[n]. By the same token, the corrected motion vector Mv computed for the macro block 306 is stored in a storage area 316 in the unit Hbuf[n]. In the same way, the corrected motion vector Mv computed for the macro block 307 is stored in a storage area 317 in the unit Hbuf[n].
Motion vectors Mv stored in the unit Hbuf[n] include motion vectors Mv stored in the rightmost storage areas 314 and 318 of the unit Hbuf[n]. It is quite within the bounds of possibility that each of the motion vectors Mv stored in the rightmost storage areas 314 and 318 of the unit Hbuf[n] is used in processing of the next macro blocks as a left upper referenced motion vector. For this reason, the corrected motion vector Mv computed for the rightmost macro block 304 on the bottom-field lowermost row including the macro blocks 301 to 304 is not stored in the rightmost storage area 314 in the unit Hbuf[n] whereas the corrected motion vector Mv computed for the rightmost macro block 308 on the top-field lowermost row including the macro blocks 305 to 308 is not stored in the rightmost storage area 318 in the unit Hbuf[n]. The corrected motion vector Mv computed for the rightmost macro block 304 and the corrected motion vector Mv computed for the rightmost macro block 308 are stored in storage areas which will be described later in detail by referring to
As shown in
To put it more concretely, in the case of a processing-subject macro block pair 320 having the frame structure, the lowermost row of the processing-subject macro block pair 320 includes macro blocks 321 to 324. Each of the motion vectors Mv computed for the macro blocks 321 to 324 is a motion vector Mv to be stored in the motion-vector storage area 210. Since the processing-subject macro block pair 320 has the frame structure, however, the motion-vector correction section 130 does not correct the motion vectors Mv. That is to say, the motion-vector correction section 130 supplies the motion vectors Mv computed for the macro blocks 321 to 324 to the address conversion section 140 without correcting the motion vectors Mv. Then, the address conversion section 140 stores the corrected motion vectors Mv computed for the macro blocks 321 to 323 in the unit Hbuf[n] of the motion-vector storage area 210 at addresses assigned to the macro blocks 321 to 323 respectively.
To be more specific, the corrected motion vector Mv computed for the macro block 321 is stored in storage areas 331 and 335 in the unit Hbuf[n]. By the same token, the corrected motion vector Mv computed for the macro block 322 is stored in storage areas 332 and 336 in the unit Hbuf[n]. In the same way, the corrected motion vector Mv computed for the macro block 323 is stored in storage areas 333 and 337 in the unit Hbuf[n].
As described above, in the case of a processing-subject macro block pair 320 having the frame structure, only the motion vectors of the bottom frame are stored in the motion-vector storage area 210. In this case, each of the motion vectors of the bottom frame is stored in the motion-vector storage area 210 to serve as referenced motion vectors of both the bottom and top fields of the processing-subject macro blocks and the motion vectors of the top frame are not used.
In addition, motion vectors Mv stored in the unit Hbuf[n] include motion vectors Mv stored in the rightmost storage areas 334 and 338 of the unit Hbuf[n]. As described above, it is quite within the bounds of possibility that each of the motion vectors Mv stored in the rightmost storage areas 334 and 338 of the unit Hbuf[n] is used in processing of the next macro blocks as a left upper referenced motion vector. For this reason, the motion vector Mv computed for the rightmost macro block 324 on the bottom row including the macro blocks 321 to 324 is not stored in the rightmost storage areas 334 and 338 in the unit Hbuf[n]. The motion vector Mv computed for the rightmost macro block 324 are stored in storage areas which will be described later in detail by referring to
It is to be noted that the macro block pair 300 shown in
As described earlier, it is quite within the bounds of possibility that each of the two motion vectors Mv stored in respectively the two rightmost storage areas of the unit Hbuf[n] is used as a left upper motion vector Mv in the processing of the next macro block.
Thus, for the reason described above, the corrected motion vector Mv computed for the rightmost macro block 304 on the bottom-field lowermost row including the macro blocks 301 to 304 is not stored in the rightmost storage area 314 in the unit Hbuf[n], but stored in a rightmost storage area 341 in the unit Hbuf[−1] whereas the corrected motion vector Mv computed for the rightmost macro block 308 on the top-field lowermost row including the macro blocks 305 to 308 is not stored in the rightmost storage area 318 in the unit Hbuf[n], but stored in a rightmost storage area 342 in the unit Hbuf[−1] instead as shown in
By the same token, for the same reason described above, the motion vector Mv computed for the rightmost macro block 324 on the bottom row including the macro blocks 321 to 324 is not stored in the rightmost storage areas 334 and 338 in the unit Hbuf[n], but stored in the rightmost storage areas 341 and 342 in the unit Hbuf[−1] instead as shown in
If the structure of the next processing-subject macro block is the field structure, as shown in
To be more specific, the motion-vector correction section 130 corrects the value of the Y-axis component of each of the motion vectors Mv computed for the macro blocks 401 to 408 of the processing-subject macro block pair 400 and, then, stores eight macro vectors Mv in the storage areas 221 to 228 of the motion-vector storage area 220, respectively.
If the structure of the next processing-subject macro block is the frame structure, on the other hand, as shown in
To be more specific, the motion-vector correction section 130 corrects the value of the Y-axis component of the motion vector Mv computed for the macro block 401 of the processing-subject macro block pair 400 and, then, stores the macro vector Mv in the storage areas 221 and 222 of the motion-vector storage area 220. By the same token, the motion-vector correction section 130 corrects the value of the Y-axis component of the motion vector Mv computed for the macro block 402 of the processing-subject macro block pair 400 and, then, stores the macro vector Mv in the storage areas 223 and 224 of the motion-vector storage area 220. In the same way, the motion-vector correction section 130 corrects the value of the Y-axis component of the motion vector Mv computed for the macro block 403 of the processing-subject macro block pair 400 and, then, stores the macro vector Mv in the storage areas 225 and 226 of the motion-vector storage area 220. Likewise, the motion-vector correction section 130 corrects the value of the Y-axis component of the motion vector Mv computed for the macro block 404 of the processing-subject macro block pair 400 and, then, stores the macro vector Mv in the storage areas 227 and 228 of the motion-vector storage area 220.
As described above, in the case of the next processing-subject macro block having the frame structure, motion vectors Mv computed for the top field are used as referenced motion vectors Mv for both the top and bottom frames of the processing-subject macro blocks and motion vectors Mv computed for the bottom field are not used.
If the structure of the next processing-subject macro block is the frame structure, as shown in
If the structure of the next processing-subject macro block is the field structure, on the other hand, as shown in
It is to be noted that the typical model shown in
Typical Operations to Load Data in Motion-Vector Prediction Processing for Next Processing-Subject Macro Blocks with an Unknown Structure
An assumed case is described as follows. After the data storing process shown in
As described above, the method for carrying out the process to load each of referenced motion vectors arranged in the vertical direction as shown in
To be more specific,
The motion-vector flows shown in
As obvious from the above description, a motion vector on a macro block boundary can be said to be approximately the same as a referenced motion vector to be used in motion-vector prediction processing. It is thus possible to reduce the cost of making an access to a motion vector in deblocking mode processing. In addition, an address conversion process of the deblocking mode processing is made unnecessary. Thus, the deblocking mode processing can be carried out at a high speed.
In addition, even though the macro block structure which can be the frame or field structure has an effect also on the deblocking mode processing, the process to identify the structure of a macro block can be made unnecessary because every referenced motion vector has been fixed at a value set for the frame prediction processing.
The flowchart shown in the figure begins with a step S901 at which the motion-vector computation apparatus 100 receives an input stream. Then, at the next step S910, the motion-vector computation apparatus 100 carries out a motion-vector computation process. This motion-vector computation process will be explained later in detail by referring to a flowchart shown in
Subsequently, at the next step S902, the motion-vector computation apparatus 100 outputs the motion vector computed at the step S910. Then, at the next step S930, the motion-vector computation apparatus 100 carries out a data storing process. This data storing process will be explained later in detail by referring to a flowchart shown in
Subsequently, at the next step S903, the deblocking mode parameter determination section 181 employed in the motion-vector computation apparatus 100 determines a deblock strength parameter BsV whereas the deblocking mode parameter determination section 182 also employed in the motion-vector computation apparatus 100 determines a deblock strength parameter BsH. Then, at the next step S904, a deblocking mode processing is carried out by making use of the deblock strength parameter BsV and the deblock strength parameter BsH.
The flowchart shown in
If the determination result produced at the step S912 indicates that the structure of the processing-subject macro block is indeed the field structure, the flow of the motion-vector computation process goes on to a step S913 at which the motion-vector predicted-value computation section 160 loads a referenced motion vector for the field structure from the motion-vector buffer 200. Then, at the next step S914, the motion-vector predicted-value computation section 160 computes a motion-vector predicted value Mvp of the processing-subject macro block on the basis of the referenced motion vector which has been loaded from the motion-vector buffer 200.
Subsequently, at the next step S915, the motion-vector predicted-value correction section 170 corrects the motion-vector predicted value Mvp by doubling the value of the Y-axis component of the motion-vector predicted value Mvp which has been computed by the motion-vector predicted-value computation section 160. Then, at the next step S916, the adder 120 adds the difference value Mvd found by the arithmetic decoding processing section 110 at the step S911 to the motion-vector predicted value Mvp corrected by the motion-vector predicted-value correction section 170 at the step S915 in order to compute the motion vector Mv of the processing-subject macro block.
If the determination result produced at the step S912 indicates that the structure of the processing-subject macro block is the frame structure, on the other hand, the flow of the motion-vector computation process goes on to a step S917 at which the motion-vector predicted-value computation section 160 loads a referenced motion vector for the frame structure from the motion-vector buffer 200. Then, at the next step S918, the motion-vector predicted-value computation section 160 computes a motion-vector predicted value Mvp of the processing-subject macro block on the basis of the referenced motion vector which has been loaded from the motion-vector buffer 200.
Subsequently, at the next step S919, the adder 120 adds the difference value Mvd found by the arithmetic decoding processing section 110 at the step S911 to the motion-vector predicted value Mvp computed by the motion-vector predicted-value computation section 160 at the step S918 in order to compute the motion vector Mv of the processing-subject macro block.
The flowchart shown in
Subsequently, the flow of the data storing process goes on to the next step S934 to produce a result of determination as to whether or not the structure of the next processing-subject macro block is the field structure. If the determination result produced at the step S934 indicates that the structure of the next processing-subject macro block is indeed the field structure, the flow of the motion-vector storing process goes on to a step S935 at which the address conversion section 140 stores the motion vector Mv corrected at the step S932 in the motion-vector storage area 220 of the motion-vector buffer 200 at an address obtained as a result of conversion from the field structure into the field structure. That is to say, the address conversion section 140 stores the motion vector Mv corrected at the step S932 in the motion-vector storage area 220 of the motion-vector buffer 200 at an address set for the field structure. A typical example of the process carried out at the step S935 to store the corrected motion vector Mv in the motion-vector storage area 220 is the operation explained earlier by referring to
If the determination result produced at the step S934 indicates that the structure of the next processing-subject macro block is the frame structure, on the other hand, the flow of the motion-vector storing process goes on to a step S936 at which the address conversion section 140 stores the motion vector Mv corrected at the step S932 in the motion-vector storage area 220 of the motion-vector buffer 200 at an address obtained as a result of conversion from the field structure into the frame structure. That is to say, the address conversion section 140 stores the motion vector Mv corrected at the step S932 in the motion-vector storage area 220 of the motion-vector buffer 200 at an address set for the frame structure. A typical example of the process carried out at the step S936 to store the corrected motion vector Mv in the motion-vector storage area 220 is the operation explained earlier by referring to
By the way, if the determination result produced at the step S931 indicates that the structure of the processing-subject macro block is the frame structure, on the other hand, the flow of the motion-vector storing process goes on to a step S937 at which the address conversion section 140 stores the motion vector Mv corrected at the step S932 in the motion-vector storage area 210 of the motion-vector buffer 200 at an address set for the frame structure.
Subsequently, the flow of the motion-vector storing process goes on to the next step S938 to produce a result of determination as to whether or not the structure of the next processing-subject macro block is the field structure. If the determination result produced at the step S938 indicates that the structure of the next processing-subject macro block is indeed the field structure, the flow of the motion-vector storing process goes on to a step S939 at which the address conversion section 140 stores the motion vector Mv computed at the step S910 in the motion-vector storage area 220 of the motion-vector buffer 200 at an address obtained as a result of conversion from the frame structure into the field structure. That is to say, the address conversion section 140 stores the motion vector Mv computed at the step S910 in the motion-vector storage area 220 of the motion-vector buffer 200 at an address set for the field structure. A typical example of the process carried out at the step S939 to store the corrected motion vector Mv in the motion-vector storage area 220 is the operation explained earlier by referring to
If the determination result produced at the step S938 indicates that the structure of the next processing-subject macro block is the frame structure, on the other hand, the flow of the motion-vector storing process goes on to a step S940 at which the address conversion section 140 stores the motion vector Mv computed at the step S910 in the motion-vector storage area 220 of the motion-vector buffer 200 at an address obtained as a result of conversion from the frame structure into the frame structure. That is to say, the address conversion section 140 stores the motion vector Mv computed at the step S910 in the motion-vector storage area 220 of the motion-vector buffer 200 at an address set for the frame structure. A typical example of the process carried out at the step S940 to store the corrected motion vector Mv in the motion-vector storage area 220 is the operation explained earlier by referring to
It is to be noted that the processes carried out at the steps S933, S935, S936, S937, S939 and S940 are a typical example of a motion-vector storing procedure described in a claim appended to this invention specification.
The first embodiment of the present invention implements a typical configuration of the motion-vector computation apparatus in which the motion vector of a processing-subject macro block is computed by referencing motion vectors of macro blocks surrounding the processing-subject macro block. On the other hand, a second embodiment of the present invention implements another typical configuration of the motion-vector computation apparatus in which the motion vector of a processing-subject macro block is computed by referencing motion vectors of macro blocks of another frame referred to as a referenced frame different from the frame which includes the processing-subject macro block. That is to say, the second embodiment of the present invention implements another typical configuration in which the motion vector of a processing-subject macro block is computed in the so-called direct mode.
As described before, each of the structure of a motion vector computed for a referenced frame and the structure of the processing-subject macro block is a frame or field structure. In general, if the structure of a motion vector computed for a referenced frame is different from the structure of the processing-subject macro block, it is necessary to correct the value of the Y-component of the motion vector computed for the referenced frame. If the structure of a motion vector computed for a referenced frame is the field structure whereas the structure of the processing-subject macro block is the frame structure for example, it is necessary to correct the value of the Y-component of the motion vector computed for the referenced frame by doubling the value of the Y-component of the motion vector. If the structure of a motion vector computed for a referenced frame is the frame structure whereas the structure of the processing-subject macro block is the field structure, on the other hand, it is necessary to correct the value of the Y-component of the motion vector computed for the referenced frame by halving the value of the Y-component of the motion vector.
It is to be noted that
In this case, up to 32 motion vectors are used for one macro block including 4×4 blocks which each require two motion vectors in the case of a 2-vector prediction process. That is to say, up to 32 motion vectors are used in a 2-vector prediction process. Thus, a memory having an extremely large storage capacity is required if all motion vectors of a frame to be referenced in the direct mode processing are to be stored in the memory. In order to solve this problem of the extremely large memory storage capacity, in the case of the second embodiment of the present invention, only motion vectors of surrounding macro blocks to be referenced in the direct mode processing are stored in the motion-vector buffer 200 to serve as referenced motion vectors in the same way as the first embodiment of the present invention. Thus, the utilization efficiency of the memory can be increased. As a result, it is possible to make use of a high-speed memory such as a cache.
As described above, in accordance with the first embodiment of the present invention, in the motion-vector prediction processing carried out by adoption of the H.264 method and the deblocking mode processing, the process to convert an address from which a motion vector is to be loaded is made unnecessary. Thus, the motion vector can be computed at a high speed.
In addition, for the processing to correct the structure from the frame structure to the field structure for example, it is necessary carry out a truncation process symmetrically with respect to an axis which separates the positive and negative sides from each other. Since the truncation process is not a right-shift operation, the cost of execution of the process is high. On the other hand, the Y-axis component of every referenced motion vector stored in the motion-vector buffer 200 is fixed at a value which is compatible with the frame structure. It is thus necessary to carry out a process of correcting the structure of every motion vector to be stored in the motion-vector buffer 200 from the field structure to the frame structure. Since the process of correcting the structure of every motion vector to be stored in the motion-vector buffer 200 from the field structure to the frame structure is merely a left-shift operation, however, the cost of execution of the process can be reduced substantially.
On top of that, in order to fix the Y-axis component of every referenced motion vector to be stored in the motion-vector buffer 200 at a value which is compatible with the frame structure, the number of operations to correct a referenced motion vector can be reduced. In addition, for the correction operations such as a conditional branch process and a process of truncation symmetrical with respect to an axis separating the positive and negative sides from each other, the cost of execution of a process to set a frame prediction processing value at a fixed value is very low. Thus, the correction operations can be carried out at a high speed.
It is to be noted that each of the first and second embodiments of the present invention is merely a typical implementation of the present invention. As obviously revealed in the descriptions of the first and second embodiments provided by the present invention, each of the inventions described in the embodiments corresponds to one of inventions described in claims appended to this invention specification. By the same token, each particular one of the inventions described in the claims appended to this invention specification corresponds to one the inventions described in the embodiments of the present invention as an invention which has the same name as the particular invention described in the claims. Nonetheless, implementations of the present invention are by no means limited to the first and second embodiments of the present invention. That is to say, in order to implement the present invention, each of the first and second embodiments of the present invention can be changed to any one of a variety of modified versions within a range which does not deviate from essentials of the present invention.
In addition, each of the processing procedures according to the first embodiment of the present invention can be interpreted as a method for carrying out a sequence of processes to implement the method or interpreted as a program to be executed by a computer for carrying out the sequence of processes and as a recording medium used for storing the program. Typical examples of the recording medium are a CD (Compact Disc), an MD (Mini Disc), a DVD (Digital Versatile Disk), a memory card and a Blu-ray disc (a trade mark).
The present application contains subject matter related to that disclosed in Japanese Priority Patent Application JP 2009-205648 filed in the Japan Patent Office on Sep. 7, 2009, the entire content of which is hereby incorporated by reference.
It should be understood by those skilled in the art that a variety of modifications, combinations, sub-combinations and alterations may occur, depending on design requirements and other factors as far as they are within the scope of the appended claims or the equivalents thereof.
Number | Date | Country | Kind |
---|---|---|---|
P2009-205648 | Sep 2009 | JP | national |