JP6679778B2 - Image coding device, image coding method and program, image decoding device, image decoding method and program - Google Patents

Image coding device, image coding method and program, image decoding device, image decoding method and program Download PDF

Info

Publication number
JP6679778B2
JP6679778B2 JP2019030981A JP2019030981A JP6679778B2 JP 6679778 B2 JP6679778 B2 JP 6679778B2 JP 2019030981 A JP2019030981 A JP 2019030981A JP 2019030981 A JP2019030981 A JP 2019030981A JP 6679778 B2 JP6679778 B2 JP 6679778B2
Authority
JP
Japan
Prior art keywords
quantization matrix
image
row
column
matrix
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
JP2019030981A
Other languages
Japanese (ja)
Other versions
JP2019075836A (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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Publication of JP2019075836A publication Critical patent/JP2019075836A/en
Application granted granted Critical
Publication of JP6679778B2 publication Critical patent/JP6679778B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Description

本発明は画像符号化装置、画像符号化方法及びプログラム、画像復号装置、画像復号方法及びプログラムに関し、特に画像中の量子化マトリクスの符号化方法・復号方法に関する。   The present invention relates to an image encoding device, an image encoding method and program, an image decoding device, an image decoding method and program, and more particularly to an encoding method / decoding method for a quantization matrix in an image.

動画像の圧縮記録方法として、H.264/MPEG−4 AVC(以下H.264)が知られている。(非特許文献1)
H.264においてはscaling_list情報を符号化することにより、量子化マトリクスの各要素を任意の値に変更することができる。非特許文献1の7.3.2.1.1.1節の記載によれば、直前の要素に差分値であるdelta_scaleを加算することで量子化マトリクスの各要素は任意の値をとることができる。
As a compression recording method of a moving image, H.264 is used. H.264 / MPEG-4 AVC (hereinafter H.264) is known. (Non-patent document 1)
H. In H.264, each element of the quantization matrix can be changed to an arbitrary value by encoding the scaling_list information. According to the description in Section 7.3.2.1.1.1 of Non-Patent Document 1, each element of the quantization matrix takes an arbitrary value by adding the difference value delta_scale to the immediately preceding element. You can

ITU−T H.264 (03/2010) Advancedvideo coding for generic audiovisual servicesITU-TH. H.264 (03/2010) Advanced video coding for general audiovisual services

H.264においては、二次元の量子化マトリクスの左上の低周波成分にあたる要素から右下の高周波成分にあたる要素の方向に量子化マトリクス内の各要素を走査する。例えば、図6(a)に示される二次元の量子化マトリクスを符号化する場合、図13(a)に示されるジグザグスキャンと呼ばれる走査方法を用いて図6(b)に示される一次元の行列に配置する。そして、行列内の符号化する要素と直前の要素との差分値を計算し、図6(d)に示される差分値の行列を得る。続いて、前述の差分値であるdelta_scaleとして、図5(a)に示されるsigned Exp−Golomb符号と呼ばれる方式を用いて符号化する。例えば、直前の要素と符号化する要素との差分が0であれば二値符号1を符号化し、差分が−2であれば二値符号00101を符号化する。   H. In H.264, each element in the quantization matrix is scanned in the direction from the element corresponding to the low frequency component in the upper left of the two-dimensional quantization matrix to the element corresponding to the high frequency component in the lower right. For example, when the two-dimensional quantization matrix shown in FIG. 6A is encoded, the one-dimensional quantization matrix shown in FIG. 6B is obtained by using the scanning method called zigzag scanning shown in FIG. Place in a matrix. Then, the difference value between the element to be coded in the matrix and the immediately preceding element is calculated, and the matrix of the difference values shown in FIG. 6D is obtained. Subsequently, the delta_scale which is the above-mentioned difference value is encoded using a method called a signed Exp-Golomb code shown in FIG. For example, if the difference between the immediately preceding element and the element to be encoded is 0, the binary code 1 is encoded, and if the difference is -2, the binary code 00101 is encoded.

しかしながら、H.264で用いられているジグザグスキャンでは対角線方向に量子化マトリクスの各要素を走査するため、量子化マトリクスの特性によっては、量子化マトリクスの符号量が多くなってしまうという課題が生じていた。   However, H. In the zigzag scanning used in H.264, since each element of the quantization matrix is scanned in the diagonal direction, there is a problem that the code amount of the quantization matrix increases depending on the characteristics of the quantization matrix.

したがって、本発明は上述した課題を解決するためになされたものであり、高効率の量子化マトリクス符号化・復号を実現することを目的とする。   Therefore, the present invention has been made to solve the above-mentioned problems, and an object thereof is to realize highly efficient quantization matrix encoding / decoding.

上述の問題点を解決するため、本発明の画像符号化装置は以下の構成を有する。すなわち、画像データを符号化する符号化装置であって、符号化対象の画像データを量子化する際に用いる二次元配列で表すことが可能なn行n列(nは4以上の整数)の量子化マトリクスにおける各要素において所定の要素間の差分値を取得する取得手段、を有し、前記取得手段は、前記量子化マトリクスにおける(p+1)行1列目(pは2以上かつn−1以下の整数)に対応する要素と、前記量子化マトリクスにおける1行p列目に対応する要素との差分値を取得し、前記量子化マトリクスにおけるn行q列目(qは2以上かつn−1以下の整数)に対応する要素と、前記量子化マトリクスにおける(q−1)行n列目に対応する要素との差分値を取得し、前記量子化マトリクスにおけるn行n列目に対応する要素と、前記量子化マトリクスにおける(n−1)行n列目に対応する要素との差分値を取得する。   In order to solve the above problems, the image coding apparatus of the present invention has the following configuration. That is, an encoding device that encodes image data, and has n rows and n columns (n is an integer of 4 or more) that can be represented by a two-dimensional array used when quantizing image data to be encoded. An acquisition unit that acquires a difference value between predetermined elements in each element in the quantization matrix, the acquisition unit being the (p + 1) th row and the first column (p is 2 or more and n-1) in the quantization matrix. The difference value between the element corresponding to the following integer) and the element corresponding to the 1st row and the pth column in the quantization matrix is acquired, and the nth row and the qth column (q is 2 or more and n− The difference value between the element corresponding to the (q-1) row and the n-th column in the quantization matrix is acquired and corresponds to the n-th row and the n-th column in the quantization matrix. Elements and the quantization mat Obtaining a difference value between the element corresponding to the (n-1) th row and the n-th column in the box.

また、本発明の画像復号装置は以下の構成を有する。すなわち、ビットストリームから画像データを復号する画像復号装置であって、量子化係数から変換係数を導出する際に用いられる量子化マトリクスであって、n行n列(nは4以上の整数)の量子化マトリクスに含まれる各要素における所定の要素間の差分値を前記ビットストリームから復号する復号手段と、前記復号手段によって復号された複数の差分値における第1番目の差分値と所定の初期値とを加算して第1番目の要素を導出し、前記複数の差分値における第r番目(rは2以上の整数)の差分値と第r−1番目の要素とを加算して第r番目の要素を導出することにより、複数の要素を導出する第1の導出手段と、前記第1の導出手段によって導出された前記複数の要素それぞれを、二次元配列で表わすことが可能な前記量子化マトリクスにおける各要素に対応付ける対応付け手段とを有し、前記対応付け手段は、前記複数の要素の内の第1の要素を前記量子化マトリクスにおける1行p列目(pは2以上かつn−1以下の整数)の要素に対応させる場合、前記第1の要素の次の第2の要素を前記量子化マトリクスにおける(p+1)行1列目の要素に対応させ、前記複数の要素の内の第3の要素を前記量子化マトリクスにおける(q−1)行n列目(qは2以上かつn−1以下の整数)の要素に対応させる場合、前記第3の要素の次の第4の要素を前記量子化マトリクスにおけるn行q列目の要素に対応させ、前記複数の要素の内の最後から2番目の要素を前記量子化マトリクスにおける(n−1)行n列目の要素に対応させ、前記複数の要素の内の最後の要素を前記量子化マトリクスにおけるn行n列目の要素に対応させる。   Further, the image decoding device of the present invention has the following configuration. That is, an image decoding device for decoding image data from a bit stream, which is a quantization matrix used when deriving transform coefficients from quantized coefficients, having n rows and n columns (n is an integer of 4 or more) Decoding means for decoding a difference value between predetermined elements in each element included in the quantization matrix from the bit stream, a first difference value among a plurality of difference values decoded by the decoding means, and a predetermined initial value Is added to derive the first element, and the r-th (r is an integer of 2 or more) difference value in the plurality of difference values and the r-1th element are added to obtain the r-th element. By deriving a plurality of elements by deriving a plurality of elements, and the quantization capable of expressing each of the plurality of elements derived by the first deriving means in a two-dimensional array Ma Associating means for associating each element in the lix with the associating means, wherein the associating means associates the first element of the plurality of elements with the first row and the p-th column (p is 2 or more and n− An integer of 1 or less), the second element next to the first element is made to correspond to the element at the (p + 1) th row and the first column in the quantization matrix, and When the third element is made to correspond to the element of the (q-1) th row and the nth column (q is an integer of 2 or more and n-1 or less) in the quantization matrix, a fourth element next to the third element is assigned. The element corresponds to the element in the n-th row and the q-th column in the quantization matrix, and the penultimate element of the plurality of elements corresponds to the element in the (n-1) -th row and the n-th column in the quantization matrix. The last element of the plurality of elements To correspond to the n-th row and n-th column of elements in the Coca matrix.

本発明により、量子化マトリクス符号化のための符号量を削減し、高効率の符号化・復号が可能になる。   According to the present invention, it is possible to reduce the amount of code for quantization matrix coding and perform highly efficient coding / decoding.

実施形態1における画像符号化装置の構成を示すブロック図FIG. 3 is a block diagram showing the configuration of the image encoding device according to the first embodiment. 実施形態2における画像復号装置の構成を示すブロック図FIG. 3 is a block diagram showing the configuration of an image decoding device according to the second embodiment. 実施形態3における画像符号化装置の構成を示すブロック図FIG. 3 is a block diagram showing the arrangement of an image coding apparatus according to the third embodiment. 実施形態4における画像復号装置の構成を示すブロック図Block diagram showing the configuration of an image decoding apparatus according to a fourth embodiment (a)、(b)正負対称および正負非対称の符号化テーブルの一例を示す図The figure which shows an example of the encoding table of (a), (b) positive / negative symmetry and positive / negative asymmetry. (a)〜(e)量子化マトリクスと差分行列の一例を示す図The figure which shows an example of (a)-(e) quantization matrix and difference matrix. 量子化マトリクスの符号化例を示す図Diagram showing an example of encoding a quantization matrix (a)、(b)ビットストリーム構造の一例を示す図The figure which shows an example of (a), (b) bit stream structure. 実施形態1に係る画像符号化装置における画像符号化処理を示すフローチャートThe flowchart which shows the image coding process in the image coding apparatus which concerns on Embodiment 1. 実施形態2に係る画像復号装置における画像復号処理を示すフローチャートThe flowchart which shows the image decoding process in the image decoding apparatus which concerns on Embodiment 2. 実施形態3に係る画像符号化装置における画像符号化処理を示すフローチャートThe flowchart which shows the image coding process in the image coding apparatus which concerns on Embodiment 3. 実施形態4に係る画像復号装置における画像復号処理を示すフローチャートThe flowchart which shows the image decoding process in the image decoding apparatus which concerns on Embodiment 4. (a)〜(e)量子化マトリクスの係数の走査方法および差分算出方法の例を示す図(A)-(e) The figure which shows the example of the scanning method of the coefficient of a quantization matrix, and the difference calculation method. 本発明の画像符号化装置、復号装置に適用可能なコンピュータのハードウェアの構成例を示すブロック図Block diagram showing a configuration example of computer hardware applicable to the image encoding device and the decoding device of the present invention 実施形態5および実施形態6における量子化マトリクスの符号化例を示す図The figure which shows the example of encoding of the quantization matrix in Embodiment 5 and Embodiment 6. (a)〜(c) 実施形態5および実施形態6における量子化マトリクスの係数の走査方法および差分算出方法の例を示す図(A)-(c) The figure which shows the example of the scanning method and difference calculation method of the coefficient of a quantization matrix in Embodiment 5 and Embodiment 6. (a)〜(c) 実施形態5および実施形態6における量子化マトリクスと差分行列の一例を示す図(A)-(c) The figure which shows an example of the quantization matrix and difference matrix in Embodiment 5 and Embodiment 6. (a)、(b) 実施形態7および実施形態8における量子化マトリクスの係数の走査方法の例を示す図(A), (b) The figure which shows the example of the scanning method of the coefficient of the quantization matrix in Embodiment 7 and Embodiment 8. (a)、(b) 実施形態7および実施形態8における量子化マトリクスと差分行列の例を示す図(A), (b) The figure which shows the example of the quantization matrix and difference matrix in Embodiment 7 and Embodiment 8. (a)〜(d) 実施形態7および実施形態8における量子化マトリクスの係数の走査方法の例を示す図(A)-(d) The figure which shows the example of the scanning method of the coefficient of the quantization matrix in Embodiment 7 and Embodiment 8.

以下、添付の図面を参照して、本願発明をその好適な実施形態に基づいて詳細に説明する。なお、以下の実施形態において示す構成は一例に過ぎず、本発明は図示された構成に限定されるものではない。   Hereinafter, the present invention will be described in detail based on its preferred embodiments with reference to the accompanying drawings. The configurations shown in the following embodiments are merely examples, and the present invention is not limited to the illustrated configurations.

また、本発明では、本発明では、図13(b)に示される二次元のマトリクスの走査方法を水平スキャンと呼称し、図13(d)に示される二次元のマトリクスの走査方法を垂直スキャンと呼称する。   Further, in the present invention, in the present invention, the scanning method of the two-dimensional matrix shown in FIG. 13B is called horizontal scanning, and the scanning method of the two-dimensional matrix shown in FIG. 13D is vertical scan. I call it.

<実施形態1>
以下、本発明の実施形態を、図面を用いて説明する。図1は本実施形態の画像符号化装置を示すブロック図である。
<Embodiment 1>
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing an image coding apparatus according to this embodiment.

図1において、101は入力画像を複数のブロックに分割するブロック分割部である。   In FIG. 1, reference numeral 101 is a block division unit that divides an input image into a plurality of blocks.

102はブロック分割部101で分割された各ブロックを、ブロック単位で予測を行い、予測方法を決定し、それに従って差分値算出を行い、予測誤差を算出する予測部である。静止画または動画の場合のイントラフレームではイントラ予測を行い、動画の場合は動き補償予測も行うものとする。イントラ予測は一般的には、周囲の画素データから予測値を算出するために、複数の参照方法の中から最適なものを予測方法として選択することで実現する。   Reference numeral 102 denotes a prediction unit that predicts each block divided by the block division unit 101 in block units, determines a prediction method, calculates a difference value according to the prediction method, and calculates a prediction error. Intra prediction is performed for intra frames in the case of still images or moving images, and motion compensation prediction is also performed for moving images. Intra prediction is generally realized by selecting an optimal prediction method from among a plurality of reference methods in order to calculate a prediction value from surrounding pixel data.

103は各ブロックの予測誤差に対して直交変換を行う変換部であり、入力されたブロックサイズまたはそれを細分化したブロックサイズを単位に直交変換を行い、直交変換係数を算出する。以下では直交変換を行うブロックを変換ブロックと呼称する。直交変換に関しては特に限定しないが、離散コサイン変換やアダマール変換等を用いてもよい。また、本実施形態では説明のため、8×8画素のブロック単位の予測誤差を縦横2分割し、4×4画素の変換ブロック単位で直交変換を行うものとするが、変換ブロックの大きさ、形状はこれに限定されない。ブロックと同一の大きさの変換ブロックを用いて直交変換を行っても良いし、ブロックを縦横2分割よりもさらに細かい単位で分割した変換ブロックを用いて直交変換を行っても良い。   Reference numeral 103 denotes a transform unit that performs orthogonal transform on the prediction error of each block, and performs orthogonal transform in units of the input block size or the block size obtained by subdividing the input block size to calculate orthogonal transform coefficients. Hereinafter, the block that performs the orthogonal transform is referred to as a transform block. The orthogonal transform is not particularly limited, but discrete cosine transform, Hadamard transform, or the like may be used. Further, in the present embodiment, for the sake of explanation, it is assumed that the prediction error in block units of 8 × 8 pixels is vertically and horizontally divided into two, and orthogonal transformation is performed in transform block units of 4 × 4 pixels. The shape is not limited to this. Orthogonal transform may be performed using a transform block having the same size as the block, or orthogonal transform may be performed using a transform block obtained by dividing the block into units finer than the vertical and horizontal two-division.

106は量子化マトリクスを生成し、格納する量子化マトリクス保持部である。格納される量子化マトリクスの生成方法については特に限定しないが、ユーザが量子化マトリクスを入力しても良いし、入力画像の特性から算出しても、初期値としてあらかじめ指定されたものを使用してももちろん良い。本実施形態では、図6(a)に示されるような4×4画素の変換ブロックに対応した二次元の量子化マトリクスが生成され、格納されるものとする。   A quantization matrix holding unit 106 generates and stores a quantization matrix. The generation method of the stored quantization matrix is not particularly limited, but the user may input the quantization matrix or calculate it from the characteristics of the input image, and use the one specified in advance as the initial value. But of course it's good. In the present embodiment, it is assumed that a two-dimensional quantization matrix corresponding to a conversion block of 4 × 4 pixels as shown in FIG. 6A is generated and stored.

104は量子化マトリクス保持部106に格納された量子化マトリクスによって、前記直交変換係数を量子化する量子化部である。この量子化によって量子化係数を得ることができる。   A quantization unit 104 quantizes the orthogonal transform coefficient by the quantization matrix stored in the quantization matrix holding unit 106. A quantization coefficient can be obtained by this quantization.

105はこのようにして得られた量子化係数を、符号化して量子化係数符号データを生成する係数符号化部である。符号化の方法は特に限定しないが、ハフマン符号や算術符号などを用いることができる。   Reference numeral 105 denotes a coefficient coding unit that codes the quantized coefficient thus obtained to generate quantized coefficient code data. The encoding method is not particularly limited, but Huffman code, arithmetic code, or the like can be used.

109は量子化マトリクス保持部106に格納された二次元の量子化マトリクスを走査して各要素の差分を計算し、一次元の行列に配置する量子化マトリクス走査部である。本特許では、この一次元の行列に配置された差分を差分行列と呼称する。   A quantization matrix scanning unit 109 scans the two-dimensional quantization matrix stored in the quantization matrix holding unit 106 to calculate the difference between each element and arranges the difference in a one-dimensional matrix. In this patent, the difference arranged in this one-dimensional matrix is referred to as a difference matrix.

107は量子化マトリクス走査部109によって一次元の行列となった差分行列を符号化して、量子化マトリクス符号データを生成する量子化マトリクス符号化部である。108はヘッダ情報や予測、変換に関する符号を生成するとともに、係数符号化部105で生成された量子化係数符号データおよび量子化マトリクス符号化部107で生成された量子化マトリクス符号データを統合する統合符号化部である。予測、変換に関する符号とは、例えば選択した予測方法や変換ブロックの分割の様子等の符号であるとする。   A quantization matrix encoding unit 107 encodes the difference matrix that has become a one-dimensional matrix by the quantization matrix scanning unit 109 to generate quantization matrix code data. An integration unit 108 generates header information, a code relating to prediction and conversion, and integrates the quantized coefficient code data generated by the coefficient coding unit 105 and the quantization matrix code data generated by the quantization matrix coding unit 107. It is an encoding unit. The code related to prediction and conversion is, for example, a code such as the selected prediction method or the state of division of a conversion block.

上記画像符号化装置における画像の符号化動作を以下に説明する。本実施形態では動画像データをフレーム単位に入力する構成となっているが、1フレーム分の静止画像データを入力する構成としても構わない。また、本実施形態では、説明を容易にするため、イントラ予測符号化の処理のみを説明するが、これに限定されずインター予測符号化の処理においても適用可能である。本実施形態では説明のため、ブロック分割部101においては8×8画素のブロックに分割するものとして説明するが、これに限定されない。   An image encoding operation in the image encoding device will be described below. In the present embodiment, moving image data is input in frame units, but still image data for one frame may be input. Further, in the present embodiment, for the sake of simplicity of description, only the intra prediction coding process will be described, but the present invention is not limited to this and is also applicable to the inter prediction coding process. In the present embodiment, for the sake of explanation, the block division unit 101 is described as being divided into blocks of 8 × 8 pixels, but the present invention is not limited to this.

次に、画像の符号化に先立ち、量子化マトリクスの要素の符号化を行う。最初に、量子化マトリクス保持部106は量子化マトリクスを生成する。符号化を行うブロックサイズに応じて、量子化マトリクスが決定される。量子化マトリクスの要素の決定方法はとくに限定しない。例えば、所定の初期値を用いても良いし、個別に設定しても良い。また、画像の特性に応じて設定生成されても構わない。   Next, the elements of the quantization matrix are encoded prior to encoding the image. First, the quantization matrix holding unit 106 generates a quantization matrix. The quantization matrix is determined according to the block size to be encoded. The method of determining the elements of the quantization matrix is not particularly limited. For example, a predetermined initial value may be used or may be set individually. Alternatively, the setting may be generated according to the characteristics of the image.

量子化マトリクス保持部106には、このようにして生成された量子化マトリクスが保持されている。図6(a)は4×4画素の変換ブロックに対応する量子化マトリクスの一例である。太枠の600は、量子化マトリクスを表している。説明を簡易にするため、4×4画素の変換ブロックに対応した16画素分の構成とし、太枠内の各正方形は要素を表しているものとする。本実施形態では、図6(a)に示された量子化マトリクスが二次元形状で保持されているものとするが、量子化マトリクス内の要素はもちろんこれに限定されない。例えば、本実施形態に加えて8×8画素の変換ブロックサイズも用いる場合には、8×8画素変換ブロックに対応する他の量子化マトリクスを保持することになる。   The quantization matrix holding unit 106 holds the quantization matrix thus generated. FIG. 6A is an example of a quantization matrix corresponding to a conversion block of 4 × 4 pixels. A thick frame 600 represents a quantization matrix. In order to simplify the explanation, it is assumed that the configuration is 16 pixels corresponding to a conversion block of 4 × 4 pixels, and that each square in the thick frame represents an element. In the present embodiment, it is assumed that the quantization matrix shown in FIG. 6A is held in a two-dimensional shape, but the elements in the quantization matrix are not limited to this. For example, when a transform block size of 8 × 8 pixels is also used in addition to this embodiment, another quantization matrix corresponding to the 8 × 8 pixel transform block is held.

量子化マトリクス走査部109は二次元形状で格納されている量子化マトリクスを量子化マトリクス保持部106から順に読み出し、各要素を走査して差分を計算し、一次元の行列に配置する。本実施形態では、図13(d)に示された垂直スキャンを用いるものとし、要素ごとに走査順に直前の要素との差分を計算するものするが、走査方法および差分の計算方法はこれに限定されない。図13(b)に示された水平スキャンを用いて、要素ごとに走査順に直前の要素との差分を計算しても良い。また図13(b)の走査方法を用いつつ、図13(c)に示されたように左端の要素の差分だけは上の要素との差分を計算し、それ以外は図13(b)同様直前の要素との差分を計算しても良い。また、図13(d)の走査方法を用いつつ、図13(e)に示されたように上端の要素の差分だけは左の要素との差分を計算し、それ以外は図13(d)同様直前の要素との差分を計算しても良い。本実施形態では、図6(a)に示される二次元形状の量子化マトリクスを図13(d)に示される垂直スキャンを用いて走査し、それぞれの要素と直前の要素との差分を計算して図6(e)に示される差分行列を生成するものとする。また、行列の最初の要素に対応する差分値は所定の初期値との差分を計算するものとし、本実施形態では初期値を8とするが、もちろんこれに限定されず、任意の値をとったり最初の要素の値そのものを用いたりしても良い。   The quantization matrix scanning unit 109 sequentially reads the quantization matrix stored in the two-dimensional shape from the quantization matrix holding unit 106, scans each element, calculates the difference, and arranges it in a one-dimensional matrix. In this embodiment, the vertical scan shown in FIG. 13D is used, and the difference between each element and the immediately preceding element is calculated in the scanning order, but the scanning method and the difference calculation method are limited to this. Not done. The horizontal scan shown in FIG. 13B may be used to calculate the difference between each element and the immediately preceding element in the scanning order. Also, while using the scanning method of FIG. 13B, only the difference of the leftmost element is calculated as the difference from the upper element as shown in FIG. 13C, and otherwise the same as in FIG. 13B. You may calculate the difference with the last element. Further, while using the scanning method of FIG. 13D, as shown in FIG. 13E, only the difference between the elements at the upper end is calculated as the difference from the element on the left, and other than that, FIG. Similarly, the difference from the immediately preceding element may be calculated. In the present embodiment, the two-dimensional shape quantization matrix shown in FIG. 6A is scanned using the vertical scan shown in FIG. 13D, and the difference between each element and the immediately preceding element is calculated. The difference matrix shown in FIG. 6E is generated. Further, the difference value corresponding to the first element of the matrix is calculated as a difference from a predetermined initial value, and the initial value is set to 8 in the present embodiment, but it is not limited to this and may take an arbitrary value. The value of the first element itself may be used.

量子化マトリクス符号化部107は前記差分行列を量子化マトリクス走査部109から順に読み出し、符号化して量子化マトリクス符号データを生成する。本実施形態では、図5(a)に示される符号化テーブルを用いて符号化するものとするが、符号化テーブルはこれに限定されず、例えば図5(b)に示されるような符号化テーブルを用いても良い。   The quantization matrix coding unit 107 sequentially reads the difference matrix from the quantization matrix scanning unit 109 and codes the difference matrix to generate quantization matrix code data. In the present embodiment, it is assumed that the coding is performed using the coding table shown in FIG. 5A, but the coding table is not limited to this, and for example, the coding as shown in FIG. You may use a table.

図7は、図6(a)に示された量子化マトリクスを図13(a)、図13(d)の各走査方法を用いて差分行列を計算し、図5(a)の符号化テーブルで符号化した際の例を示している。図7の要素の行は図6(a)の量子化マトリクスの各要素を走査したものを示しており、差分値の行は所定の初期値8および直前の要素との差分値を示している。ジグザグスキャンの行は図13(a)で示された従来手法のジグザグスキャンを用いた場合の符号を示しており、合計68ビットが必要となる。一方、垂直スキャンの行は図13(d)で示された垂直スキャンを用いた場合の符号を示しており、合計60ビットが必要であり、本実施形態ではより少ない符号量で同一の量子化マトリクスを符号化できる。このようにして生成された量子化マトリクスの符号データは統合符号化部108に入力される。統合符号化部108では画像データの符号化に必要なヘッダ情報を符号化し、量子化マトリクスの符号データを統合する。   FIG. 7 shows the encoding matrix of FIG. 5A obtained by calculating the difference matrix of the quantization matrix shown in FIG. 6A using each scanning method of FIGS. 13A and 13D. An example when encoded with is shown. The row of elements in FIG. 7 shows a scan of each element of the quantization matrix of FIG. 6A, and the row of difference values shows the predetermined initial value 8 and the difference value with the immediately preceding element. . The zigzag scan row shows the code when the zigzag scan of the conventional method shown in FIG. 13A is used, and a total of 68 bits are required. On the other hand, the row of the vertical scan shows the code when the vertical scan shown in FIG. 13D is used, and a total of 60 bits are required. In the present embodiment, the same quantization is performed with a smaller code amount. The matrix can be encoded. The coded data of the quantization matrix thus generated is input to the integrated coding unit 108. The integrated coding unit 108 codes the header information necessary for coding the image data, and integrates the coded data of the quantization matrix.

続いて、画像データの符号化が行われる。1フレーム分の画像データはブロック分割部101に入力され、8×8画素のブロック単位に分割される。分割された画像データは予測部102に入力される。   Subsequently, the image data is encoded. The image data for one frame is input to the block division unit 101 and divided into blocks of 8 × 8 pixels. The divided image data is input to the prediction unit 102.

予測部102ではブロック単位の予測が行われ、予測誤差が生成される。変換部103では、予測部102で生成された予測誤差を変換ブロックサイズに分割して直交変換を行い、直交変換係数を生成する。そして、直交変換係数を量子化部104に入力する。本実施形態では、8×8画素のブロック単位の予測誤差を4×4画素の変換ブロック単位に分割して直交変換を行うものとする。   The prediction unit 102 performs block-by-block prediction and generates a prediction error. The transform unit 103 divides the prediction error generated by the prediction unit 102 into transform block sizes, performs orthogonal transform, and generates orthogonal transform coefficients. Then, the orthogonal transform coefficient is input to the quantization unit 104. In the present embodiment, it is assumed that the prediction error in block units of 8 × 8 pixels is divided into transform block units of 4 × 4 pixels and orthogonal transform is performed.

図1に戻り、量子化部104では、変換部103から出力された直交変換係数を量子化マトリクス保持部106に格納されている量子化マトリクスを用いて量子化して量子化係数を生成する。生成された量子化係数は係数符号化部105に入力される。   Returning to FIG. 1, the quantization unit 104 quantizes the orthogonal transform coefficient output from the transform unit 103 using the quantization matrix stored in the quantization matrix holding unit 106 to generate a quantized coefficient. The generated quantized coefficient is input to the coefficient coding unit 105.

係数符号化部105では、量子化部104で生成された量子化係数を符号化し、量子化係数符号データを生成して統合符号化部108に出力する。統合符号化部108はブロック単位で予測、変換に関する符号を生成し、前記ヘッダの符号化データとともに、ブロック単位の符号、係数符号化部105で生成された量子化係数符号データを統合し、ビットストリームを生成し出力する。   The coefficient coding unit 105 codes the quantized coefficient generated by the quantization unit 104, generates quantized coefficient code data, and outputs the quantized coefficient code data to the integrated coding unit 108. The integrated coding unit 108 generates a code relating to prediction and conversion in block units, integrates the coded data in the header, the coded data in block units, and the quantized coefficient coded data generated in the coefficient coding unit 105 into bits. Generate and output a stream.

図8(a)は実施形態1で出力されるビットストリームの一例である。シーケンスヘッダに量子化マトリクスの符号データが含まれ、各要素の符号化結果で構成されている。但し、符号化の位置はこれに限定されない。ピクチャヘッダ部やその他のヘッダ部に符号化される構成をとってももちろん構わない。また、1つのシーケンスの中で量子化マトリクスの変更を行う場合、量子化マトリクスを新たに符号化することで更新することも可能である。この際、全ての量子化マトリクスを書き換えても良いし、書き換える量子化マトリクスの走査方法と変換ブロックサイズを指定することでその一部を変更するようにすることも可能である。   FIG. 8A is an example of the bit stream output in the first embodiment. The sequence header includes the coded data of the quantization matrix, and is composed of the coding result of each element. However, the coding position is not limited to this. Of course, the picture header section and other header sections may be encoded. When the quantization matrix is changed in one sequence, it is possible to update it by newly encoding the quantization matrix. At this time, all the quantization matrices may be rewritten, or a part of them may be changed by designating the scanning method of the rewritten quantization matrix and the conversion block size.

図9は実施形態1に係る画像符号化装置における画像符号化処理を示すフローチャートである。まず、ステップS901にて、量子化マトリクス保持部106は量子化マトリクスを生成する。   FIG. 9 is a flowchart showing an image coding process in the image coding apparatus according to the first embodiment. First, in step S901, the quantization matrix holding unit 106 generates a quantization matrix.

ステップS902にて、量子化マトリクス走査部109はステップS901で生成された量子化マトリクスを走査して各要素の差分を算出し、差分行列を生成する。本実施形態では、図6(a)に示される量子化マトリクスを図13(d)に示される走査方法で走査し、図6(e)に示される差分行列を生成するものとするが、量子化マトリクスや走査方法はこれらに限定されない。   In step S902, the quantization matrix scanning unit 109 scans the quantization matrix generated in step S901, calculates the difference between each element, and generates a difference matrix. In the present embodiment, the quantization matrix shown in FIG. 6A is scanned by the scanning method shown in FIG. 13D to generate the difference matrix shown in FIG. 6E. The conversion matrix and scanning method are not limited to these.

ステップS903にて、量子化マトリクス符号化部107はステップS902で生成された差分行列を符号化する。本実施形態では、量子化マトリクス符号化部107は図6(e)に示される差分行列を、図5(a)に示される符号化テーブルを用いて符号化されるものとするが、使用される符号化テーブルはこれに限定されない。   In step S903, the quantization matrix coding unit 107 codes the difference matrix generated in step S902. In the present embodiment, the quantization matrix encoding unit 107 is assumed to encode the difference matrix shown in FIG. 6E using the encoding table shown in FIG. The encoding table according to the present invention is not limited to this.

ステップS904にて、統合符号化部108はビットストリームのヘッダ部の符号化を行い出力する。ステップS905にて、ブロック分割部101は、フレーム単位の入力画像をブロック単位に分割する。ステップS906にて、予測部102はブロック単位の予測を行い、予測誤差を生成する。   In step S904, the integrated encoding unit 108 encodes and outputs the header portion of the bitstream. In step S905, the block division unit 101 divides the input image in frame units into block units. In step S906, the prediction unit 102 performs prediction in block units and generates a prediction error.

ステップS907にて、変換部103はステップS906で生成された予測誤差に対して変換ブロックサイズに分割して直交変換を行い、直交変換係数を生成する。ステップS908にて、量子化部104はステップS907で生成された直交変換係数を、ステップS901で生成されて量子化マトリクス保持部106に格納された量子化マトリクスを用いて量子化して量子化係数を生成する。   In step S907, the transform unit 103 divides the prediction error generated in step S906 into transform block sizes, performs orthogonal transform, and generates orthogonal transform coefficients. In step S908, the quantization unit 104 quantizes the orthogonal transform coefficient generated in step S907 using the quantization matrix generated in step S901 and stored in the quantization matrix holding unit 106 to obtain the quantized coefficient. To generate.

ステップS909にて、係数符号化部105はステップS908で生成された量子化係数を符号化し、量子化係数符号データを生成する。ステップS910にて、画像符号化装置は、当該ブロック内の全ての変換ブロックの符号化が終了したか否かの判定を行い、終了していればステップS911に進み、終了していなければ次の変換ブロックを対象としてステップS907に戻る。   In step S909, the coefficient coding unit 105 codes the quantized coefficient generated in step S908 to generate quantized coefficient coded data. In step S910, the image coding apparatus determines whether or not coding of all transform blocks in the block has been completed. If completed, the process proceeds to step S911, and if not completed, the next The process returns to step S907 for the conversion block.

ステップS911にて、画像符号化装置は、全てのブロックの符号化が終了したか否かの判定を行い、終了していれば全ての動作を停止して処理を終了し、そうでなければ次のブロックを対象としてステップS905に戻る。   In step S911, the image coding apparatus determines whether or not coding of all blocks is completed, and if completed, stops all operations and ends the processing. The process returns to step S905 for the block.

以上の構成と動作により、特にステップS902に示した量子化マトリクスを単方向走査して差分行列を算出する処理により、量子化マトリクスの符号量がより少ないビットストリームを生成することができる。   With the above configuration and operation, in particular, the bitstream having a smaller code amount of the quantization matrix can be generated by the processing of unidirectionally scanning the quantization matrix shown in step S902 to calculate the difference matrix.

なお、本実施形態においては、イントラ予測のみを用いるフレームを例にとって説明したが、インター予測を使用できるフレームにおいても対応できることは明らかである。   It should be noted that, in the present embodiment, a frame using only intra prediction has been described as an example, but it is obvious that a frame that can use inter prediction can also be applied.

さらに、本実施形態では説明のためにブロックを8×8画素、変換ブロックを4×4画素としたが、これに限定されない。例えば16×16画素や32×32画素などのブロックサイズへの変更が可能であり、また、ブロックの形状も正方形に限定されず、16×8画素などの長方形でも良い。   Furthermore, in the present embodiment, the blocks are 8 × 8 pixels and the conversion blocks are 4 × 4 pixels for the sake of explanation, but the present invention is not limited to this. For example, the block size can be changed to 16 × 16 pixels, 32 × 32 pixels, or the like, and the shape of the block is not limited to a square, and may be a rectangle of 16 × 8 pixels.

また、変換ブロックサイズはブロックサイズの縦横それぞれ半分としたが、同じ大きさでも構わないし、縦横それぞれ半分よりもさらに細かいサイズでももちろん構わない。   Further, although the conversion block size is half the block size in each of the vertical and horizontal directions, it may be the same size or may be a size smaller than the vertical and horizontal halves.

また、本実施形態では、差分行列を一旦生成して符号化する構成をとったが、量子化マトリクス符号化部107が量子化マトリクスから所定の走査方法を用いて直接差分値を算出して符号化する構成をとっても良い。その場合、量子化マトリクス走査部109は省略可能である。   In the present embodiment, the difference matrix is once generated and encoded. However, the quantization matrix encoding unit 107 directly calculates the difference value from the quantization matrix using a predetermined scanning method and encodes the difference value. It is also possible to adopt a configuration that realizes. In that case, the quantization matrix scanning unit 109 can be omitted.

また、直交変換係数の走査方法に応じて異なる量子化マトリクスを備えて適応する場合、直交変換係数の走査方法に応じて量子化マトリクスの要素の走査方法を決定しても良い。
また、本実施形態では量子化マトリクスが1つの場合について説明したが、これに限定されない。例えば、輝度・色度で異なる量子化マトリクスを設ける場合、共通の量子化マトリクス走査方法を用いても構わないし、個別に設けても構わない。
Further, when different quantization matrices are provided and adapted depending on the scanning method of the orthogonal transform coefficient, the scanning method of the elements of the quantization matrix may be determined according to the scanning method of the orthogonal transform coefficient.
Further, although the case where there is one quantization matrix has been described in the present embodiment, the present invention is not limited to this. For example, in the case of providing different quantization matrices depending on luminance and chromaticity, a common quantization matrix scanning method may be used or they may be provided individually.

<実施形態2>
図2は、本発明の実施形態2に係る画像復号装置の構成を示すブロック図である。本実施形態では、実施形態1で生成されたビットストリームの復号について説明する。
<Embodiment 2>
FIG. 2 is a block diagram showing the configuration of the image decoding apparatus according to the second embodiment of the present invention. In this embodiment, decoding of the bitstream generated in the first embodiment will be described.

図2において、201は入力されたビットストリームのヘッダ情報を復号し、ビットストリームから必要な符号を分離して後段へ出力する復号・分離部である。復号・分離部201は図1の統合符号化部108と逆の動作を行う。206はビットストリームのヘッダ情報から量子化マトリクス符号データを復号し、差分行列を生成する量子化マトリクス復号部である。   In FIG. 2, 201 is a decoding / separating unit that decodes the header information of the input bitstream, separates the necessary code from the bitstream, and outputs the code to the subsequent stage. The decoding / separating unit 201 performs an operation reverse to that of the integrated encoding unit 108 in FIG. A quantization matrix decoding unit 206 decodes the quantization matrix coded data from the header information of the bit stream to generate a difference matrix.

208は量子化マトリクス復号部206で生成された差分行列を逆走査して量子化マトリクスを再生する量子化マトリクス逆走査部である。量子化マトリクス逆走査部208は図1の量子化マトリクス走査部109と逆の動作を行う。207は量子化マトリクス逆走査部208で再生された量子化マトリクスを格納しておく量子化マトリクス保持部である。   Reference numeral 208 denotes a quantization matrix reverse scanning unit that reversely scans the difference matrix generated by the quantization matrix decoding unit 206 to reproduce the quantization matrix. The quantization matrix reverse scanning unit 208 performs an operation reverse to that of the quantization matrix scanning unit 109 of FIG. A quantization matrix holding unit 207 stores the quantization matrix reproduced by the quantization matrix reverse scanning unit 208.

一方、202は復号・分離部201で分離された符号から量子化係数符号を復号し、量子化係数を再生する係数復号部である。203は量子化マトリクス保持部207に格納された量子化マトリクスを用いて量子化係数に逆量子化を行い、直交変換係数を再生する逆量子化部である。204は図1の変換部103の逆となる逆直交変換を行い、予測誤差を再生する逆変換部である。205は予測誤差と復号済みの画像データからブロックの画像データを再生する予測再構成部である。   On the other hand, 202 is a coefficient decoding unit that decodes the quantized coefficient code from the code separated by the decoding / separation unit 201 and reproduces the quantized coefficient. Reference numeral 203 denotes an inverse quantization unit that inversely quantizes the quantized coefficient using the quantization matrix stored in the quantization matrix holding unit 207 and reproduces the orthogonal transform coefficient. An inverse transform unit 204 performs an inverse orthogonal transform that is the inverse of the transform unit 103 in FIG. 1 and reproduces a prediction error. Reference numeral 205 denotes a prediction reconstructing unit that reproduces the block image data from the prediction error and the decoded image data.

上記画像復号装置における画像の復号動作を以下に説明する。本実施形態では実施形態1で生成された動画像ビットストリームをフレーム単位で入力する構成となっているが、1フレーム分の静止画像ビットストリームを入力する構成としても構わない。また、本実施形態では説明を容易にするため、イントラ予測復号処理のみを説明するが、これに限定されずインター予測復号処理においても適用可能である。   The image decoding operation in the image decoding apparatus will be described below. In the present embodiment, the moving image bitstream generated in the first embodiment is input in frame units, but a still image bitstream for one frame may be input. Further, in the present embodiment, only the intra-prediction decoding process is described for ease of description, but the present invention is not limited to this and is also applicable to the inter-prediction decoding process.

図2において、入力された1フレーム分のビットストリームは復号・分離部201に入力され、画像を再生するのに必要なヘッダ情報が復号され、さらに後段で使用される符号が分離され出力される。ヘッダ情報に含まれる量子化マトリクス符号データは量子化マトリクス復号部206に入力され、一次元の差分行列が再生される。この時、本実施形態では、図5(a)に示される復号テーブルを用いて量子化マトリクスの各要素の差分値を復号し、差分行列が再生されるものとするが、使用される復号テーブルはこれに限定されない。再生された差分行列は量子化マトリクス逆走査部208に入力される。   In FIG. 2, the input bit stream for one frame is input to the decoding / separation unit 201, the header information necessary for reproducing the image is decoded, and the code used in the subsequent stage is separated and output. . The quantization matrix coded data included in the header information is input to the quantization matrix decoding unit 206, and the one-dimensional difference matrix is reproduced. At this time, in the present embodiment, it is assumed that the difference value of each element of the quantization matrix is decoded by using the decoding table shown in FIG. Is not limited to this. The reproduced difference matrix is input to the quantization matrix inverse scanning unit 208.

量子化マトリクス逆走査部208に入力された差分行列は、それぞれの差分値から量子化マトリクスの各要素を算出し、それを逆走査して二次元の量子化マトリクスを再生する。再生された量子化マトリクスは量子化マトリクス保持部207に入力され、格納される。また、復号・分離部201で分離された符号のうち、量子化係数符号データは係数復号部202に入力される。まず、係数復号部202は変換ブロックごとに量子化係数符号データを復号し、量子化係数を再生し、逆量子化部203に出力する。   The difference matrix input to the quantization matrix inverse scanning unit 208 calculates each element of the quantization matrix from each difference value, and inversely scans it to reproduce a two-dimensional quantization matrix. The reproduced quantization matrix is input to and stored in the quantization matrix holding unit 207. Further, among the codes separated by the decoding / separation unit 201, the quantized coefficient code data is input to the coefficient decoding unit 202. First, the coefficient decoding unit 202 decodes the quantized coefficient code data for each transform block, reproduces the quantized coefficient, and outputs the quantized coefficient to the inverse quantization unit 203.

逆量子化部203は、係数復号部202で再生された量子化係数および量子化マトリクス保持部207に格納されている量子化マトリクスを入力する。そして、前記量子化マトリクスを用いて逆量子化を行い、直交変換係数を再生し、逆変換部204に出力する。逆変換部204は、直交変換係数を入力し、図1の変換部103の逆となる逆直交変換を行い、予測誤差を再生し、予測再構成部205に出力する。予測再構成部205は、入力された予測誤差に復号済みの周囲の画素データから予測を行ってブロック単位の画像データを再生し、出力する。   The inverse quantization unit 203 inputs the quantized coefficient reproduced by the coefficient decoding unit 202 and the quantization matrix stored in the quantization matrix holding unit 207. Then, inverse quantization is performed using the quantization matrix to reproduce the orthogonal transform coefficient and output to the inverse transform unit 204. The inverse transform unit 204 inputs the orthogonal transform coefficient, performs the inverse orthogonal transform that is the inverse of the transform unit 103 in FIG. 1, reproduces the prediction error, and outputs the prediction error to the prediction reconstruction unit 205. The prediction reconstructing unit 205 performs prediction from the decoded surrounding pixel data to the input prediction error, reproduces block-unit image data, and outputs the image data.

図10は、実施形態2に係る画像復号装置における画像復号処理を示すフローチャートである。   FIG. 10 is a flowchart showing an image decoding process in the image decoding device according to the second embodiment.

まず、ステップS1001にて、復号・分離部201がヘッダ情報を復号し、符号を後段に出力するために分離する。ステップS1002にて、量子化マトリクス復号部206はヘッダ情報に含まれる量子化マトリクス符号データを、図5(a)に示される復号テーブルを用いて復号し、量子化マトリクス再生に必要な差分行列を生成する。ステップS1003にて、量子化マトリクス逆走査部208はステップS1002で生成された差分行列から量子化マトリクスの各要素を算出し、それを逆走査して二次元の量子化マトリクスを再生する。   First, in step S1001, the decoding / separation unit 201 decodes the header information and separates the code for output to the subsequent stage. In step S1002, the quantization matrix decoding unit 206 decodes the quantization matrix coded data included in the header information by using the decoding table shown in FIG. 5A, and obtains the difference matrix necessary for the quantization matrix reproduction. To generate. In step S1003, the quantization matrix inverse scanning unit 208 calculates each element of the quantization matrix from the difference matrix generated in step S1002, and inversely scans it to reproduce a two-dimensional quantization matrix.

ステップS1004にて、係数復号部202は変換ブロック単位で量子化係数符号データを復号し、量子化係数を再生する。ステップS1005にて、逆量子化部203はステップS1003で再生された量子化マトリクスを用いてステップS1004にて再生された量子化係数を逆量子化し、直交変換係数を再生する。ステップS1006にて、逆変換部204はステップS1005で再生された直交変換係数に対し、逆直交変換を行い、予測誤差を再生する。ステップS1007にて、画像復号装置は、当該ブロック内の全ての変換ブロックの復号が終了したか否かの判定を行い、終了していればステップS1008に進み、終了していなければ次の変換ブロックを対象としてステップS1004に戻る。   In step S1004, the coefficient decoding unit 202 decodes the quantized coefficient code data in units of transform block, and reproduces the quantized coefficient. In step S1005, the dequantization unit 203 dequantizes the quantized coefficient regenerated in step S1004 using the quantized matrix regenerated in step S1003, and regenerates the orthogonal transform coefficient. In step S1006, the inverse transform unit 204 performs inverse orthogonal transform on the orthogonal transform coefficient regenerated in step S1005 to regenerate the prediction error. In step S1007, the image decoding apparatus determines whether or not decoding of all conversion blocks in the block is completed. If completed, the process proceeds to step S1008, and if not completed, the next conversion block is completed. Then, the process returns to step S1004.

ステップS1008にて、予測再構成部205は復号済みの周囲の画素データから予測を行い、ステップS1006で再生された予測誤差に加算して、ブロックの復号画像を再生する。ステップS1009にて、画像復号装置は、全てのブロックの復号が終了したか否かの判定を行い、終了していれば全ての動作を停止して処理を終了し、そうでなければ次のブロックを対象として、ステップS1003に戻る。   In step S1008, the prediction reconstruction unit 205 performs prediction from the decoded surrounding pixel data, adds the prediction to the prediction error reproduced in step S1006, and reproduces the decoded image of the block. In step S1009, the image decoding apparatus determines whether or not decoding of all blocks is completed, and if completed, stops all operations and ends processing, and if not, completes the next block. Target, the process returns to step S1003.

以上の構成と動作により、実施形態1で生成された、量子化マトリクスの符号量がより少ないビットストリームの復号を行い、再生画像を得ることができる。また、実施形態1と同様にブロックのサイズ、変換ブロックのサイズ、ブロックの形状についてはこれに限定されない。   With the above configuration and operation, it is possible to perform decoding of the bit stream generated in the first embodiment, in which the code amount of the quantization matrix is smaller, and obtain a reproduced image. In addition, the block size, the conversion block size, and the block shape are not limited to the same as in the first embodiment.

また、本実施形態では、図5(a)に示される復号テーブルを用いて量子化マトリクスの各要素の差分値を復号したが、使用される復号テーブルはこれに限定されない。   Further, in the present embodiment, the difference value of each element of the quantization matrix is decoded using the decoding table shown in FIG. 5A, but the decoding table used is not limited to this.

また、1つのシーケンスのビットストリーム中で量子化マトリクス符号データが複数回含まれている場合、量子化マトリクスの更新をすることも可能である。復号・分離部201で量子化マトリクス符号データを検出し、量子化マトリクス復号部206で復号し差分行列を生成する。生成された差分行列を量子化マトリクス逆走査部208で逆走査して量子化マトリクスを再生する。そして、再生された量子化マトリクスのデータを量子化マトリクス保持部207の該当する量子化マトリクスに置き換える。この際、全ての量子化マトリクスを書き換えても良いし、書き換える量子化マトリクスを判別することでその一部を変更することも可能である。   Further, when the quantization matrix code data is included in the bit stream of one sequence a plurality of times, the quantization matrix can be updated. The decoding / separation unit 201 detects the quantization matrix coded data, and the quantization matrix decoding unit 206 decodes it to generate a difference matrix. The quantization matrix inverse scanning unit 208 inversely scans the generated difference matrix to reproduce the quantization matrix. Then, the reproduced quantization matrix data is replaced with the corresponding quantization matrix in the quantization matrix holding unit 207. At this time, all the quantization matrices may be rewritten, or a part of them may be changed by discriminating the rewritten quantization matrix.

また、本実施形態では1フレーム分の符号データを蓄積してから処理を行う方式を例にとって説明したが、これに限定されない。例えば、ブロック単位や複数のブロックで構成されるスライス単位といった入力方法でも構わない。さらにはブロック等の構成ではなく、固定長のパケット等に分割されているものでも構わない。   Further, although the present embodiment has been described by taking the method of accumulating the code data for one frame and then performing the processing as an example, the present invention is not limited to this. For example, an input method such as a block unit or a slice unit composed of a plurality of blocks may be used. Further, the packet may be divided into fixed-length packets or the like instead of the block or the like.

また、本実施形態では、差分行列を一旦生成してから量子化マトリクスを再生する構成をとったが、量子化マトリクス復号部206が差分値を復号後、所定の走査方法を用いて直接量子化マトリクスを再生する構成をとっても良い。その場合、量子化マトリクス逆走査部208は省略可能である。   Further, in the present embodiment, although the configuration is such that the difference matrix is once generated and then the quantization matrix is reproduced, the quantization matrix decoding unit 206 decodes the difference value and then directly quantizes it using a predetermined scanning method. A structure for reproducing the matrix may be adopted. In that case, the quantization matrix reverse scanning unit 208 can be omitted.

また、直交変換係数の走査方法に応じて異なる量子化マトリクスを備えて適応する場合、直交変換係数の走査方法に応じて量子化マトリクスの要素の走査方法を決定しても良い。   Further, when different quantization matrices are provided and adapted depending on the scanning method of the orthogonal transform coefficient, the scanning method of the elements of the quantization matrix may be determined according to the scanning method of the orthogonal transform coefficient.

<実施形態3>
図3は本実施形態の画像符号化装置を示すブロック図である。図3において、実施形態1の図1と同様の機能を果たす部分に関しては同じ番号を付与し、説明を省略する。
<Embodiment 3>
FIG. 3 is a block diagram showing the image coding apparatus of this embodiment. In FIG. 3, parts having the same functions as those in FIG. 1 of the first embodiment are given the same numbers, and description thereof will be omitted.

321は各量子化マトリクスをどのように走査するかを示す量子化マトリクス走査方法情報を生成する、走査制御情報生成部である。309は走査制御情報生成部321で生成された量子化マトリクス走査方法情報に基づいて走査方法を決定し、量子化マトリクス保持部106に格納された量子化マトリクスを走査して差分値を計算し、差分行列を生成する量子化マトリクス走査部である。   A scanning control information generation unit 321 generates quantization matrix scanning method information indicating how to scan each quantization matrix. A scanning method 309 determines a scanning method based on the quantization matrix scanning method information generated by the scanning control information generation unit 321, scans the quantization matrix stored in the quantization matrix holding unit 106, and calculates a difference value. It is a quantization matrix scanning unit that generates a difference matrix.

308は図1の統合符号化部108と同様に、ヘッダ情報や予測、変換に関する符号を生成する統合符号化部であり、前記統合符号化部108とは走査制御情報生成部321から量子化マトリクス走査方法情報を入力し、これを符号化することが異なる。   Similar to the integrated coding unit 108 in FIG. 1, 308 is an integrated coding unit that generates header information, a code relating to prediction, and conversion. The integrated coding unit 108 is a quantization matrix from the scan control information generation unit 321. The difference is that the scanning method information is input and encoded.

上記画像符号化装置における画像の符号化動作を以下に説明する。   An image encoding operation in the image encoding device will be described below.

符号化制御情報生成部321では、まず、各量子化マトリクスをどのように走査して差分値を算出するかを示す量子化マトリクス走査方法情報を生成する。本実施形態では、前記量子化マトリクス走査方法情報が0であれば、量子化マトリクスを図13(a)に示された走査方法を用いて走査し、各要素と走査順で直前の要素との差分値を算出して差分行列を生成するものとする。また、1であれば、量子化マトリクスを図13(b)に示された走査方法を用いて走査し、各要素と走査順で直前の要素との差分値を算出して差分行列を生成するものとする。また、2であれば、量子化マトリクスを図13(d)に示された走査方法を用いて走査し、各要素と走査順で直前の要素との差分値を算出して差分行列を生成するものとする。量子化マトリクスの各要素の走査方法および差分算出方法はこれらに限定されず、図13(a)、(b)、(d)に示されたもの以外の方法を用いても良く、例えば図13(c)、(e)に示された差分算出方法を用いても良い。また、前記量子化マトリクス走査方法情報と量子化マトリクスの走査方法との組合せはこれに限定されない。量子化マトリクス走査方法情報の生成方法については特に限定しないが、ユーザが入力しても良いし、固定値としてあらかじめ指定されたものを使用して良いし、量子化マトリクス保持部106に格納されている量子化マトリクスの特性から算出してももちろん良い。生成された量子化マトリクス走査方法情報は量子化マトリクス走査部309と統合符号化部308に入力される。   The coding control information generation unit 321 first generates quantization matrix scanning method information indicating how to scan each quantization matrix to calculate a difference value. In the present embodiment, if the quantization matrix scanning method information is 0, the quantization matrix is scanned using the scanning method shown in FIG. 13A, and each element and the immediately previous element in the scanning order are scanned. It is assumed that the difference value is calculated and the difference matrix is generated. If it is 1, the quantization matrix is scanned using the scanning method shown in FIG. 13B, the difference value between each element and the immediately preceding element in the scanning order is calculated, and the difference matrix is generated. I shall. If it is 2, the quantization matrix is scanned using the scanning method shown in FIG. 13D, the difference value between each element and the immediately preceding element in the scanning order is calculated, and the difference matrix is generated. I shall. The scanning method and the difference calculating method of each element of the quantization matrix are not limited to these, and methods other than those shown in FIGS. 13A, 13B, and 13D may be used, and for example, FIG. The difference calculation method shown in (c) and (e) may be used. The combination of the quantization matrix scanning method information and the quantization matrix scanning method is not limited to this. The method of generating the quantization matrix scanning method information is not particularly limited, but it may be input by the user, may be specified in advance as a fixed value, or may be stored in the quantization matrix holding unit 106. Of course, it may be calculated from the characteristics of the quantization matrix. The generated quantization matrix scanning method information is input to the quantization matrix scanning unit 309 and the integrated coding unit 308.

量子化マトリクス走査部309では、入力された量子化マトリクス走査方法情報に基づいて、量子化マトリクス保持部106に格納された各量子化マトリクスを走査して差分値を算出し、差分行列を生成して量子化マトリクス符号化部107に出力する。   The quantization matrix scanning unit 309 scans each quantization matrix stored in the quantization matrix holding unit 106 based on the input quantization matrix scanning method information, calculates a difference value, and generates a difference matrix. And outputs it to the quantization matrix coding unit 107.

統合符号化部308では、走査制御情報生成部321で生成された量子化マトリクス走査方法情報を符号化し、量子化マトリクス走査情報符号を生成し、ヘッダ情報等に組み込んで出力する。符号化の方法は特に限定しないが、ハフマン符号や算術符号などを用いることができる。図8(b)に量子化マトリクス走査情報符号を含むビットストリームの例を示す。量子化マトリクス符号化情報符号はシーケンス、ピクチャ等のヘッダのいずれに入れても構わないが、各量子化マトリクス符号データより前に存在する。   The integrated encoding unit 308 encodes the quantization matrix scanning method information generated by the scanning control information generating unit 321, generates a quantization matrix scanning information code, incorporates it into header information, and outputs it. The encoding method is not particularly limited, but Huffman code, arithmetic code, or the like can be used. FIG. 8B shows an example of a bitstream including the quantization matrix scanning information code. The quantization matrix coding information code may be put in any of headers such as sequences and pictures, but it exists before each quantization matrix code data.

図11は実施形態3に係る画像符号化装置における画像符号化処理を示すフローチャートである。図11において、実施形態1の図9と同様の機能を果たす部分に関しては同じ番号を付与し、説明を省略する。   FIG. 11 is a flowchart showing the image coding process in the image coding apparatus according to the third embodiment. In FIG. 11, parts that perform the same functions as those in FIG. 9 of the first embodiment are given the same numbers and description thereof is omitted.

ステップS1151にて、走査制御情報生成部321は、後段のステップS1152における量子化マトリクス走査方法を決定し、量子化マトリクス走査方法情報を生成する。ステップS1152にて、量子化マトリクス走査部309は、ステップS1151で決定した量子化マトリクス走査方法に基づいて、ステップS901で生成された量子化マトリクスを走査して差分値を算出し、差分行列を生成する。ステップS1153にて、量子化マトリクス符号化部107は、ステップS1152で生成された差分行列を符号化する。ステップS1154では量子化マトリクス走査方法情報を符号化し、量子化マトリクス走査情報符号を生成し、他の符号と同様にヘッダ部に組み込み出力する。   In step S1151, the scan control information generation unit 321 determines the quantization matrix scanning method in the subsequent step S1152, and generates quantization matrix scanning method information. In step S1152, the quantization matrix scanning unit 309 scans the quantization matrix generated in step S901 to calculate a difference value based on the quantization matrix scanning method determined in step S1151 to generate a difference matrix. To do. In step S1153, the quantization matrix coding unit 107 codes the difference matrix generated in step S1152. In step S1154, the quantization matrix scanning method information is coded to generate a quantization matrix scanning information code, which is incorporated in the header part and output like the other codes.

以上の構成と動作により、各量子化マトリクスが最適な走査方法で走査され、量子化マトリクスの符号量がより少ないビットストリームを生成することができる。なお、直交変換係数の走査方法に応じて異なる量子化マトリクスを備えて適応する場合、直交変換係数の走査方法に応じて量子化マトリクスの要素の走査方法を決定しても良い。それ以外の走査方法を用いる場合、そのことを示すフラグと使用する量子化マトリクス走査方法情報を符号化してもよい。   With the above configuration and operation, each quantization matrix is scanned by the optimum scanning method, and it is possible to generate a bitstream with a smaller code amount of the quantization matrix. When different quantization matrices are provided and adapted depending on the scanning method of the orthogonal transformation coefficient, the scanning method of the elements of the quantization matrix may be determined according to the scanning method of the orthogonal transformation coefficient. When another scanning method is used, a flag indicating that and a quantization matrix scanning method information to be used may be encoded.

また、本実施形態では量子化マトリクスが1つの場合について説明したが、これに限定されない。例えば、輝度・色度で異なる量子化マトリクスを設ける場合、共通の量子化マトリクス走査方法の情報を符号化して用いても構わないし、個別に設けて符号化しても構わない。   Further, although the case where there is one quantization matrix has been described in the present embodiment, the present invention is not limited to this. For example, when providing quantization matrices that differ in luminance and chromaticity, information of a common quantization matrix scanning method may be encoded and used, or may be individually provided and encoded.

また、走査制御情報生成部321は量子化マトリクス保持部106で生成された量子化マトリクスを参照して走査方法を生成しても構わない。前記のように複数の走査方法を予め用意しておいて、これらの中から選択して量子化マトリクス走査情報とすることもできるし、走査される要素の順番を別途符号化しても構わない。図13(a)であれば、1、2、6、7、3、5、8、13、4、9、12、14、10、11、15,16のような順番を符号化して送っても構わない。   Further, the scanning control information generating unit 321 may generate the scanning method by referring to the quantization matrix generated by the quantization matrix holding unit 106. As described above, it is possible to prepare a plurality of scanning methods in advance and select them to be used as the quantization matrix scanning information, or the order of the scanned elements may be encoded separately. In the case of FIG. 13 (a), the order of 1, 2, 6, 7, 3, 5, 8, 13, 4, 9, 12, 14, 10, 11, 15, 16 is encoded and sent. I don't mind.

<実施形態4>
図4は本実施形態の画像復号装置を示すブロック図である。図4において、実施形態2の図2と同様の機能を果たす部分に関しては同じ番号を付与し、説明を省略する。本実施形態では、実施形態3で生成されたビットストリームの復号について説明する。
<Embodiment 4>
FIG. 4 is a block diagram showing the image decoding apparatus of this embodiment. In FIG. 4, parts that perform the same functions as those in FIG. 2 of the second embodiment are given the same numbers, and description thereof is omitted. In this embodiment, decoding of the bitstream generated in the third embodiment will be described.

401は入力されたビットストリームのヘッダ情報を復号し、ビットストリームから必要な符号を分離して後段へ出力する復号・分離部である。図2の復号・分離部201とはビットストリームのヘッダ情報から量子化マトリクス走査情報符号を分離して後段に出力することが異なる。   Reference numeral 401 is a decoding / separation unit that decodes the header information of the input bitstream, separates the necessary code from the bitstream, and outputs the code to the subsequent stage. 2 is different from the decoding / separating unit 201 in FIG. 2 in that the quantization matrix scanning information code is separated from the header information of the bit stream and is output to the subsequent stage.

421は復号・分離部401で分離された量子化マトリクス走査方法情報符号を復号し、量子化マトリクス走査方法の情報を再生する走査制御情報復号部である。408は量子化マトリクス復号部206で生成された差分行列を前記量子化マトリクス走査方法の情報に基づいて逆走査して量子化マトリクスを再生する量子化マトリクス逆走査部である。   A scanning control information decoding unit 421 decodes the quantization matrix scanning method information code separated by the decoding / separation unit 401 and reproduces the information of the quantization matrix scanning method. A quantization matrix reverse scanning unit 408 reproduces a quantization matrix by inversely scanning the difference matrix generated by the quantization matrix decoding unit 206 based on the information of the quantization matrix scanning method.

上記画像復号装置における画像の復号動作を以下に説明する。   The image decoding operation in the image decoding apparatus will be described below.

図4において、入力された1フレーム分のビットストリームは復号・分離部401に入力され、画像を再生するのに必要なヘッダ情報が復号され、さらに後段で使用される符号が分離され出力される。ヘッダ情報に含まれる量子化マトリクス走査方法情報符号は走査制御情報復号部421に入力され、量子化マトリクス走査方法の情報を再生する。そして、再生された量子化マトリクス走査方法の情報は量子化マトリクス逆走査部408に入力される。一方、ヘッダ情報に含まれる量子化マトリクス符号データは量子化マトリクス復号部206に入力される。   In FIG. 4, the input bit stream for one frame is input to the decoding / separation unit 401, the header information necessary for reproducing the image is decoded, and the code used in the subsequent stage is separated and output. . The quantization matrix scanning method information code included in the header information is input to the scanning control information decoding unit 421 to reproduce the quantization matrix scanning method information. Then, the reproduced quantization matrix scanning method information is input to the quantization matrix inverse scanning unit 408. On the other hand, the quantization matrix coded data included in the header information is input to the quantization matrix decoding unit 206.

量子化マトリクス復号部206は量子化マトリクス符号データを復号し、差分行列を再生する。再生された差分行列は量子化マトリクス逆走査部408に入力される。量子化マトリクス逆走査部408は、前記量子化マトリクス走査方法の情報に基づいて、量子化マトリクス復号部206から入力された差分行列を逆走査し、要素単位で差分を加算して、量子化マトリクスを再生する。再生された量子化マトリクスは量子化マトリクス保持部207に格納される。   The quantization matrix decoding unit 206 decodes the quantization matrix code data and reproduces the difference matrix. The reproduced difference matrix is input to the quantization matrix inverse scanning unit 408. The quantization matrix inverse scanning unit 408 inversely scans the difference matrix input from the quantization matrix decoding unit 206 based on the information of the quantization matrix scanning method, adds the difference in element units, and adds the quantization matrix. To play. The reproduced quantization matrix is stored in the quantization matrix holding unit 207.

図12は実施形態4に係る画像復号装置における画像復号処理を示すフローチャートである。実施形態2の図10と同様の機能を果たす部分に関しては同じ番号を付与し、説明を省略する。   FIG. 12 is a flowchart showing an image decoding process in the image decoding device according to the fourth embodiment. Portions having the same functions as those in FIG. 10 of the second embodiment are given the same numbers, and the description thereof will be omitted.

ステップS1001にて、復号・分離部401はヘッダ情報を復号する。ステップS1251にて、走査制御情報復号部421はヘッダ情報に含まれる量子化マトリクス走査方法情報符号を復号し、量子化マトリクス走査方法の情報を再生する。ステップS1253にて、量子化マトリクス逆走査部408は、ステップS1251で再生された量子化マトリクスの走査方法の情報を用いてステップS1252で再生された差分行列を逆走査し、量子化マトリクスを再生する。   In step S1001, the decoding / separation unit 401 decodes the header information. In step S1251, the scanning control information decoding unit 421 decodes the quantization matrix scanning method information code included in the header information and reproduces the quantization matrix scanning method information. In step S1253, the quantization matrix inverse scanning unit 408 inversely scans the difference matrix reproduced in step S1252 by using the information about the scanning method of the quantization matrix reproduced in step S1251, and reproduces the quantization matrix. .

以上の構成と動作により、実施形態3で生成された、各量子化マトリクスが最適な走査方法で走査され、量子化マトリクスの符号量がより少ないビットストリームの復号を行い、再生画像を得ることができる。   With the above configuration and operation, each quantization matrix generated in the third embodiment is scanned by the optimum scanning method, the bit stream having a smaller code amount of the quantization matrix is decoded, and the reproduced image can be obtained. it can.

なお、直交変換係数の走査方法に応じて異なる量子化マトリクスを備えて適応する場合、直交変換係数の走査方法に応じて量子化マトリクスの要素の走査方法を決定しても良い。それ以外の走査方法を用いる場合、そのことを示すフラグと使用する量子化マトリクス走査方法情報を符号化してもよい。   When different quantization matrices are provided and adapted depending on the scanning method of the orthogonal transformation coefficient, the scanning method of the elements of the quantization matrix may be determined according to the scanning method of the orthogonal transformation coefficient. When another scanning method is used, a flag indicating that and a quantization matrix scanning method information to be used may be encoded.

<実施形態5>
本実施形態では画像符号化装置は実施形態1の図1と同じ構成をとる。ただし、量子化マトリクス走査部109の動作が異なる。従って、量子化マトリクス走査部109以外の符号化に関しては実施形態1と同様であり、説明を省略する。
<Fifth Embodiment>
In this embodiment, the image coding apparatus has the same configuration as that of FIG. 1 of the first embodiment. However, the operation of the quantization matrix scanning unit 109 is different. Therefore, the coding other than the quantization matrix scanning unit 109 is similar to that of the first embodiment, and the description thereof is omitted.

量子化マトリクス走査部109は二次元形状で格納されている量子化マトリクスを量子化マトリクス保持部106から順に読み出し、各要素と予測値との差分を計算し、計算された差分を走査して一次元の行列に配置する。実施形態1の量子化マトリクス走査部109とは差分の計算方法が異なる。   The quantization matrix scanning unit 109 sequentially reads the quantization matrix stored in the two-dimensional shape from the quantization matrix holding unit 106, calculates the difference between each element and the predicted value, scans the calculated difference, and performs primary calculation. Place it in the original matrix. The difference calculation method is different from that of the quantization matrix scanning unit 109 of the first embodiment.

本実施形態では、図16(c)に示されたように左および上の要素を参照して予測値を算出し、算出した予測値を図16(a)に示された水平スキャンを用いて走査して一次元の行列に配置するものとする。予測値の算出方法については、本実施形態では左の要素と上の要素のうち値が大きい方を予測値とするが、これに限定されず小さい方を予測値としても2つの要素の平均値を予測値としても良い。マトリクス内の上端の要素の符号化においては左の要素を予測値とし、左端の要素の符号化においては上の要素を予測値とする。また、マトリクスの最初の要素に対応する差分値は所定の初期値との差分を計算するものとし、本実施形態では初期値を8とするが、もちろんこれに限定されず、任意の値をとったり最初の要素の値そのものを用いたりしても良い。また、走査方法は水平スキャンに限定されず、図16(b)に示された垂直スキャンでも良く、単方向の走査方法であれば良い。   In the present embodiment, the predicted value is calculated by referring to the left and upper elements as shown in FIG. 16C, and the calculated predicted value is calculated using the horizontal scan shown in FIG. 16A. It shall be scanned and placed in a one-dimensional matrix. Regarding the calculation method of the predicted value, in the present embodiment, the one with the larger value of the left element and the upper element is set as the predicted value, but the present invention is not limited to this, and the smaller value is also the predicted value, and the average value of the two elements May be used as the predicted value. The left element is used as a prediction value when encoding the uppermost element in the matrix, and the upper element is used as the prediction value when encoding the leftmost element. Further, the difference value corresponding to the first element of the matrix is calculated as a difference from a predetermined initial value, and the initial value is set to 8 in the present embodiment, but it is not limited to this and may take an arbitrary value. The value of the first element itself may be used. The scanning method is not limited to the horizontal scanning, and may be the vertical scanning shown in FIG. 16B, as long as it is a unidirectional scanning method.

本実施形態における画像符号化処理を示すフローチャートは実施形態1の図9と同様である。ただし、ステップS902の動作が異なる。従って、ステップS902以外の符号化動作に関しては実施形態1と同様であり、説明を省略する。   The flowchart showing the image coding process in this embodiment is the same as that in FIG. 9 of the first embodiment. However, the operation of step S902 is different. Therefore, the encoding operation other than step S902 is the same as that of the first embodiment, and the description thereof is omitted.

ステップS902にて、量子化マトリックス走査部109はステップS901で生成された量子化マトリクスに対し、各要素の差分を算出し、算出された差分を走査して差分行列を生成する。本実施形態では、図17(a)に示された量子化マトリクスをステップS901で生成する場合を例にとって説明する。生成された量子化マトリクスは図16(c)に示される上または左の要素の最大値を予測値として図17(b)に示される二次元の差分値マトリクスを計算する。そして計算された差分値マトリクスを図16(a)に示される水平走査で走査し、図17(c)に示される差分行列を生成する。もちろん、差分値算出方法は上および左の要素を用いれば最大値に限定されず、最小値や平均値でも構わないし、走査方法は水平スキャンに限定されず、単方向の走査方法であれば良い。   In step S902, the quantization matrix scanning unit 109 calculates the difference of each element with respect to the quantization matrix generated in step S901 and scans the calculated difference to generate a difference matrix. In this embodiment, the case where the quantization matrix shown in FIG. 17A is generated in step S901 will be described as an example. The generated quantization matrix calculates the two-dimensional difference value matrix shown in FIG. 17B using the maximum value of the upper or left element shown in FIG. 16C as the predicted value. Then, the calculated difference value matrix is scanned by the horizontal scanning shown in FIG. 16A to generate the difference matrix shown in FIG. 17C. Of course, the difference value calculation method is not limited to the maximum value as long as the upper and left elements are used, the minimum value or the average value may be used, and the scanning method is not limited to the horizontal scanning and may be a unidirectional scanning method. .

図15は図17(a)に示された量子化マトリックスを図16(c)に示される上または左の要素の最大値を予測値として差分値を計算し、それを図16(a)の走査方法を用いて走査し、図5(a)の符号化テーブルで符号化した際の例を示している。図15の差分値の行は所定の初期値8および左または上の要素の最大値との差分値を水平スキャンしたものを示しており、図17(c)の差分行列と同等である。符号の行は差分値を図5(a)の符号化テーブルを用いて符号化した際の符号を示しており、合計50ビットが必要となる。これは図7に示されている従来手法の68ビットおよび実施形態1の60ビットよりもさらに少ない符号量で量子化マトリクスが符号化できることを示している。   FIG. 15 shows a difference value calculated from the quantization matrix shown in FIG. 17A with the maximum value of the upper or left element shown in FIG. An example in which scanning is performed using the scanning method and encoding is performed using the encoding table of FIG. The row of the difference value in FIG. 15 shows a value obtained by horizontally scanning the difference between the predetermined initial value 8 and the maximum value of the left or upper element, and is equivalent to the difference matrix in FIG. 17C. The code line shows the code when the difference value is coded using the coding table of FIG. 5A, and requires a total of 50 bits. This indicates that the quantization matrix can be encoded with a code amount smaller than 68 bits of the conventional method shown in FIG. 7 and 60 bits of the first embodiment.

以上の構成と動作により、量子化マトリクスの符号量がさらに少ないビットストリームを生成することができる。   With the above configuration and operation, it is possible to generate a bitstream in which the code amount of the quantization matrix is even smaller.

本実施形態では左と上の要素を用いて予測値を算出したが、これに限定されず、例えば左上の要素も用いても構わない。また、それ以外の要素を用いても構わない。その際にはその最大値、最小値、平均値に加えて中央値を用いても構わないしこれらに限定されない。   In the present embodiment, the predicted value is calculated using the left and upper elements, but the present invention is not limited to this, and the upper left element may be used, for example. Also, other elements may be used. At that time, the median value may be used in addition to the maximum value, the minimum value, and the average value, and the present invention is not limited thereto.

<実施形態6>
本実施形態では画像復号装置は実施形態2の図2と同じ構成をとる。ただし、量子化マトリクス逆走査部208の動作が異なる。従って、量子化マトリクス逆走査部208以外の復号に関しては実施形態2と同様であり、説明を省略する。また、本実施形態では実施形態6で生成されたビットストリームの復号について説明する。
<Sixth Embodiment>
In this embodiment, the image decoding apparatus has the same configuration as that of the second embodiment shown in FIG. However, the operation of the quantization matrix reverse scanning unit 208 is different. Therefore, the decoding other than the quantization matrix inverse scanning unit 208 is similar to that of the second embodiment, and the description thereof is omitted. Also, in this embodiment, decoding of the bitstream generated in the sixth embodiment will be described.

量子化マトリクス逆走査部208は実施形態6の量子化マトリクス走査部109と逆の動作を行う。量子化マトリクス逆走査部208に入力された差分行列は、それぞれの差分値を逆走査して二次元の差分値マトリクスを再生し、それから量子化マトリクスの各要素を算出して二次元の量子化マトリクスを再生する。本実施形態では、差分行列を図16(a)に示される水平スキャンを用いて逆走査して二次元の差分値マトリクスを再生し、図16(c)に示されるように左または上の要素と差分値から量子化マトリクスの各要素を算出し、二次元の量子化マトリクスを再生する。逆走査方法は水平スキャンに限定されず、図16(b)に示された垂直スキャンでも良く、単方向の走査方法であれば良い。量子化マトリクスの各要素の算出方法については、本実施形態では左の要素と上の要素のうち値が大きい方を予測値とし、それと差分値との合計を量子化マトリクスの各要素とするが、これに限定されない。左の要素と上の要素のうち値が小さい方を予測値としても良いし、2つの要素の平均値を予測値としても良く、予測値と差分値との合計を量子化マトリクスの各要素の値とする。また、マトリクス内の上端の要素の再生においては左の要素を予測値とし、左端の要素の符号化においては上の要素を予測値とし、差分値との合計をもって要素の値とする。また、マトリクスの最初の要素に対応する差分値は所定の初期値との差分を計算するものとし、本実施形態では初期値を8とするが、もちろんこれに限定されず、任意の値をとったり最初の要素の値そのものを用いたりしても良い。また、走査方法は水平スキャンに限定されず、図16(b)に示された垂直スキャンでも良く、単方向の走査方法であれば良い。   The quantization matrix reverse scanning unit 208 performs the reverse operation of the quantization matrix scanning unit 109 of the sixth embodiment. The difference matrix input to the quantization matrix inverse scanning unit 208 reversely scans each difference value to reproduce a two-dimensional difference value matrix, and then calculates each element of the quantization matrix to perform two-dimensional quantization. Play the matrix. In the present embodiment, the difference matrix is reversely scanned using the horizontal scan shown in FIG. 16A to reproduce a two-dimensional difference value matrix, and the left or upper element is reproduced as shown in FIG. 16C. And each element of the quantization matrix is calculated from the difference value and the two-dimensional quantization matrix is reproduced. The reverse scanning method is not limited to the horizontal scanning, and may be the vertical scanning shown in FIG. 16B, as long as it is a unidirectional scanning method. Regarding the method of calculating each element of the quantization matrix, in the present embodiment, the one with the larger value of the left element and the upper element is the predicted value, and the sum of it and the difference value is each element of the quantization matrix. , But is not limited to this. The smaller value of the left element and the upper element may be used as the predicted value, or the average value of the two elements may be used as the predicted value, and the sum of the predicted value and the difference value may be calculated for each element of the quantization matrix. The value. The left element is used as a prediction value when reproducing the uppermost element in the matrix, and the upper element is used as the prediction value when encoding the leftmost element, and the sum of the difference value is used as the element value. Further, the difference value corresponding to the first element of the matrix is calculated as a difference from a predetermined initial value, and the initial value is set to 8 in the present embodiment, but it is not limited to this and may take an arbitrary value. The value of the first element itself may be used. The scanning method is not limited to the horizontal scanning, and may be the vertical scanning shown in FIG. 16B, as long as it is a unidirectional scanning method.

本実施形態における画像復号処理を示すフローチャートは実施形態2の図10と同様である。ただし、ステップS1003の動作が異なる。従って、ステップS1003以外の復号動作に関しては実施形態2と同様であり、説明を省略する。   The flowchart showing the image decoding process in this embodiment is the same as that in FIG. 10 of the second embodiment. However, the operation of step S1003 is different. Therefore, the decoding operation other than step S1003 is the same as that of the second embodiment, and the description thereof is omitted.

ステップS1003にて、量子化マトリクス逆走査部208はステップS1002で生成された差分行列からそれぞれの差分値を逆走査して二次元の差分値マトリクスを再生し、それから量子化マトリクスの各要素を算出して二次元の量子化マトリクスを再生する。本実施形態では、実施形態6で示した図17(c)に示される差分行列を例にとって説明する。差分行列に対して、図16(a)に示される水平走査で逆走査し、図17(b)に示される二次元の差分値マトリクスを計算する。そして各要素の上または左の要素の大きい方を予測値として、各予測値と各差分値の合計を量子化マトリクスの各要素の値とする。逆走査方法は水平スキャンに限定されず単方向の逆走査方法であれば良く、量子化マトリクスの各要素の再生方法も左もしくは上の要素の小さい方や平均値を予測値として、差分値との合計を各要素の値としてももちろん良い。   In step S1003, the quantization matrix inverse scanning unit 208 inversely scans each difference value from the difference matrix generated in step S1002 to reproduce a two-dimensional difference value matrix, and then calculates each element of the quantization matrix. Then, the two-dimensional quantization matrix is reproduced. In the present embodiment, the difference matrix shown in FIG. 17C shown in the sixth embodiment will be described as an example. The difference matrix is inversely scanned by the horizontal scanning shown in FIG. 16A, and the two-dimensional difference value matrix shown in FIG. 17B is calculated. Then, the larger one of the elements above or to the left of each element is set as the prediction value, and the sum of each prediction value and each difference value is set as the value of each element of the quantization matrix. The reverse scanning method is not limited to horizontal scanning and may be a unidirectional reverse scanning method, and the method of reproducing each element of the quantization matrix also uses the smaller one of the left or upper elements or the average value as the prediction value and the difference value. Of course, the sum of can be used as the value of each element.

以上の構成と動作により、実施形態6で生成された、量子化マトリクスの符号量がさらに少ないビットストリームの復号を行い、再生画像を得ることができる。   With the above configuration and operation, it is possible to perform decoding of the bit stream generated in the sixth embodiment with a smaller code amount of the quantization matrix, and obtain a reproduced image.

本実施形態では左と上の要素を用いて予測値を算出したが、これに限定されず、例えば左上の要素も用いても構わない。また、それ以外の要素を用いても構わない。その際にはその最大値、最小値、平均値に加えて中央値を用いても構わないしこれらに限定されない。   In the present embodiment, the predicted value is calculated using the left and upper elements, but the present invention is not limited to this, and the upper left element may be used, for example. Also, other elements may be used. At that time, the median value may be used in addition to the maximum value, the minimum value, and the average value, and the present invention is not limited thereto.

<実施形態7>
本実施形態では画像符号化装置は実施形態1の図1と同じ構成をとる。ただし、量子化マトリクス走査部109の動作が異なる。従って、量子化マトリクス走査部109以外の符号化に関しては実施形態1と同様であり、説明を省略する。
<Embodiment 7>
In this embodiment, the image coding apparatus has the same configuration as that of FIG. 1 of the first embodiment. However, the operation of the quantization matrix scanning unit 109 is different. Therefore, the coding other than the quantization matrix scanning unit 109 is similar to that of the first embodiment, and the description thereof is omitted.

量子化マトリクス走査部109は二次元形状で格納されている量子化マトリクスを量子化マトリクス保持部106から順に読み出し、各要素と予測値との差分を計算し、計算された差分を走査して一次元の行列に配置する。実施形態1の量子化マトリクス走査部109とは差分の計算方法が異なる。   The quantization matrix scanning unit 109 sequentially reads the quantization matrix stored in the two-dimensional shape from the quantization matrix holding unit 106, calculates the difference between each element and the predicted value, scans the calculated difference, and performs primary calculation. Place it in the original matrix. The difference calculation method is different from that of the quantization matrix scanning unit 109 of the first embodiment.

本実施形態では、図18(a)に示されたような斜め方向の単方向スキャンを用いるものとし、要素ごとに走査順に直前の要素との差分を計算するものとするが、走査方法はこれに限定されない。図18(b)に示された図18(a)とは対角線で対称な斜め方向の単方向スキャンでも良く、単方向の走査方法であれば良い。   In the present embodiment, the diagonal unidirectional scan as shown in FIG. 18A is used, and the difference from the immediately preceding element is calculated for each element in the scanning order. Not limited to. 18A shown in FIG. 18B may be a diagonal unidirectional scan symmetrical with respect to a diagonal line, and a unidirectional scanning method may be used.

本実施形態における画像符号化処理を示すフローチャートは実施形態1の図9と同様である。ただし、ステップS902の動作が異なる。従って、ステップS902以外の符号化動作に関しては実施形態1と同様であり、説明を省略する。   The flowchart showing the image coding process in this embodiment is the same as that in FIG. 9 of the first embodiment. However, the operation of step S902 is different. Therefore, the encoding operation other than step S902 is the same as that of the first embodiment, and the description thereof is omitted.

ステップS902にて、量子化マトリクス走査部109はステップS901で生成された量子化マトリクスを走査して各要素の差分を算出し、差分行列を生成する。本実施形態では、図19(a)に示される量子化マトリクスを図18(a)に示される走査方法で走査し、図19(b)に示される差分行列を生成するものとするが、量子化マトリクスや走査方法はこれらに限定されない。   In step S902, the quantization matrix scanning unit 109 scans the quantization matrix generated in step S901, calculates the difference between each element, and generates a difference matrix. In the present embodiment, the quantization matrix shown in FIG. 19A is scanned by the scanning method shown in FIG. 18A to generate the difference matrix shown in FIG. 19B. The conversion matrix and scanning method are not limited to these.

以上の構成と動作により、図13(a)に示されるジグザグスキャンを用いず図19(a)に示される斜め方向の走査方法を用いる符号化方法において、走査方法を共有することで、使用されるメモリを節約しながら同等の効率でビットストリームを生成できる。   With the above configuration and operation, the scanning method is shared by the encoding method using the diagonal scanning method shown in FIG. 19A without using the zigzag scanning shown in FIG. Bitstream can be generated with the same efficiency while saving memory.

また図20(a)〜(d)のように量子化マトリクスをいくつかの小マトリクスに分割して、小マトリクスの中で単方向の走査を行っても良い。このようにすることによって、4×4量子化マトリクスの走査方法をより大きな量子化マトリクスにも適用でき、その順番を表すメモリを省略することができる。   Alternatively, as shown in FIGS. 20A to 20D, the quantization matrix may be divided into some small matrices and unidirectional scanning may be performed in the small matrices. By doing so, the scanning method of the 4 × 4 quantization matrix can be applied to a larger quantization matrix, and the memory indicating the order can be omitted.

<実施形態8>
本実施形態では画像復号装置は実施形態2の図2と同じ構成をとる。ただし、量子化マトリクス逆走査部208の動作が異なる。従って、量子化マトリクス逆走査部208以外の復号に関しては実施形態2と同様であり、説明を省略する。また、本実施形態では実施形態7で生成されたビットストリームの復号について説明する。
<Embodiment 8>
In this embodiment, the image decoding apparatus has the same configuration as that of the second embodiment shown in FIG. However, the operation of the quantization matrix reverse scanning unit 208 is different. Therefore, the decoding other than the quantization matrix inverse scanning unit 208 is similar to that of the second embodiment, and the description thereof is omitted. Also, in this embodiment, decoding of the bitstream generated in the seventh embodiment will be described.

量子化マトリクス逆走査部208は実施形態7の量子化マトリクス走査部109と逆の動作を行う。量子化マトリクス逆走査部208に入力された差分行列は、それぞれの差分値から量子化マトリクスの各要素を算出し、それを逆走査して二次元の量子化マトリクスを再生する。   The quantization matrix inverse scanning unit 208 performs an operation reverse to that of the quantization matrix scanning unit 109 of the seventh embodiment. The difference matrix input to the quantization matrix inverse scanning unit 208 calculates each element of the quantization matrix from each difference value, and inversely scans it to reproduce a two-dimensional quantization matrix.

本実施形態では、差分行列のそれぞれの差分値から量子化マトリクスの各要素を算出し、それを図18(a)に示される走査方法を用いて逆走査して二次元の量子化マトリクスを再生する。逆走査方法は図16(a)に示された方法に限定されず、図18(b)に示された図18(a)とは対角線で対称な斜め方向の単方向スキャンでも良く、単方向の逆走査方法であれば良い。   In the present embodiment, each element of the quantization matrix is calculated from each difference value of the difference matrix, and it is reverse-scanned using the scanning method shown in FIG. 18A to reproduce the two-dimensional quantization matrix. To do. The reverse scanning method is not limited to the method shown in FIG. 16A, and may be a diagonal unidirectional scan symmetrical with respect to FIG. 18A shown in FIG. 18B in a diagonal direction. The reverse scanning method may be used.

本実施形態における画像復号処理を示すフローチャートは実施形態2の図10と同様である。ただし、ステップS1003の動作が異なる。従って、ステップS1003以外の復号動作に関しては実施形態2と同様であり、説明を省略する。   The flowchart showing the image decoding process in this embodiment is the same as that in FIG. 10 of the second embodiment. However, the operation of step S1003 is different. Therefore, the decoding operation other than step S1003 is the same as that of the second embodiment, and the description thereof is omitted.

ステップS1003にて、量子化マトリクス逆走査部208はステップS1002で生成された差分行列から量子化マトリクスの各要素を算出し、それを逆走査して二次元の量子化マトリクスを再生する。本実施形態では、実施形態7で用いた図19(b)に示される差分行列から量子化マトリクスの各要素を算出し、算出されたそれぞれの要素を図18(a)に示される逆走査方法を用いて逆走査し、図19(a)に示された量子化マトリクスを再生する。使用される差分行列や逆走査方法はこれらに限定されない。   In step S1003, the quantization matrix inverse scanning unit 208 calculates each element of the quantization matrix from the difference matrix generated in step S1002, and inversely scans it to reproduce a two-dimensional quantization matrix. In the present embodiment, the respective elements of the quantization matrix are calculated from the difference matrix shown in FIG. 19B used in the seventh embodiment, and the calculated respective elements are calculated by the reverse scanning method shown in FIG. Reverse scanning is performed to reproduce the quantization matrix shown in FIG. The difference matrix and the inverse scanning method used are not limited to these.

以上の構成と動作により、実施形態7で生成された、走査方法を共有することで使用されるメモリを節約しながら生成されたビットストリームの復号を行い、再生画像を得ることができる。   With the above configuration and operation, it is possible to decode the bit stream generated in the seventh embodiment while saving the memory used by sharing the scanning method, and obtain the reproduced image.

<実施形態9>
図1〜図4に示した各処理部はハードウェアでもって構成しているものとして上記実施形態では説明した。しかし、図1〜図4に示した各処理部で行なう処理をコンピュータプログラムでもって構成しても良い。
<Embodiment 9>
In the above embodiment, each processing unit shown in FIGS. 1 to 4 is described as being configured by hardware. However, the processing performed by each processing unit shown in FIGS. 1 to 4 may be configured by a computer program.

図14は、上記各実施形態に係る画像表示装置に適用可能なコンピュータのハードウェアの構成例を示すブロック図である。   FIG. 14 is a block diagram showing an example of the hardware configuration of a computer applicable to the image display device according to each of the above embodiments.

CPU1401は、RAM1402やROM1403に格納されているコンピュータプログラムやデータを用いてコンピュータ全体の制御を行うと共に、上記各実施形態に係る画像処理装置が行うものとして上述した各処理を実行する。即ち、CPU1401は、図1〜図4に示した各処理部として機能することになる。   The CPU 1401 controls the entire computer using the computer programs and data stored in the RAM 1402 and the ROM 1403, and also executes the processes described above as the processes performed by the image processing apparatus according to each of the above embodiments. That is, the CPU 1401 functions as each processing unit shown in FIGS.

RAM1402は、外部記憶装置1406からロードされたコンピュータプログラムやデータ、I/F(インターフェース)1407を介して外部から取得したデータなどを一時的に記憶するためのエリアを有する。更に、RAM1402は、CPU1401が各種の処理を実行する際に用いるワークエリアを有する。即ち、RAM1402は、例えば、フレームメモリとして割当てたり、その他の各種のエリアを適宜提供することができる。   The RAM 1402 has an area for temporarily storing a computer program or data loaded from the external storage device 1406, data acquired from the outside via the I / F (interface) 1407, and the like. Further, the RAM 1402 has a work area used when the CPU 1401 executes various processes. That is, the RAM 1402 can be allocated as, for example, a frame memory or can appropriately provide other various areas.

ROM1403には、本コンピュータの設定データや、ブートプログラムなどが格納されている。操作部1404は、キーボードやマウスなどにより構成されており、本コンピュータのユーザが操作することで、各種の指示をCPU1401に対して入力することができる。出力部1405は、CPU1401による処理結果を出力する。また出力部1405は例えば液晶ディスプレイのような表示装置で構成して処理結果を表示することができる。   The ROM 1403 stores setting data of the computer, a boot program, and the like. The operation unit 1404 is composed of a keyboard, a mouse and the like, and can be operated by the user of the computer to input various instructions to the CPU 1401. The output unit 1405 outputs the processing result by the CPU 1401. The output unit 1405 can be configured by a display device such as a liquid crystal display to display the processing result.

外部記憶装置1406は、ハードディスクドライブ装置に代表される、大容量情報記憶装置である。外部記憶装置1406には、OS(オペレーティングシステム)や、図1〜図4に示した各部の機能をCPU1401に実現させるためのコンピュータプログラムが保存されている。更には、外部記憶装置1406には、処理対象としての各画像データが保存されていても良い。   The external storage device 1406 is a large capacity information storage device represented by a hard disk drive device. The external storage device 1406 stores an OS (operating system) and a computer program for causing the CPU 1401 to realize the functions of the units illustrated in FIGS. 1 to 4. Furthermore, each image data to be processed may be stored in the external storage device 1406.

外部記憶装置1406に保存されているコンピュータプログラムやデータは、CPU1401による制御に従って適宜RAM1402にロードされ、CPU1401による処理対象となる。I/F1407には、LANやインターネット等のネットワーク、投影装置や表示装置などの他の機器を接続することができ、本コンピュータはこのI/F1407を介して様々な情報を取得したり、送出したりすることができる。1408は上述の各部を繋ぐバスである。   The computer programs and data stored in the external storage device 1406 are appropriately loaded into the RAM 1402 under the control of the CPU 1401 and are processed by the CPU 1401. The I / F 1407 can be connected to a network such as a LAN or the Internet, and other devices such as a projection device and a display device. The computer acquires and sends various information via the I / F 1407. You can 1408 is a bus connecting the above-mentioned units.

上述の構成からなる作動は前述のフローチャートで説明した作動をCPU1401が中心となってその制御を行う。   The operation having the above-described configuration is controlled mainly by the CPU 1401 which is the operation described in the above flowchart.

<その他の実施形態>
本発明の目的は、前述した機能を実現するコンピュータプログラムのコードを記録した記憶媒体を、システムに供給し、そのシステムがコンピュータプログラムのコードを読み出し実行することによっても達成される。この場合、記憶媒体から読み出されたコンピュータプログラムのコード自体が前述した実施形態の機能を実現し、そのコンピュータプログラムのコードを記憶した記憶媒体は本発明を構成する。また、そのプログラムのコードの指示に基づき、コンピュータ上で稼働しているオペレーティングシステム(OS)などが実際の処理の一部または全部を行い、その処理によって前述した機能が実現される場合も含まれる。
<Other embodiments>
The object of the present invention is also achieved by supplying a storage medium storing a code of a computer program that realizes the above-described functions to a system, and the system reading and executing the code of the computer program. In this case, the computer program code itself read from the storage medium realizes the functions of the above-described embodiments, and the storage medium storing the computer program code constitutes the present invention. Further, it includes a case where an operating system (OS) running on a computer performs some or all of actual processing based on the instructions of the code of the program, and the processing realizes the above-described functions. .

さらに、以下の形態で実現しても構わない。すなわち、記憶媒体から読み出されたコンピュータプログラムコードを、コンピュータに挿入された機能拡張カードやコンピュータに接続された機能拡張ユニットに備わるメモリに書込む。そして、そのコンピュータプログラムのコードの指示に基づき、その機能拡張カードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行って、前述した機能が実現される場合も含まれる。   Further, it may be realized in the following forms. That is, the computer program code read from the storage medium is written in the memory provided in the function expansion card inserted in the computer or the function expansion unit connected to the computer. Then, based on the instructions of the code of the computer program, a case where the CPU or the like included in the function expansion card or the function expansion unit performs some or all of the actual processing to realize the above-described functions is also included.

本発明を上記記憶媒体に適用する場合、その記憶媒体には、先に説明したフローチャートに対応するコンピュータプログラムのコードが格納されることになる。   When the present invention is applied to the storage medium, the storage medium stores the code of the computer program corresponding to the above-described flowchart.

Claims (13)

画像データを符号化する符号化装置であって、
符号化対象の画像データを量子化する際に用いる二次元配列で表すことが可能なn行n列(nは4以上の整数)の量子化マトリクスにおける各要素において所定の要素間の差分値を取得する取得手段、
を有し、
前記取得手段は、
前記量子化マトリクスにおける(p+1)行1列目(pは2以上かつn−1以下の整数)に対応する要素と、前記量子化マトリクスにおける1行p列目に対応する要素との差分値を取得し、
前記量子化マトリクスにおけるn行q列目(qは2以上かつn−1以下の整数)に対応する要素と、前記量子化マトリクスにおける(q−1)行n列目に対応する要素との差分値を取得し、
前記量子化マトリクスにおけるn行n列目に対応する要素と、前記量子化マトリクスにおける(n−1)行n列目に対応する要素との差分値を取得する
ことを特徴とする画像符号化装置。
An encoding device for encoding image data,
For each element in a quantization matrix of n rows and n columns (n is an integer of 4 or more) that can be represented by a two-dimensional array used when quantizing image data to be encoded, a difference value between predetermined elements is calculated. Acquisition means to acquire,
Have
The acquisition means is
The difference value between the element corresponding to the (p + 1) th row and the 1st column (p is an integer of 2 or more and n-1 or less) in the quantization matrix and the element corresponding to the 1st row and the pth column of the quantization matrix is calculated. Acquired,
Difference between an element corresponding to the nth row and the qth column (q is an integer of 2 or more and n-1 or less) in the quantization matrix and an element corresponding to the (q-1) th row and the nth column in the quantization matrix Get the value,
An image coding apparatus, wherein a difference value between an element corresponding to the nth row and the nth column in the quantization matrix and an element corresponding to the (n-1) th row and the nth column in the quantization matrix is acquired. .
前記量子化マトリクスにおける行の数は、前記量子化マトリクスにおける列の数と等しい
ことを特徴とする請求項1記載の画像符号化装置。
The image coding apparatus according to claim 1, wherein the number of rows in the quantization matrix is equal to the number of columns in the quantization matrix.
前記量子化マトリクスのサイズを示すヘッダ情報を生成する生成手段
を有することを特徴とする請求項1又は2に記載の画像符号化装置。
The image coding apparatus according to claim 1, further comprising: a generation unit that generates header information indicating a size of the quantization matrix.
前記取得手段は、前記量子化マトリクスにおける1行1列目に対応する要素と、所定の初期値との差分値を取得する
ことを特徴とする請求項1〜3のいずれか1項に記載の画像符号化装置。
The said acquisition means acquires the difference value of the element corresponding to the 1st row and 1st column in the said quantization matrix, and a predetermined initial value. The claim 1 characterized by the above-mentioned. Image coding device.
予測誤差を生成するために、符号化対象の画像に対して予測処理を行う予測手段と、
変換係数を生成するために、前記予測誤差を直交変換する予測手段と、
量子化係数を生成するために、前記量子化マトリクスを用いて、前記変換係数を量子化する量子化手段と、
を有し、
前記符号化手段は、前記量子化係数を符号化する。
ことを特徴とする請求項1〜4のいずれか1項に記載の画像符号化装置。
A prediction unit that performs a prediction process on an image to be encoded in order to generate a prediction error;
Prediction means for orthogonally transforming the prediction error to generate transform coefficients;
Quantizing means for quantizing the transform coefficient using the quantization matrix to generate a quantized coefficient;
Have
The encoding means encodes the quantized coefficient.
The image encoding device according to claim 1, wherein the image encoding device is an image encoding device.
ビットストリームから画像データを復号する画像復号装置であって、
量子化係数から変換係数を導出する際に用いられる量子化マトリクスであって、n行n列(nは4以上の整数)の量子化マトリクスに含まれる各要素における所定の要素間の差分値を前記ビットストリームから復号する復号手段と、
前記復号手段によって復号された複数の差分値における第1番目の差分値と所定の初期値とを加算して第1番目の要素を導出し、前記複数の差分値における第r番目(rは2以上の整数)の差分値と第r−1番目の要素とを加算して第r番目の要素を導出することにより、複数の要素を導出する第1の導出手段と、
前記第1の導出手段によって導出された前記複数の要素それぞれを、二次元配列で表わすことが可能な前記量子化マトリクスにおける各要素に対応付ける対応付け手段と
を有し、
前記対応付け手段は、
前記複数の要素の内の第1の要素を前記量子化マトリクスにおける1行p列目(pは2以上かつn−1以下の整数)の要素に対応させる場合、前記第1の要素の次の第2の要素を前記量子化マトリクスにおける(p+1)行1列目の要素に対応させ、
前記複数の要素の内の第3の要素を前記量子化マトリクスにおける(q−1)行n列目(qは2以上かつn−1以下の整数)の要素に対応させる場合、前記第3の要素の次の第4の要素を前記量子化マトリクスにおけるn行q列目の要素に対応させ、
前記複数の要素の内の最後から2番目の要素を前記量子化マトリクスにおける(n−1)行n列目の要素に対応させ、
前記複数の要素の内の最後の要素を前記量子化マトリクスにおけるn行n列目の要素に対応させる
ことを特徴とする画像復号装置。
An image decoding device for decoding image data from a bitstream,
A quantization matrix used when deriving a transform coefficient from a quantized coefficient, which is a difference value between predetermined elements in each element included in the quantization matrix of n rows and n columns (n is an integer of 4 or more). Decoding means for decoding from the bitstream,
The first difference value of the plurality of difference values decoded by the decoding means and a predetermined initial value are added to derive the first element, and the r-th (r is 2) of the plurality of difference values. First deriving means for deriving a plurality of elements by adding the difference value of (the above integer) and the r-1th element to derive the rth element,
Associating means for associating each of the plurality of elements derived by the first deriving means with each element in the quantization matrix that can be represented by a two-dimensional array,
The associating means is
When the first element of the plurality of elements is made to correspond to the element of the first row and the p-th column (p is an integer of 2 or more and n-1 or less) in the quantization matrix, the next element of the first element is The second element is made to correspond to the element in the (p + 1) th row and first column in the quantization matrix,
When the third element of the plurality of elements is made to correspond to the element of the (q-1) th row and the nth column (q is an integer of 2 or more and n-1 or less) in the quantization matrix, the third element The fourth element following the element is made to correspond to the element in the n-th row and the q-th column in the quantization matrix,
The penultimate element of the plurality of elements corresponds to the element at the (n-1) th row and nth column in the quantization matrix;
The image decoding device, wherein the last element of the plurality of elements is made to correspond to the element in the n-th row and the n-th column in the quantization matrix.
前記量子化マトリクスにおける行の数は、前記量子化マトリクスにおける列の数と等しい
ことを特徴とする請求項6記載の画像復号装置。
The image decoding device according to claim 6, wherein the number of rows in the quantization matrix is equal to the number of columns in the quantization matrix.
前記量子化マトリクスのサイズは、ヘッダ情報に含まれる情報に基づく
ことを特徴とする請求項6又は7に記載の画像復号装置。
The image decoding device according to claim 6 or 7, wherein the size of the quantization matrix is based on information included in header information.
前記量子化マトリクスを用いて前記量子化係数から前記変換係数を導出する第2の導出手段と、
前記変換係数から予測誤差を導出する第3の導出手段と、
予測画像を導出するために復号済みの画素に基づいて予測を行い、前記予測画像と前記予測誤差に基づく画像を生成する画像生成手段と
を有することを特徴とする請求項6〜8のいずれか1項に記載の画像復号装置。
Second deriving means for deriving the transform coefficient from the quantized coefficient using the quantization matrix,
Third derivation means for deriving a prediction error from the conversion coefficient,
9. An image generation unit that performs prediction based on decoded pixels to derive a predicted image and that generates the predicted image and an image based on the prediction error. The image decoding device according to item 1.
画像データを符号化する符号化方法であって、
符号化対象の画像データを量子化する際に用いる二次元配列で表すことが可能なn行n列(nは4以上の整数)の量子化マトリクスにおける各要素において所定の要素間の差分値を取得する取得工程、
を有し、
前記取得工程において、
前記量子化マトリクスにおける(p+1)行1列目(pは2以上かつn−1以下の整数)に対応する要素と、前記量子化マトリクスにおける1行p列目に対応する要素との差分値を取得し、
前記量子化マトリクスにおけるn行q列目(qは2以上かつn−1以下の整数)に対応する要素と、前記量子化マトリクスにおける(q−1)行n列目に対応する要素との差分値を取得し、
前記量子化マトリクスにおけるn行n列目に対応する要素と、前記量子化マトリクスにおける(n−1)行n列目に対応する要素との差分値を取得する
ことを特徴とする画像符号化方法。
A coding method for coding image data, comprising:
For each element in a quantization matrix of n rows and n columns (n is an integer of 4 or more) that can be represented by a two-dimensional array used when quantizing image data to be encoded, a difference value between predetermined elements is calculated. Acquisition process to acquire,
Have
In the acquisition step,
The difference value between the element corresponding to the (p + 1) th row and the 1st column (p is an integer of 2 or more and n-1 or less) in the quantization matrix and the element corresponding to the 1st row and the pth column of the quantization matrix is calculated. Acquired,
Difference between an element corresponding to the nth row and the qth column (q is an integer of 2 or more and n-1 or less) in the quantization matrix and an element corresponding to the (q-1) th row and the nth column in the quantization matrix Get the value,
An image coding method, wherein a difference value between an element corresponding to the nth row and the nth column in the quantization matrix and an element corresponding to the (n-1) th row and the nth column in the quantization matrix is obtained. .
ビットストリームから画像データを復号する画像復号方法であって、
量子化係数から変換係数を導出する際に用いられる量子化マトリクスであって、n行n列(nは4以上の整数)の量子化マトリクスに含まれる各要素における所定の要素間の差分値を前記ビットストリームから復号する復号工程と、
前記復号工程によって復号された複数の差分値における第1番目の差分値と所定の初期値とを加算して第1番目の要素を導出し、前記複数の差分値における第r番目(rは2以上の整数)の差分値と第r−1番目の要素とを加算して第r番目の要素を導出することにより、複数の要素を導出する第1の導出工程と、
前記第1の導出工程によって導出された前記複数の要素それぞれを、二次元配列で表わすことが可能な前記量子化マトリクスにおける各要素に対応付ける対応付け工程と
を有し、
前記対応付け工程において、
前記複数の要素の内の第1の要素を前記量子化マトリクスにおける1行p列目(pは2以上かつn−1以下の整数)の要素に対応させる場合、前記第1の要素の次の第2の要素を前記量子化マトリクスにおける(p+1)行1列目の要素に対応させ、
前記複数の要素の内の第3の要素を前記量子化マトリクスにおける(q−1)行n列目(qは2以上かつn−1以下の整数)の要素に対応させる場合、前記第3の要素の次の第4の要素を前記量子化マトリクスにおけるn行q列目の要素に対応させ、
前記複数の要素の内の最後から2番目の要素を前記量子化マトリクスにおける(n−1)行n列目の要素に対応させ、
前記複数の要素の内の最後の要素を前記量子化マトリクスにおけるn行n列目の要素に対応させる
ことを特徴とする画像復号方法。
An image decoding method for decoding image data from a bitstream,
A quantization matrix used when deriving a transform coefficient from a quantized coefficient, which is a difference value between predetermined elements in each element included in the quantization matrix of n rows and n columns (n is an integer of 4 or more). A decoding step of decoding from the bitstream,
The first difference value of the plurality of difference values decoded by the decoding process is added to a predetermined initial value to derive the first element, and the r-th (r is 2) of the plurality of difference values. A first deriving step of deriving a plurality of elements by deriving the r-th element by adding the difference value of (the above integer) and the (r-1) -th element,
An associating step of associating each of the plurality of elements derived by the first deriving step with each element in the quantization matrix that can be represented by a two-dimensional array,
In the associating step,
When the first element of the plurality of elements is made to correspond to the element of the first row and the p-th column (p is an integer of 2 or more and n-1 or less) in the quantization matrix, the next element of the first element is The second element is made to correspond to the element in the (p + 1) th row and first column in the quantization matrix,
When the third element of the plurality of elements is made to correspond to the element of the (q-1) th row and the nth column (q is an integer of 2 or more and n-1 or less) in the quantization matrix, the third element The fourth element following the element is made to correspond to the element in the n-th row and the q-th column in the quantization matrix,
The penultimate element of the plurality of elements corresponds to the element at the (n-1) th row and nth column in the quantization matrix;
The image decoding method, wherein the last element of the plurality of elements is made to correspond to the element in the n-th row and the n-th column in the quantization matrix.
コンピュータを、請求項1〜5のいずれか1項に記載の画像符号化装置の各手段として機能させることを特徴とするプログラム。   A program that causes a computer to function as each unit of the image coding apparatus according to claim 1. コンピュータを、請求項6〜9のいずれか1項に記載の画像復号装置の各手段として機能させることを特徴とするプログラム。   A program that causes a computer to function as each unit of the image decoding apparatus according to claim 6.
JP2019030981A 2011-11-07 2019-02-22 Image coding device, image coding method and program, image decoding device, image decoding method and program Active JP6679778B2 (en)

Applications Claiming Priority (6)

Application Number Priority Date Filing Date Title
JP2011243942 2011-11-07
JP2011243942 2011-11-07
JP2012008199 2012-01-18
JP2012008199 2012-01-18
JP2012057424 2012-03-14
JP2012057424 2012-03-14

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2018052119A Division JP6490272B2 (en) 2011-11-07 2018-03-20 Image encoding device, image encoding method and program, image decoding device, image decoding method and program

Publications (2)

Publication Number Publication Date
JP2019075836A JP2019075836A (en) 2019-05-16
JP6679778B2 true JP6679778B2 (en) 2020-04-15

Family

ID=58537617

Family Applications (4)

Application Number Title Priority Date Filing Date
JP2017016100A Active JP6312879B2 (en) 2011-11-07 2017-01-31 Image encoding device, image encoding method and program, image decoding device, image decoding method and program
JP2018052119A Active JP6490272B2 (en) 2011-11-07 2018-03-20 Image encoding device, image encoding method and program, image decoding device, image decoding method and program
JP2019030981A Active JP6679778B2 (en) 2011-11-07 2019-02-22 Image coding device, image coding method and program, image decoding device, image decoding method and program
JP2019030980A Active JP6679777B2 (en) 2011-11-07 2019-02-22 Image coding device, image coding method and program, image decoding device, image decoding method and program

Family Applications Before (2)

Application Number Title Priority Date Filing Date
JP2017016100A Active JP6312879B2 (en) 2011-11-07 2017-01-31 Image encoding device, image encoding method and program, image decoding device, image decoding method and program
JP2018052119A Active JP6490272B2 (en) 2011-11-07 2018-03-20 Image encoding device, image encoding method and program, image decoding device, image decoding method and program

Family Applications After (1)

Application Number Title Priority Date Filing Date
JP2019030980A Active JP6679777B2 (en) 2011-11-07 2019-02-22 Image coding device, image coding method and program, image decoding device, image decoding method and program

Country Status (1)

Country Link
JP (4) JP6312879B2 (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2679769B2 (en) * 1992-11-16 1997-11-19 富士ゼロックス株式会社 Image signal encoding device
JPH06284412A (en) * 1993-03-26 1994-10-07 Sony Corp Picture signal coding method and picture signal coder, picture signal decoding method and picture signal decoder and picture signal recording medium
JP3234807B2 (en) * 1997-02-08 2001-12-04 松下電器産業株式会社 Decoding method
WO2005072312A2 (en) * 2004-01-20 2005-08-11 Matsushita Electric Industrial Co., Ltd. Picture coding method, picture decoding method, picture coding apparatus, picture decoding apparatus, and program thereof
US10277915B2 (en) * 2011-11-07 2019-04-30 Qualcomm Incorporated Signaling quantization matrices for video coding
CN111064966B (en) * 2012-04-16 2022-05-31 韩国电子通信研究院 Image decoding method and image encoding method

Also Published As

Publication number Publication date
JP6490272B2 (en) 2019-03-27
JP6312879B2 (en) 2018-04-18
JP6679777B2 (en) 2020-04-15
JP2017073837A (en) 2017-04-13
JP2018121355A (en) 2018-08-02
JP2019097208A (en) 2019-06-20
JP2019075836A (en) 2019-05-16

Similar Documents

Publication Publication Date Title
JP6120490B2 (en) Image encoding device, image encoding method and program, image decoding device, image decoding method and program
JP5871628B2 (en) Image encoding device, image encoding method and program, image decoding device, image decoding method and program
JP2013038758A (en) Image encoder, image encoding method, program, image decoder, image decoding method and program
JP2013038768A (en) Image encoder, image encoding method, program, image decoder, image decoding method and program
JP2013146038A (en) Image quantization apparatus, image quantization method, and program, and image inverse quantization apparatus, image inverse quantization method, and program
JP2013012887A (en) Image encoding apparatus, image encoding method and program, image decoding apparatus, image decoding method and program
JP6679778B2 (en) Image coding device, image coding method and program, image decoding device, image decoding method and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190222

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200210

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200318

R151 Written notification of patent or utility model registration

Ref document number: 6679778

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151