JP6682594B2 - Encoding method and decoding method - Google Patents

Encoding method and decoding method Download PDF

Info

Publication number
JP6682594B2
JP6682594B2 JP2018186475A JP2018186475A JP6682594B2 JP 6682594 B2 JP6682594 B2 JP 6682594B2 JP 2018186475 A JP2018186475 A JP 2018186475A JP 2018186475 A JP2018186475 A JP 2018186475A JP 6682594 B2 JP6682594 B2 JP 6682594B2
Authority
JP
Japan
Prior art keywords
value
unit
prediction
image
selection range
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.)
Active
Application number
JP2018186475A
Other languages
Japanese (ja)
Other versions
JP2019017103A (en
Inventor
昭行 谷沢
昭行 谷沢
中條 健
健 中條
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 JP2018186475A priority Critical patent/JP6682594B2/en
Publication of JP2019017103A publication Critical patent/JP2019017103A/en
Priority to JP2020011419A priority patent/JP6903778B2/en
Application granted granted Critical
Publication of JP6682594B2 publication Critical patent/JP6682594B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明の実施形態は、符号化方法、復号方法及び符号化データに関する。   Embodiments of the present invention relate to an encoding method, a decoding method, and encoded data.

近年、符号化効率を大幅に向上させた画像符号化方法が、ITU−T(International Telecommunication Union Telecommunication Standardization Sector)とISO(International Organization for Standardization)/IEC(International Electrotechnical Commission)との共同で、ITU−T REC. H.264及びISO/IEC 14496−10(以下、「H.264」という)として勧告されている。   2. Description of the Related Art In recent years, an image coding method that greatly improves coding efficiency has been developed in cooperation with ITU-T (International Telecommunication Union Telecommunication Standardization Sector) and ISO (International Organization for Standardization) / IEC (International Electrotechnical Commission). T REC. H. H.264 and ISO / IEC 14496-10 (hereinafter referred to as “H.264”).

H.264には、符号化済みの画像を参照画像に用いて分数精度の動き補償予測を行うことにより、時間方向の冗長性を削除し、高い符号化効率を実現するインター予測符号化方式が開示されている。   H. H.264 discloses an inter-prediction coding scheme that eliminates temporal redundancy and realizes high coding efficiency by performing fractional-accuracy motion compensation prediction using a coded picture as a reference picture. ing.

また、ISO/IEC MPEG(Moving Picture Experts Group)−1,2,4におけるインター予測符号化方式よりも、フェードやディゾルブ効果を含む動画像を高効率に符号化する方式も提案されている。この方式では、時間方向における明度変化を予測する枠組みとして、輝度と2つの色差とを有する入力動画像に対して分数精度の動き補償予測を行う。そして、参照画像、輝度及び2つの色差毎の重み係数、並びに輝度及び2つの色差毎のオフセットなどを用いて、予測画像に重み係数を乗じ、オフセットを加算する。重み係数は、固定小数点精度を示すパラメータにより、所定の精度で分数値を表現することができ、画像間の画素値変化をより細かい精度で重み付きの動き補償予測を行うことが可能となっている。   Also, a scheme has been proposed in which a moving picture including a fade and a dissolve effect is encoded with higher efficiency than the inter prediction encoding scheme in ISO / IEC MPEG (Moving Picture Experts Group) -1, 2, and 4. In this method, as a framework for predicting a change in lightness in the time direction, motion compensation prediction with fractional accuracy is performed on an input moving image having luminance and two color differences. Then, using the reference image, the luminance and the weighting coefficient for each of the two color differences, and the offset for each of the luminance and the two color differences, the predicted image is multiplied by the weighting coefficient, and the offset is added. The weighting factor can express a fractional value with a predetermined precision by a parameter indicating fixed-point precision, and it becomes possible to perform weighted motion compensation prediction with a finer precision on pixel value changes between images. There is.

特開2004−7377号公報JP-A-2004-7377

上述したような従来技術では、参照画像、重み係数、及びオフセットなどはインデックスとして符号化されるが、インデックスは予め定められたビット精度で表現するよう規定されているため、重み係数を表現できない場合がある。本発明が解決しようとする課題は、予め定められたビット精度で重み係数を表現可能としつつ、符号化効率を向上できる電子機器、復号方法及びプログラムを提供することである。   In the conventional technique as described above, the reference image, the weight coefficient, the offset, and the like are coded as an index, but since the index is defined to be expressed with a predetermined bit precision, the weight coefficient cannot be expressed. There is. The problem to be solved by the present invention is to provide an electronic device, a decoding method, and a program capable of improving a coding efficiency while allowing a weighting coefficient to be expressed with a predetermined bit precision.

実施形態の符号化方法は、輝度の重み係数の第1固定小数点精度を符号化するステップと、前記第1固定小数点精度と、色差の重み係数の第2固定小数点精度との差異と同じ値である、第1差分値を符号化するステップと、前記第1固定小数点精度で定められるビット数だけ“1”を左シフトすることによって得られる値と同じ値である第1基準値と、前記輝度の重み係数と、の差異と同じ値である、前記輝度の重み係数の第2差分値を符号化するステップと、を含む。   The encoding method of the embodiment uses the same value as the step of encoding the first fixed-point precision of the luminance weighting factor, and the difference between the first fixed-point precision and the second fixed-point precision of the color difference weighting factor. A step of encoding a first difference value, a first reference value which is the same value as the value obtained by left-shifting "1" by the number of bits determined by the first fixed point precision, and the luminance Encoding a second difference value of the luminance weighting coefficient, which has the same value as the difference between

第1実施形態の符号化装置の例を示すブロック図。FIG. 1 is a block diagram illustrating an example of an encoding device according to a first embodiment. 第1実施形態の画素ブロックの予測符号化順序例を示す説明図。FIG. 3 is an explanatory diagram showing an example of a predictive coding order of pixel blocks according to the first embodiment. 第1実施形態の画素ブロックの予測符号化順序の他の例を示す説明図。FIG. 6 is an explanatory diagram showing another example of the predictive coding order of the pixel block according to the first embodiment. 第1実施形態におけるコーディングツリーブロックのブロックサイズ例を示す図。FIG. 3 is a diagram illustrating an example of a block size of a coding tree block according to the first embodiment. 第1実施形態のコーディングツリーブロックの具体例を示す図。FIG. 3 is a diagram illustrating a specific example of a coding tree block according to the first embodiment. 第1実施形態のコーディングツリーブロックの具体例を示す図。FIG. 3 is a diagram illustrating a specific example of a coding tree block according to the first embodiment. 第1実施形態のコーディングツリーブロックの具体例を示す図。FIG. 3 is a diagram illustrating a specific example of a coding tree block according to the first embodiment. 第1実施形態の予測画像生成部の例を示すブロック図。FIG. 2 is a block diagram illustrating an example of a predicted image generation unit according to the first embodiment. 第1実施形態の双方向予測における動き補償予測の動きベクトルの関係の例を示す図。The figure which shows the example of the relationship of the motion vector of the motion compensation prediction in the bidirectional prediction of 1st Embodiment. 第1実施形態の複数フレーム動き補償部の例を示すブロック図。FIG. 3 is a block diagram illustrating an example of a multi-frame motion compensation unit according to the first embodiment. 重み係数の説明のための参考図。A reference diagram for explaining a weighting factor. H.264の重み係数の選択範囲を示す参考図。H. FIG. 12 is a reference diagram showing a selection range of H.264 weighting coefficients. 第1実施形態の重み係数の選択範囲の例を示す説明図。Explanatory drawing which shows the example of the selection range of the weighting coefficient of 1st Embodiment. 第1実施形態の重み係数の選択範囲の具体例を示す説明図。Explanatory drawing which shows the specific example of the selection range of the weighting coefficient of 1st Embodiment. 第1実施形態の重み係数の選択範囲の具体例を示す説明図。Explanatory drawing which shows the specific example of the selection range of the weighting coefficient of 1st Embodiment. H.264の重み係数の最小値及び最大値を示す参考図。H. The reference diagram which shows the minimum value of the weighting coefficient of H.264, and the maximum value. 第1実施形態の重み係数の最小値及び最大値の例を示す説明図。Explanatory drawing which shows the example of the minimum value and maximum value of a weighting coefficient of 1st Embodiment. 第1実施形態のWPパラメータ情報例を示す図。FIG. 3 is a diagram illustrating an example of WP parameter information according to the first embodiment. 第1実施形態のWPパラメータ情報例を示す図。FIG. 3 is a diagram illustrating an example of WP parameter information according to the first embodiment. 第1実施形態の重み係数の選択範囲の導出処理例を示すフローチャート。6 is a flowchart showing an example of a process of deriving a selection range of weighting factors according to the first embodiment. 第1実施形態のシンタクスの例を示す図。The figure which shows the example of the syntax of 1st Embodiment. 第1実施形態のピクチャパラメータセットシンタクスの例を示す図。FIG. 4 is a diagram illustrating an example of a picture parameter set syntax according to the first embodiment. 第1実施形態のスライスヘッダーシンタクスの例を示す図。FIG. 4 is a diagram illustrating an example of slice header syntax according to the first embodiment. 第1実施形態のプレッドウェイトテーブルシンタクスの例を示す図。FIG. 4 is a diagram illustrating an example of a spread weight table syntax according to the first embodiment. 第1実施形態のシンタクス要素の値の関係の例を示す説明図。Explanatory drawing which shows the example of the relationship of the value of the syntax element of 1st Embodiment. 第2実施形態の復号装置の構成例を示すブロック図。FIG. 13 is a block diagram illustrating a configuration example of a decoding device according to a second embodiment. 変形例1のオフセットの選択範囲の例を示す説明図。Explanatory drawing which shows the example of the selection range of the offset of the modification 1. FIG. 変形例1のオフセットの選択範囲の導出処理例を示すフローチャート。9 is a flowchart illustrating an example of a process of deriving a selection range of offset according to the first modification. 変形例2の重み係数の選択範囲の例を示す説明図。Explanatory drawing which shows the example of the selection range of the weighting factor of the modification 2. 変形例2の重み係数の選択範囲の導出処理例を示すフローチャート。9 is a flowchart showing an example of a process of deriving a selection range of weighting factors according to the second modification. 変形例3の符号化対象の重み係数の差分値の範囲の例を示す説明図。FIG. 8 is an explanatory diagram showing an example of a range of difference values of weighting coefficients to be encoded according to the modified example 3. 変形例3のシンタクス要素の値の関係の例を示す説明図。FIG. 10 is an explanatory diagram showing an example of a relationship between values of syntax elements according to Modification 3; 変形例4の重み係数の差分値の範囲の例を示す説明図。Explanatory drawing which shows the example of the range of the difference value of the weighting coefficient of the modification 4. 変形例4の復号後の重み係数の選択範囲の例を示す説明図。FIG. 11 is an explanatory diagram showing an example of a selection range of weighting coefficients after decoding according to the modified example 4. 変形例5の重み係数の差分値のラップ処理例を示すフローチャート。9 is a flowchart showing an example of a wrapping process of a difference value of weighting factors according to the modified example 5. 変形例5の重み係数の差分値の復元処理例を示すフローチャート。9 is a flowchart showing an example of restoration processing of a difference value of weighting factors according to the fifth modification.

以下、添付図面を参照しながら、実施形態を詳細に説明する。以下の各実施形態の符号化装置及び復号装置は、LSI(Large-Scale Integration)チップ、DSP(Digital Signal Processor)、又はFPGA(Field Programmable Gate Array)などのハードウェアにより実現できる。また、以下の各実施形態の符号化装置及び復号装置は、コンピュータにプログラムを実行させること、即ち、ソフトウェアにより実現させることもできる。なお、以降の説明において、「画像」という用語は、「映像」、「画素」、「画像信号」、「絵」、又は「画像データ」などの用語に適宜読み替えることができる。   Hereinafter, embodiments will be described in detail with reference to the accompanying drawings. The encoding device and the decoding device according to the following embodiments can be realized by hardware such as an LSI (Large-Scale Integration) chip, a DSP (Digital Signal Processor), or an FPGA (Field Programmable Gate Array). In addition, the encoding device and the decoding device according to each of the following embodiments can be realized by causing a computer to execute a program, that is, by software. Note that in the following description, the term "image" can be appropriately replaced with a term such as "video", "pixel", "image signal", "picture", or "image data".

(第1実施形態)
第1実施形態では、動画像を符号化する符号化装置について説明する。
(First embodiment)
In the first embodiment, an encoding device that encodes a moving image will be described.

図1は、第1実施形態の符号化装置100の構成の一例を示すブロック図である。   FIG. 1 is a block diagram illustrating an example of a configuration of the encoding device 100 according to the first embodiment.

符号化装置100は、入力画像を構成する各フレーム又は各フィールドを複数の画素ブロックに分割し、符号化制御部111から入力される符号化パラメータを用いて、分割した画素ブロックに対して予測符号化を行い、予測画像を生成する。そして符号化装置100は、複数の画素ブロックに分割した入力画像と予測画像とを減算して予測誤差を生成し、生成した予測誤差を直交変換及び量子化し、更にエントロピー符号化を行って符号化データを生成し、出力する。   The encoding device 100 divides each frame or each field constituting the input image into a plurality of pixel blocks, and uses a coding parameter input from the coding control unit 111 to perform prediction coding on the divided pixel blocks. To generate a predicted image. Then, the encoding device 100 subtracts the input image and the predicted image divided into a plurality of pixel blocks to generate a prediction error, orthogonally transforms and quantizes the generated prediction error, and further performs entropy coding to perform coding. Generate and output data.

符号化装置100は、画素ブロックのブロックサイズ及び予測画像の生成方法の少なくともいずれかが異なる複数の予測モードを選択的に適用して予測符号化を行う。予測画像の生成方法は、大別すると、符号化対象フレーム内で予測を行うイントラ予測と、時間的に異なる1以上の参照フレームを用いて動き補償予測を行うインター予測との2種類である。なお、イントラ予測は、画面内予測又はフレーム内予測などとも称され、インター予測は、画面間予測、フレーム間予測、又は動き補償予測などとも称される。   The encoding device 100 performs predictive encoding by selectively applying a plurality of prediction modes in which at least one of a block size of a pixel block and a method of generating a predicted image is different. The methods of generating a predicted image are roughly classified into two types: intra prediction for performing prediction in a current frame to be encoded, and inter prediction for performing motion compensation prediction using one or more temporally different reference frames. Intra prediction is also referred to as intra-picture prediction or intra-frame prediction, and inter-prediction is also referred to as inter-picture prediction, inter-frame prediction, motion compensation prediction, or the like.

図2Aは、第1実施形態における画素ブロックの予測符号化順序の一例を示す説明図である。図2Aに示す例では、符号化装置100は、画素ブロックの左上から右下に向かって予測符号化を行っており、符号化処理対象のフレームfにおいて、符号化対象画素ブロックcよりも左側及び上側に符号化済み画素ブロックpが位置している。   FIG. 2A is an explanatory diagram showing an example of a predictive coding order of pixel blocks in the first embodiment. In the example illustrated in FIG. 2A, the encoding device 100 performs predictive encoding from the upper left to the lower right of the pixel block, and in the frame f to be encoded, the left side and the left side of the encoding target pixel block c. The encoded pixel block p is located on the upper side.

図2Bは、第1実施形態における画素ブロックの予測符号化順序の他の例を示す説明図である。図2Bに示す例は、符号化装置100は、予め画面を複数のタイル状又はスライス状に分割した上で、各タイル又は各スライスの中の画素ブロックの左上から右下に向かって予測符号化を行っており、符号化処理対象のフレームfにおいて、符号化対象画素ブロックcよりも左側及び上側に符号化済み画素ブロックpが位置している。なお、タイルは、画面を任意の矩形領域で切り出した領域を意味し、スライスは、予測符号化順に従って後述する任意数のラージコーディングツリーブロックで切り出した領域を意味する。   FIG. 2B is an explanatory diagram illustrating another example of the predictive coding order of the pixel block according to the first embodiment. In the example illustrated in FIG. 2B, the encoding device 100 divides the screen into a plurality of tiles or slices in advance, and then performs predictive encoding from the upper left to the lower right of the pixel block in each tile or each slice. The encoded pixel block p is located on the left side and the upper side of the encoding target pixel block c in the encoding target frame f. The tile means an area obtained by cutting out the screen in an arbitrary rectangular area, and the slice means an area cut out in an arbitrary number of large coding tree blocks described later according to the predictive coding order.

図2Bに示す例のように、画面を複数のタイル状又は複数のスライス状に分割した後に、タイル毎又はスライス毎に符号化処理を行うことにより、タイル毎又はスライス毎の復号処理が可能となる。このため、高解像度映像の復号処理を並列して行うことにより、復号に必要となる演算量を分散することが可能となる。つまり、図2Bに示す例の場合、符号化処理及び復号処理の高速化が可能となる。   As in the example shown in FIG. 2B, after the screen is divided into a plurality of tiles or a plurality of slices, encoding processing is performed for each tile or each slice, thereby enabling decoding processing for each tile or each slice. Become. Therefore, by performing the decoding processing of the high resolution video in parallel, it is possible to disperse the calculation amount required for the decoding. That is, in the case of the example shown in FIG. 2B, it is possible to speed up the encoding process and the decoding process.

以下では、説明の簡単化のため、符号化装置100は、図2Aに示す順序で予測符号化を行うものとするが、予測符号化の順序はこれに限定されるものではない。   Hereinafter, for simplification of description, the coding apparatus 100 performs the predictive coding in the order shown in FIG. 2A, but the predictive coding order is not limited to this.

画素ブロックは、画像を処理する単位を示し、例えば、M×Nサイズのブロック(M及びNは自然数)、コーディングツリーブロック、マクロブロック、サブブロック、又は1画素などが該当する。以降の説明では、基本的に、画素ブロックをコーディングツリーブロックの意味で使用するが、他の意味で使用する場合もある。例えば、プレディクションユニットの説明では、画素ブロックを、プレディクションユニットの画素ブロックの意味で使用する。また、ブロックはユニットなどの名称で呼ばれることもある。例えばコーディングブロックをコーディングユニットと呼ぶ。   The pixel block indicates a unit for processing an image, and corresponds to, for example, an M × N size block (M and N are natural numbers), a coding tree block, a macro block, a sub block, or one pixel. In the following description, a pixel block is basically used as a coding tree block, but may be used in other meanings. For example, in the description of the prediction unit, a pixel block is used in the meaning of the pixel block of the prediction unit. A block may be called by a name such as a unit. For example, a coding block is called a coding unit.

図3Aは、第1実施形態におけるコーディングツリーブロックのブロックサイズの一例を示す図である。コーディングツリーブロックは、典型的には、図3Aに示すような64×64の画素ブロックである。但し、これに限定されるものではなく、32×32の画素ブロック、16×16の画素ブロック、8×8の画素ブロック、又は4×4の画素ブロックなどであってもよい。また、コーディングツリーブロックは、正方形でなくてもよく、例えば、M×Nサイズ(M≠N)の画素ブロックであってもよい。   FIG. 3A is a diagram illustrating an example of a block size of a coding tree block according to the first embodiment. The coding tree block is typically a 64 × 64 pixel block as shown in FIG. 3A. However, the present invention is not limited to this, and may be a 32 × 32 pixel block, a 16 × 16 pixel block, an 8 × 8 pixel block, a 4 × 4 pixel block, or the like. Further, the coding tree block may not be a square, and may be, for example, a pixel block of M × N size (M ≠ N).

図3B〜図3Dは、第1実施形態のコーディングツリーブロックの具体例を示す図である。図3Bは、ブロックサイズが64×64(N=32)のコーディングツリーブロックを示している。Nは、基準となるコーディングツリーブロックのサイズを表しており、分割された場合のサイズがN、分割されない場合のサイズが2Nと定義されている。図3Cは、図3Bのコーディングツリーブロックを四分木分割したコーディングツリーブロックを示している。コーディングツリーブロックは、図3Cに示すように、四分木構造を持つ。コーディングツリーブロックが分割された場合、分割後の4つの画素ブロックに対して、図3Cに示すように、Zスキャン順で番号が付される。   3B to 3D are diagrams illustrating specific examples of the coding tree block according to the first embodiment. FIG. 3B shows a coding tree block having a block size of 64 × 64 (N = 32). N represents the size of a coding tree block serving as a reference, and the size when divided is defined as N, and the size when not divided is defined as 2N. FIG. 3C shows a coding tree block obtained by dividing the coding tree block of FIG. 3B into quadtrees. The coding tree block has a quad tree structure as shown in FIG. 3C. When the coding tree block is divided, the four pixel blocks after the division are numbered in the Z-scan order as shown in FIG. 3C.

なお、コーディングツリーブロックは、1つの四分木の番号内で更に四分木分割することができる。これにより、コーディングツリーブロックを階層的に分割することができる。この場合、分割の深さは、Depthで定義される。図3Dは、図3Bのコーディングツリーブロックを四分木分割したコーディングツリーブロックの1つを示し、ブロックサイズが32×32(N=16)となっている。図3Bに示すコーディングツリーブロックのDepthは0であり、図3Dに示すコーディングツリーブロックのDepthは、1である。なお、最もユニットが大きいコーディングツリーブロックは、ラージコーディングツリーブロックと呼ばれ、この単位で入力画像信号がラスタースキャン順に符号化される。   Note that the coding tree block can be further divided into quadtrees within one quadtree number. Thus, the coding tree block can be divided hierarchically. In this case, the depth of division is defined by Depth. FIG. 3D shows one of the coding tree blocks obtained by dividing the coding tree block of FIG. 3B into quadtrees, and has a block size of 32 × 32 (N = 16). The depth of the coding tree block shown in FIG. 3B is 0, and the depth of the coding tree block shown in FIG. 3D is 1. Note that the coding tree block having the largest unit is called a large coding tree block, and the input image signal is encoded in raster scan order in this unit.

以降の説明では、入力画像の符号化対象ブロック又はコーディングツリーブロックを予測対象ブロック又は予測画素ブロックと称することもある。なお、符号化単位は画素ブロックに限らず、フレーム、フィールド、スライス、ライン、及び画素の少なくともいずれかを用いることもできる。   In the following description, the encoding target block or the coding tree block of the input image may be referred to as a prediction target block or a prediction pixel block. Note that the coding unit is not limited to a pixel block, and may be at least one of a frame, a field, a slice, a line, and a pixel.

符号化装置100は、図1に示すように、減算部101と、直交変換部102と、量子化部103と、逆量子化部104と、逆直交変換部105と、加算部106と、予測画像生成部107と、インデックス設定部108と、動き評価部109と、符号化部110とを、備える。なお、図1に示す符号化制御部111は、符号化装置100を制御するものであり、例えば、CPU(Central Processing Unit)などにより実現できる。   As shown in FIG. 1, the encoding device 100 includes a subtraction unit 101, an orthogonal transformation unit 102, a quantization unit 103, an inverse quantization unit 104, an inverse orthogonal transformation unit 105, an addition unit 106, and a prediction unit. An image generation unit 107, an index setting unit 108, a motion evaluation unit 109, and an encoding unit 110 are provided. The encoding control unit 111 shown in FIG. 1 controls the encoding device 100, and can be realized by, for example, a CPU (Central Processing Unit).

減算部101は、画素ブロックに分割された入力画像から対応する予測画像を減算して予測誤差を得る。減算部101は、予測誤差を出力し、直交変換部102に入力する。   The subtraction unit 101 subtracts a corresponding prediction image from an input image divided into pixel blocks to obtain a prediction error. The subtraction unit 101 outputs a prediction error and inputs the prediction error to the orthogonal transformation unit 102.

直交変換部102は、減算部101から入力された予測誤差に対して、例えば、離散コサイン変換(DCT)又は離散サイン変換(DST)のような直交変換を行い、変換係数を得る。直交変換部102は、変換係数を出力し、量子化部103に入力する。   The orthogonal transformation unit 102 performs an orthogonal transformation such as a discrete cosine transform (DCT) or a discrete sine transform (DST) on the prediction error input from the subtraction unit 101 to obtain a transform coefficient. The orthogonal transformation unit 102 outputs the transformation coefficient and inputs it to the quantization unit 103.

量子化部103は、直交変換部102から入力された変換係数に対して量子化処理を行い、量子化変換係数を得る。具体的には、量子化部103は、符号化制御部111によって指定される量子化パラメータや量子化マトリクスなどの量子化情報に従って量子化を行う。より詳細には、量子化部103は、変換係数を量子化情報によって導出される量子化ステップサイズで除算し、量子化変換係数を得る。量子化パラメータは、量子化の細かさを示す。量子化マトリクスは、量子化の細かさを変換係数の成分毎に重み付けするために使用される。量子化部103は、量子化変換係数を出力し、逆量子化部104及び符号化部110に入力する。   The quantization unit 103 performs a quantization process on the transform coefficient input from the orthogonal transform unit 102 to obtain a quantized transform coefficient. Specifically, the quantization unit 103 performs quantization according to quantization information such as a quantization parameter and a quantization matrix specified by the encoding control unit 111. More specifically, the quantization unit 103 divides the transform coefficient by the quantization step size derived from the quantization information to obtain the quantized transform coefficient. The quantization parameter indicates the degree of quantization. The quantization matrix is used to weight the fineness of the quantization for each component of the transform coefficient. The quantization unit 103 outputs the quantized transform coefficient, and inputs it to the inverse quantization unit 104 and the encoding unit 110.

逆量子化部104は、量子化部103から入力された量子化変換係数に対して逆量子化処理を行い、復元変換係数を得る。具体的には、逆量子化部104は、量子化部103において使用された量子化情報に従って逆量子化を行う。より詳細には、逆量子化部104は、量子化情報によって導出された量子化ステップサイズを量子化変換係数に乗算し、復元変換係数を得る。なお、量子化部103において使用された量子化情報は、符号化制御部111の図示せぬ内部メモリからロードされて利用される。逆量子化部104は、復元変換係数を出力し、逆直交変換部105に入力する。   The inverse quantization unit 104 performs an inverse quantization process on the quantized transform coefficient input from the quantization unit 103 to obtain a restored transform coefficient. Specifically, the inverse quantization unit 104 performs inverse quantization according to the quantization information used in the quantization unit 103. More specifically, the inverse quantization unit 104 multiplies the quantization transform coefficient by the quantization step size derived from the quantization information to obtain a restored transform coefficient. The quantization information used in the quantization unit 103 is loaded from an internal memory (not shown) of the encoding control unit 111 and used. The inverse quantization unit 104 outputs the restored transform coefficient and inputs the same to the inverse orthogonal transform unit 105.

逆直交変換部105は、逆量子化部104から入力された復元変換係数に対して、例えば、逆離散コサイン変換(IDCT)又は逆離散サイン変換(IDST)などのような逆直交変換を行い、復元予測誤差を得る。なお、逆直交変換部105が行う逆直交変換は、直交変換部102において行われた直交変換に対応する。逆直交変換部105は、復元予測誤差を出力し、加算部106に入力する。   The inverse orthogonal transform unit 105 performs an inverse orthogonal transform such as an inverse discrete cosine transform (IDCT) or an inverse discrete sine transform (IDST) on the restored transform coefficient input from the inverse quantization unit 104, Obtain the restoration prediction error. Note that the inverse orthogonal transform performed by the inverse orthogonal transform unit 105 corresponds to the orthogonal transform performed by the orthogonal transform unit 102. The inverse orthogonal transform unit 105 outputs the restoration prediction error and inputs the error to the adding unit 106.

加算部106は、逆直交変換部105から入力された復元予測誤差と対応する予測画像とを加算し、局所復号画像を生成する。加算部106は、局所復号画像を出力し、予測画像生成部107に入力する。   The adding unit 106 adds the restored prediction error input from the inverse orthogonal transform unit 105 and the corresponding predicted image to generate a locally decoded image. The adding unit 106 outputs the locally decoded image and inputs the locally decoded image to the predicted image generating unit 107.

予測画像生成部107は、加算部106から入力された局所復号画像を参照画像としてメモリ(図1では図示省略)に蓄積し、メモリに蓄積した参照画像を出力し、動き評価部109に入力する。また予測画像生成部107は、動き評価部109から入力される動き情報及びWPパラメータ情報に基づいて重み付き動き補償予測を行い、予測画像を生成する。予測画像生成部107は、予測画像を出力し、減算部101及び加算部106に入力する。   The predicted image generation unit 107 stores the locally decoded image input from the addition unit 106 as a reference image in a memory (not shown in FIG. 1), outputs the reference image stored in the memory, and inputs the reference image to the motion evaluation unit 109. . The predicted image generation unit 107 also performs weighted motion compensation prediction based on the motion information and the WP parameter information input from the motion evaluation unit 109, and generates a predicted image. The predicted image generation unit 107 outputs a predicted image and inputs the predicted image to the subtraction unit 101 and the addition unit 106.

図4は、第1実施形態の予測画像生成部107の構成の一例を示すブロック図である。予測画像生成部107は、図4に示すように、複数フレーム動き補償部201と、メモリ202と、単方向動き補償部203と、予測パラメータ制御部204と、参照画像セレクタ205と、フレームメモリ206と、参照画像制御部207と、を備える。   FIG. 4 is a block diagram illustrating an example of a configuration of the predicted image generation unit 107 according to the first embodiment. As shown in FIG. 4, the prediction image generation unit 107 includes a multi-frame motion compensation unit 201, a memory 202, a unidirectional motion compensation unit 203, a prediction parameter control unit 204, a reference image selector 205, and a frame memory 206. And a reference image control unit 207.

フレームメモリ206は、参照画像制御部207の制御の下、加算部106から入力された局所復号画像を参照画像として格納する。フレームメモリ206は、参照画像を一時保持するための複数のメモリセットFM1〜FMN(N≧1)を有する。   The frame memory 206 stores the locally decoded image input from the adding unit 106 as a reference image under the control of the reference image control unit 207. The frame memory 206 has a plurality of memory sets FM1 to FMN (N ≧ 1) for temporarily holding a reference image.

予測パラメータ制御部204は、動き評価部109から入力される動き情報に基づいて、参照画像番号と予測パラメータとの複数の組み合わせをテーブルとして用意している。ここで、動き情報とは、動き補償予測で用いられる動きのズレ量を示す動きベクトルや参照画像番号、単方向/双方向予測などの予測モードに関する情報などを指す。予測パラメータは、動きベクトル及び予測モードに関する情報を指す。そして予測パラメータ制御部204は、入力画像に基づいて、予測画像の生成に用いる参照画像番号と予測パラメータとの組み合わせを選択して出力し、参照画像番号を参照画像セレクタ205に入力し、予測パラメータを単方向動き補償部203に入力する。   The prediction parameter control unit 204 prepares a plurality of combinations of reference image numbers and prediction parameters as a table based on the motion information input from the motion evaluation unit 109. Here, the motion information indicates a motion vector indicating a displacement amount of motion used in motion compensation prediction, a reference image number, information on prediction modes such as unidirectional / bidirectional prediction, and the like. The prediction parameter indicates information on a motion vector and a prediction mode. Then, the prediction parameter control unit 204 selects and outputs a combination of the reference image number and the prediction parameter used for generating the prediction image based on the input image, inputs the reference image number to the reference image selector 205, Is input to the unidirectional motion compensation unit 203.

参照画像セレクタ205は、フレームメモリ206が有するフレームメモリFM1〜FMNのいずれの出力端を接続するかを、予測パラメータ制御部204から入力された参照画像番号に従って切り替えるスイッチである。参照画像セレクタ205は、例えば、参照画像番号が0であれば、FM1の出力端を参照画像セレクタ205の出力端に接続し、参照画像番号がN−1であれば、FMNの出力端を参照画像セレクタ205の出力端に接続する。参照画像セレクタ205は、フレームメモリ206が有するフレームメモリFM1〜FMNのうち、出力端が接続されているフレームメモリに格納されている参照画像を出力し、単方向動き補償部203及び動き評価部109へ入力する。   The reference image selector 205 is a switch for switching which output terminal of the frame memories FM1 to FMN of the frame memory 206 is to be connected in accordance with the reference image number input from the prediction parameter control unit 204. For example, if the reference image number is 0, the reference image selector 205 connects the output terminal of FM1 to the output terminal of the reference image selector 205. If the reference image number is N-1, the reference image selector 205 refers to the output terminal of FMN. It is connected to the output terminal of the image selector 205. The reference image selector 205 outputs a reference image stored in a frame memory to which an output terminal is connected among the frame memories FM1 to FMN included in the frame memory 206, and outputs a unidirectional motion compensation unit 203 and a motion evaluation unit 109. Enter

単方向動き補償部203は、予測パラメータ制御部204から入力された予測パラメータと参照画像セレクタ205から入力された参照画像に従って、動き補償予測処理を行い、単方向予測画像を生成する。   The unidirectional motion compensation unit 203 performs motion compensation prediction processing according to the prediction parameter input from the prediction parameter control unit 204 and the reference image input from the reference image selector 205 to generate a unidirectional prediction image.

図5は、第1実施形態の双方向予測における動き補償予測の動きベクトルの関係の一例を示す図である。動き補償予測では、参照画像を用いて補間処理が行われ、作成された補間画像と入力画像との符号化対象位置の画素ブロックからの動きのズレ量を元に単方向予測画像が生成される。ここで、ズレ量は、動きベクトルである。図5に示すように、双方向予測スライス(B−slice)では、2種類の参照画像と動きベクトルのセットを用いて予測画像が生成される。補間処理としては、1/2画素精度の補間処理や、1/4画素精度の補間処理などが用いられ、参照画像に対してフィルタリング処理が行われることによって、補間画像の値が生成される。例えば、輝度信号に対して1/4画素精度までの補間処理な可能なH.264では、ズレ量は整数画素精度の4倍で表現される。   FIG. 5 is a diagram illustrating an example of a relationship between motion vectors of motion compensation prediction in bidirectional prediction according to the first embodiment. In motion-compensated prediction, interpolation processing is performed using a reference image, and a unidirectional predicted image is generated based on the amount of motion shift from the pixel block at the coding target position between the created interpolation image and the input image. . Here, the shift amount is a motion vector. As shown in FIG. 5, in a bidirectional prediction slice (B-slice), a predicted image is generated using two types of reference images and a set of motion vectors. As the interpolation processing, interpolation processing with 1/2 pixel precision, interpolation processing with 1/4 pixel precision, or the like is used, and the value of the interpolation image is generated by performing filtering processing on the reference image. For example, H.264 capable of performing interpolation processing up to 1/4 pixel accuracy for a luminance signal. In H.264, the shift amount is represented by four times the integer pixel precision.

単方向動き補償部203は、単方向予測画像を出力し、メモリ202に一時的に格納する。ここで、動き情報(予測パラメータ)が双方向予測を示す場合には、複数フレーム動き補償部201が2種類の単方向予測画像を用いて重み付き予測を行うため、単方向動き補償部203は、1つ目に対応する単方向予測画像をメモリ202に格納し、2つ目に対応する単方向予測画像を複数フレーム動き補償部201に直接出力する。ここでは、1つ目に対応する単方向予測画像を第一予測画像とし、2つ目に対応する単方向予測画像を第二予測画像とする。   The unidirectional motion compensation unit 203 outputs the unidirectional predicted image and temporarily stores it in the memory 202. Here, when the motion information (prediction parameter) indicates bidirectional prediction, the multi-frame motion compensating unit 201 performs weighted prediction using two types of unidirectionally predicted images, so that the unidirectional motion compensating unit 203 The unidirectional predicted image corresponding to the first one is stored in the memory 202, and the unidirectional predicted image corresponding to the second is directly output to the multi-frame motion compensation unit 201. Here, the first unidirectional predicted image corresponding to the first is a first predicted image, and the second unidirectional predicted image corresponding to the second is a second predicted image.

なお、単方向動き補償部203を2つ用意し、それぞれが2つの単方向予測画像を生成するようにしてもよい。この場合、動き情報(予測パラメータ)が単方向予測を示すときには、単方向動き補償部203が、1つ目の単方向予測画像を第一予測画像として複数フレーム動き補償部201に直接出力すればよい。   Note that two unidirectional motion compensating units 203 may be prepared, and each may generate two unidirectional predicted images. In this case, when the motion information (prediction parameter) indicates unidirectional prediction, the unidirectional motion compensating unit 203 may directly output the first unidirectional predicted image as the first predicted image to the multi-frame motion compensating unit 201. Good.

複数フレーム動き補償部201は、メモリ202から入力される第一予測画像、単方向動き補償部203から入力される第二予測画像、及び動き評価部109から入力されるWPパラメータ情報を用いて、重み付き予測を行って予測画像を生成する。複数フレーム動き補償部201は、予測画像を出力し、減算部101及び加算部106に入力する。   The multi-frame motion compensation unit 201 uses the first predicted image input from the memory 202, the second predicted image input from the unidirectional motion compensation unit 203, and the WP parameter information input from the motion evaluation unit 109, Weighted prediction is performed to generate a predicted image. The multi-frame motion compensation unit 201 outputs the predicted image and inputs it to the subtraction unit 101 and the addition unit 106.

図6は、第1実施形態の複数フレーム動き補償部201の構成の一例を示すブロック図である。複数フレーム動き補償部201は、図6に示すように、デフォルト動き補償部301と、重み付き動き補償部302と、WPパラメータ制御部303と、WPセレクタ304、305とを、備える。   FIG. 6 is a block diagram illustrating an example of a configuration of the multi-frame motion compensation unit 201 according to the first embodiment. As shown in FIG. 6, the multi-frame motion compensation unit 201 includes a default motion compensation unit 301, a weighted motion compensation unit 302, a WP parameter control unit 303, and WP selectors 304 and 305.

WPパラメータ制御部303は、動き評価部109から入力されるWPパラメータ情報に基づいて、WP適用フラグ及び重み情報を出力し、WP適用フラグをWPセレクタ304、305に入力し、重み情報を重み付き動き補償部302に入力する。具体的には、WPパラメータ制御部303は、動き評価部109からWPパラメータ情報が入力されると、WPパラメータ情報を第一WP適用フラグ、第二WP適用フラグ、及び重み情報に分離して出力し、第一WP適用フラグをWPセレクタ304に入力し、第二WP適用フラグをWPセレクタ305に入力し、重み情報を重み付き動き補償部302に入力する。   The WP parameter control unit 303 outputs a WP application flag and weight information based on the WP parameter information input from the motion evaluation unit 109, inputs the WP application flag to the WP selectors 304 and 305, and weights the weight information. Input to the motion compensation unit 302. Specifically, when the WP parameter information is input from the motion evaluation unit 109, the WP parameter control unit 303 separates the WP parameter information into a first WP application flag, a second WP application flag, and weight information, and outputs the weight information. Then, the first WP application flag is input to the WP selector 304, the second WP application flag is input to the WP selector 305, and the weight information is input to the weighted motion compensation unit 302.

ここで、WPパラメータ情報は、第一WP適用フラグ(詳細には、第一WP適用フラグのフラグ情報)、第二WP適応フラグ(詳細には、第二WP適用フラグのフラグ情報)、及び重み情報の情報を含む。第一WP適用フラグ、第二WP適用フラグは、該当する参照画像及び信号成分毎に設定可能なパラメータであり、それぞれ、第一予測画像、第二予測画像の予測に関してデフォルト動き補償予測を行うか重み付き動き補償予測を行うかの情報を含む。ここでは、第一WP適用フラグ、第二WP適用フラグは、いずれも、0である場合デフォルト動き補償予測を行うことを示し、1である場合重み付き動き補償予測を行うことを示すものとする。   Here, the WP parameter information includes a first WP applicable flag (specifically, flag information of the first WP applicable flag), a second WP adaptive flag (specifically, flag information of the second WP applicable flag), and a weight. Contains information of information. The first WP application flag and the second WP application flag are parameters that can be set for each corresponding reference image and signal component, and whether to perform default motion compensation prediction for prediction of the first prediction image and the second prediction image, respectively. It includes information on whether to perform weighted motion compensation prediction. Here, if the first WP application flag and the second WP application flag are both 0, it indicates that the default motion compensation prediction is performed, and if they are 1, it indicates that the weighted motion compensation prediction is performed. .

重み情報は、第一重み係数の値w0C、第二重み係数の値w1C、第一重み係数及び第二重み係数の固定小数点精度を示すパラメータLWD(以下、「固定小数点精度LWD」と称する場合がある)、第一オフセットo0C、及び第二オフセットo1Cの情報を含む。なお、変数Cは、信号成分を意味する。例えば、YUV空間信号の場合、輝度信号をC=Yとし、Cr色差信号をC=Cr、Cb色差成分をC=Cbと表す。   The weight information includes a value w0C of the first weight coefficient, a value w1C of the second weight coefficient, a parameter LWD indicating fixed point precision of the first weight coefficient and the second weight coefficient (hereinafter, referred to as “fixed point precision LWD”). Yes), first offset o0C, and second offset o1C. The variable C means a signal component. For example, in the case of a YUV spatial signal, the luminance signal is represented by C = Y, the Cr color difference signal is represented by C = Cr, and the Cb color difference component is represented by C = Cb.

第一重み係数は、第一予測画像に対応する重み係数であり、固定小数点精度LWDによって値が定まる(変動する)パラメータである。第二重み係数は、第二予測画像に対応する重み係数であり、固定小数点精度LWDによって値が定まる(変動する)パラメータである。固定小数点精度LWDは、第一重み係数及び第二重み係数の分数精度に対応する刻み幅を制御するパラメータである。固定小数点精度LWDは、輝度と色差で異なる値を使ってもよいが、ここでは、簡単化のため、色信号毎に明示的に分けずに説明する。例えば、w0Cが実数値で表現した場合に1.0(2進数表記で1)、LWDが5の場合、第一重み係数は32(2進数表記で100000)となり、w1Cが実数値で表現した場合に2.0(2進数表記で10)、LWDが5の場合、第二重み係数は64(2進数表記で1000000)となる。第一オフセットo0Cは、第一予測画像に対応するオフセットであり、第二オフセットo1Cは、第二予測画像に対応するオフセットである。   The first weighting coefficient is a weighting coefficient corresponding to the first predicted image, and is a parameter whose value is determined (changes) by the fixed point precision LWD. The second weighting coefficient is a weighting coefficient corresponding to the second predicted image, and is a parameter whose value is determined (changes) by the fixed point precision LWD. The fixed point precision LWD is a parameter that controls the step size corresponding to the fractional precision of the first weighting coefficient and the second weighting coefficient. The fixed-point precision LWD may use different values for luminance and color difference, but here, for simplification, description will be made without explicitly dividing each color signal. For example, when w0C is expressed by a real number, 1.0 (1 in binary notation), when LWD is 5, the first weighting factor is 32 (100,000 in binary notation), and w1C is expressed by a real number. In this case, 2.0 (10 in binary notation), and when LWD is 5, the second weighting factor is 64 (1000000 in binary notation). The first offset o0C is an offset corresponding to the first predicted image, and the second offset o1C is an offset corresponding to the second predicted image.

なお、WPパラメータ制御部303は、WPパラメータ情報が入力されると、重み情報の値が規定の範囲内に収まっているかどうかチェックし、範囲外の値を範囲内の値に再設定したり、WP適用フラグの値を変更したりする。例えば、w0Cが実数値で表現した場合に3.0、LWDが7の場合、第一重み係数は384となる。ここで、384は、第一重み係数の範囲外であり、使用できないが、96は、第一重み係数の範囲内であり、使用できるとする。この場合、WPパラメータ制御部303は、LWDを5、第一重み係数は96とすることで、w0Cを実数値で表現した場合に3.0としたまま、第一重み係数を範囲内に再設定してもよい。またこの際に、WPパラメータ制御部303は、量子化処理を行ってもよい。例えば、LWDが7であり、第一重み係数が385となる場合、WPパラメータ制御部303は、量子化処理を行って第一重み係数を384とした後に、LWDを5、w0Cを実数値で表現した場合に3.0とすることで、第一重み係数は96に再設定してもよい。また、WPパラメータ制御部303は、第一WP適用フラグの値を1から0に変更し、重み付き動き補償予測を利用しないようにしてもよい。これらの手法に限定されないが、WPパラメータ制御部303は、重み情報の値が仕様等で定められた規定の範囲を超えて使用されないように制御する。   When the WP parameter information is input, the WP parameter control unit 303 checks whether the value of the weight information is within the specified range, and resets the value outside the range to the value within the range, The value of the WP applicable flag is changed. For example, when w0C is represented by a real number, 3.0, and when LWD is 7, the first weighting factor is 384. Here, 384 is outside the range of the first weighting factor and cannot be used, but 96 is within the range of the first weighting factor and can be used. In this case, the WP parameter control unit 303 sets the LWD to 5 and the first weighting factor to 96, so that the first weighting factor is set to 3.0 within the range when w0C is expressed as a real value. You may set it. Further, at this time, the WP parameter control unit 303 may perform a quantization process. For example, when LWD is 7 and the first weighting coefficient is 385, the WP parameter control unit 303 performs quantization processing to set the first weighting coefficient to 384, then sets LWD to 5 and w0C to real values. The first weighting factor may be reset to 96 by setting it to 3.0 when expressed. Further, the WP parameter control unit 303 may change the value of the first WP application flag from 1 to 0 so that the weighted motion compensation prediction is not used. Although not limited to these methods, the WP parameter control unit 303 controls such that the value of the weight information is not used beyond the prescribed range defined by the specifications and the like.

WPセレクタ304、305は、WPパラメータ制御部303から入力されたWP適用フラグに基づいて、各々の予測画像の接続端を切り替える。WPセレクタ304、305は、各々のWP適用フラグが0の場合、各々の出力端をデフォルト動き補償部301へ接続する。そしてWPセレクタ304、305は、第一予測画像及び第二予測画像を出力し、デフォルト動き補償部301に入力する。一方、WPセレクタ304、305は、各々のWP適用フラグが1の場合、各々の出力端を重み付き動き補償部302へ接続する。そしてWPセレクタ304、305は、第一予測画像及び第二予測画像を出力し、重み付き動き補償部302に入力する。   The WP selectors 304 and 305 switch the connection end of each predicted image based on the WP application flag input from the WP parameter control unit 303. When each WP application flag is 0, the WP selectors 304 and 305 connect each output terminal to the default motion compensation unit 301. Then, the WP selectors 304 and 305 output the first prediction image and the second prediction image, and input them to the default motion compensation unit 301. On the other hand, when each WP application flag is 1, the WP selectors 304 and 305 connect each output end to the weighted motion compensation unit 302. Then, the WP selectors 304 and 305 output the first prediction image and the second prediction image, and input the weighted motion compensation unit 302.

デフォルト動き補償部301は、WPセレクタ304、305から入力された2つの単方向予測画像(第一予測画像及び第二予測画像)を元に平均値処理(デフォルト動き補償予測)を行い、予測画像を生成する。具体的には、デフォルト動き補償部301は、第一WP適用フラグ及び第二WP適用フラグが0の場合、数式(1)に基づいて平均値処理を行う。   The default motion compensation unit 301 performs average value processing (default motion compensation prediction) based on the two unidirectional prediction images (first prediction image and second prediction image) input from the WP selectors 304 and 305 to obtain a prediction image. To generate. Specifically, when the first WP application flag and the second WP application flag are 0, the default motion compensation unit 301 performs an average value process based on Expression (1).

P[x,y]=Clip1((PL0[x,y]+PL1[x,y]+offset2)>>(shift2)) …(1)   P [x, y] = Clip1 ((PL0 [x, y] + PL1 [x, y] + offset2) >> (shift2)) (1)

ここで、P[x,y]は予測画像、PL0[x,y]は第一予測画像、PL1[x,y]は第二予測画像である。offset2及びshift2は平均値処理における丸め処理のパラメータであり、第一予測画像及び第二予測画像の内部演算精度によって定まる。Clip1(X)は、変数Xを特定のビット精度内にクリップする関数であり、ここでは、予測画像のビット精度内にクリップする。例えば予測画像のビット精度をL=8とした場合、0から255の範囲外の値を0から255にクリップする。更に具体的に説明すると、0以下の値を0に設定し、255より大きい値を255に設定する。   Here, P [x, y] is a predicted image, PL0 [x, y] is a first predicted image, and PL1 [x, y] is a second predicted image. offset2 and shift2 are parameters for rounding processing in the average value processing, and are determined by the internal calculation accuracy of the first predicted image and the second predicted image. Clip1 (X) is a function that clips the variable X within a specific bit precision, and here clips it within the bit precision of the prediction image. For example, when the bit precision of the predicted image is L = 8, a value outside the range of 0 to 255 is clipped to 0 to 255. More specifically, values less than or equal to 0 are set to 0, and values greater than 255 are set to 255.

予測画像のビット精度をL、第一予測画像及び第二予測画像のビット精度をM(L≦M)とすると、shift2は数式(2)で定式化され、offset2は数式(3)で定式化される。   Assuming that the bit precision of the predicted image is L and the bit precisions of the first predicted image and the second predicted image are M (L ≦ M), shift2 is formulated by equation (2), and offset2 is formulated by equation (3). Is done.

shift2=(M−L+1) …(2)   shift2 = (M−L + 1) (2)

offset2=(1<<(shift2−1) …(3)   offset2 = (1 << (shift2-1) (3)

例えば、予測画像のビット精度が8であり、第一予測画像及び第二予測画像のビット精度が14である場合、数式(2)よりshift2=7、数式(3)よりoffset2=(1<<6)となる。   For example, when the bit precision of the predicted image is 8, and the bit precisions of the first predicted image and the second predicted image are 14, shift2 = 7 from Expression (2), and offset2 = (1 <<) from Expression (3). 6).

なお、動き情報(予測パラメータ)で示される予測モードが単方向予測である場合、デフォルト動き補償部301は、第一予測画像のみを用いて、数式(4)に基づいて最終的な予測画像を算出する。   When the prediction mode indicated by the motion information (prediction parameter) is unidirectional prediction, the default motion compensation unit 301 uses only the first predicted image and calculates the final predicted image based on Expression (4). calculate.

P[x,y]=Clip1((PLX[x,y]+offset1)>>(shift1)) …(4)   P [x, y] = Clip1 ((PLX [x, y] + offset1) >> (shift1)) (4)

ここで、PLX[x,y]は単方向予測画像(第一予測画像)を示しており、Xは参照リストの0又は1のいずれかを示す識別子である。例えば、参照リストが0の場合はPL0[x,y]、参照リストが1の場合はPL1[x,y]となる。offset1及びshift1は丸め処理のパラメータであり、第一予測画像の内部演算精度によって定まる。予測画像のビット精度をL、第一予測画像のビット精度をMとすると、shift1は数式(5)で定式化され、offset1は数式(6)で定式化される。   Here, PLX [x, y] indicates a unidirectional predicted image (first predicted image), and X is an identifier indicating either 0 or 1 in the reference list. For example, when the reference list is 0, it is PL0 [x, y], and when the reference list is 1, it is PL1 [x, y]. offset1 and shift1 are parameters of the rounding process, and are determined by the internal calculation accuracy of the first predicted image. If the bit precision of the predicted image is L and the bit precision of the first predicted image is M, shift1 is formulated by Equation (5) and offset1 is formulated by Equation (6).

shift1=(M−L) …(5)   shift1 = (ML) (5)

offset1=(1<<(shift1−1) …(6)   offset1 = (1 << (shift1-1) (6)

例えば、予測画像のビット精度が8であり、第一予測画像のビット精度が14である場合、数式(5)よりshift1=6、数式(6)よりoffset1=(1<<5)となる。   For example, when the bit precision of the predicted image is 8 and the bit precision of the first predicted image is 14, shift1 = 6 from Expression (5), and offset1 = (1 << 5) from Expression (6).

重み付き動き補償部302は、WPセレクタ304、305から入力された2つの単方向予測画像(第一予測画像及び第二予測画像)とWPパラメータ制御部303から入力された重み情報とを元に重み付き動き補償(重み付き動き補償予測)を行う。   The weighted motion compensation unit 302 is based on the two unidirectional prediction images (first prediction image and second prediction image) input from the WP selectors 304 and 305 and the weight information input from the WP parameter control unit 303. Weighted motion compensation (weighted motion compensation prediction) is performed.

ここで、重み係数について更に説明する。図7は、重み係数の説明のための参考図であり、時間方向の画素値変化がある動画像の階調値の変化の一例を示している。図7に示す例では、符号化対象フレームをFrame(t)とし、時間的に1つ前のフレームをFrame(t−1)、時間的に1つ後のフレームをFrame(t+1)としている。図7に示すように、白から黒に変化するフェード画像では、画像の明度(階調値)が時間とともに減少していく。重み係数の値は、図7で説明したような画素値変化の度合いを意味しており、画素値変化が無い場合(画素値変化が0の場合)に実数値で表現すると1.0の値を取る。   Here, the weighting factor will be further described. FIG. 7 is a reference diagram for explaining the weighting coefficient, and shows an example of the change in the gradation value of the moving image having the change in the pixel value in the time direction. In the example shown in FIG. 7, the encoding target frame is Frame (t), the temporally preceding frame is Frame (t−1), and the temporally succeeding frame is Frame (t + 1). As shown in FIG. 7, in a fade image that changes from white to black, the brightness (tone value) of the image decreases with time. The value of the weighting factor means the degree of pixel value change as described with reference to FIG. 7, and when there is no pixel value change (when the pixel value change is 0), a value of 1.0 is represented by a real value. I take the.

ここで、画素値変化が無い場合について更に説明する。例えば、同一の静止画像が時間的に連続している動画像を想定した場合、画面間の輝度変化は0となる。この場合、重み付き動き補償部302は、重み付き動き補償予測を行っても画素値変化が0であるため、デフォルト動き補償予測を行っていることと等価となる。このような場合、即ち、画素値変化が無い場合、重み付き動き補償部302は、重み係数の基準値を選択することで、デフォルト動き補償予測を重み付き動き補償予測で実現する。ここで、重み係数の基準値は、固定小数点精度に従って導出でき、(1<<LWD)となる。   Here, the case where the pixel value does not change will be further described. For example, assuming a moving image in which the same still image is temporally continuous, the luminance change between screens is zero. In this case, the weighted motion compensation unit 302 is equivalent to performing the default motion compensation prediction because the pixel value change is 0 even if the weighted motion compensation prediction is performed. In such a case, that is, when there is no pixel value change, the weighted motion compensation unit 302 implements the default motion compensation prediction by the weighted motion compensation prediction by selecting the reference value of the weighting coefficient. Here, the reference value of the weighting factor can be derived in accordance with the fixed point precision and becomes (1 << LWD).

また、一般的に、フェード効果やディゾルブ効果などの動画像の画素値変化はフレーム毎にそれほど大きく変化しないため、重み係数の値は、実数値で表現した場合に1.0近傍に偏っている。なお、第1実施形態では、重み係数の値は2のべき乗で示される固定小数点精度に量子化されているため、2つの画像間で平均的な画素値変化が僅かに生じたとしても1/128精度以下での変化であれば、重み係数の値は実数値で表現した場合に1.0に量子化される。このため、第1実施形態では、画素値変化が生じたとしても実質的に画素値変化が無い場合として扱うことができる。以下では、説明を簡単にするため、画素値変化が無い場合、即ち、重み係数の値を実数値で表現すると1.0となる場合を想定して、説明を行う。なお、画素値変化が無い場合は、画素値変化が所定の値(重み係数の精度よりも十分小さい値)以下であることに相当する。   Further, in general, a pixel value change of a moving image such as a fade effect or a dissolve effect does not change so much for each frame, and therefore the value of the weighting factor is biased to around 1.0 when expressed by a real value. . In the first embodiment, the value of the weighting factor is quantized to the fixed point precision represented by a power of 2, so that even if a slight change in average pixel value occurs between two images, If the change is less than 128 precision, the value of the weighting coefficient is quantized to 1.0 when expressed by a real value. Therefore, in the first embodiment, it can be treated as a case where the pixel value does not substantially change even if the pixel value changes. In the following, in order to simplify the description, the description will be made assuming that there is no pixel value change, that is, the case where the value of the weighting coefficient is 1.0 when expressed by a real value. If there is no change in pixel value, it means that the change in pixel value is equal to or smaller than a predetermined value (a value sufficiently smaller than the accuracy of the weighting coefficient).

このため、重み付き動き補償部302は、第一WP適用フラグ及び第二WP適用フラグが1の場合、数式(7)に基づいて重み付き処理を行う。   Therefore, when the first WP application flag and the second WP application flag are 1, the weighted motion compensation unit 302 performs the weighting process based on Expression (7).

P[x,y]=Clip1(((PL0[x,y]*w0C+PL1[x,y]*w1C+((o0C+o1C+1)<<LWD))>>(LWD+1))) …(7)   P [x, y] = Clip1 (((PL0 [x, y] * w0C + PL1 [x, y] * w1C + ((o0C + o1C + 1) << LWD)) >> (LWD + 1))) ... (7)

なお、重み付き動き補償部302は、第一予測画像及び第二予測画像と予測画像との演算精度が異なる場合、LWDを数式(8)のように制御することで丸め処理を実現する。   Note that the weighted motion compensation unit 302 implements the rounding process by controlling LWD as in Expression (8) when the calculation accuracy of the first predicted image and the second predicted image is different from that of the predicted image.

LWD’=LWD+offset1 …(8)   LWD '= LWD + offset1 (8)

丸め処理は、数式(7)のLWDを、数式(8)のLWD’に置き換えることで実現できる。例えば、予測画像のビット精度が8であり、第一予測画像及び第二予測画像のビット精度が14である場合、LWDを再設定することにより、数式(1)のshift2と同様の演算精度における一括丸め処理を実現することが可能となる。   The rounding process can be realized by replacing the LWD in Expression (7) with LWD ′ in Expression (8). For example, when the bit precision of the predicted image is 8 and the bit precision of the first predicted image and the second predicted image is 14, by resetting LWD, it is possible to obtain the same calculation precision as that of shift2 in Expression (1). It is possible to realize a batch rounding process.

なお、動き情報(予測パラメータ)で示される予測モードが単方向予測である場合、重み付き動き補償部302は、第一予測画像のみを用いて、数式(9)に基づいて最終的な予測画像を算出する。   When the prediction mode indicated by the motion information (prediction parameter) is unidirectional prediction, the weighted motion compensator 302 uses only the first predicted image and calculates the final predicted image based on Expression (9). Is calculated.

P[x,y]=Clip1((PLX[x,y]*wXC+(1<<(LWD−1)))>>(LWD)+oXC) …(9)   P [x, y] = Clip1 ((PLX [x, y] * wXC + (1 << (LWD-1))) >> (LWD) + oXC) (9)

ここで、PLX[x,y]は単方向予測画像(第一予測画像)を示し、wXCは単方向予測に対応する重み係数を示しており、Xは参照リストの0又は1のいずれかを示す識別子であり、oXCは単方向予測に対応するオフセットを示す。例えば、参照リストが0の場合はPL0[x,y]、w0C、o0C、参照リストが1の場合はPL1[x,y]、w1C、o1Cとなる。   Here, PLX [x, y] indicates a unidirectional prediction image (first prediction image), wXC indicates a weighting factor corresponding to unidirectional prediction, and X indicates either 0 or 1 in the reference list. OXC indicates an offset corresponding to unidirectional prediction. For example, if the reference list is 0, PL0 [x, y], w0C, o0C, and if the reference list is 1, PL1 [x, y], w1C, o1C.

なお、重み付き動き補償部302は、第一予測画像及び第二予測画像と予測画像との演算精度が異なる場合、LWDを双方向予測時と同様に数式(8)のように制御することで丸め処理を実現する。   Note that the weighted motion compensation unit 302 controls the LWD like Equation (8) as in bidirectional prediction when the first prediction image and the second prediction image have different calculation precisions from the prediction image. Achieve rounding processing.

丸め処理は、数式(9)のLWDを、数式(8)のLWD’に置き換えることで実現できる。例えば、予測画像のビット精度が8であり、第一予測画像のビット精度が14である場合、LWDを再設定することにより、数式(4)のshift1と同様の演算精度における一括丸め処理を実現することが可能となる。   The rounding process can be realized by replacing the LWD in Expression (9) with LWD ′ in Expression (8). For example, when the bit precision of the predicted image is 8 and the bit precision of the first predicted image is 14, by resetting LWD, a batch rounding process with the same calculation precision as shift1 in Formula (4) is realized. It becomes possible to do.

なお、単方向予測の場合には、第二予測画像に対応する各種パラメータ(第二WP適応フラグ、第二重み係数、及び第二オフセットの情報)は利用されないため、予め定めた初期値に設定されていてもよい。   Note that in the case of unidirectional prediction, various parameters (second WP adaptation flag, second weighting coefficient, and second offset information) corresponding to the second predicted image are not used, so set to a predetermined initial value. It may have been done.

図1に戻り、動き評価部109は、入力画像と予測画像生成部107から入力された参照画像とに基づき複数フレーム間の動き評価を行い、動き情報及びWPパラメータ情報を出力し、動き情報を予測画像生成部107及び符号化部110に入力し、WPパラメータ情報を予測画像生成部107及びインデックス設定部108に入力する。   Referring back to FIG. 1, the motion estimator 109 performs motion estimation between a plurality of frames based on the input image and the reference image input from the predicted image generator 107, outputs motion information and WP parameter information, and outputs the motion information. It is input to the predicted image generation unit 107 and the encoding unit 110, and the WP parameter information is input to the predicted image generation unit 107 and the index setting unit 108.

動き評価部109は、例えば、予測対象画素ブロックの入力画像と同位置に対応する複数の参照画像を起点として差分値を計算することで誤差を算出し、この位置を分数精度でずらし、誤差最小のブロックを探すブロックマッチングなどの手法により、最適な動き情報を算出する。動き評価部109は、双方向予測の場合には、単方向予測で導出された動き情報を用いて、数式(1)及び数式(4)に示すようなデフォルト動き補償予測を含むブロックマッチングを行うことにより、双方向予測の動き情報を算出する。   The motion evaluator 109 calculates an error by calculating a difference value from a plurality of reference images corresponding to the same position as the input image of the pixel block to be predicted as a starting point, for example, and shifts the position with fractional accuracy to minimize the error. Optimum motion information is calculated by a method such as block matching for searching for a block. In the case of bidirectional prediction, the motion evaluator 109 performs block matching including default motion compensation prediction as shown in Expressions (1) and (4) using the motion information derived in unidirectional prediction. Thereby, motion information for bidirectional prediction is calculated.

この際、動き評価部109は、数式(7)及び数式(9)で示されるような重み付き動き補償予測を含むブロックマッチングを行うことにより、WPパラメータ情報を算出できる。なお、WPパラメータ情報の算出には、入力画像の画素勾配を用いて重み係数やオフセットを算出する方法や、符号化した際の予測誤差の累積による重み係数やオフセットの算出方法などを用いてもよい。またWPパラメータ情報は、符号化装置毎に予め定めた固定値を用いてもよい。   At this time, the motion evaluator 109 can calculate WP parameter information by performing block matching including weighted motion compensation prediction as shown in Expressions (7) and (9). Note that the WP parameter information may be calculated by using a method of calculating a weighting coefficient or offset using the pixel gradient of the input image, a method of calculating a weighting coefficient or offset by accumulating prediction errors at the time of encoding, or the like. Good. As the WP parameter information, a fixed value predetermined for each encoding device may be used.

ここで、再度図7を参照しながら、時間的に画素値変化のある動画像から、重み係数、重み係数の固定小数点精度、及びオフセットを算出する方法を説明する。前述したように、図7に示すような白から黒に変化するフェード画像では、画素値(階調値)が時間とともに減少していく。動き評価部109は、この傾きを計算することにより、重み係数を算出することができる。   Here, referring to FIG. 7 again, a method of calculating the weighting coefficient, the fixed point precision of the weighting coefficient, and the offset from the moving image in which the pixel value changes temporally will be described. As described above, in the fade image that changes from white to black as shown in FIG. 7, the pixel value (gradation value) decreases with time. The motion evaluator 109 can calculate the weight coefficient by calculating the inclination.

また、重み係数の固定小数点精度は、この傾きの精度を示す情報であり、動き評価部109は、参照画像の時間的な距離と画像値の変化度から、最適な値を計算できる。例えば、図7において、Frame(t−1)〜Frame(t+1)間の重み係数の値を実数精度で表現すると0.75である場合、1/4精度であれば、3/4が表現できるため、動き評価部109は、固定小数点精度を2(1<<2)に設定する。固定小数点精度の値は、重み係数を符号化した場合の符号量に影響を与えるため、符号量と予測精度を考慮して最適な値を選択すればよい。なお、固定小数点精度の値は、予め定めた固定値としてもよい。   Further, the fixed point precision of the weighting factor is information indicating the precision of this inclination, and the motion evaluation unit 109 can calculate an optimum value from the temporal distance of the reference image and the degree of change of the image value. For example, in FIG. 7, when the value of the weighting coefficient between Frame (t−1) and Frame (t + 1) is expressed in real number precision as 0.75, it can be expressed as 3/4 in 1/4 precision. Therefore, the motion evaluation unit 109 sets the fixed-point precision to 2 (1 << 2). Since the value of the fixed-point precision affects the code amount when the weight coefficient is encoded, an optimum value may be selected in consideration of the code amount and the prediction accuracy. Note that the value of the fixed-point precision may be a predetermined fixed value.

また、動き評価部109は、傾きが一致しない場合、一次関数の切片に対応する補正値(ズレ量)を求めることでオフセット値を算出できる。例えば、図7において、Frame(t−1)〜Frame(t+1)間の重み係数の値を実数精度で表現すると0.60であり、固定小数点精度が1(1<<1)である場合、重み係数は1(つまり、重み係数の値を実数精度で表現した場合の0.50に該当)が設定される可能性が高い。この場合、重み係数の小数点精度は、最適な値である0.60から0.10ずれているため、動き評価部109は、この分の補正値を画素の最大値から計算し、オフセット値として設定する。画素の最大値が255である場合、動き評価部109は、25(255×0.1)などの値を設定すればよい。   Further, when the inclinations do not match, the motion evaluation unit 109 can calculate the offset value by obtaining the correction value (deviation amount) corresponding to the intercept of the linear function. For example, in FIG. 7, when the value of the weighting coefficient between Frame (t-1) to Frame (t + 1) is expressed in real number precision, it is 0.60, and when the fixed point precision is 1 (1 << 1), It is highly possible that the weighting factor is set to 1 (that is, corresponds to 0.50 when the value of the weighting factor is expressed in real number precision). In this case, the decimal point precision of the weighting coefficient is shifted from the optimal value of 0.60 by 0.10, and therefore, the motion estimating unit 109 calculates the correction value for this value from the maximum value of the pixel, and sets Set. When the maximum value of the pixel is 255, the motion evaluator 109 may set a value such as 25 (255 × 0.1).

なお第1実施形態では、符号化装置100の一機能として動き評価部109を例示しているが、動き評価部109は符号化装置100の必須の構成ではなく、例えば、動き評価部109を符号化装置100外の装置としてもよい。この場合、動き評価部109で算出された動き情報及びWPパラメータ情報を符号化装置100にロードするようにすればよい。   In the first embodiment, the motion estimation unit 109 is exemplified as one function of the encoding device 100. However, the motion estimation unit 109 is not an essential component of the encoding device 100. It may be a device outside the chemical conversion device 100. In this case, the motion information and the WP parameter information calculated by the motion evaluation unit 109 may be loaded into the encoding device 100.

インデックス設定部108は、動き評価部109から入力されたWPパラメータ情報を受け取り、参照リスト(リスト番号)と参照画像(参照番号)とを確認して、インデックス情報を出力し、符号化部110に入力する。インデックス設定部108は、動き評価部109から入力されたWPパラメータ情報を、後述するシンタクス要素にマッピングしてインデックス情報を生成する。この際、インデックス設定部108は、重み係数の選択範囲を導出し、重み係数が当該選択範囲に含まれていることを確認する。   The index setting unit 108 receives the WP parameter information input from the motion evaluation unit 109, checks the reference list (list number) and the reference image (reference number), outputs index information, and outputs the index information to the encoding unit 110. input. The index setting unit 108 maps the WP parameter information input from the motion evaluation unit 109 to a syntax element described below to generate index information. At this time, the index setting unit 108 derives the selection range of the weighting factor and confirms that the weighting factor is included in the selection range.

ここで、重み係数の選択範囲の導出について説明する。   Here, the derivation of the selection range of the weighting factor will be described.

第1実施形態では、前述したように、画素値変化が無く、重み係数の値を実数値で表現すると1.0となる場合を想定しており、この場合、重み係数/重み係数の基準値=1が成立する。重み係数の基準値は、前述したように、(1<<LWD)であるため、第1実施形態では、重み係数は(1<<LWD)となり、重み係数の基準値と同値となる。   In the first embodiment, as described above, it is assumed that there is no pixel value change and the value of the weighting coefficient is 1.0 when expressed by a real value. In this case, the weighting coefficient / reference value of the weighting coefficient is assumed. = 1 is established. Since the reference value of the weighting factor is (1 << LWD) as described above, the weighting factor is (1 << LWD) in the first embodiment, which is the same value as the reference value of the weighting factor.

ところで、H.264などでは、重み係数やオフセットなどのインデックスは、−128から127までの符号付き8ビットの値を取るよう規定され、固定小数点精度は、0から7までの値を取るように規定されている。このため第1実施形態では、重み係数が規定の範囲外となる場合が生じる。   By the way, H. In H.264 and the like, indexes such as weighting factors and offsets are specified to take signed 8-bit values from -128 to 127, and fixed-point precision is specified to take values from 0 to 7. . Therefore, in the first embodiment, the weighting factor may be out of the specified range.

図8は、H.264における重み係数の選択範囲を示す参考図であり、固定小数点精度LWDがそれぞれ0から7の値を取った場合の重み係数(1<<LWD)を示している。図8から明らかなように、重み係数は、固定小数点精度LWDの値が小さくなると0近辺の正の値を取るが、固定小数点精度LWDの値が7になると128となり、H.264の規定の範囲外となる。   FIG. It is a reference diagram showing a selection range of the weighting coefficient in H.264, and shows the weighting coefficient (1 << LWD) when the fixed point precision LWD takes a value of 0 to 7, respectively. As is clear from FIG. 8, the weighting factor takes a positive value near 0 when the value of the fixed point precision LWD becomes small, but becomes 128 when the value of the fixed point precision LWD becomes 7, and H.264. It is outside the range specified by H.264.

このように、H.264の規定では、使用したい重み係数の範囲が規定の範囲外となってしまい、実用面に則さないことがある。また、単方向予測では、負の方向に対応する重み係数を選択したとしても、単方向予測で出力される予測画素値が入力画像のビット範囲にクリップ処理され0となる可能性が高く、負の方向に対応する重み係数を実質的に選択できない。一方、双方向予測では、外挿予測を実現するために、片方の単方向予測の重み係数を負の値に設定し、他方の重み係数を正の値に設定するといった使い方が可能であるが、負側の値は、重み係数の範囲として、正側の値と同じ精度が必要とならない場合が多い。   Thus, H.264. According to the H.264 standard, the range of the weighting coefficient to be used may be outside the specified range, which may not be practical. Further, in unidirectional prediction, even if a weighting coefficient corresponding to a negative direction is selected, the predicted pixel value output in unidirectional prediction is highly likely to be clipped to the bit range of the input image to 0, and The weighting factor corresponding to the direction of can not be selected substantially. On the other hand, in bidirectional prediction, in order to realize extrapolation prediction, it is possible to use one of the unidirectional prediction weighting factors as a negative value and the other weighting factor as a positive value. In many cases, the value on the negative side does not require the same accuracy as the value on the positive side as the range of the weighting coefficient.

このため、第1実施形態では、インデックス設定部108は、重み係数の基準値を略中心として負の方向と正の方向に値を割り振ることにより重み係数の選択範囲を導出し、導出した重み係数の選択範囲内に重み係数が含まれていることを確認する。   Therefore, in the first embodiment, the index setting unit 108 derives the selection range of the weighting factor by allocating the values in the negative direction and the positive direction with the reference value of the weighting factor as the center, and derives the derived weighting factor. Confirm that the weighting factor is included in the selection range of.

図9は、第1実施形態の重み係数の選択範囲の一例を示す説明図である。図9に示す例では、図8で説明した重み係数の選択範囲と異なり、重み係数の基準値(1<<LWD)が、選択範囲の略中心に位置するように配置され、重み係数の基準値から128を減算した値(−128+(1<<LWD))が選択範囲の最小値となり、重み係数の基準値に127を加算した値(127+(1<<LWD))が選択範囲の最大値となっている。   FIG. 9 is an explanatory diagram showing an example of the selection range of the weighting factor according to the first embodiment. In the example shown in FIG. 9, unlike the weighting factor selection range described with reference to FIG. 8, the weighting factor reference value (1 << LWD) is arranged so as to be located substantially at the center of the selection range. The value obtained by subtracting 128 from the value (-128+ (1 << LWD)) becomes the minimum value of the selection range, and the value obtained by adding 127 to the reference value of the weighting factor (127+ (1 << LWD)) is the maximum of the selection range. It is a value.

インデックス設定部108は、数式(10)及び数式(11)を用いて、重み係数の選択範囲を設定する。なお、数式(10)で選択範囲の最小値が定式化され、数式(11)で選択範囲の最大値が定式化される。   The index setting unit 108 uses Equations (10) and (11) to set the selection range of weighting factors. The minimum value of the selection range is formulated by the formula (10), and the maximum value of the selection range is formulated by the formula (11).

min_wXC=−128+(1<<LWD) …(10)   min_wXC = -128 + (1 << LWD) (10)

max_wXC=127+(1<<LWD) …(11)   max_wXC = 127 + (1 << LWD) (11)

図10A及び図10Bは、第1実施形態の重み係数の選択範囲の具体例を示す説明図であり、図10Aは、固定小数点精度LWDの値が7の場合の重み係数の選択範囲を示し、図10Bは、固定小数点精度LWDの値が5の場合の重み係数の選択範囲を示している。図10Aに示す例では、重み係数の基準値である128が選択範囲の略中心に位置するように配置され、選択範囲の最小値が0となり、選択範囲の最大値が255となっている。図10Bに示す例では、重み係数の基準値である32が選択範囲の略中心に位置するように配置され、選択範囲の最小値が−96となり、選択範囲の最大値が159となっている。   10A and 10B are explanatory diagrams showing a specific example of the selection range of the weighting factor of the first embodiment, and FIG. 10A shows the selection range of the weighting factor when the value of the fixed point precision LWD is 7. FIG. 10B shows the selection range of the weighting factor when the value of the fixed point precision LWD is 5. In the example shown in FIG. 10A, the reference value 128 of the weighting coefficient is arranged so as to be located substantially at the center of the selection range, the minimum value of the selection range is 0, and the maximum value of the selection range is 255. In the example shown in FIG. 10B, the reference value 32 of the weighting factor is arranged so as to be located substantially at the center of the selection range, the minimum value of the selection range is −96, and the maximum value of the selection range is 159. .

図11は、H.264における重み係数の選択範囲の最小値及び最大値を示す参考図であり、図12は、第1実施形態の重み係数の選択範囲の最小値及び最大値の一例を示す説明図である。図11に示すように、H.264では、重み係数の選択範囲の最小値及び最大値は、重み係数の基準値に依存せず、一定である。一方、図12に示すように、第1実施形態では、重み係数の選択範囲の最小値及び最大値は、重み係数の基準値に依存して変動している。   FIG. FIG. 12 is a reference diagram showing the minimum value and the maximum value of the selection range of the weighting coefficient in H.264, and FIG. 12 is an explanatory diagram showing an example of the minimum value and the maximum value of the selection range of the weighting coefficient of the first embodiment. As shown in FIG. In H.264, the minimum value and the maximum value of the selection range of the weight coefficient are constant without depending on the reference value of the weight coefficient. On the other hand, as shown in FIG. 12, in the first embodiment, the minimum value and the maximum value of the selection range of the weight coefficient fluctuate depending on the reference value of the weight coefficient.

図12に示すように、重み係数の基準値を略中心として重み係数の選択範囲を設定した場合、重み係数の取りうる範囲は、−127から255となり、符号付き9ビットの精度が必要となる。このため、第1実施形態では、後述の符号化部110が、インデックスとして設定された重み係数、即ち、符号化対象の値を、重み係数と重み係数の基準値との差分値に更新する。図9に示すように、導出した重み係数の選択範囲から重み係数の基準値を減算すると、重み係数の差分値の範囲が−128から127までの符号付き8ビットの値を取ることが分かる。つまり、重み係数の基準値を略中心として重み係数の選択範囲を設定した場合、重み係数の選択範囲は重み係数の基準値に依存して変動するが、重み係数の選択範囲から重み係数の基準値を減算することにより、重み係数の差分値の範囲は、重み係数の基準値に依存せず、一定となる。このように第1実施形態では、重み係数を重み係数の差分値に置き換えるので、重み係数の選択範囲を拡張し、かつ符号付き8ビット精度の選択範囲を規定することができる。   As shown in FIG. 12, when the selection range of the weighting factor is set with the reference value of the weighting factor substantially at the center, the range of the weighting factor is -127 to 255, and 9-bit signed precision is required. . Therefore, in the first embodiment, the encoding unit 110, which will be described later, updates the weighting coefficient set as an index, that is, the value to be encoded, to the difference value between the weighting coefficient and the reference value of the weighting coefficient. As shown in FIG. 9, when the reference value of the weighting factor is subtracted from the derived selection range of the weighting factor, the range of the difference value of the weighting factor takes a signed 8-bit value from -128 to 127. In other words, when the weighting factor selection range is set with the reference value of the weighting factor substantially at the center, the weighting factor selection range varies depending on the weighting factor reference value. By subtracting the values, the range of the difference value of the weight coefficient becomes constant without depending on the reference value of the weight coefficient. As described above, in the first embodiment, since the weight coefficient is replaced with the difference value of the weight coefficient, the selection range of the weight coefficient can be expanded and the signed 8-bit precision selection range can be defined.

なお、インデックス設定部108は、重み係数が導出した重み係数の選択範囲内に含まれていないことを確認した場合、重み係数の選択範囲の最大値又は最小値を用いてクリップ処理を行ってもよい。この場合、インデックス設定部108は、重み係数が選択範囲の最小値より小さければ当該最小値でクリップし、重み係数が選択範囲の最大値よりも大きければ当該最大値でクリップすればよい。このようなクリップ処理を導入することで、特定の範囲制約を設けなくても、重み係数の差分値などの符号化対象の値は、予め定められたビット精度内の値を取るため、ハードウェアが用いる回路規模の構成を明確化できる。   If the index setting unit 108 confirms that the weighting factor is not included in the derived weighting factor selection range, the indexing unit 108 may perform clipping processing using the maximum value or the minimum value of the weighting factor selection range. Good. In this case, the index setting unit 108 may clip at the minimum value if the weight coefficient is smaller than the minimum value in the selection range, and at the maximum value if the weight coefficient is larger than the maximum value in the selection range. By introducing such a clipping process, the value to be encoded such as the difference value of the weighting coefficient takes a value within a predetermined bit precision even if a specific range constraint is not set. Can clarify the circuit scale configuration used by.

また第1実施形態では、重み係数の選択範囲が符号付き8ビットの精度である場合を想定しているが、重み係数の選択範囲の精度はこれに限定されるものではなく、例えば、符号付き9ビットの精度としてもよい。この場合、重み係数の選択範囲は、−256から255までとなるが、数式(10)の−128を−256に置き換え、数式(11)の127を255に置き換えればよい。   Further, in the first embodiment, it is assumed that the selection range of the weighting coefficient has a precision of signed 8-bit, but the accuracy of the selection range of the weighting factor is not limited to this. The precision may be 9 bits. In this case, the selection range of the weighting coefficient is from -256 to 255, but -128 in Expression (10) may be replaced with -256, and 127 in Expression (11) may be replaced with 255.

また第1実施形態では、重み係数の選択範囲の導出をインデックス設定部108が行う例について説明したが、これに限定されず、符号化部110で行うようにしてもよい。つまり、インデックス設定部108を導出部としてもよいし、符号化部110を導出部としてもよい。   Further, in the first embodiment, the example in which the index setting unit 108 derives the selection range of the weighting factor has been described, but the present invention is not limited to this, and the encoding unit 110 may perform it. That is, the index setting unit 108 may be the derivation unit, and the coding unit 110 may be the derivation unit.

図13A及び図13Bは、第1実施形態のインデックス設定部108に入力されるWPパラメータ情報の一例を示す図である。P−slice時のWPパラメータ情報の一例は、図13Aに示すとおりであり、B−slice時のWPパラメータ情報の一例は、図13A及び図13Bに示すとおりである。リスト番号は、予測方向を示す識別子であり、単方向予測時は0の値を取り、双方向予測時は2種類の予測を用いることができるため、0と1の2つの値を取る。参照番号は、フレームメモリ206に示される1〜Nに対応する値である。WPパラメータ情報は、参照リストと参照画像毎に保持されるため、B−slice時で必要な情報は、参照画像がN個とすると2N個となる。   13A and 13B are diagrams illustrating an example of WP parameter information input to the index setting unit 108 according to the first embodiment. An example of the WP parameter information at the time of P-slice is as shown in FIG. 13A, and an example of the WP parameter information at the time of B-slice is as shown in FIG. 13A and FIG. 13B. The list number is an identifier indicating the prediction direction, and takes a value of 0 in unidirectional prediction, and takes two values of 0 and 1 since two types of prediction can be used in bidirectional prediction. The reference numbers are values corresponding to 1 to N shown in the frame memory 206. Since the WP parameter information is held for each reference list and reference image, the information necessary for B-slice is 2N when the number of reference images is N.

図14は、第1実施形態の重み係数の選択範囲の導出処理の一例を示すフローチャートである。ここでは、インデックス設定部108が重み係数の選択範囲の導出処理を行う場合を想定して説明するが、前述したように、符号化部110が行ってもよい。   FIG. 14 is a flowchart showing an example of the derivation process of the selection range of the weighting factor according to the first embodiment. Here, description will be made assuming that the index setting unit 108 performs the derivation process of the selection range of the weighting coefficient, but as described above, the encoding unit 110 may perform it.

まず、インデックス設定部108は、重み係数の固定小数点精度LWDを導出する(ステップS02)。ここで、インデックス設定部108は、重み係数の固定小数点精度LWDをWPパラメータ情報から導出してもよいし、インデックス情報から導出してもよい。   First, the index setting unit 108 derives the fixed point precision LWD of the weighting factor (step S02). Here, the index setting unit 108 may derive the fixed point precision LWD of the weighting factor from the WP parameter information or the index information.

続いて、インデックス設定部108は、導出した固定小数点精度LWDを用いて、重み係数の基準値(1<<LWD)を導出する(ステップS03)。   Subsequently, the index setting unit 108 derives the reference value (1 << LWD) of the weighting factor using the derived fixed-point precision LWD (step S03).

続いて、インデックス設定部108は、導出した重み係数の基準値(1<<LWD)から128を減算し、重み係数の選択範囲の最小値を導出する(ステップS04)。   Subsequently, the index setting unit 108 subtracts 128 from the derived reference value (1 << LWD) of the weighting factor to derive the minimum value of the selection range of the weighting factor (step S04).

続いて、インデックス設定部108は、導出した重み係数の基準値(1<<LWD)に127を加算し、重み係数の選択範囲の最大値を導出する(ステップS05)。   Subsequently, the index setting unit 108 adds 127 to the derived reference value (1 << LWD) of the weighting factor to derive the maximum value of the selection range of the weighting factor (step S05).

そしてインデックス設定部108は、導出した重み係数の選択範囲内に重み係数が含まれていることを確認する。   Then, the index setting unit 108 confirms that the weighting factor is included in the derived selection range of the weighting factor.

図1に戻り、符号化部110は、量子化部103から入力された量子化変換係数、動き評価部109から入力された動き情報、インデックス設定部108から入力されたインデックス情報及び重み係数の選択範囲、並びに符号化制御部111によって指定される量子化情報などの様々な符号化パラメータに対して符号化処理を行い、符号化データを生成する。符号化処理は、例えば、ハフマン符号化や算術符号化などが該当する。   Returning to FIG. 1, the encoding unit 110 selects the quantized transform coefficient input from the quantization unit 103, the motion information input from the motion evaluation unit 109, the index information input from the index setting unit 108, and the weighting coefficient. Encoding processing is performed on various encoding parameters such as the range and the quantization information designated by the encoding control unit 111 to generate encoded data. The encoding process corresponds to, for example, Huffman encoding or arithmetic encoding.

符号化パラメータとは、予測方法などを示す予測情報、量子化変換係数に関する情報、及び量子化に関する情報などの復号に必要となるパラメータである。例えば、符号化制御部111が図示せぬ内部メモリを持ち、この内部メモリに符号化パラメータが保持され、画素ブロックを符号化する際に隣接する既に符号化済みの画素ブロックの符号化パラメータを用いるようにできる。例えば、H.264のイントラ予測では、符号化済みの隣接ブロックの予測情報から、画素ブロックの予測情報を導出することができる。   The coding parameter is a parameter required for decoding prediction information indicating a prediction method and the like, information regarding a quantized transform coefficient, and information regarding quantization. For example, the encoding control unit 111 has an internal memory (not shown), and the encoding parameters are held in the internal memory. When encoding a pixel block, the encoding control unit 111 uses the encoding parameters of an adjacent already encoded pixel block. I can do it. For example, H.264. In the H.264 intra prediction, prediction information of a pixel block can be derived from prediction information of an encoded adjacent block.

符号化部110は、生成した符号化データを、符号化制御部111が管理する適切な出力タイミングに従って出力する。出力された符号化データは、例えば、図示せぬ多重化部などで様々な情報が多重化されて、図示せぬ出力バッファなどに一時的に蓄積された後に、例えば、図示せぬ蓄積系(蓄積メディア)又は伝送系(通信回線)へ出力される。   The encoding unit 110 outputs the generated encoded data according to an appropriate output timing managed by the encoding control unit 111. The output encoded data is multiplexed with various information by a multiplexing unit (not shown), for example, and temporarily stored in an output buffer (not shown). (Storage media) or a transmission system (communication line).

符号化部110は、エントロピー符号化部110Aと、インデックス再構成部110Bとを、備える。   The coding unit 110 includes an entropy coding unit 110A and an index reconstructing unit 110B.

エントロピー符号化部110Aは、入力されてきた情報に対して可変長符号化や算術符号化などの符号化処理を行う。例えば、H.264では、コンテキスト適応型の可変長符号化(CAVLC:Context based Adaptive Variable Length Coding)やコンテキスト適応型の算術符号化(CABAC:Context based Adaptive Binary Arithmetic Coding)などが用いられる。   The entropy coding unit 110A performs coding processing such as variable length coding and arithmetic coding on the input information. For example, H.264. In H.264, context-based adaptive variable length coding (CAVLC) and context-based adaptive binary coding (CABAC) are used, and context-based adaptive variable length coding (CAVLC).

インデックス再構成部110Bは、インデックス設定部108から入力されたインデックス情報のシンタクス要素の符号長を削減するため、シンタクス要素のパラメータの特徴に応じて予測処理を行い、シンタクス要素のそのままの値(直値)と予測値の差分値とを計算し、エントロピー符号化部110Aに出力する。予測処理の具体例は、後述する。なお、重み係数の選択範囲の導出を符号化部110で行う場合、インデックス再構成部110Bで行うことになる。   In order to reduce the code length of the syntax element of the index information input from the index setting unit 108, the index reconstructing unit 110B performs prediction processing according to the characteristics of the parameter of the syntax element, and the value of the syntax element as it is (direct (Value) and the difference value between the prediction values and outputs the calculated value to the entropy coding unit 110A. A specific example of the prediction process will be described later. When the encoding unit 110 derives the selection range of the weighting coefficient, the index reconstructing unit 110B performs it.

図15は、第1実施形態の符号化装置100が利用するシンタクス500の一例を示す図である。シンタクス500は、符号化装置100が入力画像(動画像データ)を符号化して生成した符号化データの構造を示している。符号化データを復号する場合、後述の復号装置は、シンタクス500と同一のシンタクス構造を参照して動画像データのシンタクス解釈を行う。   FIG. 15 is a diagram showing an example of the syntax 500 used by the encoding device 100 of the first embodiment. Syntax 500 indicates the structure of encoded data generated by encoding apparatus 100 by encoding an input image (moving image data). When decoding the encoded data, the decoding device described below refers to the same syntax structure as the syntax 500 and interprets the syntax of the moving image data.

シンタクス500は、ハイレベルシンタクス501、スライスレベルシンタクス502及びコーディングツリーレベルシンタクス503の3つのパートを含む。ハイレベルシンタクス501は、スライスよりも上位のレイヤのシンタクス情報を含む。シンタクス情報は、例えば、図2Bに示す例で説明したタイル状の分割情報を含む。スライスとは、フレーム若しくはフィールドに含まれる矩形領域又は連続領域を指す。スライスレベルシンタクス502は、各スライスを復号するために必要な情報を含む。コーディングツリーレベルシンタクス503は、各コーディングツリー(即ち、各コーディングツリーブロック)を復号するために必要な情報を含む。これら各パートは、更に詳細なシンタクスを含む。   The syntax 500 includes three parts: a high-level syntax 501, a slice-level syntax 502, and a coding-tree-level syntax 503. The high-level syntax 501 includes syntax information of a layer higher than the slice. The syntax information includes, for example, the tiled division information described in the example illustrated in FIG. 2B. A slice refers to a rectangular area or a continuous area included in a frame or a field. Slice level syntax 502 contains the information needed to decode each slice. The coding tree level syntax 503 includes information necessary for decoding each coding tree (that is, each coding tree block). Each of these parts contains more detailed syntax.

ハイレベルシンタクス501は、シーケンスパラメータセットシンタクス504、ピクチャパラメータセットシンタクス505、及びアダプテーションパラメータセットシンタクス506などのシーケンス及びピクチャレベルのシンタクスを含む。   The high-level syntax 501 includes sequence and picture-level syntax such as a sequence parameter set syntax 504, a picture parameter set syntax 505, and an adaptation parameter set syntax 506.

スライスレベルシンタクス502は、スライスヘッダーシンタクス507、プレッドウェイトテーブルシンタクス508、及びスライスデータシンタクス509などを含む。プレッドウェイトテーブルシンタクス508は、スライスヘッダーシンタクス507から呼び出される。   The slice level syntax 502 includes a slice header syntax 507, a spread weight table syntax 508, a slice data syntax 509, and the like. The pread weight table syntax 508 is called from the slice header syntax 507.

コーディングツリーレベルシンタクス503は、コーディングツリーユニットシンタクス510、トランスフォームユニットシンタクス511、及びプレディクションユニットシンタクス512などを含む。コーディングツリーユニットシンタクス510は、四分木構造を持つことができる。具体的には、コーディングツリーユニットシンタクス510のシンタクス要素として、更にコーディングツリーユニットシンタクス510を再帰呼び出しすることができる。即ち、1つのコーディングツリーブロックを四分木で細分化することができる。また、コーディングツリーユニットシンタクス510内にはトランスフォームユニットシンタクス511が含まれている。トランスフォームユニットシンタクス511は、四分木の最末端の各コーディングツリーユニットシンタクス510において呼び出される。トランスフォームユニットシンタクス511は、逆直交変換及び量子化などに関わる情報が記述されている。これらのシンタクスには、重み付き動き補償予測に関する情報が記述されてもよい。   The coding tree level syntax 503 includes a coding tree unit syntax 510, a transform unit syntax 511, a prediction unit syntax 512, and the like. The coding tree unit syntax 510 may have a quadtree structure. Specifically, the coding tree unit syntax 510 can be recursively called as a syntax element of the coding tree unit syntax 510. That is, one coding tree block can be subdivided by a quadtree. The transform tree syntax 511 is included in the coding tree unit syntax 510. The transform unit syntax 511 is called in each coding tree unit syntax 510 at the end of the quadtree. The transform unit syntax 511 describes information related to inverse orthogonal transform, quantization, and the like. Information on weighted motion compensation prediction may be described in these syntaxes.

図16は、第1実施形態のピクチャパラメータセットシンタクス505の一例を示す図である。weighted_pred_flagは、例えば、P−sliceに関する第1実施形態の重み付き補償予測の有効又は無効を示すシンタクス要素である。weighted_pred_flagが0である場合、P−slice内での第1実施形態の重み付き動き補償予測は無効となる。従って、WPパラメータ情報に含まれるWP適用フラグは常に0に設定され、WPセレクタ304、305は、各々の出力端をデフォルト動き補償部301へ接続する。一方、weighted_pred_flagが1である場合、P−slice内での第1実施形態の重み付き動き補償予測は有効となる。   FIG. 16 is a diagram showing an example of the picture parameter set syntax 505 of the first embodiment. The weighted_pred_flag is, for example, a syntax element indicating the validity or invalidity of the weighted compensation prediction of the first embodiment relating to P-slice. When the weighted_pred_flag is 0, the weighted motion compensation prediction in the first embodiment in the P-slice is invalid. Therefore, the WP application flag included in the WP parameter information is always set to 0, and the WP selectors 304 and 305 connect their output terminals to the default motion compensation unit 301. On the other hand, when the weighted_pred_flag is 1, the weighted motion compensation prediction of the first embodiment in the P-slice is valid.

なお、別の例として、weighted_pred_flagが1である場合には、より下位のレイヤ(スライスヘッダー、コーディングツリーブロック、トランスフォームユニット、及びプレディクションユニットなど)のシンタクスにおいて、スライス内部の局所領域毎に第1実施形態の重み付き動き補償予測の有効又は無効を規定するようにしてもよい。   As another example, when weighted_pred_flag is 1, in the syntax of a lower layer (slice header, coding tree block, transform unit, prediction unit, and the like), each local region within a slice is assigned The validity or invalidity of the weighted motion compensation prediction of one embodiment may be defined.

weighted_bipred_idcは、例えば、B−sliceに関する第1実施形態の重み付き補償予測の有効又は無効を示すシンタクス要素である。weighted_bipred_idcが0である場合、B−slice内での第1実施形態の重み付き動き補償予測は無効となる。従って、WPパラメータ情報に含まれるWP適用フラグは常に0に設定され、WPセレクタ304、305は、各々の出力端をデフォルト動き補償部301へ接続する。一方、weighted_bipred_idcが1である場合、B−slice内での第1実施形態の重み付き動き補償予測は有効となる。   weighted_bipred_idc is, for example, a syntax element indicating the validity or invalidity of the weighted compensation prediction of the first embodiment relating to B-slice. When weighted_bipred_idc is 0, the weighted motion compensation prediction according to the first embodiment in a B-slice becomes invalid. Therefore, the WP application flag included in the WP parameter information is always set to 0, and the WP selectors 304 and 305 connect their output terminals to the default motion compensation unit 301. On the other hand, when the weighted_bipred_idc is 1, the weighted motion compensation prediction of the first embodiment in the B-slice is valid.

なお、別の例として、weighted_bipred_idcが1である場合には、より下位のレイヤ(スライスヘッダー、コーディングツリーブロック、及びトランスフォームユニットなど)のシンタクスにおいて、スライス内部の局所領域毎に第1実施形態の重み付き動き補償予測の有効又は無効を規定するようにしてもよい。   As another example, when weighted_bipred_idc is 1, in the syntax of a lower layer (slice header, coding tree block, transform unit, and the like), each local region in the slice according to the first embodiment is used. The validity or invalidity of the weighted motion compensation prediction may be defined.

図17は、第1実施形態のスライスヘッダーシンタクス507の一例を示す図である。slice_typeはスライスのスライスタイプ(I−slice,P−slice,B−sliceなど)を示している。pic_parameter_set_idは、いずれのピクチャパラメータセットシンタクス505を参照するかを示す識別子である。num_ref_idx_active_override_flagは、有効な参照画像の数を更新するかどうかを示すフラグであり、本フラグが1の場合、参照リストの参照画像数を定義するnum_ref_idx_l0_active_minus1及びnum_ref_idx_l1_active_minus1が利用できる。pred_weight_table()は、重み付き動き補償予測に利用するプレッドウェイトテーブルシンタクスを示す関数であり、前述のweighted_pred_flagが1かつP−sliceの場合、及びweighted_bipred_idcが1かつB−sliceの場合に、本関数が呼び出される。   FIG. 17 is a diagram showing an example of the slice header syntax 507 of the first embodiment. slice_type indicates the slice type (I-slice, P-slice, B-slice, etc.) of the slice. pic_parameter_set_id is an identifier indicating which picture parameter set syntax 505 is referred to. num_ref_idx_active_override_flag is a flag indicating whether or not to update the number of valid reference images. When this flag is 1, num_ref_idx_l0_active_minus1 and num_ref_idx_l1_active_minus1 that define the number of reference images in the reference list can be used. pred_weight_table () is a function indicating the pread weight table syntax used for weighted motion compensation prediction, and when weighted_pred_flag is 1 and P-slice, and when weighted_bipred_idc is 1 and B-slice, this function is Be called.

図18は、第1実施形態のプレッドウェイトテーブルシンタクス508の一例を示す図である。luma_log2_weight_denomは、スライスにおける輝度信号の重み係数の固定小数点精度(LWD)を表しており、数式(7)又は数式(9)のLWDに対応する値である。delta_chroma_log2_weight_denomは、スライスにおける色差信号の重み係数の固定小数点精度を表しており、導出方法は後述する。chroma_format_idcは、色空間を表す識別子であり、MONO_IDXはモノクロ映像を示す値である。num_ref_common_active_minus1は、スライスにおける共通リストに含まれる参照画像の数から1を引いた値を示している。   FIG. 18 is a diagram showing an example of the pread weight table syntax 508 of the first embodiment. luma_log2_weight_denom represents the fixed-point precision (LWD) of the weighting factor of the luminance signal in the slice, and is a value corresponding to the LWD in Expression (7) or Expression (9). delta_chroma_log2_weight_denom represents the fixed point precision of the weighting coefficient of the color difference signal in the slice, and the derivation method will be described later. chroma_format_idc is an identifier representing a color space, and MONO_IDX is a value indicating a monochrome image. num_ref_common_active_minus1 indicates a value obtained by subtracting 1 from the number of reference images included in the common list in the slice.

luma_weight_l0_flag及びluma_weight_l1_flagは、リスト0及びリスト1のそれぞれに対応する輝度信号におけるWP適応フラグを示している。本フラグが1の場合、スライス内全域で第1実施形態の輝度信号の重み付き動き補償予測が有効となる。chroma_weight_l0_flag及びchroma_weight_l1_flagは、リスト0及びリスト1のそれぞれに対応する色差信号におけるWP適応フラグを示している。本フラグが1の場合、スライス内全域で第1実施形態の色差信号の重み付き動き補償予測が有効となる。luma_weight_l0[i]及びluma_weight_l1[i]は、リスト0及びリスト1のそれぞれで管理された参照番号i番目に対応する輝度信号の重み係数である。luma_offset_l0[i]及びluma_offset_l1[i]は、リスト0及びリスト1のそれぞれで管理された参照番号i番目に対応する輝度信号のオフセットである。これらは、それぞれ、数式(7)又は数式(9)のw0C、w1C、o0C、o1Cに対応する値である。但し、C=Yとする。   luma_weight_l0_flag and luma_weight_l1_flag indicate WP adaptation flags in the luminance signal corresponding to each of list 0 and list 1. When this flag is 1, the weighted motion-compensated prediction of the luminance signal of the first embodiment is effective in the entire slice. chroma_weight_l0_flag and chroma_weight_l1_flag indicate WP adaptation flags in the color difference signals corresponding to List 0 and List 1, respectively. When this flag is 1, the weighted motion compensation prediction of the chrominance signal of the first embodiment is valid in the entire area within the slice. luma_weight_l0 [i] and luma_weight_l1 [i] are weighting coefficients of the luminance signal corresponding to the reference number i-th managed in each of the list 0 and the list 1. luma_offset_l0 [i] and luma_offset_l1 [i] are offsets of the luminance signal corresponding to the reference number i-th managed in each of list 0 and list 1. These are values corresponding to w0C, w1C, o0C, and o1C in Equation (7) or Equation (9), respectively. However, C = Y.

chroma_weight_l0[i][j]及びchroma_weight_l1[i][j]は、リスト0及びリスト1のそれぞれで管理された参照番号i番目に対応する色差信号の重み係数である。chroma_offset_l0[i][j]及びchroma_offset_l1[i][j]は、リスト0及びリスト1のそれぞれで管理された参照番号i番目に対応する色差信号のオフセットである。これらは、それぞれ、数式(7)又は数式(9)のw0C、w1C、o0C、o1Cに対応する値である。但し、C=Cr又はCbとする。jは色差成分のコンポーネントを示しており、例えばYUV4:2:0信号の場合、j=0がCr成分、j=1がCb成分であることを示す。なお、本表記はj=0がCb成分、j=1がCr成分として用いてもよい。   chroma_weight_l0 [i] [j] and chroma_weight_l1 [i] [j] are the weighting coefficients of the color difference signal corresponding to the reference number i-th managed in list 0 and list 1, respectively. chroma_offset_l0 [i] [j] and chroma_offset_l1 [i] [j] are offsets of the color difference signal corresponding to the reference number i-th managed in each of the list 0 and the list 1. These are values corresponding to w0C, w1C, o0C, and o1C in Equation (7) or Equation (9), respectively. However, C = Cr or Cb. j indicates a component of the color difference component. For example, in the case of a YUV 4: 2: 0 signal, j = 0 indicates a Cr component and j = 1 indicates a Cb component. In this notation, j = 0 may be used as a Cb component, and j = 1 may be used as a Cr component.

ここで、シンタクス構成における重み付き予測に関連するそれぞれのシンタクス要素の予測方法の詳細について説明する。シンタクス要素の予測は、インデックス再構成部110Bにより行われる。図18に示す例では、予測を導入したシンタクス要素をdeltaの接頭語を付けて示している。   Here, the details of the method of predicting each syntax element related to weighted prediction in the syntax configuration will be described. The prediction of the syntax element is performed by the index reconstructing unit 110B. In the example shown in FIG. 18, the syntax element to which prediction is introduced is shown with a prefix of delta.

まず、重み係数の固定小数点精度を示すluma_log2_weight_denom及びchroma_log2_weight_denomの信号間の予測方法について説明する。インデックス再構成部110Bは、数式(12)を用いて、luma_log2_weight_denom及びchroma_log2_weight_denomの信号間の予測処理を行い、数式(13)を用いて、復元処理を行う。ここでは、図18に示すとおり、luma_log2_weight_denomが先に定義されているため、luma_log2_weight_denomの値からchroma_log2_weight_denomを予測する。   First, a prediction method between signals of luma_log2_weight_denom and chroma_log2_weight_denom indicating fixed-point precision of a weight coefficient will be described. The index reconstructing unit 110B performs the prediction process between the signals of luma_log2_weight_denom and chroma_log2_weight_denom using Formula (12), and performs the restoration process using Formula (13). Here, as shown in FIG. 18, since luma_log2_weight_denom is defined first, chroma_log2_weight_denom is predicted from the value of luma_log2_weight_denom.

delta_chroma_log2_weight_denom = (chroma_log2_weight_denom - luma_log2_weight_denom) …(12)   delta_chroma_log2_weight_denom = (chroma_log2_weight_denom-luma_log2_weight_denom)… (12)

chroma_log2_weight_denom = (luma_log2_weight_denom + delta_chroma_log2_weight_denom) …(13)   chroma_log2_weight_denom = (luma_log2_weight_denom + delta_chroma_log2_weight_denom) (13)

フェード効果は、一般的に色空間別に異なる時間的変化をさせるケースが少ないため、信号成分毎の固定小数点精度は、輝度成分と色差成分で強い相関がある。このため、このように色空間内で予測することにより、固定小数点精度を示す情報量を削減できる。   In general, the fade effect rarely causes different temporal changes for each color space, so that the fixed point precision of each signal component has a strong correlation between the luminance component and the color difference component. For this reason, by performing prediction in the color space in this way, the amount of information indicating fixed-point precision can be reduced.

なお、数式(12)では、色差成分から輝度成分を減算しているが、輝度成分から色差成分を減算してもよい。この場合、数式(12)に応じて数式(13)も式を変形すればよい。   Note that in the formula (12), the luminance component is subtracted from the color difference component, but the color difference component may be subtracted from the luminance component. In this case, the equation (13) may be modified according to the equation (12).

次に、輝度及び色差信号の重み係数をそれぞれ表すluma_weight_lx[i]及びchroma_weight_lx[i][j]の予測方法について説明する。ここで、xは、0又は1を示す識別子である。luma_weight_lx[i]及びchroma_weight_lx[i][j]の値は、それぞれ、luma_log2_weight_denom及びchroma_log2_weight_denomの値に応じて変化する。例えば、luma_log2_weight_denomの値が3である場合、画素値変化がない場合のluma_weight_lx[i]は、(1<<3)となる。一方、luma_log2_weight_denomの値が5である場合、明度変化がないと仮定した場合のluma_weight_lx[i]は、(1<<5)となる。   Next, a method of predicting luma_weight_lx [i] and chroma_weight_lx [i] [j] representing the weight coefficients of the luminance and color difference signals will be described. Here, x is an identifier indicating 0 or 1. The values of luma_weight_lx [i] and chroma_weight_lx [i] [j] change according to the values of luma_log2_weight_denom and chroma_log2_weight_denom, respectively. For example, when the value of luma_log2_weight_denom is 3, luma_weight_lx [i] when there is no pixel value change is (1 << 3). On the other hand, when the value of luma_log2_weight_denom is 5, the luma_weight_lx [i] is (1 << 5) assuming that there is no change in brightness.

このため、インデックス再構成部110Bは、画素値変化がない場合の重み係数を基準係数(デフォルト値)として予測処理を行う。具体的には、インデックス再構成部110Bは、数式(14)〜(15)を用いてluma_weight_lx[i]の予測処理を行い、数式(16)を用いて、復元処理を行う。同様に、インデックス再構成部110Bは、数式(17)〜(18)を用いてchroma_weight_lx[i]の予測処理を行い、数式(19)を用いて、復元処理を行う。   Therefore, the index reconstructing unit 110B performs the prediction process by using the weighting coefficient when there is no pixel value change as the reference coefficient (default value). Specifically, the index reconstructing unit 110B performs the prediction process of luma_weight_lx [i] using Formulas (14) to (15), and performs the restoration process using Formula (16). Similarly, the index reconstructing unit 110B performs the prediction process of chroma_weight_lx [i] using Formulas (17) to (18), and performs the restoration process using Formula (19).

delta_luma_weight_lx[i] = (luma_weight_lx[i] - default_luma_weight_lx) …(14)   delta_luma_weight_lx [i] = (luma_weight_lx [i]-default_luma_weight_lx) (14)

default_luma_weight_lx = (1<<luma_log2_weight_denom) …(15)   default_luma_weight_lx = (1 << luma_log2_weight_denom) (15)

luma_weight_lx[i] = (default_luma_weight_lx + delta_luma_weight_lx[i]) …(16)   luma_weight_lx [i] = (default_luma_weight_lx + delta_luma_weight_lx [i]) (16)

delta_chroma_weight_lx[i][j] = (chroma_weight_lx[i][j] - default_chroma_weight_lx) …(17)   delta_chroma_weight_lx [i] [j] = (chroma_weight_lx [i] [j]-default_chroma_weight_lx) (17)

default_chroma_weight_lx = (1<<chroma_log2_weight_denom) …(18)   default_chroma_weight_lx = (1 << chroma_log2_weight_denom) (18)

chroma_weight_lx[i][j] = (default_chroma_weight_lx + delta_chroma_weight_lx[i][j]) …(19)   chroma_weight_lx [i] [j] = (default_chroma_weight_lx + delta_chroma_weight_lx [i] [j]) (19)

ここで、default_luma_weight_lx、default_chroma_weight_lxは、それぞれ、輝度成分、色差成分における画素値変化がない基準値(デフォルト値)である。   Here, default_luma_weight_lx and default_chroma_weight_lx are reference values (default values) with no change in pixel value in the luminance component and the color difference component, respectively.

フェード効果を含む画像は、ある特定のフェード変化点でフェードを行い、それ以外の画像は通常の自然画像又はフェード効果のない画像であることが多い。この場合、重み係数は画素値変化がない場合を取ることが多くなる。そこで、画素値変化がない場合の初期値を、固定小数点精度から導出し、予測値として用いることで重み係数の符号量を削減できる。   An image including a fade effect fades at a specific fade change point, and the other images are usually natural images or images without a fade effect. In this case, the weighting factor is often taken when there is no change in pixel value. Therefore, it is possible to reduce the code amount of the weighting coefficient by deriving the initial value when there is no pixel value change from the fixed-point precision and using it as the predicted value.

次に、色差信号のオフセットを表すchroma_offset_lx[i][j]の予測方法について説明する。YUVの色空間では、色差成分は、中央値からのズレ量で色を表現する。このため、重み係数を用いて中央値を考慮した画素値変化からの変化量を予測値とすることができる。具体的には、インデックス再構成部110Bは、数式(20)〜(21)を用いてchroma_offset_lx[i][j]の予測処理を行い、数式(22)を用いて、復元処理を行う。   Next, a method of predicting chroma_offset_lx [i] [j] representing the offset of the color difference signal will be described. In the YUV color space, the color difference component expresses a color with an amount of deviation from the median value. For this reason, the amount of change from the pixel value change considering the median can be used as the predicted value using the weighting coefficient. Specifically, the index reconstructing unit 110B performs the prediction process of chroma_offset_lx [i] [j] using Formulas (20) to (21), and performs the restoration process using Formula (22).

delta_chroma_offset_lx[i][j] = (chroma_offset_lx[i][j] + ( ( MED * chroma_weight_lx[i][j])>> chroma_log2_weight_denom) - MED ) …(20)   delta_chroma_offset_lx [i] [j] = (chroma_offset_lx [i] [j] + ((MED * chroma_weight_lx [i] [j]) >> chroma_log2_weight_denom)-MED) (20)

MED = (MaxChromaValue>>1) …(21)   MED = (MaxChromaValue >> 1)… (21)

ここで、MaxChromaValueは色差信号が取れる最大画素値を示している。例えば、8ビットの信号である場合、MaxChromaValueは255であり、MEDは128となる。   Here, MaxChromaValue indicates the maximum pixel value at which the color difference signal can be obtained. For example, in the case of an 8-bit signal, MaxChromaValue is 255 and MED is 128.

chroma_offset_lx[i][j] = (delta_chroma_offset_lx[i][j] - ( ( MED * chroma_weight_lx[i][j])>> chroma_log2_weight_denom) + MED ) …(22)   chroma_offset_lx [i] [j] = (delta_chroma_offset_lx [i] [j]-((MED * chroma_weight_lx [i] [j]) >> chroma_log2_weight_denom) + MED) (22)

色差信号の信号特性を利用して、中央値からのズレ量を考慮した予測値を導入することにより、オフセット値をそのまま符号化する場合と比較して、色差信号のオフセット値の符号量を削減できる。   By using the signal characteristics of the color difference signal to introduce a predicted value that takes into account the amount of deviation from the median, the amount of code for the offset value of the color difference signal is reduced as compared to the case where the offset value is directly encoded it can.

図19は、第1実施形態のシンタクス要素の値の関係の一例を示す説明図であり、luma_log2_weight_denom、default_luma_weight_lx、luma_weight_lx[i]、及びdelta_luma_weight_lx[i]の値の関係を示している。図19に示すように、エントロピー符号化部110Aによって符号化されるシンタクス要素であるdelta_luma_weight_lx[i]、即ち、重み係数の差分値の取りうる範囲は、−128から127の範囲に固定されており、符号付き8ビット精度となっている。   FIG. 19 is an explanatory diagram illustrating an example of the relationship between the values of the syntax elements according to the first embodiment, and illustrates the relationship between the values of luma_log2_weight_denom, default_luma_weight_lx, luma_weight_lx [i], and delta_luma_weight_lx [i]. As shown in FIG. 19, delta_luma_weight_lx [i], which is a syntax element coded by the entropy coding unit 110A, that is, a range in which a difference value of weighting factors can be taken is fixed in a range of −128 to 127. , Signed 8-bit precision.

以上のように第1実施形態では、画素値変化が0となる重み係数の基準点を略中心として負の方向と正の方向に値を割り振ることにより重み係数の選択範囲を導出し、導出した重み係数の選択範囲内に重み係数が含まれていることを確認する。このため第1実施形態によれば、H.264等と比較して、重み係数の選択範囲を拡張し、選択頻度の高い正側の値を取りやすくすることができる。また第1実施形態によれば、符号化対象の重み係数の差分値が−128から127までの符号付き8ビットの値を固定値として取るため、重み係数の選択範囲を拡張しつつ、符号付き8ビット精度の選択範囲を規定することができる。   As described above, in the first embodiment, the selection range of the weighting factor is derived by allocating the values in the negative direction and the positive direction with the reference point of the weighting factor at which the pixel value change is 0 as the approximate center. Confirm that the weighting factor is included in the selection range of the weighting factor. Therefore, according to the first embodiment, H.264. Compared with H.264 or the like, it is possible to expand the selection range of the weighting coefficient and make it easier to take a positive value that is frequently selected. Further, according to the first embodiment, since the difference value of the weighting coefficient to be encoded is a signed 8-bit value from −128 to 127, a fixed value is added while expanding the selection range of the weighting coefficient. An 8-bit precision selection range can be defined.

このように第1実施形態では、符号化するシンタクス(重み係数の差分値)の範囲を固定値にできるため、エンコーダがこれらの範囲を動的に変更するような構成と比較して、仕様を簡略化できる。例えば、符号化するシンタクスを重み係数とし、重み係数の選択範囲が重み係数の基準値に応じて変動する場合、重み係数の基準値と重み係数の選択範囲の最小値及び最大値を対応付けたテーブルを用意して重み係数の選択範囲の導出後に都度参照するような構成や、重み係数の選択範囲を都度計算して導出するような構成が必要となる。このような場合、テーブルをメモリにロードして都度参照するという構成や、重み係数の選択範囲を都度計算するための演算回路が必要になり、ハードウェア規模が増大する。これに対し、第1実施形態では、符号化するシンタクス(重み係数の差分値)の範囲を固定値にできるため、上述したようなハードウェア構成などの制約を受けず、ハードウェア規模を削減することができる。   As described above, in the first embodiment, the range of syntax (difference value of weighting factor) to be encoded can be set to a fixed value, so that the specification can be compared with the configuration in which the encoder dynamically changes these ranges. Can be simplified. For example, when the syntax to be encoded is a weighting coefficient and the selection range of the weighting coefficient fluctuates according to the reference value of the weighting coefficient, the reference value of the weighting coefficient is associated with the minimum value and the maximum value of the selection range of the weighting coefficient. It is necessary to prepare a table and refer to it each time after deriving the selection range of the weighting coefficient, or to calculate and derive the selection range of the weighting coefficient each time. In such a case, a configuration in which the table is loaded in the memory and referred to each time and an arithmetic circuit for calculating the selection range of the weighting coefficient each time are required, which increases the hardware scale. On the other hand, in the first embodiment, the range of syntax to be coded (difference value of weighting factor) can be set to a fixed value, so that the hardware scale is reduced without being restricted by the hardware configuration as described above. be able to.

更に第1実施形態では、範囲が符号付き8ビット精度に固定された重み係数の差分値を符号化することになるが、重み係数の差分値は範囲の中心付近(0付近)の値を取るため、符号化時の符号長を短くすることができ、符号化効率を向上できる。H.264などでは、重み係数を符号付き指数ゴロム符号(se(v))で符号化するが、この符号は、符号化する値が0を基準として指数的に増加するシンボルに対して有効な符号であるため、一番利用頻度が高い基準値を範囲の中心にすることが一般的である。第1実施形態では、一般的な動画像でピクチャ間の画素値変化が0となる場合を重み係数の基準値とし、かつ重み係数の選択範囲の予測においても上記基準値からの予測を導入している。これにより、指数ゴロム符号と予測及び重み係数の選択範囲が一致するため、符号量削減効果が高いとともに、基準値を中心に係数範囲を決めているため、大きな値を取る場合でも正の値と負の値の基準値からの距離が同程度になり、従来手法と比較して短い符号長で符号化できる効果を奏する。   Furthermore, in the first embodiment, the difference value of the weighting coefficient whose range is fixed to signed 8-bit precision is encoded, but the difference value of the weighting coefficient takes a value near the center of the range (near 0). Therefore, the code length at the time of encoding can be shortened and the encoding efficiency can be improved. H. In H.264 or the like, the weighting factor is encoded by a signed exponential Golomb code (se (v)), which is a valid code for a symbol whose value to be encoded increases exponentially with 0 as a reference. For this reason, it is common to set the most frequently used reference value as the center of the range. In the first embodiment, the case where the pixel value change between pictures in a general moving image is 0 is set as the reference value of the weighting coefficient, and the prediction from the reference value is also introduced in the prediction of the selection range of the weighting coefficient. ing. As a result, the exponential Golomb code and the selection range of the prediction and weighting coefficients match, so that the code amount reduction effect is high and the coefficient range is determined around the reference value. The distance from the reference value of the negative value becomes approximately the same, and there is an effect that encoding can be performed with a shorter code length as compared with the conventional method.

なお、第1実施形態の図16〜図18に例示するシンタクステーブルの行間には、本実施形態において規定していないシンタクス要素が挿入されてもよいし、その他の条件分岐に関する記述が含まれていてもよい。また、シンタクステーブルを複数のテーブルに分割したり、複数のシンタクステーブルを統合したりしてもよい。また、例示した各シンタクス要素の用語は、任意に変更可能である。   It should be noted that syntax elements not defined in the present embodiment may be inserted between the rows of the syntax table illustrated in FIGS. 16 to 18 of the first embodiment, and description regarding other conditional branches is included. May be. Further, the syntax table may be divided into a plurality of tables, or a plurality of syntax tables may be integrated. The term of each syntax element exemplified can be arbitrarily changed.

(第2実施形態)
第2実施形態では、第1実施形態の符号化装置で符号化された符号化データを復号する復号装置について説明する。なお第2実施形態においても、第1実施形態同様、画素値変化が無い場合、即ち、重み係数の値を実数値で表現すると1.0となる場合を想定して、説明を行う。
(Second embodiment)
In the second embodiment, a decoding device that decodes the encoded data encoded by the encoding device according to the first embodiment will be described. In the second embodiment, as in the first embodiment, description will be made assuming that there is no pixel value change, that is, the case where the value of the weighting coefficient is represented by a real value is 1.0.

図20は、第2実施形態の復号装置800の構成の一例を示すブロック図である。   FIG. 20 is a block diagram showing an example of the configuration of the decoding device 800 according to the second embodiment.

復号装置800は、図示せぬ入力バッファなどに蓄積された符号化データを復号画像に復号し、出力画像として図示せぬ出力バッファに出力する。符号化データは、例えば、図1の符号化装置100などから出力され、図示せぬ蓄積系、伝送系、又はバッファなどを経て、復号装置800に入力される。   The decoding device 800 decodes encoded data stored in an input buffer (not shown) or the like into a decoded image and outputs the decoded image to an output buffer (not shown) as an output image. The encoded data is output from, for example, the encoding device 100 in FIG. 1 or the like, and is input to the decoding device 800 via a storage system, a transmission system, or a buffer (not shown).

復号装置800は、図20に示すように、復号部801と、逆量子化部802と、逆直交変換部803と、加算部804と、予測画像生成部805と、インデックス設定部806とを、備える。逆量子化部802、逆直交変換部803、加算部804、予測画像生成部805は、それぞれ、図1の逆量子化部104、逆直交変換部105、加算部106、予測画像生成部107、と実質的に同一又は類似の要素である。なお、図20に示す復号制御部807は、復号装置800を制御するものであり、例えば、CPUなどにより実現できる。   As illustrated in FIG. 20, the decoding device 800 includes a decoding unit 801, a dequantization unit 802, an inverse orthogonal transformation unit 803, an addition unit 804, a predicted image generation unit 805, and an index setting unit 806. Prepare The inverse quantization unit 802, the inverse orthogonal transformation unit 803, the addition unit 804, and the predicted image generation unit 805 are respectively the inverse quantization unit 104, the inverse orthogonal transformation unit 105, the addition unit 106, the predicted image generation unit 107, Are substantially the same or similar elements. The decoding control unit 807 shown in FIG. 20 controls the decoding device 800 and can be realized by, for example, a CPU.

復号部801は、符号化データの復号のために、1フレーム又は1フィールド毎にシンタクスに基づいて解読を行う。復号部801は、エントロピー復号部801Aと、インデックス再構成部801Bとを、備える。   The decoding unit 801 performs decoding on a frame-by-frame or field-by-field basis based on syntax for decoding encoded data. The decoding unit 801 includes an entropy decoding unit 801A and an index reconstruction unit 801B.

エントロピー復号部801Aは、各シンタクスの符号列を順次エントロピー復号し、予測モード、動きベクトル、及び参照番号などを含む動き情報、重み付き動き補償予測のためのインデックス情報、並びに量子化変換係数などの符号化対象ブロックの符号化パラメータを再生する。なお、エントロピー復号は、パース処理などとも称される。ここで、符号化パラメータとは、上記以外にも変換係数に関する情報、量子化に関する情報、などの復号に必要となるすべてのパラメータである。   The entropy decoding unit 801A sequentially performs entropy decoding on the code string of each syntax, and calculates motion information including a prediction mode, a motion vector, and a reference number, index information for weighted motion compensation prediction, and quantization transform coefficients. The encoding parameters of the encoding target block are reproduced. Note that entropy decoding is also called parsing processing or the like. Here, the coding parameters are all parameters other than those described above that are necessary for decoding information such as transform coefficient information and quantization information.

具体的には、エントロピー復号部801Aは、入力されてきた符号化データに対して可変長復号処理や算術復号処理などの復号処理を行う機能を有する。例えば、H.264ではコンテキスト適応型の可変長符号化(CAVLC:Context based Adaptive Variable Length Coding)やコンテキスト適応型の算術符号化(CABAC:Context based Adaptive Binary Arithmetic Coding)などが用いられ、入力されてきた符号化データを意味のあるシンタクス要素に復号している。これらの処理は解読処理とも呼ばれる。   Specifically, the entropy decoding unit 801A has a function of performing decoding processing such as variable-length decoding processing and arithmetic decoding processing on input encoded data. For example, H.264. In H.264, context-based variable-length coding (CAVLC), context-based arithmetic coding (CABAC), and the like are used to input context-based adaptive coded data (CABAC). Is decoded into a meaningful syntax element. These processes are also called decryption processes.

インデックス再構成部801Bは、解読されたインデックス情報を復元し、インデックス情報を再構成する。具体的には、インデックス再構成部801Bは、解読されたインデックス情報のシンタクス要素の符号長を削減するために、シンタクス要素のパラメータの特徴に応じて予測処理を行い、シンタクス要素を復元し、インデックス情報を再構成する。予測処理の具体例は、後述する。   The index reconstructing unit 801B restores the decrypted index information and reconstructs the index information. Specifically, in order to reduce the code length of the syntax element of the decoded index information, the index reconstructing unit 801B performs prediction processing according to the characteristics of the syntax element parameter, restores the syntax element, Reconstruct information. A specific example of the prediction process will be described later.

復号部801は、動き情報、インデックス情報、及び量子化変換係数を出力し、量子化変換係数を逆量子化部802に入力し、インデックス情報をインデックス設定部806に入力し、動き情報を予測画像生成部805に入力する。   The decoding unit 801 outputs the motion information, the index information, and the quantized transform coefficient, inputs the quantized transform coefficient to the inverse quantization unit 802, inputs the index information to the index setting unit 806, and outputs the motion information to the prediction image. Input to the generation unit 805.

逆量子化部802は、復号部801から入力された量子化変換係数に対して逆量子化処理を行い、復元変換係数を得る。具体的には、逆量子化部802は、復号部801において使用された量子化情報に従って逆量子化を行う。より詳細には、逆量子化部802は、量子化情報によって導出された量子化ステップサイズを量子化変換係数に乗算し、復元変換係数を得る。逆量子化部802は、復元変換係数を出力し、逆直交変換部803に入力する。   The inverse quantization unit 802 performs an inverse quantization process on the quantized transform coefficient input from the decoding unit 801 to obtain a restored transform coefficient. Specifically, the inverse quantization unit 802 performs inverse quantization according to the quantization information used in the decoding unit 801. More specifically, the inverse quantization unit 802 multiplies the quantized transform coefficient by a quantization step size derived from the quantization information to obtain a restored transform coefficient. The inverse quantization unit 802 outputs the restoration transform coefficient and inputs it to the inverse orthogonal transform unit 803.

逆直交変換部803は、逆量子化部802から入力された復元変換係数に対して、符号化側において行われた直交変換に対応する逆直交変換を行い、復元予測誤差を得る。逆直交変換部803は、復元予測誤差を出力し、加算部804に入力する。   The inverse orthogonal transform unit 803 performs an inverse orthogonal transform corresponding to the orthogonal transform performed on the encoding side on the restored transform coefficient input from the inverse quantization unit 802, and obtains a restored prediction error. The inverse orthogonal transformation unit 803 outputs the restoration prediction error and inputs it to the addition unit 804.

加算部804は、逆直交変換部803から入力された復元予測誤差と、対応する予測画像とを加算し、復号画像を生成する。加算部804は、復号画像を出力し、予測画像生成部805に入力する。また加算部804は、復号画像を出力画像として外部に出力する。出力画像は、その後図示せぬ外部の出力バッファなどに一時的に蓄積され、例えば、復号制御部807によって管理される出力タイミングに従って、図示せぬディスプレイやモニタなどの表示装置系又は映像デバイス系へ出力される。   The addition unit 804 adds the restoration prediction error input from the inverse orthogonal transform unit 803 and the corresponding prediction image to generate a decoded image. The addition unit 804 outputs the decoded image and inputs the decoded image to the predicted image generation unit 805. The addition unit 804 outputs the decoded image to the outside as an output image. The output image is then temporarily stored in an external output buffer (not shown) or the like, and is output to a display device system such as a display or monitor (not shown) or a video device system in accordance with the output timing managed by the decoding control unit 807, for example. Is output.

インデックス設定部806は、復号部801から入力されたインデックス情報を受け取り、WPパラメータ情報に変換して出力し、予測画像生成部805に入力する。具体的には、インデックス設定部806は、エントロピー復号部801Aで復号処理され、インデックス再構成部801Bで再構成されたインデックス情報を受け取る。そしてインデックス設定部806は、参照画像のリストと参照番号を確認して、WPパラメータ情報に変換し、変換したWPパラメータ情報を予測画像生成部805へ出力する。インデックス設定部806は、インデックス情報をWPパラメータ情報に変換する際に、重み係数の選択範囲を導出し、重み係数が当該選択範囲に含まれていることを確認する。なお、重み係数の選択範囲の導出については、第1実施形態と同様であるため、詳細な説明は省略する。また、重み係数の選択範囲の導出をインデックス設定部806ではなく、インデックス再構成部801Bで行うようにしてもよい。つまり、インデックス設定部806を導出部としてもよいし、インデックス再構成部801B(復号部801)を導出部としてもよい。   The index setting unit 806 receives the index information input from the decoding unit 801, converts the index information into WP parameter information, outputs the WP parameter information, and inputs the WP parameter information to the predicted image generation unit 805. Specifically, the index setting unit 806 receives the index information decoded by the entropy decoding unit 801A and reconstructed by the index reconstructing unit 801B. Then, the index setting unit 806 checks the reference image list and the reference number, converts the reference image list into the WP parameter information, and outputs the converted WP parameter information to the predicted image generation unit 805. The index setting unit 806 derives the selection range of the weighting factor when converting the index information into the WP parameter information, and confirms that the weighting factor is included in the selection range. The derivation of the selection range of the weighting factor is the same as in the first embodiment, and thus detailed description will be omitted. Moreover, the derivation of the selection range of the weighting factor may be performed not by the index setting unit 806 but by the index reconstructing unit 801B. That is, the index setting unit 806 may be the derivation unit, or the index reconstruction unit 801B (decoding unit 801) may be the derivation unit.

また、WPパラメータ情報は、第1実施形態同様、第一WP適用フラグ、第二WP適応フラグ及び重み情報の情報を含む。また、重み情報は、第1実施形態同様、第一重み係数の値w0C、第二重み係数の値w1C、第一重み係数及び第二重み係数の固定小数点精度LWD、第一オフセットo0C、及び第二オフセットo1Cの情報を含む。   In addition, the WP parameter information includes the information of the first WP application flag, the second WP adaptation flag, and the weight information, as in the first embodiment. In addition, the weight information includes the first weighting coefficient value w0C, the second weighting coefficient value w1C, the fixed-point precision LWD of the first weighting coefficient and the second weighting coefficient, the first offset o0C, and the first weighting coefficient w0C, as in the first embodiment. Two offsets o1C information is included.

予測画像生成部805は、復号部801から入力された動き情報、インデックス設定部806から入力されたWPパラメータ情報、及び加算部804から入力された復号画像を用いて、予測画像を生成する。   The predicted image generation unit 805 generates a predicted image using the motion information input from the decoding unit 801, the WP parameter information input from the index setting unit 806, and the decoded image input from the addition unit 804.

ここで、図4を参照しながら、予測画像生成部805の詳細について説明する。予測画像生成部805は、予測画像生成部107同様、複数フレーム動き補償部201と、メモリ202と、単方向動き補償部203と、予測パラメータ制御部204と、参照画像セレクタ205と、フレームメモリ206と、参照画像制御部207と、を備える。   Here, the details of the predicted image generation unit 805 will be described with reference to FIG. Like the predicted image generation unit 107, the predicted image generation unit 805 includes a multi-frame motion compensation unit 201, a memory 202, a unidirectional motion compensation unit 203, a prediction parameter control unit 204, a reference image selector 205, and a frame memory 206. And a reference image control unit 207.

フレームメモリ206は、参照画像制御部207の制御の下、加算部106から入力された復号画像を参照画像として格納する。フレームメモリ206は、参照画像を一時保持するための複数のメモリセットFM1〜FMN(N≧1)を有する。   The frame memory 206 stores the decoded image input from the adding unit 106 as a reference image under the control of the reference image control unit 207. The frame memory 206 has a plurality of memory sets FM1 to FMN (N ≧ 1) for temporarily holding a reference image.

予測パラメータ制御部204は、復号部801から入力される動き情報に基づいて、参照画像番号と予測パラメータとの複数の組み合わせをテーブルとして用意している。ここで、動き情報とは、動き補償予測で用いられる動きのズレ量を示す動きベクトルや参照画像番号、単方向/双方向予測などの予測モードに関する情報などを指す。予測パラメータは、動きベクトル及び予測モードに関する情報を指す。そして予測パラメータ制御部204は、動き情報に基づいて、予測画像の生成に用いる参照画像番号と予測パラメータとの組み合わせを選択して出力し、参照画像番号を参照画像セレクタ205に入力し、予測パラメータを単方向動き補償部203に入力する。   The prediction parameter control unit 204 prepares a plurality of combinations of reference image numbers and prediction parameters as a table based on the motion information input from the decoding unit 801. Here, the motion information indicates a motion vector indicating a displacement amount of motion used in motion compensation prediction, a reference image number, information on prediction modes such as unidirectional / bidirectional prediction, and the like. The prediction parameter indicates information on a motion vector and a prediction mode. Then, the prediction parameter control unit 204 selects and outputs a combination of a reference image number and a prediction parameter used for generation of a predicted image based on the motion information, inputs the reference image number to the reference image selector 205, Is input to the unidirectional motion compensation unit 203.

参照画像セレクタ205は、フレームメモリ206が有するフレームメモリFM1〜FMNのいずれの出力端を接続するかを、予測パラメータ制御部204から入力された参照画像番号に従って切り替えるスイッチである。参照画像セレクタ205は、例えば、参照画像番号が0であれば、FM1の出力端を参照画像セレクタ205の出力端に接続し、参照画像番号がN−1であれば、FMNの出力端を参照画像セレクタ205の出力端に接続する。参照画像セレクタ205は、フレームメモリ206が有するフレームメモリFM1〜FMNのうち、出力端が接続されているフレームメモリに格納されている参照画像を出力し、単方向動き補償部203へ入力する。なお、復号装置800では、予測画像生成部805以外で参照画像は利用されないため、予測画像生成部805の外部へ参照画像を出力しなくてもよい。   The reference image selector 205 is a switch for switching which output terminal of the frame memories FM1 to FMN of the frame memory 206 is to be connected in accordance with the reference image number input from the prediction parameter control unit 204. For example, if the reference image number is 0, the reference image selector 205 connects the output terminal of FM1 to the output terminal of the reference image selector 205. If the reference image number is N-1, the reference image selector 205 refers to the output terminal of FMN. It is connected to the output terminal of the image selector 205. The reference image selector 205 outputs a reference image stored in a frame memory to which an output terminal is connected among the frame memories FM1 to FMN of the frame memory 206, and inputs the reference image to the unidirectional motion compensation unit 203. In the decoding device 800, the reference image is not used except for the predicted image generation unit 805, and thus the reference image does not have to be output to the outside of the predicted image generation unit 805.

単方向動き補償部203は、予測パラメータ制御部204から入力された予測パラメータと参照画像セレクタ205から入力された参照画像に従って、動き補償予測処理を行い、単方向予測画像を生成する。動き補償予測については、図5を参照して既に説明しているため、説明を省略する。   The unidirectional motion compensation unit 203 performs motion compensation prediction processing according to the prediction parameter input from the prediction parameter control unit 204 and the reference image input from the reference image selector 205 to generate a unidirectional prediction image. The motion compensation prediction has already been described with reference to FIG.

単方向動き補償部203は、単方向予測画像を出力し、メモリ202に一時的に格納する。ここで、動き情報(予測パラメータ)が双方向予測を示す場合には、複数フレーム動き補償部201が2種類の単方向予測画像を用いて重み付き予測を行うため、単方向動き補償部203は、1つ目に対応する単方向予測画像をメモリ202に格納し、2つ目に対応する単方向予測画像を複数フレーム動き補償部201に直接出力する。ここでは、1つ目に対応する単方向予測画像を第一予測画像とし、2つ目に対応する単方向予測画像を第二予測画像とする。   The unidirectional motion compensation unit 203 outputs the unidirectional predicted image and temporarily stores it in the memory 202. Here, when the motion information (prediction parameter) indicates bidirectional prediction, the multi-frame motion compensating unit 201 performs weighted prediction using two types of unidirectionally predicted images, so that the unidirectional motion compensating unit 203 The unidirectional predicted image corresponding to the first one is stored in the memory 202, and the unidirectional predicted image corresponding to the second is directly output to the multi-frame motion compensation unit 201. Here, the first unidirectional predicted image corresponding to the first is a first predicted image, and the second unidirectional predicted image corresponding to the second is a second predicted image.

なお、単方向動き補償部203を2つ用意し、それぞれが2つの単方向予測画像を生成するようにしてもよい。この場合、動き情報(予測パラメータ)が単方向予測を示すときには、単方向動き補償部203が、1つ目の単方向予測画像を第一予測画像として複数フレーム動き補償部201に直接出力すればよい。   Note that two unidirectional motion compensating units 203 may be prepared, and each may generate two unidirectional predicted images. In this case, when the motion information (prediction parameter) indicates unidirectional prediction, the unidirectional motion compensating unit 203 may directly output the first unidirectional predicted image as the first predicted image to the multi-frame motion compensating unit 201. Good.

複数フレーム動き補償部201は、メモリ202から入力される第一予測画像、単方向動き補償部203から入力される第二予測画像、及び動き評価部109から入力されるWPパラメータ情報を用いて、重み付き予測を行って予測画像を生成する。複数フレーム動き補償部201は、予測画像を出力し、加算部804に入力する。   The multi-frame motion compensation unit 201 uses the first predicted image input from the memory 202, the second predicted image input from the unidirectional motion compensation unit 203, and the WP parameter information input from the motion evaluation unit 109, Weighted prediction is performed to generate a predicted image. The multi-frame motion compensation unit 201 outputs a prediction image and inputs the prediction image to the addition unit 804.

ここで、図6を参照しながら、複数フレーム動き補償部201の詳細について説明する。複数フレーム動き補償部201は、予測画像生成部107同様、デフォルト動き補償部301と、重み付き動き補償部302と、WPパラメータ制御部303と、WPセレクタ304、305とを、備える。   Here, the details of the multi-frame motion compensation unit 201 will be described with reference to FIG. The multiple-frame motion compensation unit 201 includes a default motion compensation unit 301, a weighted motion compensation unit 302, a WP parameter control unit 303, and WP selectors 304 and 305, similarly to the predicted image generation unit 107.

WPパラメータ制御部303は、インデックス設定部806から入力されるWPパラメータ情報に基づいて、WP適用フラグ及び重み情報を出力し、WP適用フラグをWPセレクタ304、305に入力し、重み情報を重み付き動き補償部302に入力する。   The WP parameter control unit 303 outputs the WP application flag and weight information based on the WP parameter information input from the index setting unit 806, inputs the WP application flag to the WP selectors 304 and 305, and weights the weight information. It is input to the motion compensation unit 302.

詳細には、WPパラメータ制御部303は、インデックス設定部806からWPパラメータ情報が入力されると、WPパラメータ情報を第一WP適用フラグ、第二WP適用フラグ、及び重み情報に分離して出力し、第一WP適用フラグをWPセレクタ304に入力し、第二WP適用フラグをWPセレクタ305に入力し、重み情報を重み付き動き補償部302に入力する。   Specifically, when the WP parameter information is input from the index setting unit 806, the WP parameter control unit 303 separates and outputs the WP parameter information into a first WP application flag, a second WP application flag, and weight information. , The first WP application flag is input to the WP selector 304, the second WP application flag is input to the WP selector 305, and the weight information is input to the weighted motion compensation unit 302.

なお、WPパラメータ制御部303は、WPパラメータ情報が入力されると、重み情報の値が規定の範囲内に収まっているかどうかチェックする。例えば、w0Cが実数値で表現した場合に3.0、LWDが7の場合、第一重み係数は384となる。ここで、384は、第一重み係数の範囲外であり、使用できないとする。この場合、WPパラメータ制御部303は、規格違反のデータであるため、規格違反であることを示す情報を復号制御部807に通知し、復号処理をやめてもよい。また、WPパラメータ制御部303は、第一重み係数の範囲内にクリップ処理を行い、復号処理を進めてもよい。また、WPパラメータ制御部303は、第一WP適用フラグの値を1から0に変更し、デフォルト動き補償予測を行ってもよい。   When the WP parameter information is input, the WP parameter control unit 303 checks whether the value of the weight information is within the specified range. For example, when w0C is represented by a real number, 3.0, and when LWD is 7, the first weighting factor is 384. Here, 384 is out of the range of the first weighting coefficient and cannot be used. In this case, since the WP parameter control unit 303 is data that violates the standard, the WP parameter control unit 303 may notify the decoding control unit 807 of information indicating that the standard has been violated, and stop the decoding process. Further, the WP parameter control unit 303 may perform the clipping process within the range of the first weighting coefficient and proceed with the decoding process. Further, the WP parameter control unit 303 may change the value of the first WP application flag from 1 to 0 and perform the default motion compensation prediction.

WPセレクタ304、305は、WPパラメータ制御部303から入力されたWP適用フラグに基づいて、各々の予測画像の接続端を切り替える。WPセレクタ304、305は、各々のWP適用フラグが0の場合、各々の出力端をデフォルト動き補償部301へ接続する。そしてWPセレクタ304、305は、第一予測画像及び第二予測画像を出力し、デフォルト動き補償部301に入力する。一方、WPセレクタ304、305は、各々のWP適用フラグが1の場合、各々の出力端を重み付き動き補償部302へ接続する。そしてWPセレクタ304、305は、第一予測画像及び第二予測画像を出力し、重み付き動き補償部302に入力する。   The WP selectors 304 and 305 switch the connection end of each predicted image based on the WP application flag input from the WP parameter control unit 303. When each WP application flag is 0, the WP selectors 304 and 305 connect each output terminal to the default motion compensation unit 301. Then, the WP selectors 304 and 305 output the first prediction image and the second prediction image, and input them to the default motion compensation unit 301. On the other hand, when each WP application flag is 1, the WP selectors 304 and 305 connect each output end to the weighted motion compensation unit 302. Then, the WP selectors 304 and 305 output the first prediction image and the second prediction image, and input the weighted motion compensation unit 302.

デフォルト動き補償部301は、WPセレクタ304、305から入力された2つの単方向予測画像(第一予測画像及び第二予測画像)を元に平均値処理を行い、予測画像を生成する。具体的には、デフォルト動き補償部301は、第一WP適用フラグ及び第二WP適用フラグが0の場合、数式(1)に基づいて平均値処理を行う。   The default motion compensation unit 301 performs an average value process based on two unidirectional predicted images (first predicted image and second predicted image) input from the WP selectors 304 and 305, and generates a predicted image. Specifically, when the first WP application flag and the second WP application flag are 0, the default motion compensation unit 301 performs an average value process based on Expression (1).

なお、動き情報(予測パラメータ)で示される予測モードが単方向予測である場合、デフォルト動き補償部301は、第一予測画像のみを用いて、数式(4)に基づいて最終的な予測画像を算出する。   When the prediction mode indicated by the motion information (prediction parameter) is unidirectional prediction, the default motion compensation unit 301 uses only the first predicted image and calculates the final predicted image based on Expression (4). calculate.

重み付き動き補償部302は、WPセレクタ304、305から入力された2つの単方向予測画像(第一予測画像及び第二予測画像)とWPパラメータ制御部303から入力された重み情報とを元に重み付き動き補償を行う。具体的には、重み付き動き補償部302は、第一WP適用フラグ及び第二WP適用フラグが1の場合、数式(7)に基づいて重み付き処理を行う。   The weighted motion compensation unit 302 is based on the two unidirectional prediction images (first prediction image and second prediction image) input from the WP selectors 304 and 305 and the weight information input from the WP parameter control unit 303. Perform weighted motion compensation. Specifically, when the first WP application flag and the second WP application flag are 1, the weighted motion compensation unit 302 performs a weighting process based on Expression (7).

なお、重み付き動き補償部302は、第一予測画像及び第二予測画像と予測画像との演算精度が異なる場合、固定小数点精度であるLWDを数式(8)のように制御することで丸め処理を実現する。   Note that the weighted motion compensation unit 302 performs rounding processing by controlling LWD, which is fixed-point precision, as in Expression (8) when the calculation accuracy of the first predicted image and the second predicted image is different from that of the predicted image. To realize.

また、動き情報(予測パラメータ)で示される予測モードが単方向予測である場合、重み付き動き補償部302は、第一予測画像のみを用いて、数式(9)に基づいて最終的な予測画像を算出する。   In addition, when the prediction mode indicated by the motion information (prediction parameter) is unidirectional prediction, the weighted motion compensation unit 302 uses only the first prediction image and makes a final prediction image based on Expression (9). To calculate.

なお、重み付き動き補償部302は、第一予測画像及び第二予測画像と予測画像との演算精度が異なる場合、固定小数点精度であるLWDを双方向予測時と同様に数式(8)のように制御することで丸め処理を実現する。   Note that the weighted motion compensation unit 302 sets the LWD, which is the fixed-point precision, to the formula (8) as in the bidirectional prediction when the calculation accuracy of the first prediction image and the second prediction image is different from that of the prediction image. The rounding process is realized by controlling to.

重み係数の固定小数点精度については、図7を参照して既に説明しているため、説明を省略する。なお、単方向予測の場合には、第二予測画像に対応する各種パラメータ(第二WP適応フラグ、第二重み係数、及び第二オフセットの情報)は利用されないため、予め定めた初期値に設定されていてもよい。   Since the fixed-point precision of the weight coefficient has already been described with reference to FIG. 7, the description is omitted. Note that in the case of unidirectional prediction, various parameters (second WP adaptation flag, second weighting coefficient, and second offset information) corresponding to the second predicted image are not used, so set to a predetermined initial value. It may have been done.

復号部801は、図15に示すシンタクス500を利用する。シンタクス500は、復号部801の復号対象の符号化データの構造を示している。シンタクス500については、図15を参照して既に説明しているため、説明を省略する。また、ピクチャパラメータセットシンタクス505については、符号化が復号である点を除き、図16を参照して既に説明しているため、説明を省略する。また、スライスヘッダーシンタクス507についても、符号化が復号である点を除き、図17を参照して既に説明しているため、説明を省略する。また、プレッドウェイトテーブルシンタクス508についても、符号化が復号である点を除き、図18を参照して既に説明しているため、説明を省略する。   The decoding unit 801 uses the syntax 500 shown in FIG. The syntax 500 shows the structure of encoded data to be decoded by the decoding unit 801. The syntax 500 has already been described with reference to FIG. 15, so description thereof will be omitted. Further, the picture parameter set syntax 505 has already been described with reference to FIG. 16 except that the encoding is decoding, and therefore description thereof will be omitted. Also, the slice header syntax 507 has already been described with reference to FIG. 17 except that the encoding is decoding, and thus the description thereof will be omitted. Further, the description of the pred weight table syntax 508 has also been omitted because it has already been described with reference to FIG. 18 except that the encoding is decoding.

ここで、シンタクス構成における重み付き予測に関連するそれぞれのシンタクス要素の予測方法の詳細について説明する。シンタクス要素の予測は、インデックス再構成部801Bにより行われる。第2実施形態の予測方法を明示的に示したシンタクス構成は、第1実施形態と同様である。   Here, the details of the method of predicting each syntax element related to weighted prediction in the syntax configuration will be described. The prediction of the syntax element is performed by the index reconstructing unit 801B. The syntax configuration explicitly showing the prediction method of the second embodiment is the same as that of the first embodiment.

重み係数の固定小数点精度を示すluma_log2_weight_denom及びchroma_log2_weight_denomの信号間の予測方法については、数式(13)を用いて、復元処理が行われる。   Regarding the prediction method between the signals of luma_log2_weight_denom and chroma_log2_weight_denom, which indicate the fixed-point precision of the weighting coefficient, the restoration process is performed using Expression (13).

輝度及び色差信号の重み係数を表すluma_weight_lx[i]及びchroma_weight_lx[i][j]の予測方法については、数式(16)及び(19)を用いて、復元処理が行われる。   With respect to the prediction method of luma_weight_lx [i] and chroma_weight_lx [i] [j] that represent the weighting factors of the luminance and color difference signals, the restoration process is performed using Equations (16) and (19).

なお、上記説明した複数の予測手法は、単独で使用するだけでなく組み合わせて利用することもできる。例えば、数式(13)、数式(15)、及び数式(19)等を組み合わせるなどとすることにより、インデックス情報におけるシンタクス要素の符号量を効率良く削減することが可能となる。   Note that the above-described plurality of prediction methods can be used not only alone but also in combination. For example, by combining Expression (13), Expression (15), Expression (19), and the like, it is possible to efficiently reduce the code amount of the syntax element in the index information.

以上のように第2実施形態では、画素値変化が0となる重み係数の基準点を略中心として負の方向と正の方向に値を割り振ることにより重み係数の選択範囲を導出し、導出した重み係数の選択範囲内に重み係数が含まれていることを確認する。このため第2実施形態によれば、H.264等と比較して、重み係数の選択範囲を拡張し、選択頻度の高い正側の値を取りやすくすることができる。また第2実施形態によれば、復号対象の重み係数の差分値が−128から127までの符号付き8ビットの値を固定値として取るため、重み係数の選択範囲を拡張しつつ、符号付き8ビット精度の選択範囲を規定することができる。   As described above, in the second embodiment, the selection range of the weighting factor is derived and derived by allocating the values in the negative direction and the positive direction with the reference point of the weighting factor at which the pixel value change is 0 as the center. Confirm that the weighting factor is included in the selection range of the weighting factor. Therefore, according to the second embodiment, H.264. Compared with H.264 or the like, it is possible to expand the selection range of the weighting coefficient and make it easier to take a positive value that is frequently selected. Further, according to the second embodiment, since the difference value of the weighting coefficient to be decoded is a signed 8-bit value from −128 to 127, the weighting coefficient selection range is expanded and A bit precision selection range can be defined.

このように第2実施形態では、復号するシンタクス(重み係数の差分値)の範囲を固定値にできるため、デコーダは復号処理した符号化データが予め定められた仕様の範囲内に収まっているかどうかを簡単にチェックすることができ仕様を簡略化できる。例えば、復号するシンタクスを重み係数とし、重み係数の選択範囲が重み係数の基準値に応じて変動する場合、重み係数の基準値と重み係数の選択範囲の最小値及び最大値を対応付けたテーブルを用意して重み係数の選択範囲の導出後に都度参照するような構成が必要となる。このような場合、テーブルをメモリにロードして都度参照するという構成が必要になり、ハードウェア規模が増大する。これに対し、第2実施形態では、復号するシンタクス(重み係数の差分値)の範囲を固定値にできるため、上述したようなハードウェア構成などの制約を受けず、ハードウェア規模を削減することができる。   As described above, in the second embodiment, since the range of syntax (difference value of weighting factor) to be decoded can be set to a fixed value, the decoder determines whether the decoded encoded data is within the range of the predetermined specifications. Can be checked easily and the specifications can be simplified. For example, when the syntax to be decoded is a weighting coefficient and the selection range of the weighting coefficient varies according to the reference value of the weighting coefficient, a table that associates the reference value of the weighting coefficient with the minimum value and the maximum value of the selection range of the weighting coefficient. Must be prepared and referred to each time after the selection range of the weighting factor is derived. In such a case, it is necessary to load the table in the memory and refer to the table each time, which increases the hardware scale. On the other hand, in the second embodiment, the range of syntax (difference value of weighting coefficient) to be decoded can be set to a fixed value, so that the hardware scale can be reduced without being restricted by the hardware configuration as described above. You can

更に第2実施形態では、範囲が符号付き8ビット精度に固定された重み係数の差分値を復号することになるが、重み係数の差分値は範囲の中心付近(0付近)の値を取るため、復号時の符号長を短くすることができ、復号効率を向上できる。H.264などでは、重み係数を符号付き指数ゴロム符号(se(v))で復号するが、この符号は、復号する値が0を基準として指数的に増加するシンボルに対して有効な符号であるため、一番利用頻度が高い基準値を範囲の中心にすることが一般的である。第2実施形態では、一般的な動画像でピクチャ間の画素値変化が0となる場合を重み係数の基準値とし、かつ重み係数の選択範囲の予測においても上記基準値からの予測を導入している。これにより、指数ゴロム符号と予測及び重み係数の選択範囲が一致するため、符号量削減効果が高いとともに、基準値を中心に係数範囲を決めているため、大きな値を取る場合でも正の値と負の値の基準値からの距離が同程度になり、従来手法と比較して短い符号長で復号できる効果を奏する。   Furthermore, in the second embodiment, the difference value of the weighting coefficient whose range is fixed to signed 8-bit precision is decoded, but the difference value of the weighting coefficient takes a value near the center of the range (near 0). The code length at the time of decoding can be shortened, and the decoding efficiency can be improved. H. In H.264 and the like, the weighting coefficient is decoded by a signed exponential Golomb code (se (v)), but this code is effective for a symbol whose value to be decoded increases exponentially with 0 as a reference. , It is common to set the most frequently used reference value as the center of the range. In the second embodiment, when the pixel value change between pictures in a general moving image is 0, the reference value of the weighting coefficient is used, and the prediction from the above reference value is also introduced in the prediction of the selection range of the weighting coefficient. ing. As a result, the exponential Golomb code and the selection range of the prediction and weighting coefficients match, so that the code amount reduction effect is high and the coefficient range is determined around the reference value. The distance from the reference value of the negative value becomes approximately the same, and there is an effect that decoding can be performed with a shorter code length as compared with the conventional method.

(第1実施形態の変形例1)
第1実施形態では、符号化装置100での重み係数の選択範囲の導出について説明したが、変形例1では、符号化装置100でのオフセットの選択範囲の導出について説明する。
(Modification 1 of the first embodiment)
In the first embodiment, the derivation of the selection range of the weighting coefficient in the encoding device 100 has been described, but in the first modification, the derivation of the selection range of the offset in the encoding device 100 will be described.

数式(20)〜数式(22)で説明したとおり、YUVの色空間では、色差成分は中央値からのズレ量で色を表現する。このため、重み係数を用いて中央値を考慮した画素値変化からの変化量を予測値とすることができる。この予測値は、重み係数の影響を排除した場合のオフセットの基準値を示している。つまり、インデックス設定部108は、予測値(オフセットの基準値)を略中心として値の取りうる範囲を割り振ることで、オフセットの選択範囲を導出でき、オフセットが導出したオフセットの選択範囲内に含まれていることを確認できる。   As described in the formulas (20) to (22), in the YUV color space, the color difference component expresses a color by the amount of deviation from the median value. For this reason, the amount of change from the pixel value change considering the median can be used as the predicted value using the weighting coefficient. This predicted value indicates the reference value of the offset when the influence of the weighting coefficient is eliminated. That is, the index setting unit 108 can derive the offset selection range by allocating a range of possible values around the predicted value (offset reference value), and the offset is included in the derived offset selection range. Can be confirmed.

例えば、LWDが2、重み係数の値が5の場合、重み係数の基準値は(1<<2)、即ち、4となる。一方、重み係数の値が5であるため、画素値変化が生じる。色差信号は、中央値からのズレ量で色を表現するため、インデックス設定部108は、重み係数の影響を排除することで、オフセットの基準値を求める。オフセットの基準値は、数式(23)で定式化される。   For example, when the LWD is 2 and the value of the weighting coefficient is 5, the reference value of the weighting coefficient is (1 << 2), that is, 4. On the other hand, since the value of the weighting factor is 5, the pixel value changes. Since the color difference signal expresses the color by the amount of deviation from the median value, the index setting unit 108 eliminates the influence of the weighting coefficient to obtain the offset reference value. The reference value of the offset is formulated by Equation (23).

Pred =( MED − ( ( MED * chroma_weight_lx[i][j])>> chroma_log2_weight_denom)) …(23)   Pred = (MED − ((MED * chroma_weight_lx [i] [j]) >> chroma_log2_weight_denom))… (23)

Predは色差信号のオフセットの基準値を示し、MEDは色差信号の中央値(8ビット時に128)を示し、右側の項は重み係数の影響による中央値からのズレ量を意味している。なお、数式(23)は、数式(20)の右端の項の符号を反転した値に対応している。数式(23)に示すように、色差信号のオフセットの基準値は、色差信号の重み係数及び固定小数点精度に従って定まる。   Pred indicates the reference value of the color difference signal offset, MED indicates the median value of the color difference signal (128 at 8 bits), and the term on the right side means the amount of deviation from the median value due to the influence of the weighting coefficient. Expression (23) corresponds to a value obtained by inverting the sign of the rightmost term of expression (20). As shown in Expression (23), the reference value of the offset of the color difference signal is determined according to the weighting coefficient of the color difference signal and the fixed point precision.

なお、数式(23)は、数式(24)のように変形できる。   The formula (23) can be transformed into the formula (24).

Pred =( ( 1 << ( BitDepth − 1 )) − ( ( chroma_weight_lx[i][j] ) << (BitDepth − 1 − chroma_log2_weight_denom)) …(24)   Pred = ((1 << (BitDepth − 1)) − ((chroma_weight_lx [i] [j]) << (BitDepth − 1 − chroma_log2_weight_denom))… (24)

ここで、BitDepthは色差信号の画素深度を表しており、8ビット信号であればBitDepthは8である。数式(23)のMEDは、2のべき乗で表現される値であるため、右辺のシフト内をBitDepthを利用して書き換えると数式(24)のように表現することが可能となる。   Here, BitDepth represents the pixel depth of the color difference signal, and BitDepth is 8 if it is an 8-bit signal. Since the MED in Expression (23) is a value expressed by a power of 2, it can be expressed as Expression (24) if the shift on the right side is rewritten using BitDepth.

図21は、変形例1の色差信号のオフセットの選択範囲の一例を示す説明図である。図21に示す例では、Predが、選択範囲の略中心に位置するように配置され、(Pred)-(1<<OR)が選択範囲の最小値となり、(Pred)+(1<<OR)-1が選択範囲の最大値となっている。ORは、オフセットのビット精度を意味し、例えば、H.264などでは、8となる。図21に示すように、色差信号のオフセットの選択範囲は、色差信号のオフセットの基準値を略中心として、所定のビット精度の中で定義される。また、詳細な説明は省略するが、符号化対象の色差信号のオフセットの差分値(色差信号のオフセットと色差信号のオフセットの基準値との差分値)は、オフセットのビット精度の固定値で定義できる。例えば、8ビット精度であれば、色差信号のオフセットの差分値は、−128から127の8ビット固定値となる。また、例えば9ビット精度であれば、色差信号のオフセットの差分値は、−256から255の9ビット固定値となる。   FIG. 21 is an explanatory diagram showing an example of the selection range of the offset of the color difference signal of the first modification. In the example shown in FIG. 21, Pred is arranged so as to be located substantially at the center of the selection range, and (Pred)-(1 << OR) becomes the minimum value of the selection range, and (Pred) + (1 << OR ) -1 is the maximum value of the selection range. OR means the bit precision of the offset, for example, H.264. In H.264, it becomes 8. As shown in FIG. 21, the selection range of the offset of the color difference signal is defined within a predetermined bit precision centering on the reference value of the offset of the color difference signal. Although detailed description is omitted, the offset difference value of the color difference signal to be encoded (the difference value between the color difference signal offset and the color difference signal offset reference value) is defined as a fixed value of the offset bit precision. it can. For example, with 8-bit precision, the difference value of the offset of the color difference signal is an 8-bit fixed value of -128 to 127. Further, for example, with 9-bit precision, the difference value of the offset of the color difference signal is a fixed value of 9-bit from -256 to 255.

これにより、基準値を復元しないと符号化する値の範囲が決まらないような問題を解決できる。なお、変形例1では、色差信号のオフセットの選択範囲の導出をインデックス設定部108が行う例について説明したが、これに限定されず、符号化部110で行うようにしてもよい。   This can solve the problem that the range of values to be encoded cannot be determined unless the reference value is restored. In addition, in the first modification, an example in which the index setting unit 108 derives the selection range of the offset of the color difference signal has been described, but the present invention is not limited to this, and the encoding unit 110 may perform it.

図22は、変形例1の色差信号のオフセットの選択範囲の導出処理の一例を示すフローチャートである。ここでは、インデックス設定部108が色差信号のオフセットの選択範囲の導出処理を行う場合を想定して説明するが、前述したように、符号化部110が行ってもよい。   FIG. 22 is a flowchart illustrating an example of the derivation process of the offset selection range of the color difference signal according to the first modification. Here, description will be made assuming that the index setting unit 108 performs the process of deriving the offset selection range of the color difference signals, but as described above, the encoding unit 110 may perform it.

まず、インデックス設定部108は、重み係数の固定小数点精度LWDを導出する(ステップS12)。ここで、インデックス設定部108は、重み係数の固定小数点精度LWDをWPパラメータ情報から導出してもよいし、インデックス情報から導出してもよい。   First, the index setting unit 108 derives the fixed point precision LWD of the weighting factor (step S12). Here, the index setting unit 108 may derive the fixed point precision LWD of the weighting factor from the WP parameter information or the index information.

続いて、インデックス設定部108は、重み係数Wxcを導出する(S13)。ここで、インデックス設定部108は、重み係数WxcをWPパラメータ情報から導出してもよいし、インデックス情報から導出してもよい。   Subsequently, the index setting unit 108 derives the weighting coefficient Wxc (S13). Here, the index setting unit 108 may derive the weighting coefficient Wxc from the WP parameter information or the index information.

続いて、インデックス設定部108は、導出した重み係数の固定小数点精度LWD及び重み係数Wxcを用いて、色差信号のオフセットの基準値を数式(23)より導出する(ステップS14)。   Subsequently, the index setting unit 108 derives the reference value of the offset of the color difference signal from the mathematical expression (23) using the fixed point precision LWD and the weighting coefficient Wxc of the derived weighting coefficient (step S14).

続いて、インデックス設定部108は、導出した色差信号のオフセットの基準値から(1<<OR)を減算し、色差信号のオフセットの選択範囲の最小値を導出する(ステップS15)。   Subsequently, the index setting unit 108 subtracts (1 << OR) from the derived reference value of the offset of the color difference signal to derive the minimum value of the selection range of the offset of the color difference signal (step S15).

続いて、インデックス設定部108は、導出した色差信号のオフセットの基準値に(1<<OR)-1を加算し、色差信号のオフセットの選択範囲の最大値を導出する(ステップS16)。   Subsequently, the index setting unit 108 adds (1 << OR) -1 to the derived reference value of the offset of the color difference signal to derive the maximum value of the selection range of the offset of the color difference signal (step S16).

そしてインデックス設定部108は、導出した色差信号のオフセットの選択範囲内に色差信号のオフセットが含まれていることを確認する。なお、インデックス設定部108は、色差信号のオフセットが色差信号のオフセットの選択範囲内に含まれていないことを確認した場合、色差信号のオフセットの選択範囲の最大値又は最小値を用いてクリップ処理を行ってもよい。この場合、インデックス設定部108は、色差信号のオフセットが選択範囲の最小値より小さければ当該最小値でクリップし、色差信号のオフセットが選択範囲の最大値よりも大きければ当該最大値でクリップすればよい。このようなクリップ処理を導入することで、特定の範囲制約を設けなくても、色差信号のオフセットの差分値などの符号化対象の値は、予め定められたビット精度内の値を取るため、ハードウェアが用いる回路規模の構成を明確化できる。   Then, the index setting unit 108 confirms that the offset of the color difference signal is included in the derived selection range of the offset of the color difference signal. In addition, when the index setting unit 108 confirms that the offset of the color difference signal is not included in the selection range of the offset of the color difference signal, the clip setting process is performed using the maximum value or the minimum value of the selection range of the offset of the color difference signal. You may go. In this case, if the offset of the color difference signal is smaller than the minimum value of the selection range, the index setting unit 108 clips at the minimum value, and if the offset of the color difference signal is larger than the maximum value of the selection range, the index setting unit 108 clips at the maximum value. Good. By introducing such a clipping process, the value to be encoded such as the difference value of the offset of the color difference signal takes a value within a predetermined bit precision without providing a specific range constraint. The structure of the circuit scale used by the hardware can be clarified.

なお、図18で説明したとおり、重み係数の値と固定小数点精度の情報は、オフセットの情報よりも先に符号化されるため、オフセットの基準値を導出する際に重み係数の値を導出できる。   Note that, as described with reference to FIG. 18, since the value of the weighting factor and the information on the fixed point precision are encoded before the information on the offset, the value of the weighting factor can be derived when deriving the reference value of the offset. .

また、変形例1で説明した色差信号に対する第1オフセット及び第2オフセットの選択範囲を、第1実施形態で説明した第1重み係数及び第2重み係数の選択範囲と別々に適用してもよい。例えば、第1重み係数、第2重み係数の選択範囲は、H.264と同一とし、色差信号に対する第1オフセット及び第2オフセットの選択範囲は、変形例1のようにしてもよい。   Further, the selection range of the first offset and the second offset with respect to the color difference signal described in the first modification may be applied separately from the selection range of the first weighting coefficient and the second weighting coefficient described in the first embodiment. . For example, the selection range of the first weighting coefficient and the second weighting coefficient is H.264. The selection range of the first offset and the second offset with respect to the color difference signal may be the same as that of the first modification.

変形例1によれば、符号化するシンタクス(オフセットの差分値)の範囲を固定値にできるため、エンコーダがこれらの範囲を動的に変更するような構成と比較して、仕様を簡略化できる。なお、復号するシンタクスをオフセットとし、オフセットの選択範囲がオフセットの基準値に応じて変動する場合、オフセットの基準値とオフセットの選択範囲の最小値及び最大値を対応付けたテーブルを用意して、オフセットの選択範囲を導出後に都度参照するような構成やオフセットの選択範囲を都度計算して導出するような構成が必要となる。このような場合、テーブルをメモリにロードして都度参照するという構成や計算するための演算回路が必要になりハードウェア規模が増大する。これに対し、変形例1のように符号化するシンタクス(オフセットの差分値)の範囲が固定であると、このようなハードウェア構成などの制約を受けないため、ハードウェア規模を削減できる。   According to the first modification, the range of syntax (difference value of offset) to be encoded can be set to a fixed value, so that the specification can be simplified as compared with the configuration in which the encoder dynamically changes these ranges. . In addition, when the syntax to be decoded is an offset and the selection range of the offset varies according to the reference value of the offset, a table in which the reference value of the offset and the minimum value and the maximum value of the selection range of the offset are associated is prepared, It is necessary to have a configuration that refers to the offset selection range each time after derivation and a configuration that calculates and derives the offset selection range each time. In such a case, a configuration in which the table is loaded into the memory and referred to each time and a calculation circuit for calculation are required, which increases the hardware scale. On the other hand, when the range of syntax (offset difference value) to be encoded is fixed as in the first modification, the hardware scale can be reduced because the hardware configuration is not restricted.

(第2実施形態の変形例1)
第2実施形態では、復号装置800での重み係数の選択範囲の導出について説明したが、第2実施形態の変形例1では、復号装置800でのオフセットの選択範囲の導出について説明する。第2実施形態の変形例1では、インデックス設定部806が、予測値(オフセットの基準値)を略中心として値の取りうる範囲を割り振ることで、オフセットの選択範囲を導出でき、オフセットが導出したオフセットの選択範囲内に含まれていることを確認できる。なお、オフセットの選択範囲を導出については、第1実施形態の変形例1と同様であるため、詳細な説明は省略する。また、オフセットの選択範囲の導出をインデックス設定部806ではなく、インデックス再構成部801Bで行うようにしてもよい。
(Modification 1 of the second embodiment)
In the second embodiment, the derivation of the selection range of the weighting factor in the decoding device 800 has been described, but in the first modification of the second embodiment, the derivation of the selection range of the offset in the decoding device 800 will be described. In the first modification of the second embodiment, the index setting unit 806 can derive the offset selection range and derive the offset by allocating the range of possible values with the predicted value (reference value of the offset) as the approximate center. You can confirm that it is included in the offset selection range. The derivation of the offset selection range is the same as in the first modification of the first embodiment, and thus detailed description thereof is omitted. Further, the derivation of the offset selection range may be performed by the index reconstructing unit 801B instead of the index setting unit 806.

第2実施形態の変形例1によれば、符号化するシンタクス(オフセットの差分値)の範囲を固定値にできるため、デコーダがこれらの範囲を動的に変更するような構成と比較して、仕様を簡略化できる。なお、復号するシンタクスをオフセットとし、オフセットの選択範囲がオフセットの基準値に応じて変動する場合、オフセットの基準値とオフセットの選択範囲の最小値及び最大値を対応付けたテーブルを用意して、オフセットの選択範囲を導出後に都度参照するような構成やオフセットの選択範囲を都度計算して導出するような構成が必要となる。このような場合、テーブルをメモリにロードして都度参照するという構成や計算するための演算回路が必要になりハードウェア規模が増大する。これに対し、変形例1のように符号化するシンタクス(オフセットの差分値)の範囲が固定であると、このようなハードウェア構成などの制約を受けないため、ハードウェア規模を削減できる。   According to the first modification of the second embodiment, the range of syntax (offset difference value) to be encoded can be set to a fixed value, and therefore, as compared with a configuration in which the decoder dynamically changes these ranges, The specifications can be simplified. In addition, when the syntax to be decoded is an offset and the selection range of the offset varies according to the reference value of the offset, a table in which the reference value of the offset and the minimum value and the maximum value of the selection range of the offset are associated is prepared, It is necessary to have a configuration that refers to the offset selection range each time after derivation and a configuration that calculates and derives the offset selection range each time. In such a case, a configuration in which the table is loaded into the memory and referred to each time and a calculation circuit for calculation are required, which increases the hardware scale. On the other hand, when the range of the syntax (the difference value of the offset) to be encoded is fixed as in the first modification, the hardware scale can be reduced because the hardware configuration is not restricted.

(第1実施形態の変形例2)
第1実施形態では、符号化装置100での重み係数の選択範囲の導出について説明したが、変形例2では、符号化装置100での重み係数の選択範囲の導出の際に、重み係数の選択範囲をシフトする例について説明する。
(Modification 2 of the first embodiment)
In the first embodiment, the derivation of the weighting factor selection range in the encoding device 100 has been described, but in the second modification, the weighting factor selection is performed when the weighting factor selection range is derived in the encoding device 100. An example of shifting the range will be described.

第1実施形態では、図9で説明したように、重み係数の選択範囲の略中心を、重み係数の基準値としていた。また、図7等で説明したように、画像間で平均的な画素値変化が無い場合、重み係数の値を実数値で表現すると1.0となり、重み係数が負となる範囲は単方向の重み付き予測では選択されない。これより、実運用上の重み係数の選択範囲は、基準値近辺の選択頻度が最も高く、負の範囲はあまり利用されないことが判る。このため、変形例2では、インデックス設定部108は、重み係数の選択範囲の導出の際に、重み係数の選択範囲を正側にシフトする。   In the first embodiment, as described with reference to FIG. 9, the approximate center of the selection range of the weight coefficient is used as the reference value of the weight coefficient. Further, as described with reference to FIG. 7 and the like, when there is no average pixel value change between images, the value of the weighting coefficient is 1.0 when expressed by a real value, and the range where the weighting coefficient is negative is unidirectional. Not selected in weighted prediction. From this, it can be seen that the selection range of the weighting factor in actual operation has the highest selection frequency near the reference value, and the negative range is rarely used. For this reason, in the second modification, the index setting unit 108 shifts the weighting factor selection range to the positive side when deriving the weighting factor selection range.

図23は、変形例2の重み係数の選択範囲の一例を示す説明図である。図23に示す例では、図9で説明した重み係数の選択範囲と異なり、重み係数の基準値(1<<LWD)にシフト値SHFTを加算した新たな基準値((1<<LWD)+SHFT)が、選択範囲の略中心に位置するように配置され、この値から128を減算した値(−128+(1<<LWD)+SHFT)が選択範囲の最小値となり、この値に127を加算した値(127+(1<<LWD)+SHFT)が選択範囲の最大値となっている。この際、固定小数点精度LWDの値によって最大値が255よりも大きくなる場合が発生するが、インデックス設定部108は、最大値を255でクリップ処理してもよいし、固定小数点ごとに取りうるSHFTの値を変更してもよい。なお、変形例2では、重み係数の選択範囲の導出をインデックス設定部108が行う例について説明したが、これに限定されず、符号化部110で行うようにしてもよい。   FIG. 23 is an explanatory diagram showing an example of the selection range of the weighting factor of the second modification. In the example shown in FIG. 23, unlike the selection range of the weighting factor described in FIG. 9, a new reference value ((1 << LWD) + SHFT) obtained by adding the shift value SHFT to the reference value (1 << LWD) of the weighting factor. ) Is arranged so as to be located substantially at the center of the selection range, and the value obtained by subtracting 128 from this value (-128+ (1 << LWD) + SHFT) becomes the minimum value of the selection range, and 127 is added to this value. The value (127+ (1 << LWD) + SHFT) is the maximum value of the selection range. At this time, the maximum value may become larger than 255 depending on the value of the fixed-point precision LWD, but the index setting unit 108 may perform the clipping process with the maximum value at 255, or the SHFT that can be taken for each fixed point. The value of may be changed. In Modification 2, the example in which the index setting unit 108 derives the selection range of the weighting factor has been described, but the present invention is not limited to this, and the encoding unit 110 may perform it.

図24は、変形例2の重み係数の選択範囲の導出処理の一例を示すフローチャートである。ここでは、インデックス設定部108が重み係数の選択範囲の導出処理を行う場合を想定して説明するが、前述したように、符号化部110が行ってもよい。   FIG. 24 is a flowchart illustrating an example of the derivation process of the selection range of the weighting factor of the second modification. Here, description will be made assuming that the index setting unit 108 performs the derivation process of the selection range of the weighting coefficient, but as described above, the encoding unit 110 may perform it.

まず、インデックス設定部108は、重み係数の固定小数点精度LWDを導出する(ステップS22)。ここで、インデックス設定部108は、重み係数の固定小数点精度LWDをWPパラメータ情報から導出してもよいし、インデックス情報から導出してもよい。   First, the index setting unit 108 derives the fixed point precision LWD of the weighting factor (step S22). Here, the index setting unit 108 may derive the fixed point precision LWD of the weighting factor from the WP parameter information or the index information.

続いて、インデックス設定部108は、導出した固定小数点精度LWD及びシフト値SHFTを用いて、重み係数の基準値((1<<LWD)+SHFT)を導出する(ステップS23)。   Then, the index setting unit 108 derives the reference value ((1 << LWD) + SHFT) of the weighting factor using the derived fixed-point precision LWD and shift value SHFT (step S23).

続いて、インデックス設定部108は、導出した重み係数の基準値((1<<LWD)+SHFT)から128を減算し、重み係数の選択範囲の最小値を導出する(ステップS24)。   Subsequently, the index setting unit 108 subtracts 128 from the derived reference value ((1 << LWD) + SHFT) of the weighting factor to derive the minimum value of the selection range of the weighting factor (step S24).

続いて、インデックス設定部108は、導出した重み係数の基準値((1<<LWD)+SHFT)に127を加算し、重み係数の選択範囲の最大値を導出する(ステップS25)。   Subsequently, the index setting unit 108 adds 127 to the derived reference value ((1 << LWD) + SHFT) of the weighting factor to derive the maximum value of the selection range of the weighting factor (step S25).

そしてインデックス設定部108は、導出した重み係数の選択範囲内に重み係数が含まれていることを確認する。なお、インデックス設定部108は、重み係数が導出した重み係数の選択範囲内に含まれていないことを確認した場合、重み係数の選択範囲の最大値又は最小値を用いてクリップ処理を行ってもよい。この場合、インデックス設定部108は、重み係数が選択範囲の最小値より小さければ当該最小値でクリップし、重み係数が選択範囲の最大値よりも大きければ当該最大値でクリップすればよい。このようなクリップ処理を導入することで、特定の範囲制約を設けなくても、重み係数の差分値などの符号化対象の値は、予め定められたビット精度内の値を取るため、ハードウェアが用いる回路規模の構成を明確化できる。   Then, the index setting unit 108 confirms that the weighting factor is included in the derived selection range of the weighting factor. If the index setting unit 108 confirms that the weighting factor is not included in the derived weighting factor selection range, the indexing unit 108 may perform clipping processing using the maximum value or the minimum value of the weighting factor selection range. Good. In this case, the index setting unit 108 may clip at the minimum value if the weight coefficient is smaller than the minimum value in the selection range, and at the maximum value if the weight coefficient is larger than the maximum value in the selection range. By introducing such a clipping process, the value to be encoded such as the difference value of the weighting coefficient takes a value within a predetermined bit precision even if a specific range constraint is not set. Can clarify the circuit scale configuration used by.

以上のように変形例2では、重み係数の選択範囲を、重み係数の変化分を考慮した上で所定の値だけシフトした基準点を中心として、負の方向と正の方向に値を割り振ることにより、符号化する値の範囲を固定とすることができる。   As described above, in the second modification, the weighting factor selection range is assigned values in the negative direction and the positive direction around the reference point shifted by a predetermined value in consideration of the variation of the weighting factor. By this, the range of values to be encoded can be fixed.

(第2実施形態の変形例2)
第2実施形態では、復号装置800での重み係数の選択範囲の導出について説明したが、第2実施形態の変形例2では、復号装置800での重み係数の選択範囲の導出の際に、重み係数の選択範囲をシフトする例について説明する。第2実施形態の変形例2では、インデックス設定部806が、重み係数の選択範囲の導出の際に、重み係数の選択範囲を正側にシフトする。なお、重み係数の選択範囲の導出については、第1実施形態の変形例2と同様であるため、詳細な説明は省略する。また、重み係数の選択範囲の導出をインデックス設定部806ではなく、インデックス再構成部801Bで行うようにしてもよい。
(Modification 2 of the second embodiment)
In the second embodiment, the derivation of the selection range of the weighting factor in the decoding device 800 has been described. However, in the modification 2 of the second embodiment, the weighting is performed in the derivation of the selection range of the weighting factor in the decoding device 800. An example of shifting the selection range of the coefficient will be described. In the second modification of the second embodiment, the index setting unit 806 shifts the weighting factor selection range to the positive side when deriving the weighting factor selection range. The derivation of the selection range of the weighting factor is the same as in the second modification of the first embodiment, and thus detailed description will be omitted. Moreover, the derivation of the selection range of the weighting factor may be performed not by the index setting unit 806 but by the index reconstructing unit 801B.

以上のように第2実施形態の変形例2では、重み係数の選択範囲を、重み係数の変化分を考慮した上で所定の値だけシフトした基準点を中心として、負の方向と正の方向に値を割り振ることにより、復号する値の範囲を固定とすることができる。   As described above, in the modified example 2 of the second embodiment, the selection range of the weighting factor is negative and positive with respect to the reference point that is shifted by a predetermined value in consideration of the change amount of the weighting factor. By assigning a value to, the range of values to be decoded can be fixed.

(第1実施形態の変形例3)
変形例3では、第1実施形態の符号化装置100での重み係数の選択範囲の導出手法と異なる導出手法について説明する。
(Modification 3 of the first embodiment)
In Modification 3, a derivation method different from the derivation method of the selection range of the weighting coefficient in the encoding device 100 of the first embodiment will be described.

変形例3では、数式(14)〜数式(16)におけるluma_weight_lx[i]が固定の選択範囲を持ち、delta_luma_weight_lx[i]が、LWDに応じて動的な選択範囲を持つ。なお、変形例5の重み係数(luma_weight_lx[i])の選択範囲は図9と同様である。   In Modification 3, luma_weight_lx [i] in Expressions (14) to (16) has a fixed selection range, and delta_luma_weight_lx [i] has a dynamic selection range according to LWD. The selection range of the weighting factor (luma_weight_lx [i]) of the modification 5 is the same as that of FIG.

図25は、変形例3における符号化対象の重み係数の差分値の範囲の一例を示す説明図である。図25に示す例では、重み係数の差分値(delta_luma_weight_lx[i])は、符号付き8ビット信号の加減算を行うため、符号付き9ビットの値を取る。一方、重み係数の基準値は固定小数点精度に応じて大きくなる値を取るため、重み係数の差分値は固定小数点精度の値が大きくなるにつれて負側に偏る傾向がある。   FIG. 25 is an explanatory diagram showing an example of the range of the difference value of the weighting coefficient to be encoded in Modification 3. In the example shown in FIG. 25, the difference value of the weighting factors (delta_luma_weight_lx [i]) is a signed 9-bit value because addition / subtraction of a signed 8-bit signal is performed. On the other hand, since the reference value of the weighting coefficient takes a value that increases according to the fixed point precision, the difference value of the weighting coefficient tends to be biased toward the negative side as the value of the fixed point precision increases.

図26は、変形例3のシンタクス要素の値の関係の一例を示す説明図であり、luma_log2_weight_denom、default_luma_weight_lx、luma_weight_lx[i]、及びdelta_luma_weight_lx[i]の値の関係を示している。エントロピー符号化部110Aによって符号化されるシンタクス要素であるdelta_luma_weight_lx[i]、即ち、重み係数の差分値の取りうる範囲は、図19に示すように、固定小数点精度を表すluma_log2_weight_denomの値が大きくなるにつれて負側に偏る傾向があることが判る。一方、復号した重み係数の値(luma_weight_lx[i])は、−128から127まで固定の範囲となることが判る。   FIG. 26 is an explanatory diagram showing an example of the relationship between the values of the syntax elements of the modified example 3, and shows the relationship between the values of luma_log2_weight_denom, default_luma_weight_lx, luma_weight_lx [i], and delta_luma_weight_lx [i]. As shown in FIG. 19, the delta_luma_weight_lx [i], which is a syntax element encoded by the entropy encoding unit 110, that is, the range in which the difference value of the weight coefficient can be taken, is such that the value of luma_log2_weight_denom representing the fixed-point precision becomes large. It turns out that there is a tendency to bias toward the negative side. On the other hand, it can be seen that the decoded weight coefficient value (luma_weight_lx [i]) is in a fixed range from -128 to 127.

以上のように変形例3では、復号した重み係数の値が固定の選択範囲を持つように符号化する差分値の範囲を定めることにより、予測方法が変わった場合においてもH.264と同一の選択範囲を定めることが出来るようになる。   As described above, in Modification 3, by defining the range of the difference value to be encoded so that the value of the decoded weighting coefficient has a fixed selection range, even if the prediction method is changed, the H.264 codec is changed. It becomes possible to define the same selection range as H.264.

(第2実施形態の変形例3)
第2実施形態の変形例3では、第2実施形態の復号装置800での重み係数の選択範囲の導出手法と異なる導出手法について説明する。但し、第2実施形態の変形例3の重み係数の選択範囲の導出手法は、第1実施形態の変形例3と同様であるため、詳細な説明は省略する。
(Modification 3 of the second embodiment)
In the modified example 3 of the second embodiment, a derivation method different from the derivation method of the selection range of the weighting coefficient in the decoding device 800 of the second embodiment will be described. However, since the method of deriving the selection range of the weighting factor of the modified example 3 of the second embodiment is the same as that of the modified example 3 of the first embodiment, detailed description thereof will be omitted.

以上のように第2実施形態の変形例3では、重み係数の値が固定の選択範囲を持つように復号する差分値の範囲を定めることにより、予測方法が変わった場合においてもH.264と同一の選択範囲を定めることが出来るようになる。   As described above, in the modified example 3 of the second embodiment, the range of the difference value to be decoded is determined so that the value of the weighting coefficient has a fixed selection range. It becomes possible to define the same selection range as H.264.

(第1実施形態の変形例4)
変形例4では、第1実施形態の変形例3の重み係数の選択範囲の導出の際に、重み係数の選択範囲をシフトする例について説明する。
(Modification 4 of the first embodiment)
In modification 4, an example of shifting the selection range of the weighting factor when deriving the selection range of the weighting factor of the modification 3 of the first embodiment will be described.

変形例4では、インデックス設定部108が重み係数の差分値の範囲を正側にシフトするが、これは実質的に復号後の重み係数の選択範囲を正側にシフトしていることと等価である。   In the modified example 4, the index setting unit 108 shifts the range of the difference value of the weighting factors to the positive side, which is substantially equivalent to shifting the selection range of the decoded weighting factors to the positive side. is there.

図27は、変形例4の重み係数の差分値の範囲の一例を示す説明図である。第1実施形態の変形例3と比較して、−128から127までの8ビット範囲の値を取る重み係数の差分値の範囲が、正側にSHFT分シフトしている。   FIG. 27 is an explanatory diagram showing an example of the range of the difference value of the weighting factor of the modified example 4. Compared with the modified example 3 of the first embodiment, the range of the difference value of the weighting coefficient that takes a value in the 8-bit range from −128 to 127 is shifted to the positive side by SHFT.

図28は、変形例4の復号後の重み係数の選択範囲を示している。図28より、変形例4では、差分値のシフト分だけ、重み係数の範囲を正側にシフトしていることが判る。このような構成としても、従来選択することが出来なかったLWDが7の場合の基準値も選択することが出来るようになる。   FIG. 28 shows a selection range of the weighting coefficient after decoding in the modified example 4. From FIG. 28, it is understood that in Modification 4, the range of the weighting factor is shifted to the positive side by the shift amount of the difference value. Even with such a configuration, it becomes possible to select the reference value when the LWD is 7, which could not be selected conventionally.

(第2実施形態の変形例4)
第2実施形態の変形例4では、第2実施形態の変形例3の重み係数の選択範囲の導出の際に、重み係数の選択範囲をシフトする例について説明する。但し、第2実施形態の変形例4の重み係数の選択範囲をシフトする手法は、第1実施形態の変形例4と同様であるため、詳細な説明は省略する。このような構成としても、従来選択することが出来なかったLWDが7の場合の基準値も選択することが出来るようになる。
(Modification 4 of the second embodiment)
In the modification 4 of the second embodiment, an example of shifting the selection range of the weight coefficient when deriving the selection range of the weight coefficient of the modification 3 of the second embodiment will be described. However, since the method of shifting the selection range of the weighting factor of the modified example 4 of the second embodiment is the same as that of the modified example 4 of the first embodiment, detailed description thereof will be omitted. Even with such a configuration, it becomes possible to select the reference value when the LWD is 7, which could not be selected conventionally.

(第1実施形態の変形例5)
変形例5では、第1実施形態の変形例3及び変形例4において重み係数の差分値をラップ処理する例について説明する。
(Modification 5 of the first embodiment)
In modification 5, an example in which the difference value of the weighting factors is subjected to the wrap processing in modifications 3 and 4 of the first embodiment will be described.

図25で説明したように、重み係数の差分値は、符号付き9ビット信号(−256から126)であって、固定小数点精度が大きくなると負側に偏っている。重み係数は、一般的に指数ゴロム符号などを用いてエントロピー符号化されるため、正負のバランスが偏っている場合、符号化効率が低下する場合がある。重み係数の差分値の範囲は、固定小数点精度に応じて異なるが、固定小数点精度が確定した場合の範囲は8ビット内に収まっている。例えば、LWDが7の場合、差分値の範囲は−256から−1までであり、0基準にシフトすると0から255までの8ビットの値となる。このため、インデックス再構成部110Bは、固定小数点精度に応じて、符号付き9ビットを符号無し8ビットにラップ処理する。この場合、正方向の値は従来通りの値を取り、負の値は正の値の終端に接続される。   As described with reference to FIG. 25, the difference value of the weighting coefficient is a signed 9-bit signal (-256 to 126) and is biased to the negative side when the fixed-point precision increases. Since the weighting factor is generally entropy-coded by using an exponential Golomb code or the like, if the positive and negative balance is biased, the coding efficiency may decrease. Although the range of the difference value of the weighting coefficient differs depending on the fixed point precision, the range when the fixed point precision is fixed is within 8 bits. For example, when LWD is 7, the range of the difference value is −256 to −1, and when it is shifted to the 0 standard, it becomes an 8-bit value from 0 to 255. Therefore, the index reconstructing unit 110B wraps signed 9 bits into unsigned 8 bits according to the fixed-point precision. In this case, the positive value has a conventional value, and the negative value is connected to the end of the positive value.

図29は、変形例5の重み係数の差分値のラップ処理の一例を示すフローチャートである。   FIG. 29 is a flowchart showing an example of the wrapping process of the difference value of the weighting factors of the modified example 5.

まず、インデックス再構成部110Bは、インデックス情報から重み係数の固定小数点精度LWDを導出する(ステップS32)。   First, the index reconstructing unit 110B derives the fixed point precision LWD of the weighting factor from the index information (step S32).

続いて、インデックス再構成部110Bは、インデックス情報から重み係数を導出する(ステップS33)。   Subsequently, the index reconstructing unit 110B derives a weighting factor from the index information (step S33).

続いて、インデックス再構成部110Bは、導出した固定小数点精度LWDを用いて、重み係数の基準値(1<<LWD)を導出する(ステップS34)。   Subsequently, the index reconstructing unit 110B derives the reference value (1 << LWD) of the weighting factor using the derived fixed-point precision LWD (step S34).

続いて、インデックス再構成部110Bは、数式(14)より重み係数の差分値を導出する(ステップS35)。   Subsequently, the index reconstructing unit 110B derives the difference value of the weighting factor from the mathematical expression (14) (step S35).

続いて、インデックス再構成部110Bは、重み係数の基準値(1<<LWD)に基づいて、ラップ処理を行い、正の値はそのままに負の値を正の最大値の後ろに接続することで符号無し8ビットコードを生成する(ステップS36)。   Subsequently, the index reconstructing unit 110B performs the wrap processing based on the reference value (1 << LWD) of the weighting coefficient, and connects the negative value after the maximum positive value while keeping the positive value as it is. An unsigned 8-bit code is generated by (step S36).

そして、インデックス再構成部110Bにより生成されたコードがエントロピー符号化部110Aでエントロピー符号化される。   Then, the code generated by the index reconstructing unit 110B is entropy coded by the entropy coding unit 110A.

以上のように変形例5では、符号付き9ビットの値に対してラップ処理を施すことにより、常に符号無し8ビットで符号化できるようになり、符号付き9ビットの指数ゴロム符号化部などのハードウェアを持つ必要が無くなる。   As described above, in the modified example 5, by performing the wrap processing on the signed 9-bit value, it is possible to always encode with an unsigned 8-bit value, and the signed 9-bit exponential Golomb coding unit or the like can be used. Eliminates the need to have hardware

(第2実施形態の変形例5)
第2実施形態の変形例5では、第2実施形態の変形例3及び変形例4において重み係数の差分値をラップ処理する例について説明する。
(Modification 5 of the second embodiment)
In the modified example 5 of the second embodiment, an example in which the difference value of the weighting factors in the modified examples 3 and 4 of the second embodiment is lapped will be described.

図25で説明したように、重み係数の差分値は、符号付き9ビット信号(−256から126)であって、固定小数点精度が大きくなると負側に偏っている。重み係数は、一般的に指数ゴロム符号などを用いてエントロピー符号化されるため、正負のバランスが偏っている場合、符号化効率が低下する場合がある。重み係数の差分値の範囲は、固定小数点精度に応じて異なるが、固定小数点精度が確定した場合の範囲は8ビット内に収まっている。例えば、LWDが7の場合、差分値の範囲は−256から−1までであり、0基準にシフトすると0から255までの8ビットの値となる。このため、インデックス再構成部801Bは、固定小数点精度に応じて、符号付き9ビットを符号無し8ビットにラップ処理する。この場合、正方向の値は従来通りの値を取り、負の値は正の値の終端に接続される。   As described with reference to FIG. 25, the difference value of the weighting coefficient is a signed 9-bit signal (-256 to 126) and is biased to the negative side when the fixed-point precision increases. Since the weighting factor is generally entropy-coded by using an exponential Golomb code or the like, if the positive and negative balance is biased, the coding efficiency may decrease. Although the range of the difference value of the weighting coefficient differs depending on the fixed point precision, the range when the fixed point precision is fixed is within 8 bits. For example, when LWD is 7, the range of the difference value is −256 to −1, and when it is shifted to the 0 standard, it becomes an 8-bit value from 0 to 255. Therefore, the index reconstructing unit 801B wraps signed 9 bits into unsigned 8 bits according to the fixed-point precision. In this case, the positive value has a conventional value, and the negative value is connected to the end of the positive value.

図30は、第2実施形態の変形例5の重み係数の差分値の復元処理の一例を示すフローチャートである。   FIG. 30 is a flowchart showing an example of the restoration process of the difference value of the weighting factors according to the modified example 5 of the second embodiment.

まず、エントロピー復号部801Aは、符号化データを復号して重み係数の固定小数点精度LWDを導出する(ステップS42)。   First, the entropy decoding unit 801A decodes the encoded data to derive the fixed point precision LWD of the weighting factor (step S42).

続いて、エントロピー復号部801Aは、次に符号化データを復号して重み係数の差分値を示す符号無し8ビットコードを復号する(ステップS43)。   Subsequently, the entropy decoding unit 801A next decodes the encoded data to decode an unsigned 8-bit code indicating the difference value of the weighting factors (step S43).

続いて、インデックス再構成部801Bは、導出した固定小数点精度LWDを用いて、重み係数の基準値(1<<LWD)を導出する(ステップS44)。   Subsequently, the index reconstructing unit 801B derives the reference value (1 << LWD) of the weighting factor using the derived fixed-point precision LWD (step S44).

続いて、インデックス再構成部801Bは、導出した重み係数の基準値(1<<LWD)を用いて、符号無し8ビットコードを符号付き9ビットの差分値に復元する(ステップS45)。ここでは、復号したデータから基準値を下回る値をそのままにし、基準値以上のコードを負側に接続することで差分値を復元する。以上により、復元された重み係数の差分値を導出し、数式(15)により重み係数を復元する。   Subsequently, the index reconstructing unit 801B restores the unsigned 8-bit code into a signed 9-bit difference value by using the derived reference value (1 << LWD) of the weighting coefficient (step S45). Here, the value below the reference value is left unchanged from the decoded data, and the difference value is restored by connecting the code above the reference value to the negative side. As described above, the difference value of the restored weighting factor is derived, and the weighting factor is restored by the mathematical expression (15).

以上のように第2実施形態の変形例5では、符号付き9ビットの値に対してラップ処理を施すことにより、常に符号無し8ビットで符号化できるようになり、符号付き9ビットの指数ゴロム符号化部などのハードウェアを持つ必要が無くなる。   As described above, in the modified example 5 of the second embodiment, by performing the wrap processing on the signed 9-bit value, it is possible to always encode the unsigned 8-bit value. There is no need to have hardware such as an encoding unit.

(変形例6)
上記第1〜第2実施形態では、フレームを16×16画素サイズなどの矩形ブロックに分割し、画面左上のブロックから右下に向かって順に符号化/復号を行う例について説明している(図2Aを参照)。しかしながら、符号化順序及び復号順序はこの例に限定されない。例えば、右下から左上に向かって順に符号化及び復号が行われてもよいし、画面中央から画面端に向かって渦巻を描くように符号化及び復号が行われてもよい。更に、右上から左下に向かって順に符号化及び復号が行われてもよいし、画面端から画面中央に向かって渦巻きを描くように符号化及び復号が行われてもよい。この場合、符号化順序によって参照できる隣接画素ブロックの位置が変わるので、適宜利用可能な位置に変更すればよい。
(Modification 6)
In the first and second embodiments, an example is described in which a frame is divided into rectangular blocks having a size of 16 × 16 pixels, and encoding / decoding is performed in order from the upper left block to the lower right. 2A). However, the encoding order and the decoding order are not limited to this example. For example, the encoding and decoding may be performed sequentially from the lower right side to the upper left side, or the encoding and decoding may be performed so as to draw a spiral from the center of the screen toward the screen edge. Furthermore, encoding and decoding may be performed in order from the upper right to the lower left, or encoding and decoding may be performed so as to draw a spiral from the edge of the screen toward the center of the screen. In this case, since the position of the adjacent pixel block that can be referred to changes depending on the encoding order, it may be changed to an appropriately usable position.

上記第1〜第2実施形態では、4×4画素ブロック、8×8画素ブロック、16×16画素ブロックなどの予測対象ブロックサイズを例示して説明を行ったが、予測対象ブロックは均一なブロック形状でなくてもよい。例えば、予測対象ブロックサイズは、16×8画素ブロック、8×16画素ブロック、8×4画素ブロック、4×8画素ブロックなどであってもよい。また、1つのコーディングツリーブロック内で全てのブロックサイズを統一させる必要はなく、複数の異なるブロックサイズを混在させてもよい。1つのコーディングツリーブロック内で複数の異なるブロックサイズを混在させる場合、分割数の増加に伴って分割情報を符号化又は復号するための符号量も増加する。そこで、分割情報の符号量と局所復号画像または復号画像の品質との間のバランスを考慮して、ブロックサイズを選択することが望ましい。   The first to second embodiments have been described by exemplifying the prediction target block size such as the 4 × 4 pixel block, the 8 × 8 pixel block, and the 16 × 16 pixel block, but the prediction target block is a uniform block. It does not have to be a shape. For example, the prediction target block size may be a 16 × 8 pixel block, an 8 × 16 pixel block, an 8 × 4 pixel block, a 4 × 8 pixel block, or the like. Further, it is not necessary to unify all block sizes in one coding tree block, and a plurality of different block sizes may be mixed. When a plurality of different block sizes are mixed in one coding tree block, the code amount for coding or decoding the division information increases as the number of divisions increases. Therefore, it is desirable to select the block size in consideration of the balance between the code amount of the division information and the locally decoded image or the quality of the decoded image.

上記第1〜第2実施形態では、簡単化のために、輝度信号と色差信号における予測処理や選択範囲の導出方法とを区別せず、色信号成分に関して包括的な説明を記述した部分がある。しかしながら、予測処理や選択範囲の導出方法が輝度信号と色差信号との間で異なる場合には、同一または異なる予測方法が用いられてよい。輝度信号と色差信号との間で異なる予測方法が用いられるならば、色差信号に対して選択した予測方法を輝度信号と同様の方法で符号化又は復号できる。   In the first and second embodiments described above, for simplification, there is a part in which a comprehensive description is described regarding the color signal component without distinguishing between the prediction process and the selection range deriving method for the luminance signal and the color difference signal. . However, when the prediction process and the method of deriving the selection range are different between the luminance signal and the color difference signal, the same or different prediction method may be used. If different prediction methods are used between the luminance signal and the chrominance signal, the prediction method selected for the chrominance signal can be encoded or decoded in the same manner as the luminance signal.

上記第1〜第2実施形態では、簡単化のために、輝度信号と色差信号における重み付き動き補償予測処理とを区別せず、色信号成分に関して包括的な説明を記述した。しかしながら、重み付き動き補償予測処理が輝度信号と色差信号との間で異なる場合には、同一または異なる重み付き動き補償予測処理が用いられてよい。輝度信号と色差信号との間で異なる重み付き動き補償予測処理が用いられるならば、色差信号に対して選択した重み付き動き補償予測処理を輝度信号と同様の方法で符号化又は復号できる。   In the first and second embodiments, for simplicity, a comprehensive description has been given regarding the color signal components without distinguishing between the weighted motion compensation prediction processing on the luminance signal and the color difference signal. However, when the weighted motion compensation prediction processing differs between the luminance signal and the color difference signal, the same or different weighted motion compensation prediction processing may be used. If different weighted motion compensation prediction processes are used between the luminance signal and the color difference signal, the selected weighted motion compensation prediction process for the color difference signal can be encoded or decoded in the same manner as the luminance signal.

上記第1〜第2実施形態では、シンタクス構成に示す表の行間には、本実施形態で規定していないシンタクス要素が挿入されることも可能であるし、それ以外の条件分岐に関する記述が含まれていても構わない。或いは、シンタクステーブルを複数のテーブルに分割、統合することも可能である。また、必ずしも同一の用語を用いる必要は無く、利用する形態によって任意に変更しても構わない。   In the first and second embodiments, syntax elements not defined in the present embodiment can be inserted between the rows of the table shown in the syntax configuration, and descriptions about other conditional branches are included. It does not matter. Alternatively, the syntax table can be divided into a plurality of tables and integrated. Further, it is not always necessary to use the same term, and the term may be arbitrarily changed depending on the form used.

以上説明したように、各実施形態及び各変形例は、重み付き動き補償予測を行う際にシンタクス要素の取りうる値の範囲を定義し、それに伴う値の範囲を予め定めたビット精度の範囲で設定し、実際に利用頻度の高い値に対して短い符号長を与える構成とすることで、シンタクス要素の冗長な情報を符号化する問題を解消しつつ、高効率な重み付き動き補償予測処理を実現する。故に、各実施形態及び各変形例によれば、符号化効率が向上し、ひいては主観画質も向上する。   As described above, each embodiment and each modified example define a range of values that syntax elements can take when performing weighted motion compensation prediction, and set the accompanying value range within a predetermined bit precision range. By setting it and giving a short code length to a value that is frequently used, a highly efficient weighted motion compensation prediction process can be performed while solving the problem of encoding redundant information of syntax elements. To be realized. Therefore, according to each embodiment and each modification, the coding efficiency is improved and the subjective image quality is also improved.

本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら新規な実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれるとともに、特許請求の範囲に記載された発明とその均等の範囲に含まれる。   Although some embodiments of the present invention have been described, these embodiments are presented as examples and are not intended to limit the scope of the invention. These novel embodiments can be implemented in various other forms, and various omissions, replacements, and changes can be made without departing from the spirit of the invention. These embodiments and modifications thereof are included in the scope and the gist of the invention, and are also included in the invention described in the claims and the scope equivalent thereto.

例えば、上記各実施形態の処理を実現するプログラムを、コンピュータで読み取り可能な記憶媒体に格納して提供することも可能である。記憶媒体としては、磁気ディスク、光ディスク(CD−ROM、CD−R、DVD等)、光磁気ディスク(MO等)、半導体メモリなど、プログラムを記憶でき、かつ、コンピュータが読み取り可能な記憶媒体であれば、その記憶形式は何れの形態であってもよい。   For example, a program that implements the processing of each of the above embodiments may be stored in a computer-readable storage medium and provided. The storage medium may be a computer-readable storage medium that can store a program, such as a magnetic disk, an optical disk (CD-ROM, CD-R, DVD, etc.), a magneto-optical disk (MO, etc.), a semiconductor memory, etc. The storage format may be any format.

また、上記各実施形態の処理を実現するプログラムを、インターネットなどのネットワークに接続されたコンピュータ(サーバ)上に格納し、ネットワーク経由でコンピュータ(クライアント)にダウンロードさせてもよい。   Further, a program for realizing the processing of each of the above embodiments may be stored on a computer (server) connected to a network such as the Internet, and downloaded to a computer (client) via the network.

100 符号化装置
101 減算部
102 直交変換部
103 量子化部
104 逆量子化部
105 逆直交変換部
106 加算部
107 予測画像生成部
108 インデックス設定部
109 動き評価部
110 符号化部
110A エントロピー符号化部
110B インデックス再構成部
111 符号化制御部
201 複数フレーム動き補償部
202 メモリ
203 単方向動き補償部
204 予測パラメータ制御部
205 参照画像セレクタ
206 フレームメモリ
207 参照画像制御部
301 デフォルト動き補償部
302 重み付き動き補償部
303 WPパラメータ制御部
304、305 WPセレクタ
800 復号装置
801 復号部
801A エントロピー復号部
801B インデックス再構成部
802 逆量子化部
803 逆直交変換部
804 加算部
805 予測画像生成部
806 インデックス設定部
807 復号制御部
REFERENCE SIGNS LIST 100 Encoding device 101 Subtraction unit 102 Orthogonal transformation unit 103 Quantization unit 104 Inverse quantization unit 105 Inverse orthogonal transformation unit 106 Addition unit 107 Predicted image generation unit 108 Index setting unit 109 Motion evaluation unit 110 Encoding unit 110A Entropy encoding unit 110B Index Reconstruction Unit 111 Encoding Control Unit 201 Multiple Frame Motion Compensation Unit 202 Memory 203 Unidirectional Motion Compensation Unit 204 Prediction Parameter Control Unit 205 Reference Image Selector 206 Frame Memory 207 Reference Image Control Unit 301 Default Motion Compensation Unit 302 Weighted Motion Compensation unit 303 WP parameter control unit 304, 305 WP selector 800 Decoding device 801 Decoding unit 801A Entropy decoding unit 801B Index reconstructing unit 802 Inverse quantization unit 803 Inverse orthogonal transform unit 804 Calculation unit 805 predicted image generator 806 index setting unit 807 the decoding control unit

Claims (2)

画像に対する重み付き動き補償予測で用いられる輝度の重み係数の第1固定小数点精度を符号化するステップと、
前記第1固定小数点精度と、前記重み付き動き補償予測で用いられる色差の重み係数の第2固定小数点精度との差異と同じ値である、第1差分値を符号化するステップと、
前記第1固定小数点精度で定められるビット数だけ“1”を左シフトすることによって得られる値と同じ値である第1基準値と、前記輝度の重み係数と、の差異と同じ値であって、前記第1固定小数点精度によらず−128から+127までの範囲をとりうる値とする、前記輝度の重み係数の第2差分値を符号化するステップと、
を含む符号化方法。
Encoding a first fixed point precision of luminance weighting factors used in weighted motion compensated prediction for an image;
Encoding a first difference value that is the same value as the difference between the first fixed-point precision and the second fixed-point precision of the color difference weighting coefficient used in the weighted motion compensation prediction;
The same value as the difference between the first reference value, which is the same value as the value obtained by left-shifting “1” by the number of bits determined by the first fixed-point precision, and the luminance weighting coefficient. Encoding the second difference value of the luminance weighting coefficient, which is a value that can take a range from -128 to +127 regardless of the first fixed point precision.
An encoding method including:
画像に対する重み付き動き補償予測で用いられる輝度の重み係数の第1固定小数点精度を復号するステップと、
前記第1固定小数点精度と、前記重み付き動き補償予測で用いられる色差の重み係数の第2固定小数点精度との差異と同じ値である、第1差分値を復号するステップと、
前記第1固定小数点精度と前記第1差分値とを加算することにより、前記第2固定小数点精度を決定するステップと、
前記第1固定小数点精度で定められるビット数だけ“1”を左シフトすることによって得られる値と同じ値を、前記輝度の重み係数の第1基準値と決定するステップと、
前記輝度の重み係数と前記第1基準値との差異と同じ値であって、前記第1固定小数点精度によらず−128から+127までの範囲をとりうる値とする、前記輝度の重み係数の第2差分値を復号するステップと、
前記第1基準値と前記第2差分値を加算することにより、前記輝度の重み係数を決定するステップと、
を含む復号方法。
Decoding a first fixed point precision of the luminance weighting factors used in the weighted motion compensated prediction for the image;
Decoding a first difference value that is the same value as the difference between the first fixed-point precision and the second fixed-point precision of the color difference weighting coefficient used in the weighted motion compensation prediction;
Determining the second fixed-point accuracy by adding the first fixed-point accuracy and the first difference value;
Determining the same value as the value obtained by left-shifting "1" by the number of bits determined by the first fixed-point precision as the first reference value of the luminance weighting factor;
Of the luminance weighting factor, which is the same value as the difference between the luminance weighting factor and the first reference value and can take a range of −128 to +127 regardless of the first fixed point precision. Decoding the second difference value;
Determining the weighting coefficient of the brightness by adding the first reference value and the second difference value;
A decoding method including:
JP2018186475A 2018-10-01 2018-10-01 Encoding method and decoding method Active JP6682594B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2018186475A JP6682594B2 (en) 2018-10-01 2018-10-01 Encoding method and decoding method
JP2020011419A JP6903778B2 (en) 2018-10-01 2020-01-28 Storage device, transmitter and receiver

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018186475A JP6682594B2 (en) 2018-10-01 2018-10-01 Encoding method and decoding method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2017232686A Division JP6419934B2 (en) 2017-12-04 2017-12-04 Electronic device, encoding method and program

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2020011419A Division JP6903778B2 (en) 2018-10-01 2020-01-28 Storage device, transmitter and receiver

Publications (2)

Publication Number Publication Date
JP2019017103A JP2019017103A (en) 2019-01-31
JP6682594B2 true JP6682594B2 (en) 2020-04-15

Family

ID=65357034

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018186475A Active JP6682594B2 (en) 2018-10-01 2018-10-01 Encoding method and decoding method

Country Status (1)

Country Link
JP (1) JP6682594B2 (en)

Also Published As

Publication number Publication date
JP2019017103A (en) 2019-01-31

Similar Documents

Publication Publication Date Title
JP5925801B2 (en) Encoding method, decoding method, encoding device, and decoding device
WO2013057783A1 (en) Encoding method and decoding method
JP6419934B2 (en) Electronic device, encoding method and program
JP6262381B2 (en) Electronic device, decoding method and program
JP6682594B2 (en) Encoding method and decoding method
JP6088036B2 (en) Decoding method, decoding apparatus, and program
JP6903778B2 (en) Storage device, transmitter and receiver
JP6262380B2 (en) Electronic device, decoding method and program
JP6744507B2 (en) Encoding method and decoding method
JP6132950B2 (en) Encoding method, decoding method, encoding device, and decoding device
JP5702011B2 (en) Encoding method, encoding apparatus, and program
JP5916906B2 (en) Encoding method, decoding method, encoding device, and decoding device
JP7000498B2 (en) Storage device, transmitter and coding method
JP6396566B2 (en) Electronic device, encoding method and program
JP6235745B2 (en) Electronic device, decoding method and program
JP6235742B2 (en) Electronic device, decoding method and program
JP5869160B2 (en) Decoding method, decoding apparatus, and program
JP2019009792A (en) Encoding method, decoding method and encoded data
JPWO2013057783A1 (en) Encoding method and decoding method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20181001

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190808

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190827

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20191021

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20191105

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20191115

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20200114

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200128

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20200205

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: 20200225

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200325

R151 Written notification of patent or utility model registration

Ref document number: 6682594

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151