JP2018023126A - Image encoding method and image decoding method - Google Patents

Image encoding method and image decoding method Download PDF

Info

Publication number
JP2018023126A
JP2018023126A JP2017167620A JP2017167620A JP2018023126A JP 2018023126 A JP2018023126 A JP 2018023126A JP 2017167620 A JP2017167620 A JP 2017167620A JP 2017167620 A JP2017167620 A JP 2017167620A JP 2018023126 A JP2018023126 A JP 2018023126A
Authority
JP
Japan
Prior art keywords
block
motion
information
motion information
prediction
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.)
Granted
Application number
JP2017167620A
Other languages
Japanese (ja)
Other versions
JP6370977B2 (en
Inventor
太一郎 塩寺
Taiichiro Shiodera
太一郎 塩寺
沙織 浅香
Saori Asaka
沙織 浅香
昭行 谷沢
Akiyuki Tanizawa
昭行 谷沢
中條 健
Takeshi Nakajo
健 中條
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2017167620A priority Critical patent/JP6370977B2/en
Publication of JP2018023126A publication Critical patent/JP2018023126A/en
Application granted granted Critical
Publication of JP6370977B2 publication Critical patent/JP6370977B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

PROBLEM TO BE SOLVED: To provide an image encoding method improved in efficiency in encoding selected information specifying an encoded block, which assigns a movement vector to a block to be encoded.SOLUTION: The prediction section of an image encoding section comprises: a first step of selecting one or more movement reference blocks from among encoded pixel blocks having movement information; a second step of selecting, from among the movement reference blocks, one or more usable blocks that are pixel blocks having movement information candidates applied in blocks to be encoded and that have pieces of movement information different from one another; a third step of selecting one selected block from the usable blocks; a fourth step of producing a prediction image for a block to be encoded, by using movement information about the selected block; a fifth step of encoding a prediction error between the prediction image and an original image; and a sixth step of encoding selection information for specifying the selected block, with reference to a code table predetermined according to the number of usable blocks.SELECTED DRAWING: Figure 16

Description

本発明は、動画像及び静止画像のための符号化及び復号化方法に関する。   The present invention relates to an encoding and decoding method for moving images and still images.

近年、大幅に符号化効率を向上させた動画像符号化方法が、ITU-TとISO/IECとの共同で、ITU-T Rec. H.264及びISO/IEC 14496-10(以下、H.264という)として勧告されている。H.264では、予測処理、変換処理及びエントロピー符号化処理は、矩形ブロック単位(例えば、16×16画素ブロック単位、8×8画素ブロック単位等)で行われる。予測処理においては、符号化対象の矩形ブロック(符号化対象ブロック)に対して、既に符号化済みのフレーム(参照フレーム)を参照して、時間方向の予測を行う動き補償が行われる。このような動き補償では、符号化対象ブロックと参照フレーム内において参照されるブロックとの空間的シフト情報としての動きベクトルを含む動き情報を符号化して復号化側に送る必要がある。さらに、複数の参照フレームを用いて動き補償を行う場合、動き情報とともに参照フレーム番号も符号化する必要がある。このため、動き情報及び参照フレーム番号に関する符号量が増大する場合がある。   In recent years, video coding methods that have greatly improved coding efficiency have been jointly developed by ITU-T and ISO / IEC in accordance with ITU-T Rec. H.264 and ISO / IEC 14496-10 (hereinafter referred to as H.264). 264)). In H.264, prediction processing, conversion processing, and entropy encoding processing are performed in units of rectangular blocks (for example, 16 × 16 pixel block units, 8 × 8 pixel block units, etc.). In the prediction process, motion compensation is performed on a rectangular block to be encoded (encoding target block) with reference to an already encoded frame (reference frame) to perform prediction in the time direction. In such motion compensation, it is necessary to encode motion information including a motion vector as spatial shift information between an encoding target block and a block referred to in a reference frame and send the encoded motion information to the decoding side. Furthermore, when motion compensation is performed using a plurality of reference frames, it is necessary to encode a reference frame number together with motion information. For this reason, the amount of codes related to motion information and reference frame numbers may increase.

動き補償予測において動きベクトルを求める方法の一例としては、既に符号化済みのブロックに割り当てられている動きベクトルから、符号化対象ブロックに割り当てるべき動きベクトルを導出し、導出した動きベクトルに基づいて予測画像を生成するダイレクトモードがある(特許文献1及び特許文献2参照)。ダイレクトモードでは、動きベクトルを符号化しないことから、動き情報の符号量を低減することができる。ダイレクトモードは、例えばH.264/AVCに採用されている。   As an example of a method for obtaining a motion vector in motion compensated prediction, a motion vector to be assigned to an encoding target block is derived from a motion vector assigned to an already encoded block, and prediction is performed based on the derived motion vector. There is a direct mode for generating an image (see Patent Document 1 and Patent Document 2). In the direct mode, since the motion vector is not encoded, the code amount of the motion information can be reduced. The direct mode is adopted in H.264 / AVC, for example.

特許第4020789号Patent No. 4020789 米国特許第7233621号US Pat. No. 7,233,621

ダイレクトモードでは、符号化対象ブロックに隣接する符号化済みのブロックの動きベクトルのメディアン値から動きベクトルを算出するという固定された方法で、符号化対象ブロックの動きベクトルを予測生成する。このため、動きベクトル算出の自由度が低い。   In the direct mode, the motion vector of the encoding target block is predicted and generated by a fixed method of calculating the motion vector from the median value of the motion vector of the encoded block adjacent to the encoding target block. For this reason, the freedom degree of motion vector calculation is low.

動きベクトル算出の自由度を上げるために、複数の符号化済みブロックの中から1つを選択して符号化対象ブロックに動きベクトルを割り当てる方法が提案されている。この方法では、選択した符号化済みのブロックを復号側が特定することができるように、選択したブロックを特定する選択情報が常に送信されなければならない。従って、複数の符号化済みブロックの中から1つを選択して符号化対象ブロックに割り当てるべき動きベクトルを決定する場合、選択情報に関する符号量が増加される問題がある。   In order to increase the degree of freedom of motion vector calculation, a method has been proposed in which one of a plurality of encoded blocks is selected and a motion vector is assigned to the encoding target block. In this method, selection information for identifying the selected block must always be transmitted so that the decoding side can identify the selected encoded block. Accordingly, when one of a plurality of encoded blocks is selected and a motion vector to be assigned to the encoding target block is determined, there is a problem that the amount of code related to the selection information is increased.

本発明は、上記問題点を解決するためになされたものであり、符号化効率の高い画像符号化及び画像復号化方法を提供することを目的とする。   The present invention has been made to solve the above problems, and an object thereof is to provide an image encoding and image decoding method with high encoding efficiency.

本発明の一実施形態に係る画像符号化方法は、動き情報を有する符号化済みの画素ブロックの中から、少なくとも1つの動き参照ブロックを選択する第1ステップと、符号化対象ブロックに適用する動き情報の候補を有する画素ブロックであって、互いに異なる動き情報を有する少なくとも1つの利用可能ブロックを、前記動き参照ブロックの中から選択する第2ステップと、前記利用可能ブロックの中から、1つの選択ブロックを選択する第3ステップと、前記選択ブロックの動き情報を使用して、前記符号化対象ブロックの予測画像を生成する第4ステップと、前記予測画像と原画像との間の予測誤差を符号化する第5ステップと、前記利用可能ブロックの数に応じて予め定められた符号表を参照して、前記選択ブロックを特定する選択情報を符号化する第6ステップと、を具備する。   An image encoding method according to an embodiment of the present invention includes a first step of selecting at least one motion reference block from among encoded pixel blocks having motion information, and motion to be applied to an encoding target block. A second step of selecting, from among the motion reference blocks, at least one usable block having pixel information and having different motion information, and selecting one of the available blocks A third step of selecting a block, a fourth step of generating a predicted image of the target block using the motion information of the selected block, and encoding a prediction error between the predicted image and the original image 5th step to be converted, and a selection that identifies the selected block with reference to a code table that is predetermined according to the number of available blocks Comprising a sixth step of encoding the broadcast, the.

本発明の他の実施形態に係る画像復号化方法は、動き情報を有する復号化済みの画素ブロックの中から、少なくとも1つの動き参照ブロックを選択する第1ステップと、復号化対象ブロックに適用する動き情報の候補を有する画素ブロックであって、互いに異なる動き情報を有する少なくとも1つの利用可能ブロックを、前記動き参照ブロックの中から選択する第2ステップと、前記利用可能ブロックの数に応じて予め定められた符号表を参照して、入力された符号化データを復号化することにより、選択ブロックを特定するための選択情報を求める第3ステップと、前記選択情報に従って、前記利用可能ブロックの中から1つの選択ブロックを選択する第4ステップと、前記選択ブロックの動き情報を使用して、前記復号化対象ブロックの予測画像を生成する第5ステップと、前記符号化データから前記復号化対象ブロックの予測残差を復号化する第6ステップと、前記予測画像と前記予測残差から復号画像を求める第7ステップと、を具備する。   An image decoding method according to another embodiment of the present invention is applied to a decoding target block and a first step of selecting at least one motion reference block from among decoded pixel blocks having motion information. A second step of selecting at least one usable block having motion information candidates and having different motion information from among the motion reference blocks, and in advance according to the number of usable blocks A third step of obtaining selection information for specifying the selected block by decoding the input encoded data with reference to a predetermined code table, and according to the selection information, 4th step of selecting one selected block from the above, and using the motion information of the selected block, A fifth step of generating a measured image; a sixth step of decoding a prediction residual of the decoding target block from the encoded data; a seventh step of obtaining a decoded image from the prediction image and the prediction residual; Are provided.

本発明によれば、符号化効率を向上させることができる。   According to the present invention, encoding efficiency can be improved.

第1の実施形態に係る画像符号化装置の構成を概略的に示すブロック図である。It is a block diagram which shows roughly the structure of the image coding apparatus which concerns on 1st Embodiment. 図1に示した画像復号化部の符号化の処理単位であるマクロブロックのサイズの一例を示す図である。It is a figure which shows an example of the size of the macroblock which is a process unit of the encoding of the image decoding part shown in FIG. 図1に示した画像復号化部の符号化の処理単位であるマクロブロックのサイズの他の例を示す図である。It is a figure which shows the other example of the size of the macroblock which is a process unit of the encoding of the image decoding part shown in FIG. 図1に示した画像符号化部が符号化対象フレーム内の画素ブロックを符号化する順序を示す図である。It is a figure which shows the order in which the image encoding part shown in FIG. 1 encodes the pixel block in an encoding object frame. 図1に示した動き情報メモリが保持する動き情報フレームの一例を示す図である。It is a figure which shows an example of the motion information frame which the motion information memory shown in FIG. 1 hold | maintains. 図1の入力画像信号を処理する手順の一例を示すフローチャートである。It is a flowchart which shows an example of the procedure which processes the input image signal of FIG. 図1の動き補償部が実行するインター予測処理の一例を示す図である。It is a figure which shows an example of the inter prediction process which the motion compensation part of FIG. 1 performs. 図1の動き補償部が実行するインター予測処理の他の例を示す図である。It is a figure which shows the other example of the inter prediction process which the motion compensation part of FIG. 1 performs. インター予測処理に使用される動き補償ブロックのサイズの一例を示す図である。It is a figure which shows an example of the size of the motion compensation block used for the inter prediction process. インター予測処理に使用される動き補償ブロックのサイズの他の例を示す図である。It is a figure which shows the other example of the size of the motion compensation block used for the inter prediction process. インター予測処理に使用される動き補償ブロックのサイズのさらに他の例を示す図である。It is a figure which shows the further another example of the size of the motion compensation block used for the inter prediction process. インター予測処理に使用される動き補償ブロックのサイズの他の例を示す図である。It is a figure which shows the other example of the size of the motion compensation block used for the inter prediction process. 空間方向及び時間方向動き参照ブロックの配置の一例を示す図である。It is a figure which shows an example of arrangement | positioning of a space direction and a time direction motion reference block. 空間方向動き参照ブロックの配置の他の例を示す図である。It is a figure which shows the other example of arrangement | positioning of a spatial direction motion reference block. 図8Bに示した符号化対象ブロックに対する空間方向動き参照ブロックの相対位置を示す図である。It is a figure which shows the relative position of the spatial direction motion reference block with respect to the encoding object block shown to FIG. 8B. 時間方向動き参照ブロックの配置の他の例を示す図である。It is a figure which shows the other example of arrangement | positioning of a time direction motion reference block. 時間方向動き参照ブロックの配置のさらに他の例を示す図である。It is a figure which shows the further another example of arrangement | positioning of a time direction motion reference block. 時間方向動き参照ブロックの配置のさらにまた他の例を示す図である。It is a figure which shows the further another example of arrangement | positioning of a time direction motion reference block. 図1の利用可能ブロック取得部が動き参照ブロックの中から利用可能ブロックを選択する方法の一例を示すフローチャートである。It is a flowchart which shows an example of the method in which the available block acquisition part of FIG. 1 selects an available block from a motion reference block. 図8に示した動き参照ブロックの中から、図9の方法に従って選択された利用可能ブロックの一例を示す図である。FIG. 10 is a diagram illustrating an example of an available block selected from the motion reference blocks illustrated in FIG. 8 according to the method of FIG. 9. 図1の利用可能ブロック取得部が出力する利用可能ブロック情報の一例を示す図である。It is a figure which shows an example of the available block information which the available block acquisition part of FIG. 1 outputs. 図1の利用可能ブロック取得部によるブロック間の動き情報の同一性判定の一例を示す図である。It is a figure which shows an example of the identity determination of the motion information between blocks by the available block acquisition part of FIG. 図1の利用可能ブロック取得部によるブロック間の動き情報の同一性判定の他の例を示す図である。It is a figure which shows the other example of the identity determination of the motion information between the blocks by the available block acquisition part of FIG. 図1の利用可能ブロック取得部によるブロック間の動き情報の同一性判定のさらに他の例を示す図である。It is a figure which shows the further another example of the identity determination of the motion information between blocks by the available block acquisition part of FIG. 図1の利用可能ブロック取得部によるブロック間の動き情報の同一性判定の他の例を示す図である。It is a figure which shows the other example of the identity determination of the motion information between the blocks by the available block acquisition part of FIG. 図1の利用可能ブロック取得部によるブロック間の動き情報の同一性判定のさらに他の例を示す図である。It is a figure which shows the further another example of the identity determination of the motion information between blocks by the available block acquisition part of FIG. 図1の利用可能ブロック取得部によるブロック間の動き情報の同一性判定の他の例を示す図である。It is a figure which shows the other example of the identity determination of the motion information between the blocks by the available block acquisition part of FIG. 図1の予測部の構成を概略的に示すブロック図である。It is a block diagram which shows schematically the structure of the estimation part of FIG. 図13の時間方向動き情報取得部が出力する動き情報の群を示す図である。It is a figure which shows the group of the motion information which the time direction motion information acquisition part of FIG. 13 outputs. 図13の動き補償部による動き補償処理において利用可能な少数画素精度の補間処理を説明する説明図である。It is explanatory drawing explaining the interpolation process of the minority pixel precision which can be utilized in the motion compensation process by the motion compensation part of FIG. 図13の予測部の動作の一例を示すフローチャートである。It is a flowchart which shows an example of operation | movement of the estimation part of FIG. 図13の動き補償部が時間方向動き参照ブロックの動き情報を符号化対象ブロックにコピーする様子を示す図である。It is a figure which shows a mode that the motion compensation part of FIG. 13 copies the motion information of a time direction motion reference block to an encoding object block. 図1の可変長符号化部の構成を概略的に示すブロック図である。FIG. 2 is a block diagram schematically showing a configuration of a variable length coding unit in FIG. 1. 利用可能ブロック情報に応じてシンタクスを生成する例を示す図である。It is a figure which shows the example which produces | generates syntax according to usable block information. 利用可能ブロック情報に対応する選択ブロック情報シンタクスの2値化の例を示す図である。It is a figure which shows the example of the binarization of the selection block information syntax corresponding to usable block information. 動き情報のスケーリングを説明する説明図である。It is explanatory drawing explaining scaling of motion information. 実施形態に従うシンタクス構造を示す図である。It is a figure which shows the syntax structure according to embodiment. 第1の実施形態に従うマクロブロックレイヤーシンクタスの一例を示す図である。It is a figure which shows an example of the macroblock layer synchronization according to 1st Embodiment. 第1の実施形態に従うマクロブロックレイヤーシンクタスの他の例を示す図である。It is a figure which shows the other example of the macroblock layer synchronization according to 1st Embodiment. H.264におけるBスライス時のmb_type及びmb_typeに対応する符号表を示す図である。H. 2 is a diagram illustrating a code table corresponding to mb_type and mb_type at the time of B slice in H.264. 実施形態に係る符号表の一例を示す図である。It is a figure which shows an example of the code table which concerns on embodiment. H.264におけるPスライス時のmb_type及びmb_typeに対応する符号表を示す図である。H. 2 is a diagram illustrating a code table corresponding to mb_type and mb_type at the time of P slice in H.264. 実施形態に係る符号表の他の例を示す図である。It is a figure which shows the other example of the code table which concerns on embodiment. 実施形態に従って、Bスライスにおけるmb_type及びmb_typeに対応する符号表の一例を示す図である。It is a figure which shows an example of the code table corresponding to mb_type and mb_type in B slice according to embodiment. 実施形態に従って、Pスライスにおけるmb_type及びmb_typeに対応する符号表の他の例を示す図である。It is a figure which shows the other example of the code table corresponding to mb_type and mb_type in P slice according to embodiment. 第2の実施形態に係る画像符号化装置の構成を概略的に示すブロック図である。It is a block diagram which shows roughly the structure of the image coding apparatus which concerns on 2nd Embodiment. 図26の予測部の構成を概略的に示すブロック図である。FIG. 27 is a block diagram schematically showing a configuration of a prediction unit in FIG. 26. 図27の第2予測部の構成を概略的に示すブロック図である。It is a block diagram which shows roughly the structure of the 2nd estimation part of FIG. 図26の可変長符号化部の構成を概略的に示すブロック図である。FIG. 27 is a block diagram schematically showing a configuration of a variable length coding unit in FIG. 26. 第2の実施形態に従うマクロブロックレイヤーシンタクスの一例を示す図である。It is a figure which shows an example of the macroblock layer syntax according to 2nd Embodiment. 第2の実施形態に従うマクロブロックレイヤーシンタクスの他の例を示す図である。It is a figure which shows the other example of the macroblock layer syntax according to 2nd Embodiment. 第3の実施形態に係る画像復号化装置を概略的に示すブロック図である。It is a block diagram which shows roughly the image decoding apparatus which concerns on 3rd Embodiment. 図31に示した符号化列復号化部をより詳細に示すブロック図である。FIG. 32 is a block diagram showing in more detail the encoded sequence decoding unit shown in FIG. 31. 図31に示した予測部をより詳細に示すブロック図である。FIG. 32 is a block diagram showing the prediction unit shown in FIG. 31 in more detail. 第4の実施形態に係る画像復号化装置を概略的に示すブロック図である。It is a block diagram which shows roughly the image decoding apparatus which concerns on 4th Embodiment. 図33に示した符号化列復号化部をより詳細に示すブロック図である。FIG. 34 is a block diagram illustrating in more detail the encoded string decoding unit illustrated in FIG. 33. 図33に示した予測部をより詳細に示すブロック図である。It is a block diagram which shows the prediction part shown in FIG. 33 in detail.

以下、必要に応じて図面を参照しながら、本発明の実施形態に係る画像符号化及び画像復号化の方法及び装置を説明する。なお、以下の実施形態では、同一の番号を付した部分については同様の動作を行うものとして、重ねての説明を省略する。   Hereinafter, an image encoding and image decoding method and apparatus according to an embodiment of the present invention will be described with reference to the drawings as necessary. Note that, in the following embodiments, the same numbered portions are assumed to perform the same operation, and repeated description is omitted.

(第1の実施形態)
図1は、本発明の第1の実施形態に係る画像符号化装置の構成を概略的に示している。この画像符号化装置は、図1に示されるように、画像符号化部100、符号化制御部150及び出力バッファ120を備えている。この画像符号化装置は、LSIチップなどのハードウェアにより実現されてもよく、或いは、コンピュータに画像符号化プログラムを実行させることにより実現されても構わない。
(First embodiment)
FIG. 1 schematically shows the configuration of an image coding apparatus according to the first embodiment of the present invention. As shown in FIG. 1, the image encoding device includes an image encoding unit 100, an encoding control unit 150, and an output buffer 120. This image encoding apparatus may be realized by hardware such as an LSI chip, or may be realized by causing a computer to execute an image encoding program.

画像符号化部100には、動画像又は静止画像である原画像(入力画像信号)10が、例えば原画像を分割した画素ブロック単位で、入力される。画像符号化部100は、後に詳細に説明するように、入力画像信号10を圧縮符号化して、符号化データ14を生成する。生成された符号化データ14は、出力バッファ120に一時的に格納され、符号化制御部150が管理する出力タイミングで、図示しない蓄積系(蓄積メディア)又は伝送系(通信回線)へ送出される。   An original image (input image signal) 10 that is a moving image or a still image is input to the image encoding unit 100, for example, in units of pixel blocks obtained by dividing the original image. As will be described in detail later, the image encoding unit 100 compresses and encodes the input image signal 10 to generate encoded data 14. The generated encoded data 14 is temporarily stored in the output buffer 120 and sent to a storage system (storage medium) or a transmission system (communication line) (not shown) at an output timing managed by the encoding control unit 150. .

符号化制御部150は、発生符号量のフィードバック制御、量子化制御、予測モード制御及びエントロピー符号化制御といった画像符号化部100の符号化処理全般を制御する。具体的には、符号化制御部150は、符号化制御情報50を画像符号化部100に与え、画像符号化部100からフィードバック情報51を適宜受け取る。符号化制御情報50には、予測情報、動き情報18及び量子化パラメータ情報などが含まれる。予測情報は、予測モード情報及びブロックサイズ情報を含む。動き情報18は、動きベクトル、参照フレーム番号及び予測方向(単方向予測、双方向予測)を含む。量子化パラメータ情報は、量子化幅(量子化ステップサイズ)等の量子化パラメータ及び量子化マトリクスを含む。フィードバック情報51は、画像符号化部100による発生符号量を含み、例えば、量子化パラメータを決定するのに使用される。   The encoding control unit 150 controls overall encoding processing of the image encoding unit 100 such as feedback control of generated code amount, quantization control, prediction mode control, and entropy encoding control. Specifically, the encoding control unit 150 provides the encoding control information 50 to the image encoding unit 100 and receives the feedback information 51 from the image encoding unit 100 as appropriate. The encoding control information 50 includes prediction information, motion information 18 and quantization parameter information. The prediction information includes prediction mode information and block size information. The motion information 18 includes a motion vector, a reference frame number, and a prediction direction (unidirectional prediction, bidirectional prediction). The quantization parameter information includes a quantization parameter such as a quantization width (quantization step size) and a quantization matrix. The feedback information 51 includes the amount of code generated by the image encoding unit 100, and is used, for example, to determine a quantization parameter.

画像符号化部100は、原画像を分割した画素ブロック(例えば、マクロブロック、サブブロック、1画素など)を単位として、入力画像信号10を符号化する。このため、入力画像信号10は、原画像を分割した画素ブロック単位で画像符号化部100へ順次に入力される。本実施形態では、符号化の処理単位をマクロブロックとし、入力画像信号10に対応する、符号化対象である画素ブロック(マクロブロック)を単に符号化対象ブロックと称す。また、符号化対象ブロックを含む画像フレーム、即ち、符号化対象の画像フレームを符号化対象フレームと称す。   The image encoding unit 100 encodes the input image signal 10 in units of pixel blocks obtained by dividing the original image (for example, macroblocks, sub-blocks, 1 pixel, etc.). For this reason, the input image signal 10 is sequentially input to the image encoding unit 100 in units of pixel blocks obtained by dividing the original image. In this embodiment, the encoding processing unit is a macro block, and a pixel block (macro block) that is an encoding target and corresponds to the input image signal 10 is simply referred to as an encoding target block. Also, an image frame including an encoding target block, that is, an encoding target image frame is referred to as an encoding target frame.

このような符号化対象ブロックは、例えば、図2Aに示すような16×16画素ブロックであってもよく、図2Bに示すような64×64画素ブロックであっても構わない。また、符号化対象ブロックは、32×32画素ブロック、8×8画素ブロックなどであっても構わない。また、マクロブロックの形状は、図2A及び図2Bに示されるような正方形状の例に限らず、矩形状などの任意形状に設定されても構わない。さらに、上記処理単位は、マクロブロックのような画素ブロックに限らず、フレーム又はフィールドであっても構わない。   Such an encoding target block may be, for example, a 16 × 16 pixel block as shown in FIG. 2A or a 64 × 64 pixel block as shown in FIG. 2B. The encoding target block may be a 32 × 32 pixel block, an 8 × 8 pixel block, or the like. The shape of the macroblock is not limited to the square shape as shown in FIGS. 2A and 2B, and may be set to an arbitrary shape such as a rectangular shape. Furthermore, the processing unit is not limited to a pixel block such as a macroblock, and may be a frame or a field.

なお、符号化対象フレーム内の各画素ブロックに対する符号化処理は、いかなる順序で実行されても構わない。本実施形態では、説明を簡単にするために、図3に示すように、符号化対象フレームの左上の画素ブロックから右下の画素ブロックに向かって一行毎に、即ち、ラスタスキャン順に、画素ブロックに対して符号化処理が実行されるものとする。   The encoding process for each pixel block in the encoding target frame may be executed in any order. In the present embodiment, in order to simplify the description, as shown in FIG. 3, the pixel blocks are arranged row by row from the upper left pixel block of the encoding target frame to the lower right pixel block, that is, in raster scan order. It is assumed that the encoding process is performed on

図1に示した画像符号化部100は、予測部101、減算器102、変換・量子化部103、可変長符号化部104、逆量子化・逆変換部105、加算器106、フレームメモリ107、動き情報メモリ108及び利用可能ブロック取得部109を備えている。   1 includes a prediction unit 101, a subtracter 102, a transform / quantization unit 103, a variable length coding unit 104, an inverse quantization / inverse transform unit 105, an adder 106, and a frame memory 107. A motion information memory 108 and an available block acquisition unit 109.

画像符号化部100において、入力画像信号10は、予測部101及び減算器102へ入力される。減算器102は、入力画像信号10を受け取るとともに、後述する予測部101から予測画像信号11を受け取る。減算器102は、入力画像信号10と予測画像信号11との差分を算出して、予測誤差画像信号12を生成する。   In the image encoding unit 100, the input image signal 10 is input to the prediction unit 101 and the subtracter 102. The subtracter 102 receives the input image signal 10 and also receives the predicted image signal 11 from the prediction unit 101 described later. The subtractor 102 calculates a difference between the input image signal 10 and the predicted image signal 11 and generates a prediction error image signal 12.

変換・量子化部103は、減算器102から予測誤差画像信号12を受け取り、受け取った予測誤差画像信号12に対して変換処理を施して、変換係数を生成する。変換処理は、例えば、離散コサイン変換(DCT:Discrete Cosine Transform)等の直交変換である。他の実施形態では、変換・量子化部103は、離散コサイン変換に代えて、ウェーブレット変換及び独立成分解析などの手法を利用して、変換係数を生成しても構わない。さらに、変換・量子化部103は、符号化制御部150によって与えられた量子化パラメータに基づいて、生成した変換係数を量子化する。量子化された変換係数(変換係数情報)13は、可変長符号化部104及び逆量子化・逆変換部105へ出力される。   The transform / quantization unit 103 receives the prediction error image signal 12 from the subtractor 102, performs a conversion process on the received prediction error image signal 12, and generates a transform coefficient. The transform process is, for example, an orthogonal transform such as a discrete cosine transform (DCT). In another embodiment, the transform / quantization unit 103 may generate transform coefficients using a technique such as wavelet transform and independent component analysis instead of the discrete cosine transform. Further, the transform / quantization unit 103 quantizes the generated transform coefficient based on the quantization parameter given by the encoding control unit 150. The quantized transform coefficient (transform coefficient information) 13 is output to the variable length coding unit 104 and the inverse quantization / inverse transform unit 105.

逆量子化・逆変換部105は、符号化制御部150によって与えられた量子化パラメータ、即ち、変換・量子化部103と同じ量子化パラメータに従って、量子化された変換係数13を逆量子化する。続いて、逆量子化・逆変換部105は、逆量子化された変換係数に対して逆変換を施して、復号予測誤差信号15を生成する。逆量子化・逆変換部105による逆変換処理は、変換・量子化部103による変換処理の逆変換処理に一致する。例えば、逆変換処理は、逆離散コサイン変換(IDCT:Inverse Discrete Cosine Transform)又は逆ウェーブレット変換などである。   The inverse quantization / inverse transform unit 105 inversely quantizes the quantized transform coefficient 13 according to the quantization parameter given by the encoding control unit 150, that is, the same quantization parameter as the transform / quantization unit 103. . Subsequently, the inverse quantization / inverse transform unit 105 performs inverse transform on the inversely quantized transform coefficient to generate a decoded prediction error signal 15. The inverse transformation process by the inverse quantization / inverse transformation unit 105 matches the inverse transformation process of the transformation process by the transformation / quantization unit 103. For example, the inverse transform process is an inverse discrete cosine transform (IDCT) or an inverse wavelet transform.

加算器106は、逆量子化・逆変換部105から復号予測誤差信号15を受け取り、さらに、予測部101から予測画像信号11を受け取る。加算器106は、復号予測誤差信号15と予測画像信号11とを加算して、局所復号画像信号16を生成する。生成された局所復号画像信号16は、フレームメモリ107に参照画像信号17として格納される。フレームメモリ107に格納されている参照画像信号17は、その後の符号化対象ブロックを符号化する際に、予測部101によって読み出されて参照される。   The adder 106 receives the decoded prediction error signal 15 from the inverse quantization / inverse transform unit 105, and further receives the predicted image signal 11 from the prediction unit 101. The adder 106 adds the decoded prediction error signal 15 and the predicted image signal 11 to generate a local decoded image signal 16. The generated local decoded image signal 16 is stored as a reference image signal 17 in the frame memory 107. The reference image signal 17 stored in the frame memory 107 is read and referred to by the prediction unit 101 when a subsequent encoding target block is encoded.

予測部101は、フレームメモリ107から参照画像信号17を受け取るとともに、後述する利用可能ブロック取得部109から利用可能ブロック情報30を受け取る。さらに、予測部101は、後述する動き情報メモリ108から参照動き情報19を受け取る。予測部101は、参照画像信号17、参照動き情報19及び利用可能ブロック情報30に基づいて、符号化対象ブロックの予測画像信号11、動き情報18及び選択ブロック情報31を生成する。具体的には、予測部101は、利用可能ブロック情報30及び参照動き情報19に基づいて、動き情報18及び選択ブロック情報31を生成する動き情報選択部118、並びに、動き情報18に基づいて、予測画像信号11を生成する動き補償部113を備えている。予測画像信号11は、減算器102及び加算器106へ送られる。動き情報18は、その後の符号化対象ブロックに対する予測処理のために、動き情報メモリ108に格納される。また、選択ブロック情報31は、可変長符号化部104へ送られる。予測部101については、後に詳細に説明する。   The prediction unit 101 receives the reference image signal 17 from the frame memory 107 and also receives available block information 30 from an available block acquisition unit 109 described later. Further, the prediction unit 101 receives reference motion information 19 from a motion information memory 108 described later. The prediction unit 101 generates the prediction image signal 11, the motion information 18, and the selected block information 31 of the encoding target block based on the reference image signal 17, the reference motion information 19, and the available block information 30. Specifically, the prediction unit 101 generates motion information 18 and selected block information 31 based on the available block information 30 and the reference motion information 19, and based on the motion information 18. A motion compensation unit 113 that generates the predicted image signal 11 is provided. The predicted image signal 11 is sent to the subtracter 102 and the adder 106. The motion information 18 is stored in the motion information memory 108 for subsequent prediction processing on the current block. The selected block information 31 is sent to the variable length coding unit 104. The prediction unit 101 will be described in detail later.

動き情報メモリ108には、動き情報18が参照動き情報19として一時的に格納される。図4には、動き情報メモリ108の構成の一例が示されている。図4に示されるように、動き情報メモリ108には、参照動き情報19がフレーム単位で保持されており、参照動き情報19が動き情報フレーム25を形成している。動き情報メモリ108には、符号化済みのブロックに関する動き情報18が順次入力され、その結果、動き情報メモリ108は、符号化時間の異なる複数の動き情報フレーム25を保持する。   In the motion information memory 108, motion information 18 is temporarily stored as reference motion information 19. FIG. 4 shows an example of the configuration of the motion information memory 108. As shown in FIG. 4, the motion information memory 108 stores reference motion information 19 in units of frames, and the reference motion information 19 forms a motion information frame 25. The motion information memory 108 sequentially receives motion information 18 relating to encoded blocks, and as a result, the motion information memory 108 holds a plurality of motion information frames 25 having different encoding times.

参照動き情報19は、所定のブロック単位(例えば、4×4画素ブロック単位)で動き情報フレーム25内に保持される。図4に示す動きベクトルブロック28は、符号化対象ブロック、利用可能ブロック及び選択ブロックなどと同じサイズの画素ブロックを示し、例えば、16×16画素ブロックである。動きベクトルブロック28には、例えば4×4画素ブロック毎に、動きベクトルが割り当てられている。動きベクトルブロックを利用したインター予測処理を、動きベクトルブロック予測処理と称する。動き情報メモリ108が保持する参照動き情報19は、予測部101によって、動き情報18を生成する際に読み出される。後述するような利用可能ブロックが有する動き情報18とは、動き情報メモリ108中の利用可能ブロックが位置する領域に保持された参照動き情報19を指す。   The reference motion information 19 is held in the motion information frame 25 in predetermined block units (for example, 4 × 4 pixel block units). The motion vector block 28 illustrated in FIG. 4 indicates a pixel block having the same size as the encoding target block, the usable block, the selection block, and the like, and is, for example, a 16 × 16 pixel block. For example, a motion vector is assigned to the motion vector block 28 for each 4 × 4 pixel block. Inter prediction processing using motion vector blocks is referred to as motion vector block prediction processing. The reference motion information 19 held in the motion information memory 108 is read by the prediction unit 101 when the motion information 18 is generated. The motion information 18 included in the available block as described later refers to the reference motion information 19 held in the area where the available block in the motion information memory 108 is located.

なお、動き情報メモリ108は、4×4画素ブロック単位で参照動き情報19を保持する例に限らず、他の画素ブロック単位で参照動き情報19を保持しても構わない。例えば、参照動き情報19に関する画素ブロック単位は、1画素であってもよく、2×2画素ブロックであっても構わない。また、参照動き情報19に関する画素ブロックの形状は、正方形状の例に限らず、任意形状とすることができる。   Note that the motion information memory 108 is not limited to the example in which the reference motion information 19 is stored in units of 4 × 4 pixel blocks, and the motion information memory 108 may store the reference motion information 19 in units of other pixel blocks. For example, the pixel block unit related to the reference motion information 19 may be one pixel or a 2 × 2 pixel block. In addition, the shape of the pixel block related to the reference motion information 19 is not limited to a square shape, and may be an arbitrary shape.

図1の利用可能ブロック取得部109は、動き情報メモリ108から参照動き情報19を取得し、取得した参照動き情報19に基づいて、既に符号化が完了している複数のブロックから、予測部101の予測処理に利用することができる利用可能ブロックを選択する。選択された利用可能ブロックは、利用可能ブロック情報30として予測部101及び可変長符号化部104へ送られる。利用可能ブロックを選択するための候補となる符号化済みのブロックを、動き参照ブロックと称す。動き参照ブロック及び利用可能ブロックの選択方法については、後に詳細に説明する。   The available block acquisition unit 109 in FIG. 1 acquires the reference motion information 19 from the motion information memory 108, and based on the acquired reference motion information 19, from the plurality of blocks that have already been encoded, the prediction unit 101 An available block that can be used for the prediction process is selected. The selected available block is sent to the prediction unit 101 and the variable length coding unit 104 as available block information 30. A coded block that is a candidate for selecting an available block is referred to as a motion reference block. A method for selecting a motion reference block and an available block will be described in detail later.

可変長符号化部104は、変換係数情報13に加えて、予測部101から選択ブロック情報31を、符号化制御部150から予測情報及び量子化パラメータなどの符号化パラメータを、利用可能ブロック取得部109から利用可能ブロック情報30を受け取る。可変長符号化部104は、量子化された変換係数13、選択ブロック情報31、利用可能ブロック情報30及び符号化パラメータをエントロピー符号化(例えば、等長符号化、ハフマン符号化又は算術符号化など)して、符号化データ14を生成する。符号化パラメータは、選択ブロック情報31及び予測情報とともに、変換係数に関する情報、量子化に関する情報などの復号の際に必要になるあらゆるパラメータを含む。生成された符号化データ14は、出力バッファ120に一時的に格納され、図示しない蓄積系又は伝送系へ送出される。   In addition to the transform coefficient information 13, the variable length coding unit 104 uses the selected block information 31 from the prediction unit 101, and the coding parameters such as the prediction information and the quantization parameter from the coding control unit 150. The available block information 30 is received from 109. The variable length coding unit 104 performs entropy coding (for example, isometric coding, Huffman coding, arithmetic coding, etc.) on the quantized transform coefficient 13, selected block information 31, usable block information 30, and coding parameters. ) To generate encoded data 14. The coding parameters include all parameters necessary for decoding such as information on transform coefficients and information on quantization, as well as selected block information 31 and prediction information. The generated encoded data 14 is temporarily stored in the output buffer 120 and sent to a storage system or transmission system (not shown).

図5は、入力画像信号10の処理手順を示している。図5に示されるように、まず、予測画像信号11が予測部101によって生成される(ステップS501)。ステップS501の予測画像信号11の生成においては、後述する利用可能ブロックのうちの1つが選択ブロックとして選択され、選択ブロック情報31、選択ブロックが有する動き情報及び参照画像信号17を用いて、予測画像信号11が作成される。予測画像信号11と入力画像信号10との差分が減算器102により計算され、予測誤差画像信号12が生成される(ステップS502)。   FIG. 5 shows the processing procedure of the input image signal 10. As shown in FIG. 5, first, the prediction image signal 11 is generated by the prediction unit 101 (step S501). In the generation of the predicted image signal 11 in step S501, one of the available blocks described later is selected as a selected block, and the predicted image is selected using the selected block information 31, the motion information of the selected block, and the reference image signal 17. A signal 11 is created. The difference between the predicted image signal 11 and the input image signal 10 is calculated by the subtracter 102, and the predicted error image signal 12 is generated (step S502).

続いて、予測誤差画像信号12に対して変換・量子化部103により直交変換及び量子化が施され、変換係数情報13が生成される(ステップS503)。変換係数情報13及び選択ブロック情報31は、可変長符号化部104に送られ、可変長符号化が施され、符号化データ14が生成される(ステップS504)。また、ステップS504では、選択ブロック情報31に応じて、利用可能ブロックの数と等しい数のエントリーをコード表に持つように符号表が切り替えられ、選択ブロック情報31が可変長符号化される。符号化データのビットストリーム20は、図示しない蓄積系あるいは伝送路へ送出される。   Subsequently, orthogonal transform and quantization are performed on the prediction error image signal 12 by the transform / quantization unit 103, and transform coefficient information 13 is generated (step S503). The transform coefficient information 13 and the selected block information 31 are sent to the variable length encoding unit 104, subjected to variable length encoding, and encoded data 14 is generated (step S504). In step S504, the code table is switched so that the code table has the same number of entries as the number of available blocks according to the selected block information 31, and the selected block information 31 is variable-length encoded. The encoded data bit stream 20 is sent to a storage system (not shown) or a transmission path.

ステップS503で生成された変換係数情報13は、逆量子化・逆変換部105によって逆量子化され、逆変換処理が施されて、復号予測誤差信号15となる(ステップS505)。復号予測誤差信号15は、ステップS501で使用された参照画像信号17に加算され、局所復号画像信号16となり(ステップS506)、フレームメモリ107に参照画像信号として記憶される(ステップS507)。   The transform coefficient information 13 generated in step S503 is inversely quantized by the inverse quantization / inverse transform unit 105, subjected to inverse transform processing, and becomes the decoded prediction error signal 15 (step S505). The decoded prediction error signal 15 is added to the reference image signal 17 used in step S501 to become a local decoded image signal 16 (step S506), and stored as a reference image signal in the frame memory 107 (step S507).

次に、上述した画像符号化部100の各構成をより詳細に説明する。
図1の画像符号化部100には、複数の予測モードが用意されており、各予測モードは、予測画像信号11の生成方法及び動き補償ブロックサイズが互いに異なる。予測部101が予測画像信号11を生成する方法としては、具体的には大きく分けて、符号化対象フレーム(又は、フィールド)に関する参照画像信号17を用いて予測画像を生成するイントラ予測(フレーム内予測)と、1以上の符号化済みの参照フレーム(参照フィールド)に関する参照画像信号17を用いて予測画像を生成するインター予測(フレーム間予測)とがある。予測部101は、イントラ予測及びインター予測を選択的に切り替えて、符号化対象ブロックの予測画像信号11を生成する。
Next, each configuration of the above-described image encoding unit 100 will be described in more detail.
A plurality of prediction modes are prepared in the image encoding unit 100 of FIG. 1, and each prediction mode differs in the generation method of the predicted image signal 11 and the motion compensation block size. Specifically, the prediction unit 101 generates the predicted image signal 11 broadly, and can be broadly divided into intra prediction (intraframe) that generates a predicted image using the reference image signal 17 related to the encoding target frame (or field). Prediction) and inter prediction (interframe prediction) for generating a predicted image using the reference image signal 17 related to one or more encoded reference frames (reference fields). The prediction unit 101 selectively switches between intra prediction and inter prediction, and generates the predicted image signal 11 of the encoding target block.

図6Aは、動き補償部113によるインター予測の一例を示している。インター予測では、図6Aに示されるように、既に符号化が完了している1フレーム前の参照フレーム内のブロックであって、符号化対象ブロックと同じ位置のブロック(予測ブロックともいう)23から、動き情報18に含まれる動きベクトル18aに応じて空間的にシフトした位置のブロック24に関する参照画像信号17を使用して、予測画像信号11が生成される。即ち、予測画像信号11の生成では、符号化対象ブロックの位置(座標)、及び動き情報18に含まれる動きベクトル18aで特定される、参照フレーム内のブロック24に関する参照画像信号17が使用される。インター予測では、少数画素精度(例えば、1/2画素精度又は1/4画素精度)の動き補償が可能であり、参照画像信号17に対してフィルタリング処理を行うことによって、補間画素の値が生成される。例えば、H.264では、輝度信号に対して1/4画素精度までの補間処理が可能である。1/4画素精度の動き補償を行う場合、動き情報18の情報量は、整数画素精度の4倍となる。   FIG. 6A shows an example of inter prediction by the motion compensation unit 113. In inter prediction, as shown in FIG. 6A, from a block (also referred to as a prediction block) 23 in a reference frame one frame before encoding that is the same position as the current block to be encoded. The predicted image signal 11 is generated using the reference image signal 17 related to the block 24 at the position spatially shifted according to the motion vector 18 a included in the motion information 18. That is, in the generation of the predicted image signal 11, the reference image signal 17 related to the block 24 in the reference frame specified by the position (coordinates) of the encoding target block and the motion vector 18a included in the motion information 18 is used. . In inter prediction, motion compensation with a small pixel accuracy (for example, a 1/2 pixel accuracy or a 1/4 pixel accuracy) is possible, and a value of an interpolation pixel is generated by performing a filtering process on the reference image signal 17. Is done. For example, H.M. In H.264, it is possible to perform interpolation processing up to 1/4 pixel accuracy on the luminance signal. When motion compensation with ¼ pixel accuracy is performed, the information amount of the motion information 18 is four times the integer pixel accuracy.

なお、インター予測では、図6Aに示されるような1フレーム前の参照フレームを使用する例に限らず、図6Bに示されるように、いずれの符号化済みの参照フレームが使用されても構わない。時間位置が異なる複数の参照フレームに関する参照画像信号17が保持されている場合、どの時間位置の参照画像信号17から予測画像信号11を生成したかを示す情報は、参照フレーム番号で表わされる。参照フレーム番号は、動き情報18に含まれる。参照フレーム番号は、領域単位(ピクチャ、ブロック単位など)で変更することができる。即ち、画素ブロック毎に異なる参照フレームが使用されることができる。一例として、符号化済みの1フレーム前の参照フレームを予測に使用した場合、この領域の参照フレーム番号は、0に設定され、符号化済みの2フレーム前の参照フレームを予測に使用した場合、この領域の参照フレーム番号は、1に設定される。他の例として、1フレーム分だけの参照画像信号17がフレームメモリ107に保持されている(参照フレームの数が1である)場合、参照フレーム番号は、常に0に設定される。   In inter prediction, not only an example in which a reference frame one frame before as shown in FIG. 6A is used, but any encoded reference frame may be used as shown in FIG. 6B. . When reference image signals 17 relating to a plurality of reference frames having different time positions are held, information indicating which time position the reference image signal 17 is generated from the reference image signal 17 is represented by a reference frame number. The reference frame number is included in the motion information 18. The reference frame number can be changed on an area basis (picture, block basis, etc.). That is, a different reference frame can be used for each pixel block. As an example, when the encoded reference frame one frame before is used for prediction, the reference frame number of this region is set to 0, and when the encoded reference frame two frames before is used for prediction, The reference frame number of this area is set to 1. As another example, when the reference image signal 17 for only one frame is held in the frame memory 107 (the number of reference frames is 1), the reference frame number is always set to 0.

さらに、インター予測では、複数の動き補償ブロックの中から符号化対象ブロックに適したブロックサイズを選択することができる。即ち、符号化対象ブロックが複数の小画素ブロックに分割され、小画素ブロック毎に動き補償が行われても構わない。図7Aから図7Cは、マクロブロック単位の動き補償ブロックのサイズを示し、図7Dは、サブブロック(8×8画素以下の画素ブロック)単位の動き補償ブロックのサイズを示す。図7Aに示されるように、符号化対象ブロックが64×64画素である場合、動き補償ブロックとして、64×64画素ブロック、64×32画素ブロック、32×64画素ブロック又は32×32画素ブロックなどが選択されることができる。また、図7Bに示されるように、符号化対象ブロックが32×32画素である場合、動き補償ブロックとして、32×32画素ブロック、32×16画素ブロック、16×32画素ブロック又は16×16画素ブロックなどが選択されることができる。さらに、図7Cに示されるように、符号化対象ブロックが16×16画素である場合、動き補償ブロックは、16×16画素ブロック、16×8画素ブロック、8×16画素ブロック又は8×8画素ブロックなどに設定されることができる。さらにまた、図7Dに示されるように、符号化対象ブロックが8×8画素である場合、動き補償ブロックは、8×8画素ブロック、8×4画素ブロック、4×8画素ブロック又は4×4画素ブロックなどが選択されることができる。   Further, in inter prediction, a block size suitable for a coding target block can be selected from a plurality of motion compensation blocks. That is, the encoding target block may be divided into a plurality of small pixel blocks, and motion compensation may be performed for each small pixel block. 7A to 7C show the size of the motion compensation block in units of macroblocks, and FIG. 7D shows the size of the motion compensation block in units of sub-blocks (pixel blocks of 8 × 8 pixels or less). As shown in FIG. 7A, when the encoding target block is 64 × 64 pixels, the motion compensation block is a 64 × 64 pixel block, a 64 × 32 pixel block, a 32 × 64 pixel block, a 32 × 32 pixel block, or the like. Can be selected. As shown in FIG. 7B, when the encoding target block is 32 × 32 pixels, the motion compensation block is a 32 × 32 pixel block, a 32 × 16 pixel block, a 16 × 32 pixel block, or a 16 × 16 pixel. A block or the like can be selected. Further, as shown in FIG. 7C, when the encoding target block is 16 × 16 pixels, the motion compensation block is a 16 × 16 pixel block, a 16 × 8 pixel block, an 8 × 16 pixel block, or an 8 × 8 pixel. It can be set to a block or the like. Furthermore, as shown in FIG. 7D, when the encoding target block is 8 × 8 pixels, the motion compensation block is an 8 × 8 pixel block, an 8 × 4 pixel block, a 4 × 8 pixel block, or 4 × 4. A pixel block or the like can be selected.

前述したように、インター予測に使用する参照フレーム内の小画素ブロック(例えば、4×4画素ブロック)が動き情報18を有しているので、入力画像信号10の局所的な性質に従って、最適な動き補償ブロックの形状及び動きベクトルを利用することができる。また、図7Aから図7Dのマクロブロック及びサブマクロブロックは、任意に組み合わせることができる。符号化対象ブロックが図7Aに示されるような64×64画素ブロックである場合、64×64画素ブロックを分割した4つの32×32画素ブロックの各々に対して、図7Bに示す各ブロックサイズを選択することで、階層的に64×64〜16×16画素のブロックを利用することができる。同様にして、図7Dに示されるブロックサイズまで選択可能とする場合、階層的に64×64〜4×4のブロックサイズを利用することができる。   As described above, since the small pixel block (for example, 4 × 4 pixel block) in the reference frame used for the inter prediction has the motion information 18, the optimal value is determined according to the local property of the input image signal 10. The shape and motion vector of the motion compensation block can be used. Also, the macroblocks and sub-macroblocks in FIGS. 7A to 7D can be arbitrarily combined. When the encoding target block is a 64 × 64 pixel block as shown in FIG. 7A, each block size shown in FIG. 7B is set for each of the four 32 × 32 pixel blocks obtained by dividing the 64 × 64 pixel block. By selecting, a block of 64 × 64 to 16 × 16 pixels can be used hierarchically. Similarly, when the block size shown in FIG. 7D can be selected, a block size of 64 × 64 to 4 × 4 can be used hierarchically.

次に、図8Aから図8Fを参照して、動き参照ブロックについて説明する。
動き参照ブロックは、図1の画像符号化装置及び後述する画像復号化装置の両方によって取り決められた方法に従って、符号化対象フレーム及び参照フレーム内の符号化済みの領域(ブロック)の中から選択される。図8Aは、符号化対象ブロックの位置に応じて選択される動き参照ブロックの配置の一例を示している。図8Aの例では、9つの動き参照ブロックA〜D及びTA〜TEが符号化対象フレーム及び参照フレーム内の符号化済みの領域から選択される。具体的には、符号化対象フレームからは、符号化対象ブロックの左、上、右上、左上に隣接する4つのブロックA,B,C,Dが動き参照ブロックとして選択され、参照フレームからは、符号化対象ブロックと同一位置のブロックTA、並びにこのブロックTAの右、下、左及び上に隣接する4つの画素ブロックTB,TC,TD,TEが動き参照ブロックとして選択される。本実施形態では、符号化対象フレームから選択された動き参照ブロックを空間方向動き参照ブロックと称し、参照フレームから選択された動き参照ブロックを時間方向動き参照ブロックと称す。図8Aの各動き参照ブロックに付与されている記号pは、動き参照ブロックのインデクスを示す。このインデクスは、時間方向、空間方向の動き参照ブロックの順にナンバリングされているが、これに限らず、インデクスが重複しなければ、必ずしもこの順序でなくても構わない。例えば、時間方向及び空間方向の動き参照ブロックは、順序がばらばらにナンバリングされていても構わない。
Next, the motion reference block will be described with reference to FIGS. 8A to 8F.
The motion reference block is selected from the encoding target frame and the encoded region (block) in the reference frame according to a method determined by both the image encoding device of FIG. 1 and an image decoding device described later. The FIG. 8A shows an example of the arrangement of motion reference blocks selected according to the position of the encoding target block. In the example of FIG. 8A, nine motion reference blocks A to D and TA to TE are selected from the encoding target frame and the encoded region in the reference frame. Specifically, four blocks A, B, C, and D adjacent to the left, upper, upper right, and upper left of the encoding target block are selected as motion reference blocks from the encoding target frame, and from the reference frame, A block TA at the same position as the encoding target block and four pixel blocks TB, TC, TD, TE adjacent to the right, bottom, left and top of the block TA are selected as motion reference blocks. In the present embodiment, the motion reference block selected from the encoding target frame is referred to as a spatial direction motion reference block, and the motion reference block selected from the reference frame is referred to as a temporal direction motion reference block. A symbol p assigned to each motion reference block in FIG. 8A indicates an index of the motion reference block. The indexes are numbered in the order of motion reference blocks in the temporal direction and the spatial direction. However, the order is not limited to this, and the order is not necessarily limited as long as the indexes do not overlap. For example, the motion reference blocks in the temporal direction and the spatial direction may be numbered out of order.

なお、空間方向動き参照ブロックは、図8Aに示す例に限らず、図8Bに示すように、符号化対象ブロックに隣接する画素a,b,c,dが属するブロック(例えば、マクロブロック又はサブマクロブロック等)であっても構わない。この場合、符号化対象ブロック内の左上画素eから各画素a,b,c,dへの相対位置(dx,dy)は、図8Cに示されるように、設定される。ここで、図8A及び図8Bに示される例では、マクロブロックは、N×N画素ブロックであるものとして示されている。   Note that the spatial direction motion reference block is not limited to the example illustrated in FIG. 8A, and as illustrated in FIG. Macroblock etc.). In this case, the relative position (dx, dy) from the upper left pixel e in the encoding target block to each of the pixels a, b, c, d is set as shown in FIG. 8C. Here, in the example shown in FIGS. 8A and 8B, the macroblock is shown as being an N × N pixel block.

また、図8Dに示されるように、符号化対象ブロックに隣接する全てのブロックA1〜A4,B1,B2,C,Dが空間方向動き参照ブロックとして選択されても構わない。図8Dの例では、空間方向動き参照ブロックの数は8となる。   Further, as shown in FIG. 8D, all the blocks A1 to A4, B1, B2, C, and D adjacent to the encoding target block may be selected as the spatial direction motion reference block. In the example of FIG. 8D, the number of spatial direction motion reference blocks is 8.

さらに、時間方向動き参照ブロックは、図8Eに示されるように、各ブロックTA〜TEの一部が重なり合っていてもよく、図8Fに示されるように、各ブロックTA〜TEが離れて配置されていても構わない。図8Eでは、時間方向動き参照ブロックTA及びTBが重なりあっている部分が斜線で示されている。さらにまた、時間方向動き参照ブロックは、必ずしも符号化対象ブロックに対応する位置(Collocate位置)のブロック及びその周囲に位置するブロックである例に限らず、参照フレーム内のいずれの位置に配置されているブロックであっても構わない。例えば、参照ブロックの位置、及び符号化対象ブロックに隣接するいずれかの符号化済みのブロックが有する動き情報18で特定される、参照フレーム内のブロックを中心ブロック(例えば、ブロックTA)として、この中心ブロック及びその周囲のブロックが時間方向動き参照ブロックとして選択されても構わない。さらに、時間方向参照ブロックは、中心ブロックから等間隔に配置されていなくても構わない。   Further, as shown in FIG. 8E, the temporal motion reference block may have a part of each of the blocks TA to TE overlapping, and the blocks TA to TE are arranged apart from each other as shown in FIG. 8F. It does not matter. In FIG. 8E, a portion where the temporal direction motion reference blocks TA and TB overlap is indicated by hatching. Furthermore, the temporal direction motion reference block is not limited to the example of the block at the position corresponding to the encoding target block (Collocate position) and the block positioned around it, and is arranged at any position in the reference frame. It may be a block. For example, the block in the reference frame specified by the position of the reference block and the motion information 18 included in any of the encoded blocks adjacent to the encoding target block is set as the central block (for example, the block TA). The central block and its surrounding blocks may be selected as the temporal direction motion reference block. Furthermore, the time direction reference blocks may not be arranged at equal intervals from the central block.

上述したいずれの場合においても、符号化装置及び復号化装置で空間方向及び時間方向動き参照ブロックの数及び位置を予め取り決めておけば、動き参照ブロックの数及び位置は、どのように設定されても構わない。また、動き参照ブロックのサイズは、必ずしも符号化対象ブロックと同じサイズである必要はない。例えば、図8Dに示されるように、動き参照ブロックのサイズが符号化対象ブロックより大きくてもよく、小さくても構わない。さらに、動き参照ブロックは、正方形状に限らず、長方形状等の任意形状に設定されても構わない。また、動き参照ブロックは、いかなるサイズに設定されても構わない。   In any of the above cases, if the number and position of the spatial and temporal motion reference blocks are determined in advance in the encoding device and the decoding device, how are the number and position of the motion reference blocks set? It doesn't matter. In addition, the size of the motion reference block is not necessarily the same size as the encoding target block. For example, as illustrated in FIG. 8D, the size of the motion reference block may be larger or smaller than the encoding target block. Furthermore, the motion reference block is not limited to a square shape, and may be set to an arbitrary shape such as a rectangular shape. In addition, the motion reference block may be set to any size.

また、動き参照ブロック及び利用可能ブロックは、時間方向及び空間方向のいずれか一方のみに配置されていても構わない。また、Pスライス、Bスライスといったスライスの種類に従って、時間方向の動き参照ブロック及び利用可能ブロックを配置しても構わないいし、空間方向の動き参照ブロック及び利用可能ブロックを配置しても構わない。   Further, the motion reference block and the available block may be arranged only in one of the temporal direction and the spatial direction. Further, the motion reference block and the usable block in the time direction may be arranged according to the type of slice such as the P slice and the B slice, and the motion reference block and the usable block in the spatial direction may be arranged.

図9は、利用可能ブロック取得部109が動き参照ブロックの中から利用可能ブロックを選択する方法を示している。利用可能ブロックは、符号化対象ブロックへ動き情報を適用可能なブロックであり、互いに異なる動き情報を有している。利用可能ブロック取得部109は、参照動き情報19を参照して、図9に示す方法に従って、動き参照ブロックが各々利用可能ブロックであるか否かを判定し、利用可能ブロック情報30を出力する。   FIG. 9 shows a method in which the available block acquisition unit 109 selects an available block from the motion reference blocks. An available block is a block in which motion information can be applied to an encoding target block, and has different motion information. The available block acquisition unit 109 refers to the reference motion information 19 and determines whether or not each motion reference block is an available block according to the method shown in FIG. 9, and outputs the available block information 30.

図9に示されるように、まず、インデクスpがゼロである動き参照ブロックが選択される(S800)。図9の説明では、インデクスpが0からM−1(Mは、動き参照ブロックの数を示す。)まで順番に動き参照ブロックを処理する場合を想定している。また、インデクスpが0からp−1までの動き参照ブロックに対する利用可能判定処理が終了し、利用可能か否かを判定する対象となっている動き参照ブロックのインデクスがpであるものとして説明する。   As shown in FIG. 9, first, a motion reference block whose index p is zero is selected (S800). In the description of FIG. 9, it is assumed that the motion reference blocks are processed in order from the index p of 0 to M−1 (M indicates the number of motion reference blocks). Further, the description will be made assuming that the availability determination process for the motion reference blocks with the index p of 0 to p−1 is completed and the index of the motion reference block that is the target of determining whether or not the index p is p. .

利用可能ブロック取得部109は、動き参照ブロックpが動き情報18を有しているか否か、即ち、少なくとも1つの動きベクトルが割り当てられているか否かを判定する(S801)。動き参照ブロックpが動きベクトルを有していない場合、即ち、時間方向動き参照ブロックpが、動き情報を有していないIスライス内のブロックであるか、或いは、時間方向動き参照ブロックp内の全ての小画素ブロックがイントラ予測符号化されたものである場合、ステップS805に進む。ステップS805において、動き参照ブロックpは、利用不可能ブロックと判定される。   The available block acquisition unit 109 determines whether or not the motion reference block p has the motion information 18, that is, whether or not at least one motion vector is assigned (S801). If the motion reference block p does not have a motion vector, that is, the time direction motion reference block p is a block in an I slice that does not have motion information, or in the time direction motion reference block p When all the small pixel blocks are intra prediction encoded, the process proceeds to step S805. In step S805, the motion reference block p is determined as an unusable block.

ステップS801において動き参照ブロックpが動き情報を有している場合、ステップS802に進む。利用可能ブロック取得部109は、既に利用可能ブロックに選択されている動き参照ブロックq(利用可能ブロックq)を選定する。ここで、qは、pよりも小さい値である。続いて、利用可能ブロック取得部109は、動き参照ブロックpの動き情報18と、利用可能ブロックqの動き情報18とを比較して、同一の動き情報を有するか否かを判定する(S803)。動き参照ブロックpの動き情報18と利用可能ブロックに選択されている動き参照ブロックqの動き情報18とが同一であると判定された場合、ステップS805に進み、動き参照ブロックpが利用不可能ブロックと判定される。   If the motion reference block p has motion information in step S801, the process proceeds to step S802. The available block acquisition unit 109 selects a motion reference block q (available block q) that has already been selected as an available block. Here, q is a value smaller than p. Subsequently, the available block acquisition unit 109 compares the motion information 18 of the motion reference block p with the motion information 18 of the available block q to determine whether or not the same motion information is included (S803). . When it is determined that the motion information 18 of the motion reference block p and the motion information 18 of the motion reference block q selected as an available block are the same, the process proceeds to step S805, and the motion reference block p is not available. It is determined.

q<pを満たす全ての利用可能ブロックqに対して、ステップS803で動き参照ブロックpの動き情報18と、利用可能ブロックqの動き情報18とが同一でないと判定された場合、ステップS804に進む。ステップS804において、利用可能ブロック取得部109は、動き参照ブロックpを利用可能ブロックとして判定する。   If it is determined in step S803 that the motion information 18 of the motion reference block p and the motion information 18 of the available block q are not the same for all available blocks q satisfying q <p, the process proceeds to step S804. . In step S804, the available block acquisition unit 109 determines the motion reference block p as an available block.

動き参照ブロックpが利用可能ブロック又は利用不可能ブロックであると判定されると、利用可能ブロック取得部109は、全ての動き参照ブロックに対して利用可能判定が実行されたか否かを判定する(S806)。利用可能判定が実行されていない動き参照ブロックが存在する場合、例えば、p<M−1である場合、ステップS807に進む。続いて、利用可能ブロック取得部109は、インデクスpを1インクリメントして(ステップS807)、ステップS801からステップS806を再度実行する。ステップS806で全ての動き参照ブロックに対して利用可能判定が実行されると、利用可能判定処理は、終了となる。   When it is determined that the motion reference block p is an available block or an unusable block, the available block acquisition unit 109 determines whether the availability determination has been performed for all the motion reference blocks ( S806). If there is a motion reference block for which the availability determination has not been performed, for example, if p <M−1, the process proceeds to step S807. Subsequently, the available block acquisition unit 109 increments the index p by 1 (step S807), and executes steps S801 to S806 again. When the availability determination is executed for all the motion reference blocks in step S806, the availability determination process ends.

上述した利用可能判定処理を実行することにより、各動き参照ブロックが利用可能ブロックであるか、又は利用不可能ブロックであるかが判定される。利用可能ブロック取得部109は、利用可能ブロックに関する情報を含む利用可能ブロック情報30を生成する。このように、動き参照ブロックの中から利用可能ブロックを選択することによって、利用可能ブロック情報30に関する情報量が低減され、結果として、符号化データ14の量を低減することができる。   By executing the availability determination process described above, it is determined whether each motion reference block is an available block or an unavailable block. The available block acquisition unit 109 generates usable block information 30 including information on available blocks. Thus, by selecting an available block from the motion reference blocks, the amount of information related to the available block information 30 is reduced, and as a result, the amount of encoded data 14 can be reduced.

図8Aに示した動き参照ブロックに対して、利用可能判定処理を実行した結果の一例を図10に示す。図10では、2つの空間方向動き参照ブロック(p=0,1)及び2つの時間方向動き参照ブロック(p=5,8)が利用可能ブロックであると判定されている。図10の例に関する利用可能ブロック情報30の一例を図11に示す。図11に示されるように、利用可能ブロック情報30は、動き参照ブロックのインデクス、利用可能性及び動き参照ブロック名称を含む。図11の例では、インデクスp=0,1,5,8が利用可能ブロックであり、利用可能ブロック数は4である。予測部101は、これらの利用可能ブロックの中から最適な1つ利用可能ブロックを選択ブロックとして選択し、選択ブロックに関する情報(選択ブロック情報)31を出力する。選択ブロック情報31は、利用可能ブロックの数及び選択された利用可能ブロックのインデクス値を含む。例えば、利用可能ブロックの数が4である場合、応じた選択ブロック情報31は、最大のエントリーが4である符号表を用いて、可変長符号化部104によって符号化される。   FIG. 10 shows an example of the result of executing the availability determination process on the motion reference block shown in FIG. 8A. In FIG. 10, it is determined that two spatial direction motion reference blocks (p = 0, 1) and two temporal direction motion reference blocks (p = 5, 8) are usable blocks. An example of the available block information 30 relating to the example of FIG. 10 is shown in FIG. As shown in FIG. 11, the available block information 30 includes an index of a motion reference block, availability, and a motion reference block name. In the example of FIG. 11, indexes p = 0, 1, 5, and 8 are usable blocks, and the number of usable blocks is four. The prediction unit 101 selects one optimum usable block from these usable blocks as a selected block, and outputs information (selected block information) 31 regarding the selected block. The selected block information 31 includes the number of available blocks and the index value of the selected available block. For example, when the number of available blocks is 4, the corresponding selected block information 31 is encoded by the variable-length encoding unit 104 using a code table whose maximum entry is 4.

なお、図9のステップS801において、時間方向動き参照ブロックp内のブロックのうちの少なくとも1つがイントラ予測符号化されたブロックであった場合、利用可能ブロック取得部109は、動き参照ブロックpを利用不可能ブロックと判定しても構わない。即ち、時間方向動き参照ブロックp内の全てのブロックがインター予測で符号化されている場合のみ、ステップS802に進むようにしても構わない。   In step S801 in FIG. 9, when at least one of the blocks in the temporal direction motion reference block p is an intra prediction encoded block, the available block acquisition unit 109 uses the motion reference block p. It may be determined as an impossible block. In other words, the process may proceed to step S802 only when all the blocks in the temporal direction motion reference block p are encoded by inter prediction.

図12Aから図12Eは、ステップS803の動き情報18の比較において、動き参照ブロックpの動き情報18と、利用可能ブロックqの動き情報18とが同一であると判定される例を示す。図12Aから図12Eには、各々、斜線が施された複数のブロックと、2つの白塗りのブロックとが示されている。図12Aから図12Eでは、説明を簡単にするために、斜線が施されたブロックを考慮せずに、これらの2つの白塗りのブロックの動き情報18を比較する場合を想定している。2つの白塗りのブロックの一方が、動き参照ブロックpであり、他方が既に利用可能と判定されている動き参照ブロックq(利用可能ブロックq)であるものとする。特に断りのない限り、2つの白色ブロックのいずれが動き参照ブロックpであっても構わない。   12A to 12E show an example in which it is determined that the motion information 18 of the motion reference block p and the motion information 18 of the available block q are the same in the comparison of the motion information 18 in step S803. 12A to 12E each show a plurality of hatched blocks and two white blocks. In FIG. 12A to FIG. 12E, to simplify the explanation, it is assumed that the motion information 18 of these two white blocks is compared without considering the shaded blocks. One of the two white blocks is a motion reference block p, and the other is a motion reference block q (usable block q) that has already been determined to be usable. Unless otherwise specified, any of the two white blocks may be the motion reference block p.

図12Aは、動き参照ブロックp及び利用可能ブロックqの両方が空間方向のブロックである例を示している。図12Aの例では、ブロックA及びBの動き情報18が同一であれば、動き情報18が同一であると判定される。このとき、ブロックA及びBのサイズが同一である必要はない。   FIG. 12A shows an example in which both the motion reference block p and the available block q are spatial blocks. In the example of FIG. 12A, if the motion information 18 of the blocks A and B is the same, it is determined that the motion information 18 is the same. At this time, the sizes of the blocks A and B do not have to be the same.

図12Bは、動き参照ブロックp及び利用可能ブロックqの一方が空間方向のブロックAであり、他方が時間方向のブロックTBである例を示している。図12Bでは、時間方向のブロックTB内に動き情報を有するブロックが1つある。時間方向のブロックTBの動き情報18と空間方向のブロックAの動き情報18とが同一であれば、動き情報18が同一であると判定される。このとき、ブロックA及びTBのサイズが同一である必要はない。   FIG. 12B illustrates an example in which one of the motion reference block p and the available block q is the block A in the spatial direction, and the other is the block TB in the temporal direction. In FIG. 12B, there is one block having motion information in the block TB in the time direction. If the motion information 18 of the block TB in the time direction and the motion information 18 of the block A in the spatial direction are the same, it is determined that the motion information 18 is the same. At this time, the sizes of the blocks A and TB do not have to be the same.

図12Cは、動き参照ブロックp及び利用可能ブロックqの一方が空間方向のブロックAであり、他方が時間方向のブロックTBである他の例を示している。図12Cは、時間方向のブロックTBが複数の小ブロックに分割されていて、動き情報18を有する小ブロックが複数ある場合を示している。図12Cの例では、動き情報18を有する全てのブロックが同じ動き情報18を有し、その動き情報18が空間方向のブロックAの動き情報18と同一であれば、動き情報18が同一であると判定される。このとき、ブロックA及びTBのサイズが同一である必要はない。   FIG. 12C shows another example in which one of the motion reference block p and the available block q is a block A in the spatial direction and the other is a block TB in the temporal direction. FIG. 12C shows a case where the block TB in the time direction is divided into a plurality of small blocks, and there are a plurality of small blocks having the motion information 18. In the example of FIG. 12C, if all the blocks having the motion information 18 have the same motion information 18, and the motion information 18 is the same as the motion information 18 of the block A in the spatial direction, the motion information 18 is the same. It is determined. At this time, the sizes of the blocks A and TB do not have to be the same.

図12Dは、動き参照ブロックp及び利用可能ブロックqがともに時間方向のブロックである例を示している。この場合、ブロックTB及びTEの動き情報18が同一であれば、動き情報18が同一であると判定される。   FIG. 12D illustrates an example in which both the motion reference block p and the available block q are temporal blocks. In this case, if the motion information 18 of the blocks TB and TE is the same, it is determined that the motion information 18 is the same.

図12Eは、動き参照ブロックp及び利用可能ブロックqがともに時間方向のブロックである他の例を示している。図12Eは、時間方向のブロックTB及びTEが各々複数の小ブロックに分割されていて、各々に動き情報18を有する小ブロックが複数ある場合を示している。この場合、ブロック内の小ブロック毎に動き情報18を比較して、全ての小ブロックに対し動き情報18が同一であれば、ブロックTBの動き情報18とブロックTEの動き情報18とが同一であると判定される。   FIG. 12E shows another example in which the motion reference block p and the available block q are both temporal blocks. FIG. 12E shows a case where the blocks TB and TE in the time direction are each divided into a plurality of small blocks, and there are a plurality of small blocks each having the motion information 18. In this case, the motion information 18 is compared for each small block in the block, and if the motion information 18 is the same for all the small blocks, the motion information 18 of the block TB and the motion information 18 of the block TE are the same. It is determined that there is.

図12Fは、動き参照ブロックp及び利用可能ブロックqがともに時間方向のブロックであるさらに他の例を示している。図12Fは、時間方向のブロックTEが複数の小ブロックに分割されていて、ブロックTEに動き情報18を有する小ブロックが複数ある場合を示している。ブロックTEの全ての動き情報18が同一の動き情報18であり、且つ、ブロックTDが有する動き情報18と同一である場合、ブロックTDとTEの動き情報18が同一であると判定される。   FIG. 12F illustrates still another example in which the motion reference block p and the available block q are both temporal blocks. FIG. 12F shows a case where the block TE in the time direction is divided into a plurality of small blocks, and there are a plurality of small blocks having the motion information 18 in the block TE. When all the motion information 18 of the block TE is the same motion information 18 and the same as the motion information 18 included in the block TD, it is determined that the motion information 18 of the blocks TD and TE is the same.

このようにして、ステップS803では、動き参照ブロックpの動き情報18と利用可能ブロックqの動き情報18とが同一であるか否かが判定される。図12Aから図12Fの例では、動き参照ブロックpと比較する利用可能ブロックqの数を1として説明したが、利用可能ブロックqの数が2以上の場合においては、動き参照ブロックpの動き情報18と、各々の利用可能ブロックqの動き情報18とを比較しても構わない。また、後述するスケーリングを適用する場合、スケーリング後の動き情報18が上記説明の動き情報18となる。   In this way, in step S803, it is determined whether or not the motion information 18 of the motion reference block p and the motion information 18 of the available block q are the same. In the example of FIGS. 12A to 12F, the number of available blocks q to be compared with the motion reference block p has been described as 1. However, when the number of available blocks q is 2 or more, the motion information of the motion reference block p 18 may be compared with the motion information 18 of each available block q. Further, when scaling described later is applied, the motion information 18 after scaling becomes the motion information 18 described above.

なお、動き参照ブロックpの動き情報と利用可能ブロックqの動き情報とが同一であるという判定は、動き情報に含まれる各動きベクトルが完全に一致する場合に限定されることはない。例えば、2つの動きベクトルの差のノルムが所定の範囲内であれば、動き参照ブロックpの動き情報と利用可能ブロックqの動き情報とが実質的に同一であるとみなしても構わない。   Note that the determination that the motion information of the motion reference block p and the motion information of the available block q are the same is not limited to the case where the motion vectors included in the motion information completely match. For example, if the norm of the difference between two motion vectors is within a predetermined range, the motion information of the motion reference block p and the motion information of the available block q may be regarded as substantially the same.

図13は、予測部101のより詳細な構成を示している。この予測部101は、前述したように、利用可能ブロック情報30、参照動き情報19及び参照画像信号17を入力として、予測画像信号11、動き情報18及び選択ブロック情報31を出力する。動き情報選択部118は、図13に示されるように、空間方向動き情報取得部110、時間方向動き情報取得部111及び動き情報切替スイッチ112を備えている。   FIG. 13 shows a more detailed configuration of the prediction unit 101. As described above, the prediction unit 101 receives the available block information 30, the reference motion information 19, and the reference image signal 17, and outputs the prediction image signal 11, the motion information 18, and the selected block information 31. As illustrated in FIG. 13, the motion information selection unit 118 includes a spatial direction motion information acquisition unit 110, a time direction motion information acquisition unit 111, and a motion information changeover switch 112.

空間方向動き情報取得部110には、利用可能ブロック情報30、及び空間方向動き参照ブロックに関する参照動き情報19が入力される。空間方向動き情報取得部110は、空間方向に位置する各利用可能ブロックが有する動き情報及び利用可能ブロックのインデクス値を含む動き情報18Aを出力する。図11に示した情報が利用可能ブロック情報30として入力される場合、空間方向動き情報取得部110は、2つの動き情報出力18Aを生成し、各動き情報出力18Aは、利用可能ブロック及びこの利用可能ブロックが有する動き情報19を含む。   The spatial direction motion information acquisition unit 110 receives the usable block information 30 and the reference motion information 19 related to the spatial direction motion reference block. The spatial direction motion information acquisition unit 110 outputs motion information 18A including motion information included in each available block located in the spatial direction and an index value of the available block. When the information shown in FIG. 11 is input as the usable block information 30, the spatial direction motion information acquisition unit 110 generates two motion information outputs 18A, and each motion information output 18A includes an available block and this usage. The motion information 19 included in the possible block is included.

時間方向動き情報取得部111には、利用可能ブロック情報30及び時間方向動き参照ブロックに関する参照動き情報19が入力される。時間方向動き情報取得部111は、利用可能ブロック情報30で特定される利用可能な時間方向動き参照ブロックが有する動き情報19及び利用可能ブロックのインデクス値を動き情報18Bとして出力する。時間方向動き参照ブロックは複数の小画素ブロックに分割されていて、各小画素ブロックが動き情報19を有している。時間方向動き情報取得部111が出力する動き情報18Bは、図14に示すように、利用可能ブロック内の各小画素ブロックが有する動き情報19の群を含む。動き情報18Bが動き情報19の群を含む場合、符号化対象ブロックを分割した小画素ブロック単位で、符号化対象ブロックに対して動き補償予測を実行することができる。図11に示した情報が利用可能ブロック情報30として入力される場合、時間方向動き情報取得部111は、2つの動き情報出力18Bを生成し、各動き情報出力は、利用可能ブロック及びこの利用可能ブロックが有する動き情報19の群を含む。   The temporal direction motion information acquisition unit 111 receives the usable block information 30 and the reference motion information 19 related to the temporal direction motion reference block. The time direction motion information acquisition unit 111 outputs the motion information 19 included in the available time direction motion reference block specified by the available block information 30 and the index value of the available block as motion information 18B. The temporal direction motion reference block is divided into a plurality of small pixel blocks, and each small pixel block has motion information 19. The motion information 18B output from the temporal direction motion information acquisition unit 111 includes a group of motion information 19 included in each small pixel block in the available block, as illustrated in FIG. When the motion information 18B includes a group of motion information 19, motion compensation prediction can be executed on the encoding target block in units of small pixel blocks obtained by dividing the encoding target block. When the information shown in FIG. 11 is input as the usable block information 30, the time direction motion information acquisition unit 111 generates two motion information outputs 18B, and each motion information output includes an available block and this usable information. It includes a group of motion information 19 that the block has.

なお、時間方向動き情報取得部111は、各画素小ブロックが有する動き情報19に含まれる動きベクトルの平均値又は代表値を求め、動きベクトルの平均値又は代表値を動き情報18Bとして出力しても構わない。   The time direction motion information acquisition unit 111 obtains an average value or representative value of motion vectors included in the motion information 19 of each pixel small block, and outputs the average value or representative value of the motion vectors as motion information 18B. It doesn't matter.

図13の動き情報切替スイッチ112は、空間方向動き情報取得部110及び時間方向動き情報取得部111から出力される動き情報18A及び18Bに基づいて、適切な1つの利用可能ブロックを選択ブロックとして選択し、選択ブロックに対応する動き情報18(又は、動き情報18の群)を動き補償部113に出力する。また、動き情報切替スイッチ112は、選択ブロックに関する選択ブロック情報31を出力する。選択ブロック情報31は、インデクスp又は動き参照ブロックの名称などを含み、単に選択情報とも称される。選択ブロック情報31は、インデクスp及び動き参照ブロックの名称に限定されず、選択ブロックの位置を特定することができれば、いかなる情報であっても構わない。   The motion information changeover switch 112 in FIG. 13 selects an appropriate usable block as a selected block based on the motion information 18A and 18B output from the spatial direction motion information acquisition unit 110 and the temporal direction motion information acquisition unit 111. Then, the motion information 18 (or group of motion information 18) corresponding to the selected block is output to the motion compensation unit 113. The motion information changeover switch 112 outputs selected block information 31 related to the selected block. The selected block information 31 includes the name of the index p or the motion reference block, and is also simply referred to as selection information. The selected block information 31 is not limited to the name of the index p and the motion reference block, and may be any information as long as the position of the selected block can be specified.

動き情報切替スイッチ112は、例えば、下記数式1に示すコスト式によって導出される符号化コストが最小になる利用可能ブロックを選択ブロックとして選択する。
For example, the motion information changeover switch 112 selects an available block that minimizes the coding cost derived by the cost equation shown in the following Equation 1 as a selected block.

ここで、Jは符号化コストを示し、Dは入力画像信号10と参照画像信号17との間の二乗誤差和を表す符号化歪みを示す。また、Rは仮符号化によって見積もられる符号量を示し、λは。量子化幅等によって定められるラグランジュ未定係数を示す。数式1に代えて、符号量R又は符号化歪みDのみを使用して、符号化コストJを算出してもよく、符号量R又は符号化歪みDを近似した値を使用して数式1のコスト関数を作成しても構わない。さらに、符号化歪みDは、二乗誤差和に限らず、予測誤差の絶対値和(SAD:sums of absolute difference)であっても構わない。符号量Rは、動き情報18に関する符号量のみを使用しても構わない。また、符号化コストが最小になる利用可能ブロックが選択ブロックとして選択される例に限定されず、符号化コストが最も小さい値以上のある範囲内の値を有する1つの利用可能ブロックが選択ブロックとして選択されても構わない。   Here, J represents the coding cost, and D represents the coding distortion that represents the sum of square errors between the input image signal 10 and the reference image signal 17. R indicates the code amount estimated by provisional encoding, and λ. The Lagrange undetermined coefficient determined by the quantization width or the like is shown. The coding cost J may be calculated using only the code amount R or the encoding distortion D instead of the equation 1, and the value obtained by approximating the code amount R or the encoding distortion D is used. A cost function may be created. Furthermore, the coding distortion D is not limited to the sum of square errors, and may be a sum of absolute values (SAD) of prediction errors. As the code amount R, only the code amount related to the motion information 18 may be used. In addition, it is not limited to an example in which an available block with the lowest coding cost is selected as the selected block, and one available block having a value within a certain range that is equal to or larger than the smallest value of the coding cost is selected as the selected block. It does not matter if it is selected.

動き補償部113は、動き情報選択部118が選択した選択ブロックが有する動き情報(又は、動き情報の群)に基づいて、参照画像信号17が予測画像信号11として取り出される画素ブロックの位置を導出する。動き補償部113に動き情報の群が入力された場合、動き補償部113は、参照画像信号17が予測画像信号11として取り出される画素ブロックを小画素ブロック(例えば、4×4画素ブロック)に分割し、かつ、これら小画素ブロックの各々に、対応する動き情報18を適用することによって、参照画像信号17から予測画像信号11を取得する。予測画像信号11が取得されるブロックの位置は、例えば図4Aに示されるように、小画素ブロックから、動き情報18に含まれる動きベクトル18aに応じて空間方向にシフトした位置となる。   The motion compensation unit 113 derives the position of the pixel block from which the reference image signal 17 is extracted as the predicted image signal 11 based on the motion information (or a group of motion information) included in the selected block selected by the motion information selection unit 118. To do. When a group of motion information is input to the motion compensation unit 113, the motion compensation unit 113 divides a pixel block from which the reference image signal 17 is extracted as the predicted image signal 11 into small pixel blocks (for example, 4 × 4 pixel blocks). And the prediction image signal 11 is acquired from the reference image signal 17 by applying the corresponding motion information 18 to each of these small pixel blocks. The position of the block from which the predicted image signal 11 is acquired is, for example, a position shifted from the small pixel block in the spatial direction according to the motion vector 18a included in the motion information 18, as shown in FIG. 4A.

符号化対象ブロックに対する動き補償処理は、H.264の動き補償処理と同様のものを使用することができる。ここでは、一例として、1/4画素精度の補間手法を具体的に説明する。1/4画素精度の補間では、動きベクトルの各成分が4の倍数である場合、動きベクトルは、整数画素位置を指し示す。それ以外の場合、動きベクトルは、分数精度の補間位置に対応する予測位置を指し示す。
The motion compensation process for the encoding target block is H.264. Similar to the H.264 motion compensation process can be used. Here, as an example, an interpolation method with 1/4 pixel accuracy will be specifically described. In 1/4 pixel precision interpolation, if each component of the motion vector is a multiple of 4, the motion vector points to an integer pixel position. In other cases, the motion vector indicates a predicted position corresponding to the interpolation position with fractional accuracy.

ここで、x及びyは、予測対象ブロックの先頭位置(例えば、左上頂点)を示す垂直及び水平方向のインデクスを示し、x_pos及びy_posは、参照画像信号17の対応する予測位置を示す。(mv_x,mv_y)は、1/4画素精度を持つ動きベクトルを示す。次に、割り出した画素位置に対して、参照画像信号17の対応する画素位置の補填又は補間処理によって予測画素を生成する。図15に、H.264の予測画素生成の一例が示されている。図15において大文字のアルファベットで示される正方形(斜線が施された正方形)は、整数位置の画素を示しており、網掛けで表示されている正方形は、1/2画素位置の補間画素を示している。また、白塗りで表示された正方形は1/4画素位置に対応する補間画素を示している。例えば、図15において、アルファベットb、hの位置に対応する1/2画素の補間処理は、下記数式3で算出される。
Here, x and y indicate vertical and horizontal indexes indicating the head position (for example, the upper left vertex) of the prediction target block, and x_pos and y_pos indicate the corresponding prediction position of the reference image signal 17. (mv_x, mv_y) indicates a motion vector having a 1/4 pixel accuracy. Next, a predicted pixel is generated by interpolation or interpolation of the corresponding pixel position of the reference image signal 17 for the determined pixel position. In FIG. An example of H.264 prediction pixel generation is shown. In FIG. 15, squares indicated by capital letters (hatched squares) indicate pixels at integer positions, and squares indicated by shading indicate interpolation pixels at 1/2 pixel positions. Yes. A square displayed in white indicates an interpolation pixel corresponding to a 1/4 pixel position. For example, in FIG. 15, the 1/2 pixel interpolation process corresponding to the positions of the alphabets b and h is calculated by the following Equation 3.

ここで、数式3及び下記数式4に示されるアルファベット(例えば、b,h,C1等)は、図16において同じアルファベットを付与された画素の画素値を示す。また、「>>」は、右シフト演算を示し、「>> 5」は、32で除算することに相当する。即ち、1/2画素位置の補間画素は、6タップFIR(Finite Impulse Response)フィルタ(タップ係数:(1,−5,20,20,−5,1)/32)を用いて算出される。 Here, alphabets (for example, b, h, C1, etc.) shown in Formula 3 and Formula 4 below indicate pixel values of pixels to which the same alphabet is assigned in FIG. “>>” indicates a right shift operation, and “>> 5” corresponds to division by 32. That is, the interpolated pixel at the 1/2 pixel position is calculated using a 6-tap FIR (Finite Impulse Response) filter (tap coefficient: (1, -5, 20, 20, -5, 1) / 32).

また、図15でアルファベットa、dの位置に対応する1/4画素の補間処理は、下記数式4で算出される。
Further, the interpolation processing of ¼ pixels corresponding to the positions of the alphabets a and d in FIG.

このように、1/4画素位置の補間画素は、2タップの平均値フィルタ(タップ係数:(1/2,1/2))を用いて算出される。4つの整数画素位置の中間に存在するアルファベットjに対応する1/2画素の補間処理は、垂直方向6タップ及び水平方向6タップの両方向を用いて生成される。説明した以外の画素位置に対しても同様の方法で、補間画素値が生成される。   In this way, the interpolation pixel at the 1/4 pixel position is calculated using a 2-tap average value filter (tap coefficients: (1/2, 1/2)). The interpolation process of 1/2 pixel corresponding to the alphabet j existing in the middle of the four integer pixel positions is generated by using both directions of 6 taps in the vertical direction and 6 taps in the horizontal direction. Interpolated pixel values are generated in the same manner for pixel positions other than those described.

なお、補間処理は、数式3及び数式4の例に限らず、他の補間係数を用いて生成されても構わない。また、補間係数は、符号化制御部150から与えられる固定の値を用いてもよく、或いは、前述の符号化コストに基づいて、フレーム毎に補間係数を最適化し、最適化された補間係数を用いて生成されても構わない。   Note that the interpolation processing is not limited to the examples of Equation 3 and Equation 4, and may be generated using other interpolation coefficients. The interpolation coefficient may be a fixed value given from the encoding control unit 150, or the interpolation coefficient is optimized for each frame based on the encoding cost described above, and the optimized interpolation coefficient is calculated. May be used.

また、本実施形態では、動き参照ブロックがマクロブロック(例えば、16×16画素ブロック)単位での動きベクトルブロック予測処理に関する処理について述べたが、マクロブロックに限らず、16×8画素ブロック単位、8×16画素ブロック単位、8×8画素ブロック単位、8×4画素ブロック単位、4×8画素ブロック単位又は4×4画素ブロック単位で予測処理が実行されても構わない。この場合、動きベクトルブロックに関する情報は、画素ブロック単位で導出される。また、32×32画素ブロック単位、32×16画素ブロック単位、64×64画素ブロック単位など、16×16画素ブロックより大きい単位で上記の予測処理を行っても構わない。   In the present embodiment, the processing related to motion vector block prediction processing in which a motion reference block is a macroblock (for example, a 16 × 16 pixel block) is described. However, the present invention is not limited to a macroblock, and a 16 × 8 pixel block unit. The prediction process may be executed in units of 8 × 16 pixel blocks, 8 × 8 pixel blocks, 8 × 4 pixel blocks, 4 × 8 pixel blocks, or 4 × 4 pixel blocks. In this case, the information regarding the motion vector block is derived for each pixel block. Further, the above prediction processing may be performed in units larger than 16 × 16 pixel blocks, such as 32 × 32 pixel block units, 32 × 16 pixel block units, and 64 × 64 pixel block units.

動きベクトルブロック内の参照動きベクトルを、符号化対象ブロック内の小画素ブロックの動きベクトルとして代入する際には、(A)参照動きベクトルのマイナス値(反転ベクトル)を代入してもよく、或いは(B)小ブロックに対応する参照動きベクトルと、この参照動きベクトルに隣接する参照動きベクトルを用いた加重平均値若しくはメディアン値、最大値、最小値を代入しても構わない。   When substituting the reference motion vector in the motion vector block as the motion vector of the small pixel block in the encoding target block, (A) a negative value (inversion vector) of the reference motion vector may be substituted, or (B) A weighted average value or median value, maximum value, and minimum value using a reference motion vector corresponding to a small block and a reference motion vector adjacent to the reference motion vector may be substituted.

図16は、予測部101の動作を概略的に示している。図16に示されるように、まず、時間方向参照動きブロックを含む参照フレーム(動き参照フレーム)を取得する(ステップS1501)。動き参照フレームは、典型的には、符号化対象フレームと時間的距離が最も小さい参照フレームであって、時間的に過去の参照フレームである。例えば、動き参照フレームは、符号化対象フレームの直前に符号化されたフレームである。他の例では、動き情報メモリ108に動き情報18が保存されているいずれの参照フレームが動き参照フレームとして取得されても構わない。次に、空間方向動き情報取得部110及び時間方向動き情報取得部111は、各々、利用可能ブロック取得部109から出力された利用可能ブロック情報30を取得する(ステップS1502)。次に、動き情報切替スイッチ112は、例えば数式1に従って、利用可能ブロックの中から1つを選択ブロックとして選択する(ステップS1503)。続いて、動き補償部113は、選択された選択ブロックが有する動き情報を符号化対象ブロックにコピーする(ステップS1504)。このとき、選択ブロックが空間方向参照ブロックである場合には、図17に示されるように、この選択ブロックが有する動き情報18が符号化参照ブロックへコピーされる。また、選択ブロックが時間方向参照ブロックである場合には、この選択ブロックが有する動き情報18の群が位置情報とともに符号化対象ブロックへコピーされる。次に、動き補償部113によってコピーされた動き情報18又は動き情報18の群を用いて、動き補償を実行し、予測画像信号11及び動き補償予測に用いた動き情報18を出力する。   FIG. 16 schematically shows the operation of the prediction unit 101. As shown in FIG. 16, first, a reference frame (motion reference frame) including a temporal direction reference motion block is acquired (step S1501). The motion reference frame is typically a reference frame having the smallest temporal distance from the encoding target frame and is a temporally past reference frame. For example, the motion reference frame is a frame encoded immediately before the encoding target frame. In another example, any reference frame in which the motion information 18 is stored in the motion information memory 108 may be acquired as a motion reference frame. Next, the spatial direction motion information acquisition unit 110 and the temporal direction motion information acquisition unit 111 each acquire the available block information 30 output from the available block acquisition unit 109 (step S1502). Next, the motion information changeover switch 112 selects one of the available blocks as a selected block according to Equation 1, for example (step S1503). Subsequently, the motion compensation unit 113 copies the motion information included in the selected block to be encoded (step S1504). At this time, if the selected block is a spatial direction reference block, as shown in FIG. 17, the motion information 18 included in this selected block is copied to the encoded reference block. If the selected block is a temporal direction reference block, the group of motion information 18 included in the selected block is copied to the encoding target block together with the position information. Next, motion compensation is executed using the motion information 18 or the group of motion information 18 copied by the motion compensation unit 113, and the predicted image signal 11 and the motion information 18 used for motion compensation prediction are output.

図18は、可変長符号化部104のより詳細な構成を示している。可変長符号化部104は、図18に示されるように、パラメータ符号化部114、変換係数符号化部115、選択ブロック符号化部116及び多重化部117を備えている。パラメータ符号化部114は、変換係数情報13及び選択ブロック情報31を除く、予測モード情報、ブロックサイズ情報、量子化パラメータ情報などの復号に必要になるパラメータを符号化し、符号化データ14Aを生成する。変換係数符号化部115は、変換係数情報13を符号化して、符号化データ14Bを生成する。また、選択ブロック符号化部116は、利用可能ブロック情報30を参照して、選択ブロック情報31を符号化し、符号化データ14Cを生成する。   FIG. 18 shows a more detailed configuration of the variable length coding unit 104. As shown in FIG. 18, the variable length coding unit 104 includes a parameter coding unit 114, a transform coefficient coding unit 115, a selected block coding unit 116, and a multiplexing unit 117. The parameter encoding unit 114 encodes parameters necessary for decoding, such as prediction mode information, block size information, and quantization parameter information, excluding the transform coefficient information 13 and the selected block information 31, and generates encoded data 14A. . The transform coefficient encoding unit 115 encodes the transform coefficient information 13 to generate encoded data 14B. In addition, the selected block encoding unit 116 encodes the selected block information 31 with reference to the available block information 30, and generates encoded data 14C.

利用可能ブロック情報30が、図19に示すように、インデクスとインデクスに対応する動き参照ブロックの利用可能性とを含む場合、予め設定された複数の動き参照ブロックのうち、利用不可能である動き参照ブロックを除外して、利用可能である動き参照ブロックのみをシンタクス(stds_idx)に変換する。図19では、9つの動き参照ブロックのうちの5つの動き参照ブロックが利用不可能であるので、これらを除外した4つの動き参照ブロックに対して、シンタクスstds_idxが0から順番に割り当てられる。この例では、符号化すべき選択ブロック情報は、9つから選択するのではなく、4つの利用可能ブロックから選択することになるので、割り当てる符号量(bin数)は、平均的に少なく済む。   As shown in FIG. 19, when the available block information 30 includes an index and availability of a motion reference block corresponding to the index, a motion that cannot be used among a plurality of preset motion reference blocks. Excluding the reference block, only the available motion reference block is converted into syntax (stds_idx). In FIG. 19, five motion reference blocks out of nine motion reference blocks cannot be used, and syntax stds_idx is assigned in order from 0 to four motion reference blocks excluding these. In this example, since the selected block information to be encoded is not selected from nine, but is selected from four available blocks, the allocated code amount (bin number) can be reduced on average.

図20は、シンタクスstds_idx及びシンタクスstds_idxの2値情報(bin)を示す符号表の一例を示す。図18に示されるように、利用可能な動き参照ブロックの数が少なければ少ないほど、シンタクスstds_idxの符号化に必要な平均のbin数は、低減される。例えば、利用可能ブロックの数が4である場合、シンタクスstds_idxは、3ビット以下で表わすことができる。シンタクスstds_idxの2値情報(bin)は、利用可能ブロック数毎に全てのstds_idxが同じbin数となるよう2値化されてもよく、事前学習によって定められた2値化方法に従って2値化されても構わない。また、複数の2値化方法が用意され、符号化対象ブロック毎に適用的に切り替えられても構わない。   FIG. 20 illustrates an example of a code table indicating binary information (bin) of syntax stds_idx and syntax stds_idx. As shown in FIG. 18, the smaller the number of available motion reference blocks, the lower the average number of bins required for encoding the syntax stds_idx. For example, when the number of available blocks is 4, the syntax stds_idx can be represented by 3 bits or less. The binary information (bin) of the syntax stds_idx may be binarized so that every stds_idx has the same bin number for every number of usable blocks, and binarized according to a binarization method determined by prior learning. It doesn't matter. Also, a plurality of binarization methods may be prepared and switched appropriately for each encoding target block.

これらの符号化部114、115、116には、エントロピー符号化(例えば等長符号化、ハフマン符号化若しくは算術符号化など)が適用されることができ、生成された符号化データ14A、14B、14Cは、多重化部117によって多重化されて出力される。   Entropy coding (for example, isometric coding, Huffman coding, arithmetic coding, etc.) can be applied to these coding units 114, 115, 116, and the generated coded data 14A, 14B, 14C is multiplexed by the multiplexing unit 117 and output.

本実施形態では、符号化対象フレームより1フレーム前に符号化されたフレームを参照フレームとして参照する例を想定して説明しているが、選択ブロックが有する参照動き情報19中の動きベクトル及び参照フレーム番号を用いて、動きベクトルをスケーリング(又は、正規化)して、参照動き情報19が符号化対象ブロックへ適用されても構わない。   In the present embodiment, the description is given assuming an example in which a frame encoded one frame before the encoding target frame is referred to as a reference frame. However, the motion vector and reference in the reference motion information 19 included in the selected block are described. The motion vector may be scaled (or normalized) using the frame number, and the reference motion information 19 may be applied to the encoding target block.

このスケーリング処理について、図21を参照して具体的に説明する。図21に示すtcは、符号化対象フレームと動き参照フレームとの時間距離(POC(ディスプレイ順序を示す番号)距離)を示し、下記数式5により算出される。図21に示すtr[i]は、動き参照フレームと選択ブロックが参照するフレームiとの時間距離を示し、下記数式6により算出される。
This scaling processing will be specifically described with reference to FIG. Tc shown in FIG. 21 indicates a time distance (POC (number indicating the display order) distance) between the encoding target frame and the motion reference frame, and is calculated by the following Equation 5. Tr [i] shown in FIG. 21 indicates a time distance between the motion reference frame and the frame i referred to by the selected block, and is calculated by the following Equation 6.

ここで、curPOCは符号化対象フレームのPOC(Picture Order Count)を示し、colPOCは動き参照フレームのPOCを示し、refPOCは選択ブロックが参照するフレームiのPOCを示している。また、Clip(min,max,target)はtargetがminより小さい値になる場合にはminを出力し、maxより大きい値になる場合にはmaxを出力し、それ以外の場合にはtargetを出力するクリップ関数である。また、DiffPicOrderCnt(x,y)は2つのPOCの差分を計算する関数である。   Here, curPOC indicates the POC (Picture Order Count) of the encoding target frame, colPOC indicates the POC of the motion reference frame, and refPOC indicates the POC of the frame i referenced by the selected block. Clip (min, max, target) outputs min if target is less than min, outputs max if it is greater than max, and outputs target otherwise. This is a clip function. DiffPicOrderCnt (x, y) is a function for calculating the difference between two POCs.

選択ブロックの動きベクトルをMVr=(MVr_x,MVr_y)とし、符号化対象ブロックへ適用する動きベクトルをMV=(MV_x,MV_y)とすると、下記数式7により動きベクトルMVが算出される。
If the motion vector of the selected block is MVr = (MVr_x, MVr_y) and the motion vector to be applied to the encoding target block is MV = (MV_x, MV_y), the motion vector MV is calculated by Equation 7 below.

ここで、Abs(x)はxの絶対値を取り出す関数を示す。このようにして、動きベクトルのスケーリングでは、選択ブロックに割り当てられている動きベクトルMVrが符号化対象フレームと動き第1参照フレームとの間の動きベクトルMVに変換される。   Here, Abs (x) represents a function for extracting the absolute value of x. In this manner, in motion vector scaling, the motion vector MVr assigned to the selected block is converted into a motion vector MV between the encoding target frame and the motion first reference frame.

また、動きベクトルのスケーリングに関する他の例を以下に説明する。
まず、スライス又はフレーム毎に、下記数式8に従って、動き参照フレームが取りうる全ての時間距離trに関してスケーリング係数(DistScaleFactor[i])を求める。スケーリング係数の数は、選択ブロックが参照するフレームの数、即ち、参照フレームの数と等しい。
In addition, another example relating to scaling of motion vectors will be described below.
First, for each slice or frame, a scaling coefficient (DistScaleFactor [i]) is obtained for all time distances tr that the motion reference frame can take according to the following Equation 8. The number of scaling factors is equal to the number of frames referenced by the selected block, that is, the number of reference frames.

数式8に示すtxの計算については、予めテーブル化しておいても構わない。   The calculation of tx shown in Equation 8 may be tabulated in advance.

符号化対象ブロック毎のスケーリングの際には、下記数式9を用いることにより、乗算、加算、シフト演算のみで動きベクトルMVを計算することができる。
When scaling for each block to be encoded, the motion vector MV can be calculated only by multiplication, addition, and shift operation by using the following formula 9.

このようなスケーリング処理を施した場合、予測部101とともに利用可能ブロック取得部109の処理に、スケーリング後の動き情報18を適用する。スケーリング処理を施した場合、符号化対象ブロックが参照する参照フレームは、動き参照フレームとなる。   When such scaling processing is performed, the motion information 18 after scaling is applied to the processing of the usable block acquisition unit 109 together with the prediction unit 101. When the scaling process is performed, the reference frame referred to by the encoding target block is a motion reference frame.

図22は、画像符号化部100におけるシンタクス構造を示している。図22に示されるように、シンタクスは、主に3つのパート、即ち、ハイレベルシンタクス901、スライスレベルシンタクス904及びマクロブロックレベルシンタクス907を含む。ハイレベルシンタクス901は、スライス以上の上位レイヤのシンタクス情報を保持している。スライスレベルシンタクス904は、スライス毎に必要な情報を保持し、マクロブロックレベルシンタクス907は、図7Aから図7Dに示されるマクロブロック毎に必要とされるデータを保持している。   FIG. 22 shows a syntax structure in the image encoding unit 100. As shown in FIG. 22, the syntax mainly includes three parts, namely, a high level syntax 901, a slice level syntax 904, and a macroblock level syntax 907. The high-level syntax 901 holds higher layer syntax information above the slice. The slice level syntax 904 holds information necessary for each slice, and the macroblock level syntax 907 holds data required for each macroblock shown in FIGS. 7A to 7D.

各パートは、さらに詳細なシンタクスを含む。ハイレベルシンタクス901は、シーケンスパラメータセットシンタクス902及びピクチャパラメータセットシンタクス903などのシーケンス及びピクチャレベルのシンタクスを含む。スライスレベルシンタクス904は、スライスヘッダーシンタクス905及びスライスデータシンタクス906などを含む。さらに、マクロブロックレベルシンタクス907は、マクロブロックレイヤーシンタクス908及びマクロブロックプレディクションシンタクス909などを含む。   Each part includes more detailed syntax. High level syntax 901 includes sequence and picture level syntax such as sequence parameter set syntax 902 and picture parameter set syntax 903. The slice level syntax 904 includes a slice header syntax 905, a slice data syntax 906, and the like. Further, the macroblock level syntax 907 includes a macroblock layer syntax 908, a macroblock prediction syntax 909, and the like.

図23A及び図23Bは、マクロブロックレイヤーシンタクスの例を示している。図23A及び図23Bに示すavailable_block_numは、利用可能ブロックの数を示しており、これが1より大きい値の場合は、選択ブロック情報の符号化が必要となる。さらに、stds_idxは、選択ブロック情報を示しており、前述した利用可能ブロック数に応じた符号表を用いてstds_idxを符号化する。   23A and 23B show examples of macroblock layer syntax. The available_block_num shown in FIGS. 23A and 23B indicates the number of available blocks. If this is a value larger than 1, the selected block information needs to be encoded. Furthermore, stds_idx indicates selected block information, and stds_idx is encoded using the above-described code table corresponding to the number of available blocks.

図23Aは、mb_typeの後に選択ブロック情報を符号化する場合のシンタクスを示している。mb_typeが示すモードが定められたサイズや定められたモード(TARGET_MODE)の場合で、かつavailable_block_numが1より大きい値の場合に、stds_idxを符号化する。例えば、選択ブロックの動き情報が利用可能となるのが、ブロックサイズが64×64画素、32×32画素、16×16画素の場合や、ダイレクトモードの場合にstds_idxを符号化する。   FIG. 23A shows the syntax when the selected block information is encoded after mb_type. When the mode indicated by mb_type is a defined size or a defined mode (TARGET_MODE), and available_block_num is a value greater than 1, stds_idx is encoded. For example, stds_idx is encoded when the motion information of the selected block is available when the block size is 64 × 64 pixels, 32 × 32 pixels, 16 × 16 pixels, or in the direct mode.

図23Bは、mb_typeの前に選択ブロック情報を符号化する場合のシンタクスを示している。available_block_numが1より大きい値の場合に、stds_idxを符号化する。また、available_block_num が0ならば、H.264に代表される従来の動き補償を行うのでmb_typeを符号化する。   FIG. 23B shows the syntax when the selected block information is encoded before mb_type. When available_block_num is a value larger than 1, stds_idx is encoded. If available_block_num is 0, H. Since conventional motion compensation represented by H.264 is performed, mb_type is encoded.

なお、図23A及び図23Bに示す表の行間には、本発明で規定していないシンタクス要素が挿入されることも可能であるし、それ以外の条件分岐に関する記述が含まれていても構わない。或いは、シンタクステーブルを複数のテーブルに分割、統合することも可能である。また、必ずしも同一の用語を用いる必要は無く、利用する形態によって任意に変更しても構わない。更に、当該マクロブロックレイヤーシンタクスに記述されている各々のシンタクスエレメントは、後述するマクロブロックデータシンタクスに明記されるように変更しても構わない。   It should be noted that syntax elements not defined in the present invention can be inserted between the rows of the tables shown in FIGS. 23A and 23B, and other conditional branch descriptions may be included. . Alternatively, the syntax table can be divided and integrated into a plurality of tables. Moreover, it is not always necessary to use the same term, and it may be arbitrarily changed depending on the form to be used. Further, each syntax element described in the macroblock layer syntax may be changed as specified in a macroblock data syntax described later.

また、stds_idxの情報を利用することでmb_typeの情報を削減することが可能である。図24Aは、H.264におけるBスライス時のmb_type及びmb_typeに対応する符号表である。図24Aに示されるNは、16,32,64などの、符号化対象ブロックのサイズを表す値であり、MはNの半分の値である。従って、mb_typeが4〜21である場合、符号化対象ブロックは長方形ブロックであることを示している。また、図24AのL0,L1,Biは、夫々単方向予測(List0方向のみ)、単方向予測(List1方向のみ)、双方向予測を示している。符号化対象ブロックが長方形ブロックである場合、mb_typeは、符号化対象ブロック内の2つの長方形ブロックの各々に対して、L0,L1,Biのいずれの予測が行われたかを示す情報を含む。また、B_Subは、マクロブロックを4分割した画素ブロックの各々に対して上記処理を行うことを意味する。例えば、符号化対象ブロックが64×64画素マクロブロックである場合、符号化対象ブロックは、このマクロブロックを4分割して得られる4つの32×32画素ブロック毎に、mb_typeをさらに割り当てられて符号化される。   Further, it is possible to reduce mb_type information by using stds_idx information. FIG. 2 is a code table corresponding to mb_type and mb_type at the time of B slice in H.264. N shown in FIG. 24A is a value representing the size of the block to be encoded, such as 16, 32, 64, and M is half the value of N. Therefore, when mb_type is 4 to 21, it indicates that the encoding target block is a rectangular block. Also, L0, L1, and Bi in FIG. 24A indicate unidirectional prediction (List0 direction only), unidirectional prediction (List1 direction only), and bidirectional prediction, respectively. When the encoding target block is a rectangular block, mb_type includes information indicating which of L0, L1, and Bi is predicted for each of the two rectangular blocks in the encoding target block. B_Sub means that the above process is performed on each pixel block obtained by dividing a macroblock into four. For example, when the encoding target block is a 64 × 64 pixel macroblock, the encoding target block is further encoded with mb_type assigned to each of four 32 × 32 pixel blocks obtained by dividing the macroblock into four. It becomes.

ここで、stds_idxが示す選択ブロックがSpatial Left(符号化対象ブロックの左側に隣接する画素ブロック)である場合には、符号化対象ブロックの左側に隣接する画素ブロックの動き情報を符号化対象ブロックの動き情報とするので、stds_idxは、図24Aのmb_type=4,6,8,10,12,14,16,18,20が示す横長の長方形ブロックを使用して、符号化対象ブロックに対して予測を実行することと等しい意味を持つ。また、stds_idxが示す選択ブロックがSpatial Upの場合には、符号化対象ブロックの上側に隣接する動き情報を符号化対象ブロックの動き情報とするので、stds_idxは、図24Aのmb_type=5,7,9,11,13,15,17,19,21が示す縦長の長方形ブロックで予測を実行することと等しい意味を持つ。従って、stds_idxを利用することにより、図24Bに示すような図24Aのmb_type=4〜21の欄を削減した符号表を作成することが可能である。同様に、図24Cに示すH.264におけるPスライス時のmb_type及びmb_typeに対応する符号表に関しても、図24Dに示すようなmb_typeの数を削減した符号表を作成することが可能である。   If the selected block indicated by stds_idx is Spatial Left (a pixel block adjacent to the left side of the encoding target block), the motion information of the pixel block adjacent to the left side of the encoding target block is Since it is motion information, stds_idx is predicted for the encoding target block using horizontally long rectangular blocks indicated by mb_type = 4, 6, 8, 10, 12, 14, 16, 18, 20 in FIG. 24A. Is equivalent to executing When the selected block indicated by stds_idx is Spatial Up, the motion information adjacent to the upper side of the block to be encoded is used as the motion information of the block to be encoded, so stds_idx is mb_type = 5,7, This has the same meaning as executing the prediction on the vertically long rectangular block indicated by 9,11,13,15,17,19,21. Therefore, by using stds_idx, it is possible to create a code table in which the columns of mb_type = 4 to 21 in FIG. 24A as shown in FIG. 24B are reduced. Similarly, H.264 shown in FIG. As for the code table corresponding to mb_type and mb_type at the time of P slice in H.264, a code table with a reduced number of mb_types as shown in FIG. 24D can be created.

また、stds_idxの情報をmb_typeの情報に含めて符号化しても構わない。図25Aは、stds_idxの情報をmb_typeの情報に含めた場合の符号表であって、Bスライスにおけるmb_type及びmb_typeに対応する符号表の一例を示している。図25AのB_STDS_X(X=0,1,2)は、stds_idxに相当するモードを示し、利用可能ブロック数の分だけB_STDS_Xが追加される(図25Aでは、利用可能ブロック数は3である)。同様にPスライスに関するmb_typeの他の例を図25Bに示す。図25Bの説明は、Bスライスと同様であるために省略する。   Also, stds_idx information may be included in mb_type information for encoding. FIG. 25A is a code table when stds_idx information is included in mb_type information, and shows an example of a code table corresponding to mb_type and mb_type in a B slice. B_STDS_X (X = 0, 1, 2) in FIG. 25A indicates a mode corresponding to stds_idx, and B_STDS_X is added by the number of available blocks (in FIG. 25A, the number of available blocks is 3). Similarly, FIG. 25B shows another example of mb_type related to the P slice. The description of FIG. 25B is omitted because it is similar to the B slice.

mb_typeの順序及び2値化方法(bin化)は、図25A及び図25Bに示す例に限られず、他の順序及び2値化方法に従ってmb_typeが符号化されても構わない。B_STDS_X及びP_STDS_Xは、連続している必要はなく、各mb_typeの間に配置されていても構わない。また、2値化方法(bin化)は、予め学習された選択頻度に基づいて設計しても構わない。   The order of mb_type and the binarization method (binization) are not limited to the examples shown in FIGS. 25A and 25B, and mb_type may be encoded according to another order and binarization method. B_STDS_X and P_STDS_X do not need to be continuous and may be arranged between each mb_type. Also, the binarization method (binization) may be designed based on the selection frequency learned in advance.

本実施形態では、マクロブロックを複数個まとめて動き補償予測を行う拡張マクロブロックにおいても、本発明は適応可能である。また、本実施形態では、符号化のスキャン順についてはどのような順序でも構わない。例えば、ラインスキャン又はZスキャンなどに対しても、本発明は適応可能である。   In the present embodiment, the present invention can also be applied to an extended macroblock that performs motion compensation prediction by collecting a plurality of macroblocks. In the present embodiment, any order may be used for the scan order of encoding. For example, the present invention can be applied to a line scan or a Z scan.

以上のように、本実施形態に係る画像符号化装置は、複数の動き参照ブロックから利用可能ブロックを選択し、選択した利用可能ブロックの数に応じて、符号化対象ブロックに適用する動き参照ブロックを特定するための情報を生成し、この情報を符号化している。従って、本実施形態に係る画像符号化装置によれば、動きベクトル情報に関する符号量を削減しながらも、符号化対象ブロックよりも細かな小画素ブロック単位で動き補償を行えるため、高い符号化効率を実現することができる。   As described above, the image coding apparatus according to the present embodiment selects an available block from a plurality of motion reference blocks, and applies a motion reference block to an encoding target block according to the selected number of available blocks. The information for specifying is generated, and this information is encoded. Therefore, according to the image coding apparatus according to the present embodiment, it is possible to perform motion compensation in units of small pixel blocks that are finer than the current block while reducing the amount of code related to motion vector information. Can be realized.

(第2の実施形態)
図26は、本発明の第2の実施形態に係る画像符号化装置を示している。第2の実施形態では、第1の実施形態と異なる部分及び動作について主に説明する。本実施形態に係る画像符号化部200は、図26に示されるように、第1の実施形態とは予測部201及び可変長符号化部204の構成が異なる。予測部201は、図27に示すように、第1予測部101及び第2予測部202を備え、これら第1及び第2予測部101、202を選択的に切り替えて予測画像信号11を生成する。第1予測部101は、第1の実施形態に係る予測部101(図1)と同じ構成を有し、選択ブロックが有する動き情報18を用いて動き補償する予測方式(第1予測方式)に従って、予測画像信号11を生成する。第2予測部202は、符号化対象ブロックに対して、1つの動きベクトルを用いて動き補償する、H.264のような予測方式(第2予測方式)に従って、予測画像信号11を生成する。第2予測部202は、入力画像信号10及びフレームメモリからの参照画像信号17を使用して、予測画像信号11Bを生成する。
(Second Embodiment)
FIG. 26 shows an image encoding device according to the second embodiment of the present invention. In the second embodiment, parts and operations different from those in the first embodiment will be mainly described. As shown in FIG. 26, the image coding unit 200 according to the present embodiment is different from the first embodiment in the configuration of a prediction unit 201 and a variable length coding unit 204. As illustrated in FIG. 27, the prediction unit 201 includes a first prediction unit 101 and a second prediction unit 202, and selectively generates a predicted image signal 11 by selectively switching the first and second prediction units 101 and 202. . The first prediction unit 101 has the same configuration as the prediction unit 101 (FIG. 1) according to the first embodiment, and follows a prediction method (first prediction method) that performs motion compensation using the motion information 18 included in the selected block. The prediction image signal 11 is generated. The second prediction unit 202 performs motion compensation on the current block using one motion vector. The predicted image signal 11 is generated according to a prediction method (second prediction method) such as H.264. The second prediction unit 202 uses the input image signal 10 and the reference image signal 17 from the frame memory to generate a predicted image signal 11B.

図28は、第2予測部202の構成を概略的に示している。第2予測部202は、図28に示されるように、入力画像信号10及び参照画像信号17を使用して動き情報21を生成する動き情報取得部205、並びに、参照画像信号17及び動き情報21を使用して予測画像信号11Aを生成する動き補償部113(図1)を備えている。この動き情報取得部205は、入力画像信号10及び参照画像信号17に基づいて、例えばブロックマッチングによって、符号化対象ブロックに割り当てるべき動きベクトルを求める。マッチングの評価基準としては、入力画像信号10とマッチング後の補間画像との差分を画素毎に累積した値を用いる。   FIG. 28 schematically shows the configuration of the second prediction unit 202. As shown in FIG. 28, the second prediction unit 202 includes a motion information acquisition unit 205 that generates the motion information 21 using the input image signal 10 and the reference image signal 17, and the reference image signal 17 and the motion information 21. Is used to generate a predicted image signal 11A. The motion information acquisition unit 205 obtains a motion vector to be assigned to the encoding target block based on the input image signal 10 and the reference image signal 17 by, for example, block matching. As an evaluation criterion for matching, a value obtained by accumulating the difference between the input image signal 10 and the interpolated image after matching for each pixel is used.

なお、動き情報取得部205は、予測画像信号11と入力画像信号10との差分を変換した値を使用して、最適な動きベクトルを決定しても構わない。また、動きベクトルの大きさ、並びに、動きベクトル及び参照フレーム番号の符号量を考慮して、或いは、数式1を使用して最適な動きベクトルが決定されても構わない。マッチング方法は、画像符号化装置の外部から提供される探索範囲情報に基づいて実行されてもよく、画素精度毎に階層的に実行されても構わない。また、探索処理を行わず、符号化制御部150によって与えられた動き情報を動き情報取得部205の出力21としても構わない。   Note that the motion information acquisition unit 205 may determine an optimal motion vector using a value obtained by converting the difference between the predicted image signal 11 and the input image signal 10. Further, an optimal motion vector may be determined in consideration of the size of the motion vector and the amount of code of the motion vector and the reference frame number, or using Equation 1. The matching method may be executed based on search range information provided from the outside of the image encoding device, or may be executed hierarchically for each pixel accuracy. Further, the motion information given by the encoding control unit 150 may be used as the output 21 of the motion information acquisition unit 205 without performing the search process.

図27の予測部101は、第1予測部101からの予測画像信号11A及び第2予測部202からの予測画像信号11Bのいずれか一方を選択して出力する予測方法切替スイッチ203をさらに備えている。例えば、予測方法切替スイッチ203は、予測画像信号11A及び11B毎に、入力画像信号10を使用して、例えば数式1に従って、符号化コストを求め、符号化コストがより小さくなるように、予測画像信号11A及び11Bのいずれか一方を選択して予測画像信号11として出力する。さらに、予測方法切替スイッチ203は、動き情報18及び選択ブロック情報31とともに、出力した予測画像信号11が第1予測部101及び第2予測部202のいずれかから出力されたものかを示す予測切替情報32も出力する。出力された動き情報18は、可変長符号化部204によって符号化された後、符号化データ14に多重化される。   The prediction unit 101 in FIG. 27 further includes a prediction method changeover switch 203 that selects and outputs one of the prediction image signal 11A from the first prediction unit 101 and the prediction image signal 11B from the second prediction unit 202. Yes. For example, the prediction method changeover switch 203 uses the input image signal 10 for each of the predicted image signals 11A and 11B to obtain an encoding cost according to, for example, Equation 1 so that the prediction image becomes smaller. One of the signals 11A and 11B is selected and output as the predicted image signal 11. Further, the prediction method changeover switch 203, together with the motion information 18 and the selected block information 31, predictive switching indicating whether the output predicted image signal 11 is output from either the first prediction unit 101 or the second prediction unit 202. Information 32 is also output. The output motion information 18 is encoded by the variable length encoding unit 204 and then multiplexed on the encoded data 14.

図29は、可変長符号化部204の構成を概略的に示している。図29に示した可変長符号化部204は、図18に示した可変長符号化部104の構成に加えて、動き情報符号化部217を備えている。また、図29の選択ブロック符号化部216は、図18の選択ブロック符号化部116と異なり、予測切替情報32を符号化して、符号化データ14Dを生成する。予測処理を第1予測部101が実行した場合には、選択ブロック符号化部216は、利用可能ブロック情報30及び選択ブロック情報31をさらに符号化する。符号化された利用可能ブロック情報30及び選択ブロック情報31は、符号化データ14Dに含まれる。予測処理を第2予測部202が実行した場合には、動き情報符号化部217が動き情報18を符号化し、符号化データ14Eを生成する。選択ブロック符号化部216及び動き情報符号化部217は、各々、予測画像が選択ブロックの動き情報を用いた動き補償予測により生成されたかどうかを示す予測切替情報32に基づいて、予測処理を第1予測部101及び第2予測部202のどちらが実行されたかを判定する。   FIG. 29 schematically shows the configuration of the variable length coding unit 204. The variable length encoding unit 204 illustrated in FIG. 29 includes a motion information encoding unit 217 in addition to the configuration of the variable length encoding unit 104 illustrated in FIG. 29, unlike the selected block encoding unit 116 in FIG. 18, the selected block encoding unit 216 encodes the prediction switching information 32 to generate encoded data 14D. When the first prediction unit 101 executes the prediction process, the selected block encoding unit 216 further encodes the available block information 30 and the selected block information 31. The encoded usable block information 30 and the selected block information 31 are included in the encoded data 14D. When the second prediction unit 202 executes the prediction process, the motion information encoding unit 217 encodes the motion information 18 and generates encoded data 14E. Each of the selected block encoding unit 216 and the motion information encoding unit 217 performs a prediction process based on prediction switching information 32 indicating whether or not a predicted image has been generated by motion compensated prediction using the motion information of the selected block. It is determined which one of the first prediction unit 101 and the second prediction unit 202 has been executed.

多重化部117は、パラメータ符号化部114、変換係数符号化部115、選択ブロック符号化部216及び動き情報符号化部から符号化データ14A,B,D,Eを受け取り、受け取った符号化データ14A,B,D,Eを多重化する。   The multiplexing unit 117 receives the encoded data 14A, B, D, E from the parameter encoding unit 114, the transform coefficient encoding unit 115, the selected block encoding unit 216, and the motion information encoding unit, and receives the encoded data 14A, B, D, E are multiplexed.

図30A及び図30Bは、各々、本実施形態に係るマクロブロックレイヤーシンタクスの例を示している。図30Aに示されるavailable_block_numは、利用可能ブロックの数を示し、これが1より大きい値の場合、選択ブロック符号化部216は、選択ブロック情報31を符号化する。また、stds_flagは、動き補償予測において選択ブロックの動き情報を符号化対象ブロックの動き情報として使用したか否かを示すフラグ、即ち、予測方法切替スイッチ203が第1予測部101及び第2予測部202のどちらを選択したかを示すフラグである。利用可能ブロックの数が1より大きく、かつ、stds_flagが1である場合、選択ブロックが有する動き情報を動き補償予測に使用したことを示す。また、stds_flagが0の場合、選択ブロックが有する動き情報を利用せずに、H.264と同様に動き情報18の情報を直接もしくは予測した差分値を符号化する。さらに、stds_idxは、選択ブロック情報を示しており、利用可能ブロック数に応じた符号表は、前述したとおりである。   FIG. 30A and FIG. 30B each show an example of the macroblock layer syntax according to the present embodiment. The available_block_num shown in FIG. 30A indicates the number of available blocks. When this is a value greater than 1, the selected block encoding unit 216 encodes the selected block information 31. Also, stds_flag is a flag indicating whether or not the motion information of the selected block is used as motion information of the encoding target block in motion compensation prediction, that is, the prediction method changeover switch 203 is the first prediction unit 101 and the second prediction unit. A flag indicating which of 202 is selected. When the number of available blocks is larger than 1 and stds_flag is 1, it indicates that the motion information of the selected block is used for motion compensation prediction. If stds_flag is 0, the motion information of the selected block is not used and Similarly to H.264, a difference value obtained by directly or predicting the information of motion information 18 is encoded. Furthermore, stds_idx indicates selected block information, and the code table corresponding to the number of usable blocks is as described above.

図30Aは、mb_typeの後に選択ブロック情報を符号化する場合のシンタクスを示している。mb_typeが示すモードが定められたサイズや定められたモードの場合にのみ、stds_flag及びstds_idxを符号化する。例えば、選択ブロックの動き情報が利用可能となるのが、ブロックサイズが64×64、32×32、16×16の場合や、ダイレクトモードの場合に、stds_flag及びstds_idxを符号化する。   FIG. 30A shows the syntax when the selected block information is encoded after mb_type. Only when the mode indicated by mb_type is a predetermined size or a predetermined mode, stds_flag and stds_idx are encoded. For example, stds_flag and stds_idx are encoded when the motion information of the selected block is available when the block size is 64 × 64, 32 × 32, 16 × 16, or in the direct mode.

図30Bは、mb_typeの前に選択ブロック情報を符号化する場合のシンタクスを示している。例えばstds_flagが1である場合、mb_typeは符号化される必要はない。stds_flagが0である場合、mb_typeは符号化される。   FIG. 30B shows the syntax when the selected block information is encoded before mb_type. For example, when stds_flag is 1, mb_type does not need to be encoded. If stds_flag is 0, mb_type is encoded.

以上のように、第2の実施形態に係る画像符号化装置は、符号化コストが小さくなるように、第1の実施形態に係る第1予測部101と、H.264等の予測方式を利用する第2予測部202とを、選択的に切り替えて、入力画像信号を圧縮符号化している。従って、第2の実施形態に係る画像符号化装置においては、第1の実施形態の画像符号化装置より符号化効率が向上している。   As described above, the image coding apparatus according to the second embodiment uses the first prediction unit 101 according to the first embodiment and the prediction scheme such as H.264 so that the coding cost is reduced. The input image signal is compressed and encoded by selectively switching between the second prediction unit 202 and the second prediction unit 202. Therefore, in the image coding apparatus according to the second embodiment, the coding efficiency is improved as compared with the image coding apparatus according to the first embodiment.

(第3の実施形態)
図31は、第3の実施形態に係る画像復号化装置を概略的に示している。この画像復号化装置は、図31に示されるように、画像復号化部300、復号化制御部350及び出力バッファ308を備えている。画像復号化部300は、復号化制御部350により制御される。第3の実施形態に係る画像復号化装置は、第1の実施形態に係る画像符号化装置に対応する。即ち、図31の画像復号化装置による復号処理は、図1の画像符号化処理による符号化処理と相補的な関係を有している。図31の画像復号化装置は、LSIチップなどのハードウェアにより実現されてもよく、或いは、コンピュータに画像復号化プログラムを実行させることにより実現されても構わない。
(Third embodiment)
FIG. 31 schematically shows an image decoding apparatus according to the third embodiment. As shown in FIG. 31, the image decoding apparatus includes an image decoding unit 300, a decoding control unit 350, and an output buffer 308. The image decoding unit 300 is controlled by the decoding control unit 350. An image decoding apparatus according to the third embodiment corresponds to the image encoding apparatus according to the first embodiment. That is, the decoding process by the image decoding apparatus in FIG. 31 has a complementary relationship with the encoding process by the image encoding process in FIG. The image decoding device in FIG. 31 may be realized by hardware such as an LSI chip, or may be realized by causing a computer to execute an image decoding program.

図31の画像復号化装置は、符号化列復号化部301、逆量子化・逆変換部302、加算器303、フレームメモリ304、予測部305、動き情報メモリ306及び利用可能ブロック取得部307を備えている。画像復号化部300において、図示しない蓄積系又は伝送系からの符号化データ80は、符号化列復号化部301に入力される。この符号化データ80は、例えば、図1の画像符号化装置から多重化された状態で送出された符号化データ14に対応する。   The image decoding apparatus in FIG. 31 includes an encoded sequence decoding unit 301, an inverse quantization / inverse conversion unit 302, an adder 303, a frame memory 304, a prediction unit 305, a motion information memory 306, and an available block acquisition unit 307. I have. In the image decoding unit 300, encoded data 80 from a storage system or transmission system (not shown) is input to the encoded string decoding unit 301. The encoded data 80 corresponds to, for example, the encoded data 14 transmitted in a multiplexed state from the image encoding device in FIG.

本実施形態では、復号化対象である画素ブロック(例えば、マクロブロック)を単に復号化対象ブロックと称す。また、復号化対象ブロックを含む画像フレームを復号化対象フレームと称す。   In the present embodiment, a pixel block (for example, a macro block) that is a decoding target is simply referred to as a decoding target block. An image frame including a decoding target block is referred to as a decoding target frame.

符号化列復号化部301では、1フレーム又は1フィールド毎に、シンタクスに基づいて、構文解析による解読が行われる。具体的には、符号化列復号化部301は、各シンタクスの符号列を順次、可変長復号化し、変換係数情報33、選択ブロック情報61、並びにブロックサイズ情報及び予測モード情報などの予測情報を含む、復号化対象ブロックに関する符号化パラメータなどを復号する。   The encoded sequence decoding unit 301 performs decoding by syntax analysis based on the syntax for each frame or field. Specifically, the coded sequence decoding unit 301 sequentially performs variable length decoding on the code sequence of each syntax, and provides prediction information such as transform coefficient information 33, selected block information 61, block size information, and prediction mode information. Including the encoding parameters relating to the decoding target block.

本実施形態において、復号化パラメータは、変換係数33、選択ブロック情報61及び予測情報を含み、変換係数に関する情報、量子化に関する情報などの復号の際に必要になるあらゆるパラメータを含む。予測情報、変換係数に関する情報、及び量子化に関する情報は、制御情報71として復号化制御部350へ入力される。復号化制御部350は、予測情報及び量子化パラメータなどの復号化に必要なパラメータを含む復号化制御情報70を、画像復号化部300の各部に与える。   In the present embodiment, the decoding parameters include the transform coefficient 33, the selected block information 61, and the prediction information, and include all parameters necessary for decoding such as information about the transform coefficient and information about the quantization. Prediction information, information on transform coefficients, and information on quantization are input to the decoding control unit 350 as control information 71. The decoding control unit 350 gives the decoding control information 70 including parameters necessary for decoding such as prediction information and quantization parameters to each unit of the image decoding unit 300.

さらに、符号化列復号化部301は、後に説明するように、符号化データ80を同時に復号化して、予測情報及び選択ブロック情報61を得る。動きベクトル及び参照フレーム番号を含む動き情報38は、復号化されなくても構わない。   Further, the encoded sequence decoding unit 301 simultaneously decodes the encoded data 80 to obtain prediction information and selected block information 61, as will be described later. The motion information 38 including the motion vector and the reference frame number may not be decoded.

符号化列復号化部301によって解読された変換係数33は、逆量子化・逆変換部302へ送られる。符号化列復号化部301によって解読された量子化に関する種々の情報、即ち、量子化パラメータ及び量子化マトリクスは、復号化制御部350に与えられ、逆量子化する際に逆量子化・逆変換部302にロードされる。逆量子化・逆変換部302は、ロードされた量子化に関する情報に従って、変換係数33を逆量子化し、続いて逆変換処理(例えば、逆離散コサイン変換など)を施して、予測誤差信号34を得る。図31の逆量子化・逆変換部302による逆変換処理は、図1の変換・量子化部による変換処理の逆変換である。例えば、画像符号化装置(図1)によりウェーブレット変換が施される場合、逆量子化・逆変換部302は、対応する逆量子化及び逆ウェーブレット変換を実行する。   The transform coefficient 33 decoded by the encoded sequence decoding unit 301 is sent to the inverse quantization / inverse transform unit 302. Various information relating to the quantization decoded by the coded sequence decoding unit 301, that is, the quantization parameter and the quantization matrix are given to the decoding control unit 350, and when the inverse quantization is performed, the inverse quantization / inverse transformation is performed. Loaded into the unit 302. The inverse quantization / inverse transform unit 302 inversely quantizes the transform coefficient 33 according to the loaded information related to quantization, and then performs inverse transform processing (for example, inverse discrete cosine transform) to obtain the prediction error signal 34. obtain. The inverse transform process by the inverse quantization / inverse transform unit 302 in FIG. 31 is an inverse transform of the transform process by the transform / quantization unit in FIG. For example, when the wavelet transform is performed by the image encoding device (FIG. 1), the inverse quantization / inverse transform unit 302 executes the corresponding inverse quantization and inverse wavelet transform.

逆量子化・逆変換部302によって復元された予測誤差信号34は、加算器303へ入力される。加算器303は、予測誤差信号34と、後述する予測部305で生成された予測画像信号35と加算して、復号画像信号36を生成する。生成された復号画像信号36は、画像復号化部300から出力されて、出力バッファ308に一旦蓄積された後、復号化制御部350が管理する出力タイミングに従って、出力される。また、この復号画像信号36は、フレームメモリ304に参照画像信号37として格納される。参照画像信号37は、フレームメモリ304から、フレーム毎或いはフィールド毎に順次読み出され、予測部305へ入力される。   The prediction error signal 34 restored by the inverse quantization / inverse transform unit 302 is input to the adder 303. The adder 303 adds the prediction error signal 34 and the prediction image signal 35 generated by the prediction unit 305 described later to generate a decoded image signal 36. The generated decoded image signal 36 is output from the image decoding unit 300, temporarily stored in the output buffer 308, and then output according to the output timing managed by the decoding control unit 350. The decoded image signal 36 is stored as a reference image signal 37 in the frame memory 304. The reference image signal 37 is sequentially read from the frame memory 304 for each frame or field and is input to the prediction unit 305.

利用可能ブロック取得部307は、後述する動き情報メモリ306から参照動き情報39を受け取り、利用可能ブロック情報60を出力する。利用可能ブロック取得部307の動作は、第1の実施形態で説明した利用可能ブロック取得部109(図1)と同様である。   The available block acquisition unit 307 receives reference motion information 39 from a motion information memory 306 described later, and outputs usable block information 60. The operation of the available block acquisition unit 307 is the same as that of the available block acquisition unit 109 (FIG. 1) described in the first embodiment.

動き情報メモリ306は、予測部305から動き情報38を受け取り、参照動き情報39として一時的に格納する。動き情報メモリ306は、予測部305から出力された動き情報38を参照動き情報39として一時保存する。図4は、動き情報メモリ306の一例を示す。動き情報メモリ306は、符号化時間の異なる複数の動き情報フレーム26を保持している。復号化が終了した動き情報38又は動き情報38の群は、参照動き情報39として復号化時間に対応した動き情報フレーム26に保存される。動き情報フレーム26では、参照動き情報39は、例えば4×4画素ブロック単位で保存されている。動き情報メモリ306が保持している参照動き情報39は、予測部305によって、復号化対象ブロックの動き情報38を生成する際に読み出され参照される。   The motion information memory 306 receives the motion information 38 from the prediction unit 305 and temporarily stores it as reference motion information 39. The motion information memory 306 temporarily stores the motion information 38 output from the prediction unit 305 as reference motion information 39. FIG. 4 shows an example of the motion information memory 306. The motion information memory 306 holds a plurality of motion information frames 26 having different encoding times. The motion information 38 or the group of motion information 38 that has been decoded is stored as reference motion information 39 in the motion information frame 26 corresponding to the decoding time. In the motion information frame 26, the reference motion information 39 is stored, for example, in units of 4 × 4 pixel blocks. The reference motion information 39 held in the motion information memory 306 is read and referenced by the prediction unit 305 when generating the motion information 38 of the decoding target block.

次に、本実施形態に係る動き参照ブロック及び利用可能ブロックを説明する。動き参照ブロックは、既に復号化済みの領域の中から前述の画像符号化装置及び画像復号化装置によって予め定められた方法に従って選択される候補ブロックである。図8Aは、利用可能ブロックに関する一例を示している。図8Aでは、復号化対象フレーム内の4つの動き参照ブロック及び参照フレーム内の5つの動き参照ブロックの、合計9つの動き参照ブロックが配置されている。図8Aの復号化対象フレーム内の動き参照ブロックA,B,C,Dは、復号化対象ブロックに対して、左、上、右上、左上に隣接するブロックである。本実施形態では、復号化対象ブロックを含む復号化対象フレームの中から選択された動き参照ブロックを、空間方向動き参照ブロックと称す。また、参照フレーム内の動き参照ブロックTAは、参照フレーム内の、復号化対象ブロックと同じ位置の画素ブロックであり、この動き参照ブロックTAに接している画素ブロックTB,TC,TD,TEが動き参照ブロックとして選択される。参照フレーム内の画素ブロックの中から選択された動き参照ブロックを、時間方向動き参照ブロックと称す。また、時間方向動き参照ブロックが位置するフレームを動き参照フレームと称す。   Next, the motion reference block and the available block according to the present embodiment will be described. The motion reference block is a candidate block that is selected from the already decoded regions according to a predetermined method by the above-described image encoding device and image decoding device. FIG. 8A shows an example regarding an available block. In FIG. 8A, a total of nine motion reference blocks of four motion reference blocks in the decoding target frame and five motion reference blocks in the reference frame are arranged. The motion reference blocks A, B, C, and D in the decoding target frame in FIG. 8A are blocks adjacent to the decoding target block on the left, upper, upper right, and upper left. In the present embodiment, a motion reference block selected from decoding target frames including a decoding target block is referred to as a spatial direction motion reference block. The motion reference block TA in the reference frame is a pixel block at the same position as the decoding target block in the reference frame, and the pixel blocks TB, TC, TD, TE in contact with the motion reference block TA are moved. Selected as a reference block. A motion reference block selected from among the pixel blocks in the reference frame is referred to as a temporal direction motion reference block. A frame in which the temporal direction motion reference block is located is referred to as a motion reference frame.

空間方向動き参照ブロックは、図8Aに示される例に限らず、図8B示すように、復号化対象ブロックに隣接する画素a,b,c,dが属する画素ブロックが、空間方向動き参照ブロックとして選択されても構わない。この場合、復号化対象ブロック内の左上画素に対する画素a,b,c,dの相対位置(dx,dy)は、図8Cに示される。   The spatial direction motion reference block is not limited to the example shown in FIG. 8A. As shown in FIG. 8B, the pixel block to which the pixels a, b, c, and d adjacent to the decoding target block belong is used as the spatial direction motion reference block. It does not matter if it is selected. In this case, the relative positions (dx, dy) of the pixels a, b, c, d with respect to the upper left pixel in the decoding target block are shown in FIG. 8C.

また、図8Dに示されるように、復号化対象ブロックに隣接するすべての画素ブロックA1〜A4,B1,B2,C,Dが、空間方向動き参照ブロックとして選択されても構わない。図8Dでは、空間方向動き参照ブロックの数は8である。   Further, as illustrated in FIG. 8D, all the pixel blocks A1 to A4, B1, B2, C, and D adjacent to the decoding target block may be selected as the spatial direction motion reference block. In FIG. 8D, the number of spatial direction motion reference blocks is eight.

また、時間方向動き参照ブロックTA〜TEは、図8Eに示すように、互いに部分的に重なり合っていてもよく、図8Fに示すように、各々が互いに離れていても構わない。また、時間方向動き参照ブロックは、必ずしもCollocate位置のブロック及びその周囲に位置する必要はなく、動き参照フレーム内であればいずれの位置の画素ブロックであっても構わない。例えば、復号化対象ブロックに隣接する既に復号化済みのブロックの動き情報を利用して、動き情報に含まれる動きベクトルが指し示す参照ブロックを動き参照ブロックの中心(例えば、ブロックTA)として選択しても構わない。さらに、時間方向の参照ブロックは、等間隔に配置されていなくても構わない。   Further, the temporal direction motion reference blocks TA to TE may partially overlap each other as shown in FIG. 8E, or may be separated from each other as shown in FIG. 8F. In addition, the temporal direction motion reference block does not necessarily need to be located around the block at the Collocate position, and may be a pixel block at any position within the motion reference frame. For example, using the motion information of an already decoded block adjacent to the decoding target block, the reference block indicated by the motion vector included in the motion information is selected as the center of the motion reference block (for example, block TA). It doesn't matter. Furthermore, the reference blocks in the time direction may not be arranged at equal intervals.

上述したような動き参照ブロックを選択する方法においては、画像復号化装置及び画像復号化装置の両方で空間方向及び時間方向動き参照ブロックの数及び位置に関する情報を共有していれば、動き参照ブロックがいずれの数及び位置から選択されても構わない。また、動き参照ブロックのサイズは、必ずしも復号化対象ブロックと同じサイズである必要はない。例えば図8Dに示すように、動き参照ブロックのサイズが復号化対象ブロックのサイズよりも大きくてもよく、小さくてもよく、任意のサイズであっても構わない。また、動き参照ブロックの形状は、正方形状に限らず、長方形状であっても構わない。   In the method for selecting a motion reference block as described above, if both the image decoding apparatus and the image decoding apparatus share information on the number and position of spatial direction and temporal direction motion reference blocks, the motion reference block May be selected from any number and position. The size of the motion reference block is not necessarily the same size as the decoding target block. For example, as illustrated in FIG. 8D, the size of the motion reference block may be larger than the size of the decoding target block, may be smaller, or may be an arbitrary size. The shape of the motion reference block is not limited to a square shape, and may be a rectangular shape.

次に、利用可能ブロックについて説明する。利用可能ブロックは、動き参照ブロックの中から選択された画素ブロックであって、復号化対象ブロックへ動き情報を適用可能な画素ブロックである。利用可能ブロックは、互いに異なる動き情報を有している。利用可能ブロックは、例えば図8Aに示されるような復号化対象フレーム及び参照フレーム内の合計9つの動き参照ブロックに対して、図9に示す利用可能ブロック判定処理を実行することによって、選択される。図10は、図9に示す利用可能ブロック判定処理を実行した結果を示している。図10では、斜線を施された画素ブロックが利用不可能ブロックを示し、白塗りのブロックが利用可能ブロックを示す。即ち、空間方向動き参照ブロックの中から2つ、時間方向動き参照ブロックの中から2つの、合計4つが利用可能ブロックとして判定されている。予測部305内の動き情報選択部314は、選択ブロック復号化部323から受け取った選択ブロック情報61に従って、時間及び空間方向に配置されているこれらの利用可能ブロックの中から最適な1つ利用可能ブロックを選択ブロックとして選択する。   Next, available blocks will be described. The available block is a pixel block selected from the motion reference blocks, and is a pixel block to which motion information can be applied to the decoding target block. The available blocks have different motion information. The available blocks are selected by executing the available block determination process shown in FIG. 9 for a total of nine motion reference blocks in the decoding target frame and the reference frame as shown in FIG. 8A, for example. . FIG. 10 shows the result of executing the available block determination process shown in FIG. In FIG. 10, a shaded pixel block indicates an unusable block, and a white block indicates an available block. That is, two of the spatial direction motion reference blocks and two of the temporal direction motion reference blocks are determined as usable blocks. The motion information selection unit 314 in the prediction unit 305 can use one of the available blocks arranged in the temporal and spatial directions according to the selected block information 61 received from the selected block decoding unit 323. Select a block as the selected block.

次に、利用可能ブロック取得部307について説明する。利用可能ブロック取得部307は、第1の実施形態の利用可能ブロック取得部109と同一の機能を持ち、参照動き情報39を動き情報メモリ306から取得し、動き参照ブロック毎に利用可能ブロック又は利用不可能ブロックを示す情報である利用可能ブロック情報60を出力する。   Next, the available block acquisition unit 307 will be described. The available block acquisition unit 307 has the same function as the available block acquisition unit 109 of the first embodiment, acquires the reference motion information 39 from the motion information memory 306, and can be used or used for each motion reference block. The available block information 60, which is information indicating an impossible block, is output.

利用可能ブロック取得部307の動作を図9のフローチャートを参照して説明する。まず、利用可能ブロック取得部307は、動き参照ブロック(インデクスp)が動き情報を有するか否かを判定する(ステップS801)。即ち、ステップS801では、動き参照ブロックp内の少なくとも1つの小画素ブロックが動き情報を有しているか否かが判定される。動き参照ブロックpが動き情報を有していないと判定された場合、即ち、時間方向動き参照ブロックが動き情報のないIスライス内のブロックあるか、或いは、時間方向動き参照ブロック内の全ての小画素ブロックがイントラ予測復号化されている場合、ステップS805に進む。ステップS805において、この動き参照ブロックpは、利用不可能ブロックと判定される。   The operation of the available block acquisition unit 307 will be described with reference to the flowchart of FIG. First, the available block acquisition unit 307 determines whether or not the motion reference block (index p) has motion information (step S801). That is, in step S801, it is determined whether or not at least one small pixel block in the motion reference block p has motion information. When it is determined that the motion reference block p does not have motion information, that is, the temporal motion reference block is a block in the I slice without motion information, or all the small blocks in the temporal motion reference block If the pixel block has been subjected to intra prediction decoding, the process proceeds to step S805. In step S805, the motion reference block p is determined as an unusable block.

ステップS801で動き参照ブロックpが動き情報を有すと判定された場合、利用可能ブロック取得部307は、既に利用可能ブロックと判定されている動き参照ブロックq(利用可能ブロックqと称す)を選定する(ステップS802)。ここで、qはpより小さい値である。続いて、利用可能ブロック取得部307は、全てのqに対して、この動き参照ブロックpの動き情報と、利用可能ブロックqの動き情報とを比較して、動き参照ブロックpが利用可能ブロックqと同一の動き情報を有しているか否かを判定する(S803)。動き参照ブロックpが利用可能ブロックqと同一の動きベクトルを有している場合、ステップS805に進み、ステップS805において、この動き参照ブロックpは、利用可能ブロック取得部307によって、利用不可能ブロックと判定される。動き参照ブロックpが全ての利用可能ブロックqと異なる動き情報を有している場合、ステップS804において、この動き参照ブロックpは、利用可能ブロック取得部307によって、利用可能ブロックと判定される。   When it is determined in step S801 that the motion reference block p has motion information, the available block acquisition unit 307 selects a motion reference block q (referred to as an available block q) that has already been determined as an available block. (Step S802). Here, q is a value smaller than p. Subsequently, the available block acquisition unit 307 compares the motion information of the motion reference block p with the motion information of the available block q for all q, and the motion reference block p can use the available block q. It is determined whether or not the same motion information is included (S803). If the motion reference block p has the same motion vector as that of the available block q, the process proceeds to step S805. In step S805, the motion reference block p is converted into an unavailable block by the available block acquisition unit 307. Determined. When the motion reference block p has motion information different from all the available blocks q, the motion reference block p is determined as an available block by the available block acquisition unit 307 in step S804.

上述した利用可能ブロック判定処理を全ての動き参照ブロックに対して実行することにより、動き参照ブロック毎に利用可能ブロックか利用不可能ブロックかが判定され、利用可能ブロック情報60が生成される。利用可能ブロック情報60の一例が、図11に示されている。利用可能ブロック情報60は、図11に示されるように、動き参照ブロックのインデクスp及び利用可能性を含む。図11では、利用可能ブロック情報60は、インデクスpが0,1,5及び8である動き参照ブロックが利用可能ブロックとして選択されたことを示し、利用可能ブロックの数は4である。   By executing the above-described usable block determination process for all the motion reference blocks, it is determined for each motion reference block whether the block is usable or unavailable, and usable block information 60 is generated. An example of the usable block information 60 is shown in FIG. The available block information 60 includes the index p and availability of the motion reference block, as shown in FIG. In FIG. 11, the usable block information 60 indicates that motion reference blocks whose indexes p are 0, 1, 5 and 8 are selected as usable blocks, and the number of usable blocks is four.

なお、図9のステップS801において、時間方向動き参照ブロックp内のブロックのうちの少なくとも1つがイントラ予測符号化されたブロックであった場合、利用可能ブロック取得部307は、動き参照ブロックpを利用不可能ブロックと判定しても構わない。即ち、時間方向動き参照ブロックp内の全てのブロックがインター予測で符号化されている場合のみ、ステップS802に進むようにしても構わない。   Note that, in step S801 in FIG. 9, when at least one of the blocks in the temporal direction motion reference block p is an intra prediction encoded block, the available block acquisition unit 307 uses the motion reference block p. It may be determined as an impossible block. In other words, the process may proceed to step S802 only when all the blocks in the temporal direction motion reference block p are encoded by inter prediction.

図12Aから図12Eは、ステップS803の動き情報38の比較において、動き参照ブロックpの動き情報38と、利用可能ブロックqの動き情報38とが同一であると判定される例を示す。図12Aから図12Eには、各々、斜線が施された複数のブロックと、2つの白塗りのブロックとが示されている。図12Aから図12Eでは、説明を簡単にするために、斜線が施されたブロックを考慮せずに、これらの2つの白塗りのブロックの動き情報38を比較する場合を想定している。2つの白塗りのブロックの一方が、動き参照ブロックpであり、他方が既に利用可能と判定されている動き参照ブロックq(利用可能ブロックq)であるものとする。特に断りのない限り、2つの白色ブロックのいずれが動き参照ブロックpであっても構わない。   12A to 12E show an example in which it is determined that the motion information 38 of the motion reference block p and the motion information 38 of the available block q are the same in the comparison of the motion information 38 in step S803. 12A to 12E each show a plurality of hatched blocks and two white blocks. In FIG. 12A to FIG. 12E, in order to simplify the description, it is assumed that the motion information 38 of these two white blocks is compared without considering the shaded blocks. One of the two white blocks is a motion reference block p, and the other is a motion reference block q (usable block q) that has already been determined to be usable. Unless otherwise specified, any of the two white blocks may be the motion reference block p.

図12Aは、動き参照ブロックp及び利用可能ブロックqの両方が空間方向のブロックである例を示している。図12Aの例では、ブロックA及びBの動き情報38が同一であれば、動き情報38が同一であると判定される。このとき、ブロックA及びBのサイズが同一である必要はない。   FIG. 12A shows an example in which both the motion reference block p and the available block q are spatial blocks. In the example of FIG. 12A, if the motion information 38 of the blocks A and B is the same, it is determined that the motion information 38 is the same. At this time, the sizes of the blocks A and B do not have to be the same.

図12Bは、動き参照ブロックp及び利用可能ブロックqの一方が空間方向のブロックAであり、他方が時間方向のブロックTBである例を示している。図12Bでは、時間方向のブロックTB内に動き情報を有するブロックが1つある。時間方向のブロックTBの動き情報38と空間方向のブロックAの動き情報38とが同一であれば、動き情報38が同一であると判定される。このとき、ブロックA及びTBのサイズが同一である必要はない。   FIG. 12B illustrates an example in which one of the motion reference block p and the available block q is the block A in the spatial direction, and the other is the block TB in the temporal direction. In FIG. 12B, there is one block having motion information in the block TB in the time direction. If the motion information 38 of the block TB in the time direction and the motion information 38 of the block A in the spatial direction are the same, it is determined that the motion information 38 is the same. At this time, the sizes of the blocks A and TB do not have to be the same.

図12Cは、動き参照ブロックp及び利用可能ブロックqの一方が空間方向のブロックAであり、他方が時間方向のブロックTBである他の例を示している。図12Cは、時間方向のブロックTBが複数の小ブロックに分割されていて、動き情報38を有する小ブロックが複数ある場合を示している。図12Cの例では、動き情報38を有する全てのブロックが同じ動き情報38を有し、その動き情報38が空間方向のブロックAの動き情報38と同一であれば、動き情報38が同一であると判定される。このとき、ブロックA及びTBのサイズが同一である必要はない。   FIG. 12C shows another example in which one of the motion reference block p and the available block q is a block A in the spatial direction and the other is a block TB in the temporal direction. FIG. 12C shows a case where the block TB in the time direction is divided into a plurality of small blocks and there are a plurality of small blocks having the motion information 38. In the example of FIG. 12C, if all the blocks having the motion information 38 have the same motion information 38 and the motion information 38 is the same as the motion information 38 of the block A in the spatial direction, the motion information 38 is the same. It is determined. At this time, the sizes of the blocks A and TB do not have to be the same.

図12Dは、動き参照ブロックp及び利用可能ブロックqがともに時間方向のブロックである例を示している。この場合、ブロックTB及びTEの動き情報38が同一であれば、動き情報38が同一であると判定される。   FIG. 12D illustrates an example in which both the motion reference block p and the available block q are temporal blocks. In this case, if the motion information 38 of the blocks TB and TE is the same, it is determined that the motion information 38 is the same.

図12Eは、動き参照ブロックp及び利用可能ブロックqがともに時間方向のブロックである他の例を示している。図12Eは、時間方向のブロックTB及びTEが各々複数の小ブロックに分割されていて、各々に動き情報38を有する小ブロックが複数ある場合を示している。この場合、ブロック内の小ブロック毎に動き情報38を比較して、全ての小ブロックに対し動き情報38が同一であれば、ブロックTBの動き情報38とブロックTEの動き情報38とが同一であると判定される。   FIG. 12E shows another example in which the motion reference block p and the available block q are both temporal blocks. FIG. 12E shows a case where the blocks TB and TE in the time direction are each divided into a plurality of small blocks, and there are a plurality of small blocks each having motion information 38. In this case, the motion information 38 is compared for each small block in the block, and if the motion information 38 is the same for all the small blocks, the motion information 38 of the block TB and the motion information 38 of the block TE are the same. It is determined that there is.

図12Fは、動き参照ブロックp及び利用可能ブロックqがともに時間方向のブロックであるさらに他の例を示している。図12Fは、時間方向のブロックTEが複数の小ブロックに分割されていて、ブロックTEに動き情報38を有する小ブロックが複数ある場合を示している。ブロックTEの全ての動き情報38が同一の動き情報38であり、且つ、ブロックTDが有する動き情報38と同一である場合、ブロックTDとTEの動き情報38が同一であると判定される。   FIG. 12F illustrates still another example in which the motion reference block p and the available block q are both temporal blocks. FIG. 12F shows a case where the block TE in the time direction is divided into a plurality of small blocks, and there are a plurality of small blocks having the motion information 38 in the block TE. When all the motion information 38 of the block TE is the same motion information 38 and is the same as the motion information 38 included in the block TD, it is determined that the motion information 38 of the blocks TD and TE is the same.

このようにして、ステップS803では、動き参照ブロックpの動き情報38と利用可能ブロックqの動き情報38とが同一であるか否かが判定される。図12Aから図12Fの例では、動き参照ブロックpと比較する利用可能ブロックqの数を1として説明したが、利用可能ブロックqの数が2以上の場合においては、動き参照ブロックpの動き情報38と、各々の利用可能ブロックqの動き情報38とを比較しても構わない。また、後述するスケーリングを適用する場合、スケーリング後の動き情報38が上記説明の動き情報38となる。   In this way, in step S803, it is determined whether or not the motion information 38 of the motion reference block p and the motion information 38 of the available block q are the same. In the example of FIGS. 12A to 12F, the number of available blocks q to be compared with the motion reference block p has been described as 1. However, when the number of available blocks q is 2 or more, the motion information of the motion reference block p 38 may be compared with the motion information 38 of each available block q. When scaling described later is applied, the motion information 38 after scaling becomes the motion information 38 described above.

なお、動き参照ブロックpの動き情報と利用可能ブロックqの動き情報とが同一であるという判定は、動き情報に含まれる各動きベクトルが完全に一致する場合に限定されることはない。例えば、2つの動きベクトルの差のノルムが所定の範囲内であれば、動き参照ブロックpの動き情報と利用可能ブロックqの動き情報とが実質的に同一であるとみなしても構わない。   Note that the determination that the motion information of the motion reference block p and the motion information of the available block q are the same is not limited to the case where the motion vectors included in the motion information completely match. For example, if the norm of the difference between two motion vectors is within a predetermined range, the motion information of the motion reference block p and the motion information of the available block q may be regarded as substantially the same.

図32は、符号化列復号化部301をより詳細に示すブロック図である。符号化列復号化部301は、図32に示されるように、符号化データ80をシンタクス単位に分離する分離部320、変換係数を復号化する変換係数復号化部322、選択ブロック情報を復号化する選択ブロック復号化部323、並びに、予測ブロックサイズ及び量子化に関するパラメータなどを復号化するパラメータ復号化部321を備えている。   FIG. 32 is a block diagram showing the encoded sequence decoding unit 301 in more detail. As shown in FIG. 32, the encoded sequence decoding unit 301 separates the encoded data 80 into syntax units, a separating unit 320, a transform coefficient decoding unit 322 for decoding transform coefficients, and decoding selected block information. And a parameter decoding unit 321 that decodes a prediction block size, a parameter relating to quantization, and the like.

パラメータ復号化部321は、分離部から、予測ブロックサイズ及び量子化に関するパラメータを含む符号化データ80Aを受け取り、符号化データ80Aを復号化して制御情報71を生成する。変換係数復号化部322は、分離部320から、符号化されている変換係数80Bを受け取り、この符号化されている変換係数80Bを復号化し、変換係数情報33を得る。選択ブロック復号化部323は、選択ブロックに関する符号化データ80C及び利用可能ブロック情報60を入力として、選択ブロック情報61を出力する。入力の利用可能ブロック情報60は、図11に示すように、動き参照ブロック毎の利用可能性を示す。   The parameter decoding unit 321 receives the encoded data 80A including the prediction block size and the parameters related to quantization from the demultiplexing unit, and generates the control information 71 by decoding the encoded data 80A. The transform coefficient decoding unit 322 receives the encoded transform coefficient 80B from the separation unit 320, decodes the encoded transform coefficient 80B, and obtains transform coefficient information 33. The selected block decoding unit 323 receives the encoded data 80C relating to the selected block and the available block information 60 as inputs, and outputs selected block information 61. The input available block information 60 indicates the availability for each motion reference block, as shown in FIG.

次に、図33を参照して、予測部305を詳細に説明する。
予測部305は、図33に示すように、動き情報選択部314及び動き補償部313を備え、動き情報選択部314は、空間方向動き情報取得部310、時間方向動き情報取得部311及び動き情報切替スイッチ312を備える。予測部305は、基本的には、第1の実施形態で説明した予測部101と同一の構成及び機能を持つ。
Next, the prediction unit 305 will be described in detail with reference to FIG.
As illustrated in FIG. 33, the prediction unit 305 includes a motion information selection unit 314 and a motion compensation unit 313. The motion information selection unit 314 includes a spatial direction motion information acquisition unit 310, a time direction motion information acquisition unit 311, and motion information. A changeover switch 312 is provided. The prediction unit 305 basically has the same configuration and function as the prediction unit 101 described in the first embodiment.

予測部305は、利用可能ブロック情報60、選択ブロック情報61、参照動き情報39及び参照画像信号37を入力として、予測画像信号35及び動き情報38を出力する。空間方向動き情報取得部310及び時間方向動き情報取得部311は、夫々第1の実施形態で説明した空間方向動き情報取得部110及び時間方向動き情報取得部111と同一の機能を持つ。空間方向動き情報取得部310は、利用可能ブロック情報60及び参照動き情報39を使用して、空間方向に位置する各利用可能ブロックの動き情報及びインデクスを含む動き情報38Aを生成する。時間方向動き情報取得部311は、利用可能ブロック情報60及び参照動き情報39を使用して、時間方向に位置する各利用可能ブロックの動き情報及びインデクスを含む動き情報(又は、動き情報の群)38Bを生成する。   The prediction unit 305 receives the available block information 60, the selected block information 61, the reference motion information 39, and the reference image signal 37, and outputs a predicted image signal 35 and motion information 38. The spatial direction motion information acquisition unit 310 and the temporal direction motion information acquisition unit 311 have the same functions as the spatial direction motion information acquisition unit 110 and the temporal direction motion information acquisition unit 111 described in the first embodiment, respectively. The spatial direction motion information acquisition unit 310 uses the available block information 60 and the reference motion information 39 to generate motion information 38A including motion information and an index for each available block located in the spatial direction. The time direction motion information acquisition unit 311 uses the available block information 60 and the reference motion information 39, and motion information (or a group of motion information) including motion information and an index of each available block located in the time direction. 38B is generated.

動き情報切替スイッチ312では、選択ブロック情報61に従って、空間方向動き情報取得部310からの動き情報38A及び時間方向動き情報取得部311からの動き情報(又は、動き情報の群)38Bの中から1つを選択し、動き情報38を得る。選択された動き情報38は、動き補償部313及び動き情報メモリ306へ送られる。動き補償部313は、選択された動き情報38に従って、第1の実施形態で説明した動き補償部113と同様に動き補償予測を行い、予測画像信号35を生成する。   In the motion information changeover switch 312, one of the motion information 38 A from the spatial direction motion information acquisition unit 310 and the motion information (or group of motion information) 38 B from the time direction motion information acquisition unit 311 is selected according to the selected block information 61. The motion information 38 is obtained. The selected motion information 38 is sent to the motion compensation unit 313 and the motion information memory 306. The motion compensation unit 313 performs motion compensation prediction according to the selected motion information 38 in the same manner as the motion compensation unit 113 described in the first embodiment, and generates a predicted image signal 35.

動き補償部313の動きベクトルのスケーリング機能においては、第1の実施形態に説明したものと同様であるので説明を省略する。   The motion vector scaling function of the motion compensation unit 313 is the same as that described in the first embodiment, and a description thereof will be omitted.

図22は、画像復号化部300におけるシンタクス構造を示している。図22に示されるように、シンタクスは、主に3つのパート、即ち、ハイレベルシンタクス901、スライスレベルシンタクス904及びマクロブロックレベルシンタクス907を含む。ハイレベルシンタクス901は、スライス以上の上位レイヤのシンタクス情報を保持している。スライスレベルシンタクス904は、スライス毎に必要な情報を保持し、マクロブロックレベルシンタクス907は、図7Aから図7Dに示されるマクロブロック毎に必要とされるデータを保持している。   FIG. 22 shows a syntax structure in the image decoding unit 300. As shown in FIG. 22, the syntax mainly includes three parts, namely, a high level syntax 901, a slice level syntax 904, and a macroblock level syntax 907. The high-level syntax 901 holds higher layer syntax information above the slice. The slice level syntax 904 holds information necessary for each slice, and the macroblock level syntax 907 holds data required for each macroblock shown in FIGS. 7A to 7D.

各パートは、さらに詳細なシンタクスを含む。ハイレベルシンタクス901は、シーケンスパラメータセットシンタクス902及びピクチャパラメータセットシンタクス903などのシーケンス及びピクチャレベルのシンタクスを含む。スライスレベルシンタクス904は、スライスヘッダーシンタクス905及びスライスデータシンタクス906などを含む。さらに、マクロブロックレベルシンタクス907は、マクロブロックレイヤーシンタクス908及びマクロブロックプレディクションシンタクス909などを含む。   Each part includes more detailed syntax. High level syntax 901 includes sequence and picture level syntax such as sequence parameter set syntax 902 and picture parameter set syntax 903. The slice level syntax 904 includes a slice header syntax 905, a slice data syntax 906, and the like. Further, the macroblock level syntax 907 includes a macroblock layer syntax 908, a macroblock prediction syntax 909, and the like.

図23A及び図23Bは、マクロブロックレイヤーシンタクスの例を示している。図23A及び図23Bに示すavailable_block_numは、利用可能ブロックの数を示しており、これが1より大きい値の場合は、選択ブロック情報の復号化が必要となる。さらに、stds_idxは、選択ブロック情報を示しており、前述した利用可能ブロック数に応じた符号表を用いてstds_idxを符号化する。   23A and 23B show examples of macroblock layer syntax. The available_block_num shown in FIGS. 23A and 23B indicates the number of available blocks. When this is a value larger than 1, the selected block information needs to be decoded. Furthermore, stds_idx indicates selected block information, and stds_idx is encoded using the above-described code table corresponding to the number of available blocks.

図23Aは、mb_typeの後に選択ブロック情報を復号化する場合のシンタクスを示している。mb_typeが示す予測モードが定められたサイズや定められたモード(TARGET_MODE)の場合で、かつavailable_block_numが1より大きい値の場合に、stds_idxを復号化する。例えば、選択ブロックの動き情報が利用可能となるのが、ブロックサイズが64×64画素、32×32画素、16×16画素の場合や、ダイレクトモードの場合にstds_idxを符号化する。   FIG. 23A shows syntax when decoding selected block information after mb_type. When the prediction mode indicated by mb_type is a predetermined size or a predetermined mode (TARGET_MODE), and available_block_num is a value larger than 1, stds_idx is decoded. For example, stds_idx is encoded when the motion information of the selected block is available when the block size is 64 × 64 pixels, 32 × 32 pixels, 16 × 16 pixels, or in the direct mode.

図23Bは、mb_typeの前に選択ブロック情報を復号化する場合のシンタクスを示している。available_block_numが1より大きい値の場合に、stds_idxを復号化する。また、available_block_num が0ならば、H.264に代表される従来の動き補償を行うのでmb_typeを符号化する。   FIG. 23B shows the syntax when the selected block information is decoded before mb_type. When available_block_num is greater than 1, stds_idx is decoded. If available_block_num is 0, H. Since conventional motion compensation represented by H.264 is performed, mb_type is encoded.

図23A及び図23Bに示す表の行間には、本発明で規定していないシンタクス要素が挿入されることも可能であるし、それ以外の条件分岐に関する記述が含まれていても構わない。或いは、シンタクステーブルを複数のテーブルに分割、統合することも可能である。また、必ずしも同一の用語を用いる必要は無く、利用する形態によって任意に変更しても構わない。更に、当該マクロブロックレイヤーシンタクスに記述されている各々のシンタクスエレメントは、後述するマクロブロックデータシンタクスに明記されるように変更しても構わない。   A syntax element not defined in the present invention can be inserted between the rows of the tables shown in FIGS. 23A and 23B, or other conditional branch descriptions can be included. Alternatively, the syntax table can be divided and integrated into a plurality of tables. Moreover, it is not always necessary to use the same term, and it may be arbitrarily changed depending on the form to be used. Further, each syntax element described in the macroblock layer syntax may be changed as specified in a macroblock data syntax described later.

以上のように、本実施形態に係る画像復号化装置は、前述した第1の実施形態に係る画像符号化装置によって符号化された画像を復号化している。従って、本実施形態に係る画像復号化は、比較的小さな符号化データから高画質な復号画像を再生することができる。   As described above, the image decoding apparatus according to the present embodiment decodes the image encoded by the image encoding apparatus according to the first embodiment described above. Therefore, the image decoding according to the present embodiment can reproduce a high-quality decoded image from relatively small encoded data.

(第4の実施形態)
図34は、第4の実施形態に係る画像復号化装置を概略的に示している。画像復号化装置は、図34に示されるように、画像復号化部400、復号化制御部350及び出力バッファ308を備える。第4の実施形態に係る画像復号化装置は、第2の実施形態に係る画像符号化装置に対応する。第4の実施形態では、第3の実施形態と異なる部分及び動作について主に説明する。本実施形態に係る画像復号化部400は、図34に示されるように、第3の実施形態とは符号化列復号化部401及び予測部405が異なる。
(Fourth embodiment)
FIG. 34 schematically shows an image decoding apparatus according to the fourth embodiment. As shown in FIG. 34, the image decoding apparatus includes an image decoding unit 400, a decoding control unit 350, and an output buffer 308. An image decoding apparatus according to the fourth embodiment corresponds to the image encoding apparatus according to the second embodiment. In the fourth embodiment, parts and operations different from those of the third embodiment will be mainly described. As shown in FIG. 34, the image decoding unit 400 according to the present embodiment is different from the third embodiment in an encoded sequence decoding unit 401 and a prediction unit 405.

本実施の形態の予測部405は、選択ブロックが有する動き情報を用いて動き補償する予測方式(第1予測方式)と、H.264のような、復号化対象ブロックに対して1つの動きベクトルを用いて動き補償する予測方式(第2予測方式)と、を選択的に切り替えて、予測画像信号35を生成する。   The prediction unit 405 of the present embodiment includes a prediction method (first prediction method) that performs motion compensation using motion information included in the selected block, The prediction image signal 35 is generated by selectively switching a prediction method (second prediction method) such as H.264 that performs motion compensation on a decoding target block using one motion vector.

図35は、符号化列復号化部401をより詳細に示すブロック図である。図35に示す符号化列復号化部401は、図32に示す符号化列復号化部301の構成に加えて、動き情報復号化部424を備えている。また、図35に示した選択ブロック復号化部423は、図32に示した選択ブロック復号化部323と異なり、選択ブロックに関する符号化データ80Cを復号化して、予測切替情報62を得る。予測切替情報62は、図1の画像符号化装置内の予測部101が第1及び第2予測方式のどちらを使用したかを示す。予測部101が第1予測方式を使用したことを予測切替情報62が示す場合、即ち、復号化対象ブロックが第1予測方式で符号化されている場合、選択ブロック復号化部423は、符号化データ80C中の選択ブロック情報を復号化して、選択ブロック情報61を得る。予測部101が第2予測方式を使用したことを予測切替情報62が示す場合、即ち、復号化対象ブロックが第2予測方式で符号化されている場合、選択ブロック復号化部423は選択ブロック情報を復号化せずに、動き情報復号化部424が符号化されている動き情報80Dを復号化し、動き情報40を得る。   FIG. 35 is a block diagram showing the encoded sequence decoding unit 401 in more detail. The encoded sequence decoding unit 401 illustrated in FIG. 35 includes a motion information decoding unit 424 in addition to the configuration of the encoded sequence decoding unit 301 illustrated in FIG. 35, unlike the selected block decoding unit 323 shown in FIG. 32, the selected block decoding unit 423 decodes the encoded data 80C related to the selected block to obtain the prediction switching information 62. The prediction switching information 62 indicates which one of the first and second prediction methods is used by the prediction unit 101 in the image encoding device in FIG. When the prediction switching information 62 indicates that the prediction unit 101 has used the first prediction method, that is, when the decoding target block is encoded by the first prediction method, the selected block decoding unit 423 performs encoding. The selected block information in the data 80C is decoded to obtain selected block information 61. When the prediction switching information 62 indicates that the prediction unit 101 uses the second prediction method, that is, when the decoding target block is encoded by the second prediction method, the selected block decoding unit 423 selects the selected block information. Without decoding the motion information, the motion information decoding unit 424 decodes the encoded motion information 80D to obtain the motion information 40.

図36は、予測部405をより詳細に示すブロック図である。図34に示した予測部405は、第1予測部305、第2予測部410及び予測方法切替スイッチ411を備えている。第2予測部410は、符号化列復号化部401によって復号化された動き情報40及び参照画像信号37を用いて、図33の動き補償部313と同様の動き補償予測を行い、予測画像信号35Bを生成する。第1予測部305は、第3の実施形態で説明した予測部305と同じであり、予測画像信号35Bを生成する。また、予測方法切替スイッチ411は、予測切替情報62に基づいて、第2予測部410からの予測画像信号35B及び第1予測部305からの予測画像信号35Aのうちのいずれか一方を選択して予測部405の予測画像信号35として出力する。同時に、予測方法切替スイッチ411は、選択された第1予測部305若しくは第2予測部410で用いられた動き情報を動き情報38として動き情報メモリ306に送る。   FIG. 36 is a block diagram showing the prediction unit 405 in more detail. A prediction unit 405 illustrated in FIG. 34 includes a first prediction unit 305, a second prediction unit 410, and a prediction method changeover switch 411. The second prediction unit 410 performs motion compensation prediction similar to the motion compensation unit 313 in FIG. 33 using the motion information 40 and the reference image signal 37 decoded by the coded sequence decoding unit 401, and performs the prediction image signal. 35B is generated. The first prediction unit 305 is the same as the prediction unit 305 described in the third embodiment, and generates a predicted image signal 35B. In addition, the prediction method changeover switch 411 selects one of the prediction image signal 35B from the second prediction unit 410 and the prediction image signal 35A from the first prediction unit 305 based on the prediction switching information 62. The prediction image signal 35 of the prediction unit 405 is output. At the same time, the prediction method changeover switch 411 sends the motion information used by the selected first prediction unit 305 or second prediction unit 410 to the motion information memory 306 as motion information 38.

次に、本実施の形態に関するシンタクス構造について、第3の実施形態と異なる点を主に説明する。   Next, regarding the syntax structure relating to the present embodiment, differences from the third embodiment will be mainly described.

図30A及び図30Bは、各々、本実施形態に係るマクロブロックレイヤーシンタクスの例を示している。図30Aに示されるavailable_block_numは、利用可能ブロックの数を示し、これが1より大きい値の場合、選択ブロック復号化部423は、符号化データ80C中の選択ブロック情報を復号化する。また、stds_flagは、動き補償予測において選択ブロックの動き情報を復号化対象ブロックの動き情報として使用したか否かを示すフラグ、即ち、予測方法切替スイッチ411が第1予測部305及び第2予測部410のどちらを選択したかを示すフラグである。利用可能ブロックの数が1より大きく、かつ、stds_flagが1である場合、選択ブロックが有する動き情報を動き補償予測に使用したことを示す。また、stds_flagが0の場合、選択ブロックが有する動き情報を利用せずに、H.264と同様に動き情報の情報を直接もしくは予測した差分値を符号化する。さらに、stds_idxは、選択ブロック情報を示しており、利用可能ブロック数に応じた符号表は、前述したとおりである。   FIG. 30A and FIG. 30B each show an example of the macroblock layer syntax according to the present embodiment. The available_block_num shown in FIG. 30A indicates the number of available blocks. When this is a value larger than 1, the selected block decoding unit 423 decodes the selected block information in the encoded data 80C. Also, stds_flag is a flag indicating whether or not the motion information of the selected block is used as motion information of the decoding target block in motion compensation prediction, that is, the prediction method changeover switch 411 has the first prediction unit 305 and the second prediction unit. This is a flag indicating which of 410 has been selected. When the number of available blocks is larger than 1 and stds_flag is 1, it indicates that the motion information of the selected block is used for motion compensation prediction. If stds_flag is 0, the motion information of the selected block is not used and Similarly to H.264, a difference value obtained by directly or predicting motion information is encoded. Furthermore, stds_idx indicates selected block information, and the code table corresponding to the number of usable blocks is as described above.

図30Aは、mb_typeの後に選択ブロック情報を復号化する場合のシンタクスを示している。mb_typeが示す予測モードが定められたブロックサイズや定められたモードの場合にのみ、stds_flag及びstds_idxを復号化する。例えば、ブロックサイズが64×64、32×32、16×16である場合、或いは、ダイレクトモードの場合、stds_flag及びstds_idxを復号化する。   FIG. 30A shows syntax when decoding selected block information after mb_type. Only when the prediction mode indicated by mb_type is a predetermined block size or a predetermined mode, stds_flag and stds_idx are decoded. For example, when the block size is 64 × 64, 32 × 32, 16 × 16, or in the direct mode, stds_flag and stds_idx are decoded.

図30Bは、mb_typeの前に選択ブロック情報を復号化する場合のシンタクスを示している。例えばstds_flagが1である場合、mb_typeは復号化される必要はない。stds_flag が0である場合、mb_typeは復号化される。   FIG. 30B shows the syntax when the selected block information is decoded before mb_type. For example, when stds_flag is 1, mb_type does not need to be decoded. If stds_flag is 0, mb_type is decoded.

以上のように、本実施形態に係る画像復号化装置は、前述した第2の実施形態に係る画像符号化装置によって符号化された画像を復号化している。従って、本実施形態に係る画像復号化は、比較的小さな符号化データから高画質な復号画像を再生することができる。   As described above, the image decoding apparatus according to the present embodiment decodes the image encoded by the above-described image encoding apparatus according to the second embodiment. Therefore, the image decoding according to the present embodiment can reproduce a high-quality decoded image from relatively small encoded data.

なお、本発明は上記実施形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化できる。また、上記実施形態に開示されている複数の構成要素の適宜な組み合わせにより、種々の発明を形成できる。例えば、実施形態に示される全構成要素から幾つかの構成要素を削除しても構わない。さらに、異なる実施形態にわたる構成要素を適宜組み合わせても構わない。   Note that the present invention is not limited to the above-described embodiment as it is, and can be embodied by modifying the constituent elements without departing from the scope of the invention in the implementation stage. In addition, various inventions can be formed by appropriately combining a plurality of components disclosed in the embodiment. For example, some components may be deleted from all the components shown in the embodiment. Furthermore, you may combine the component covering different embodiment suitably.

この一例として、上述した第1から第4の実施形態を次のように変形しても同様の効果が得られる。   As an example of this, the same effect can be obtained even if the above-described first to fourth embodiments are modified as follows.

(1)第1から第4の実施形態では、処理対象フレームを16×16画素ブロックなどの矩形ブロックに分割し、図4に示したような画面左上の画素ブロックから右下の画素ブロックに向かう順序で、符号化又は復号化する場合を例にとって説明しているが、符号化又は復号化順序は、この例に制限されることはない。例えば、符号化又は復号化順序は、画面右下から左上に向かう順序でもよく、右上から左下に向かう順序でも構わない。また、符号化又は復号化順序は、画面の中央部から周辺部に渦巻状に向かう順序であってもよく、画面の周辺部から中心部に向かう順序であっても構わない。   (1) In the first to fourth embodiments, the processing target frame is divided into rectangular blocks such as 16 × 16 pixel blocks, and the pixel blocks from the upper left pixel block to the lower right pixel block as shown in FIG. Although the case where encoding or decoding is performed in order has been described as an example, the encoding or decoding order is not limited to this example. For example, the encoding or decoding order may be an order from the lower right to the upper left of the screen or an order from the upper right to the lower left. Further, the encoding or decoding order may be a spiral order from the central part of the screen to the peripheral part, or an order from the peripheral part to the central part of the screen.

(2)第1から第4の実施形態では、輝度信号と色差信号とを分割せず、一方の色信号成分に限定した場合を例にとって説明している。しかしながら、輝度信号及び色差信号に対して、異なる予測処理を使用してもよく、或いは、同一の予測処理を使用しても構わない。異なる予測処理を使用する場合、色差信号に対して選択した予測方法を、輝度信号と同様の方法で符号化/復号化する。 (2) In the first to fourth embodiments, the case where the luminance signal and the color difference signal are not divided but limited to one color signal component is described as an example. However, different prediction processes may be used for the luminance signal and the color difference signal, or the same prediction process may be used. When different prediction processes are used, the prediction method selected for the color difference signal is encoded / decoded in the same manner as the luminance signal.

その他、本発明の要旨を逸脱しない範囲で種々の偏見を施しても同様に実施可能であることはいうまでもない。   In addition, it goes without saying that the present invention can be similarly implemented even if various prejudices are given without departing from the gist of the present invention.

本発明に係る画像符号化/復号化方法は、符号化効率を向上させることができることから、産業上の利用可能性を有している。   Since the image encoding / decoding method according to the present invention can improve the encoding efficiency, it has industrial applicability.

10…入力画像信号、11…予測画像信号、12…予測誤差画像信号、13…量子化変換係数、14…符号化データ、15…復号予測誤差信号、16…局所復号画像信号、17…参照画像信号、18…動き情報、20…ビットストリーム、21…動き情報、25,26…情報フレーム、30…利用可能ブロック情報、31…選択ブロック情報、32…予測切替情報、33…変換係数情報、34…予測誤差信号、35…予測画像信号、36…復号画像信号、37…参照画像信号、38…動き情報、39…参照動き情報、40…動き情報、50…符号化制御情報、51…フィードバック情報、60…利用可能ブロック情報、61…選択ブロック情報、62…予測切替情報、70…復号化制御情報、71…制御情報、80…符号化データ、100…画像符号化部、101…予測部、102…減算器、103…変換・量子化部、104…可変長符号化部、105…逆量子化・逆変換部、106…加算器、107…フレームメモリ、108…情報メモリ、109…利用可能ブロック取得部、110…空間方向動き情報取得部、111…時間方向動き情報取得部、112…情報切替スイッチ、113…動き補償部、114…パラメータ符号化部、115…変換係数符号化部、116…選択ブロック符号化部、117…多重化部、118…動き情報選択部、120…出力バッファ、150…符号化制御部、200…画像符号化部、201…予測部、202…第2予測部、203…予測方法切替スイッチ、204…可変長符号化部、205…動き情報取得部、216…選択ブロック符号化部、217…動き情報符号化部、300…画像復号化部、301…符号化列復号化部、301…符号列復号部、302…逆量子化・逆変換部、303…加算器、304…フレームメモリ、305…予測部、306…情報メモリ、307…利用可能ブロック取得部、308…出力バッファ、310…空間方向動き情報取得部、311…時間方向動き情報取得部、312…動き情報切替スイッチ、313…動き補償部、314…情報選択部、320…分離部、321…パラメータ復号化部、322…変換係数復号化部、323…選択ブロック復号化部、350…復号化制御部、400…画像復号化部、401…符号化列復号化部、405…予測部、410…第2予測部、411…予測方法切替スイッチ、423…選択ブロック復号化部、424…情報復号化部、901…ハイレベルシンタクス、902…シーケンスパラメータセットシンタクス、903…ピクチャパラメータセットシンタクス、904…スライスレベルシンタクス、905…スライスヘッダーシンタクス、906…スライスデータシンタクス、907…マクロブロックレベルシンタクス、908…マクロブロックレイヤーシンタクス、909…マクロブロックプレディクションシンタクス。 DESCRIPTION OF SYMBOLS 10 ... Input image signal, 11 ... Predictive image signal, 12 ... Prediction error image signal, 13 ... Quantization transform coefficient, 14 ... Encoded data, 15 ... Decoded prediction error signal, 16 ... Local decoded image signal, 17 ... Reference image Signal, 18 ... motion information, 20 ... bit stream, 21 ... motion information, 25, 26 ... information frame, 30 ... usable block information, 31 ... selected block information, 32 ... prediction switching information, 33 ... transform coefficient information, 34 ... Prediction error signal, 35 ... Predictive image signal, 36 ... Decoded image signal, 37 ... Reference image signal, 38 ... Motion information, 39 ... Reference motion information, 40 ... Motion information, 50 ... Coding control information, 51 ... Feedback information , 60 ... Available block information, 61 ... Selected block information, 62 ... Prediction switching information, 70 ... Decoding control information, 71 ... Control information, 80 ... Encoded data, 100 ... Image encoding unit 101 ... Prediction unit 102 ... Subtractor 103 ... Transform / quantization unit 104 ... Variable length encoding unit 105 ... Inverse quantization / inverse transform unit 106 ... Adder 107 ... Frame memory , 108 ... Information memory, 109 ... Available block acquisition unit, 110 ... Spatial direction motion information acquisition unit, 111 ... Time direction motion information acquisition unit, 112 ... Information changeover switch, 113 ... Motion compensation unit, 114 ... Parameter encoding unit , 115 ... transform coefficient encoding unit, 116 ... selected block encoding unit, 117 ... multiplexing unit, 118 ... motion information selection unit, 120 ... output buffer, 150 ... encoding control unit, 200 ... image encoding unit, 201 ... Prediction unit, 202 ... Second prediction unit, 203 ... Prediction method changeover switch, 204 ... Variable length coding unit, 205 ... Motion information acquisition unit, 216 ... Selected block coding unit, 217 Motion information encoding unit, 300 ... image decoding unit, 301 ... encoded sequence decoding unit, 301 ... code sequence decoding unit, 302 ... inverse quantization / inverse transform unit, 303 ... adder, 304 ... frame memory, 305 ... Prediction unit, 306 ... Information memory, 307 ... Available block acquisition unit, 308 ... Output buffer, 310 ... Spatial direction motion information acquisition unit, 311 ... Time direction motion information acquisition unit, 312 ... Motion information changeover switch, 313 ... Motion Compensation unit, 314 ... information selection unit, 320 ... separation unit, 321 ... parameter decoding unit, 322 ... transform coefficient decoding unit, 323 ... selected block decoding unit, 350 ... decoding control unit, 400 ... image decoding unit , 401 ... Coding sequence decoding unit, 405 ... Prediction unit, 410 ... Second prediction unit, 411 ... Prediction method changeover switch, 423 ... Selected block decoding unit, 424 ... Information decoding unit 901 ... High level syntax 902 ... Sequence parameter set syntax 903 ... Picture parameter set syntax 904 ... Slice level syntax 905 ... Slice header syntax 906 ... Slice data syntax 907 ... Macro block level syntax 908 ... Macro block Layer syntax, 909 ... Macroblock prediction syntax.

Claims (3)

対象ブロックの予測モードに関するモード情報の入力を受け付ける入力部と、
前記対象ブロックに対して予め定められた位置関係にある複数の候補ブロックが利用可能か否かを前記位置関係に応じて予め定められた順番に従って判定する判定部と、
前記モード情報が所定の情報を示し、前記利用可能と判定された候補ブロックの数が2以上である場合に、前記利用可能と判定された候補ブロックのうち1つを示す識別情報を、符号化データから取得する復号化部と、
前記モード情報が前記所定の情報を示し、前記利用可能と判定された候補ブロックの数が2以上である場合に、前記利用可能と判定された候補ブロックの中から前記識別情報に従って選択ブロックを選択する選択部と、
前記選択ブロックに対応する動き情報に基づいて、前記対象ブロックの予測画像を生成する予測部と、
を具備し、
前記判定部は、前記候補ブロックが動き情報を有し、かつ、該動き情報が既に利用可能と判定された候補ブロックに対応する動き情報と一致しない場合に利用可能な候補ブロックと判定する、画像復号化装置。
An input unit for receiving input of mode information related to the prediction mode of the target block;
A determination unit that determines whether or not a plurality of candidate blocks having a predetermined positional relationship with the target block can be used according to a predetermined order according to the positional relationship;
When the mode information indicates predetermined information and the number of candidate blocks determined to be usable is 2 or more, identification information indicating one of the candidate blocks determined to be usable is encoded. A decryption unit obtained from the data;
When the mode information indicates the predetermined information and the number of candidate blocks determined to be usable is two or more, a selected block is selected from the candidate blocks determined to be usable according to the identification information A selection section to
A prediction unit that generates a predicted image of the target block based on motion information corresponding to the selected block;
Comprising
The determination unit determines that a candidate block is usable when the candidate block has motion information and the motion information does not match motion information corresponding to a candidate block that has already been determined to be usable. Decryption device.
対象ブロックの予測モードに関するモード情報の入力を受け付けるステップと、
前記対象ブロックに対して予め定められた位置関係にある複数の候補ブロックが利用可能か否かを前記位置関係に応じて予め定められた順番に従って判定するステップと、
前記モード情報が所定の情報を示し、前記利用可能と判定された候補ブロックの数が2以上である場合に、前記利用可能と判定された候補ブロックのうち1つを示す識別情報を、符号化データから取得するステップと、
前記モード情報が前記所定の情報を示し、前記利用可能と判定された候補ブロックの数が2以上である場合に、前記利用可能と判定された候補ブロックの中から前記識別情報に従って選択ブロックを選択するステップと、
前記選択ブロックに対応する動き情報に基づいて、前記対象ブロックの予測画像を生成するステップと、
を具備し、
前記判定するステップは、前記候補ブロックが動き情報を有し、かつ、該動き情報が既に利用可能と判定された候補ブロックに対応する動き情報と一致しない場合に利用可能な候補ブロックと判定する、画像復号化方法。
Receiving mode information regarding the prediction mode of the target block;
Determining whether or not a plurality of candidate blocks having a predetermined positional relationship with respect to the target block can be used according to a predetermined order according to the positional relationship;
When the mode information indicates predetermined information and the number of candidate blocks determined to be usable is 2 or more, identification information indicating one of the candidate blocks determined to be usable is encoded. Retrieving from the data;
When the mode information indicates the predetermined information and the number of candidate blocks determined to be usable is two or more, a selected block is selected from the candidate blocks determined to be usable according to the identification information And steps to
Generating a predicted image of the target block based on motion information corresponding to the selected block;
Comprising
The determining step determines a candidate block that can be used when the candidate block has motion information and the motion information does not match motion information corresponding to a candidate block that has already been determined to be usable, Image decoding method.
対象ブロックの予測モードに関するモード情報の入力を受け付ける手段、
前記対象ブロックに対して予め定められた位置関係にある複数の候補ブロックが利用可能か否かを前記位置関係に応じて予め定められた順番に従って判定する手段、
前記モード情報が所定の情報を示し、前記利用可能と判定された候補ブロックの数が2以上である場合に、前記利用可能と判定された候補ブロックのうち1つを示す識別情報を、符号化データから取得する手段、
前記モード情報が前記所定の情報を示し、前記利用可能と判定された候補ブロックの数が2以上である場合に、前記利用可能と判定された候補ブロックの中から前記識別情報に従って選択ブロックを選択する手段、及び
前記選択ブロックに対応する動き情報に基づいて、前記対象ブロックの予測画像を生成する予測部
としてコンピュータを機能させるための画像復号化プログラムであって、
前記判定する手段は、前記候補ブロックが動き情報を有し、かつ、該動き情報が既に利用可能と判定された候補ブロックに対応する動き情報と一致しない場合に利用可能な候補ブロックと判定する、画像復号化プログラム。
Means for receiving input of mode information related to the prediction mode of the target block;
Means for determining whether or not a plurality of candidate blocks having a predetermined positional relationship with the target block can be used according to a predetermined order according to the positional relationship;
When the mode information indicates predetermined information and the number of candidate blocks determined to be usable is 2 or more, identification information indicating one of the candidate blocks determined to be usable is encoded. Means to obtain from data,
When the mode information indicates the predetermined information and the number of candidate blocks determined to be usable is two or more, a selected block is selected from the candidate blocks determined to be usable according to the identification information And an image decoding program for causing a computer to function as a prediction unit that generates a predicted image of the target block based on motion information corresponding to the selected block,
The determining means determines that the candidate block has motion information, and the candidate block is usable when the motion information does not match the motion information corresponding to the candidate block that has already been determined to be usable, Image decoding program.
JP2017167620A 2017-08-31 2017-08-31 Image encoding method and image decoding method Active JP6370977B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017167620A JP6370977B2 (en) 2017-08-31 2017-08-31 Image encoding method and image decoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017167620A JP6370977B2 (en) 2017-08-31 2017-08-31 Image encoding method and image decoding method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2016244520A Division JP6271694B2 (en) 2016-12-16 2016-12-16 Image encoding method and image decoding method

Publications (2)

Publication Number Publication Date
JP2018023126A true JP2018023126A (en) 2018-02-08
JP6370977B2 JP6370977B2 (en) 2018-08-08

Family

ID=61165930

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017167620A Active JP6370977B2 (en) 2017-08-31 2017-08-31 Image encoding method and image decoding method

Country Status (1)

Country Link
JP (1) JP6370977B2 (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004040785A (en) * 2002-06-03 2004-02-05 Microsoft Corp Time and space prediction of bidirectional prediction (b) picture, and moving vector prediction of plural picture reference moving compensations
JP2004056823A (en) * 2002-07-16 2004-02-19 Samsung Electronics Co Ltd Motion vector encoding/decoding method and apparatus
JP2004104159A (en) * 2002-07-03 2004-04-02 Ntt Docomo Inc Variable length code generating apparatus, variable length decoding apparatus, variable length code generating method, and variable length decoding method
JP2004165703A (en) * 2002-09-20 2004-06-10 Toshiba Corp Moving picture coding method and decoding method
JP2004208259A (en) * 2002-04-19 2004-07-22 Matsushita Electric Ind Co Ltd Motion vector calculating method
JP2008278091A (en) * 2007-04-27 2008-11-13 Hitachi Ltd Moving picture recording method, and apparatus thereof
JP2010010950A (en) * 2008-06-25 2010-01-14 Toshiba Corp Image coding/decoding method and apparatus
WO2010146696A1 (en) * 2009-06-18 2010-12-23 株式会社 東芝 Dynamic image encoding device and dynamic image decoding device
WO2011087321A2 (en) * 2010-01-14 2011-07-21 Samsung Electronics Co., Ltd. Method and apparatus for encoding and decoding motion vector
WO2011090314A2 (en) * 2010-01-19 2011-07-28 Samsung Electronics Co., Ltd. Method and apparatus for encoding and decoding motion vector based on reduced motion vector predictor candidates

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004208259A (en) * 2002-04-19 2004-07-22 Matsushita Electric Ind Co Ltd Motion vector calculating method
JP2004040785A (en) * 2002-06-03 2004-02-05 Microsoft Corp Time and space prediction of bidirectional prediction (b) picture, and moving vector prediction of plural picture reference moving compensations
JP2004104159A (en) * 2002-07-03 2004-04-02 Ntt Docomo Inc Variable length code generating apparatus, variable length decoding apparatus, variable length code generating method, and variable length decoding method
JP2004056823A (en) * 2002-07-16 2004-02-19 Samsung Electronics Co Ltd Motion vector encoding/decoding method and apparatus
JP2004165703A (en) * 2002-09-20 2004-06-10 Toshiba Corp Moving picture coding method and decoding method
JP2008278091A (en) * 2007-04-27 2008-11-13 Hitachi Ltd Moving picture recording method, and apparatus thereof
JP2010010950A (en) * 2008-06-25 2010-01-14 Toshiba Corp Image coding/decoding method and apparatus
WO2010146696A1 (en) * 2009-06-18 2010-12-23 株式会社 東芝 Dynamic image encoding device and dynamic image decoding device
WO2011087321A2 (en) * 2010-01-14 2011-07-21 Samsung Electronics Co., Ltd. Method and apparatus for encoding and decoding motion vector
WO2011090314A2 (en) * 2010-01-19 2011-07-28 Samsung Electronics Co., Ltd. Method and apparatus for encoding and decoding motion vector based on reduced motion vector predictor candidates

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
TAKESHI CHUJOH ET AL.: "Description of video coding technology proposal by TOSHIBA", JOINT COLLABORATIVE TEAM ON VIDEO CODING (JCT-VC) OF ITU-T SG16 WP3 AND ISO/IEC JTC1/SC29/WG11, vol. JCTVC-A117r1, JPN6018021138, April 2010 (2010-04-01), pages 1 - 6, XP008169779, ISSN: 0003812175 *

Also Published As

Publication number Publication date
JP6370977B2 (en) 2018-08-08

Similar Documents

Publication Publication Date Title
JP5368631B2 (en) Image encoding method, apparatus, and program
CN113039787A (en) Decoder-side motion vector refinement
JP2017041902A (en) Apparatus for encoding moving picture
CN113678452A (en) Constraint on decoder-side motion vector refinement
JP5479648B1 (en) Image encoding method and image decoding method
JP5444497B2 (en) Image encoding method and image decoding method
JP5571262B2 (en) Image encoding method and image decoding method
JP6609004B2 (en) Image encoding method and image decoding method
JP6367452B2 (en) Image encoding method and image decoding method
JP6370977B2 (en) Image encoding method and image decoding method
JP6271694B2 (en) Image encoding method and image decoding method
JP6980889B2 (en) Image coding method and image decoding method
JP6196341B2 (en) Image encoding method and image decoding method
JP6961781B2 (en) Image coding method and image decoding method
JP6795666B2 (en) Image coding method and image decoding method
JP7242811B2 (en) Image encoding method and image decoding method
JP5659314B1 (en) Image encoding method and image decoding method
JP5509398B1 (en) Image encoding method and image decoding method
JP2014131295A (en) Image encoding method and image decoding method
JP2014131293A (en) Image encoding method and image decoding method
JP5571229B2 (en) Image encoding method and image decoding method
JP2015035660A (en) Image encoder, image encoding method, and image encoding program
JP2015053729A (en) Image encoding method, and image decoding method
JP5649701B2 (en) Image decoding method, apparatus, and program
JPWO2011125256A1 (en) Image encoding method and image decoding method

Legal Events

Date Code Title Description
TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20180612

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180711

R151 Written notification of patent or utility model registration

Ref document number: 6370977

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151