JP2006187039A - Motion picture coding method and motion picture decoding method - Google Patents

Motion picture coding method and motion picture decoding method Download PDF

Info

Publication number
JP2006187039A
JP2006187039A JP2006045668A JP2006045668A JP2006187039A JP 2006187039 A JP2006187039 A JP 2006187039A JP 2006045668 A JP2006045668 A JP 2006045668A JP 2006045668 A JP2006045668 A JP 2006045668A JP 2006187039 A JP2006187039 A JP 2006187039A
Authority
JP
Japan
Prior art keywords
picture
motion vector
decoding
block
pictures
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2006045668A
Other languages
Japanese (ja)
Inventor
Toshiyuki Kondo
敏志 近藤
Shinya Sumino
眞也 角野
Makoto Hagai
誠 羽飼
Seishi Abe
清史 安倍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2006045668A priority Critical patent/JP2006187039A/en
Publication of JP2006187039A publication Critical patent/JP2006187039A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a motion picture coding method and a motion picture decoding method, that can avoid degradation in the coding efficiency of B-pictures, even when the number of the B-pictures inserted into between I-pictures or P-pictures increases, and the coding efficiency in direct mode can be made to improve. <P>SOLUTION: This method is provided with a coding control section 110 which preferentially determines pictures which becomes farthest from a previously coded picture, and rearranges each picture into the order to be encoded, when the coding order of a plurality of consecutive B-pictures located between I-pictures or P-pictures is considered in the display time order. Further, the method is provided with a mode selection section 109, which generates a movement vector of a block to be coded by performing the scaling to a forward movement vector, when coding in a direct mode is performed, in case of coding a block in the backward reference picture of a picture to be coded, and co-located with the block to be coded, when the forward motion vector has been used. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、動画像符号化方法および動画像復号化方法に関し、特に処理対象ピクチャに対して、処理済みのピクチャを参照ピクチャとして用いるピクチャ間予測符号化処理及びピクチャ間予測復号化処理を施す方法に関するものである。   The present invention relates to a moving picture coding method and a moving picture decoding method, and in particular, a method of performing inter picture predictive coding processing and inter picture predictive decoding processing using a processed picture as a reference picture for a processing target picture. It is about.

動画像符号化処理では、一般に動画像が有する空間方向および時間方向の冗長性を利用して情報量の圧縮が行われる。ここで一般に、空間方向の冗長性を利用する方法としては、周波数領域への変換が用いられ、時間方向の冗長性を利用する方法としては、ピクチャ間予測符号化処理が用いられる。ピクチャ間予測符号化処理では、あるピクチャを符号化する際に、符号化処理の対象となる符号化対象ピクチャに対して表示時間順で前方または後方にある符号化処理済みのピクチャを、符号化対象ピクチャに対応する参照ピクチャとする。そして、その参照ピクチャに対する符号化対象ピクチャの動き量を検出し、この動き量に基づいて動き補償処理を行って得られた画像データと符号化対象ピクチャの画像データとの差分を取ることにより時間方向の冗長性を取り除く。さらに、この差分値に対して空間方向の冗長度を取り除くことにより、符号化対象ピクチャに対する情報量の圧縮を行う。   In the moving image encoding process, the amount of information is generally compressed using redundancy in the spatial direction and temporal direction of a moving image. Here, generally, as a method of using redundancy in the spatial direction, conversion to the frequency domain is used, and as a method of using redundancy in the temporal direction, inter-picture predictive encoding processing is used. In the inter-picture predictive coding process, when a certain picture is coded, a coded picture that is forward or backward in display time order with respect to the coding target picture to be coded is coded. A reference picture corresponding to the target picture is used. Then, the amount of motion of the encoding target picture relative to the reference picture is detected, and a time is obtained by taking a difference between the image data obtained by performing the motion compensation processing based on the amount of motion and the image data of the encoding target picture. Remove direction redundancy. Further, the amount of information for the encoding target picture is compressed by removing the redundancy in the spatial direction from the difference value.

現在標準化中のH.264と呼ばれる動画像符号化方式では、ピクチャ間予測符号化処理を行わない、すなわちピクチャ内符号化処理を行うピクチャをIピクチャと呼ぶ。また、表示時間順で符号化対象ピクチャの前方または後方にある既に処理済みの1つのピクチャを参照してピクチャ間予測符号化が行われるピクチャをPピクチャと呼び、表示時間順で符号化対象ピクチャの前方または後方にある既に処理済みの2つのピクチャを参照してピクチャ間予測符号化が行われるピクチャをBピクチャと呼ぶ(例えば、非特許文献1参照)。   H. currently being standardized. In a moving picture coding scheme called H.264, a picture that does not perform inter-picture predictive coding processing, that is, performs intra-picture coding processing is called an I picture. In addition, a picture that is subjected to inter-picture prediction encoding with reference to one picture that has already been processed in front of or behind the encoding target picture in display time order is called a P picture, and the encoding target picture in display time order A picture that is subjected to inter-picture predictive coding with reference to two processed pictures that are already processed in front or behind is called a B picture (for example, see Non-Patent Document 1).

図20(a) は、上記の動画像符号化方式における、各ピクチャと、対応する参照ピクチャとの関係を示す図であり、図20(b) は符号化により生成された符号列の順序を示す図である。   FIG. 20 (a) is a diagram showing the relationship between each picture and the corresponding reference picture in the above moving picture coding system, and FIG. 20 (b) shows the order of the code strings generated by the coding. FIG.

ピクチャI1はIピクチャであり、ピクチャP5、P9、P13は、Pピクチャであり、ピクチャB2,B3,B4、B6、B7、B8、B10、B11、B12は、Bピクチャである。つまり、PピクチャP5、P9、P13は、矢印で示すように、それぞれ、IピクチャI1、PピクチャP5,PピクチャP9を参照ピクチャとして用いてピクチャ間予測符号化が施されるものである。   The picture I1 is an I picture, the pictures P5, P9, and P13 are P pictures, and the pictures B2, B3, B4, B6, B7, B8, B10, B11, and B12 are B pictures. That is, the P pictures P5, P9, and P13 are subjected to inter-picture prediction encoding using the I picture I1, the P picture P5, and the P picture P9 as reference pictures, respectively, as indicated by arrows.

また、BピクチャB2、B3、B4はそれぞれ、矢印で示すように、IピクチャI1及びPピクチャP5を参照ピクチャとして用いてピクチャ間予測符号化が施されるもの、BピクチャB6、B7、B8はそれぞれ、矢印で示すように、PピクチャP5及びPピクチャB9を参照ピクチャとして用いてピクチャ間予測符号化が施されるもの、BピクチャB10、B11、B12はそれぞれ、矢印で示すように、PピクチャP9及びPピクチャP13を参照ピクチャとして用いてピクチャ間予測符号化が施されるものである。   In addition, as shown by arrows, B pictures B2, B3, and B4 are subjected to inter-picture prediction coding using I picture I1 and P picture P5 as reference pictures, and B pictures B6, B7, and B8 are respectively As shown by the arrows, P pictures P5 and P pictures B9 are used as reference pictures and subjected to inter-picture prediction coding, and B pictures B10, B11, and B12 are respectively P pictures as shown by the arrows. Inter-picture predictive coding is performed using P9 and P picture P13 as reference pictures.

以上の符号化の際には、参照ピクチャとして用いられるピクチャは、そのピクチャを参照するピクチャよりも先行して符号化される。したがって、上記の符号化により生成された符号列は、図20(b) に示すようなピクチャの順序となる。   In the above encoding, a picture used as a reference picture is encoded before a picture that refers to the picture. Therefore, the code sequence generated by the above encoding has the picture order as shown in FIG.

ところで、H.264方式の動画像符号化方式では、Bピクチャの符号化において、ダイレクトモードと呼ぶ符号化モードを選択することができる。ダイレクトモードにおけるフレーム間予測方法を、図21を用いて説明する。図21はダイレクトモードにおける動きベクトルを示す説明図であり、ピクチャB6のブロックaをダイレクトモードで符号化する場合を示している。この場合、ピクチャB6の後方にある参照ピクチャであるピクチャP9中の、ブロックaと同じ位置にあるブロックbを符号化した際に用いた動きベクトルcを利用する。動きベクトルcは、ブロックbが符号化された際に用いられた動きベクトルであり、ピクチャP5を参照している。ブロックaは、動きベクトルcと平行な動きベクトルを用いて、前方向参照ピクチャであるピクチャP5と、後方向参照ピクチャであるピクチャP9とから参照ブロックを取得し、2方向予測を行って符号化される。すなわち、ブロックaを符号化する際に用いられる動きベクトルは、ピクチャP5に対しては動きベクトルd、ピクチャP9に対しては動きベクトルeとなる。
ISO/IEC 14496-2「Information technology − Coding of audio-visualobjects − Part2: Visual」pp.218-219
H. In the H.264 moving image coding method, a coding mode called a direct mode can be selected for coding a B picture. The inter-frame prediction method in the direct mode will be described with reference to FIG. FIG. 21 is an explanatory diagram showing motion vectors in the direct mode, and shows a case where the block a of the picture B6 is encoded in the direct mode. In this case, the motion vector c used when the block b located at the same position as the block a in the picture P9, which is the reference picture behind the picture B6, is used. The motion vector c is a motion vector used when the block b is encoded, and refers to the picture P5. The block a uses a motion vector parallel to the motion vector c to obtain a reference block from the picture P5 which is a forward reference picture and the picture P9 which is a backward reference picture, and performs bi-directional prediction and performs coding. Is done. That is, the motion vector used when coding the block a is the motion vector d for the picture P5 and the motion vector e for the picture P9.
ISO / IEC 14496-2 “Information technology − Coding of audio-visualobjects − Part2: Visual” pp.218-219

しかしながら、上記のようにBピクチャに対してIピクチャやPピクチャを参照するピクチャ間予測符号化処理を施す際に、符号化対象ピクチャと参照ピクチャとの間の時間的距離が長くなる場合があり、このような場合には、符号化効率の低下を招くこととなる。特にBピクチャの挿入枚数、つまり、隣合うIピクチャとPピクチャとの間、あるいは最も近い位置にある2つのPピクチャの間に配置されるBピクチャの数が多くなった場合、符号化効率の低下が顕著となる。   However, when the inter-picture predictive encoding process that refers to the I picture or P picture is performed on the B picture as described above, the temporal distance between the encoding target picture and the reference picture may become long. In such a case, the encoding efficiency is reduced. Especially when the number of inserted B pictures increases, that is, when the number of B pictures arranged between adjacent I and P pictures or between two nearest P pictures increases, The decrease is remarkable.

そこで、本発明は上記のような問題点を解決するためになされたものであり、IピクチャとPピクチャとの間、あるいはPピクチャ間に挿入されるBピクチャの枚数が多くなった場合でも、Bピクチャの符号化効率の劣化を回避することができる動画像符号化方法および動画像復号化方法を提供することを目的とする。また、ダイレクトモードにおける符号化効率を向上させることができる動画像符号化方法および動画像復号化方法を提供することを目的とする。   Therefore, the present invention has been made to solve the above problems, and even when the number of B pictures inserted between I pictures and P pictures or between P pictures increases, An object of the present invention is to provide a moving picture coding method and a moving picture decoding method capable of avoiding deterioration in coding efficiency of a B picture. It is another object of the present invention to provide a moving picture coding method and a moving picture decoding method that can improve coding efficiency in the direct mode.

上記目的を達成するために、本発明に係る動画像復号化方法は、動画像を構成する各ピクチャに対応する画像データを符号化して生成された符号列を復号化する動画像復号化方法であって、復号化対象ブロックを復号化する際に、既に復号化済みであるピクチャ内にあるブロックであって、しかも前記復号化対象ブロックと同一位置にあるブロックでもある同一位置ブロックの動きベクトルに基づいて、前記復号化対象ブロックの動きベクトルを決定し、前記復号化対象ブロックの動きベクトルと、前記復号化対象ブロックの動きベクトルに対応する参照ピクチャを用いて、前記復号化対象ブロックをダイレクトモードで動き補償して復号化する復号化ステップを含むことを特徴とする。   In order to achieve the above object, a moving picture decoding method according to the present invention is a moving picture decoding method for decoding a code string generated by encoding image data corresponding to each picture constituting a moving picture. Then, when decoding the decoding target block, the motion vector of the same position block that is in the already decoded picture and is also in the same position as the decoding target block is used. And determining a motion vector of the decoding target block based on the motion vector of the decoding target block and a reference picture corresponding to the motion vector of the decoding target block. And a decoding step for decoding with motion compensation.

また、本発明に係る動画像符号化方法は、動画像を構成する各ピクチャに対応する画像データを符号化して符号列を生成する動画像符号化方法であって、符号化の対象となる対象ピクチャが、ピクチャ内符号化を行うブロックのみを有するIピクチャ、既に符号化済みであるピクチャを第1参照ピクチャとして用いる1方向参照によるピクチャ間予測符号化を行うブロックを有するPピクチャ、既に符号化済みであるピクチャを第1参照ピクチャおよび第2参照ピクチャとして用いる2方向参照によるピクチャ間予測符号化を行うブロックを有するBピクチャのいずれかとして符号化を行う符号化ステップを含み、前記符号化ステップは、前記IピクチャまたはPピクチャ間に挟まれる複数の連続した前記Bピクチャの符号化順序を、表示時間順とは異なる順序に決定する制御ステップを含むことを特徴とする。   The moving picture encoding method according to the present invention is a moving picture encoding method for generating a code string by encoding image data corresponding to each picture constituting a moving picture, and is a target to be encoded. The picture is an I picture having only a block for performing intra-picture coding, a P picture having a block for performing inter-picture predictive coding by one-way reference using an already coded picture as a first reference picture, and already coding A coding step of performing coding as one of B pictures having a block for performing inter-picture predictive coding by bi-directional reference using a completed picture as a first reference picture and a second reference picture, Indicates the encoding order of a plurality of consecutive B pictures sandwiched between the I picture or P picture at the time of display. Characterized in that it comprises a control step of determining a different order than the order.

これによって、Bピクチャを符号化する際に、より表示時間順で近傍のピクチャを参照ピクチャとして用いることができるので、動き補償の際の予測効率を向上して、符号化効率を向上することができる。   As a result, when encoding a B picture, a neighboring picture can be used as a reference picture in the order of display time, so that the prediction efficiency in motion compensation can be improved and the encoding efficiency can be improved. it can.

また、本発明に係る動画像符号化方法は、動画像を構成する各ピクチャに対応する画像データを符号化して符号列を生成する動画像符号化方法であって、符号化の対象となる対象ピクチャを、少なくとも、既に符号化済みであるピクチャを第1参照ピクチャおよび第2参照ピクチャとして用いる2方向参照によるピクチャ間予測符号化を行うブロックを有するBピクチャとして符号化を行う符号化ステップを含み、前記符号化ステップでは、符号化対象であるBピクチャの符号化対象ブロックを、既に符号化済みであるブロックの有する動きベクトルに基づく、前記符号化対象ブロックの動きベクトルによって動き補償するダイレクトモードとして符号化する場合に、前記符号化対象ブロックと同一位置にある前記第2参照ピクチャ内のブロックを符号化した際に用いた当該ブロックが参照する第1参照ピクチャに基づく第1動きベクトルに対して、ピクチャの表示順序を示す情報の差を用いてスケーリングすることにより、前記符号化対象ブロックを動き補償する際の動きベクトルを得ることを特徴とする。   The moving picture encoding method according to the present invention is a moving picture encoding method for generating a code string by encoding image data corresponding to each picture constituting a moving picture, and is a target to be encoded. A coding step of coding a picture as a B picture having a block for performing inter-picture predictive coding by bi-directional reference using at least a picture that has already been coded as a first reference picture and a second reference picture In the encoding step, as a direct mode for performing motion compensation on the encoding target block of the B picture that is the encoding target based on the motion vector of the already encoded block based on the motion vector of the encoding target block When encoding, the block in the second reference picture at the same position as the encoding target block is used. The encoding target block by scaling the first motion vector based on the first reference picture referenced by the block used when encoding the image using a difference in information indicating the display order of the pictures. It is characterized in that a motion vector for motion compensation is obtained.

これによって、ダイレクトモードが選択された場合には、第2参照ピクチャの第1動きベクトルに対してスケーリングを行うので、動きベクトルの情報を符号列に付加する必要がなく、かつ予測効率を向上させることができる。   As a result, when the direct mode is selected, the first motion vector of the second reference picture is scaled, so that it is not necessary to add motion vector information to the code string, and the prediction efficiency is improved. be able to.

また、符号化対象であるBピクチャの符号化対象ブロックをダイレクトモードとして符号化する場合に、前記符号化対象ブロックと同一位置にある前記第2参照ピクチャ内のブロックを符号化した際に用いた当該ブロックが参照する第2参照ピクチャに基づく第2動きベクトルに対して、ピクチャの表示順序を示す情報の差を用いてスケーリングすることにより、前記符号化対象ブロックを動き補償する際の動きベクトルを得てもよい。   In addition, when the encoding target block of the B picture that is the encoding target is encoded as the direct mode, it was used when the block in the second reference picture at the same position as the encoding target block was encoded The second motion vector based on the second reference picture referred to by the block is scaled by using a difference in information indicating the display order of the pictures, thereby obtaining a motion vector for motion compensation of the encoding target block. May be obtained.

これによって、ダイレクトモードが選択された場合には、第2参照ピクチャの第2動きベクトルに対してスケーリングを行うので、動きベクトルの情報を符号列に付加する必要がなく、かつ予測効率を向上させることができる。   As a result, when the direct mode is selected, scaling is performed on the second motion vector of the second reference picture, so that it is not necessary to add motion vector information to the code string and the prediction efficiency is improved. be able to.

また、符号化対象であるBピクチャの符号化対象ブロックをダイレクトモードとして符号化する場合に、前記符号化対象ブロックと同一位置にある前記第2参照ピクチャ内のブロックがダイレクトモードで符号化されているときには、前記第2参照ピクチャ内のブロックを符号化する際に実質的に用いた当該ブロックが参照する第1参照ピクチャに基づく第1動きベクトルに対して、ピクチャの表示順序を示す情報の差を用いてスケーリングを行うことにより、前記符号化対象ブロックを動き補償する際の動きベクトルを得てもよい。   In addition, when the encoding target block of the B picture that is the encoding target is encoded as the direct mode, the block in the second reference picture at the same position as the encoding target block is encoded in the direct mode. The difference in information indicating the display order of pictures with respect to the first motion vector based on the first reference picture referenced by the block substantially used when coding the block in the second reference picture. By performing scaling using, a motion vector for motion compensation of the encoding target block may be obtained.

これによって、ダイレクトモードが選択された場合には、第2参照ピクチャの実質的に用いた第1動きベクトルに対してスケーリングを行うので、動きベクトルの情報を符号列に付加する必要がなく、かつ予測効率を向上させることができる。   Accordingly, when the direct mode is selected, the scaling is performed on the first motion vector substantially used in the second reference picture, so that it is not necessary to add motion vector information to the code string, and Prediction efficiency can be improved.

また、符号化対象であるBピクチャの符号化対象ブロックをダイレクトモードとして符号化する場合に、前記符号化対象ブロックと同一位置にある後方Pピクチャ内のブロックを符号化した際に用いた当該ブロックが参照する第1参照ピクチャに基づく第1動きベクトルに対して、ピクチャの表示順序を示す情報の差を用いてスケーリングを行うことにより、前記符号化対象ブロックを動き補償する際の動きベクトルを得てもよい。   In addition, when the encoding target block of the B picture to be encoded is encoded as the direct mode, the block used when the block in the backward P picture at the same position as the encoding target block is encoded The first motion vector based on the first reference picture that is referenced by is scaled using a difference in information indicating the display order of pictures to obtain a motion vector for motion compensation of the coding target block. May be.

これによって、ダイレクトモードが選択された場合には、後方Pピクチャの第1動きベクトルに対してスケーリングを行うので、動きベクトルの情報を符号列に付加する必要がなく、かつ予測効率を向上させることができる。   As a result, when the direct mode is selected, scaling is performed on the first motion vector of the backward P picture, so that it is not necessary to add motion vector information to the code string and improve prediction efficiency. Can do.

また、符号化対象であるBピクチャの符号化対象ブロックをダイレクトモードとして符号化する場合に、前記符号化対象ブロックと同一位置にある前記第2参照ピクチャ内のブロックが少なくとも第1参照ピクチャに基づく第1動きベクトルを用いて符号化されている場合は、前記第1動きベクトルに対して、前記同一位置にある前記第2参照ピクチャ内のブロックが第2参照ピクチャに基づく第2動きベクトルのみを用いて符号化されている場合は、前記第2動きベクトルに対して、ピクチャの表示順序を示す情報の差を用いてスケーリングすることにより、前記符号化対象ブロックを動き補償する際の動きベクトルを得てもよい。   Further, when the encoding target block of the B picture to be encoded is encoded as the direct mode, the block in the second reference picture at the same position as the encoding target block is based on at least the first reference picture. When the first motion vector is encoded, the block in the second reference picture at the same position with respect to the first motion vector includes only the second motion vector based on the second reference picture. The second motion vector is scaled by using a difference in information indicating the display order of pictures, thereby obtaining a motion vector for motion compensation of the encoding target block. May be obtained.

これによって、ダイレクトモードが選択された場合には、第2参照ピクチャが第1動きベクトルを有していれば、この第1動きベクトルに対してスケーリングを行い、また、第2参照ピクチャが第1動きベクトルを有さず第2動きベクトルのみを有していれば、この第2動きベクトルに対してスケーリングを行うので、動きベクトルの情報を符号列に付加する必要がなく、かつ予測効率を向上させることができる。   Accordingly, when the direct mode is selected, if the second reference picture has the first motion vector, the first motion vector is scaled, and the second reference picture is the first motion picture. If there is only a second motion vector without a motion vector, the second motion vector is scaled, so there is no need to add motion vector information to the code string and the prediction efficiency is improved. Can be made.

また、本発明に係る動画像復号化方法は、動画像を構成する各ピクチャに対応する画像データを符号化して生成された符号列を復号化する動画像復号化方法であって、復号化の対象となる対象ピクチャを、既に復号化済みのピクチャを参照ピクチャとして用いてピクチャ間予測復号化を行う復号化ステップを含み、前記復号化ステップでは、既に復号化済みであるピクチャを第1参照ピクチャおよび第2参照ピクチャとして用いる2方向参照によるピクチャ間予測復号化を行う際に、前記第1参照ピクチャおよび第2参照ピクチャとして、それぞれ表示時間順で最も近いピクチャを少なくとも含む符号列を復号化することを特徴とする。   A moving picture decoding method according to the present invention is a moving picture decoding method for decoding a code string generated by encoding image data corresponding to each picture constituting a moving picture. A decoding step of performing inter-picture predictive decoding using a target picture that is already decoded as a reference picture, and in the decoding step, a picture that has already been decoded is a first reference picture When performing inter-picture predictive decoding using bi-directional reference used as the second reference picture, a code sequence including at least the closest picture in the display time order is decoded as the first reference picture and the second reference picture, respectively. It is characterized by that.

これによって、2方向参照によるピクチャ間予測符号化処理を行う際に第1参照ピクチャおよび第2参照ピクチャとして、表示時間順に近傍に位置するピクチャを用いて符号化されて生成された符号列を、復号化する際に正しく復号化処理を行うことができる。   As a result, when performing inter-picture predictive encoding processing by bi-directional reference, a code string generated by encoding using pictures located nearby in order of display time as the first reference picture and the second reference picture, When decrypting, the decryption process can be performed correctly.

また、本発明に係る動画像復号化方法は、動画像を構成する各ピクチャに対応する画像データを符号化して生成された符号列を復号化する動画像復号化方法であって、復号化の対象となる対象ピクチャを、既に復号化済みのピクチャを参照ピクチャとして用いてピクチャ間予測復号化を行う復号化ステップを含み、前記復号化ステップでは、復号化対象ピクチャが、既に復号化済みであるピクチャを第1参照ピクチャおよび第2参照ピクチャとして用いる2方向参照によるピクチャ間予測復号化を行うブロックを有するピクチャであり、かつ、復号化対象ブロックを既に復号化済みであるブロックの有する動きベクトルに基づく、前記復号化対象ブロックの動きベクトルによって動き補償するダイレクトモードとして復号化する場合に、前記復号化対象ブロックと同一位置にある前記第2参照ピクチャ内のブロックを復号化した際に用いた当該ブロックが参照する第1参照ピクチャに基づく第1動きベクトルに対して、ピクチャの表示順序を示す情報の差を用いてスケーリングを行うことにより、前記復号化対象ブロックを動き補償する際の動きベクトルを得ることを特徴とする。   A moving picture decoding method according to the present invention is a moving picture decoding method for decoding a code string generated by encoding image data corresponding to each picture constituting a moving picture. A decoding step of performing inter-picture predictive decoding using a target picture that is already decoded as a reference picture, in which the decoding target picture has already been decoded It is a picture having a block for performing inter-picture predictive decoding by bi-directional reference using a picture as a first reference picture and a second reference picture, and a block to be decoded has already been decoded into a motion vector When decoding as a direct mode in which motion compensation is performed using a motion vector of the decoding target block, Indicates the display order of pictures for the first motion vector based on the first reference picture that is used when the block in the second reference picture located at the same position as the current block is decoded. By performing scaling using the information difference, a motion vector for motion compensation of the decoding target block is obtained.

これによって、ダイレクトモードが選択された場合には、第2参照ピクチャの第1動きベクトルに対してスケーリングを行うので、復号化する際に正しく復号化処理を行うことができる。   Thus, when the direct mode is selected, the first motion vector of the second reference picture is scaled, so that the decoding process can be correctly performed when decoding.

また、復号化対象ピクチャが2方向参照によるピクチャ間予測復号化を行うブロックを有するピクチャであり、かつ、復号化対象ブロックをダイレクトモードとして復号化する場合に、前記復号化対象ブロックと同一位置にある前記第2参照ピクチャ内のブロックを復号化した際に用いた当該ブロックが参照する第2参照ピクチャに基づく第2動きベクトルに対して、ピクチャの表示順序を示す情報の差を用いてスケーリングを行うことにより、前記復号化対象ブロックを動き補償する際の動きベクトルを得てもよい。   Further, when the decoding target picture is a picture having a block for performing inter-picture predictive decoding by bi-directional reference and decoding is performed in the direct mode, the decoding target block is located at the same position as the decoding target block. The second motion vector based on the second reference picture referred to by the block used when the block in the second reference picture is decoded is scaled using a difference in information indicating the display order of the pictures. By performing this, a motion vector for motion compensation of the decoding target block may be obtained.

これによって、ダイレクトモードが選択された場合には、第2参照ピクチャの第2動きベクトルに対してスケーリングを行うので、復号化する際に正しく復号化処理を行うことができる。   Thus, when the direct mode is selected, the second motion vector of the second reference picture is scaled, so that the decoding process can be performed correctly when decoding.

また、復号化対象ピクチャが2方向参照によるピクチャ間予測復号化を行うブロックを有するピクチャであり、かつ、復号化対象ブロックをダイレクトモードとして復号化する場合に、前記復号化対象ブロックと同一位置にある前記第2参照ピクチャ内のブロックがダイレクトモードで復号化されているときには、前記第2参照ピクチャ内のブロックを復号化する際に実質的に用いた当該ブロックが参照する第1参照ピクチャに基づく第1動きベクトルに対して、参照ピクチャの表示順序を示す情報の差を用いてスケーリングを行うことにより、前記復号化対象ブロックを動き補償する際の動きベクトルを得てもよい。   Further, when the decoding target picture is a picture having a block for performing inter-picture predictive decoding by bi-directional reference and decoding is performed in the direct mode, the decoding target block is located at the same position as the decoding target block. When a block in a certain second reference picture is decoded in the direct mode, it is based on the first reference picture referred to by the block substantially used in decoding the block in the second reference picture. A motion vector for motion compensation of the decoding target block may be obtained by performing scaling on the first motion vector using a difference in information indicating the display order of reference pictures.

これによって、ダイレクトモードが選択された場合には、第2参照ピクチャの実質的に用いた第1動きベクトルに対してスケーリングを行うので、復号化する際に正しく復号化処理を行うことができる。   Accordingly, when the direct mode is selected, the first motion vector substantially used in the second reference picture is scaled, so that the decoding process can be correctly performed when decoding.

また、復号化対象ピクチャが2方向参照によるピクチャ間予測復号化を行うブロックを有するピクチャであり、かつ、復号化対象ブロックをダイレクトモードとして復号化する場合に、表示時間順で後方に位置する、既に復号化済みであるピクチャを第1参照ピクチャとして用いる1方向参照によるピクチャ間予測復号化を行うピクチャ内の、前記復号化対象ブロックと同一位置にあるブロックを復号化した際に用いた当該ブロックが参照する第1参照ピクチャに基づく第1動きベクトルに対して、ピクチャの表示順序を示す情報の差を用いてスケーリングを行うことにより、前記復号化対象ブロックを動き補償する際の動きベクトルを得てもよい。   In addition, when the decoding target picture is a picture having a block that performs inter-picture predictive decoding by bi-directional reference, and the decoding target block is decoded in the direct mode, the decoding target picture is positioned backward in display time order, The block used when a block located at the same position as the decoding target block in a picture to be subjected to inter-picture prediction decoding by one-way reference using a picture that has already been decoded as a first reference picture The first motion vector based on the first reference picture referenced by is scaled using a difference in information indicating the display order of pictures, thereby obtaining a motion vector for motion compensation of the decoding target block. May be.

これによって、ダイレクトモードが選択された場合には、1方向参照によるピクチャ間予測復号化を行うピクチャの第1動きベクトルに対してスケーリングを行うので、復号化する際に正しく復号化処理を行うことができる。   Thus, when the direct mode is selected, scaling is performed on the first motion vector of a picture to be subjected to inter-picture predictive decoding based on one-way reference, so that decoding processing is correctly performed when decoding. Can do.

なお、本発明は、このような動画像符号化方法および動画像復号化方法として実現することができるだけでなく、このような動画像符号化方法および動画像復号化方法が含む特徴的なステップを手段として備える動画像符号化装置および動画像復号化装置として実現できる。また、動画像符号化方法により符号化した符号列として実現し、CD−ROM等の記録媒体やインターネット等の伝送媒体を介して配信することができる。   Note that the present invention can be realized not only as such a moving image encoding method and a moving image decoding method, but also including the characteristic steps included in such a moving image encoding method and a moving image decoding method. It can be realized as a moving image encoding device and a moving image decoding device provided as means. Further, it can be realized as a code string encoded by a moving image encoding method and distributed via a recording medium such as a CD-ROM or a transmission medium such as the Internet.

以上のように、本発明に係る動画像符号化方法によれば、Bピクチャを符号化する際に、より表示時間順で近傍のピクチャを参照ピクチャとして用いることができ、これにより動き補償の際の予測効率が向上するため、符号化効率が向上する。   As described above, according to the moving picture coding method of the present invention, when a B picture is coded, a neighboring picture can be used as a reference picture in the order of display time. Since the prediction efficiency is improved, the coding efficiency is improved.

また、ダイレクトモードにおいて、第2参照ピクチャの第1動きベクトルに対してスケーリングを行うことにより、動きベクトルの情報を送る必要がなく、かつ予測効率を向上させることができる。   Further, in the direct mode, by performing scaling on the first motion vector of the second reference picture, it is not necessary to send motion vector information, and prediction efficiency can be improved.

また、ダイレクトモードにおいて、第2参照ピクチャのダイレクトモードで実質的に用いた第1動きベクトルに対してスケーリングを行うことにより、動きベクトルの情報を送る必要がなく、かつ第2参照ピクチャ内の同一位置のブロックがダイレクトモードで符号化されている場合でも、予測効率を向上させることができる。   Further, in direct mode, by scaling the first motion vector substantially used in the direct mode of the second reference picture, there is no need to send motion vector information and the same in the second reference picture. Even when the position block is encoded in the direct mode, the prediction efficiency can be improved.

また、ダイレクトモードにおいて、第2参照ピクチャの同一位置のブロックを符号化する際に用いた第2動きベクトルに対してスケーリングを行うことにより、動きベクトルの情報を送る必要がなく、かつ第2参照ピクチャ内の同一位置のブロックが第2動きベクトルしか有しない場合でも、予測効率を向上させることができる。   In the direct mode, the second motion vector used when coding the block at the same position of the second reference picture is scaled, so that it is not necessary to send motion vector information and the second reference Even when the block at the same position in the picture has only the second motion vector, the prediction efficiency can be improved.

また、ダイレクトモードにおける動きベクトルを強制的に0と置くことにより、ダイレクトモードが選択された場合には、動きベクトルの情報を送る必要がなく、かつ動きベクトルのスケーリング処理が不要となり処理量の削減を図ることができる。   In addition, by forcing the motion vector in the direct mode to be 0, when the direct mode is selected, it is not necessary to send motion vector information, and the motion vector scaling processing is unnecessary, reducing the processing amount. Can be achieved.

また、ダイレクトモードにおいて、後方Pピクチャの動きベクトルに対してスケーリングを行うことにより、第2参照ピクチャがBピクチャである場合に、そのBピクチャの動きベクトルを記憶しておく必要が無い。また、動きベクトルの情報を送る必要がなく、かつ予測効率を向上させることができる。   In the direct mode, by scaling the motion vector of the backward P picture, when the second reference picture is a B picture, there is no need to store the motion vector of the B picture. Further, it is not necessary to send motion vector information, and the prediction efficiency can be improved.

また、ダイレクトモードにおいて、第2参照ピクチャが第1動きベクトルを有していれば、この第1動きベクトルに対してスケーリングを行い、また、第2参照ピクチャが第1動きベクトルを有さず第2動きベクトルのみを有していれば、この第2動きベクトルに対してスケーリングを行うので、動きベクトルの情報を符号列に付加する必要がなく、かつ予測効率を向上させることができる。   In the direct mode, if the second reference picture has the first motion vector, the first motion vector is scaled, and the second reference picture does not have the first motion vector. If there are only two motion vectors, the second motion vector is scaled, so there is no need to add motion vector information to the code string, and the prediction efficiency can be improved.

また、本発明に係る動画像復号化方法によれば、2方向予測を用いてピクチャ間予測符号化処理を行う際に第1参照および第2参照として用いるピクチャとして、表示時間順に近傍に位置するピクチャを用いて符号化されて生成された符号列を復号化する際に、正しく復号化処理を行うことができる。   Further, according to the moving picture decoding method according to the present invention, the pictures used as the first reference and the second reference when performing inter-picture prediction encoding processing using bi-directional prediction are located in the vicinity in the order of display time. When decoding a code string generated by encoding using a picture, a correct decoding process can be performed.

本発明の実施の形態について、図面を参照しながら説明する。   Embodiments of the present invention will be described with reference to the drawings.

(実施の形態1)
図1は、本発明に係る動画像符号化方法を用いた動画像符号化装置の一実施の形態の構成を示すブロック図である。
(Embodiment 1)
FIG. 1 is a block diagram showing a configuration of an embodiment of a moving picture coding apparatus using a moving picture coding method according to the present invention.

動画像符号化装置は、図1に示すように並べ替え用メモリ101、差分演算部102、予測誤差符号化部103、符号列生成部104、予測誤差復号化部105、加算演算部106、参照ピクチャ用メモリ107、動きベクトル検出部108、モード選択部109、符号化制御部110、スイッチ111〜115、および動きベクトル記憶部116を備えている。   As shown in FIG. 1, the moving image encoding apparatus includes a rearrangement memory 101, a difference calculation unit 102, a prediction error encoding unit 103, a code string generation unit 104, a prediction error decoding unit 105, an addition calculation unit 106, and a reference. A picture memory 107, a motion vector detection unit 108, a mode selection unit 109, an encoding control unit 110, switches 111 to 115, and a motion vector storage unit 116 are provided.

並べ替え用メモリ101は、表示時間順にピクチャ単位で入力された動画像を格納する。符号化制御部110は、並べ替え用メモリ101に格納された各ピクチャを符号化が行われる順に並び替えを行う。また、符号化制御部110は、動きベクトル記憶部116への動きベクトルの記憶動作を制御する。   The rearrangement memory 101 stores moving images input in units of pictures in the order of display time. The encoding control unit 110 rearranges the pictures stored in the rearrangement memory 101 in the order in which encoding is performed. Also, the encoding control unit 110 controls the motion vector storage operation in the motion vector storage unit 116.

動きベクトル検出部108は、符号化済みの復号化画像データを参照ピクチャとして用いて、そのピクチャ内の探索領域において最適と予測される位置を示す動きベクトルの検出を行う。モード選択部109は、動きベクトル検出部108で検出された動きベクトルを用いて、マクロブロックの符号化モードを決定し、この符号化モードに基づいて予測画像データを生成する。差分演算部102は、並べ替え用メモリ101より読み出された画像データと、モード選択部109より入力された予測画像データとの差分を演算し、予測誤差画像データを生成する。   The motion vector detection unit 108 uses the encoded decoded image data as a reference picture, and detects a motion vector indicating a position predicted to be optimal in the search area in the picture. The mode selection unit 109 determines a macroblock coding mode using the motion vector detected by the motion vector detection unit 108, and generates predicted image data based on the coding mode. The difference calculation unit 102 calculates a difference between the image data read from the rearrangement memory 101 and the predicted image data input from the mode selection unit 109 to generate prediction error image data.

予測誤差符号化部103は、入力された予測誤差画像データに対して周波数変換や量子化等の符号化処理を行い、符号化データを生成する。符号列生成部104は、入力された符号化データに対して可変長符号化等を行い、さらにモード選択部109から入力された動きベクトルの情報、符号化モードの情報、およびその他の関連情報等を付加することにより符号列を生成する。   The prediction error encoding unit 103 performs encoding processing such as frequency conversion and quantization on the input prediction error image data to generate encoded data. The code string generation unit 104 performs variable-length coding or the like on the input encoded data, and further, motion vector information, encoding mode information, and other related information input from the mode selection unit 109 Is added to generate a code string.

予測誤差復号化部105は、入力された符号化データに対して逆量子化や逆周波数変換等の復号化処理を行い、復号化差分画像データを生成する。加算演算部106は、予測誤差復号化部105より入力された復号化差分画像データと、モード選択部109より入力された予測画像データとを加算し、復号化画像データを生成する。参照ピクチャ用メモリ107は、生成された復号化画像データを格納する。   The prediction error decoding unit 105 performs decoding processing such as inverse quantization and inverse frequency transform on the input encoded data, and generates decoded differential image data. The addition operation unit 106 adds the decoded differential image data input from the prediction error decoding unit 105 and the predicted image data input from the mode selection unit 109 to generate decoded image data. The reference picture memory 107 stores the generated decoded image data.

図2はピクチャと相対インデックスの説明図である。相対インデックスは、参照ピクチャ用メモリ107に格納された参照ピクチャを一意に識別するために用いられ、図2に示すように各ピクチャに対応付けられている番号である。また、相対インデックスは、ブロックをピクチャ間予測により符号化する際に使用する参照ピクチャを指示するために使用される。   FIG. 2 is an explanatory diagram of pictures and relative indexes. The relative index is used to uniquely identify the reference picture stored in the reference picture memory 107, and is a number associated with each picture as shown in FIG. The relative index is used to indicate a reference picture to be used when a block is encoded by inter picture prediction.

図3は動画像符号化装置による動画像符号化信号フォーマットの概念図である。1ピクチャ分の符号化信号Picture は、ピクチャ先頭に含まれるヘッダ符号化信号Header、ダイレクトモードによるブロックの符号化信号Block1、ダイレクトモード以外のピクチャ間予測によるブロックの符号化信号Block2等から構成されている。また、ダイレクトモード以外のピクチャ間予測によるブロックの符号化信号Block2は、ピクチャ間予測に使用する2つの参照ピクチャを示すための第1相対インデックスRIdx1 および第2相対インデックスRIdx2 、第1動きベクトルMV1、第2動きベクトルMV2をこの順で有している。一方、ダイレクトモードによるブロックの符号化信号Block1は、第1相対インデックスRIdx1 、第2相対インデックスRIdx2 、第1動きベクトルMV1、第2動きベクトルMV2を有していない。第1相対インデックスRIdx1 、第2相対インデックスRIdx2 のいずれを使用するかは予測種別PredTypeにより判断することができる。また、第1相対インデックスRIdx1 は第1参照ピクチャを示し、第2相対インデックスRIdx2 は第2参照ピクチャを示している。すなわち、第1参照ピクチャであるか第2参照ピクチャであるかは、符号化列中のデータ位置で決まる。   FIG. 3 is a conceptual diagram of a video encoded signal format by the video encoding device. The coded signal Picture for one picture is composed of a header coded signal Header included at the head of the picture, a block coded signal Block1 in the direct mode, a block coded signal Block2 by inter-picture prediction other than the direct mode, and the like. Yes. In addition, an encoded signal Block2 of a block based on inter-picture prediction other than the direct mode includes a first relative index RIdx1 and a second relative index RIdx2 for indicating two reference pictures used for inter-picture prediction, a first motion vector MV1, The second motion vector MV2 is provided in this order. On the other hand, the block encoded signal Block1 in the direct mode does not have the first relative index RIdx1, the second relative index RIdx2, the first motion vector MV1, and the second motion vector MV2. Which of the first relative index RIdx1 and the second relative index RIdx2 is used can be determined by the prediction type PredType. Also, the first relative index RIdx1 indicates the first reference picture, and the second relative index RIdx2 indicates the second reference picture. That is, whether it is the first reference picture or the second reference picture is determined by the data position in the coded sequence.

なお、表示時間順で前または後ろのいずれかにある、既に符号化済みであるピクチャを第1参照ピクチャとして用いる1方向参照によるピクチャ間予測符号化を行うピクチャがPピクチャであり、表示時間順で前または後ろのいずれかにある、既に符号化済みであるピクチャを第1参照ピクチャおよび第2参照ピクチャとして用いる2方向参照によるピクチャ間予測符号化を行うピクチャがBピクチャであるが、本実施の形態では、第1参照ピクチャを前方向参照ピクチャとして、第2参照ピクチャを後方向参照ピクチャとして説明する。また、第1参照ピクチャおよび第2参照ピクチャそれぞれに対する動きベクトルである第1動きベクトル、第2動きベクトルを、それぞれ前方向動きベクトル、後方向動きベクトルとして説明する。   Note that a picture that is subjected to inter-picture predictive coding by one-way reference using a previously coded picture that is either before or after in display time order as a first reference picture is a P picture, and is in display time order. In this embodiment, a picture that performs inter-picture predictive coding by bi-directional reference using a picture that has already been coded as a first reference picture and a second reference picture, either in front or behind, is a B picture. In this embodiment, the first reference picture is described as a forward reference picture, and the second reference picture is described as a backward reference picture. The first motion vector and the second motion vector, which are motion vectors for the first reference picture and the second reference picture, will be described as a forward motion vector and a backward motion vector, respectively.

次に、第1相対インデックス、第2相対インデックスの付与方法について図2(a) を用いて説明する。   Next, a method for assigning the first relative index and the second relative index will be described with reference to FIG.

第1相対インデックスの値には、まず、表示順序を示す情報において、符号化対象ピクチャより前の参照ピクチャに対し、符号化対象ピクチャに近い順より0から始まる値が割り当てられる。符号化対象より前の参照ピクチャ全てに対し0から始まる値が割り当てられたら、次に符号化対象ピクチャより後の参照ピクチャに対し、符号化対象ピクチャに近い順から続きの値が割り当てられる。   As the value of the first relative index, first, in the information indicating the display order, a value starting from 0 is assigned to the reference picture before the encoding target picture from the order closest to the encoding target picture. When a value starting from 0 is assigned to all the reference pictures before the encoding target, the subsequent values are assigned to the reference pictures after the encoding target picture in order from the closest to the encoding target picture.

第2相対インデックスの値には、まず、表示順序を示す情報において、符号化対象ピクチャより後の参照ピクチャに対し、符号化対象ピクチャに近い順より0から始まる値が割り当てられる。符号化対象より後の参照ピクチャ全てに対し0から始まる値が割り当てられたら、次に符号化対象ピクチャより前の参照ピクチャに対し、符号化対象ピクチャに近い順から続きの値が割り当てられる。   As the value of the second relative index, first, in the information indicating the display order, a value starting from 0 is assigned to the reference picture after the encoding target picture from the order close to the encoding target picture. When values starting from 0 are assigned to all the reference pictures after the encoding target, subsequent values are assigned to the reference pictures before the encoding target picture from the order closest to the encoding target picture.

例えば、図2(a) において、第1相対インデックスRIdx1が0で第2相対インデックスRidx2が1である場合、前方向参照ピクチャはピクチャ番号6のBピクチャであり、後方向参照ピクチャはピクチャ番号9のPピクチャである。ここでピクチャ番号は、表示順を示す番号である。   For example, in FIG. 2A, when the first relative index RIdx1 is 0 and the second relative index Ridx2 is 1, the forward reference picture is a B picture with picture number 6, and the backward reference picture is picture number 9. P picture. Here, the picture number is a number indicating the display order.

ブロック中の相対インデックスは可変長符号語により表現され、値が小さいほど短い符号長のコードが割り当てられている。通常、ピクチャ間予測の参照ピクチャとして符号化対象ピクチャに最も近いピクチャが選択されるため、上記のように符号化対象ピクチャに近い順に相対インデックス値を割り当てれば符号化効率は高くなる。   The relative index in the block is expressed by a variable-length code word, and a code having a shorter code length is assigned as the value is smaller. Normally, the picture closest to the encoding target picture is selected as the reference picture for inter-picture prediction. Therefore, if the relative index values are assigned in the order closest to the encoding target picture as described above, the encoding efficiency increases.

一方、符号化信号中のバッファ制御信号(図3に示すHeader内のRPSL)を用いて明示的に指示することにより、相対インデックスに対する参照ピクチャの割り当てを任意に変更することができる。この割り当ての変更により、第2相対インデックスが0の参照ピクチャを参照ピクチャ用メモリ107内の任意の参照ピクチャにすることも可能で、例えば、図2(b) に示すようにピクチャに対する相対インデックスの割り当てを変更することができる。   On the other hand, by explicitly instructing using the buffer control signal (RPSL in the Header shown in FIG. 3) in the encoded signal, it is possible to arbitrarily change the allocation of the reference picture to the relative index. By changing the allocation, it is possible to make the reference picture whose second relative index is 0 as an arbitrary reference picture in the reference picture memory 107. For example, as shown in FIG. The assignment can be changed.

次に、上記のように構成された動画像符号化装置の動作について説明する。
図4は、並べ替え用メモリ101におけるピクチャの順序を示す説明図であり、(a) 入力された順序、(b) 並び替えられた順序を示す説明図である。ここで、縦線はピクチャを示し、各ピクチャの右下に示す記号は、1文字目のアルファベットがピクチャタイプ(I、PまたはB)を示し、2文字目以降の数字が表示順を示すピクチャ番号を示している。
Next, the operation of the moving picture coding apparatus configured as described above will be described.
FIG. 4 is an explanatory diagram showing the order of pictures in the rearrangement memory 101, and is an explanatory diagram showing (a) the input order and (b) the rearrangement order. Here, the vertical line indicates a picture, and the symbol shown at the lower right of each picture is a picture in which the first alphabet indicates the picture type (I, P, or B), and the second and subsequent numbers indicate the display order. Numbers are shown.

入力画像は、例えば図4(a) に示すように表示時間順にピクチャ単位で並べ替え用メモリ101に入力される。並べ替え用メモリ101にピクチャが入力されると、符号化制御部110は、並べ替え用メモリ101内で入力された各ピクチャを、符号化が行われる順に並び替える。この符号化順への並び替えは、ピクチャ間予測符号化における参照関係に基づいて行われ、参照ピクチャとして用いられるピクチャが、参照ピクチャとして用いるピクチャよりも先に符号化されるように並び替えられる。   For example, as shown in FIG. 4A, the input image is input to the rearrangement memory 101 in units of pictures in order of display time. When a picture is input to the rearrangement memory 101, the encoding control unit 110 rearranges each picture input in the rearrangement memory 101 in the order in which encoding is performed. This rearrangement to the coding order is performed based on the reference relationship in the inter-picture predictive coding, and the picture used as the reference picture is rearranged so that it is coded before the picture used as the reference picture. .

ここで、Pピクチャは表示時間順で前方または後方にある、近傍の既に符号化済みのIまたはPピクチャを1つ参照するものとする。また、Bピクチャは表示時間順で前方または後方にある、近傍の既に符号化済みのピクチャを2つ参照するものとする。   Here, it is assumed that the P picture refers to one nearby already encoded I or P picture that is forward or backward in display time order. In addition, it is assumed that the B picture refers to two neighboring encoded pictures that are forward or backward in display time order.

ピクチャの符号化順は、2つのPピクチャの間にあるBピクチャ(図4(a) の例では3枚)のうち、中央にあるピクチャから符号化を行い、その後Pピクチャに近いBピクチャを符号化するとする。例えばピクチャB6〜P9については、ピクチャP9、B7、B6、B8の順に符号化を行う。   The encoding order of the pictures is that B pictures between the two P pictures (three pictures in the example of FIG. 4 (a)) are coded from the picture at the center, and then the B picture close to the P picture is selected. Suppose you want to encode. For example, the pictures B6 to P9 are encoded in the order of pictures P9, B7, B6, and B8.

この場合、ピクチャB6〜P9の各ピクチャは、図4(a) に示す矢印の終点のピクチャが矢印に始点のピクチャを参照する。すなわち、ピクチャB7はピクチャP5、P9を、ピクチャB6はピクチャP5、B7を、ピクチャB8はピクチャB7、P9を参照する。またこの場合、符号化制御部110は、各ピクチャを図4(b) に示すように符号化が行われる順に並び替える。   In this case, in each of the pictures B6 to P9, the picture at the end point of the arrow shown in FIG. 4A refers to the picture at the start point of the arrow. That is, the picture B7 refers to the pictures P5 and P9, the picture B6 refers to the pictures P5 and B7, and the picture B8 refers to the pictures B7 and P9. In this case, the encoding control unit 110 rearranges the pictures in the order in which the encoding is performed as shown in FIG.

次に、並べ替え用メモリ101で並び替えが行われた各ピクチャは、動き補償の単位で読み出される。ここでは、動き補償の単位をマクロブロックと呼び、マクロブロックは水平16×垂直16画素の大きさであるとする。以下では、図4(a) に示すピクチャP9、B7、B6、B8の符号化処理について順に説明する。   Next, each picture rearranged in the rearrangement memory 101 is read out in units of motion compensation. Here, the unit of motion compensation is referred to as a macroblock, and the macroblock has a size of horizontal 16 × vertical 16 pixels. Hereinafter, the encoding processing of the pictures P9, B7, B6, and B8 shown in FIG.

<ピクチャP9の符号化処理>
ピクチャP9はPピクチャであるので、表示時間順で前方または後方にある既に処理済みの1枚のピクチャを参照してピクチャ間予測符号化を行う。ピクチャP9の符号化においては、上記のように参照ピクチャはピクチャP5となる。ピクチャP5は、既に符号化が終了しており、復号化画像が参照ピクチャ用メモリ107に蓄積されている。Pピクチャの符号化においては、符号化制御部110は、スイッチ113、114、115がオンになるように各スイッチを制御する。これにより、並べ替え用メモリ101から読み出されたピクチャP9のマクロブロックは、まず動きベクトル検出部108、モード選択部109、および差分演算部102に入力される。
<Encoding process of picture P9>
Since the picture P9 is a P picture, inter-picture prediction coding is performed with reference to one already processed picture that is forward or backward in display time order. In the coding of the picture P9, the reference picture is the picture P5 as described above. The picture P5 has already been encoded, and the decoded picture is stored in the reference picture memory 107. In encoding a P picture, the encoding control unit 110 controls each switch so that the switches 113, 114, and 115 are turned on. Thereby, the macroblock of the picture P9 read from the rearrangement memory 101 is first input to the motion vector detection unit 108, the mode selection unit 109, and the difference calculation unit 102.

動きベクトル検出部108は、参照ピクチャ用メモリ107に蓄積されたピクチャP5の復号化画像データを参照ピクチャとして用い、ピクチャP9のマクロブロックに対して、動きベクトルの検出を行う。そして、動きベクトル検出部108は、検出した動きベクトルをモード選択部109に対して出力する。   The motion vector detection unit 108 uses the decoded image data of the picture P5 stored in the reference picture memory 107 as a reference picture, and detects a motion vector for the macroblock of the picture P9. Then, the motion vector detection unit 108 outputs the detected motion vector to the mode selection unit 109.

モード選択部109は、動きベクトル検出部108で検出された動きベクトルを用いて、ピクチャP9のマクロブロックの符号化モードを決定する。ここで符号化モードとは、マクロブロックをどのような方法で符号化するかを示すものである。Pピクチャの場合には、例えば、ピクチャ内符号化、動きベクトルを用いたピクチャ間予測符号化、動きベクトルを用いない(動きを0として扱う)ピクチャ間予測符号化の中から、いずれの方法で符号化するかを決める。符号化モードの決定においては、一般的には、少ないビット量でより符号化誤差が小さくなるような方法を選択する。   The mode selection unit 109 uses the motion vector detected by the motion vector detection unit 108 to determine the encoding mode of the macroblock of the picture P9. Here, the encoding mode indicates how the macroblock is encoded. In the case of a P picture, for example, any of an intra-picture encoding, an inter-picture predictive encoding using a motion vector, and an inter-picture predictive encoding not using a motion vector (treating motion as 0) is used. Decide whether to encode. In determining the coding mode, generally, a method is selected such that the coding error becomes smaller with a small amount of bits.

モード選択部109は、決定した符号化モードを符号列生成部104に対して出力する。このとき、モード選択部109で決定された符号化モードが、ピクチャ間予測符号化である場合には、そのピクチャ間予測符号化で用いられる動きベクトルを符号列生成部104に対して出力し、さらに動きベクトル記憶部116に記憶する。   The mode selection unit 109 outputs the determined encoding mode to the code string generation unit 104. At this time, when the coding mode determined by the mode selection unit 109 is inter-picture predictive coding, the motion vector used in the inter-picture predictive coding is output to the code string generation unit 104, Further, it is stored in the motion vector storage unit 116.

また、モード選択部109は、決定した符号化モードに基づいて予測画像データを生成し、この予測画像データを差分演算部102と加算演算部106とに出力する。但し、モード選択部109は、ピクチャ内符号化を選択した場合には、予測画像データを出力しない。また、モード選択部109は、ピクチャ内符号化を選択した場合には、スイッチ111をa側に、スイッチ112をc側に接続するように制御し、ピクチャ間予測符号化を選択した場合には、スイッチ111をb側に、スイッチ112をd側に接続するように制御する。以下では、モード選択部109でピクチャ間予測符号化が選択された場合について説明する。   Further, the mode selection unit 109 generates predicted image data based on the determined encoding mode, and outputs the predicted image data to the difference calculation unit 102 and the addition calculation unit 106. However, the mode selection unit 109 does not output predicted image data when intra-picture encoding is selected. The mode selection unit 109 controls the switch 111 to be connected to the a side and the switch 112 to the c side when the intra-picture encoding is selected, and when the inter-picture predictive encoding is selected. The switch 111 is controlled to be connected to the b side and the switch 112 is connected to the d side. Hereinafter, a case where inter-picture prediction coding is selected by the mode selection unit 109 will be described.

差分演算部102には、並べ替え用メモリ101から読み出されたピクチャP9のマクロブロックの画像データと、モード選択部109から出力された予測画像データとが入力される。差分演算部102は、ピクチャP9のマクロブロックの画像データと予測画像データとの差分を演算し、予測誤差画像データを生成して予測誤差符号化部103へ出力する。   The difference calculation unit 102 receives the macroblock image data of the picture P9 read from the rearrangement memory 101 and the predicted image data output from the mode selection unit 109. The difference calculation unit 102 calculates the difference between the image data of the macroblock of the picture P9 and the prediction image data, generates prediction error image data, and outputs the prediction error image data to the prediction error encoding unit 103.

予測誤差符号化部103は、入力された予測誤差画像データに対して周波数変換や量子化等の符号化処理を施すことにより、符号化データを生成して符号列生成部104および予測誤差復号化部105へ出力する。ここで、周波数変換や量子化の処理は、例えば水平8×垂直8画素や、水平4×垂直4画素の単位で行うものとする。   The prediction error encoding unit 103 performs encoding processing such as frequency conversion and quantization on the input prediction error image data to generate encoded data, and the code string generation unit 104 and the prediction error decoding To the unit 105. Here, frequency conversion and quantization processing are performed in units of horizontal 8 × vertical 8 pixels or horizontal 4 × vertical 4 pixels, for example.

符号列生成部104は、入力された符号化データに対して、可変長符号化等を施し、さらに動きベクトルや符号化モード等の情報やヘッダ情報等を付加することにより符号列を生成し、出力する。   The code string generation unit 104 performs variable-length coding or the like on the input encoded data, and generates a code string by adding information such as a motion vector and a coding mode, header information, and the like, Output.

一方、予測誤差復号化部105は、入力された符号化データに対して、逆量子化や逆周波数変換等の復号化処理を施し、復号化差分画像データを生成して加算演算部106へ出力する。加算演算部106は、復号化差分画像データと、モード選択部109より入力された予測画像データとを加算することにより、復号化画像データを生成し、参照ピクチャ用メモリ107に蓄積する。   On the other hand, the prediction error decoding unit 105 performs decoding processing such as inverse quantization or inverse frequency conversion on the input encoded data, generates decoded difference image data, and outputs the decoded difference image data to the addition operation unit 106. To do. The addition operation unit 106 generates decoded image data by adding the decoded differential image data and the predicted image data input from the mode selection unit 109, and stores the decoded image data in the reference picture memory 107.

以上の処理により、ピクチャP9の1マクロブロックの処理が完結する。同様の処理により、ピクチャP9の残りのマクロブロックに対しても符号化処理が行われる。そして、ピクチャP9の全てのマクロブロックに対して処理が終わると、次にピクチャB7の符号化処理が行われる。   With the above processing, processing of one macroblock of the picture P9 is completed. By the same process, the encoding process is performed also on the remaining macroblocks of the picture P9. When the processing is completed for all the macroblocks of the picture P9, the encoding process for the picture B7 is performed next.

<ピクチャB7の符号化処理>
ピクチャB7の参照画像は、前方向参照ピクチャがピクチャP5、後方向参照ピクチャがP9となる。ピクチャB7は、他のピクチャの符号化の際に、参照ピクチャとして用いられるので、符号化制御部110は、スイッチ113、114、115がオンになるように各スイッチを制御する。よって、並べ替え用メモリ101から読み出されたピクチャB7のマクロブロックは、動きベクトル検出部108、モード選択部109、および差分演算部102に入力される。
<Encoding process of picture B7>
In the reference image of picture B7, the forward reference picture is picture P5 and the backward reference picture is P9. Since the picture B7 is used as a reference picture when other pictures are encoded, the encoding control unit 110 controls each switch so that the switches 113, 114, and 115 are turned on. Therefore, the macroblock of the picture B7 read from the rearrangement memory 101 is input to the motion vector detection unit 108, the mode selection unit 109, and the difference calculation unit 102.

動きベクトル検出部108は、参照ピクチャ用メモリ107に蓄積されたピクチャP5の復号化画像データを前方向参照ピクチャとして、ピクチャP9の復号化画像データを後方向参照ピクチャとして用い、ピクチャB7のマクロブロックに対して、前方向動きベクトルと後方向動きベクトルの検出を行う。そして、動きベクトル検出部108は、検出した動きベクトルをモード選択部109に対して出力する。   The motion vector detection unit 108 uses the decoded image data of the picture P5 stored in the reference picture memory 107 as the forward reference picture, the decoded image data of the picture P9 as the backward reference picture, and uses the macroblock of the picture B7. In contrast, the forward motion vector and the backward motion vector are detected. Then, the motion vector detection unit 108 outputs the detected motion vector to the mode selection unit 109.

モード選択部109は、動きベクトル検出部108で検出された動きベクトルを用いて、ピクチャB7のマクロブロックの符号化モードを決定する。ここで、Bピクチャの符号化モードは、例えば、ピクチャ内符号化、前方向動きベクトルを用いたピクチャ間予測符号化、後方向動きベクトルを用いたピクチャ間予測符号化、2方向動きベクトルを用いたピクチャ間予測符号化、ダイレクトモードから選択することができるとする。   The mode selection unit 109 uses the motion vector detected by the motion vector detection unit 108 to determine the coding mode of the macroblock of the picture B7. Here, the B picture coding mode uses, for example, intra-picture coding, inter-picture predictive coding using forward motion vectors, inter-picture predictive coding using backward motion vectors, and two-way motion vectors. It is assumed that the selection can be made from the inter-picture predictive coding or the direct mode.

ここで、ダイレクトモードで符号化する場合の動作について、図5(a) を用いて説明する。図5(a) はダイレクトモードにおける動きベクトルを示す説明図であり、ピクチャB7のブロックaをダイレクトモードで符号化する場合を示している。この場合、ピクチャB7の後方にある参照ピクチャであるピクチャP9中の、ブロックaと同じ位置にあるブロックbを符号化した際に用いた動きベクトルcを利用する。動きベクトルcは、動きベクトル記憶部116に記憶されている。ブロックaは、動きベクトルcを利用して求めた動きベクトルを用いて、前方向参照ピクチャであるピクチャP5と、後方向参照ピクチャであるピクチャP9とから2方向予測を行う。例えば、動きベクトルcを利用する方法としては、動きベクトルcに平行な動きベクトルを生成する方法がある。この場合のブロックaを符号化する際に用いる動きベクトルは、ピクチャP5に対しては動きベクトルd、ピクチャP9に対しては動きベクトルeとなる。   Here, the operation in the case of encoding in the direct mode will be described with reference to FIG. FIG. 5 (a) is an explanatory diagram showing motion vectors in the direct mode, and shows a case where the block a of the picture B7 is encoded in the direct mode. In this case, the motion vector c used when the block b located at the same position as the block a in the picture P9 which is the reference picture behind the picture B7 is used. The motion vector c is stored in the motion vector storage unit 116. Block a performs bi-directional prediction from picture P5, which is a forward reference picture, and picture P9, which is a backward reference picture, using a motion vector obtained using motion vector c. For example, as a method of using the motion vector c, there is a method of generating a motion vector parallel to the motion vector c. The motion vector used when coding the block a in this case is the motion vector d for the picture P5 and the motion vector e for the picture P9.

この場合、前方向動きベクトルである動きベクトルdの大きさをMVF、後方向動きベクトルである動きベクトルeの大きさをMVB、動きベクトルcの大きさをMV、現在のピクチャ(ピクチャB7)の後方向参照ピクチャ(ピクチャP9)と、その後方向参照ピクチャのブロックが参照しているピクチャ(ピクチャP5)との時間的距離をTRD、現在のピクチャ(ピクチャB7)と前方向参照ピクチャ(ピクチャP5)との時間的距離をTRFとすると、動きベクトルdの大きさMVF、動きベクトルeの大きさMVBは、それぞれ(式1)、(式2)で求められる。なお、各ピクチャ間の時間的距離については、例えば各ピクチャに付される表示順序(位置)を示す情報、またはその情報の差に基づいて決定することができる。   In this case, the magnitude of the motion vector d that is the forward motion vector is MVF, the magnitude of the motion vector e that is the backward motion vector is MVB, the magnitude of the motion vector c is MV, and the current picture (picture B7) The temporal distance between the backward reference picture (picture P9) and the picture (picture P5) referenced by the block of the backward reference picture is TRD, the current picture (picture B7) and the forward reference picture (picture P5). If the time distance between and is TRF, the magnitude MVF of the motion vector d and the magnitude MVB of the motion vector e are obtained by (Equation 1) and (Equation 2), respectively. The temporal distance between the pictures can be determined based on, for example, information indicating the display order (position) given to each picture or a difference between the information.

MVF=MV×TRF/TRD −−− 式1
MVB=(TRF−TRD)×MV/TRD −−− 式2
MVF = MV × TRF / TRD --- Formula 1
MVB = (TRF−TRD) × MV / TRD −−− Formula 2

ここで、MVF、MVBは、動きベクトルの水平成分、垂直成分のそれぞれを表現しており、正負符号は動きベクトルの方向を示すものとする。   Here, MVF and MVB represent the horizontal and vertical components of the motion vector, respectively, and the positive and negative signs indicate the direction of the motion vector.

さて、符号化モードの選択においては、一般的に、少ないビット量でより符号化誤差が小さくなるような方法を選択する。モード選択部109は、決定した符号化モードを符号列生成部104に対して出力する。このとき、モード選択部109で決定された符号化モードが、ピクチャ間予測符号化である場合には、そのピクチャ間予測符号化で用いられる動きベクトルを符号列生成部104に対して出力し、さらに動きベクトル記憶部116に記憶する。また、ダイレクトモードが選択された場合には、(式1)、(式2)により計算し求めた、ダイレクトモードで用いた動きベクトルを動きベクトル記憶部116に記憶する。   In selecting an encoding mode, generally, a method is selected such that the encoding error is reduced with a small amount of bits. The mode selection unit 109 outputs the determined encoding mode to the code string generation unit 104. At this time, when the coding mode determined by the mode selection unit 109 is inter-picture predictive coding, the motion vector used in the inter-picture predictive coding is output to the code string generation unit 104, Further, it is stored in the motion vector storage unit 116. When the direct mode is selected, the motion vector used in the direct mode calculated by (Equation 1) and (Equation 2) is stored in the motion vector storage unit 116.

また、モード選択部109は、決定した符号化モードに基づいて予測画像データを生成し、この予測画像データを差分演算部102と加算演算部106とに出力する。但し、モード選択部109は、ピクチャ内符号化を選択した場合には、予測画像データを出力しない。また、モード選択部109は、ピクチャ内符号化を選択した場合には、スイッチ111をa側に、スイッチ112をc側に接続するように制御し、ピクチャ間予測符号化やダイレクトモードを選択した場合には、スイッチ111をb側に、スイッチ112をd側に接続するように制御する。以下では、モード選択部109でピクチャ間予測符号化やダイレクトモードが選択された場合について説明する。   Further, the mode selection unit 109 generates predicted image data based on the determined encoding mode, and outputs the predicted image data to the difference calculation unit 102 and the addition calculation unit 106. However, the mode selection unit 109 does not output predicted image data when intra-picture encoding is selected. In addition, when selecting intra-picture coding, the mode selection unit 109 controls the switch 111 to be connected to the a side and the switch 112 to the c side, and selects inter-picture predictive coding or direct mode. In this case, control is performed so that the switch 111 is connected to the b side and the switch 112 is connected to the d side. Hereinafter, a case where inter-picture predictive coding or direct mode is selected by the mode selection unit 109 will be described.

差分演算部102には、並べ替え用メモリ101から読み出されたピクチャB7のマクロブロックの画像データと、モード選択部109から出力された予測画像データが入力される。差分演算部102は、ピクチャB7のマクロブロックの画像データと予測画像データとの差分を演算し、予測誤差画像データを生成して予測誤差符号化部103へ出力する。   The difference calculation unit 102 receives the macroblock image data of the picture B7 read from the rearrangement memory 101 and the predicted image data output from the mode selection unit 109. The difference calculation unit 102 calculates a difference between the image data of the macroblock of the picture B7 and the prediction image data, generates prediction error image data, and outputs the prediction error image data to the prediction error encoding unit 103.

予測誤差符号化部103は、入力された予測誤差画像データに対して周波数変換や量子化等の符号化処理を施すことにより、符号化データを生成して符号列生成部104および予測誤差復号化部105へ出力する。   The prediction error encoding unit 103 performs encoding processing such as frequency conversion and quantization on the input prediction error image data to generate encoded data, and the code string generation unit 104 and the prediction error decoding To the unit 105.

符号列生成部104は、入力された符号化データに対して、可変長符号化等を施し、さらに動きベクトルや符号化モード等の情報を付加することにより符号列を生成し、出力する。   The code string generation unit 104 performs variable-length coding or the like on the input encoded data, and further generates and outputs a code string by adding information such as a motion vector and a coding mode.

一方、予測誤差復号化部105は、入力された符号化データに対して、逆量子化や逆周波数変換等の復号化処理を施し、復号化差分画像データを生成して加算演算部106へ出力する。加算演算部106は、復号化差分画像データと、モード選択部109より入力された予測画像データとを加算することにより、復号化画像データを生成し、参照ピクチャ用メモリ107に蓄積する。   On the other hand, the prediction error decoding unit 105 performs decoding processing such as inverse quantization or inverse frequency conversion on the input encoded data, generates decoded difference image data, and outputs the decoded difference image data to the addition operation unit 106. To do. The addition operation unit 106 generates decoded image data by adding the decoded differential image data and the predicted image data input from the mode selection unit 109, and stores the decoded image data in the reference picture memory 107.

以上の処理により、ピクチャB7の1マクロブロックの処理が完結する。同様の処理により、ピクチャB7の残りのマクロブロックに対して、符号化処理が行われる。そして、ピクチャB7の全てのマクロブロックに対する処理が終わると、次にピクチャB6の符号化処理が行われる。   With the above processing, processing of one macroblock of picture B7 is completed. The encoding process is performed on the remaining macroblock of the picture B7 by the same process. When all macroblocks in picture B7 are processed, the encoding process for picture B6 is next performed.

<ピクチャB6の符号化処理>
ピクチャB6はBピクチャであるので、表示時間順で前方または後方にある既に処理済みの2枚のピクチャを参照してピクチャ間予測符号化を行う。このピクチャB6の参照画像は、上記のように前方向参照ピクチャがピクチャP5、後方向参照ピクチャがB7となる。ピクチャB6は、他のピクチャの符号化を行う際に、参照ピクチャとして用いられない。よって、符号化制御部110は、スイッチ113をオンに、スイッチ114、115をオフにするように各スイッチを制御する。これにより、並べ替え用メモリ101から読み出されたピクチャB6のマクロブロックは、動きベクトル検出部108、モード選択部109、および差分演算部102に入力される。
<Encoding process of picture B6>
Since the picture B6 is a B picture, inter-picture predictive encoding is performed with reference to two already processed pictures that are forward or backward in display time order. In the reference image of the picture B6, the forward reference picture is the picture P5 and the backward reference picture is B7 as described above. The picture B6 is not used as a reference picture when other pictures are encoded. Therefore, the encoding control unit 110 controls each switch so that the switch 113 is turned on and the switches 114 and 115 are turned off. Thereby, the macroblock of the picture B6 read from the rearrangement memory 101 is input to the motion vector detection unit 108, the mode selection unit 109, and the difference calculation unit 102.

動きベクトル検出部108は、参照ピクチャ用メモリ107に蓄積されたピクチャP5の復号化画像データを前方向参照ピクチャとして、ピクチャB7の復号化画像データを後方向参照ピクチャとして用い、ピクチャB6のマクロブロックに対して、前方向動きベクトルと後方向動きベクトルの検出を行う。そして、動きベクトル検出部108は、検出した動きベクトルをモード選択部109に対して出力する。   The motion vector detection unit 108 uses the decoded image data of the picture P5 stored in the reference picture memory 107 as the forward reference picture, the decoded image data of the picture B7 as the backward reference picture, and the macroblock of the picture B6 In contrast, the forward motion vector and the backward motion vector are detected. Then, the motion vector detection unit 108 outputs the detected motion vector to the mode selection unit 109.

モード選択部109は、動きベクトル検出部108で検出された動きベクトルを用いて、ピクチャB6のマクロブロックの符号化モードを決定する。   The mode selection unit 109 uses the motion vector detected by the motion vector detection unit 108 to determine the encoding mode of the macroblock of the picture B6.

ここで、ピクチャB6のマクロブロックに対して、ダイレクトモードを用いる場合の動作について、第一の例を図5(b) を用いて説明する。図5(b) はダイレクトモードにおける動きベクトルを示す説明図であり、ピクチャB6のブロックaをダイレクトモードで符号化する場合を示している。この場合、ピクチャB6の後方にある参照ピクチャであるピクチャB7中の、ブロックaと同じ位置にあるブロックbを符号化した際に用いた動きベクトルを利用する。ここではブロックbは、前方向参照のみ、または2方向参照により符号化されたとし、その前方向動きベクトルを動きベクトルcとする。この動きベクトルcは、動きベクトル記憶部116に記憶されているとする。ブロックaは、動きベクトルcを利用して生成した動きベクトルを用いて、前方向参照ピクチャであるピクチャP5と、後方向参照ピクチャであるピクチャB7とから2方向予測を行う。例えば、上記ピクチャB7の場合と同様に動きベクトルcに平行な動きベクトルを生成する方法を用いれば、ブロックaを符号化する際に用いる動きベクトルは、ピクチャP5に対しては動きベクトルd、ピクチャB7に対しては動きベクトルeとなる。   Here, the operation in the case of using the direct mode for the macroblock of the picture B6 will be described with reference to FIG. 5B. FIG. 5B is an explanatory diagram showing motion vectors in the direct mode, and shows a case where the block a of the picture B6 is encoded in the direct mode. In this case, the motion vector used when the block b at the same position as the block a in the picture B7, which is the reference picture behind the picture B6, is used. Here, it is assumed that the block b is encoded by only forward reference or two-way reference, and the forward motion vector is a motion vector c. It is assumed that the motion vector c is stored in the motion vector storage unit 116. Block a performs bi-directional prediction from picture P5, which is a forward reference picture, and picture B7, which is a backward reference picture, using a motion vector generated using motion vector c. For example, if a method for generating a motion vector parallel to the motion vector c is used as in the case of the picture B7, the motion vector used when coding the block a is the motion vector d, the picture for the picture P5. For B7, it becomes the motion vector e.

この場合、前方向動きベクトルである動きベクトルdの大きさをMVF、後方向動きベクトルである動きベクトルeの大きさをMVB、動きベクトルcの大きさをMV、現在のピクチャ(ピクチャB6)の後方向参照ピクチャ(ピクチャB7)と、その後方向参照ピクチャのブロックbが参照しているピクチャ(ピクチャP5)との時間的距離をTRD、現在のピクチャ(ピクチャB6)と前方向参照ピクチャ(ピクチャP5)との時間的距離をTRFとすると、動きベクトルdの大きさMVF、動きベクトルeの大きさMVBは、それぞれ上記(式1)、(式2)で求められる。なお、各ピクチャ間の時間的距離については、例えば各ピクチャに付される表示順序を示す情報、またはその情報の差に基づいて決定することができる。   In this case, the magnitude of the motion vector d that is the forward motion vector is MVF, the magnitude of the motion vector e that is the backward motion vector is MVB, the magnitude of the motion vector c is MV, and the current picture (picture B6) The temporal distance between the backward reference picture (picture B7) and the picture (picture P5) referenced by the block b of the backward reference picture is TRD, the current picture (picture B6) and the forward reference picture (picture P5). ) Is a time distance from TRF, the magnitude MVF of the motion vector d and the magnitude MVB of the motion vector e are obtained by the above (formula 1) and (formula 2), respectively. Note that the temporal distance between pictures can be determined based on, for example, information indicating the display order given to each picture, or a difference between the information.

このようにダイレクトモードにおいて、後方向参照ピクチャであるBピクチャの前方向動きベクトルに対してスケーリングを行うことにより、動きベクトルの情報を送る必要がなく、かつ動き予測効率を向上させることができる。これにより符号化効率を向上させることができる。さらに、前方向参照ピクチャおよび後方向参照ピクチャとして、利用可能な限り表示時間順で最近傍の参照ピクチャを用いることにより、符号化効率を向上させることができる。   In this way, by performing scaling on the forward motion vector of the B picture that is the backward reference picture in the direct mode, it is not necessary to send motion vector information and the motion prediction efficiency can be improved. Thereby, encoding efficiency can be improved. Furthermore, the encoding efficiency can be improved by using the nearest reference pictures in the order of display time as much as possible as the forward reference picture and the backward reference picture.

次に、ダイレクトモードを用いる場合の第二の例を図5(b) を用いて説明する。この場合、ピクチャB6の後方にある参照ピクチャであるピクチャB7中の、ブロックaと同じ位置にあるブロックbを符号化した際に用いられた動きベクトルを利用する。ここではブロックbは、ダイレクトモードで符号化されたとし、そのときに実質的に用いられた前方向動きベクトルを動きベクトルcとする。すなわち、動きベクトルcは、ピクチャB7が後方向参照するピクチャP9内で、ブロックbと同一位置にあるブロックiを符号化する際に用いた動きベクトルをスケーリングすることにより得られた動きベクトルである。この動きベクトルcは、動きベクトル記憶部116に記憶されているものを用いるか、またはブロックbをダイレクトモードで符号化する際に用いたピクチャP9内のブロックiの動きベクトルを動きベクトル記憶部116から読み出して計算して求める。なお、モード選択部109は、ピクチャB7のブロックbをダイレクトモードで符号化する際にスケーリング処理により求めた動きベクトルを、動きベクトル記憶部116に記憶する場合は、前方向動きベクトルだけを記憶すればよい。ブロックaは、動きベクトルcを利用して生成した動きベクトルを用いて、前方向参照ピクチャであるピクチャP5と、後方向参照ピクチャB7とから2方向予測を行う。例えば、上記第一の例の場合と同様に動きベクトルcに平行な動きベクトルを生成する方法を用いれば、ブロックaを符号化する際に用いる動きベクトルは、ピクチャP5に対しては動きベクトルd、ピクチャB7に対しては動きベクトルeとなる。   Next, a second example in the case of using the direct mode will be described with reference to FIG. In this case, the motion vector used when the block b located at the same position as the block a in the picture B7 which is the reference picture behind the picture B6 is used. Here, it is assumed that the block b is encoded in the direct mode, and the forward motion vector substantially used at that time is the motion vector c. That is, the motion vector c is a motion vector obtained by scaling the motion vector used when coding the block i at the same position as the block b in the picture P9 that the picture B7 refers to backward. . As the motion vector c, the motion vector stored in the motion vector storage unit 116 is used, or the motion vector of the block i in the picture P9 used when the block b is encoded in the direct mode is used as the motion vector storage unit 116. Calculated by reading from. Note that the mode selection unit 109 stores only the forward motion vector when the motion vector obtained by the scaling process when the block b of the picture B7 is encoded in the direct mode in the motion vector storage unit 116. That's fine. Block a performs bi-directional prediction from picture P5, which is a forward reference picture, and backward reference picture B7, using a motion vector generated using motion vector c. For example, if a method for generating a motion vector parallel to the motion vector c is used as in the case of the first example, the motion vector used when coding the block a is the motion vector d for the picture P5. For the picture B7, the motion vector e is obtained.

この場合、ブロックaに対する前方向動きベクトルである動きベクトルdの大きさMVFと、後方向動きベクトルである動きベクトルeの大きさMVBとは、ダイレクトモードの第一の例と同様に、(式1)、(式2)を用いて求めることができる。   In this case, the magnitude MVF of the motion vector d, which is the forward motion vector for the block a, and the magnitude MVB of the motion vector e, which is the backward motion vector, are expressed in the same manner as in the first example of the direct mode. 1) and (Equation 2).

このようにダイレクトモードにおいて、後方向参照ピクチャであるBピクチャのダイレクトモードで実質的に用いた前方向動きベクトルに対してスケーリングを行うので、動きベクトルの情報を送る必要がなく、かつ後方向参照ピクチャ内の同一位置のブロックがダイレクトモードで符号化されている場合でも、動き予測効率を向上させることができる。これにより符号化効率を向上させることができる。さらに、前方向および後方向の参照ピクチャとして、表示時間順で利用可能な最近傍の参照ピクチャを用いることにより、符号化効率を向上させることができる。   In this way, in the direct mode, scaling is performed on the forward motion vector substantially used in the direct mode of the B picture which is the backward reference picture, so there is no need to send motion vector information and the backward reference Even when a block at the same position in a picture is encoded in the direct mode, the motion prediction efficiency can be improved. Thereby, encoding efficiency can be improved. Furthermore, encoding efficiency can be improved by using the nearest reference picture that can be used in the display time order as the forward and backward reference pictures.

次に、ダイレクトモードを用いる場合の第三の例を図5(c) を用いて説明する。図5(c) はダイレクトモードにおける動きベクトルを示す説明図であり、ピクチャB6のブロックaをダイレクトモードで符号化する場合を示している。この場合、ピクチャB6の後方にある参照ピクチャであるピクチャB7中の、ブロックaと同じ位置にあるブロックbを符号化する際に用いられた動きベクトルを利用する。ここでブロックbは、後方向動きベクトルのみを用いて符号化されているとし、その後方向動きベクトルが動きベクトルfであるとする。動きベクトルfは、動きベクトル記憶部116に記憶されているとする。ブロックaは、動きベクトルfを利用して生成した動きベクトルを用いて、前方向参照ピクチャであるピクチャP5と、後方向参照ピクチャであるピクチャB7とから2方向予測を行う。例えば、上記第一の例の場合と同様に動きベクトルfに平行な動きベクトルを生成する方法を用いれば、ブロックaを符号化する際に用いる動きベクトルは、ピクチャP5に対しては動きベクトルg、ピクチャB7に対しては動きベクトルhとなる。   Next, a third example using the direct mode will be described with reference to FIG. FIG. 5C is an explanatory diagram showing motion vectors in the direct mode, and shows a case where the block a of the picture B6 is encoded in the direct mode. In this case, the motion vector used when coding the block b in the same position as the block a in the picture B7 which is the reference picture behind the picture B6 is used. Here, it is assumed that the block b is encoded using only the backward motion vector, and the backward motion vector is the motion vector f. It is assumed that the motion vector f is stored in the motion vector storage unit 116. Block a performs bi-directional prediction from picture P5, which is a forward reference picture, and picture B7, which is a backward reference picture, using a motion vector generated using motion vector f. For example, if a method of generating a motion vector parallel to the motion vector f is used as in the case of the first example, the motion vector used when coding the block a is the motion vector g for the picture P5. For the picture B7, the motion vector is h.

この場合、前方向動きベクトルである動きベクトルgの大きさをMVF、後方向動きベクトルである動きベクトルhの大きさをMVB、動きベクトルfの大きさをMV、現在のピクチャ(ピクチャB6)の後方向参照ピクチャ(ピクチャB7)と、その後方向参照ピクチャのブロックが参照しているピクチャ(ピクチャP9)との時間的距離をTRD、現在のピクチャ(ピクチャB6)と前方向参照ピクチャ(ピクチャP5)との時間的距離をTRF、現在のピクチャ(ピクチャB6)と後方向参照ピクチャ(ピクチャB7)との時間的距離をTRB、とすると、動きベクトルgの大きさMVF、動きベクトルhの大きさMVBは、それぞれ(式3)、(式4)で求められる。   In this case, the magnitude of the motion vector g which is the forward motion vector is MVF, the magnitude of the motion vector h which is the backward motion vector is MVB, the magnitude of the motion vector f is MV, and the current picture (picture B6) The temporal distance between the backward reference picture (picture B7) and the picture (picture P9) referenced by the block of the backward reference picture is TRD, the current picture (picture B6) and the forward reference picture (picture P5). , TRF, and TRB as the temporal distance between the current picture (picture B6) and the backward reference picture (picture B7), the magnitude MVF of the motion vector g and the magnitude MVB of the motion vector h Are obtained by (Equation 3) and (Equation 4), respectively.

MVF=−TRF×MV/TRD −−− 式3
MVB=TRB×MV/TRD −−− 式4
MVF = −TRF × MV / TRD −−− Equation 3
MVB = TRB × MV / TRD −−− Equation 4

このようにダイレクトモードにおいて、後方向参照ピクチャであるBピクチャの同一位置のブロックを符号化する際に用いた後方向動きベクトルに対してスケーリングを行うので、動きベクトルの情報を送る必要がなく、かつ後方向参照ピクチャ内の同一位置のブロックが後方向動きベクトルしか有さない場合でも、予測効率を向上させることができる。これにより、符号化効率を向上させることができる。さらに、前方向および後方向参照ピクチャとして、表示時間順で利用可能な最近傍の参照ピクチャを用いることにより、符号化効率を向上させることができる。   Thus, in the direct mode, scaling is performed on the backward motion vector used when coding the block at the same position of the B picture which is the backward reference picture, so there is no need to send motion vector information, In addition, even when the block at the same position in the backward reference picture has only the backward motion vector, the prediction efficiency can be improved. Thereby, encoding efficiency can be improved. Furthermore, encoding efficiency can be improved by using the nearest reference picture that can be used in the order of display time as the forward and backward reference pictures.

次に、ダイレクトモードを用いる場合の第四の例を図5(d) を用いて説明する。図5(d) はダイレクトモードにおける動きベクトルを示す説明図であり、ピクチャB6のブロックaをダイレクトモードで符号化する場合を示している。この場合、ピクチャB6の後方にある参照ピクチャであるピクチャB7中の、ブロックaと同じ位置にあるブロックbを符号化する際に用いられた動きベクトルを利用する。ここでブロックbは、第三の例と同様に後方向動きベクトルのみを用いて符号化されているとし、その後方向動きベクトルが動きベクトルfであるとする。動きベクトルfは、動きベクトル記憶部116に記憶されているとする。ブロックaは、動きベクトルfを利用して生成した動きベクトルを用いて、動きベクトルfが参照するピクチャであるピクチャP9と、後方向参照ピクチャであるピクチャB7とから2方向予測を行う。例えば、上記第一の例の場合と同様に動きベクトルfに平行な動きベクトルを生成する方法を用いれば、ブロックaを符号化する際に用いる動きベクトルは、ピクチャP9に対しては動きベクトルg、ピクチャB7に対しては動きベクトルhとなる。   Next, a fourth example in the case of using the direct mode will be described with reference to FIG. FIG. 5 (d) is an explanatory diagram showing motion vectors in the direct mode, and shows a case where the block a of the picture B6 is encoded in the direct mode. In this case, the motion vector used when coding the block b in the same position as the block a in the picture B7 which is the reference picture behind the picture B6 is used. Here, it is assumed that the block b is encoded using only the backward motion vector as in the third example, and the backward motion vector is the motion vector f. It is assumed that the motion vector f is stored in the motion vector storage unit 116. The block a performs bi-directional prediction from the picture P9 that is a picture to which the motion vector f refers and the picture B7 that is the backward reference picture by using the motion vector generated by using the motion vector f. For example, if a method for generating a motion vector parallel to the motion vector f is used as in the case of the first example, the motion vector used for encoding the block a is the motion vector g for the picture P9. For the picture B7, the motion vector is h.

この場合、前方向動きベクトルである動きベクトルgの大きさをMVF、後方向動きベクトルである動きベクトルhの大きさをMVB、動きベクトルfの大きさをMV、現在のピクチャ(ピクチャB6)の後方向参照ピクチャ(ピクチャB7)と、その後方向参照ピクチャのブロックが参照しているピクチャ(ピクチャP9)との時間的距離をTRD、現在のピクチャ(ピクチャB6)と、後方向参照ピクチャ(ピクチャB7)のブロックが参照しているピクチャ(ピクチャP9)との時間的距離をTRFとすると、動きベクトルgの大きさMVF、動きベクトルhの大きさMVBは、それぞれ(式1)、(式2)で求められる。   In this case, the magnitude of the motion vector g which is the forward motion vector is MVF, the magnitude of the motion vector h which is the backward motion vector is MVB, the magnitude of the motion vector f is MV, and the current picture (picture B6) The temporal distance between the backward reference picture (picture B7) and the picture (picture P9) referenced by the block of the backward reference picture is TRD, the current picture (picture B6), and the backward reference picture (picture B7). ) Is a time distance from a picture (picture P9) referred to by a block, TRF, the magnitude MVF of the motion vector g and the magnitude MVB of the motion vector h are (Equation 1) and (Equation 2), respectively. Is required.

このようにダイレクトモードにおいて、後方向参照ピクチャであるBピクチャの同一位置のブロックを符号化する際に用いた後方向動きベクトルに対してスケーリングを行うことにより、動きベクトルの情報を送る必要がなく、かつ後方向参照ピクチャ内の同一位置のブロックが後方向動きベクトルしか有さない場合でも、予測効率を向上させることができる。これにより、符号化効率を向上させることができる。さらに、前方向参照ピクチャとして後方向動きベクトルが参照しているピクチャを、後方向参照ピクチャとして表示時間順で利用可能な最近傍の参照ピクチャを用いることにより、符号化効率を向上させることができる。   Thus, in the direct mode, it is not necessary to send motion vector information by performing scaling on the backward motion vector used when coding the block at the same position of the B picture that is the backward reference picture. In addition, even when the block at the same position in the backward reference picture has only the backward motion vector, the prediction efficiency can be improved. Thereby, encoding efficiency can be improved. Furthermore, the coding efficiency can be improved by using the picture referenced by the backward motion vector as the forward reference picture and the nearest reference picture that can be used in the display time order as the backward reference picture. .

次に、ダイレクトモードを用いる場合の第五の例を図6(a) を用いて説明する。図6(a) はダイレクトモードにおける動きベクトルを示す説明図であり、ピクチャB6のブロックaをダイレクトモードで符号化する場合を示している。この場合、動きベクトルの大きさを0として、前方向参照ピクチャとしてピクチャP5を、後方向参照ピクチャとしてピクチャB7を用いて、2方向参照を行うことにより、動き補償を行う。   Next, a fifth example in the case of using the direct mode will be described with reference to FIG. FIG. 6A is an explanatory diagram showing motion vectors in the direct mode, and shows a case where the block a of the picture B6 is encoded in the direct mode. In this case, motion compensation is performed by setting the magnitude of the motion vector to 0, performing two-way reference using the picture P5 as the forward reference picture and the picture B7 as the backward reference picture.

このようにダイレクトモードにおいて、動きベクトルを強制的に0と置くことにより、ダイレクトモードが選択された場合には、動きベクトルの情報を送る必要がなく、かつ動きベクトルのスケーリング処理が不要となり処理量の削減を図ることができる。   In this way, in the direct mode, by forcing the motion vector to 0, when the direct mode is selected, it is not necessary to send motion vector information, and the motion vector scaling processing is not required and the processing amount Can be reduced.

次に、ダイレクトモードを用いる場合の第六の例を図6(b) を用いて説明する。図6(b) はダイレクトモードにおける動きベクトルを示す説明図であり、ピクチャB6のブロックaをダイレクトモードで符号化する場合を示している。この場合、ピクチャB6の後方にあるPピクチャであるピクチャP9中の、ブロックaと同じ位置にあるブロックfを符号化する際に用いられた、動きベクトルgを利用する。動きベクトルgは、動きベクトル記憶部116に記憶されている。ブロックaは、動きベクトルgを利用して生成した動きベクトルを用いて、前方向参照ピクチャであるピクチャP5と、後方向参照ピクチャであるピクチャB7とから2方向予測を行う。例えば、上記第一の例の場合と同様に動きベクトルgに平行な動きベクトルを生成する方法を用いれば、ブロックaを符号化する際に用いる動きベクトルは、ピクチャP5に対しては動きベクトルh、ピクチャB7に対しては動きベクトルiとなる。   Next, a sixth example in the case of using the direct mode will be described with reference to FIG. FIG. 6B is an explanatory diagram showing motion vectors in the direct mode, and shows a case where the block a of the picture B6 is encoded in the direct mode. In this case, the motion vector g used when the block f at the same position as the block a in the picture P9 which is the P picture behind the picture B6 is used. The motion vector g is stored in the motion vector storage unit 116. Block a performs bi-directional prediction from picture P5, which is a forward reference picture, and picture B7, which is a backward reference picture, using a motion vector generated using motion vector g. For example, if a method of generating a motion vector parallel to the motion vector g is used as in the case of the first example, the motion vector used when coding the block a is the motion vector h for the picture P5. For the picture B7, the motion vector i is obtained.

この場合、前方向動きベクトルである動きベクトルhの大きさをMVF、後方向動きベクトルである動きベクトルiの大きさをMVB、動きベクトルgの大きさをMV、現在のピクチャ(ピクチャB6)に対して表示時間順で後方に位置するPピクチャ(ピクチャP9)と、このPピクチャのブロックfが参照しているピクチャ(ピクチャP5)との時間的距離をTRD、現在のピクチャ(ピクチャB6)と前方向参照ピクチャ(ピクチャP5)との時間的距離をTRF、現在のピクチャ(ピクチャB6)と後方向参照ピクチャ(ピクチャB7)との時間的距離をTRB、とすると、動きベクトルhの大きさMVF、動きベクトルiの大きさMVBは、それぞれ(式1)、(式5)で求められる。   In this case, the magnitude of the motion vector h that is the forward motion vector is MVF, the magnitude of the motion vector i that is the backward motion vector is MVB, the magnitude of the motion vector g is MV, and the current picture (picture B6). On the other hand, the temporal distance between the P picture (picture P9) located backward in the display time order and the picture (picture P5) referred to by the block f of this P picture is TRD, and the current picture (picture B6). When the temporal distance from the forward reference picture (picture P5) is TRF and the temporal distance between the current picture (picture B6) and the backward reference picture (picture B7) is TRB, the magnitude MVF of the motion vector h The magnitude MVB of the motion vector i is obtained by (Expression 1) and (Expression 5), respectively.

MVB=−TRB×MV/TRD −−− 式5   MVB = −TRB × MV / TRD −−− Formula 5

このようにダイレクトモードにおいて、表示時間順で後方に位置するPピクチャの動きベクトルに対してスケーリングを行うことにより、後方向参照ピクチャがBピクチャである場合に、そのBピクチャの動きベクトルを記憶しておく必要が無く、かつ動きベクトルの情報を送る必要がない。さらに、前方向および後方向参照ピクチャとして表示時間順で最近傍の参照ピクチャを用いることにより、符号化効率を向上させることができる。   In this way, in the direct mode, when the backward reference picture is a B picture, the motion vector of the B picture is stored by performing scaling on the motion vector of the P picture located backward in the display time order. There is no need to send motion vector information. Furthermore, encoding efficiency can be improved by using the nearest reference picture in display time order as the forward and backward reference pictures.

次に、ダイレクトモードを用いる場合の第七の例を図6(c) を用いて説明する。図6(c) はダイレクトモードにおける動きベクトルを示す説明図であり、ピクチャB6のブロックaをダイレクトモードで符号化する場合を示している。この例は、上記で説明したピクチャ番号に対する相対インデックスの割り当ての変更(リマッピング)が行われ、後方向参照ピクチャがピクチャP9となった場合である。この場合、ピクチャB7の後方向参照ピクチャであるピクチャP9中の、ブロックaと同じ位置にあるブロックfを符号化する際に用いられた動きベクトルgを利用する。動きベクトルgは、動きベクトル記憶部116に記憶されている。ブロックaは、動きベクトルgを利用して生成した動きベクトルを用いて、前方向参照ピクチャであるピクチャP5と、後方向参照ピクチャであるピクチャP9とから2方向予測を行う。例えば、上記第一の例の場合と同様に動きベクトルgに平行な動きベクトルを生成する方法を用いれば、ブロックaを符号化する際に用いる動きベクトルは、ピクチャP5に対しては動きベクトルh、ピクチャP9に対しては動きベクトルiとなる。   Next, a seventh example when the direct mode is used will be described with reference to FIG. FIG. 6C is an explanatory diagram showing motion vectors in the direct mode, and shows a case where the block a of the picture B6 is encoded in the direct mode. In this example, the relative index assignment change (remapping) with respect to the picture number described above is performed, and the backward reference picture becomes the picture P9. In this case, the motion vector g used when the block f at the same position as the block a in the picture P9 which is the backward reference picture of the picture B7 is used. The motion vector g is stored in the motion vector storage unit 116. Block a performs bi-directional prediction from picture P5, which is a forward reference picture, and picture P9, which is a backward reference picture, using a motion vector generated using motion vector g. For example, if a method of generating a motion vector parallel to the motion vector g is used as in the case of the first example, the motion vector used when coding the block a is the motion vector h for the picture P5. For the picture P9, the motion vector i is obtained.

この場合、前方向動きベクトルである動きベクトルhの大きさをMVF、後方向動きベクトルである動きベクトルiの大きさをMVB、動きベクトルgの大きさをMV、現在のピクチャ(ピクチャB6)の後方向参照ピクチャ(ピクチャP9)と、その後方向参照ピクチャのブロックが参照しているピクチャ(ピクチャP5)との時間的距離をTRD、現在のピクチャ(ピクチャB6)と前方向参照ピクチャ(ピクチャP5)との時間的距離をTRFとすると、動きベクトルhの大きさMVF、動きベクトルiの大きさMVBは、それぞれ(式1)、(式2)で求められる。   In this case, the magnitude of the motion vector h that is the forward motion vector is MVF, the magnitude of the motion vector i that is the backward motion vector is MVB, the magnitude of the motion vector g is MV, and the current picture (picture B6) The temporal distance between the backward reference picture (picture P9) and the picture (picture P5) referenced by the block of the backward reference picture is TRD, the current picture (picture B6) and the forward reference picture (picture P5). If the time distance between and is TRF, the magnitude MVF of the motion vector h and the magnitude MVB of the motion vector i are obtained by (Expression 1) and (Expression 2), respectively.

このようにダイレクトモードにおいて、ピクチャ番号に対する相対インデックスの割り当ての変更が行われた場合であっても、符号化済みのピクチャの動きベクトルに対してスケーリングを行うことができ、かつダイレクトモードが選択された場合には、動きベクトルの情報を送る必要がない。   In this way, even when the relative index assignment is changed for the picture number in the direct mode, the motion vector of the encoded picture can be scaled and the direct mode is selected. In such a case, there is no need to send motion vector information.

なお、ピクチャB6のブロックaをダイレクトモードにより符号化する際には、ピクチャB6の後方参照ピクチャ中の、ブロックaと同じ位置にあるブロックが前方向参照のみ、2方向参照、またはダイレクトモードにより符号化され、この符号化の際に前方向動きベクトルを用いていた場合は、この前方向動きベクトルに対してスケーリングを行い、上記第一の例、第二の例または第七の例のようにブロックaをダイレクトモードにより符号化する。一方、ブロックaと同じ位置にあるブロックが後方向参照のみにより符号化され、この符号化の際に後方向動きベクトルを用いていた場合は、この後方向動きベクトルに対してスケーリングを行い、上記第三の例または第四の例のようにブロックaをダイレクトモードにより符号化する。   When the block a of the picture B6 is encoded by the direct mode, the block at the same position as the block a in the backward reference picture of the picture B6 is encoded by the forward reference only, the two-way reference, or the direct mode. If the forward motion vector is used at the time of encoding, scaling is performed on the forward motion vector, as in the first example, the second example, or the seventh example. Block a is encoded in direct mode. On the other hand, if the block at the same position as the block a is encoded by only the backward reference, and the backward motion vector is used at the time of this encoding, the backward motion vector is scaled, As in the third example or the fourth example, the block a is encoded in the direct mode.

以上のダイレクトモードにおいては、フレーム間の時間間隔が一定である場合だけでなく、可変フレーム間隔である場合についても適用可能である。   The above direct mode is applicable not only when the time interval between frames is constant, but also when it is a variable frame interval.

さて、モード選択部109は、決定した符号化モードを符号列生成部104に対して出力する。また、モード選択部109は、決定した符号化モードに基づいて予測画像データを生成し、この予測画像データを差分演算部102に出力する。但し、モード選択部109は、ピクチャ内符号化を選択した場合には、予測画像データを出力しない。また、モード選択部109は、ピクチャ内符号化を選択した場合には、スイッチ111をa側に、スイッチ112をc側に接続するように制御し、ピクチャ間予測符号化やダイレクトモードを選択した場合には、スイッチ111をb側に、スイッチ112をd側に接続するように制御する。また、モード選択部109は、決定した符号化モードが、ピクチャ間予測符号化である場合には、そのピクチャ間予測符号化で用いられる動きベクトルを符号列生成部104に対して出力する。ここでピクチャB6は他のピクチャの符号化時に参照ピクチャとして用いられないので、ピクチャ間予測符号化で用いられる動きベクトルは動きベクトル記憶部116に記憶する必要はない。以下では、モード選択部109でピクチャ間予測符号化やダイレクトモードが選択された場合について説明する。   Mode selection section 109 outputs the determined encoding mode to code string generation section 104. Further, the mode selection unit 109 generates predicted image data based on the determined encoding mode, and outputs the predicted image data to the difference calculation unit 102. However, the mode selection unit 109 does not output predicted image data when intra-picture encoding is selected. In addition, when selecting intra-picture coding, the mode selection unit 109 controls the switch 111 to be connected to the a side and the switch 112 to the c side, and selects inter-picture predictive coding or direct mode. In this case, control is performed so that the switch 111 is connected to the b side and the switch 112 is connected to the d side. In addition, when the determined coding mode is inter-picture predictive coding, mode selecting section 109 outputs a motion vector used in the inter-picture predictive coding to code sequence generating section 104. Here, since the picture B6 is not used as a reference picture when other pictures are encoded, it is not necessary to store the motion vector used in the inter-picture prediction encoding in the motion vector storage unit 116. Hereinafter, a case where inter-picture predictive coding or direct mode is selected by the mode selection unit 109 will be described.

差分演算部102には、並べ替え用メモリ101から読み出されたピクチャB6のマクロブロックの画像データと、モード選択部109から出力された予測画像データが入力される。差分演算部102は、ピクチャB6のマクロブロックの画像データと予測画像データとの差分を演算し、予測誤差画像データを生成して予測誤差符号化部103へ出力する。予測誤差符号化部103は、入力された予測誤差画像データに対して周波数変換や量子化等の符号化処理を施すことにより、符号化データを生成して符号列生成部104へ出力する。   The difference calculation unit 102 receives the macroblock image data of the picture B6 read from the rearrangement memory 101 and the predicted image data output from the mode selection unit 109. The difference calculation unit 102 calculates the difference between the image data of the macroblock of the picture B6 and the prediction image data, generates prediction error image data, and outputs the prediction error image data to the prediction error encoding unit 103. The prediction error encoding unit 103 generates encoded data by performing encoding processing such as frequency conversion and quantization on the input prediction error image data, and outputs the encoded data to the code string generation unit 104.

符号列生成部104は、入力された符号化データに対して、可変長符号化等を施し、さらに動きベクトルや符号化モード等の情報を付加することにより符号列を生成し、出力する。   The code string generation unit 104 performs variable-length coding or the like on the input encoded data, and further generates and outputs a code string by adding information such as a motion vector and a coding mode.

以上の処理により、ピクチャB6の1マクロブロックに対する符号化処理が完了する。ピクチャB6の残りのマクロブロックに対する処理も同様に行われ、それが完了するとピクチャB8の符号化処理が行われる。   With the above process, the encoding process for one macroblock of picture B6 is completed. The processing for the remaining macroblocks of picture B6 is performed in the same manner, and when it is completed, the encoding processing of picture B8 is performed.

<ピクチャB8の符号化処理>
ピクチャB8はBピクチャであるので、表示時間順で前方または後方にある既に処理済みの2枚のピクチャを参照してピクチャ間予測符号化を行う。このピクチャB8の参照画像は、上記のように前方向参照ピクチャがピクチャB7、後方向参照ピクチャがP9となる。ピクチャB8は、他のピクチャの符号化を行う際に、参照ピクチャとして用いられないので、符号化制御部110は、スイッチ113をオンに、スイッチ114、115をオフにするように各スイッチを制御する。よって、並べ替え用メモリ101から読み出されたピクチャB8のマクロブロックは、動きベクトル検出部108、モード選択部109、および差分演算部102に入力される。
<Encoding process of picture B8>
Since the picture B8 is a B picture, inter-picture predictive encoding is performed with reference to two already processed pictures that are forward or backward in display time order. In the reference image of this picture B8, the forward reference picture is picture B7 and the backward reference picture is P9 as described above. Since the picture B8 is not used as a reference picture when other pictures are encoded, the encoding control unit 110 controls each switch so that the switch 113 is turned on and the switches 114 and 115 are turned off. To do. Therefore, the macroblock of the picture B8 read from the rearrangement memory 101 is input to the motion vector detection unit 108, the mode selection unit 109, and the difference calculation unit 102.

動きベクトル検出部108は、参照ピクチャ用メモリ107に蓄積されたピクチャB7の復号化画像データを前方向参照ピクチャとして、ピクチャP9の復号化画像データを後方向参照ピクチャとして用い、ピクチャB8のマクロブロックに対して、前方向動きベクトルと後方向動きベクトルの検出を行う。そして、動きベクトル検出部108は、検出された動きベクトルをモード選択部109に対して出力する。   The motion vector detection unit 108 uses the decoded image data of the picture B7 stored in the reference picture memory 107 as the forward reference picture, the decoded image data of the picture P9 as the backward reference picture, and uses the macroblock of the picture B8. In contrast, the forward motion vector and the backward motion vector are detected. Then, the motion vector detection unit 108 outputs the detected motion vector to the mode selection unit 109.

モード選択部109は、動きベクトル検出部108で検出された動きベクトルを用いて、ピクチャB8のマクロブロックの符号化モードを決定する。   The mode selection unit 109 uses the motion vector detected by the motion vector detection unit 108 to determine the encoding mode of the macroblock of the picture B8.

ここで、ピクチャB8のマクロブロックに対して、ダイレクトモードを用いる場合の動作について、図6(d) を用いて説明する。図6(d) はダイレクトモードにおける動きベクトルを示す説明図であり、ピクチャB8のブロックaをダイレクトモードで符号化する場合を示している。この場合、ピクチャB8の後方にある参照ピクチャであるピクチャP9中の、ブロックaと同じ位置にあるブロックbを符号化した際に用いた動きベクトルを利用する。ここではブロックbは、前方向参照により符号化されたとし、その前方向動きベクトルを動きベクトルcとする。またこの動きベクトルcは、動きベクトル記憶部116に記憶されている。ブロックaは、動きベクトルcを利用して生成した動きベクトルを用いて、前方向参照ピクチャであるピクチャB7と、後方向参照ピクチャであるピクチャP9とから2方向予測を行う。例えば、上記ピクチャB7の場合と同様に動きベクトルcに平行な動きベクトルを生成する方法を用いれば、ブロックaを符号化する際に用いる動きベクトルは、ピクチャB7に対しては動きベクトルd、ピクチャP9に対しては動きベクトルeとなる。   Here, the operation when the direct mode is used for the macroblock of the picture B8 will be described with reference to FIG. FIG. 6 (d) is an explanatory diagram showing motion vectors in the direct mode, and shows a case where the block a of the picture B8 is encoded in the direct mode. In this case, the motion vector used when coding the block b in the same position as the block a in the picture P9 which is the reference picture behind the picture B8 is used. Here, it is assumed that the block b is encoded by the forward reference, and the forward motion vector is a motion vector c. The motion vector c is stored in the motion vector storage unit 116. Block a performs bi-directional prediction from picture B7, which is a forward reference picture, and picture P9, which is a backward reference picture, using a motion vector generated using motion vector c. For example, if a method of generating a motion vector parallel to the motion vector c is used as in the case of the picture B7, the motion vector used when coding the block a is the motion vector d, the picture for the picture B7 For P9, this is the motion vector e.

この場合、前方向動きベクトルである動きベクトルdの大きさをMVF、後方向動きベクトルである動きベクトルeの大きさをMVB、動きベクトルcの大きさをMV、現在のピクチャ(ピクチャB8)の後方向参照ピクチャ(ピクチャP9)と、その後方向参照ピクチャのブロックbが参照しているピクチャ(ピクチャP5)との時間的距離をTRD、現在のピクチャ(ピクチャB8)と前方向参照ピクチャ(ピクチャB7)との時間的距離をTRF、現在のピクチャ(ピクチャB8)と後方向参照ピクチャ(ピクチャP9)との時間的距離をTRBとすると、動きベクトルdの大きさMVF、動きベクトルeの大きさMVBは、それぞれ(式1)、(式5)で求められる。   In this case, the magnitude of the motion vector d that is the forward motion vector is MVF, the magnitude of the motion vector e that is the backward motion vector is MVB, the magnitude of the motion vector c is MV, and the current picture (picture B8) The temporal distance between the backward reference picture (picture P9) and the picture (picture P5) referenced by the block b of the backward reference picture is TRD, the current picture (picture B8) and the forward reference picture (picture B7). ) And TB, and the temporal distance between the current picture (picture B8) and the backward reference picture (picture P9) is TRB, the magnitude MVF of the motion vector d and the magnitude MVB of the motion vector e Are obtained by (Equation 1) and (Equation 5), respectively.

このようにダイレクトモードにおいて、後方向参照ピクチャの前方向動きベクトルに対してスケーリングを行うことにより、動きベクトルの情報を送る必要がなく、かつ予測効率を向上させることができる。これにより符号化効率を向上させることができる。さらに、前方向参照ピクチャおよび後方向参照ピクチャとして、利用可能な限り表示時間順で最近傍の参照ピクチャを用いることにより、符号化効率を向上させることができる。   In this way, by performing scaling on the forward motion vector of the backward reference picture in the direct mode, it is not necessary to send motion vector information and the prediction efficiency can be improved. Thereby, encoding efficiency can be improved. Furthermore, the encoding efficiency can be improved by using the nearest reference pictures in the order of display time as much as possible as the forward reference picture and the backward reference picture.

上記のダイレクトモードにおいては、フレーム間の時間間隔が一定である場合だけでなく、可変フレーム間隔である場合についても適用可能である。   The direct mode is applicable not only when the time interval between frames is constant, but also when the time interval is variable.

さて、モード選択部109は、決定した符号化モードを符号列生成部104に対して出力する。また、モード選択部109は、決定した符号化モードに基づいて予測画像データを生成し、この予測画像データを差分演算部102に出力する。但し、モード選択部109は、ピクチャ内符号化を選択した場合には、予測画像データを出力しない。また、モード選択部109は、ピクチャ内符号化を選択した場合には、スイッチ111はa側に、スイッチ112はc側に接続するように制御し、ピクチャ間予測符号化やダイレクトモードを選択した場合には、スイッチ111はb側に、スイッチ112はd側に接続するように制御する。また、モード選択部109は、決定した符号化モードが、ピクチャ間予測符号化である場合には、そのピクチャ間予測符号化で用いられる動きベクトルを符号列生成部104に対して出力する。ここでピクチャB8は他のピクチャの符号化時に参照ピクチャとして用いられないので、ピクチャ間予測符号化で用いられる動きベクトルは動きベクトル記憶部116に記憶する必要はない。以下では、モード選択部109でピクチャ間予測符号化やダイレクトモードが選択された場合について説明する。   Mode selection section 109 outputs the determined encoding mode to code string generation section 104. Further, the mode selection unit 109 generates predicted image data based on the determined encoding mode, and outputs the predicted image data to the difference calculation unit 102. However, the mode selection unit 109 does not output predicted image data when intra-picture encoding is selected. Further, when selecting the intra-picture encoding, the mode selection unit 109 controls the switch 111 to be connected to the a side and the switch 112 to be connected to the c side, and selects the inter-picture predictive encoding or the direct mode. In this case, control is performed so that the switch 111 is connected to the b side and the switch 112 is connected to the d side. In addition, when the determined coding mode is inter-picture predictive coding, mode selecting section 109 outputs a motion vector used in the inter-picture predictive coding to code sequence generating section 104. Here, since the picture B8 is not used as a reference picture when other pictures are encoded, it is not necessary to store the motion vector used in the inter-picture prediction encoding in the motion vector storage unit 116. Hereinafter, a case where inter-picture predictive coding or direct mode is selected by the mode selection unit 109 will be described.

差分演算部102には、並べ替え用メモリ101から読み出されたピクチャB8のマクロブロックの画像データと、モード選択部109から出力された予測画像データが入力される。差分演算部102は、ピクチャB8のマクロブロックの画像データと予測画像データとの差分を演算し、予測誤差画像データを生成して予測誤差符号化部103へ出力する。予測誤差符号化部103は、入力された予測誤差画像データに対して周波数変換や量子化等の符号化処理を施すことにより、符号化データを生成して符号列生成部104へ出力する。   The difference calculation unit 102 receives the macroblock image data of the picture B8 read from the rearrangement memory 101 and the predicted image data output from the mode selection unit 109. The difference calculation unit 102 calculates the difference between the image data of the macroblock of the picture B8 and the prediction image data, generates prediction error image data, and outputs the prediction error image data to the prediction error encoding unit 103. The prediction error encoding unit 103 generates encoded data by performing encoding processing such as frequency conversion and quantization on the input prediction error image data, and outputs the encoded data to the code string generation unit 104.

符号列生成部104は、入力された符号化データに対して、可変長符号化等を施し、さらに動きベクトルや符号化モード等の情報を付加することにより符号列を生成し、出力する。   The code string generation unit 104 performs variable-length coding or the like on the input encoded data, and further generates and outputs a code string by adding information such as a motion vector and a coding mode.

以上の処理により、ピクチャB8の1マクロブロックに対する符号化処理が完了する。ピクチャB8の残りのマクロブロックに対する処理も同様に行われる。   With the above process, the encoding process for one macroblock of picture B8 is completed. Processing for the remaining macroblocks of picture B8 is performed in the same manner.

以下、各ピクチャの符号化処理は、各ピクチャのピクチャタイプおよびピクチャの表示時間順の位置に応じた符号化方法で、ピクチャP9、B7、B6、B8と同様な方法により行われる。   Hereinafter, the encoding process of each picture is performed in the same manner as the pictures P9, B7, B6, and B8 by an encoding method according to the picture type of each picture and the position of the picture in the display time order.

以上の実施の形態においては、図4(a) に示すピクチャ予測構造を用いた場合を例に、本発明に係る動画像符号化方法の動作を説明した。図10は、この場合のピクチャ予測構造を階層的に示す説明図である。図10において、矢印は予測関係を示しており、矢印の終点にあるピクチャが、始点にあるピクチャを参照することを示している。図4(a) に示すピクチャ予測構造においては、表示時間順で考えた場合に、図10に示すように既に符号化済みのピクチャから最も遠くなるピクチャを優先して符号化順序を決定している。例えば、IまたはPピクチャから最も遠くなるピクチャは、連続するBピクチャの中央に位置するピクチャである。したがって、例えばピクチャP5、P9が符号化済みである状態では、ピクチャB7が次の符号化対象ピクチャとなる。そして、ピクチャP5、B7、P9が符号化済みである状態では、ピクチャB6、B8が次の符号化対象ピクチャとなる。   In the above embodiment, the operation of the moving picture coding method according to the present invention has been described by taking the case of using the picture prediction structure shown in FIG. 4A as an example. FIG. 10 is an explanatory diagram showing hierarchical picture prediction structures in this case. In FIG. 10, an arrow indicates a prediction relationship, and a picture at the end point of the arrow refers to a picture at the start point. In the picture prediction structure shown in FIG. 4 (a), when considered in display time order, the coding order is determined with priority given to the picture farthest from the already coded picture as shown in FIG. Yes. For example, the picture farthest from the I or P picture is a picture located at the center of consecutive B pictures. Therefore, for example, in a state where the pictures P5 and P9 have been encoded, the picture B7 becomes the next encoding target picture. Then, in a state where the pictures P5, B7, and P9 are already encoded, the pictures B6 and B8 are the next encoding target pictures.

また、図4、図10に示すものとは異なるピクチャ予測構造を有する場合でも、本発明に係る動画像符号化方法と同様の方法を用いることができ、本発明の効果をもたらすことができる。他のピクチャ予測構造の例を図7〜図9に示す。   In addition, even when the picture prediction structure is different from those shown in FIGS. 4 and 10, the same method as the moving picture coding method according to the present invention can be used, and the effects of the present invention can be brought about. Examples of other picture prediction structures are shown in FIGS.

図7は、IまたはPピクチャ間に挟まれるBピクチャの数が3枚であり、Bピクチャを符号化する順序として、既に符号化済みのピクチャから最も近いピクチャから選択して符号化する場合について示している。図7(a) は表示時間順で示した各ピクチャの予測関係を示す図であり、図7(b) が符号化順(符号列順)に並べ替えたピクチャ順を示す図である。また、図11は、図7(a) に対応するピクチャ予測構造の階層図である。図7(a) に示すピクチャ予測構造においては、表示時間順で考えた場合に、図11に示すように既に符号化済みのピクチャから最も近いピクチャから順に符号化を行っている。例えばピクチャP5、P9が符号化済みである状態では、ピクチャB6、B8が次の符号化対象ピクチャとなる。そして、ピクチャP5、B6、B8、P9が符号化済みである状態では、ピクチャB7が次の符号化対象ピクチャとなる。   FIG. 7 shows a case where the number of B pictures sandwiched between I or P pictures is 3, and the B pictures are encoded by selecting from the pictures closest to the already encoded pictures as the order of encoding. Show. FIG. 7 (a) is a diagram showing the prediction relationship of each picture shown in display time order, and FIG. 7 (b) is a diagram showing the picture order rearranged in the coding order (code string order). FIG. 11 is a hierarchical diagram of a picture prediction structure corresponding to FIG. In the picture prediction structure shown in FIG. 7 (a), when considered in order of display time, encoding is performed in order from the closest picture to the already encoded picture as shown in FIG. For example, in a state where the pictures P5 and P9 have been encoded, the pictures B6 and B8 are the next encoding target pictures. In a state where the pictures P5, B6, B8, and P9 have been encoded, the picture B7 becomes the next encoding target picture.

図8は、IまたはPピクチャ間に挟まれるBピクチャの数が5枚であり、Bピクチャを既に符号化済みのピクチャから最も遠いピクチャを優先して符号化する場合について示している。図8(a) は表示時間順で示した各ピクチャの予測関係を示す図であり、図8(b) は符号化順(符号列順)に並べ替えたピクチャ順を示す図である。また、図12は、図8(a) に対応するピクチャ予測構造の階層図である。図8(a) に示すピクチャ予測構造においては、表示時間順で考えた場合に、図12に示すように既に符号化済みのピクチャから最も遠くなるピクチャを優先して符号化順序を決定している。例えば、IまたはPピクチャから最も遠くなるピクチャは、連続するBピクチャの中央に位置するピクチャである。したがって、例えばピクチャP7、P13が符号化済みである状態では、ピクチャB10が次の符号化対象ピクチャとなる。そして、ピクチャP7、B10、P13が符号化済みである状態では、ピクチャB8、B9、B11、B12が次の符号化対象ピクチャとなる。   FIG. 8 shows a case where the number of B pictures sandwiched between I or P pictures is 5, and the B picture is encoded with priority given to the picture farthest from the already encoded picture. FIG. 8A is a diagram showing the prediction relationship of each picture shown in the display time order, and FIG. 8B is a diagram showing the picture order rearranged in the coding order (code string order). FIG. 12 is a hierarchical diagram of a picture prediction structure corresponding to FIG. In the picture prediction structure shown in FIG. 8 (a), when considered in display time order, the coding order is determined by giving priority to a picture farthest from an already coded picture as shown in FIG. Yes. For example, the picture farthest from the I or P picture is a picture located at the center of consecutive B pictures. Therefore, for example, in a state where the pictures P7 and P13 have been encoded, the picture B10 becomes the next encoding target picture. In a state where the pictures P7, B10, and P13 have been encoded, the pictures B8, B9, B11, and B12 become the next encoding target pictures.

図9は、IまたはPピクチャ間に挟まれるBピクチャの数が5枚であり、Bピクチャを既に符号化済みのピクチャから最も近いピクチャを優先して符号化する場合について示している。図9(a) は表示時間順で示した各ピクチャの予測関係を示す図であり、図9(b) は符号化順(符号列順)に並べ替えたピクチャ順を示す図である。また、図13は、図9(a) に対応するピクチャ予測構造の階層図である。図9(a) に示すピクチャ予測構造においては、表示時間順で考えた場合に、図13に示すように既に符号化済みのピクチャから最も近いピクチャから順に符号化を行っている。例えばピクチャP5、P9が符号化済みである状態では、ピクチャB8、B12が次の符号化対象ピクチャとなる。そして、ピクチャP5、B8、B12、P9が符号化済みである状態では、ピクチャB9、B11が次の符号化対象ピクチャとなる。さらに、ピクチャP5、B8、B9、B11、B12、P9が符号化済みである状態では、ピクチャB10が次の符号化対象ピクチャとなる。   FIG. 9 shows a case where the number of B pictures sandwiched between I or P pictures is 5, and the B picture is encoded with priority given to the picture closest to the already encoded picture. FIG. 9A is a diagram showing the prediction relationship of each picture shown in display time order, and FIG. 9B is a diagram showing the picture order rearranged in the coding order (code string order). FIG. 13 is a hierarchical diagram of a picture prediction structure corresponding to FIG. 9 (a). In the picture prediction structure shown in FIG. 9 (a), when considered in order of display time, encoding is performed in order from the closest picture to the already encoded picture as shown in FIG. For example, in a state where the pictures P5 and P9 have been encoded, the pictures B8 and B12 are the next encoding target pictures. In a state where the pictures P5, B8, B12, and P9 have been encoded, the pictures B9 and B11 become the next encoding target pictures. Further, in a state where the pictures P5, B8, B9, B11, B12, and P9 have been encoded, the picture B10 is the next encoding target picture.

以上のように、本発明に係る動画像符号化方法では、2方向予測を用いてピクチャ間予測符号化処理を行うBピクチャを符号化する際に、IまたはPピクチャ間に挟まれる複数のBピクチャを表示時間順とは異なる順序で符号化する。その際には、可能な限り表示時間順で近傍に位置するピクチャを前方向および後方向の参照ピクチャとして用いる。この参照ピクチャとしては、Bピクチャが利用できる場合には、Bピクチャも用いる。また、IまたはPピクチャ間に挟まれる複数のBピクチャを表示時間順とは異なる順序で符号化する際には、既に符号化済みのピクチャから最も遠くなるピクチャから順に符号化する。または、IまたはPピクチャ間に挟まれる複数のBピクチャを表示時間順とは異なる順序で符号化する際には、既に符号化済みのピクチャから最も近いピクチャから順に符号化する。   As described above, in the moving picture encoding method according to the present invention, when encoding a B picture for which inter picture predictive encoding processing is performed using bi-directional prediction, a plurality of B sandwiched between I or P pictures is encoded. The pictures are encoded in an order different from the display time order. In that case, pictures located in the vicinity in the order of display time as much as possible are used as forward and backward reference pictures. As the reference picture, when the B picture is available, the B picture is also used. Further, when encoding a plurality of B pictures sandwiched between I or P pictures in an order different from the display time order, the pictures are encoded in order from the picture farthest from the already encoded pictures. Alternatively, when encoding a plurality of B pictures sandwiched between I or P pictures in an order different from the display time order, the pictures are encoded in order from the picture that is closest to the already encoded picture.

このような動作により、本発明に係る動画像符号化方法を用いることによって、Bピクチャを符号化する際に、より表示時間順で近傍のピクチャを参照ピクチャとして用いることができ、これにより動き補償の際の予測効率が向上するため、符号化効率を向上させることができる。   With such an operation, by using the moving picture coding method according to the present invention, when a B picture is coded, a neighboring picture can be used as a reference picture in the order of display time. Since the prediction efficiency at this time is improved, the coding efficiency can be improved.

また、本発明に係る動画像符号化方法において、後方向参照ピクチャとしてBピクチャとして符号化されたピクチャを参照し、Bピクチャ内のブロックをダイレクトモードにより符号化する際に、後方向参照ピクチャの同一位置のブロックが前方向参照または2方向参照により符号化されている場合には、その前方向動きベクトルをスケーリングすることにより得られる動きベクトルをダイレクトモードでの動きベクトルとして用いる。   Further, in the moving picture coding method according to the present invention, when a picture coded as a B picture is referred to as a backward reference picture and a block in the B picture is coded in the direct mode, the backward reference picture When blocks at the same position are encoded by forward reference or two-way reference, a motion vector obtained by scaling the forward motion vector is used as a motion vector in the direct mode.

このようにダイレクトモードにおいて、後方向参照ピクチャであるBピクチャの前方向動きベクトルに対してスケーリングを行うことにより、動きベクトルの情報を送る必要がなく、かつ予測効率を向上させることができる。さらに、前方向参照ピクチャとして時間的に最近傍の参照ピクチャを用いることにより、符号化効率を向上させることができる。   In this way, by performing scaling on the forward motion vector of the B picture that is the backward reference picture in the direct mode, it is not necessary to send motion vector information and the prediction efficiency can be improved. Furthermore, the encoding efficiency can be improved by using the temporally nearest reference picture as the forward reference picture.

または、後方向参照ピクチャであるBピクチャの同一位置のブロックが、ダイレクトモードにより符号化されている場合には、ダイレクトモードにおいて実質的に用いられた前方向動きベクトルをスケーリングすることにより得られる動きベクトルをダイレクトモードでの動きベクトルとして用いる。   Alternatively, when the block at the same position of the B picture which is the backward reference picture is encoded by the direct mode, the motion obtained by scaling the forward motion vector substantially used in the direct mode. The vector is used as a motion vector in the direct mode.

このようにダイレクトモードにおいて、後方向参照ピクチャであるBピクチャのダイレクトモードで実質的に用いた前方向動きベクトルに対してスケーリングを行うことにより、動きベクトルの情報を送る必要がなく、かつ後方向参照ピクチャ内の同一位置のブロックがダイレクトモードで符号化されている場合でも、予測効率を向上させることができる。さらに、前方向参照ピクチャとして時間的に最近傍の参照ピクチャを用いることにより、符号化効率を向上させることができる。   In this way, in the direct mode, by scaling the forward motion vector substantially used in the direct mode of the B picture that is the backward reference picture, it is not necessary to send motion vector information and the backward direction. Even when the block at the same position in the reference picture is encoded in the direct mode, the prediction efficiency can be improved. Furthermore, the encoding efficiency can be improved by using the temporally nearest reference picture as the forward reference picture.

または、後方向参照ピクチャであるBピクチャの同一位置のブロックが、後方向参照により符号化されている場合には、その後方向動きベクトルをスケーリングすることにより得られる動きベクトルをダイレクトモードでの動きベクトルとして用いる。   Alternatively, when the block at the same position of the B picture that is the backward reference picture is encoded by backward reference, the motion vector obtained by scaling the backward motion vector is used as the motion vector in the direct mode. Used as

このようにダイレクトモードにおいて、後方向参照ピクチャであるBピクチャの同一位置のブロックを符号化する際に用いた後方向動きベクトルに対してスケーリングを行うことにより、動きベクトルの情報を送る必要がなく、かつ後方向参照ピクチャ内の同一位置のブロックが後方向動きベクトルしか有しない場合でも、予測効率を向上させることができる。さらに、前方向参照ピクチャとして時間的に最近傍の参照ピクチャを用いることにより、符号化効率を向上させることができる。   Thus, in the direct mode, it is not necessary to send motion vector information by performing scaling on the backward motion vector used when coding the block at the same position of the B picture that is the backward reference picture. In addition, even when a block at the same position in the backward reference picture has only a backward motion vector, prediction efficiency can be improved. Furthermore, the encoding efficiency can be improved by using the temporally nearest reference picture as the forward reference picture.

または、後方向参照ピクチャであるBピクチャの同一位置のブロックが、後方向参照により符号化されている場合には、その際に用いた後方向動きベクトルをこの後方向動きベクトルが参照するピクチャと後方向参照ピクチャとを参照ピクチャとしてスケーリングすることにより得られる動きベクトルをダイレクトモードでの動きベクトルとして用いる。   Alternatively, when the block at the same position of the B picture that is the backward reference picture is encoded by backward reference, the backward motion vector used at that time is referred to as a picture to which the backward motion vector refers. A motion vector obtained by scaling a backward reference picture as a reference picture is used as a motion vector in the direct mode.

このようにダイレクトモードにおいて、後方向参照ピクチャであるBピクチャの同一位置のブロックを符号化する際に用いた後方向動きベクトルに対してスケーリングを行うことにより、動きベクトルの情報を送る必要がなく、かつ後方向参照ピクチャ内の同一位置のブロックが後方向動きベクトルしか有さない場合でも、予測効率を向上させることができる。これにより、符号化効率を向上させることができる。さらに、前方向参照ピクチャとして後方向動きベクトルが参照しているピクチャを、後方向参照ピクチャとして表示時間順で利用可能な最近傍の参照ピクチャを用いることにより、符号化効率を向上させることができる。   Thus, in the direct mode, it is not necessary to send motion vector information by performing scaling on the backward motion vector used when coding the block at the same position of the B picture that is the backward reference picture. In addition, even when the block at the same position in the backward reference picture has only the backward motion vector, the prediction efficiency can be improved. Thereby, encoding efficiency can be improved. Furthermore, the coding efficiency can be improved by using the picture referenced by the backward motion vector as the forward reference picture and the nearest reference picture that can be used in the display time order as the backward reference picture. .

またはダイレクトモードにおいて、強制的に大きさ0とした動きベクトルを用いる。
このようにダイレクトモードにおける動きベクトルを強制的に0と置くことにより、ダイレクトモードが選択された場合には、動きベクトルの情報を送る必要がなく、かつ動きベクトルのスケーリング処理が不要となり処理量の削減を図ることができる。
Alternatively, in the direct mode, a motion vector having a size of 0 is forcibly used.
In this way, by forcing the motion vector in the direct mode to be 0, when the direct mode is selected, it is not necessary to send motion vector information, and the motion vector scaling processing is not required and the amount of processing is reduced. Reduction can be achieved.

また、本発明の動画像符号化方法において、後方向参照ピクチャとしてBピクチャとして符号化されたピクチャを参照し、Bピクチャ内のブロックをダイレクトモードを用いて符号化する際に、後方に位置するPピクチャ内の同一位置のブロックが符号化された際に用いた前方向動きベクトルをスケーリングすることにより得られる動きベクトルをダイレクトモードでの動きベクトルとして用いる。   In the moving picture coding method of the present invention, a picture coded as a B picture is referred to as a backward reference picture, and the block in the B picture is positioned backward when coding using the direct mode. The motion vector obtained by scaling the forward motion vector used when the block at the same position in the P picture is encoded is used as the motion vector in the direct mode.

このようにダイレクトモードにおいて、後方Pピクチャの動きベクトルに対してスケーリングを行うことにより、後方向参照ピクチャがBピクチャである場合に、そのBピクチャの動きベクトルを記憶しておく必要が無く、かつ動きベクトルの情報を送る必要がなく、かつ予測効率を向上させることができる。さらに、前方向参照ピクチャとして時間的に最近傍の参照ピクチャを用いることにより、符号化効率を向上させることができる。   In this way, in the direct mode, by scaling the motion vector of the backward P picture, when the backward reference picture is a B picture, there is no need to store the motion vector of the B picture, and It is not necessary to send motion vector information, and the prediction efficiency can be improved. Furthermore, the encoding efficiency can be improved by using the temporally nearest reference picture as the forward reference picture.

また、ピクチャ番号に対する相対インデックスの割り当ての変更が行われ、後方向参照ピクチャの同一位置のブロックが前方向参照により符号化されている場合には、その前方向動きベクトルをスケーリングすることにより得られる動きベクトルをダイレクトモードでの動きベクトルとして用いる。   In addition, when the relative index assignment to the picture number is changed and the block at the same position of the backward reference picture is encoded by forward reference, it is obtained by scaling the forward motion vector. The motion vector is used as a motion vector in the direct mode.

このようにダイレクトモードにおいて、ピクチャ番号に対する相対インデックスの割り当ての変更が行われた場合であっても、符号化済みのピクチャの動きベクトルに対してスケーリングを行うことができ、かつ動きベクトルの情報を送る必要がない。   As described above, in the direct mode, even when the allocation of the relative index to the picture number is changed, the motion vector of the encoded picture can be scaled, and the motion vector information can be changed. There is no need to send.

なお、本実施の形態においては、動き補償は水平16×垂直16画素の単位で、予測誤差画像の符号化は水平8×垂直8画素や水平4×垂直4画素の単位で処理する場合について説明したが、これらの単位は別の画素数でも良い。   In this embodiment, motion compensation is performed in units of 16 horizontal pixels × vertical 16 pixels, and encoding of a prediction error image is performed in units of horizontal 8 × vertical 8 pixels or horizontal 4 × vertical 4 pixels. However, these units may be different numbers of pixels.

また、本実施の形態では、連続するBピクチャの枚数が3枚または5枚である場合を例として説明したが、このBピクチャの枚数は他の枚数であっても良い。   In this embodiment, the case where the number of consecutive B pictures is 3 or 5 has been described as an example. However, the number of B pictures may be another number.

また、本実施の形態では、Pピクチャの符号化モードは、ピクチャ内符号化、動きベクトルを用いたピクチャ間予測符号化、動きベクトルを用いないピクチャ間予測符号化から選択し、Bピクチャの符号化モードは、ピクチャ内符号化、前方向動きベクトルを用いたピクチャ間予測符号化、後方向動きベクトルを用いたピクチャ間予測符号化、2方向動きベクトルを用いたピクチャ間予測符号化、ダイレクトモードから選択する場合を例として説明したが、これらの符号化モードは他の方法であっても良い。   Also, in the present embodiment, the encoding mode of the P picture is selected from intra-picture encoding, inter-picture predictive encoding using a motion vector, and inter-picture predictive encoding not using a motion vector. Encoding modes include intra-picture encoding, inter-picture prediction encoding using forward motion vectors, inter-picture prediction encoding using backward motion vectors, inter-picture prediction encoding using two-way motion vectors, direct mode The case of selecting from the above has been described as an example, but these encoding modes may be other methods.

また、本実施の形態では、ダイレクトモードにおいては、7つの例について説明したが、これは例えばマクロブロックやブロック毎に一意的に決定される一つの方法を用いても良いし、ブロックやマクロブロック毎に複数の方法から一つの方法を選択しても良い。複数の方法を用いる場合には、どのダイレクトモードを用いたかを示す情報を符号列中に記述する。   In this embodiment, seven examples have been described in the direct mode. However, for example, one method uniquely determined for each macroblock or block may be used, or a block or macroblock may be used. One method may be selected from a plurality of methods every time. When a plurality of methods are used, information indicating which direct mode is used is described in the code string.

また、本実施の形態では、Pピクチャは表示時間順で前方または後方に位置する符号化済みのIまたはPピクチャを1つ参照して符号化し、Bピクチャは表示時間順で前方または後方に位置する近傍の符号化済みのピクチャを2つ参照して符号化する場合について説明したが、これらはPピクチャの場合には、表示時間順で前方または後方に位置する、複数の符号化済みのIまたはPピクチャを参照ピクチャの候補とし、各ブロックで最大1つのピクチャを参照して符号化し、Bピクチャの場合には、表示時間順で前方または後方に位置する近傍の複数の符号化済みのピクチャを参照ピクチャの候補とし、各ブロックで最大2つのピクチャを参照して符号化しても良い。   In the present embodiment, the P picture is encoded by referring to one encoded I or P picture positioned forward or backward in the display time order, and the B picture is positioned forward or backward in the display time order. In the case of encoding with reference to two encoded pictures in the vicinity of the P picture, these are encoded pictures that are positioned forward or backward in display time order. Alternatively, a P picture is used as a reference picture candidate and is encoded with reference to at most one picture in each block. In the case of a B picture, a plurality of neighboring pictures that are located forward or backward in display time order May be used as reference picture candidates, and encoding may be performed with reference to a maximum of two pictures in each block.

また、モード選択部109は、動きベクトル記憶部116に動きベクトルを記憶する際に、対象ブロックが2方向予測またはダイレクトモードにより符号化されている場合には、前方向および後方向の両方の動きベクトルを記憶しても良いし、前方向動きベクトルのみを記憶するようにしても良い。前方向動きベクトルのみを記憶すると、動きベクトル記憶部116のメモリ量を削減することができる。   In addition, when the mode selection unit 109 stores the motion vector in the motion vector storage unit 116, if the target block is encoded by the bi-directional prediction or the direct mode, both the forward and backward motions are stored. Vectors may be stored, or only forward motion vectors may be stored. If only the forward motion vector is stored, the memory amount of the motion vector storage unit 116 can be reduced.

(実施の形態2)
図14は、本発明に係る動画像復号化方法を用いた動画像復号化装置の一実施の形態の構成を示すブロック図である。
(Embodiment 2)
FIG. 14 is a block diagram showing a configuration of an embodiment of a moving picture decoding apparatus using the moving picture decoding method according to the present invention.

動画像復号化装置は、図14に示すように符号列解析部1401、予測誤差復号化部1402、モード復号部1403、フレームメモリ制御部1404、動き補償復号部1405、動きベクトル記憶部1406、フレームメモリ1407、加算演算部1408、およびスイッチ1409、1410を備えている。   As shown in FIG. 14, the moving picture decoding apparatus includes a code string analysis unit 1401, a prediction error decoding unit 1402, a mode decoding unit 1403, a frame memory control unit 1404, a motion compensation decoding unit 1405, a motion vector storage unit 1406, a frame A memory 1407, an addition operation unit 1408, and switches 1409 and 1410 are provided.

符号列解析部1401は、入力された符号列より符号化モードの情報および動きベクトルの情報等の各種データの抽出を行う。予測誤差復号化部1402は、符号列解析部1401より入力された予測誤差符号化データの復号化を行い、予測誤差画像データを生成する。モード復号部1403は、符号列より抽出された符号化モードの情報を参照し、スイッチ1409、1410の制御を行う。   The code string analysis unit 1401 extracts various data such as coding mode information and motion vector information from the input code string. The prediction error decoding unit 1402 decodes the prediction error encoded data input from the code string analysis unit 1401 to generate prediction error image data. The mode decoding unit 1403 controls the switches 1409 and 1410 with reference to the encoding mode information extracted from the code string.

フレームメモリ制御部1404は、符号列解析部1401より入力されたピクチャの表示順序を示す情報に基づいて、フレームメモリ1407に格納された復号化画像データを出力画像として出力する。   The frame memory control unit 1404 outputs the decoded image data stored in the frame memory 1407 as an output image based on information indicating the display order of pictures input from the code string analysis unit 1401.

動き補償復号部1405は、参照ピクチャ番号と動きベクトルの情報の復号化処理を行い、復号化した参照ピクチャ番号と動きベクトルとに基づいて、フレームメモリ1407より動き補償画像データを取得する。動きベクトル記憶部1406は、動きベクトルを記憶する。   The motion compensation decoding unit 1405 performs decoding processing on the reference picture number and motion vector information, and acquires motion compensated image data from the frame memory 1407 based on the decoded reference picture number and motion vector. The motion vector storage unit 1406 stores a motion vector.

加算演算部1408は、予測誤差復号化部1402より入力された予測誤差符号化データと、動き補償復号部1405より入力された動き補償画像データとを加算し、復号化画像データを生成する。フレームメモリ1407は、生成された復号化画像データを格納する。   The addition operation unit 1408 adds the prediction error encoded data input from the prediction error decoding unit 1402 and the motion compensated image data input from the motion compensation decoding unit 1405 to generate decoded image data. The frame memory 1407 stores the generated decoded image data.

次に、上記のように構成された動画像復号化装置の動作について説明する。ここで、動画像復号化装置には、上記動画像符号化装置で生成された符号列が入力されるとする。すなわちここでは、Pピクチャは表示時間順で前方または後方にある、近傍の既に処理済みのIまたはPピクチャを1つ参照するものとする。また、Bピクチャは表示時間順で前方または後方にある、既に符号化済みの近傍のピクチャを2つ参照するものとする。   Next, the operation of the moving picture decoding apparatus configured as described above will be described. Here, it is assumed that the code sequence generated by the video encoding device is input to the video decoding device. That is, here, it is assumed that the P picture refers to one nearby processed I or P picture that is forward or backward in display time order. In addition, it is assumed that the B picture refers to two already-encoded neighboring pictures that are forward or backward in display time order.

この場合における符号列中のピクチャは、図4(b) に示すような順序となる。以下では、ピクチャP9、B7、B6、B8の復号化処理について順に説明する。   The pictures in the code string in this case are in the order shown in FIG. Below, the decoding process of the pictures P9, B7, B6, and B8 will be described in order.

<ピクチャP9の復号化処理>
ピクチャP9の符号列は符号列解析部1401に入力される。符号列解析部1401は、入力された符号列から、各種データの抽出を行う。ここで各種データとは、モード選択の情報や動きベクトル情報等である。抽出されたモード選択の情報は、モード復号部1403に対して出力される。また、抽出された動きベクトル情報は、動き補償復号部1405に対して出力される。さらに、予測誤差符号化データは予測誤差復号化部1402に対して出力される。
<Decoding process of picture P9>
The code string of the picture P9 is input to the code string analysis unit 1401. The code string analysis unit 1401 extracts various data from the input code string. Here, the various data are mode selection information, motion vector information, and the like. The extracted mode selection information is output to mode decoding section 1403. Also, the extracted motion vector information is output to the motion compensation decoding unit 1405. Further, the prediction error encoded data is output to the prediction error decoding unit 1402.

モード復号部1403は、符号列から抽出された符号化モード選択の情報を参照し、スイッチ1409、1410の制御を行う。符号化モード選択がピクチャ内符号化である場合には、モード復号部1403は、スイッチ1409をa側に、スイッチ1410をc側に接続するように制御する。また、符号化モード選択がピクチャ間予測符号化である場合には、モード復号部1403は、スイッチ1409をb側に、スイッチ1410をd側に接続するように制御する。   The mode decoding unit 1403 controls the switches 1409 and 1410 with reference to the coding mode selection information extracted from the code string. When the coding mode selection is intra-picture coding, the mode decoding unit 1403 controls the switch 1409 to be connected to the a side and the switch 1410 to be connected to the c side. When the coding mode selection is inter-picture predictive coding, the mode decoding unit 1403 performs control so that the switch 1409 is connected to the b side and the switch 1410 is connected to the d side.

またモード復号部1403では、符号化モード選択の情報を動き補償復号部1405に対しても出力する。以下では、符号化モード選択がピクチャ間予測符号化である場合について説明する。予測誤差復号化部1402は、入力された予測誤差符号化データの復号化を行い、予測誤差画像データを生成する。そして、予測誤差復号化部1402は、生成した予測誤差画像データをスイッチ1409に対して出力する。ここでは、スイッチ1409はb側に接続されているので、予測誤差画像データは加算演算部1408に対して出力される。   The mode decoding unit 1403 also outputs information on coding mode selection to the motion compensation decoding unit 1405. Hereinafter, a case where the coding mode selection is inter-picture predictive coding will be described. The prediction error decoding unit 1402 decodes the input prediction error encoded data to generate prediction error image data. Then, the prediction error decoding unit 1402 outputs the generated prediction error image data to the switch 1409. Here, since the switch 1409 is connected to the b side, the prediction error image data is output to the addition operation unit 1408.

動き補償復号部1405は、入力された動きベクトルの情報等に基づいて、フレームメモリ1407から動き補償画像データを取得する。ピクチャP9は、ピクチャP5を参照して符号化されており、ピクチャP5は既に復号化されてフレームメモリ1407に保持されている。そこで、動き補償復号部1405は、動きベクトルの情報に基づいてフレームメモリ1407に保持されたピクチャP5の画像データから動き補償画像データを取得する。このようにして生成された動き補償画像データは加算演算部1408に対して出力される。   The motion compensation decoding unit 1405 acquires motion compensated image data from the frame memory 1407 based on the input motion vector information and the like. The picture P9 has been encoded with reference to the picture P5, and the picture P5 has already been decoded and held in the frame memory 1407. Therefore, the motion compensation decoding unit 1405 acquires motion compensation image data from the image data of the picture P5 held in the frame memory 1407 based on the motion vector information. The motion compensated image data generated in this way is output to the addition operation unit 1408.

また、動き補償復号部1405は、Pピクチャの復号化を行う場合には、動きベクトルの情報を動きベクトル記憶部1406に記憶する。   Also, the motion compensation decoding unit 1405 stores motion vector information in the motion vector storage unit 1406 when decoding a P picture.

加算演算部1408は、入力された予測誤差画像データと動き補償画像データとを加算し、復号化画像データを生成する。生成された復号化画像データはスイッチ1410を介してフレームメモリ1407に対して出力される。   The addition operation unit 1408 adds the input prediction error image data and motion compensation image data to generate decoded image data. The generated decoded image data is output to the frame memory 1407 via the switch 1410.

以上のようにして、ピクチャP9の1マクロブロックの処理が完了する。同様の処理により、残りのマクロブロックも順に復号化される。ピクチャP9のマクロブロックが全て復号化されると、ピクチャB7の復号化が行われる。   As described above, the processing of one macroblock of the picture P9 is completed. By the same process, the remaining macroblocks are sequentially decoded. When all the macroblocks of the picture P9 are decoded, the picture B7 is decoded.

<ピクチャB7の復号化処理>
符号列解析部1401、モード復号化部1403、および予測誤差復号化部1402における予測誤差画像データの生成までの動作は、ピクチャP9の復号化処理の際と同様であるので、説明は省略する。
<Decoding process of picture B7>
Since operations up to the generation of the prediction error image data in the code string analysis unit 1401, the mode decoding unit 1403, and the prediction error decoding unit 1402 are the same as those in the decoding process of the picture P9, description thereof is omitted.

動き補償復号部1405は、入力された動きベクトルの情報等に基づいて、動き補償画像データを生成する。ピクチャB7は、前方向参照ピクチャとしてピクチャP5を参照し、後方向参照ピクチャとしてP9を参照して符号化されており、これらのピクチャは既に復号化されてフレームメモリ1407に保持されている。   The motion compensation decoding unit 1405 generates motion compensated image data based on the input motion vector information and the like. The picture B7 is encoded with reference to the picture P5 as a forward reference picture and with reference to P9 as a backward reference picture, and these pictures are already decoded and held in the frame memory 1407.

モード選択が2方向予測のピクチャ間予測符号化である場合には、動き補償復号部1405は、前方向動きベクトルの情報に基づいて前方向参照画像データをフレームメモリ1407から取得する。また、後方向動きベクトルの情報に基づいて後方向参照画像データをフレームメモリ1407から取得する。そして、動き補償復号部1405は、前方向参照画像データと後方向参照画像データとを加算平均することにより、動き補償画像データを生成する。   When the mode selection is bi-prediction inter-picture predictive coding, the motion compensation decoding unit 1405 obtains forward reference image data from the frame memory 1407 based on the forward motion vector information. Further, backward reference image data is acquired from the frame memory 1407 based on the backward motion vector information. Then, the motion compensation decoding unit 1405 generates motion compensation image data by averaging the forward reference image data and the backward reference image data.

また、モード選択がダイレクトモードである場合には、動き補償復号部1405は、動きベクトル記憶部1406に記憶されているピクチャP9の動きベクトルを取得する。そして、動き補償復号部1405は、この動きベクトルを用いて、前方向参照画像データと後方向参照画像データとをフレームメモリ1407から取得する。そして、動き補償復号部1405は、前方向参照画像データと後方向参照画像データとを加算平均することにより、動き補償画像データを生成する。   When the mode selection is the direct mode, the motion compensation decoding unit 1405 acquires the motion vector of the picture P9 stored in the motion vector storage unit 1406. Then, the motion compensation decoding unit 1405 acquires the forward reference image data and the backward reference image data from the frame memory 1407 using the motion vector. Then, the motion compensation decoding unit 1405 generates motion compensation image data by averaging the forward reference image data and the backward reference image data.

このモード選択がダイレクトモードである場合について、さらに図5(a) を用いて説明する。ここで、ピクチャB7のブロックaを復号化しているとし、ブロックaと同じ位置にあるピクチャP9のブロックをブロックbとする。そしてブロックbの動きベクトルが動きベクトルcであり、これはピクチャP5を参照している。この場合、前方向動きベクトルとして、動きベクトルcを利用して求めたピクチャP5を参照する動きベクトルdを用い、後方向動きベクトルとして、動きベクトルcを利用して求めたピクチャP9を参照する動きベクトルeを用いる。例えば、動きベクトルcを利用する方法としては、動きベクトルcに平行な動きベクトルを生成する方法がある。これらの動きベクトルに基づいて得られる前方向参照データと後方向参照データとを加算平均した画像データを動き補償画像データとする。   The case where the mode selection is the direct mode will be further described with reference to FIG. Here, it is assumed that the block a of the picture B7 is decoded, and the block of the picture P9 at the same position as the block a is a block b. The motion vector of the block b is a motion vector c, which refers to the picture P5. In this case, the motion vector d that refers to the picture P5 obtained using the motion vector c is used as the forward motion vector, and the motion that refers to the picture P9 obtained using the motion vector c is used as the backward motion vector. Use vector e. For example, as a method of using the motion vector c, there is a method of generating a motion vector parallel to the motion vector c. Image data obtained by averaging the forward reference data and the backward reference data obtained based on these motion vectors is defined as motion compensated image data.

この場合、前方向動きベクトルである動きベクトルdの大きさをMVF、後方向動きベクトルである動きベクトルeの大きさをMVB、動きベクトルcの大きさをMV、現在のピクチャ(ピクチャB7)の後方向参照ピクチャ(ピクチャP9)と、その後方向参照ピクチャのブロックbが参照しているピクチャ(ピクチャP5)との時間的距離をTRD、現在のピクチャ(ピクチャB7)と前方向参照ピクチャ(ピクチャP5)との時間的距離をTRFとすると、動きベクトルdの大きさMVF、動きベクトルeの大きさMVBは、それぞれ(式1)、(式2)で求められる。ここで、MVF、MVBは、動きベクトルの水平成分、垂直成分のそれぞれを表現しているものとする。なお、各ピクチャ間の時間的距離については、例えば各ピクチャに付される表示順序(位置)を示す情報、またはその情報の差に基づいて決定することができる。   In this case, the magnitude of the motion vector d that is the forward motion vector is MVF, the magnitude of the motion vector e that is the backward motion vector is MVB, the magnitude of the motion vector c is MV, and the current picture (picture B7) The temporal distance between the backward reference picture (picture P9) and the picture (picture P5) referenced by the block b of the backward reference picture is TRD, the current picture (picture B7) and the forward reference picture (picture P5). )), The magnitude MVF of the motion vector d and the magnitude MVB of the motion vector e are obtained by (Expression 1) and (Expression 2), respectively. Here, MVF and MVB represent the horizontal component and the vertical component of the motion vector, respectively. The temporal distance between the pictures can be determined based on, for example, information indicating the display order (position) given to each picture or a difference between the information.

このようにして生成された動き補償画像データは加算演算部1408に対して出力される。また、動き補償復号部1405は、動きベクトルの情報を動きベクトル記憶部1406に記憶する。   The motion compensated image data generated in this way is output to the addition operation unit 1408. Also, the motion compensation decoding unit 1405 stores motion vector information in the motion vector storage unit 1406.

加算演算部1408は、入力された予測誤差画像データと動き補償画像データとを加算し、復号化画像データを生成する。生成された復号化画像データはスイッチ1410を介してフレームメモリ1407に対して出力される。   The addition operation unit 1408 adds the input prediction error image data and motion compensation image data to generate decoded image data. The generated decoded image data is output to the frame memory 1407 via the switch 1410.

以上のようにして、ピクチャB7の1マクロブロックの処理が完了する。同様の処理により、残りのマクロブロックも順に復号化される。ピクチャB7のマクロブロックが全て復号化されると、ピクチャB6の復号化が行われる。   As described above, the processing of one macroblock of the picture B7 is completed. By the same process, the remaining macroblocks are sequentially decoded. When all the macroblocks of the picture B7 are decoded, the picture B6 is decoded.

<ピクチャB6の復号化処理>
符号列解析部1401、モード復号化部1403、および予測誤差復号化部1402における予測誤差画像データの生成までの動作は、ピクチャP9の復号化処理の際と同様であるので、説明は省略する。
<Decoding process of picture B6>
Since operations up to the generation of the prediction error image data in the code string analysis unit 1401, the mode decoding unit 1403, and the prediction error decoding unit 1402 are the same as those in the decoding process of the picture P9, description thereof is omitted.

動き補償復号部1405は、入力された動きベクトルの情報等に基づいて、動き補償画像データを生成する。ピクチャB6は、前方向参照ピクチャとしてピクチャP5を参照し、後方向参照ピクチャとしてB7を参照して符号化されており、これらのピクチャは既に復号化されてフレームメモリ1407に保持されている。   The motion compensation decoding unit 1405 generates motion compensated image data based on the input motion vector information and the like. The picture B6 is encoded with reference to the picture P5 as the forward reference picture and with reference to B7 as the backward reference picture, and these pictures are already decoded and held in the frame memory 1407.

モード選択が2方向予測のピクチャ間予測符号化である場合には、動き補償復号部1405は、前方向動きベクトルの情報に基づいて前方向参照画像データをフレームメモリ1407から取得する。また、後方向動きベクトルの情報に基づいて後方向参照画像データをフレームメモリ1407から取得する。そして、動き補償復号部1405は、前方向参照画像データと後方向参照画像データとを加算平均することにより、動き補償画像データを生成する。   When the mode selection is bi-prediction inter-picture predictive coding, the motion compensation decoding unit 1405 obtains forward reference image data from the frame memory 1407 based on the forward motion vector information. Further, backward reference image data is acquired from the frame memory 1407 based on the backward motion vector information. Then, the motion compensation decoding unit 1405 generates motion compensation image data by averaging the forward reference image data and the backward reference image data.

また、モード選択がダイレクトモードである場合には、動き補償復号部1405は、動きベクトル記憶部1406に記憶されているピクチャB7の動きベクトルを取得する。動き補償復号部1405は、この動きベクトルを用いて、前方向参照画像データと後方向参照画像データとをフレームメモリ1407から取得する。そして、動き補償復号部1405は、前方向参照画像データと後方向参照画像データとを加算平均することにより、動き補償画像データを生成する。   When the mode selection is the direct mode, the motion compensation decoding unit 1405 acquires the motion vector of the picture B7 stored in the motion vector storage unit 1406. The motion compensation decoding unit 1405 acquires the forward reference image data and the backward reference image data from the frame memory 1407 using the motion vector. Then, the motion compensation decoding unit 1405 generates motion compensation image data by averaging the forward reference image data and the backward reference image data.

このモード選択がダイレクトモードである場合の第一の例を図5(b) を用いて説明する。ここで、ピクチャB6のブロックaを復号化しているとし、ブロックaと同じ位置にあるピクチャB7のブロックをブロックbとする。そして、ブロックbは、前方向参照によるピクチャ間予測符号化または2方向参照によるピクチャ間予測符号化されているとし、ブロックbの前方向動きベクトルを動きベクトルcとする。この動きベクトルcはピクチャP5を参照している。この場合、ブロックaに対する前方向動きベクトルとして、動きベクトルcを利用して生成したピクチャP5を参照する動きベクトルdを用い、後方向動きベクトルとして、動きベクトルcを利用して生成したピクチャB7を参照する動きベクトルeを用いる。例えば、動きベクトルcを利用する方法としては、動きベクトルcに平行な動きベクトルを生成する方法がある。これらの動きベクトルに基づいて得られる前方向参照画像データと後方向参照画像データとを加算平均した画像データを動き補償画像データとする。   A first example in which the mode selection is the direct mode will be described with reference to FIG. Here, it is assumed that the block a of the picture B6 is decoded, and the block of the picture B7 at the same position as the block a is a block b. The block b is assumed to have been inter-picture predictive coding by forward reference or inter-picture predictive coding by bi-directional reference, and the forward motion vector of the block b is a motion vector c. This motion vector c refers to the picture P5. In this case, the motion vector d referring to the picture P5 generated using the motion vector c is used as the forward motion vector for the block a, and the picture B7 generated using the motion vector c is used as the backward motion vector. A reference motion vector e is used. For example, as a method of using the motion vector c, there is a method of generating a motion vector parallel to the motion vector c. Image data obtained by averaging the forward reference image data and the backward reference image data obtained based on these motion vectors is defined as motion compensated image data.

この場合、前方向動きベクトルである動きベクトルdの大きさをMVF、後方向動きベクトルである動きベクトルeの大きさをMVB、動きベクトルcの大きさをMV、現在のピクチャ(ピクチャB6)の後方向参照ピクチャ(ピクチャB7)と、その後方向参照ピクチャのブロックbが参照しているピクチャ(ピクチャP5)との時間的距離をTRD、現在のピクチャ(ピクチャB6)と前方向参照ピクチャ(ピクチャP5)との時間的距離をTRFとすると、動きベクトルdの大きさMVF、動きベクトルeの大きさMVBは、それぞれ(式1)、(式2)で求められる。なお、各ピクチャ間の時間的距離については、例えば各ピクチャに付される表示順序(位置)を示す情報、またはその情報の差に基づいて決定することができる。または、TRD、TRFの値は、各ピクチャ毎に決められた所定値を用いても良い。この所定値は、ヘッダ情報として符号列中に記述されていても良い。   In this case, the magnitude of the motion vector d that is the forward motion vector is MVF, the magnitude of the motion vector e that is the backward motion vector is MVB, the magnitude of the motion vector c is MV, and the current picture (picture B6) The temporal distance between the backward reference picture (picture B7) and the picture (picture P5) referenced by the block b of the backward reference picture is TRD, the current picture (picture B6) and the forward reference picture (picture P5). )), The magnitude MVF of the motion vector d and the magnitude MVB of the motion vector e are obtained by (Expression 1) and (Expression 2), respectively. The temporal distance between the pictures can be determined based on, for example, information indicating the display order (position) given to each picture or a difference between the information. Alternatively, the TRD and TRF values may be predetermined values determined for each picture. This predetermined value may be described in the code string as header information.

また、モード選択がダイレクトモードである場合の第二の例を図5(b) を用いて説明する。   A second example when the mode selection is the direct mode will be described with reference to FIG.

この場合、ピクチャB6の後方にある参照ピクチャであるピクチャB7中の、ブロックaと同じ位置にあるブロックbを復号化した際に用いられた動きベクトルを利用する。ここではブロックbは、ダイレクトモードを用いて符号化されていたとし、そのときに実質的に用いられた前方向動きベクトルを動きベクトルcとする。この動きベクトルcは、動きベクトル記憶部1406に記憶されているものを用いるか、またはブロックbをダイレクトモードで符号化する際に用いたピクチャP9の動きベクトルを動きベクトル記憶部1406から読み出した後、スケーリングの計算を行って求める。なお、動き補償復号部1405は、ピクチャB7のブロックbをダイレクトモードで復号化する際にスケーリング処理により求めた動きベクトルを、動きベクトル記憶部1406に記憶する場合は、前方向動きベクトルだけを記憶すればよい。   In this case, the motion vector used when decoding the block b at the same position as the block a in the picture B7 which is the reference picture behind the picture B6 is used. Here, block b is assumed to have been encoded using the direct mode, and the forward motion vector substantially used at that time is referred to as motion vector c. As the motion vector c, the one stored in the motion vector storage unit 1406 is used, or the motion vector of the picture P9 used when the block b is encoded in the direct mode is read from the motion vector storage unit 1406. Find the scaling calculation. Note that the motion compensation decoding unit 1405 stores only the forward motion vector when the motion vector obtained by the scaling process when decoding the block b of the picture B7 in the direct mode is stored in the motion vector storage unit 1406. do it.

この場合、ブロックaに対する前方向動きベクトルとして、動きベクトルcを利用して生成したピクチャP5を参照する動きベクトルdを用い、後方向動きベクトルとして、動きベクトルcを利用して生成したピクチャB7を参照する動きベクトルeを用いる。例えば、動きベクトルcを利用する方法としては、動きベクトルcに平行な動きベクトルを生成する方法がある。これらの動きベクトルに基づいて得られる前方向参照画像データと後方向参照画像データとを加算平均した画像データを動き補償画像データとする。   In this case, the motion vector d referring to the picture P5 generated using the motion vector c is used as the forward motion vector for the block a, and the picture B7 generated using the motion vector c is used as the backward motion vector. A reference motion vector e is used. For example, as a method of using the motion vector c, there is a method of generating a motion vector parallel to the motion vector c. Image data obtained by averaging the forward reference image data and the backward reference image data obtained based on these motion vectors is defined as motion compensated image data.

この場合、前方向動きベクトルである動きベクトルdの大きさMVFと、後方向動きベクトルである動きベクトルeの大きさMVBとは、ダイレクトモードの第一の例と同様に、(式1)、(式2)を用いて求めることができる。   In this case, the magnitude MVF of the motion vector d that is the forward motion vector and the magnitude MVB of the motion vector e that is the backward motion vector are the same as in the first example of the direct mode (Equation 1), It can be determined using (Equation 2).

次に、モード選択がダイレクトモードである場合の第三の例を図5(c) を用いて説明する。   Next, a third example when the mode selection is the direct mode will be described with reference to FIG.

ここで、ピクチャB6のブロックaを復号化しているとし、ブロックaと同じ位置にあるピクチャB7のブロックをブロックbとする。ブロックbは、後方向参照予測符号化されているとし、ブロックbの後方向動きベクトルを動きベクトルfとする。この動きベクトルfはピクチャP9を参照している。この場合、ブロックaに対する前方向動きベクトルとして、動きベクトルfを利用して求めたピクチャP5を参照する動きベクトルgを用い、後方向動きベクトルとして、動きベクトルfを利用して求めたピクチャB7を参照する動きベクトルhを用いる。例えば、動きベクトルfを利用する方法としては、動きベクトルfに平行な動きベクトルを生成する方法がある。これらの動きベクトルに基づいて得られる前方向参照画像データと後方向参照画像データとを加算平均した画像データを動き補償画像データとする。   Here, it is assumed that the block a of the picture B6 is decoded, and the block of the picture B7 at the same position as the block a is a block b. It is assumed that the block b is subjected to backward reference predictive coding, and the backward motion vector of the block b is a motion vector f. This motion vector f refers to the picture P9. In this case, the motion vector g referring to the picture P5 obtained using the motion vector f is used as the forward motion vector for the block a, and the picture B7 obtained using the motion vector f is used as the backward motion vector. A motion vector h to be referred to is used. For example, as a method of using the motion vector f, there is a method of generating a motion vector parallel to the motion vector f. Image data obtained by averaging the forward reference image data and the backward reference image data obtained based on these motion vectors is defined as motion compensated image data.

この場合、前方向動きベクトルである動きベクトルgの大きさをMVF、後方向動きベクトルである動きベクトルhの大きさをMVB、動きベクトルfの大きさをMV、現在のピクチャ(ピクチャB6)の後方向参照ピクチャ(ピクチャB7)と、その後方向参照ピクチャのブロックが参照しているピクチャ(ピクチャP9)との時間的距離をTRD、現在のピクチャ(ピクチャB6)と前方向参照ピクチャ(ピクチャP5)との時間的距離をTRF、現在のピクチャ(ピクチャB6)と後方向参照ピクチャ(ピクチャB7)との時間的距離をTRB、とすると、動きベクトルgの大きさMVF、動きベクトルhの大きさMVBは、それぞれ(式3)、(式4)で求められる。   In this case, the magnitude of the motion vector g which is the forward motion vector is MVF, the magnitude of the motion vector h which is the backward motion vector is MVB, the magnitude of the motion vector f is MV, and the current picture (picture B6) The temporal distance between the backward reference picture (picture B7) and the picture (picture P9) referenced by the block of the backward reference picture is TRD, the current picture (picture B6) and the forward reference picture (picture P5). , TRF, and TRB as the temporal distance between the current picture (picture B6) and the backward reference picture (picture B7), the magnitude MVF of the motion vector g and the magnitude MVB of the motion vector h Are obtained by (Equation 3) and (Equation 4), respectively.

次に、モード選択がダイレクトモードである場合の第四の例を図5(d) を用いて説明する。   Next, a fourth example when the mode selection is the direct mode will be described with reference to FIG.

ここで、ピクチャB6のブロックaを復号化しているとし、ブロックaと同じ位置にあるピクチャB7のブロックをブロックbとする。ブロックbは、第三の例と同様に後方向参照予測符号化されているとし、ブロックbの後方向動きベクトルを動きベクトルfとする。この動きベクトルfはピクチャP9を参照している。この場合、ブロックaに対する前方向動きベクトルとして、動きベクトルfを利用して求めたピクチャP9を参照する動きベクトルgを用い、後方向動きベクトルとして、動きベクトルfを利用して求めたピクチャB7を参照する動きベクトルhを用いる。例えば、動きベクトルfを利用する方法としては、動きベクトルfに平行な動きベクトルを生成する方法がある。これらの動きベクトルに基づいて得られる前方向参照画像データと後方向参照画像データとを加算平均した画像データを動き補償画像データとする。   Here, it is assumed that the block a of the picture B6 is decoded, and the block of the picture B7 at the same position as the block a is a block b. It is assumed that the block b is subjected to backward reference prediction encoding as in the third example, and the backward motion vector of the block b is a motion vector f. This motion vector f refers to the picture P9. In this case, the motion vector g referring to the picture P9 obtained using the motion vector f is used as the forward motion vector for the block a, and the picture B7 obtained using the motion vector f is used as the backward motion vector. A motion vector h to be referred to is used. For example, as a method of using the motion vector f, there is a method of generating a motion vector parallel to the motion vector f. Image data obtained by averaging the forward reference image data and the backward reference image data obtained based on these motion vectors is defined as motion compensated image data.

この場合、前方向動きベクトルである動きベクトルgの大きさをMVF、後方向動きベクトルである動きベクトルhの大きさをMVB、動きベクトルfの大きさをMV、現在のピクチャ(ピクチャB6)の後方向参照ピクチャ(ピクチャB7)と、その後方向参照ピクチャのブロックが参照しているピクチャ(ピクチャP9)との時間的距離をTRD、現在のピクチャ(ピクチャB6)と、後方向参照ピクチャ(ピクチャB7)のブロックが参照しているピクチャ(ピクチャP9)との時間的距離をTRFとすると、動きベクトルgの大きさMVF、動きベクトルhの大きさMVBは、それぞれ(式1)、(式2)で求められる。   In this case, the magnitude of the motion vector g which is the forward motion vector is MVF, the magnitude of the motion vector h which is the backward motion vector is MVB, the magnitude of the motion vector f is MV, and the current picture (picture B6) The temporal distance between the backward reference picture (picture B7) and the picture (picture P9) referenced by the block of the backward reference picture is TRD, the current picture (picture B6), and the backward reference picture (picture B7). ) Is a time distance from a picture (picture P9) referred to by a block, TRF, the magnitude MVF of the motion vector g and the magnitude MVB of the motion vector h are (Equation 1) and (Equation 2), respectively. Is required.

また、モード選択がダイレクトモードである場合の第五の例を図6(a) を用いて説明する。ここで、ピクチャB6のブロックaをダイレクトモードにより復号化するとする。この場合、動きベクトルの大きさを0として、前方向参照ピクチャとしてピクチャP5を、後方向参照ピクチャとしてピクチャB7を用いて、2方向参照を行うことにより、動き補償を行う。   A fifth example when the mode selection is the direct mode will be described with reference to FIG. Here, it is assumed that the block a of the picture B6 is decoded in the direct mode. In this case, motion compensation is performed by setting the magnitude of the motion vector to 0, performing two-way reference using the picture P5 as the forward reference picture and the picture B7 as the backward reference picture.

次に、モード選択がダイレクトモードである場合の第六の例を図6(b) を用いて説明する。ここで、ピクチャB6のブロックaをダイレクトモードで復号化するとする。この場合、ピクチャB6の後方にあるPピクチャであるピクチャP9中の、ブロックaと同じ位置にあるブロックfを復号化する際に用いられた動きベクトルgを利用する。動きベクトルgは、動きベクトル記憶部1406に記憶されている。ブロックaは、動きベクトルgを利用して求めた動きベクトルを用いて、前方向参照ピクチャであるピクチャP5と、後方向参照ピクチャであるピクチャB7から2方向予測を行う。例えば、上記第一の例の場合と同様に動きベクトルgに平行な動きベクトルを生成する方法を用いれば、ブロックaの動き補償画像データを得るために用いる動きベクトルは、ピクチャP5に対しては動きベクトルh、ピクチャB7に対しては動きベクトルiとなる。   Next, a sixth example when the mode selection is the direct mode will be described with reference to FIG. Here, it is assumed that block a of picture B6 is decoded in the direct mode. In this case, the motion vector g used when decoding the block f in the same position as the block a in the picture P9 which is the P picture behind the picture B6 is used. The motion vector g is stored in the motion vector storage unit 1406. The block a performs bi-directional prediction from the picture P5 that is the forward reference picture and the picture B7 that is the backward reference picture, using the motion vector obtained by using the motion vector g. For example, if a method of generating a motion vector parallel to the motion vector g is used as in the case of the first example, the motion vector used to obtain the motion compensated image data of the block a is It becomes the motion vector i for the motion vector h and the picture B7.

この場合、前方向動きベクトルである動きベクトルhの大きさをMVF、後方向動きベクトルである動きベクトルiの大きさをMVB、動きベクトルgの大きさをMV、現在のピクチャ(ピクチャB6)の後方に位置するPピクチャ(ピクチャP9)と、その後に位置するピクチャのブロックfが参照しているピクチャ(ピクチャP5)との時間的距離をTRD、現在のピクチャ(ピクチャB6)と前方向参照ピクチャ(ピクチャP5)との時間的距離をTRF、現在のピクチャ(ピクチャB6)と後方向参照ピクチャ(ピクチャB7)との時間的距離をTRB、とすると、動きベクトルMVF、動きベクトルMVBは、それぞれ(式1)、(式5)で求められる。   In this case, the magnitude of the motion vector h that is the forward motion vector is MVF, the magnitude of the motion vector i that is the backward motion vector is MVB, the magnitude of the motion vector g is MV, and the current picture (picture B6) The temporal distance between the P picture (picture P9) located behind and the picture (picture P5) referenced by the block f of the picture located thereafter is TRD, the current picture (picture B6) and the forward reference picture If the temporal distance between (picture P5) is TRF, and the temporal distance between the current picture (picture B6) and the backward reference picture (picture B7) is TRB, the motion vector MVF and the motion vector MVB are ( It is calculated | required by (Formula 1) and (Formula 5).

次に、モード選択がダイレクトモードである場合の第七の例を図6(c) を用いて説明する。ここで、ピクチャB6のブロックaをダイレクトモードで復号化するとする。この例は、上記で説明したピクチャ番号に対する相対インデックスの割り当ての変更(リマッピング)が行われ、後方向参照ピクチャがピクチャP9となった場合である。この場合、ピクチャB6の後方向参照ピクチャであるピクチャP9中の、ブロックaと同じ位置にあるブロックfを符号化する際に用いられた動きベクトルgを利用する。動きベクトルgは、動きベクトル記憶部1406に記憶されている。ブロックaは、動きベクトルgを利用して生成した動きベクトルを用いて、前方向参照ピクチャであるピクチャP5と、後方向参照ピクチャであるピクチャP9とから2方向予測を行う。例えば、上記第一の例の場合と同様に動きベクトルgに平行な動きベクトルを生成する方法を用いれば、ブロックaの動き補償画像データを得るために用いる動きベクトルは、ピクチャP5に対しては動きベクトルh、ピクチャP9に対しては動きベクトルiとなる。   Next, a seventh example when the mode selection is the direct mode will be described with reference to FIG. Here, it is assumed that block a of picture B6 is decoded in the direct mode. In this example, the relative index assignment change (remapping) with respect to the picture number described above is performed, and the backward reference picture becomes the picture P9. In this case, the motion vector g used when the block f at the same position as the block a in the picture P9 which is the backward reference picture of the picture B6 is used. The motion vector g is stored in the motion vector storage unit 1406. Block a performs bi-directional prediction from picture P5, which is a forward reference picture, and picture P9, which is a backward reference picture, using a motion vector generated using motion vector g. For example, if a method of generating a motion vector parallel to the motion vector g is used as in the case of the first example, the motion vector used to obtain the motion compensated image data of the block a is It becomes the motion vector i for the motion vector h and the picture P9.

この場合、前方向動きベクトルである動きベクトルhの大きさをMVF、後方向動きベクトルである動きベクトルiの大きさをMVB、動きベクトルgの大きさをMV、現在のピクチャ(ピクチャB6)の後方向参照ピクチャ(ピクチャP9)と、その後方向参照ピクチャのブロックが参照しているピクチャ(ピクチャP5)との時間的距離をTRD、現在のピクチャ(ピクチャB6)と前方向参照ピクチャ(ピクチャP5)との時間的距離をTRFとすると、動きベクトルhの大きさMVF、動きベクトルiの大きさMVBは、それぞれ(式1)、(式2)で求められる。   In this case, the magnitude of the motion vector h that is the forward motion vector is MVF, the magnitude of the motion vector i that is the backward motion vector is MVB, the magnitude of the motion vector g is MV, and the current picture (picture B6) The temporal distance between the backward reference picture (picture P9) and the picture (picture P5) referenced by the block of the backward reference picture is TRD, the current picture (picture B6) and the forward reference picture (picture P5). If the time distance between and is TRF, the magnitude MVF of the motion vector h and the magnitude MVB of the motion vector i are obtained by (Expression 1) and (Expression 2), respectively.

このようにして生成された動き補償画像データは加算演算部1408に対して出力される。加算演算部1408は、入力された予測誤差画像データと動き補償画像データとを加算し、復号化画像データを生成する。生成された復号化画像データはスイッチ1410を介してフレームメモリ1407に対して出力される。   The motion compensated image data generated in this way is output to the addition operation unit 1408. The addition operation unit 1408 adds the input prediction error image data and motion compensation image data to generate decoded image data. The generated decoded image data is output to the frame memory 1407 via the switch 1410.

以上のようにして、ピクチャB6の1マクロブロックの処理が完了する。同様の処理により、残りのマクロブロックも順に復号化される。ピクチャB6のマクロブロックが全て復号化されると、ピクチャB8の復号化が行われる。   As described above, the processing for one macroblock of the picture B6 is completed. By the same process, the remaining macroblocks are sequentially decoded. When all the macroblocks of the picture B6 are decoded, the picture B8 is decoded.

<ピクチャB8の復号化処理>
符号列解析部1401、モード復号化部1403、および予測誤差復号化部1402における予測誤差画像データの生成までの動作は、ピクチャP9の復号化処理の際と同様であるので、説明は省略する。
<Decoding process of picture B8>
Since operations up to the generation of the prediction error image data in the code string analysis unit 1401, the mode decoding unit 1403, and the prediction error decoding unit 1402 are the same as those in the decoding process of the picture P9, description thereof is omitted.

動き補償復号部1405は、入力された動きベクトルの情報等に基づいて、動き補償画像データを生成する。ピクチャB8は、前方向参照ピクチャとしてピクチャB7を参照し、後方向参照ピクチャとしてP9を参照して符号化されており、これらのピクチャは既に復号化されてフレームメモリ1407に保持されている。   The motion compensation decoding unit 1405 generates motion compensated image data based on the input motion vector information and the like. The picture B8 is coded with reference to the picture B7 as a forward reference picture and with reference to P9 as a backward reference picture, and these pictures are already decoded and held in the frame memory 1407.

モード選択が2方向予測のピクチャ間予測符号化である場合には、動き補償復号部1405は、前方向動きベクトルの情報に基づいて前方向参照画像データをフレームメモリ1407から取得する。また、後方向動きベクトルの情報に基づいて後方向参照画像データをフレームメモリ1407から取得する。そして、動き補償復号部1405は、前方向参照画像データと後方向参照画像データとを加算平均することにより、動き補償画像データを生成する。   When the mode selection is bi-prediction inter-picture predictive coding, the motion compensation decoding unit 1405 obtains forward reference image data from the frame memory 1407 based on the forward motion vector information. Further, backward reference image data is acquired from the frame memory 1407 based on the backward motion vector information. Then, the motion compensation decoding unit 1405 generates motion compensation image data by averaging the forward reference image data and the backward reference image data.

また、モード選択がダイレクトモードである場合には、動き補償復号部1405は、動きベクトル記憶部1406に記憶されているピクチャP9の動きベクトルを取得する。動き補償復号部1405は、この動きベクトルを用いて、前方向参照画像データと後方向参照画像データとをフレームメモリ1407から取得する。そして、動き補償復号部1405は、前方向参照画像データと後方向参照画像データとを加算平均することにより、動き補償画像データを生成する。   When the mode selection is the direct mode, the motion compensation decoding unit 1405 acquires the motion vector of the picture P9 stored in the motion vector storage unit 1406. The motion compensation decoding unit 1405 acquires the forward reference image data and the backward reference image data from the frame memory 1407 using the motion vector. Then, the motion compensation decoding unit 1405 generates motion compensation image data by averaging the forward reference image data and the backward reference image data.

モード選択がダイレクトモードである場合の例を図6(d) を用いて説明する。ここで、ピクチャB8のブロックaを復号化しているとし、後方向参照ピクチャであるピクチャP9中の、ブロックaと同じ位置にあるブロックbとする。そして、ブロックbの前方向動きベクトルを動きベクトルcとする。この動きベクトルcはピクチャP5を参照している。この場合、ブロックaに対する前方向動きベクトルとして、動きベクトルcを利用して生成したピクチャB7を参照する動きベクトルdを用い、後方向動きベクトルとして、動きベクトルcを利用して生成したピクチャP9を参照する動きベクトルeを用いる。例えば、動きベクトルcを利用する方法としては、動きベクトルcに平行な動きベクトルを生成する方法がある。これらの動きベクトルに基づいて得られる前方向参照画像データと後方向参照画像データとを加算平均した画像データを動き補償画像データとする。   An example in which the mode selection is the direct mode will be described with reference to FIG. Here, it is assumed that the block a of the picture B8 is decoded, and the block b is located at the same position as the block a in the picture P9 which is the backward reference picture. Then, the forward motion vector of the block b is set as a motion vector c. This motion vector c refers to the picture P5. In this case, the motion vector d referring to the picture B7 generated using the motion vector c is used as the forward motion vector for the block a, and the picture P9 generated using the motion vector c is used as the backward motion vector. A reference motion vector e is used. For example, as a method of using the motion vector c, there is a method of generating a motion vector parallel to the motion vector c. Image data obtained by averaging the forward reference image data and the backward reference image data obtained based on these motion vectors is defined as motion compensated image data.

この場合、前方向動きベクトルである動きベクトルdの大きさをMVF、後方向動きベクトルである動きベクトルeの大きさをMVB、動きベクトルcの大きさをMV、現在のピクチャ(ピクチャB8)の後方向参照ピクチャ(ピクチャP9)と、その後方向参照ピクチャのブロックbが参照しているピクチャ(ピクチャP5)との時間的距離をTRD、現在のピクチャ(ピクチャB8)と前方向参照ピクチャ(ピクチャB7)との時間的距離をTRF、現在のピクチャ(ピクチャB8)と後方向参照ピクチャ(ピクチャP9)との時間的距離をTRBとすると、動きベクトルdの大きさMVF、動きベクトルeの大きさMVBは、それぞれ(式1)、(式5)で求められる。   In this case, the magnitude of the motion vector d that is the forward motion vector is MVF, the magnitude of the motion vector e that is the backward motion vector is MVB, the magnitude of the motion vector c is MV, and the current picture (picture B8) The temporal distance between the backward reference picture (picture P9) and the picture (picture P5) referenced by the block b of the backward reference picture is TRD, the current picture (picture B8) and the forward reference picture (picture B7). ) And TB, and the temporal distance between the current picture (picture B8) and the backward reference picture (picture P9) is TRB, the magnitude MVF of the motion vector d and the magnitude MVB of the motion vector e Are obtained by (Equation 1) and (Equation 5), respectively.

このようにして生成された動き補償画像データは加算演算部1408に対して出力される。加算演算部1408は、入力された予測誤差画像データと動き補償画像データとを加算し、復号化画像データを生成する。生成された復号化画像データはスイッチ1410を介してフレームメモリ1407に対して出力される。   The motion compensated image data generated in this way is output to the addition operation unit 1408. The addition operation unit 1408 adds the input prediction error image data and motion compensation image data to generate decoded image data. The generated decoded image data is output to the frame memory 1407 via the switch 1410.

以上のようにして、ピクチャB8の1マクロブロックの処理が完了する。同様の処理により、残りのマクロブロックも順に復号化される。以下、各ピクチャはピクチャタイプに応じた同様の処理によって復号化される。   As described above, the processing of one macroblock of picture B8 is completed. By the same process, the remaining macroblocks are sequentially decoded. Hereinafter, each picture is decoded by the same processing according to the picture type.

次に、フレームメモリ制御部1404は、上記のようにフレームメモリ1407に保持された各ピクチャの画像データを、図4(a) に示すように時間順に並び直して出力画像として出力する。   Next, the frame memory control unit 1404 rearranges the image data of each picture held in the frame memory 1407 as described above in order of time as shown in FIG.

以上のように、本発明に係る動画像復号化方法では、2方向予測を用いてピクチャ間予測符号化処理が行われているBピクチャを復号化する際に、前方向参照および後方向参照として用いるピクチャとして、既に復号化済みの表示時間順で近傍に位置するピクチャを用いて復号化する。   As described above, in the moving picture decoding method according to the present invention, when decoding a B picture that has been subjected to inter-picture prediction encoding processing using bi-directional prediction, as a forward reference and a backward reference, As a picture to be used, decoding is performed using pictures that are already decoded and are located in the vicinity in the order of display time.

また、Bピクチャで符号化モードとしてダイレクトモードが選択されている場合には、動きベクトル記憶部1406に保持している既に復号化済みの後方向参照ピクチャの動きベクトルを参照することにより、既に復号化済みの画像データから参照画像データを取得し、動き補償画像データを得る。   Also, when the direct mode is selected as the encoding mode for the B picture, the decoding is already performed by referring to the motion vector of the backward reference picture that has already been decoded and is stored in the motion vector storage unit 1406. Reference image data is acquired from the converted image data, and motion compensated image data is obtained.

このような動作により、2方向予測を用いてピクチャ間予測符号化処理を行うBピクチャを符号化する際に、前方向参照および後方向参照として用いるピクチャとして、表示時間順に近傍に位置するピクチャを用いて符号化されて生成された符号列を、復号化する際に正しく復号化処理を行うことができる。   As a result of such operations, when coding a B picture for which inter-picture predictive coding processing is performed using bi-directional prediction, pictures that are located in the order of display time are used as pictures used as forward reference and backward reference. It is possible to correctly perform a decoding process when decoding a code string generated by encoding using the code string.

なお、本実施の形態では、ダイレクトモードにおいては、7つの例について説明したが、これは例えば、後方向参照ピクチャの同一位置のブロックの復号化方法等により、マクロブロックやブロック毎に一意的に決定される一つの方法を用いても良いし、ブロックやマクロブロック単位で複数の方法を切り替えて用いても良い。複数の方法を用いられている場合には、符号列中に記述されている、どのダイレクトモードを用いたかを示す情報を用いて、復号化を行う。この際には、動き補償復号化部1405の動作が、その情報によって変わることになる。例えば、動き補償のブロック単位でこの情報が付加されている場合、モード復号部1403でどのダイレクトモードが用いられて符号化されているかを決定し、それを動き補償復号部1405に伝える。そして、動き補償復号部1405は、どのダイレクトモードが用いられているかによって、本実施の形態で説明したような復号化方法を用いて復号化処理を行う。   In this embodiment, seven examples have been described in the direct mode. For example, this is uniquely determined for each macroblock or block by a decoding method of the block at the same position of the backward reference picture. One determined method may be used, or a plurality of methods may be switched and used in units of blocks or macroblocks. When a plurality of methods are used, decoding is performed using information indicating which direct mode is used described in the code string. At this time, the operation of the motion compensation decoding unit 1405 varies depending on the information. For example, when this information is added in units of motion compensation blocks, the mode decoding unit 1403 determines which direct mode is used for encoding, and notifies the motion compensation decoding unit 1405 of it. Then, the motion compensation decoding unit 1405 performs a decoding process using the decoding method described in this embodiment depending on which direct mode is used.

また、本実施の形態では、IまたはPピクチャ間に3枚のBピクチャが挟まれているピクチャ構成の場合について説明したが、このBピクチャの枚数は別の値、例えば4枚や5枚であっても良い。   In this embodiment, the case of a picture configuration in which three B pictures are sandwiched between I or P pictures has been described. However, the number of B pictures may be a different value, for example, four or five. There may be.

また、本実施の形態では、Pピクチャは表示時間順で前方または後方に位置する符号化済みのIまたはPピクチャを1つ参照して符号化され、Bピクチャは表示時間順で前方または後方に位置する近傍の符号化済みのピクチャを2つ参照して符号化されている符号列を復号化する場合について説明したが、これらはPピクチャの場合には、表示時間順で前方または後方に位置する、複数の符号化済みのIまたはPピクチャを参照ピクチャの候補とし、各ブロックで最大1つのピクチャを参照して符号化し、Bピクチャの場合には、表示時間順で前方または後方に位置する近傍の複数の符号化済みのピクチャを参照ピクチャの候補とし、各ブロックで最大2つのピクチャを参照して符号化された符号列であっても良い。   In the present embodiment, the P picture is encoded with reference to one encoded I or P picture positioned forward or backward in the display time order, and the B picture is forward or backward in the display time order. In the case of decoding a code string that has been encoded with reference to two encoded pictures in the vicinity of the position, these are positioned forward or backward in the order of display time in the case of a P picture. A plurality of encoded I or P pictures are used as reference picture candidates, and each block is encoded with reference to at most one picture. In the case of a B picture, it is positioned forward or backward in display time order. A plurality of encoded pictures in the vicinity may be used as reference picture candidates, and a code string may be encoded with reference to a maximum of two pictures in each block.

また、動き補償復号部1405は、動きベクトル記憶部1406に動きベクトルを記憶する際に、対象ブロックが2方向予測またはダイレクトモードにより符号化されている場合には、前方向および後方向の両方の動きベクトルを記憶しても良いし、前方向動きベクトルのみを記憶するようにしても良い。前方向動きベクトルのみを記憶すると、動きベクトル記憶部1406のメモリ量を削減することができる。   In addition, when storing the motion vector in the motion vector storage unit 1406, the motion compensation decoding unit 1405, when the target block is encoded by bi-directional prediction or direct mode, both forward and backward directions. A motion vector may be stored, or only a forward motion vector may be stored. If only the forward motion vector is stored, the memory amount of the motion vector storage unit 1406 can be reduced.

(実施の形態3)
さらに、上記各実施の形態で示した動画像符号化方法または動画像復号化方法の構成を実現するためのプログラムを、フレキシブルディスク等の記憶媒体に記録するようにすることにより、上記各実施の形態で示した処理を、独立したコンピュータシステムにおいて簡単に実施することが可能となる。
(Embodiment 3)
Furthermore, by recording a program for realizing the configuration of the moving picture encoding method or the moving picture decoding method shown in each of the above embodiments on a storage medium such as a flexible disk, The processing shown in the form can be easily performed in an independent computer system.

図15は、上記各実施の形態の動画像符号化方法または動画像復号化方法を格納したフレキシブルディスクを用いて、コンピュータシステムにより実施する場合の説明図である。   FIG. 15 is an explanatory diagram in the case of implementing by a computer system using a flexible disk storing the moving picture coding method or the moving picture decoding method of each of the above embodiments.

図15(b)は、フレキシブルディスクの正面からみた外観、断面構造、及びフレキシブルディスクを示し、図15(a)は、記録媒体本体であるフレキシブルディスクの物理フォーマットの例を示している。フレキシブルディスクFDはケースF内に内蔵され、該ディスクの表面には、同心円状に外周からは内周に向かって複数のトラックTrが形成され、各トラックは角度方向に16のセクタSeに分割されている。従って、上記プログラムを格納したフレキシブルディスクでは、上記フレキシブルディスクFD上に割り当てられた領域に、上記プログラムとしての動画像符号化方法が記録されている。   FIG. 15B shows an appearance, a cross-sectional structure, and a flexible disk as viewed from the front of the flexible disk, and FIG. 15A shows an example of a physical format of the flexible disk that is a recording medium body. The flexible disk FD is built in the case F, and a plurality of tracks Tr are formed concentrically on the surface of the disk from the outer periphery toward the inner periphery, and each track is divided into 16 sectors Se in the angular direction. ing. Therefore, in the flexible disk storing the program, a moving image encoding method as the program is recorded in an area allocated on the flexible disk FD.

また、図15(c)は、フレキシブルディスクFDに上記プログラムの記録再生を行うための構成を示す。上記プログラムをフレキシブルディスクFDに記録する場合は、コンピュータシステムCsから上記プログラムとしての動画像符号化方法または動画像復号化方法をフレキシブルディスクドライブを介して書き込む。また、フレキシブルディスク内のプログラムにより上記動画像符号化方法をコンピュータシステム中に構築する場合は、フレキシブルディスクドライブによりプログラムをフレキシブルディスクから読み出し、コンピュータシステムに転送する。   FIG. 15C shows a configuration for recording and reproducing the program on the flexible disk FD. When the program is recorded on the flexible disk FD, the moving picture encoding method or the moving picture decoding method as the program is written from the computer system Cs via the flexible disk drive. Further, when the above moving image coding method is constructed in a computer system by a program in a flexible disk, the program is read from the flexible disk by a flexible disk drive and transferred to the computer system.

なお、上記説明では、記録媒体としてフレキシブルディスクを用いて説明を行ったが、光ディスクを用いても同様に行うことができる。また、記録媒体はこれに限らず、ICカード、ROMカセット等、プログラムを記録できるものであれば同様に実施することができる。   In the above description, a flexible disk is used as the recording medium, but the same can be done using an optical disk. Further, the recording medium is not limited to this, and any recording medium such as an IC card or a ROM cassette capable of recording a program can be similarly implemented.

さらにここで、上記実施の形態で示した動画像符号化方法や動画像復号化方法の応用例とそれを用いたシステムを説明する。   Furthermore, application examples of the moving picture coding method and the moving picture decoding method shown in the above embodiment and a system using the same will be described.

図16は、コンテンツ配信サービスを実現するコンテンツ供給システムex100の全体構成を示すブロック図である。通信サービスの提供エリアを所望の大きさに分割し、各セル内にそれぞれ固定無線局である基地局ex107〜ex110が設置されている。   FIG. 16 is a block diagram showing an overall configuration of a content supply system ex100 that implements a content distribution service. The communication service providing area is divided into desired sizes, and base stations ex107 to ex110, which are fixed radio stations, are installed in each cell.

このコンテンツ供給システムex100は、例えば、インターネットex101にインターネットサービスプロバイダex102および電話網ex104、および基地局ex107〜ex110を介して、コンピュータex111、PDA(personal digital assistant)ex112、カメラex113、携帯電話ex114、カメラ付きの携帯電話ex115などの各機器が接続される。   The content supply system ex100 includes, for example, a computer ex111, a PDA (personal digital assistant) ex112, a camera ex113, a mobile phone ex114, a camera via the Internet ex101, the Internet service provider ex102, the telephone network ex104, and the base stations ex107 to ex110. Each device such as the attached mobile phone ex115 is connected.

しかし、コンテンツ供給システムex100は図16のような組合せに限定されず、いずれかを組み合わせて接続するようにしてもよい。また、固定無線局である基地局ex107〜ex110を介さずに、各機器が電話網ex104に直接接続されてもよい。   However, the content supply system ex100 is not limited to the combination as shown in FIG. 16, and any of the combinations may be connected. Further, each device may be directly connected to the telephone network ex104 without going through the base stations ex107 to ex110 which are fixed wireless stations.

カメラex113はデジタルビデオカメラ等の動画撮影が可能な機器である。また、携帯電話は、PDC(Personal Digital Communications)方式、CDMA(Code Division Multiple Access)方式、W−CDMA(Wideband-Code Division Multiple Access)方式、若しくはGSM(Global System for Mobile Communications)方式の携帯電話機、またはPHS(Personal Handyphone System)等であり、いずれでも構わない。   The camera ex113 is a device capable of shooting a moving image such as a digital video camera. The mobile phone is a PDC (Personal Digital Communications) system, a CDMA (Code Division Multiple Access) system, a W-CDMA (Wideband-Code Division Multiple Access) system, or a GSM (Global System for Mobile Communications) system mobile phone, Alternatively, PHS (Personal Handyphone System) or the like may be used.

また、ストリーミングサーバex103は、カメラex113から基地局ex109、電話網ex104を通じて接続されており、カメラex113を用いてユーザが送信する符号化処理されたデータに基づいたライブ配信等が可能になる。撮影したデータの符号化処理はカメラex113で行っても、データの送信処理をするサーバ等で行ってもよい。また、カメラex116で撮影した動画データはコンピュータex111を介してストリーミングサーバex103に送信されてもよい。カメラex116はデジタルカメラ等の静止画、動画が撮影可能な機器である。この場合、動画データの符号化はカメラex116で行ってもコンピュータex111で行ってもどちらでもよい。また、符号化処理はコンピュータex111やカメラex116が有するLSIex117において処理することになる。なお、動画像符号化・復号化用のソフトウェアをコンピュータex111等で読み取り可能な記録媒体である何らかの蓄積メディア(CD−ROM、フレキシブルディスク、ハードディスクなど)に組み込んでもよい。さらに、カメラ付きの携帯電話ex115で動画データを送信してもよい。このときの動画データは携帯電話ex115が有するLSIで符号化処理されたデータである。   In addition, the streaming server ex103 is connected from the camera ex113 through the base station ex109 and the telephone network ex104, and live distribution or the like based on the encoded data transmitted by the user using the camera ex113 becomes possible. The encoded processing of the captured data may be performed by the camera ex113 or may be performed by a server or the like that performs data transmission processing. Further, the moving image data shot by the camera ex116 may be transmitted to the streaming server ex103 via the computer ex111. The camera ex116 is a device that can shoot still images and moving images, such as a digital camera. In this case, the encoding of the moving image data may be performed by the camera ex116 or the computer ex111. The encoding process is performed in the LSI ex117 included in the computer ex111 and the camera ex116. Note that moving image encoding / decoding software may be incorporated in any storage medium (CD-ROM, flexible disk, hard disk, or the like) that is a recording medium readable by the computer ex111 or the like. Furthermore, you may transmit moving image data with the mobile telephone ex115 with a camera. The moving image data at this time is data encoded by the LSI included in the mobile phone ex115.

このコンテンツ供給システムex100では、ユーザがカメラex113、カメラex116等で撮影しているコンテンツ(例えば、音楽ライブを撮影した映像等)を上記実施の形態同様に符号化処理してストリーミングサーバex103に送信する一方で、ストリーミングサーバex103は要求のあったクライアントに対して上記コンテンツデータをストリーム配信する。クライアントとしては、上記符号化処理されたデータを復号化することが可能な、コンピュータex111、PDAex112、カメラex113、携帯電話ex114等がある。このようにすることでコンテンツ供給システムex100は、符号化されたデータをクライアントにおいて受信して再生することができ、さらにクライアントにおいてリアルタイムで受信して復号化し、再生することにより、個人放送をも実現可能になるシステムである。   In this content supply system ex100, the content (for example, video shot of music live) captured by the user with the camera ex113, camera ex116, etc. is encoded and transmitted to the streaming server ex103 as in the above embodiment. On the other hand, the streaming server ex103 distributes the content data to the requested client. Examples of the client include a computer ex111, a PDA ex112, a camera ex113, a mobile phone ex114, and the like that can decode the encoded data. In this way, the content supply system ex100 can receive and reproduce the encoded data at the client, and also realize personal broadcasting by receiving, decoding, and reproducing in real time at the client. It is a system that becomes possible.

このシステムを構成する各機器の符号化、復号化には上記各実施の形態で示した動画像符号化装置あるいは動画像復号化装置を用いるようにすればよい。   For the encoding and decoding of each device constituting this system, the moving image encoding device or the moving image decoding device described in the above embodiments may be used.

その一例として携帯電話について説明する。
図17は、上記実施の形態で説明した動画像符号化方法と動画像復号化方法を用いた携帯電話ex115を示す図である。携帯電話ex115は、基地局ex110との間で電波を送受信するためのアンテナex201、CCDカメラ等の映像、静止画を撮ることが可能なカメラ部ex203、カメラ部ex203で撮影した映像、アンテナex201で受信した映像等が復号化されたデータを表示する液晶ディスプレイ等の表示部ex202、操作キーex204群から構成される本体部、音声出力をするためのスピーカ等の音声出力部ex208、音声入力をするためのマイク等の音声入力部ex205、撮影した動画もしくは静止画のデータ、受信したメールのデータ、動画のデータもしくは静止画のデータ等、符号化されたデータまたは復号化されたデータを保存するための記録メディアex207、携帯電話ex115に記録メディアex207を装着可能とするためのスロット部ex206を有している。記録メディアex207はSDカード等のプラスチックケース内に電気的に書換えや消去が可能な不揮発性メモリであるEEPROM(Electrically Erasable and Programmable Read Only Memory)の一種であるフラッシュメモリ素子を格納したものである。
A mobile phone will be described as an example.
FIG. 17 is a diagram showing the mobile phone ex115 using the moving picture coding method and the moving picture decoding method described in the above embodiment. The mobile phone ex115 includes an antenna ex201 for transmitting and receiving radio waves to and from the base station ex110, a camera such as a CCD camera, a camera unit ex203 capable of taking a still image, a video shot by the camera unit ex203, and an antenna ex201. A display unit ex202 such as a liquid crystal display that displays data obtained by decoding received video and the like, a main body unit composed of a group of operation keys ex204, an audio output unit ex208 such as a speaker for outputting audio, and a voice input To store encoded data or decoded data such as a voice input unit ex205 such as a microphone, captured video or still image data, received mail data, video data or still image data, etc. Recording medium ex207, and slot portion ex20 for enabling the recording medium ex207 to be attached to the mobile phone ex115 The it has. The recording medium ex207 stores a flash memory element, which is a kind of EEPROM (Electrically Erasable and Programmable Read Only Memory), which is a nonvolatile memory that can be electrically rewritten and erased, in a plastic case such as an SD card.

さらに、携帯電話ex115について図18を用いて説明する。携帯電話ex115は表示部ex202及び操作キーex204を備えた本体部の各部を統括的に制御するようになされた主制御部ex311に対して、電源回路部ex310、操作入力制御部ex304、画像符号化部ex312、カメラインターフェース部ex303、LCD(Liquid Crystal Display)制御部ex302、画像復号化部ex309、多重分離部ex308、記録再生部ex307、変復調回路部ex306及び音声処理部ex305が同期バスex313を介して互いに接続されている。   Further, the cellular phone ex115 will be described with reference to FIG. The cellular phone ex115 controls the power supply circuit ex310, the operation input control unit ex304, and the image coding for the main control unit ex311 which is configured to control the respective units of the main body unit including the display unit ex202 and the operation key ex204. Unit ex312, camera interface unit ex303, LCD (Liquid Crystal Display) control unit ex302, image decoding unit ex309, demultiplexing unit ex308, recording / reproducing unit ex307, modulation / demodulation circuit unit ex306, and audio processing unit ex305 via a synchronization bus ex313 Are connected to each other.

電源回路部ex310は、ユーザの操作により終話及び電源キーがオン状態にされると、バッテリパックから各部に対して電力を供給することによりカメラ付ディジタル携帯電話ex115を動作可能な状態に起動する。   When the end call and power key are turned on by a user operation, the power supply circuit ex310 activates the camera-equipped digital mobile phone ex115 by supplying power from the battery pack to each unit. .

携帯電話ex115は、CPU、ROM及びRAM等でなる主制御部ex311の制御に基づいて、音声通話モード時に音声入力部ex205で集音した音声信号を音声処理部ex305によってディジタル音声データに変換し、これを変復調回路部ex306でスペクトラム拡散処理し、送受信回路部ex301でディジタルアナログ変換処理及び周波数変換処理を施した後にアンテナex201を介して送信する。また携帯電話機ex115は、音声通話モード時にアンテナex201で受信した受信データを増幅して周波数変換処理及びアナログディジタル変換処理を施し、変復調回路部ex306でスペクトラム逆拡散処理し、音声処理部ex305によってアナログ音声データに変換した後、これを音声出力部ex208を介して出力する。   The mobile phone ex115 converts the voice signal collected by the voice input unit ex205 in the voice call mode into digital voice data by the voice processing unit ex305 based on the control of the main control unit ex311 including a CPU, a ROM, a RAM, and the like. The modulation / demodulation circuit unit ex306 performs spread spectrum processing, and the transmission / reception circuit unit ex301 performs digital analog conversion processing and frequency conversion processing, and then transmits the result via the antenna ex201. In addition, the cellular phone ex115 amplifies the received data received by the antenna ex201 in the voice call mode, performs frequency conversion processing and analog-digital conversion processing, performs spectrum despreading processing by the modulation / demodulation circuit unit ex306, and analog audio by the voice processing unit ex305. After the data is converted, it is output via the audio output unit ex208.

さらに、データ通信モード時に電子メールを送信する場合、本体部の操作キーex204の操作によって入力された電子メールのテキストデータは操作入力制御部ex304を介して主制御部ex311に送出される。主制御部ex311は、テキストデータを変復調回路部ex306でスペクトラム拡散処理し、送受信回路部ex301でディジタルアナログ変換処理及び周波数変換処理を施した後にアンテナex201を介して基地局ex110へ送信する。   Further, when an e-mail is transmitted in the data communication mode, text data of the e-mail input by operating the operation key ex204 of the main body is sent to the main control unit ex311 via the operation input control unit ex304. The main control unit ex311 performs spread spectrum processing on the text data in the modulation / demodulation circuit unit ex306, performs digital analog conversion processing and frequency conversion processing in the transmission / reception circuit unit ex301, and then transmits the text data to the base station ex110 via the antenna ex201.

データ通信モード時に画像データを送信する場合、カメラ部ex203で撮像された画像データをカメラインターフェース部ex303を介して画像符号化部ex312に供給する。また、画像データを送信しない場合には、カメラ部ex203で撮像した画像データをカメラインターフェース部ex303及びLCD制御部ex302を介して表示部ex202に直接表示することも可能である。   When transmitting image data in the data communication mode, the image data captured by the camera unit ex203 is supplied to the image encoding unit ex312 via the camera interface unit ex303. When image data is not transmitted, the image data captured by the camera unit ex203 can be directly displayed on the display unit ex202 via the camera interface unit ex303 and the LCD control unit ex302.

画像符号化部ex312は、本願発明で説明した動画像符号化装置を備えた構成であり、カメラ部ex203から供給された画像データを上記実施の形態で示した動画像符号化装置に用いた符号化方法によって圧縮符号化することにより符号化画像データに変換し、これを多重分離部ex308に送出する。また、このとき同時に携帯電話機ex115は、カメラ部ex203で撮像中に音声入力部ex205で集音した音声を音声処理部ex305を介してディジタルの音声データとして多重分離部ex308に送出する。   The image encoding unit ex312 is configured to include the moving image encoding device described in the present invention, and the image data supplied from the camera unit ex203 is a code used in the moving image encoding device described in the above embodiment. The encoded image data is converted into encoded image data by compression encoding using the encoding method, and is sent to the demultiplexing unit ex308. At the same time, the cellular phone ex115 sends the sound collected by the audio input unit ex205 during imaging by the camera unit ex203 to the demultiplexing unit ex308 as digital audio data via the audio processing unit ex305.

多重分離部ex308は、画像符号化部ex312から供給された符号化画像データと音声処理部ex305から供給された音声データとを所定の方式で多重化し、その結果得られる多重化データを変復調回路部ex306でスペクトラム拡散処理し、送受信回路部ex301でディジタルアナログ変換処理及び周波数変換処理を施した後にアンテナex201を介して送信する。   The demultiplexing unit ex308 multiplexes the encoded image data supplied from the image encoding unit ex312 and the audio data supplied from the audio processing unit ex305 by a predetermined method, and the multiplexed data obtained as a result is a modulation / demodulation circuit unit A spectrum spread process is performed in ex306, a digital analog conversion process and a frequency conversion process are performed in the transmission / reception circuit unit ex301, and then the signal is transmitted through the antenna ex201.

データ通信モード時にホームページ等にリンクされた動画像ファイルのデータを受信する場合、アンテナex201を介して基地局ex110から受信した受信データを変復調回路部ex306でスペクトラム逆拡散処理し、その結果得られる多重化データを多重分離部ex308に送出する。   When data of a moving image file linked to a homepage or the like is received in the data communication mode, the received data received from the base station ex110 via the antenna ex201 is subjected to spectrum despreading processing by the modulation / demodulation circuit unit ex306, and the resulting multiplexing is obtained. Is sent to the demultiplexing unit ex308.

また、アンテナex201を介して受信された多重化データを復号化するには、多重分離部ex308は、多重化データを分離することにより画像データのビットストリームと音声データのビットストリームとに分け、同期バスex313を介して当該符号化画像データを画像復号化部ex309に供給すると共に当該音声データを音声処理部ex305に供給する。   In addition, in order to decode multiplexed data received via the antenna ex201, the demultiplexing unit ex308 separates the multiplexed data into a bit stream of image data and a bit stream of audio data, and synchronizes them. The encoded image data is supplied to the image decoding unit ex309 via the bus ex313 and the audio data is supplied to the audio processing unit ex305.

次に、画像復号化部ex309は、本願発明で説明した動画像復号化装置を備えた構成であり、画像データのビットストリームを上記実施の形態で示した符号化方法に対応した復号化方法で復号することにより再生動画像データを生成し、これをLCD制御部ex302を介して表示部ex202に供給し、これにより、例えばホームページにリンクされた動画像ファイルに含まれる動画データが表示される。このとき同時に音声処理部ex305は、音声データをアナログ音声データに変換した後、これを音声出力部ex208に供給し、これにより、例えばホームページにリンクされた動画像ファイルに含まる音声データが再生される。   Next, the image decoding unit ex309 is configured to include the moving image decoding apparatus described in the present invention, and a bit stream of image data is decoded by a decoding method corresponding to the encoding method described in the above embodiment. Reproduction moving image data is generated by decoding, and this is supplied to the display unit ex202 via the LCD control unit ex302, whereby, for example, moving image data included in the moving image file linked to the home page is displayed. At the same time, the audio processing unit ex305 converts the audio data into analog audio data, and then supplies the analog audio data to the audio output unit ex208. Thus, for example, the audio data included in the moving image file linked to the home page is reproduced. The

なお、上記システムの例に限られず、最近は衛星、地上波によるディジタル放送が話題となっており、図19に示すようにディジタル放送用システムにも上記実施の形態の少なくとも動画像符号化装置または動画像復号化装置のいずれかを組み込むことができる。具体的には、放送局ex409では映像情報のビットストリームが電波を介して通信または放送衛星ex410に伝送される。これを受けた放送衛星ex410は、放送用の電波を発信し、この電波を衛星放送受信設備をもつ家庭のアンテナex406で受信し、テレビ(受信機)ex401またはセットトップボックス(STB)ex407などの装置によりビットストリームを復号化してこれを再生する。また、記録媒体であるCDやDVD等の蓄積メディアex402に記録したビットストリームを読み取り、復号化する再生装置ex403にも上記実施の形態で示した動画像復号化装置を実装することが可能である。この場合、再生された映像信号はモニタex404に表示される。また、ケーブルテレビ用のケーブルex405または衛星/地上波放送のアンテナex406に接続されたセットトップボックスex407内に動画像復号化装置を実装し、これをテレビのモニタex408で再生する構成も考えられる。このときセットトップボックスではなく、テレビ内に動画像復号化装置を組み込んでも良い。また、アンテナex411を有する車ex412で衛星ex410からまたは基地局ex107等から信号を受信し、車ex412が有するカーナビゲーションex413等の表示装置に動画を再生することも可能である。   Note that the present invention is not limited to the above system, and recently, satellite and terrestrial digital broadcasting has become a hot topic. As shown in FIG. 19, the digital broadcasting system also includes at least the moving image encoding apparatus of the above embodiment or Any of the video decoding devices can be incorporated. Specifically, in the broadcasting station ex409, a bit stream of video information is transmitted to a communication or broadcasting satellite ex410 via radio waves. Receiving this, the broadcasting satellite ex410 transmits a radio wave for broadcasting, and receives the radio wave with a home antenna ex406 having a satellite broadcasting receiving facility, such as a television (receiver) ex401 or a set top box (STB) ex407. The device decodes the bitstream and reproduces it. In addition, the moving picture decoding apparatus described in the above embodiment can also be implemented in the playback apparatus ex403 that reads and decodes a bitstream recorded on a storage medium ex402 such as a CD or DVD that is a recording medium. . In this case, the reproduced video signal is displayed on the monitor ex404. A configuration is also possible in which a moving picture decoding apparatus is mounted in a set-top box ex407 connected to a cable ex405 for cable television or an antenna ex406 for satellite / terrestrial broadcasting, and this is reproduced on a monitor ex408 on the television. At this time, the moving picture decoding apparatus may be incorporated in the television instead of the set top box. It is also possible to receive a signal from the satellite ex410 or the base station ex107 by the car ex412 having the antenna ex411 and reproduce a moving image on a display device such as the car navigation ex413 that the car ex412 has.

更に、画像信号を上記実施の形態で示した動画像符号化装置で符号化し、記録媒体に記録することもできる。具体例としては、DVDディスクex421に画像信号を記録するDVDレコーダや、ハードディスクに記録するディスクレコーダなどのレコーダex420がある。更にSDカードex422に記録することもできる。レコーダex420が上記実施の形態で示した動画像復号化装置を備えていれば、DVDディスクex421やSDカードex422に記録した画像信号を再生し、モニタex408で表示することができる。   Furthermore, the image signal can be encoded by the moving image encoding apparatus shown in the above embodiment and recorded on a recording medium. As a specific example, there is a recorder ex420 such as a DVD recorder that records an image signal on a DVD disk ex421 or a disk recorder that records on a hard disk. Further, it can be recorded on the SD card ex422. If the recorder ex420 includes the moving picture decoding apparatus shown in the above embodiment, the image signal recorded on the DVD disc ex421 or the SD card ex422 can be reproduced and displayed on the monitor ex408.

なお、カーナビゲーションex413の構成は例えば図18に示す構成のうち、カメラ部ex203とカメラインターフェース部ex303、画像符号化部ex312を除いた構成が考えられ、同様なことがコンピュータex111やテレビ(受信機)ex401等でも考えられる。   For example, the configuration of the car navigation ex413 may be a configuration excluding the camera unit ex203, the camera interface unit ex303, and the image encoding unit ex312 in the configuration illustrated in FIG. 18, and the same applies to the computer ex111 and the television (receiver). ) Ex401 can also be considered.

また、上記携帯電話ex114等の端末は、符号化器・復号化器を両方持つ送受信型の端末の他に、符号化器のみの送信端末、復号化器のみの受信端末の3通りの実装形式が考えられる。   In addition to the transmission / reception type terminal having both the encoder and the decoder, the terminal such as the mobile phone ex114 has three mounting formats: a transmitting terminal having only an encoder and a receiving terminal having only a decoder. Can be considered.

このように、上記実施の形態で示した動画像符号化方法あるいは動画像復号化方法を上述したいずれの機器・システムに用いることは可能であり、そうすることで、上記実施の形態で説明した効果を得ることができる。   As described above, the moving picture encoding method or the moving picture decoding method described in the above embodiment can be used in any of the above-described devices and systems, and as a result, the above-described embodiment has been described. An effect can be obtained.

また、本発明はかかる上記実施形態に限定されるものではなく、本発明の範囲を逸脱することなく種々の変形または修正が可能である。   In addition, the present invention is not limited to the above-described embodiment, and various changes and modifications can be made without departing from the scope of the present invention.

以上のように、本発明に係る動画像符号化方法および動画像復号化方法は、例えば携帯電話、DVD装置、およびパーソナルコンピュータ等で、動画像を符号化して符号列を生成したり、生成された符号列を復号化したりするための方法として有用である。   As described above, the moving image encoding method and the moving image decoding method according to the present invention generate a code string by encoding a moving image by using, for example, a mobile phone, a DVD device, and a personal computer. This is useful as a method for decoding a coded sequence.

本発明に係る動画像符号化方法を用いた動画像符号化装置の一実施の形態の構成を示すブロック図である。It is a block diagram which shows the structure of one Embodiment of the moving image encoding apparatus using the moving image encoding method which concerns on this invention. 本発明の実施の形態におけるピクチャ番号と相対インデックスの説明図である。It is explanatory drawing of the picture number and relative index in embodiment of this invention. 本発明の実施の形態における動画像符号化装置による画像符号化信号フォーマットの概念図である。It is a conceptual diagram of the image coding signal format by the moving image coding apparatus in embodiment of this invention. 本発明の実施の形態の並べ替え用メモリにおけるピクチャの順序を示す模式図であり、(a) 入力された順序、(b) 並び替えられた順序を示す図である。It is a schematic diagram which shows the order of the picture in the memory for rearrangement of embodiment of this invention, (a) The input order, (b) It is a figure which shows the rearranged order. 本発明の実施の形態でのダイレクトモードにおける動きベクトルを示す模式図であり、(a) 対象ブロックがピクチャB7である場合、(b) 対象ブロックaがピクチャB6である場合の第一および第二の例、(c) 対象ブロックaがピクチャB6である場合の第三の例、(d) 対象ブロックaがピクチャB6である場合の第四の例を示す図である。It is a schematic diagram which shows the motion vector in direct mode in embodiment of this invention, (a) When the object block is picture B7, (b) The 1st and 2nd when object block a is picture B6 (C) A third example when the target block a is a picture B6, and (d) a fourth example when the target block a is a picture B6. 本発明の実施の形態でのダイレクトモードにおける動きベクトルを示す模式図であり、(a) 対象ブロックaがピクチャB6である場合の第五の例、(b) 対象ブロックaがピクチャB6である場合の第六の例、(c) 対象ブロックaがピクチャB6である場合の第七の例、(d) 対象ブロックaがピクチャB8である場合を示す図である。It is a schematic diagram which shows the motion vector in direct mode in embodiment of this invention, (a) The 5th example in case the object block a is the picture B6, (b) When the object block a is the picture B6 (C) A seventh example when the target block a is a picture B6, and (d) a case where the target block a is a picture B8. 本発明の実施の形態におけるピクチャの予測関係および順序を示す模式図であり、(a) 表示時間順で示した各ピクチャの予測関係、(b) 符号化順(符号列順)に並べ替えたピクチャ順を示す図である。It is the schematic diagram which shows the prediction relationship and order of the picture in embodiment of this invention, (a) Prediction relationship of each picture shown by display time order, (b) It rearranged in encoding order (code sequence order) It is a figure which shows a picture order. 本発明の実施の形態におけるピクチャの予測関係および順序を示す模式図であり、(a) 表示時間順で示した各ピクチャの予測関係、(b) 符号化順(符号列順)に並べ替えたピクチャ順を示す図である。It is the schematic diagram which shows the prediction relationship and order of the picture in embodiment of this invention, (a) Prediction relationship of each picture shown by display time order, (b) It rearranged in encoding order (code sequence order) It is a figure which shows a picture order. 本発明の実施の形態におけるピクチャの予測関係および順序を示す模式図であり、(a) 表示時間順で示した各ピクチャの予測関係、(b) 符号化順(符号列順)に並べ替えたピクチャ順を示す図である。It is a schematic diagram showing the prediction relationship and order of pictures in the embodiment of the present invention, (a) prediction relationship of each picture shown in display time order, (b) rearranged in coding order (code string order) It is a figure which shows a picture order. 本発明の実施の形態の図4に示すピクチャ予測構造を階層的に示す模式図である。FIG. 5 is a schematic diagram hierarchically showing a picture prediction structure shown in FIG. 4 according to the embodiment of the present invention. 本発明の実施の形態の図7に示すピクチャ予測構造を階層的に示す模式図である。FIG. 8 is a schematic diagram hierarchically showing the picture prediction structure shown in FIG. 7 according to the embodiment of the present invention. 本発明の実施の形態の図8に示すピクチャ予測構造を階層的に示す模式図である。FIG. 9 is a schematic diagram hierarchically showing a picture prediction structure shown in FIG. 8 according to the embodiment of the present invention. 本発明の実施の形態の図9に示すピクチャ予測構造を階層的に示す模式図である。FIG. 10 is a schematic diagram hierarchically showing a picture prediction structure shown in FIG. 9 according to the embodiment of the present invention. 本発明に係る動画像復号化方法を用いた動画像復号化装置の一実施の形態の構成を示すブロック図である。It is a block diagram which shows the structure of one Embodiment of the moving image decoding apparatus using the moving image decoding method which concerns on this invention. 実施の形態1の動画像符号化方法および動画像復号化方法をコンピュータシステムにより実現するためのプログラムを格納するための記録媒体についての説明図であり、(a) 記録媒体本体であるフレキシブルディスクの物理フォーマットの例を示した説明図、(b) フレキシブルディスクの正面からみた外観、断面構造、及びフレキシブルディスクを示した説明図、(c) フレキシブルディスクFDに上記プログラムの記録再生を行うための構成を示した説明図である。It is explanatory drawing about the recording medium for storing the program for implement | achieving the moving image encoding method and moving image decoding method of Embodiment 1 by a computer system, (a) Of the flexible disk which is a recording medium main body An explanatory diagram showing an example of a physical format, (b) an external view seen from the front of the flexible disk, a cross-sectional structure, and an explanatory diagram showing the flexible disk, and (c) a configuration for recording and reproducing the program on the flexible disk FD It is explanatory drawing which showed. コンテンツ配信サービスを実現するコンテンツ供給システムの全体構成を示すブロック図である。It is a block diagram which shows the whole structure of the content supply system which implement | achieves a content delivery service. 携帯電話の一例を示す概略図である。It is the schematic which shows an example of a mobile telephone. 携帯電話の内部構成を示すブロック図である。It is a block diagram which shows the internal structure of a mobile telephone. ディジタル放送用システムの全体構成を示すブロック図である。It is a block diagram which shows the whole structure of the system for digital broadcasting. 従来の動画像符号化方法におけるピクチャの予測関係および順序を示す模式図であり、(a) 各ピクチャと対応する参照ピクチャとの関係、(b) 符号化により生成された符号列の順序を示す図である。It is a schematic diagram which shows the prediction relationship and order of the picture in the conventional moving image encoding method, (a) It shows the relationship between each picture and the corresponding reference picture, (b) Shows the order of the code string produced | generated by encoding FIG. 従来の動画像符号化方法でのダイレクトモードにおける動きベクトルを示す模式図である。It is a schematic diagram which shows the motion vector in the direct mode in the conventional moving image encoding method.

符号の説明Explanation of symbols

101 並べ替え用メモリ
102 差分演算部
103 予測誤差符号化部
104 符号列生成部
105 予測誤差復号化部
106 加算演算部
107 参照ピクチャ用メモリ
108 動きベクトル検出部
109 モード選択部
110 符号化制御部
116 動きベクトル記憶部
1401 符号列解析部
1402 予測誤差復号化部
1403 モード復号部
1404 フレームメモリ制御部
1405 動き補償復号部
1406 動きベクトル記憶部
1407 フレームメモリ
1408 加算演算部
DESCRIPTION OF SYMBOLS 101 Memory for rearrangement 102 Difference calculation part 103 Prediction error encoding part 104 Code sequence generation part 105 Prediction error decoding part 106 Addition calculation part 107 Reference picture memory 108 Motion vector detection part 109 Mode selection part 110 Encoding control part 116 Motion vector storage unit 1401 Code sequence analysis unit 1402 Prediction error decoding unit 1403 Mode decoding unit 1404 Frame memory control unit 1405 Motion compensation decoding unit 1406 Motion vector storage unit 1407 Frame memory 1408 Addition operation unit

Claims (6)

動画像を構成する各ピクチャに対応する画像データを符号化して生成された符号列を復号化する動画像復号化方法であって、
復号化対象ブロックを復号化する際に、
既に復号化済みであるピクチャ内にあるブロックであって、しかも前記復号化対象ブロックと同一位置にあるブロックでもある同一位置ブロックの動きベクトルに基づいて、前記復号化対象ブロックの動きベクトルを決定し、
前記復号化対象ブロックの動きベクトルと、前記復号化対象ブロックの動きベクトルに対応する参照ピクチャを用いて、前記復号化対象ブロックをダイレクトモードで動き補償して復号化する復号化ステップを含む
ことを特徴とする動画像復号化方法。
A moving image decoding method for decoding a code string generated by encoding image data corresponding to each picture constituting a moving image,
When decoding the block to be decoded,
A motion vector of the decoding target block is determined based on a motion vector of a block in the picture that has already been decoded and that is also a block in the same position as the decoding target block. ,
Using a motion vector of the decoding target block and a reference picture corresponding to the motion vector of the decoding target block, and a decoding step of decoding by performing motion compensation on the decoding target block in direct mode. A video decoding method as a feature.
前記復号化ステップでは、
前記同一位置ブロックが、1つの動きベクトルと該1つの動きベクトルに対応する1つの後方参照ピクチャを用いて復号化されている場合には、
前記同一位置ブロックを復号化する際に用いた前記1つの動きベクトルに対して、ピクチャの表示順序を示す情報の差を用いてスケーリングすることにより、前記復号化対象ブロックをダイレクトモードで動き補償して復号化するための2つの動きベクトルを前記復号化対象ブロックに対して生成し、
前記生成された2つの動きベクトルと前記生成された2つの動きベクトルにそれぞれ対応する2つの参照ピクチャを用いて、前記復号化対象ブロックをダイレクトモードで動き補償して復号化する
ことを特徴とする請求項1に記載の動画像復号化方法。
In the decoding step,
When the same position block is decoded using one motion vector and one backward reference picture corresponding to the one motion vector,
The single motion vector used for decoding the same position block is scaled using a difference in information indicating the display order of pictures, thereby performing motion compensation on the decoding target block in the direct mode. Generating two motion vectors for the decoding target block,
Using the generated two motion vectors and the two reference pictures corresponding to the generated two motion vectors, respectively, to perform decoding by performing motion compensation on the decoding target block in the direct mode. The moving image decoding method according to claim 1.
前記復号化対象ブロックの2つの動きベクトルにそれぞれ対応する前記2つの参照ピクチャのうち、
第1の参照ピクチャは、前記同一位置ブロックを含むピクチャであり、
第2の参照ピクチャは、前記同一位置ブロックを復号化する際に用いられた1つの後方参照ピクチャであり、前記復号化対象ブロックの2つの動きベクトルを生成する際にスケーリングの対象となった動きベクトルに対応する参照ピクチャである
ことを特徴とする請求項2に記載の動画像復号化方法。
Among the two reference pictures respectively corresponding to the two motion vectors of the decoding target block,
A first reference picture is a picture including the same position block;
The second reference picture is one backward reference picture used when decoding the same position block, and the motion subjected to scaling when generating two motion vectors of the decoding target block The moving picture decoding method according to claim 2, wherein the reference picture corresponds to a vector.
ピクチャの表示順序を示す前記情報とは、前記復号化対象ブロックを含むピクチャの表示順序を示す第1情報、前記復号化対象ブロックの前記第2の参照ピクチャの表示順序を示す第2情報、および、前記同一位置ブロックを含むピクチャでもあり前記復号化対象ブロックの前記第1の参照ピクチャでもあるピクチャの表示順序を示す第3情報であり、
前記情報の差とは、第1情報と第2情報の差、第1情報と第3情報の差、および、第2情報と第3情報の差である
ことを特徴とする請求項3に記載の動画像復号化方法。
The information indicating the display order of pictures includes first information indicating a display order of pictures including the decoding target block, second information indicating a display order of the second reference picture of the decoding target block, and , Third information indicating a display order of pictures that are also pictures including the same position block and also the first reference picture of the decoding target block;
The difference in information is a difference between first information and second information, a difference between first information and third information, and a difference between second information and third information. Video decoding method.
動画像を構成する各ピクチャに対応する画像データを符号化して生成された符号列を復号化する動画像復号化装置であって、
復号化対象ブロックを復号化する際に、
既に復号化済みであるピクチャ内にあるブロックであって、しかも前記復号化対象ブロックと同一位置にあるブロックでもある同一位置ブロックの動きベクトルに基づいて、前記復号化対象ブロックの動きベクトルを決定し、
前記復号化対象ブロックの動きベクトルと、前記復号化対象ブロックの動きベクトルに対応する参照ピクチャを用いて、前記復号化対象ブロックをダイレクトモードで動き補償して復号化する復号化手段を備え、
前記復号化手段では、
前記同一位置ブロックが、1つの動きベクトルと該1つの動きベクトルに対応する1つの後方参照ピクチャを用いて復号化されている場合には、
前記同一位置ブロックを復号化する際に用いた前記1つの動きベクトルに対して、ピクチャの表示順序を示す情報の差を用いてスケーリングすることにより、前記復号化対象ブロックをダイレクトモードで動き補償して復号化するための2つの動きベクトルを前記復号化対象ブロックに対して生成し、
前記生成された2つの動きベクトルと前記生成された2つの動きベクトルにそれぞれ対応する2つの参照ピクチャを用いて、前記復号化対象ブロックをダイレクトモードで動き補償して復号化する
ことを特徴とする動画像復号化装置。
A moving image decoding apparatus for decoding a code string generated by encoding image data corresponding to each picture constituting a moving image,
When decoding the block to be decoded,
A motion vector of the block to be decoded is determined based on a motion vector of a block in a picture that has already been decoded and that is also in the same position as the block to be decoded. ,
Using a motion vector of the block to be decoded and a reference picture corresponding to the motion vector of the block to be decoded, and comprising decoding means for decoding the block to be decoded with motion compensation in a direct mode,
In the decoding means,
When the same position block is decoded using one motion vector and one backward reference picture corresponding to the one motion vector,
The single motion vector used for decoding the same position block is scaled using a difference in information indicating the display order of pictures, thereby performing motion compensation on the decoding target block in the direct mode. Generating two motion vectors for the decoding target block,
Using the generated two motion vectors and the two reference pictures corresponding to the generated two motion vectors, respectively, to perform decoding by performing motion compensation on the decoding target block in the direct mode. Video decoding device.
動画像に対応する符号列を復号化する復号化処理を行なうプログラムを格納したデータ記憶媒体であって、
前記プログラムは、コンピュータに、請求項1〜4のいずれか一項に記載の動画像復号化方法により前記復号化処理を行なわせる
ことを特徴とするデータ記憶媒体。
A data storage medium storing a program for performing a decoding process for decoding a code string corresponding to a moving image,
A data storage medium, wherein the program causes a computer to perform the decoding process by the moving image decoding method according to claim 1.
JP2006045668A 2002-03-04 2006-02-22 Motion picture coding method and motion picture decoding method Withdrawn JP2006187039A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006045668A JP2006187039A (en) 2002-03-04 2006-02-22 Motion picture coding method and motion picture decoding method

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
JP2002056919 2002-03-04
JP2002118598 2002-04-19
JP2002193027 2002-07-02
JP2006045668A JP2006187039A (en) 2002-03-04 2006-02-22 Motion picture coding method and motion picture decoding method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2003047936A Division JP2004088722A (en) 2002-03-04 2003-02-25 Motion picture encoding method and motion picture decoding method

Publications (1)

Publication Number Publication Date
JP2006187039A true JP2006187039A (en) 2006-07-13

Family

ID=36739724

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006045668A Withdrawn JP2006187039A (en) 2002-03-04 2006-02-22 Motion picture coding method and motion picture decoding method

Country Status (1)

Country Link
JP (1) JP2006187039A (en)

Similar Documents

Publication Publication Date Title
KR100948714B1 (en) Method for encoding and decoding of moving picture
JP4130783B2 (en) Motion vector encoding method and motion vector decoding method
WO2003098939A1 (en) Moving image encoding method, moving image decoding method, and data recording medium
JP4672751B2 (en) Motion vector decoding method
JP2008182770A (en) Image decoding method and image decoding device
JP2011091846A (en) Image decoding method, image decoding device, and storage medium
JP4313710B2 (en) Image encoding method and image decoding method
JP3878591B2 (en) Video encoding method and video decoding method
JP3884472B2 (en) Video encoding method and video decoding method
JP2006187039A (en) Motion picture coding method and motion picture decoding method
JP2007049746A (en) Method for encoding and decoding motion picture

Legal Events

Date Code Title Description
A761 Written withdrawal of application

Free format text: JAPANESE INTERMEDIATE CODE: A761

Effective date: 20070615