JP2021150723A - Image encoding device, image encoding method and program, and image decoding device, image decoding method and program - Google Patents

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

Info

Publication number
JP2021150723A
JP2021150723A JP2020046696A JP2020046696A JP2021150723A JP 2021150723 A JP2021150723 A JP 2021150723A JP 2020046696 A JP2020046696 A JP 2020046696A JP 2020046696 A JP2020046696 A JP 2020046696A JP 2021150723 A JP2021150723 A JP 2021150723A
Authority
JP
Japan
Prior art keywords
quantization matrix
component
color difference
image
quantization
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.)
Pending
Application number
JP2020046696A
Other languages
Japanese (ja)
Inventor
真悟 志摩
Shingo Shima
真悟 志摩
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
Priority to JP2020046696A priority Critical patent/JP2021150723A/en
Publication of JP2021150723A publication Critical patent/JP2021150723A/en
Pending legal-status Critical Current

Links

Images

Abstract

To provide an image encoding device and an image decoding device that can reduce a code amount of data for indicating a quantization matrix.SOLUTION: An image coding device 100 encodes information indicating whether or not a second quantization matrix corresponding to a first color difference component and a third quantization matrix corresponding to a second color difference component have been encoded into a bit stream, into the bit stream, and in a case where an image to be encoded has a luminescence component, the first color difference component, and the second color difference component, when the information indicates that the second quantization matrix and the third quantization matrix have not been encoded, quantifies a prediction error of a luminescence component of a block to be encoded, a prediction error of the first color difference component of the block to be encoded, and a prediction error of the second color difference component of the block to be encoded, using the first quantization matrix.SELECTED DRAWING: Figure 1

Description

本発明は画像符号化技術に関する。 The present invention relates to an image coding technique.

動画像の圧縮記録の符号化方式として、HEVC(High Efficiency Video Coding)符号化方式(以下、HEVCと記す)が知られている。HEVCでは符号化効率向上のため、従来のマクロブロック(16×16画素)より大きなサイズの基本ブロックが採用された。この大きなサイズの基本ブロックはCTU(Coding Tree Unit)と呼ばれ、そのサイズは最大64×64画素である。CTUはさらに予測や変換を行う単位となるサブブロックに分割される。 As a coding method for compressed recording of moving images, a HEVC (High Efficiency Video Coding) coding method (hereinafter referred to as HEVC) is known. In HEVC, in order to improve coding efficiency, a basic block having a size larger than that of a conventional macroblock (16 × 16 pixels) has been adopted. This large-sized basic block is called a CTU (Coding Tree Unit), and its size is up to 64 × 64 pixels. The CTU is further divided into sub-blocks that serve as units for prediction and conversion.

また、HEVCにおいて、直交変換を施した後の係数(以下、直交変換係数と記す)に対する量子化処理が行われる。この量子化処理において、量子化マトリクスを用いて周波数成分に応じて重み付けをして、各周波数成分における量子化処理の量子化ステップを決定することが行われている。これにより、人間の視覚には劣化が目立ちにくい高周波成分のデータをより削減することで、画質を維持しながら圧縮効率を高めることが可能となっている。特許文献1には、このような量子化マトリクスを符号化する技術が開示されている。 Further, in HEVC, the quantization process is performed on the coefficient after the orthogonal transformation is performed (hereinafter, referred to as the orthogonal transformation coefficient). In this quantization process, the quantization step of the quantization process in each frequency component is determined by weighting according to the frequency component using the quantization matrix. As a result, it is possible to improve the compression efficiency while maintaining the image quality by further reducing the data of the high frequency component whose deterioration is inconspicuous to human vision. Patent Document 1 discloses a technique for encoding such a quantization matrix.

近年、HEVCの後継としてさらに高効率な符号化方式の国際標準化を行う活動が開始された。ISO/IECとITU−Tとのよって、JVET(Joint Video Experts Team)が設立され、VVC(Versatile Video Coding)符号化方式(以下、VVC)として標準化が進められている。符号化効率向上のため、VVCでは基本ブロックのサイズは最大128×128画素となっており、また、従来の正方形のサブブロックに分割する方法に加えて、長方形のサブブロックに分割する方法も検討されている。 In recent years, as a successor to HEVC, activities to carry out international standardization of more efficient coding methods have been started. JVET (Joint Video Experts Team) was established by ISO / IEC and ITU-T, and standardization is being promoted as a VVC (Versatile Video Coding) coding method (hereinafter, VVC). In order to improve coding efficiency, the maximum size of the basic block in VVC is 128 x 128 pixels, and in addition to the conventional method of dividing into square subblocks, a method of dividing into rectangular subblocks is also considered. Has been done.

特開2013−38758号公報Japanese Unexamined Patent Publication No. 2013-38758

VVCにおいても、HEVCと同様に量子化マトリクスの導入が検討されている。さらにVVCでは、長方形の形状も含め、HEVCよりも多い種類のサブブロック分割方法が検討されている。それぞれのサブブロック分割に対応する直交変換係数の分布は直交変換の大きさや形状によって異なるため、サブブロックの大きさや形状に応じて最適な量子化マトリクスを定義することが望ましい。しかしながら、全てのサブブロックの形状それぞれに対して個別に量子化マトリクスを定義すると、量子化マトリクスを示すデータの符号量が不必要に増大することとなる。 In VVC as well, the introduction of a quantization matrix is being studied as in HEVC. Further, in VVC, more kinds of subblock division methods than HEVC, including a rectangular shape, are being studied. Since the distribution of the orthogonal transformation coefficients corresponding to each subblock division differs depending on the size and shape of the orthogonal transformation, it is desirable to define the optimum quantization matrix according to the size and shape of the subblocks. However, if the quantization matrix is defined individually for each of the shapes of all the sub-blocks, the code amount of the data indicating the quantization matrix will be unnecessarily increased.

本発明は上述した課題を解決するためになされたものであり、量子化マトリクスを示すデータの符号量を抑制することを目的としている。 The present invention has been made to solve the above-mentioned problems, and an object of the present invention is to suppress the code amount of data showing a quantization matrix.

前述の問題点を解決するため、本発明の画像符号化装置は以下の構成を有する。すなわち、輝度成分と第1の色差成分と第2の色差成分とを有する画像をビットストリームに符号化することが可能な画像符号化装置であって、符号化対象の画像を複数のブロックに分割する分割手段と、符号化対象のブロックに対して予測処理を行い、前記符号化対象のブロックの予測誤差を導出する予測手段と、前記予測誤差を直交変換して直交変換係数を導出する変換手段と、少なくとも第1の量子化マトリクスを用いて、前記直交変換係数を量子化する量子化手段と、少なくとも前記第1の量子化マトリクスを符号化する符号化手段とを有し、前記符号化手段は、前記第1の色差成分に対応する第2の量子化マトリクスと、前記第2の色差成分に対応する第3の量子化マトリクスとが、前記ビットストリームに符号化されているかを示す情報を、前記ビットストリームに符号化し、前記量子化手段は、前記輝度成分と前記第1の色差成分と第2の色差成分とを前記符号化対象の画像が有する場合において、前記第2の量子化マトリクスと前記第3の量子化マトリクスとが前記ビットストリームに符号化されていることを前記情報が示す場合、前記符号化対象のブロックの前記輝度成分の予測誤差を前記第1の量子化マトリクスを用いて量子化し、前記符号化対象のブロックの前記第1の色差成分の予測誤差を前記第2の量子化マトリクスを用いて量子化し、前記符号化対象のブロックの前記第2の色差成分の予測誤差を前記第3の量子化マトリクスを用いて量子化し、前記輝度成分と前記第1の色差成分と第2の色差成分とを前記符号化対象の画像が有する場合において、前記第2の量子化マトリクスと前記第3の量子化マトリクスとが前記ビットストリームに符号化されていないことを前記情報が示す場合、前記符号化対象のブロックの前記輝度成分の前記予測誤差と、前記符号化対象のブロックの前記第1の色差成分の前記予測誤差と、前記符号化対象のブロックの前記第2の色差成分の前記予測誤差とを、第1の量子化マトリクスを用いて量子化する。 In order to solve the above-mentioned problems, the image coding apparatus of the present invention has the following configuration. That is, it is an image coding device capable of encoding an image having a brightness component, a first color difference component, and a second color difference component into a bit stream, and divides the image to be encoded into a plurality of blocks. The dividing means to be used, the prediction means for performing prediction processing on the block to be encoded and deriving the prediction error of the block to be encoded, and the conversion means for orthogonally converting the prediction error to derive the orthogonal conversion coefficient. The coding means has a quantization means for quantizing the orthogonal conversion coefficient using at least the first quantization matrix, and a coding means for encoding at least the first quantization matrix. Provides information indicating whether the second quantization matrix corresponding to the first color difference component and the third quantization matrix corresponding to the second color difference component are encoded in the bit stream. The second quantization matrix is encoded in the bit stream, and the quantization means has the brightness component, the first color difference component, and the second color difference component in the image to be encoded. When the information indicates that the third quantization matrix and the third quantization matrix are encoded in the bit stream, the prediction error of the brightness component of the coded block is determined by using the first quantization matrix. The prediction error of the first color difference component of the block to be encoded is quantized using the second quantization matrix, and the prediction error of the second color difference component of the block to be encoded is quantized. Is quantized using the third quantization matrix, and when the image to be encoded has the brightness component, the first color difference component, and the second color difference component, the second quantization matrix is used. When the information indicates that the third quantization matrix and the third quantization matrix are not encoded in the bit stream, the prediction error of the brightness component of the coded block and the coded block of the coded block. The prediction error of the first color difference component and the prediction error of the second color difference component of the block to be encoded are quantized using the first quantization matrix.

また、本発明の画像復号装置は以下の構成を有する。すなわち、画像が符号化されたビットストリームであって、輝度成分と第1の色差成分と第2の色差成分とを有するビットストリームを、復号することが可能な画像復号装置であって、少なくとも第1の量子化マトリクスを前記ビットストリームから復号する復号手段と少なくとも前記第1の量子化マトリクスを用いて、復号対象の画像における復号対象のブロックの残差係数を逆量子化して、直交変換係数を導出する逆量子化手段と、前記直交変換係数を逆直交変換して予測誤差を導出する逆変換手段と、前記予測誤差に対して予測処理を行い、前記復号対象のブロックの画像を生成する生成手段とを有し、前記復号手段は、前記第1の色差成分に対応する第2の量子化マトリクスと、前記第2の色差成分に対応する第3の量子化マトリクスとが、前記ビットストリームに符号化されているかを示す情報を、前記ビットストリームから復号し、前記逆量子化手段は、前記輝度成分と前記第1の色差成分と第2の色差成分とを復号対象のビットストリームが有する場合において、前記第2の量子化マトリクスと前記第3の量子化マトリクスとが前記ビットストリームに符号化されていることを前記情報が示す場合、前記復号対象のブロックの前記輝度成分の残差係数を前記第1の量子化マトリクスを用いて逆量子化し、前記復号対象のブロックの前記第1の色差成分の残差係数を前記第2の量子化マトリクスを用いて逆量子化し、前記復号対象のブロックの前記第2の色差成分の残差係数を前記第3の量子化マトリクスを用いて逆量子化し、前記輝度成分と前記第1の色差成分と第2の色差成分とを前記復号対象のビットストリームが有する場合において、前記第2の量子化マトリクスと前記第3の量子化マトリクスとが前記ビットストリームに符号化されていないことを前記情報が示す場合、前記復号対象のブロックの前記輝度成分の前記残差係数と、前記復号対象のブロックの前記第1の色差成分の前記残差係数と、前記復号対象のブロックの前記第2の色差成分の前記残差係数とを、第1の量子化マトリクスを用いて逆量子化する。 In addition, the image decoding device of the present invention has the following configuration. That is, it is an image decoding device capable of decoding a bit stream in which an image is encoded and having a brightness component, a first color difference component, and a second color difference component, and is at least the first. Using the decoding means for decoding the quantization matrix of 1 from the bit stream and at least the first quantization matrix, the residual coefficient of the block to be decoded in the image to be decoded is inversely quantized to obtain the orthogonal conversion coefficient. An inverse quantization means to be derived, an inverse conversion means to derive a prediction error by inversely orthogonalizing the orthogonal conversion coefficient, and a generation that performs prediction processing on the prediction error to generate an image of the block to be decoded. The decoding means has means, and the decoding means has a second quantization matrix corresponding to the first color difference component and a third quantization matrix corresponding to the second color difference component in the bit stream. When the information indicating whether the code is encoded is decoded from the bit stream, and the inverse quantization means has the brightness component, the first color difference component, and the second color difference component in the bit stream to be decoded. In, when the information indicates that the second quantization matrix and the third quantization matrix are encoded in the bit stream, the residual coefficient of the brightness component of the block to be decoded is calculated. The block to be decoded is dequantized using the first quantization matrix, and the residual coefficient of the first color difference component of the block to be decoded is dequantized using the second quantization matrix. The residual coefficient of the second color difference component is inversely quantized using the third quantization matrix, and the brightness component, the first color difference component, and the second color difference component are converted into the bit stream to be decoded. When the information indicates that the second quantization matrix and the third quantization matrix are not encoded in the bit stream, the brightness component of the block to be decoded A first quantization matrix is obtained by combining the residual coefficient, the residual coefficient of the first color difference component of the block to be decoded, and the residual coefficient of the second color difference component of the block to be decoded. Is dequantized using.

本発明によれば、量子化マトリクスを示すデータの符号量を抑制することができる。 According to the present invention, it is possible to suppress the code amount of the data indicating the quantization matrix.

実施形態における画像符号化装置の構成を示すブロック図である。It is a block diagram which shows the structure of the image coding apparatus in embodiment. 実施形態における画像復号装置のブロック図である。It is a block diagram of the image decoding apparatus in embodiment. 実施形態における画像符号化装置における画像符号化処理を示すフローチャートである。It is a flowchart which shows the image coding process in the image coding apparatus in embodiment. 実施形態における画像復号装置における画像復号処理を示すフローチャートである。It is a flowchart which shows the image decoding processing in the image decoding apparatus in embodiment. 実施形態をハードウェアで実現した場合におけるブロック図である。It is a block diagram in the case where the embodiment is realized by hardware. 実施形態における符号化装置によって生成され、画像復号装置によって復号されるビットストリーム構造の例を示す図である。It is a figure which shows the example of the bit stream structure generated by the coding apparatus in embodiment, and is decoded by the image decoding apparatus. 実施形態におけるサブブロック分割の例を示す図である。It is a figure which shows the example of the sub-block division in an embodiment. 実施形態で用いられる量子化マトリクスの例を示す図である。It is a figure which shows the example of the quantization matrix used in embodiment. 実施形態で用いられる量子化マトリクスの要素の走査方法を示す図である。It is a figure which shows the scanning method of the element of the quantization matrix used in embodiment. 実施形態で生成される量子化マトリクスの差分値の行列を示す図である。It is a figure which shows the matrix of the difference value of the quantization matrix generated in embodiment. 量子化マトリクスの差分値の符号化に用いられる符号化テーブルの例を示す図である。It is a figure which shows the example of the coding table used for coding the difference value of a quantization matrix. 実施形態で用いられる量子化マトリクスのシンタックステーブルの例を示す図である。It is a figure which shows the example of the syntax table of the quantization matrix used in embodiment. 実施形態で用いられる別の量子化マトリクスの例を示す図である。It is a figure which shows the example of another quantization matrix used in embodiment.

本発明の実施の形態を、添付の図面に基づいて説明する。なお、以下の実施形態において示す構成は一例であり、本発明は以下の実施形態で説明する構成に限定されるものではない。なお、基本ブロックやサブブロックといった呼称は、各実施形態において便宜的に用いている呼称であり、その意味が変わらない範囲で、適宜、他の呼称を用いてもよい。例えば、基本ブロックやサブブロックは、基本ユニットやサブユニットと称されてもよいし、単にブロックやユニットと称されてもよい。また、一例として、基本ブロックは、128×128画素のブロックでもよいし、64×64画素や32×32画素のブロックを基本ブロックとしてもよい。また、更に小さいブロックを基本ブロックとしてもよい。また、基本ブロックとは、例えば、coding tree unitやcoding unitである。基本ブロックとは、サブブロックへと、更に細かく分割可能な単位であればよい。 Embodiments of the present invention will be described with reference to the accompanying drawings. The configuration shown in the following embodiments is an example, and the present invention is not limited to the configurations described in the following embodiments. It should be noted that the names such as basic block and sub-block are names used for convenience in each embodiment, and other names may be used as appropriate as long as their meanings do not change. For example, a basic block or subunit may be referred to as a basic unit or subunit, or may simply be referred to as a block or unit. Further, as an example, the basic block may be a block of 128 × 128 pixels, or a block of 64 × 64 pixels or 32 × 32 pixels may be a basic block. Further, a smaller block may be used as a basic block. The basic block is, for example, a coding tree unit or a coding unit. The basic block may be a unit that can be further subdivided into subblocks.

また、各実施形態において「Cb/Cr」と表記した場合は、Cb成分及びCr成分の内の少なくともいずれか一方であることを示すこととする。つまり、「Cb/Cr」は、Cb成分及びCr成分の両方でもよいし、Cb成分及びCr成分の内のいずれか一方のみでもよい。 Further, when the term "Cb / Cr" is used in each embodiment, it means that it is at least one of the Cb component and the Cr component. That is, "Cb / Cr" may be both a Cb component and a Cr component, or may be only one of the Cb component and the Cr component.

また、各実施形態には複数の構成が記載されているが、これらの複数の構成の全てが必須のものとは限らない。また、これら複数の構成を任意に組み合わせてもよい。 Further, although a plurality of configurations are described in each embodiment, not all of these plurality of configurations are indispensable. Further, these plurality of configurations may be arbitrarily combined.

また、添付図面においては、同一もしくは同様の構成には同一の符号を付し、重複する部分についての説明は省略する。 Further, in the attached drawings, the same or similar configurations are designated by the same reference numerals, and the description of overlapping portions will be omitted.

<実施形態>
以下、本発明の実施形態を、図面を用いて説明する。
<Embodiment>
Hereinafter, embodiments of the present invention will be described with reference to the drawings.

図1は本実施形態の画像符号化装置100の構成を示すブロック図である。画像符号化装置100は、画像符号化装置100全体の制御を行う制御部150を有する。また、画像符号化装置100は、入力端子101、ブロック分割部102、量子化マトリクス保持部103、予測部104、変換・量子化部105、及び、逆量子化・逆変換部106を有する。また、画像符号化装置100は、画像再生部107、フレームメモリ108、インループフィルタ部109、符号化部110、統合符号化部111、出力端子112、及び、量子化マトリクス符号化部113を有する。なお、符号化部110と、統合符号化部111と、量子化マトリクス符号化部113とは協働して、各データをビットストリームに符号化する符号化手段として機能する。 FIG. 1 is a block diagram showing the configuration of the image coding device 100 of the present embodiment. The image coding device 100 has a control unit 150 that controls the entire image coding device 100. Further, the image coding device 100 includes an input terminal 101, a block division unit 102, a quantization matrix holding unit 103, a prediction unit 104, a conversion / quantization unit 105, and an inverse quantization / inverse conversion unit 106. Further, the image coding device 100 includes an image reproduction unit 107, a frame memory 108, an in-loop filter unit 109, a coding unit 110, an integrated coding unit 111, an output terminal 112, and a quantization matrix coding unit 113. .. The coding unit 110, the integrated coding unit 111, and the quantization matrix coding unit 113 cooperate with each other to function as a coding means for coding each data into a bit stream.

入力端子101は、符号化対象の画像データをフレーム単位に入力する。画像データは、撮像装置や、符号化対象の画像データを記憶したファイルサーバや記憶媒体等から取得されるが、その種類は問わない。また、出力端子112は、符号化データを出力先装置に出力するが、その出力先装置も記憶媒体、ファイルサーバ等、特に問わない。 The input terminal 101 inputs the image data to be encoded in frame units. The image data is acquired from an imaging device, a file server or a storage medium that stores the image data to be encoded, but the type thereof does not matter. Further, the output terminal 112 outputs the coded data to the output destination device, and the output destination device is not particularly limited to a storage medium, a file server, or the like.

ブロック分割部102は、入力したフレーム(ピクチャ)の画像を複数の基本ブロックに分割し、その1つを基本ブロックとして後段の予測部104に順に出力する。 The block division unit 102 divides the image of the input frame (picture) into a plurality of basic blocks, and outputs one of the basic blocks to the prediction unit 104 in the subsequent stage in order.

量子化マトリクス保持部103は、符号化に先立って複数の量子化マトリクスを生成し、内部の不図示のメモリに保持する。量子化マトリクスの生成方法については特に限定しない。ユーザが量子化マトリクスを示すデータを入力してもよいし、入力画像の特性から画像符号化装置100が量子化マトリクスを算出してもよい。また、量子化マトリクスとして、初期値として予め指定されたものを使用してもよい。本実施形態における量子化マトリクス保持部103は、図8(a)〜(e)に示される8×8画素、4×4画素、あるいは2×2画素の直交変換に対応した二次元の量子化マトリクス800〜804を保持する。 The quantization matrix holding unit 103 generates a plurality of quantization matrices prior to coding and holds them in an internal memory (not shown). The method of generating the quantization matrix is not particularly limited. The user may input data indicating the quantization matrix, or the image coding apparatus 100 may calculate the quantization matrix from the characteristics of the input image. Moreover, you may use the quantization matrix specified in advance as an initial value. The quantization matrix holding unit 103 in the present embodiment is a two-dimensional quantization corresponding to the orthogonal transformation of 8 × 8 pixels, 4 × 4 pixels, or 2 × 2 pixels shown in FIGS. 8 (a) to 8 (e). Hold the matrix 800-804.

ここで、量子化マトリクスとは、周波数成分に応じて、直交変換係数に対する量子化を重み付けするためのものである。後述する量子化における、各直交変換係数のための量子化ステップは、基準となるパラメータ値(量子化パラメータ)に、量子化マトリクスにおける各要素の値を乗算することで重み付けされる。 Here, the quantization matrix is for weighting the quantization with respect to the orthogonal transformation coefficient according to the frequency component. The quantization step for each orthogonal transformation coefficient in the quantization described later is weighted by multiplying the reference parameter value (quantization parameter) by the value of each element in the quantization matrix.

予測部104は、基本ブロック単位の画像データに対し、サブブロック分割を決定する。つまり、基本ブロックをサブブロックへと分割するか否かを決定し、分割するとすればどのように分割するか決定する。サブブロックへ分割しない場合、サブブロックは基本ブロックと同じサイズとなる。サブブロックは正方形でもよいし、正方形以外の長方形であってもよい。 The prediction unit 104 determines the sub-block division for the image data in the basic block unit. That is, it is determined whether or not to divide the basic block into subblocks, and if so, how to divide it. If not divided into subblocks, the subblock will be the same size as the basic block. The subblock may be a square or a rectangle other than a square.

そして、予測部104は、分割したサブブロック単位でフレーム内予測であるイントラ予測やフレーム間予測であるインター予測などを行い、サブブロック単位の予測画像データを生成する。例えば、予測部104は、あるサブブロックに対して行う予測方法を、イントラ予測、インター予測、及び、イントラ予測とインター予測とを組み合わせた予測の中から選択し、選択した予測を行って、当該サブブロックのための予測画像データを生成する。 Then, the prediction unit 104 performs intra-frame prediction, which is intra-frame prediction, inter-frame prediction, which is inter-frame prediction, and the like in the divided sub-block units, and generates prediction image data for each sub-block unit. For example, the prediction unit 104 selects a prediction method for a certain subblock from intra-prediction, inter-prediction, and prediction that combines intra-prediction and inter-prediction, and performs the selected prediction. Generate predicted image data for subblocks.

さらに、予測部104は、入力された画像データと予測画像データから画素単位の予測誤差をサブブロック単位で算出し、出力する。例えば、予測部104は、サブブロックの画像データの各画素値と、当該サブブロックに対する予測によって生成された予測画像データの各画素値との差分を算出し、それを予測誤差として算出する。 Further, the prediction unit 104 calculates and outputs a prediction error in pixel units from the input image data and the predicted image data in subblock units. For example, the prediction unit 104 calculates the difference between each pixel value of the image data of the subblock and each pixel value of the predicted image data generated by the prediction for the subblock, and calculates it as a prediction error.

また、予測部104は、予測に必要な情報、例えばサブブロック分割(基本ブロックからサブブロックへの分割状態)を示す情報(基本ブロックがどのようにサブブロックに分割されているかを示す情報)を予測誤差と併せて出力する。また、予測部104は、当該サブブロックの予測で用いる予測モードや動きベクトル等の情報も予測誤差と併せて出力する。以降、この予測に必要な情報を予測情報と呼称する。 Further, the prediction unit 104 provides information necessary for prediction, for example, information indicating subblock division (division state from basic block to subblock) (information indicating how the basic block is divided into subblocks). Output together with the prediction error. Further, the prediction unit 104 also outputs information such as a prediction mode and a motion vector used in the prediction of the sub-block together with the prediction error. Hereinafter, the information necessary for this prediction will be referred to as prediction information.

変換・量子化部105は、予測部104から入力された予測誤差をサブブロック単位で直交変換して、予測誤差の各周波数成分を表す直交変換係数を得る。さらに、変換・量子化部105は、量子化マトリクス保持部103に格納されている量子化マトリクスと、量子化パラメータとを用いて、直交変換係数の量子化を行い、残差係数(量子化後の直交変換係数)を得る。なお、直交変換を行う機能と、量子化を行う機能とは別々の構成にしてもよい。 The conversion / quantization unit 105 orthogonally transforms the prediction error input from the prediction unit 104 in subblock units to obtain an orthogonal transformation coefficient representing each frequency component of the prediction error. Further, the conversion / quantization unit 105 uses the quantization matrix stored in the quantization matrix holding unit 103 and the quantization parameters to quantize the orthogonal transformation coefficient, and the residual coefficient (after quantization). Orthogonal transformation factor). The function of performing orthogonal transformation and the function of performing quantization may be configured separately.

逆量子化・逆変換部106は、変換・量子化部105から残差係数を入力し、量子化マトリクス保持部103に格納されている量子化マトリクスと、量子化パラメータとを用いて逆量子化し、直交変換係数を再生する。逆量子化・逆変換部106は、さらに直交変換係数を逆直交変換して予測誤差を再生する。このように、量子化マトリクスと量子化パラメータとを用いて、直交変換係数を再生(導出)する処理を逆量子化と称するものとする。なお、逆量子化を行う機能と、逆直交変換を行う機能とは別々の構成にしてもよい。また、画像復号装置が量子化パラメータを導出するための情報も符号化部110によってビットストリームに符号化される。 The inverse quantization / inverse conversion unit 106 inputs a residual coefficient from the conversion / quantization unit 105, and inversely quantizes using the quantization matrix stored in the quantization matrix holding unit 103 and the quantization parameter. , Reproduce the orthogonal conversion coefficient. The inverse quantization / inverse transformation unit 106 further performs inverse orthogonal transformation of the orthogonal transformation coefficient to reproduce the prediction error. In this way, the process of reproducing (deriving) the orthogonal transformation coefficient using the quantization matrix and the quantization parameter is referred to as inverse quantization. The function of performing inverse quantization and the function of performing inverse orthogonal transformation may be configured separately. In addition, the information for the image decoding apparatus to derive the quantization parameter is also encoded in the bit stream by the coding unit 110.

画像再生部107は、予測部104から出力された予測情報に基づいて、フレームメモリ108を適宜参照して予測画像データを生成する。画像再生部107は、この予測画像データに、逆量子化・逆変換部106から入力された予測誤差を加算することで、再生画像データ(reconstructed picture)を生成し、フレームメモリ108に格納する。 The image reproduction unit 107 generates the prediction image data by appropriately referring to the frame memory 108 based on the prediction information output from the prediction unit 104. The image reproduction unit 107 adds the prediction error input from the inverse quantization / inverse conversion unit 106 to the predicted image data to generate the reproduced image data (reconcluded picture) and stores it in the frame memory 108.

インループフィルタ109は、フレームメモリ108に格納されている再生画像に対し、デブロッキングフィルタやサンプルアダプティブオフセットなどのインループフィルタ処理を行い、フィルタ処理後の画像データを再度フレームメモリ108に格納する。 The in-loop filter 109 performs in-loop filter processing such as a deblocking filter and a sample adaptive offset on the reproduced image stored in the frame memory 108, and stores the filtered image data in the frame memory 108 again.

符号化部110は、変換・量子化部105から出力された残差係数及び予測部104から出力された予測情報を符号化して、符号データを生成し、統合符号化部111に出力する。 The coding unit 110 encodes the residual coefficient output from the conversion / quantization unit 105 and the prediction information output from the prediction unit 104, generates code data, and outputs the code data to the integrated coding unit 111.

量子化マトリクス符号化部113は、量子化マトリクス保持部103に保持されている量子化マトリクスを符号化して、量子化マトリクス符号データを生成し、統合符号化部111に出力する。 The quantization matrix coding unit 113 encodes the quantization matrix held in the quantization matrix holding unit 103, generates the quantization matrix code data, and outputs the quantization matrix code data to the integrated coding unit 111.

統合符号化部111は、量子化マトリクス符号化部113からの量子化マトリクス符号データを含むヘッダ符号データを生成する。そして、統合符号化部111は、ヘッダ符号データに、符号化部110から出力された符号データと後続させ、ビットストリームを形成する。そして、統合符号化部111は、形成したビットストリームを、出力端子112を介して出力する。 The integrated coding unit 111 generates header code data including the quantization matrix code data from the quantization matrix coding unit 113. Then, the integrated coding unit 111 causes the header code data to follow the code data output from the coding unit 110 to form a bit stream. Then, the integrated coding unit 111 outputs the formed bit stream via the output terminal 112.

ここで、画像符号化装置100における画像の符号化動作をより詳しく以下に説明する。本実施形態では、入力端子101より、4:2:0カラーフォーマットの動画像データをフレーム単位に入力する構成とするが、1フレーム分の静止画データを入力する構成としても構わない。また、本実施形態では説明のため、ブロック分割部101においては、入力端子より入力した画像データを8×8画素の基本ブロックに分割するものとして説明する。すなわち、8×8画素の基本ブロックには、8×8画素の輝度(Y)成分と4×4画素の色差成分(第1の色差成分Cb及び第2の色差成分Crを含む)の画素が含まれることになる。なお、これは理解を容易にするためであり、上記数値(サイズ)に限定されるものではない。また、ここでいう、基本ブロックは、例えば、coding tree unitである。なお、一例として、coding tree unitのサイズが8×8画素である例について説明するが、他のサイズでもよい。例えば、32×32画素〜128×128画素の内のいずれかのサイズでもよい。 Here, the image coding operation in the image coding apparatus 100 will be described in more detail below. In the present embodiment, the moving image data in the 4: 2: 0 color format is input in frame units from the input terminal 101, but the still image data for one frame may be input. Further, for the sake of explanation in the present embodiment, the block division unit 101 will be described as dividing the image data input from the input terminal into basic blocks of 8 × 8 pixels. That is, in the basic block of 8 × 8 pixels, the pixels of the luminance (Y) component of 8 × 8 pixels and the color difference component of 4 × 4 pixels (including the first color difference component Cb and the second color difference component Cr) are included. Will be included. It should be noted that this is for facilitating understanding, and is not limited to the above numerical values (size). Further, the basic block referred to here is, for example, a coding tree unit. As an example, an example in which the size of the coding tree unit is 8 × 8 pixels will be described, but other sizes may be used. For example, the size may be any one of 32 × 32 pixels to 128 × 128 pixels.

画像の符号化に先立ち、量子化マトリクスの生成を行う。 Prior to image coding, a quantization matrix is generated.

量子化マトリクス保持部103は、まず、量子化マトリクスを生成し、保持する。具体的には、符号化されるサブブロックのサイズや予測方法の種類に応じて、量子化マトリクスを生成する。本実施形態では、図7(a)に示されるサブブロックに分割しない8×8画素の基本ブロックに対応する量子化マトリクス、及び、図7(b)に示される基本ブロックを四分木分割された4×4画素のサブブロックに対応する量子化マトリクスを生成する。すなわち、量子化マトリクス保持部103は、輝度(Y)成分用の8×8の量子化マトリクス及び4×4の量子化マトリクス、色差(Cb及びCr)成分用の4×4の量子化マトリクス及び2×2の量子化マトリクスを生成する。ただし、生成される量子化マトリクスはこれに限定されず、4×8や8×4など、サブブロックの形状に対応した量子化マトリクスが生成されてもよい。量子化マトリクスを構成する各要素(重み付けのための値)の決定方法は特に限定しない。例えば、所定の初期値を用いてもよいし、個別に設定してもよい。また、画像の特性に応じて生成されても構わない。 The quantization matrix holding unit 103 first generates and holds a quantization matrix. Specifically, a quantization matrix is generated according to the size of the encoded subblock and the type of prediction method. In the present embodiment, the quantization matrix corresponding to the 8 × 8 pixel basic block which is not divided into the sub-blocks shown in FIG. 7 (a) and the basic block shown in FIG. 7 (b) are divided into quadtrees. A quantization matrix corresponding to a subblock of 4 × 4 pixels is generated. That is, the quantization matrix holding unit 103 includes an 8 × 8 quantization matrix and a 4 × 4 quantization matrix for the brightness (Y) component, a 4 × 4 quantization matrix for the color difference (Cb and Cr) components, and the like. Generate a 2x2 quantization matrix. However, the generated quantization matrix is not limited to this, and a quantization matrix corresponding to the shape of the subblock, such as 4 × 8 or 8 × 4, may be generated. The method for determining each element (value for weighting) constituting the quantization matrix is not particularly limited. For example, a predetermined initial value may be used or may be set individually. Further, it may be generated according to the characteristics of the image.

量子化マトリクス保持部103は、このようにして生成された量子化マトリクスを、内部の不図示のメモリに保持する。図8(a)はイントラ予測を用いたY成分用の8×8の量子化マトリクス800を示している。また、図8(b)はインター予測を用いたY成分用の8×8の量子化マトリクス801を示している。図8(c)はイントラ予測を用いたY/Cb/Cr成分用の4×4の量子化マトリクス802を示している。同様に、図8(d)はインター予測を用いたY/Cb/Cr成分用の4×4の量子化マトリクス803を示している。また、図8(e)は同じくインター予測を用いたCb/Cr成分用の2×2の量子化マトリクス804を示している。 The quantization matrix holding unit 103 holds the quantization matrix thus generated in an internal memory (not shown). FIG. 8A shows an 8 × 8 quantization matrix 800 for the Y component using intra-prediction. Further, FIG. 8B shows an 8 × 8 quantization matrix 801 for the Y component using inter-prediction. FIG. 8 (c) shows a 4 × 4 quantization matrix 802 for the Y / Cb / Cr component using intra-prediction. Similarly, FIG. 8 (d) shows a 4 × 4 quantization matrix 803 for the Y / Cb / Cr component using inter-prediction. Further, FIG. 8E shows a 2 × 2 quantization matrix 804 for the Cb / Cr component, which also uses inter-prediction.

すなわち、本実施形態ではサブブロックの大きさが同一の場合、Y・Cb・Crといった色成分に関わらず同一の量子化マトリクスが用いられる。なお、本実施形態では、8×8画素の基本ブロックでイントラ予測を用いた場合、図7(b)に示される4分木分割をされても、輝度成分は4×4画素のサブブロックに分割されるが、色差成分は2×2画素のサブブロックに分割されないものとする。すなわち、この場合、色差成分は4×4画素の単位で処理されるため、4×4の量子化マトリクス802が用いられる。説明を簡易にするため、8×8の64画素分、4×4の16画素分及び2×2の4画素分の構成とし、太枠内の各正方形は量子化マトリクスを構成している各要素を表しているものとする。本実施形態では、図8(a)〜(e)に示された5種の量子化マトリクスが二次元の形状で保持されているものとするが、量子化マトリクス内の各要素はもちろんこれに限定されない。また、サブブロックのサイズによって、同じ色成分、同じ予測モードに対して複数の量子化マトリクスを保持することも可能である。 That is, in the present embodiment, when the subblock sizes are the same, the same quantization matrix is used regardless of the color components such as Y, Cb, and Cr. In the present embodiment, when the intra prediction is used in the basic block of 8 × 8 pixels, the brightness component is divided into the subblocks of 4 × 4 pixels even if the quadtree division shown in FIG. 7 (b) is performed. Although it is divided, it is assumed that the color difference component is not divided into 2 × 2 pixel subblocks. That is, in this case, since the color difference component is processed in units of 4 × 4 pixels, a 4 × 4 quantization matrix 802 is used. For the sake of simplicity, the configuration is 8 × 8 64 pixels, 4 × 4 16 pixels, and 2 × 2 4 pixels, and each square in the thick frame constitutes the quantization matrix. It shall represent an element. In the present embodiment, it is assumed that the five types of quantization matrices shown in FIGS. 8A to 8E are held in a two-dimensional shape, but each element in the quantization matrix is of course included in this. Not limited. It is also possible to hold multiple quantization matrices for the same color component and the same prediction mode, depending on the size of the subblock.

一般的に、量子化マトリクスは人間の視覚特性に応じた量子化処理を実現するため、図8(a)〜(e)に示すように量子化マトリクスの左上部分に相当する低周波部分の要素は小さく、右下部分に相当する高周波部分の要素は大きくなっている。要素の値が大きくなれば、量子化ステップも大きくなり、符号量が抑制されることとなる。 In general, in order to realize the quantization process according to the human visual characteristics, the quantization matrix is an element of a low frequency portion corresponding to the upper left portion of the quantization matrix as shown in FIGS. Is small, and the element of the high frequency part corresponding to the lower right part is large. As the value of the element increases, the quantization step also increases and the amount of code is suppressed.

量子化マトリクス符号化部113は、量子化マトリクス保持部106に保持されている二次元形状の量子化マトリクスを順に読み出し、各要素を走査して、要素間の差分値を算出し、差分値の集合である差分情報を符号化する。 The quantization matrix coding unit 113 reads out the two-dimensional shape quantization matrix held in the quantization matrix holding unit 106 in order, scans each element, calculates the difference value between the elements, and calculates the difference value between the elements. Encode the difference information that is a set.

図12は本実施形態において、量子化マトリクスの符号化に用いられるシンタックステーブルである。画像符号化装置100はこのシンタックステーブルに示されるシンタックスを少なくとも符号化する。このシンタックステーブルを用いて、本実施形態における図8(a)〜(e)に示された各量子化マトリクスの符号化処理について、具体的に説明する。ただし、図12は本実施形態における2×2〜8×8のサブブロックに対応する10種類の量子化マトリクスの符号化に用いられるテーブルであり、サブブロックの大きさの種類が増えれば符号化される量子化マトリクスの種類も増加する。 FIG. 12 is a syntax table used for coding the quantization matrix in the present embodiment. The image coding device 100 encodes at least the syntax shown in this syntax table. Using this syntax table, the coding process of each quantization matrix shown in FIGS. 8A to 8E in the present embodiment will be specifically described. However, FIG. 12 is a table used for coding 10 types of quantization matrices corresponding to 2 × 2 to 8 × 8 subblocks in the present embodiment, and if the types of subblock sizes increase, the coding will occur. The types of quantization matrix to be performed also increase.

まず、図12のシンタックステーブルの構造について説明する。まず、scaling_matrix_for_lfnst_disabled_flagは次のことを示すフラグである。つまり、予測誤差に直交変換を施して生成された直交変換係数に、さらに二次的な直交変換を施すサブブロックに対して、量子化マトリクスを用いた量子化を行うかを示すフラグである。本実施形態では、二次的な直交変換を用いていないため、scaling_matrix_for_lfnst_disabled_flagによる影響はないが、0を符号化するものとする。 First, the structure of the syntax table of FIG. 12 will be described. First, scaling_matrix_for_lfnst_disabled_flag is a flag indicating the following. That is, it is a flag indicating whether to perform quantization using a quantization matrix for a subblock that is further subjected to a secondary orthogonal transformation to the orthogonal transformation coefficient generated by subjecting the prediction error to the orthogonal transform. In this embodiment, since the secondary orthogonal transformation is not used, there is no influence by scaling_matrix_for_lfnst_disclosed_flag, but 0 is encoded.

次に、scaling_list_chroma_present_flagは、色差成分に対応する量子化マトリクス(chroma_scaling_lists)を符号化するか否かを示すフラグである。このフラグが1の場合は色差成分に対応する量子化マトリクスを符号化し、一方このフラグが0の場合は色差成分に対応する量子化マトリクスの符号化を省略する。 Next, scaling_list_chroma_present_flag is a flag indicating whether or not to encode the quantization matrix (chroma_scaling_lists) corresponding to the color difference component. When this flag is 1, the quantization matrix corresponding to the color difference component is encoded, while when this flag is 0, the coding of the quantization matrix corresponding to the color difference component is omitted.

なお、符号化対象の画像データがY成分だけを有している(モノクローム)場合にも、符号化部110はscaling_list_chroma_present_flagをビットストリームに符号化するようにしてもよい。つまり、モノクロームである場合でもモノクロームではない場合にも、符号化部110はscaling_list_chroma_present_flagをビットストリームに符号化するようにしてもよい。画像データがY成分だけを有している場合にも、scaling_list_chroma_present_flagをビットストリームに符号化することで次のような効果がある。つまり、画像データがモノクロームであるか否かに依存せずに、scaling_list_chroma_present_flagに基づいて、量子化処理や量子化マトリクスの符号化処理の内容を判断することができる。よって、処理が複雑になることを抑制することができる。 Even when the image data to be encoded has only the Y component (monochrome), the coding unit 110 may encode the scaling_list_chroma_present_flag into a bit stream. That is, the coding unit 110 may encode the scaling_list_chroma_present_flag into a bitstream regardless of whether it is monochrome or not. Even when the image data has only the Y component, encoding the scaling_list_chroma_present_flag into a bit stream has the following effects. That is, the contents of the quantization process and the coding process of the quantization matrix can be determined based on scaling_list_chroma_present_flag, regardless of whether the image data is monochrome or not. Therefore, it is possible to prevent the processing from becoming complicated.

本実施形態では、イントラ予測を用いたCb/Cr成分用の4×4の量子化マトリクス802は、同じくイントラ予測を用いたY成分の4×4の量子化マトリクス802と同一である。同様にインター予測を用いたCb/Cr成分用の4×4の量子化マトリクス803は、同じくインター予測を用いたY成分用の4×4の量子化マトリクス803と同一である。さらには、インター予測を用いたCb/Cr成分用の2×2の量子化マトリクス804は、インター予測を用いたY成分用の4×4の量子化マトリクス803の偶数行偶数列の各要素(10、20、20、27)を抽出することで生成することができる。 In the present embodiment, the 4 × 4 quantization matrix 802 for the Cb / Cr component using the intra prediction is the same as the 4 × 4 quantization matrix 802 for the Y component that also uses the intra prediction. Similarly, the 4 × 4 quantization matrix 803 for the Cb / Cr component using the inter-prediction is the same as the 4 × 4 quantization matrix 803 for the Y component also using the inter-prediction. Furthermore, the 2x2 quantization matrix 804 for the Cb / Cr component using the inter-prediction is each element of the even-numbered rows and even-columns of the 4x4 quantization matrix 803 for the Y component using the inter-prediction. It can be generated by extracting 10, 20, 20, 27).

言い換えれば、本実施形態では、全ての色差成分用の量子化マトリクスは、輝度成分用の量子化マトリクスを用いて生成することができる。よって、本実施形態では、各々の色差成分用の量子化マトリクスを示すデータを、直接的にビットストリームに符号化する代わりに、scaling_list_chroma_present_flagとして0を符号化することができる。それにより、色差成分用の量子化マトリクスの符号化を省略することができる。 In other words, in the present embodiment, the quantization matrix for all the color difference components can be generated by using the quantization matrix for the luminance component. Therefore, in the present embodiment, instead of directly encoding the data indicating the quantization matrix for each color difference component into a bit stream, 0 can be encoded as scaling_list_chroma_present_flag. Thereby, the coding of the quantization matrix for the color difference component can be omitted.

一方、本実施形態と異なり、少なくとも1つの色差成分用の量子化マトリクスが輝度成分用の量子化マトリクスから生成できない場合は、scaling_list_chroma_present_flagとして1を符号化する。そして色差成分用の量子化マトリクスをそれぞれ個別に符号化する。このように、符号化対象の画像データがY成分とCb成分とCr成分とを有する場合において、scaling_list_chroma_present_flagが1の場合は次のようになる。すなわち、量子化マトリクス符号化部113は、Y成分用の量子化マトリクスとCb/Cr成分用の量子化マトリクスとを符号化する。そして、変換・量子化部105は、Y成分用の量子化マトリクスを用いてY成分の量子化を行う。そして、変換・量子化部105は、Cb/Cr成分用の量子化マトリクスを用いてCb/Cr成分の量子化を行う。 On the other hand, unlike the present embodiment, when at least one quantization matrix for the color difference component cannot be generated from the quantization matrix for the luminance component, 1 is encoded as scaling_list_chroma_present_flag. Then, the quantization matrix for the color difference component is individually encoded. As described above, when the image data to be encoded has a Y component, a Cb component, and a Cr component, and the scaling_list_chroma_present_flag is 1, the result is as follows. That is, the quantization matrix coding unit 113 encodes the quantization matrix for the Y component and the quantization matrix for the Cb / Cr component. Then, the conversion / quantization unit 105 quantizes the Y component using the quantization matrix for the Y component. Then, the conversion / quantization unit 105 quantizes the Cb / Cr component using the quantization matrix for the Cb / Cr component.

次に、図12のシンタックステーブルにおいて、idというパラメータによるforループが存在する。idは量子化マトリクスの大きさや種類を示しており、同じ大きさの量子化マトリクスが連続して符号化されることになる。 Next, in the syntax table of FIG. 12, there is a for loop with a parameter called id. id indicates the size and type of the quantization matrix, and the quantization matrix of the same size is continuously encoded.

具体的には、id=0はインター予測を用いたCb成分用の2×2の量子化マトリクス、id=1はインター予測を用いたCr成分用の2×2の量子化マトリクスに対応する。id=2はイントラ予測を用いたY成分用の4×4の量子化マトリクスに対応する。id=3は同じくイントラ予測を用いたCb成分用の4×4の量子化マトリクスに対応する。id=4はイントラ予測を用いたCr成分用の4×4の量子化マトリクスに対応する。 Specifically, id = 0 corresponds to a 2 × 2 quantization matrix for the Cb component using inter-prediction, and id = 1 corresponds to a 2 × 2 quantization matrix for the Cr component using inter-prediction. id = 2 corresponds to a 4 × 4 quantization matrix for the Y component using intra-prediction. id = 3 corresponds to a 4 × 4 quantization matrix for the Cb component, also using intra-prediction. id = 4 corresponds to a 4 × 4 quantization matrix for the Cr component using intra-prediction.

同様にid=5はインター予測を用いたY成分用の4×4の量子化マトリクスに対応する。id=6はインター予測を用いたCb成分用の4×4の量子化マトリクスに対応する。id=7はインター予測を用いたCr成分用の4×4の量子化マトリクスに対応している。 Similarly, id = 5 corresponds to a 4 × 4 quantization matrix for the Y component using inter-prediction. id = 6 corresponds to a 4 × 4 quantization matrix for the Cb component using inter-prediction. id = 7 corresponds to a 4 × 4 quantization matrix for the Cr component using inter-prediction.

さらには、id=8はイントラ予測を用いたY成分用の8×8の量子化マトリクスに対応する。id=9はインター予測を用いたY成分用の8×8の量子化マトリクスに対応している。 Furthermore, id = 8 corresponds to an 8 × 8 quantization matrix for the Y component using intra-prediction. id = 9 corresponds to an 8 × 8 quantization matrix for the Y component using inter-prediction.

よって、本実施形態では2×2の量子化マトリクス群が符号化された後に、4×4の量子化マトリクス群、そして8×8の量子化マトリクス群といった順番に符号化されることを意味している。VVCでは最小2×2から64×64の大きさの直交変換が用いられており、それぞれに対応する量子化マトリクスを符号化する構成とすることも可能である。しかしながら、本実施形態では、最大の直交変換サイズ、すなわちサブブロックのサイズは8×8であるため、forループの上限値を、インター予測を用いたY成分用の8×8量子化マトリクスに対応するid=9としている。このようにして、forループの上限値を実際に用いる直交変換サイズの最大値に基づいて設定することで、不必要な量子化マトリクスの符号化を省略し、冗長な符号の発生を防止することができる。 Therefore, in the present embodiment, it means that the 2 × 2 quantization matrix group is encoded, and then the 4 × 4 quantization matrix group and the 8 × 8 quantization matrix group are encoded in this order. ing. In VVC, orthogonal transformation with a minimum magnitude of 2 × 2 to 64 × 64 is used, and it is also possible to encode a quantization matrix corresponding to each. However, in this embodiment, since the maximum orthogonal transformation size, that is, the size of the subblock is 8 × 8, the upper limit of the for loop corresponds to the 8 × 8 quantization matrix for the Y component using inter-prediction. Id = 9. In this way, by setting the upper limit of the for loop based on the maximum value of the orthogonal transform size actually used, unnecessary coding of the quantization matrix can be omitted and generation of redundant codes can be prevented. Can be done.

続いて、各量子化マトリクスの符号化手順について説明する。初めに、量子化マトリクス符号化部113は、scaling_list_chroma_present_flagやidに基づいた判定を行う。idを3で割った余りが2である場合、もしくはidが9である場合は、いずれかのY成分用の量子化マトリクスに対応しているため、対象となるY成分用の符号化を行う処理に移行する。一方、idがそれ以外の場合は、符号化の対象が、CbまたはCr成分用の量子化マトリクスとなるため、scaling_list_chroma_present_flagが1の場合のみ、対象となる色差成分用の量子化マトリクスを符号化する。 Subsequently, the coding procedure of each quantization matrix will be described. First, the quantization matrix coding unit 113 makes a determination based on scaling_list_chroma_present_flag and id. When the remainder obtained by dividing the id by 3 is 2, or when the id is 9, since it corresponds to the quantization matrix for any Y component, the coding for the target Y component is performed. Move to processing. On the other hand, when id is other than that, the object to be encoded is the quantization matrix for the Cb or Cr component. Therefore, only when the scalaring_list_chroma_present_flag is 1, the quantization matrix for the target color difference component is encoded. ..

本実施形態では、scaling_list_chroma_present_flagが0であるため、id=2、5、8、9に対応するY成分用の量子化マトリクスのみを符号化する。このように、符号化対象の画像データがY成分とCb成分とCr成分とを有する場合において、scaling_list_chroma_present_flagが0の場合は次のようになる。すなわち、量子化マトリクス符号化部113は、Y成分用の量子化マトリクスのみを符号化し、Cb/Cr成分用の量子化マトリクスは符号化しない。そして、変換・量子化部105は、Y成分用の量子化マトリクスを用いて、Cb/Cr成分の量子化を行う。 In this embodiment, since scaling_list_chroma_present_flag is 0, only the quantization matrix for the Y component corresponding to id = 2, 5, 8 and 9 is encoded. As described above, when the image data to be encoded has a Y component, a Cb component, and a Cr component, and the scaling_list_chroma_present_flag is 0, the result is as follows. That is, the quantization matrix coding unit 113 encodes only the quantization matrix for the Y component, and does not encode the quantization matrix for the Cb / Cr component. Then, the conversion / quantization unit 105 quantizes the Cb / Cr component using the quantization matrix for the Y component.

それぞれの量子化マトリクスの符号化においては、図12のシンタックステーブルでは、まず、scaling_list_copy_mode_flagを符号化する。符号化対象の量子化マトリクスが、符号化済の量子化マトリクスと同一である場合には、この値として1を符号化し、そうでない場合は0を符号化する。本実施形態では符号化対象の図8(a)〜(e)に示された各量子化マトリクスには全ての要素が同一のものが無いので、scaling_list_copy_mode_flagは0となる。 In the coding of each quantization matrix, in the syntax table of FIG. 12, first, scaling_list_copy_mode_flag is encoded. If the quantization matrix to be encoded is the same as the encoded quantization matrix, 1 is encoded as this value, and 0 is encoded otherwise. In the present embodiment, the scalaring_list_copy_mode_flag is 0 because not all the elements are the same in each of the quantization matrices shown in FIGS. 8A to 8E to be encoded.

続いて、scaling_list_copy_mode_flagが0の場合、符号化済の量子化マトリクスの各要素との予測差分符号化を用いるかを示すscaling_list_pred_mode_flagを符号化する。予測差分符号化を用いる場合にはscaling_list_pred_mode_flagは1となり、そうでない場合は0となる。本実施形態では、各量子化マトリクスの符号化に予測差分符号化を用いないため、scaling_list_pred_mode_flagとして0を符号化する。 Subsequently, when scaling_list_copy_mode_flag is 0, scaling_list_pred_mode_flag indicating whether to use the predicted difference coding with each element of the encoded quantization matrix is encoded. When predictive difference coding is used, scaling_list_pred_mode_flag is 1, otherwise it is 0. In this embodiment, since the prediction difference coding is not used for coding each quantization matrix, 0 is coded as scaling_list_pred_mode_flag.

次に、scaling_list_copy_mode_flagまたはscaling_list_pred_mode_flagが1の場合、scaling_list_pred_id_deltaを符号化する。scaling_list_pred_id_deltaは参照対象の符号化済量子化マトリクスの識別子を意味する。本実施形態では、scaling_list_copy_mode_flagもscaling_list_pred_mode_flagも0となるため、scaling_list_pred_id_deltaは符号化されない。 Next, when the scaling_list_copy_mode_flag or the scaling_list_pred_mode_flag is 1, the scaling_list_pred_id_delta is encoded. scaling_list_pred_id_delta means the identifier of the coded quantization matrix to be referenced. In this embodiment, neither the scaling_list_copy_mode_flag nor the scaling_list_pred_mode_flag is 0, so the scaling_list_pred_id_delta is not encoded.

続いて符号化対象の量子化マトリクスの各要素の差分の符号化に移る。量子化マトリクス符号化部113は、符号化対象の量子化マトリクスの各要素を、量子化マトリクスの大きさに応じて図9(a)〜(c)のいずれかを用いて走査して差分を計算し、一次元の行列に配置する。そして、量子化マトリクス符号化部113は、一次元の行列に配置された各差分値を、差分情報として符号化する。これは、図12のシンタックステーブルでは、scaling_list_delta_coefに相当する。 Next, we move on to coding the difference of each element of the quantization matrix to be coded. The quantization matrix coding unit 113 scans each element of the quantization matrix to be coded using any of FIGS. 9A to 9C according to the size of the quantization matrix to obtain a difference. Calculate and place in a one-dimensional matrix. Then, the quantization matrix coding unit 113 encodes each difference value arranged in the one-dimensional matrix as the difference information. This corresponds to scaling_list_delta_coef in the syntax table of FIG.

例えば、図8(c)の量子化マトリクス802の符号化においては、量子化マトリクス符号化部113は、図8(c)の量子化マトリクス802を、図9(b)を用いて走査し、要素ごとに走査順に直前の要素との差分を順次算出する。量子化マトリクス符号化部113は、算出された差分を一次元の行列に配置し、図10に示された一次元の差分値行列を得る。 For example, in the coding of the quantization matrix 802 of FIG. 8 (c), the quantization matrix coding unit 113 scans the quantization matrix 802 of FIG. 8 (c) using FIG. 9 (b). For each element, the difference from the immediately preceding element is sequentially calculated in the scanning order. The quantization matrix coding unit 113 arranges the calculated difference in a one-dimensional matrix, and obtains the one-dimensional difference value matrix shown in FIG.

ここで、例えば図8(c)の4×4画素分の量子化マトリクスは図9(b)で示された走査方法によって走査されるが、左上に位置する最初の要素6の次はそのすぐ下に位置する要素13が走査され、差分である+7が算出される。また、量子化マトリクスの最初の要素(本実施形態では6)の符号化には、所定の初期値(例えば8)との差分を計算するものとするが、もちろんこれに限定されず、任意の値との差分や、最初の要素の値そのものを用いてもよい。要するに、画像復号装置200と同じ初期値となっていればよい。そして、量子化マトリクス符号化部113は、図10の各差分値を符号化する。 Here, for example, the quantization matrix for 4 × 4 pixels in FIG. 8 (c) is scanned by the scanning method shown in FIG. 9 (b), but immediately after the first element 6 located in the upper left. The element 13 located below is scanned, and the difference +7 is calculated. Further, in the coding of the first element of the quantization matrix (6 in the present embodiment), the difference from a predetermined initial value (for example, 8) is calculated, but of course, the difference is not limited to this, and is arbitrary. The difference from the value or the value of the first element itself may be used. In short, it suffices if the initial value is the same as that of the image decoding device 200. Then, the quantization matrix coding unit 113 encodes each difference value in FIG. 10.

量子化マトリクス符号化部113は、上記のようにして生成した各量子化マトリクスの符号化結果として、量子化マトリクス符号データを生成する。本実施形態の量子化マトリクス符号化部113は、一次元の差分行列の個々の要素に対し、図11(a)に示される符号化テーブルを用いて、符号語を割り当てることで符号化し量子化マトリクス符号データを生成する。なお、符号化テーブルはこれに限定されず、例えば図11(b)に示される符号化テーブルを用いてもよい。このようにして、量子化マトリクス符号化部113は、生成した量子化マトリクス符号データを、後段の統合符号化部111に出力する。 The quantization matrix coding unit 113 generates the quantization matrix code data as the coding result of each quantization matrix generated as described above. The quantization matrix coding unit 113 of the present embodiment encodes and quantizes each element of the one-dimensional difference matrix by assigning a code word using the coding table shown in FIG. 11 (a). Generate matrix code data. The coding table is not limited to this, and for example, the coding table shown in FIG. 11B may be used. In this way, the quantization matrix coding unit 113 outputs the generated quantization matrix code data to the integrated coding unit 111 in the subsequent stage.

図1に戻り、統合符号化部111は画像データの符号化に必要なヘッダ情報に、量子化マトリクスの符号データを統合する。 Returning to FIG. 1, the integrated coding unit 111 integrates the code data of the quantization matrix into the header information required for encoding the image data.

続いて、画像データの符号化が行われる。入力端子101から入力された1フレーム分の画像データはブロック分割部102に供給される。 Subsequently, the image data is encoded. The image data for one frame input from the input terminal 101 is supplied to the block division unit 102.

ブロック分割部102は、入力された1フレームの画像データを複数の基本ブロックに分割し、基本ブロック単位の画像データを予測部104に出力する。本実施形態では、8×8画素の基本ブロック単位の画像データが予測部104に供給されることとなる。 The block division unit 102 divides the input one-frame image data into a plurality of basic blocks, and outputs the image data for each basic block to the prediction unit 104. In the present embodiment, image data in basic block units of 8 × 8 pixels is supplied to the prediction unit 104.

予測部104は、ブロック分割部102から入力された基本ブロック単位の画像データに対し予測処理を実行する。具体的には、適宜、基本ブロックをさらに細かいサブブロックに分割する際のサブブロック分割状態を決定し、さらにサブブロック単位でイントラ予測やインター予測などの予測モードを決定する。 The prediction unit 104 executes a prediction process on the image data of the basic block unit input from the block division unit 102. Specifically, the subblock division state when the basic block is divided into finer subblocks is determined as appropriate, and the prediction mode such as intra prediction or inter prediction is further determined for each subblock.

イントラ予測では符号化対象ブロックの空間的に周辺に位置する符号化済画素を用いて符号化対象ブロックの予測画素を生成し、水平予測や垂直予測、DC予測などのイントラ予測方法の内、使用したイントラ予測方法を示すイントラ予測モードも生成する。インター予測では符号化対象ブロックとは時間的に異なるフレームの符号化済画素を用いて符号化対象ブロックの予測画素を生成し、参照するフレームや動きベクトルなどを示す動き情報も生成する。 In intra-prediction, the predicted pixels of the coded block are generated using the coded pixels located in the spatial periphery of the coded block, and the prediction pixels of the coded block are used among the intra-prediction methods such as horizontal prediction, vertical prediction, and DC prediction. It also generates an intra-prediction mode that shows the intra-prediction method. In the inter-prediction, the predicted pixels of the coded block are generated using the encoded pixels of the frame that is different in time from the coded block, and the motion information indicating the frame to be referred to, the motion vector, and the like is also generated.

図7を参照してサブブロック分割方法を説明する。図7(a)〜(f)のブロック700〜705の太枠は基本ブロックと同じ8×8画素のサイズである。太枠内の各四角形はサブブロックを表している。図7(b)は従来の正方形サブブロック分割の一例を表しており、8×8画素の基本ブロック701は、4個の4×4画素のサブブロックに分割されている。 The sub-block division method will be described with reference to FIG. 7. The thick frames of the blocks 700 to 705 of FIGS. 7A to 7F have the same size of 8 × 8 pixels as the basic block. Each rectangle in the thick frame represents a subblock. FIG. 7B shows an example of the conventional square subblock division, and the 8 × 8 pixel basic block 701 is divided into four 4 × 4 pixel subblocks.

一方、図7(c)〜(f)は長方形サブブロック分割の一例を表している。図7(c)は、基本ブロック702が4×8画素サイズの2個のサブブロック(垂直方向に長手)に分割されることを示している。図7(d)は、基本ブロック703が、8×4画素サイズの2個のサブブロック(水平方向に長手)に分割されることを示している。図7(e)、(f)は、基本ブロック704、705の場合、分割方法が異なるものの、1:2:1の比で3つの長方形サブブロックに分割されている。このように正方形だけではなく、長方形のサブブロックも用いて符号化処理を行っている。 On the other hand, FIGS. 7 (c) to 7 (f) show an example of rectangular sub-block division. FIG. 7C shows that the basic block 702 is divided into two subblocks (longitudinal in the vertical direction) having a size of 4 × 8 pixels. FIG. 7D shows that the basic block 703 is divided into two subblocks (horizontally longitudinal) having a size of 8 × 4 pixels. 7 (e) and 7 (f) show that the basic blocks 704 and 705 are divided into three rectangular sub-blocks at a ratio of 1: 2: 1, although the division method is different. In this way, not only the square but also the rectangular sub-block is used for the coding process.

本実施形態では、8×8画素サイズの基本ブロックを、サブブロックに分割しない図7(a)及び四分木にサブブロック分割する図7(b)のいずれかが用いられるものとするが、サブブロック分割方法はこれに限定されない。図7(e)、(f)のような三分木分割または図7(c)や図7(d)のような二分木分割を用いても構わない。図7(a)や図7(b)以外のサブブロック分割も用いられる場合には、量子化マトリクス保持部103にて使用されるサブブロックに対応する量子化マトリクスが生成される。また、生成された量子化マトリクスは量子化マトリクス符号化部113にて符号化されることとなる。 In the present embodiment, either FIG. 7 (a) in which the basic block having an 8 × 8 pixel size is not divided into sub-blocks or FIG. 7 (b) in which the basic block having a size of 8 × 8 pixels is divided into sub-blocks is used. The subblock division method is not limited to this. A ternary tree division as shown in FIGS. 7 (e) and 7 (f) or a binary tree division as shown in FIGS. 7 (c) and 7 (d) may be used. When the sub-block partitioning other than those shown in FIGS. 7 (a) and 7 (b) is also used, the quantization matrix corresponding to the sub-block used in the quantization matrix holding unit 103 is generated. Further, the generated quantization matrix will be encoded by the quantization matrix coding unit 113.

予測部104は、決定した予測モード、及び、フレームメモリ108に格納されている符号化済の領域から予測画像データを生成し、さらに入力された画像データと前記予測画像データから画素単位の予測誤差を算出し、その誤差を変換・量子化部105に出力する。また、予測部104は、サブブロック分割や予測モードなどの情報を予測情報として、符号化部110、画像再生部107に出力する。 The prediction unit 104 generates prediction image data from the determined prediction mode and the encoded area stored in the frame memory 108, and further predicts an error in pixel units from the input image data and the prediction image data. Is calculated, and the error is output to the conversion / quantization unit 105. Further, the prediction unit 104 outputs information such as subblock division and prediction mode as prediction information to the coding unit 110 and the image reproduction unit 107.

変換・量子化部105は、予測部104より入力した予測誤差に対し、直交変換・量子化を行い、残差係数を生成する。具体的には、変換・量子化部105は、まず、予測誤差に対し、サブブロックのサイズに対応した直交変換処理を施し直交変換係数を生成する。そして、変換・量子化部105は、直交変換係数を予測モードや色成分に応じて量子化マトリクス保持部103に格納されている量子化マトリクスと、量子化パラメータとを用いて量子化し、残差係数を生成する。本実施形態では、サブブロック分割をせず、基本ブロックの大きさのままで、イントラ予測モードを用いた場合、Y成分の直交変換係数には図8(a)、Cb・Cr成分の直交変換係数には図8(c)の量子化マトリクスが用いられるものとする。また、同様にサブブロック分割をせず、基本ブロックの大きさのままで、代わりにインター予測モードを用いた場合、Y成分の直交変換係数には図8(b)、Cb・Cr成分の直交変換係数には図8(d)の量子化マトリクスが用いられるものとする。一方、図7(b)のサブブロック分割を行い、インター予測モードを用いた場合、Y成分の直交変換係数には図8(d)、Cb・Cr成分の直交変換係数には図8(e)の量子化マトリクスが用いられるものとする。ただし、使用される量子化マトリクスはこれに限定されない。生成された残差係数及び色差統合情報は符号化部110及び逆量子化・逆変換部106に出力される。 The conversion / quantization unit 105 performs orthogonal transformation / quantization on the prediction error input from the prediction unit 104 to generate a residual coefficient. Specifically, the conversion / quantization unit 105 first performs an orthogonal transformation process corresponding to the size of the subblock on the prediction error to generate an orthogonal transformation coefficient. Then, the conversion / quantization unit 105 quantizes the orthogonal transformation coefficient using the quantization matrix stored in the quantization matrix holding unit 103 according to the prediction mode and the color component, and the quantization parameter, and the residual Generate a coefficient. In the present embodiment, when the intra prediction mode is used without subblock division and the size of the basic block is used, the orthogonal transformation coefficient of the Y component is shown in FIG. 8A, and the orthogonal transformation of the Cb / Cr component is performed. It is assumed that the quantization matrix of FIG. 8 (c) is used for the coefficient. Similarly, when the inter-prediction mode is used instead of the size of the basic block without subblock division, the orthogonal transformation coefficient of the Y component is shown in FIG. 8 (b), and the orthogonality of the Cb / Cr components is orthogonal. It is assumed that the quantization matrix shown in FIG. 8D is used for the conversion coefficient. On the other hand, when the sub-block division of FIG. 7 (b) is performed and the inter-prediction mode is used, the orthogonal transformation coefficient of the Y component is shown in FIG. 8 (d), and the orthogonal transformation coefficient of the Cb / Cr component is shown in FIG. 8 (e). ) Quantization matrix shall be used. However, the quantization matrix used is not limited to this. The generated residual coefficient and color difference integrated information are output to the coding unit 110 and the inverse quantization / inverse conversion unit 106.

逆量子化・逆変換部106は、変換・量子化部105から入力した残差係数を、量子化マトリクス保持部103に格納されている量子化マトリクスと、量子化パラメータとを用いて逆量子化することで直交変換係数を再生する。逆量子化・逆変換部106は、さらに再生された直交変換係数を逆直交変換して予測誤差を再生する。 The inverse quantization / inverse conversion unit 106 inversely quantizes the residual coefficient input from the conversion / quantization unit 105 by using the quantization matrix stored in the quantization matrix holding unit 103 and the quantization parameter. By doing so, the orthogonal conversion coefficient is reproduced. The inverse quantization / inverse transformation unit 106 further performs inverse orthogonal transformation of the reproduced orthogonal transformation coefficient to reproduce the prediction error.

逆量子化処理には、変換・量子化部105と同様、符号化対象サブブロックの大きさや色成分に対応した量子化マトリクスが用いられる。具体的には、逆量子化・逆変換部106は、変換・量子化部105で用いられた量子化マトリクスと同一のものを用いて逆量子化を行う。すなわち、サブブロック分割をせず、イントラ予測モードを用いた場合、Y成分の直交変換係数には図8(a)、Cb・Cr成分の直交変換係数には図8(c)の量子化マトリクスが用いられる。また、同様にサブブロック分割をせず、代わりにインター予測モードを用いた場合、Y成分の直交変換係数には図8(b)、Cb・Cr成分の直交変換係数には図8(d)の量子化マトリクスが用いられる。 Similar to the conversion / quantization unit 105, the inverse quantization process uses a quantization matrix corresponding to the size and color component of the subblock to be encoded. Specifically, the inverse quantization / inverse conversion unit 106 performs inverse quantization using the same quantization matrix used in the conversion / quantization unit 105. That is, when the intra prediction mode is used without subblock division, the quantization matrix of FIG. 8 (a) is used for the orthogonal transformation coefficient of the Y component, and FIG. 8 (c) is used for the orthogonal transformation coefficient of the Cb / Cr component. Is used. Similarly, when the inter-prediction mode is used instead of subblock division, the orthogonal transformation coefficient of the Y component is shown in FIG. 8 (b), and the orthogonal transform coefficient of the Cb / Cr component is shown in FIG. 8 (d). Quantization matrix is used.

一方、図7(b)のサブブロック分割を行い、インター予測モードを用いた場合、Y成分の直交変換係数には図8(d)、Cb・Cr成分の直交変換係数には図8(e)の量子化マトリクスが用いられる。 On the other hand, when the sub-block division of FIG. 7 (b) is performed and the inter-prediction mode is used, the orthogonal transformation coefficient of the Y component is shown in FIG. 8 (d), and the orthogonal transformation coefficient of the Cb / Cr component is shown in FIG. 8 (e). ) Quantization matrix is used.

こうして再生された直交変換係数に逆直交変換を施して再生された予測誤差は画像再生部107に出力される。 The prediction error reproduced by applying the inverse orthogonal transformation to the orthogonal transformation coefficient reproduced in this way is output to the image reproduction unit 107.

画像再生部107は、予測部104から入力される予測情報に基づいて、フレームメモリ108を適宜参照し、予測画像を再生する。そして画像再生部107は、再生された予測画像と、逆量子化・逆変換部106により再生された予測誤差とに基づき、再生画像データを生成し、フレームメモリ108に格納する。 The image reproduction unit 107 appropriately refers to the frame memory 108 based on the prediction information input from the prediction unit 104, and reproduces the predicted image. Then, the image reproduction unit 107 generates the reproduced image data based on the reproduced predicted image and the prediction error reproduced by the inverse quantization / inverse conversion unit 106, and stores the reproduced image data in the frame memory 108.

インループフィルタ部109は、フレームメモリ108から再生画像データを読み出し、デブロッキングフィルタなどのインループフィルタ処理を行う。そして、インループフィルタ部109は、フィルタ処理された画像データをフレームメモリ108に再格納する。 The in-loop filter unit 109 reads the reproduced image data from the frame memory 108 and performs in-loop filter processing such as a deblocking filter. Then, the in-loop filter unit 109 re-stores the filtered image data in the frame memory 108.

符号化部110は、変換・量子化部105で生成されたサブブロック単位の残差係数や色差統合情報、並びに、予測部104から入力された予測情報をエントロピー符号化し、符号データを生成する。エントロピー符号化の方法は特に指定しないが、ゴロム符号化、算術符号化、ハフマン符号化などを用いることができる。符号化部110は、生成された符号データを統合符号化部111に出力する。 The coding unit 110 entropy-codes the residual coefficient and color difference integrated information for each subblock generated by the conversion / quantization unit 105, and the prediction information input from the prediction unit 104 to generate code data. The method of entropy coding is not particularly specified, but Golomb coding, arithmetic coding, Huffman coding, etc. can be used. The coding unit 110 outputs the generated code data to the integrated coding unit 111.

統合符号化部111は、前述のヘッダの符号データとともに、符号化部110から入力された符号データなどを多重化してビットストリームを形成する。そして、統合符号化部111は、形成したビットストリームを出力端子112から外部(記憶媒体やネットワークなど)に出力する。 The integrated coding unit 111 forms a bit stream by multiplexing the code data input from the coding unit 110 together with the code data of the header described above. Then, the integrated coding unit 111 outputs the formed bit stream from the output terminal 112 to the outside (storage medium, network, etc.).

図6(a)は本実施形態で出力されるビットストリームのデータ構造の一例である。シーケンスヘッダには、量子化マトリクスの符号データが含まれ、各量子化マトリクスの符号化結果で構成されている。ただし、符号化される位置はこれに限定されず、図6(b)のようなピクチャヘッダ部や複数のピクチャにまたがるヘッダ部に符号化される構成をとってももちろん構わない。また、1つのシーケンスの中で量子化マトリクスの変更を行う場合、量子化マトリクスを新たに符号化することで更新することも可能である。この際、全ての量子化マトリクスを書き換えてもよいし、書き換える量子化マトリクスに対応する量子化マトリクスの大きさや予測モード、色成分を指定することでその一部を変更するようにすることも可能である。 FIG. 6A is an example of the data structure of the bitstream output in the present embodiment. The sequence header contains the code data of the quantization matrix, and is composed of the coded results of each quantization matrix. However, the encoded position is not limited to this, and of course, a configuration in which the image header portion as shown in FIG. 6B or the header portion spanning a plurality of pictures may be encoded may be used. Further, when the quantization matrix is changed in one sequence, it can be updated by newly encoding the quantization matrix. At this time, all the quantization matrices may be rewritten, or some of them may be changed by specifying the size, prediction mode, and color component of the quantization matrix corresponding to the rewritten quantization matrix. Is.

図3は、実施形態の画像符号化装置100における制御部150の1フレーム分の符号化処理を示すフローチャートである。 FIG. 3 is a flowchart showing the coding process for one frame of the control unit 150 in the image coding device 100 of the embodiment.

まず、画像の符号化に先立ち、S301にて、制御部150は、量子化マトリクス保持部103を制御し、二次元の量子化マトリクスを生成させ、保持させる。本実施形態の量子化マトリクス保持部103は、8×8〜2×2画素のブロックに対応し、図8(a)〜(e)に示されるそれぞれの色成分や予測モードに対応した量子化マトリクスを生成し、保持することになる。 First, prior to image coding, in S301, the control unit 150 controls the quantization matrix holding unit 103 to generate and hold a two-dimensional quantization matrix. The quantization matrix holding unit 103 of the present embodiment corresponds to a block of 8 × 8 to 2 × 2 pixels, and quantizes corresponding to each color component and prediction mode shown in FIGS. 8 (a) to 8 (e). It will generate and hold a matrix.

S302にて、制御部150は、量子化マトリクス符号化部113を制御し、S301にて生成・保持された量子化マトリクスの符号化を行わせる。ここでの量子化マトリクス符号化部113の具体的な動作は、説明済であるため省略する。本実施形態では、制御部150は、量子化マトリクス符号化部113を制御し、図8(a)〜(e)に示された量子化マトリクス800〜804を図12のシンタックステーブルに基づいた符号化を行わせ、量子化マトリクス符号データを生成させる。 In S302, the control unit 150 controls the quantization matrix coding unit 113 to encode the quantization matrix generated and held in S301. The specific operation of the quantization matrix coding unit 113 here has already been described and will be omitted. In the present embodiment, the control unit 150 controls the quantization matrix coding unit 113, and the quantization matrices 800 to 804 shown in FIGS. 8 (a) to 8 (e) are based on the syntax table of FIG. Encoding is performed and quantization matrix code data is generated.

S303にて、制御部150は、統合符号化部111を制御し、生成された量子化マトリクス符号データとともに、画像データの符号化に必要なヘッダ情報を符号化し、出力させる。 In S303, the control unit 150 controls the integrated coding unit 111 to encode and output the header information necessary for coding the image data together with the generated quantization matrix code data.

ステップS304にて、制御部150は、ブロック分割部102を制御し、フレーム単位の入力画像を基本ブロック単位に分割させる。 In step S304, the control unit 150 controls the block division unit 102 to divide the input image in frame units into basic block units.

S305にて、制御部150は、予測部104を制御し、S304にて生成された基本ブロック単位の画像データに対して、予測処理を実行させ、サブブロック分割情報や予測モードなどの予測情報及び予測画像データを生成させる。さらに、制御部150は、予測部104を制御して、入力された画像データと予測画像データから予測誤差を算出させる。 In S305, the control unit 150 controls the prediction unit 104 to execute prediction processing on the image data of the basic block unit generated in S304, and predictive information such as sub-block division information and prediction mode and Generate predicted image data. Further, the control unit 150 controls the prediction unit 104 to calculate the prediction error from the input image data and the prediction image data.

S306にて、制御部150は、変換・量子化部105を制御し、S305で算出された予測誤差に対して直交変換を行わせ、直交変換係数を生成させる。さらに、制御部150は、変換・量子化部105を制御し、S301にて生成・保持された量子化マトリクスと、量子化パラメータとを用いて量子化を行わせ、残差係数を生成させる。本実施形態では、サブブロックのサイズや予測モード、色成分に応じて、図8(a)〜図8(e)の量子化マトリクスが用いられるものとする。 In S306, the control unit 150 controls the conversion / quantization unit 105 to perform orthogonal transformation on the prediction error calculated in S305, and generate an orthogonal transformation coefficient. Further, the control unit 150 controls the conversion / quantization unit 105 to perform quantization using the quantization matrix generated / held in S301 and the quantization parameters to generate a residual coefficient. In this embodiment, it is assumed that the quantization matrix of FIGS. 8 (a) to 8 (e) is used according to the size of the subblock, the prediction mode, and the color component.

S307にて、制御部150は、逆量子化・逆変換部106を制御し、S306で生成された残差係数を、S301にて生成・保持された量子化マトリクスと、量子化パラメータとを用いて逆量子化を行わせ、直交変換係数を再生させる。本ステップではS306で用いられた量子化マトリクスと同一のものが用いられ、逆量子化処理が行われる。そして、再生された直交変換係数に対して逆直交変換し、予測誤差を再生する。 In S307, the control unit 150 controls the inverse quantization / inverse conversion unit 106, and uses the quantization matrix generated / held in S301 and the quantization parameter for the residual coefficient generated in S306. Inverse quantization is performed to regenerate the orthogonal conversion coefficient. In this step, the same quantization matrix used in S306 is used, and the inverse quantization process is performed. Then, the reproduced orthogonal transformation coefficient is inversely orthogonally converted, and the prediction error is reproduced.

S308にて、制御部150は、画像再生部107を制御し、S305で生成された予測情報に基づいて予測画像を再生させ、再生された予測画像とS307で生成された予測誤差から画像データを再生させ、フレームメモリ108に格納させる。 In S308, the control unit 150 controls the image reproduction unit 107, reproduces the predicted image based on the prediction information generated in S305, and generates image data from the reproduced predicted image and the prediction error generated in S307. It is reproduced and stored in the frame memory 108.

S309にて、制御部150は、符号化部110を制御し、S305で生成された予測情報及びS306で生成された残差係数の符号化を行わせ、符号データを生成させる。また、符号化部110は、生成した符号データを統合符号化部111に出力する。統合符号化部111は、符号化部110からの符号化データを、先に生成したヘッダに後続するように位置させ、出力する。 In S309, the control unit 150 controls the coding unit 110 to encode the prediction information generated in S305 and the residual coefficient generated in S306 to generate code data. Further, the coding unit 110 outputs the generated code data to the integrated coding unit 111. The integrated coding unit 111 positions and outputs the coded data from the coding unit 110 so as to follow the previously generated header.

S310にて、制御部150は、着目フレーム内の全ての基本ブロックの符号化が終了したか否かの判定を行う。制御部150は、終了していると判定した場合にはS311に進め、未符号化の基本ブロックが残っていると判断した場合にはS304に処理を戻し、次の基本ブロックに対する符号化を継続させる。 In S310, the control unit 150 determines whether or not the coding of all the basic blocks in the frame of interest has been completed. The control unit 150 proceeds to S311 when it determines that it has finished, returns processing to S304 when it determines that an uncoded basic block remains, and continues encoding for the next basic block. Let me.

S311にて、制御部150は、インループフィルタ部109を制御し、S308で再生された画像データに対し、インループフィルタ処理を行い、フィルタ処理された画像を生成し、処理を終了する。 In S311 the control unit 150 controls the in-loop filter unit 109, performs in-loop filter processing on the image data reproduced in S308, generates a filtered image, and ends the processing.

以上の構成と動作、特にS302において、色差成分に対応する量子化マトリクスの符号化を省略し、輝度成分に対応する量子化マトリクスのみを符号化することで、量子化マトリクスによる発生符号量を抑制させることができる。 In the above configuration and operation, especially in S302, the amount of code generated by the quantization matrix is suppressed by omitting the coding of the quantization matrix corresponding to the color difference component and coding only the quantization matrix corresponding to the luminance component. Can be made to.

なお、本実施形態では、色差成分に対応する2×2の量子化マトリクス804を輝度成分に対応する4×4の量子化マトリクス803の偶数行偶数列成分を間引いて生成するものとしたが、生成方法はこれに限定されない。例えば、図8(f)に示され、量子化マトリクスを用いない場合に基準となる、全ての要素が均一なフラットな量子化マトリクス805を用いる構成としても構わない。これにより、2×2の量子化マトリクスを生成するための演算処理を低減し、さらには周波数分解性能が相対的に劣る2×2直交変換における各周波数成分に対する量子化時の重みづけを軽減することができる。 In the present embodiment, the 2 × 2 quantization matrix 804 corresponding to the color difference component is generated by thinning out the even-numbered rows / even-column components of the 4 × 4 quantization matrix 803 corresponding to the luminance component. The generation method is not limited to this. For example, a configuration using a flat quantization matrix 805 in which all the elements are uniform, which is shown in FIG. 8 (f) and serves as a reference when the quantization matrix is not used, may be used. As a result, the arithmetic processing for generating the 2 × 2 quantization matrix is reduced, and further, the weighting at the time of quantization for each frequency component in the 2 × 2 orthogonal transformation in which the frequency decomposition performance is relatively inferior is reduced. be able to.

また、本実施形態では、色差成分に対応する量子化マトリクスは、全て輝度成分に対応する量子化マトリクスと同一もしくは生成可能である形態として説明したが、用いられる量子化マトリクスはこれらに限定されない。 Further, in the present embodiment, the quantization matrix corresponding to the color difference component has been described as the same as or can be generated as the quantization matrix corresponding to the luminance component, but the quantization matrix used is not limited thereto.

例えば、図13に示されたような量子化マトリクス群を本実施形態で用いることも可能である。図13(a)はイントラ予測を用いたY成分用の8×8の量子化マトリクス1300を示している。また、図13(d)はインター予測を用いたY成分用の8×8の量子化マトリクス1303を示している。図13(b)はイントラ予測を用いたCb成分用の4×4の量子化マトリクス1301を示しており、図13(c)はイントラ予測を用いたCr成分用の4×4の量子化マトリクス1302を示している。 For example, it is also possible to use the quantization matrix group as shown in FIG. 13 in this embodiment. FIG. 13 (a) shows an 8 × 8 quantization matrix 1300 for the Y component using intra-prediction. Further, FIG. 13D shows an 8 × 8 quantization matrix 1303 for the Y component using inter-prediction. FIG. 13 (b) shows a 4 × 4 quantization matrix 1301 for the Cb component using intra-prediction, and FIG. 13 (c) shows a 4 × 4 quantization matrix for the Cr component using intra-prediction. It shows 1302.

同様に、図13(e)はインター予測を用いたCb成分用の4×4の量子化マトリクス1304を示しており、図13(f)はインター予測を用いたCr成分用の4×4の量子化マトリクス1305を示している。 Similarly, FIG. 13 (e) shows a 4x4 quantization matrix 1304 for the Cb component using inter-prediction, and FIG. 13 (f) shows 4x4 for the Cr component using inter-prediction. The quantization matrix 1305 is shown.

また、図13(g)はイントラ予測を用いたY成分用の4×4の量子化マトリクス1306を示しており、図13(h)はインター予測を用いたY成分用の4×4の量子化マトリクス1307を示している。 Further, FIG. 13 (g) shows a 4 × 4 quantization matrix 1306 for the Y component using intra-prediction, and FIG. 13 (h) shows a 4 × 4 quantum for the Y component using inter-prediction. Quantization matrix 1307 is shown.

さらに、図13(i)はインター予測を用いたCb成分用の2×2の量子化マトリクス1308を示しており、図13(j)はインター予測を用いたCr成分用の2×2の量子化マトリクス1309を示している。言い換えると、図13(a)、図13(d)、図13(g)、図13(h)は輝度成分に対応する量子化マトリクス群である。また、図13(b)、図13(c)、図13(e)、図13(f)、図13(i)、図13(j)は色差成分に対応する量子化マトリクスとみなすことができる。この場合、輝度成分に対応する量子化マトリクス群を用いて色差成分に対応する量子化マトリクス群の全てを生成することはできないので、色差成分に対応する量子化マトリクス群を符号化する必要がある。 Further, FIG. 13 (i) shows a 2 × 2 quantization matrix 1308 for the Cb component using inter-prediction, and FIG. 13 (j) shows a 2 × 2 quantum for the Cr component using inter-prediction. Quantization matrix 1309 is shown. In other words, FIGS. 13 (a), 13 (d), 13 (g), and 13 (h) are quantization matrix groups corresponding to the luminance components. Further, FIGS. 13 (b), 13 (c), 13 (e), 13 (f), 13 (i), and 13 (j) can be regarded as a quantization matrix corresponding to the color difference component. can. In this case, since it is not possible to generate all of the quantization matrix groups corresponding to the color difference component using the quantization matrix group corresponding to the luminance component, it is necessary to encode the quantization matrix group corresponding to the color difference component. ..

よって、量子化マトリクス符号化部113は、scaling_list_chroma_present_flagとして1を符号化し、id=0、1、3、4、6、7に対応する色差成分用の量子化マトリクスを符号化する。これにより、輝度成分と色差成分に対して異なる量子化制御を施したいときに、色成分ごとに異なる量子化マトリクスを設定し、符号化することもできる。 Therefore, the quantization matrix coding unit 113 encodes 1 as scaling_list_chroma_present_flag, and encodes the quantization matrix for the color difference component corresponding to id = 0, 1, 3, 4, 6, and 7. Thereby, when it is desired to apply different quantization control to the luminance component and the color difference component, it is possible to set a different quantization matrix for each color component and encode it.

図2は、本実施形態における前述の画像符号化装置100で生成された符号化画像データ(ビットストリーム)を復号する画像復号装置200のブロック図である。以下、図2を参照し、復号処理に係る構成とその動作を説明する。 FIG. 2 is a block diagram of an image decoding device 200 that decodes the coded image data (bit stream) generated by the image coding device 100 described in the present embodiment. Hereinafter, the configuration and its operation related to the decoding process will be described with reference to FIG.

画像復号装置200は、装置全体の制御を行う制御部250を有する。また、画像復号装置200は、入力端子201、分離復号部202、復号部203、逆量子化・逆変換部204、画像再生部205、フレームメモリ206、インループフィルタ部207、出力端子208、及び、量子化マトリクス復号部209を有する。なお、分離復号部202と、復号部203と、量子化マトリクス復号部209とは協働して、各データをビットストリームから復号する復号手段として機能する。 The image decoding device 200 has a control unit 250 that controls the entire device. Further, the image decoding device 200 includes an input terminal 201, a separation decoding unit 202, a decoding unit 203, an inverse quantization / inverse conversion unit 204, an image reproduction unit 205, a frame memory 206, an in-loop filter unit 207, an output terminal 208, and the like. , Has a quantization matrix decoding unit 209. The separation decoding unit 202, the decoding unit 203, and the quantization matrix decoding unit 209 cooperate with each other to function as a decoding means for decoding each data from the bit stream.

入力端子201は、符号化されたビットストリームを入力するものであり、入力源は例えば符号化ストリームを格納した記憶媒体であるが、ネットワークから入力してもよく、その種類は問わない。 The input terminal 201 inputs a coded bit stream, and the input source is, for example, a storage medium storing the coded stream, but it may be input from a network, and the type thereof does not matter.

分離復号部202は、ビットストリームから復号処理に関する情報や係数に関する符号データに分離し、またビットストリームのヘッダ部に存在する符号データを復号する。本実施形態の分離復号部202は、量子化マトリクス符号データを分離し、量子化マトリクス復号部209に出力する。また、分離復号部202は、画像の符号データを復号部203に出力する。つまり、分離復号部202は、図1の統合符号化部111と逆の動作を行う。 The separation / decoding unit 202 separates the bitstream into code data related to information related to the decoding process and coefficients, and decodes the code data existing in the header part of the bitstream. The separation / decoding unit 202 of the present embodiment separates the quantization matrix code data and outputs it to the quantization matrix decoding unit 209. Further, the separation / decoding unit 202 outputs the code data of the image to the decoding unit 203. That is, the separation / decoding unit 202 performs the reverse operation of the integrated coding unit 111 of FIG.

量子化マトリクス復号部209は、分離復号部202より供給された量子化マトリクス符号データを復号することで量子化マトリクスを再生し、保持する。具体的には、量子化マトリクス復号部209は、量子化マトリクスの差分行列における各差分値を、前述の初期値から順次加算することによって、量子化マトリクスにおける各要素を再生する。そして、量子化マトリクス復号部209は、例えば、その再生した一次元の各要素を図9に示される走査方法に従って、順番に2次元の量子化マトリクスの各要素に対応付けることで、2次元の量子化マトリクスを再生する。 The quantization matrix decoding unit 209 reproduces and holds the quantization matrix by decoding the quantization matrix code data supplied from the separation decoding unit 202. Specifically, the quantization matrix decoding unit 209 reproduces each element in the quantization matrix by sequentially adding each difference value in the difference matrix of the quantization matrix from the above-mentioned initial value. Then, the quantization matrix decoding unit 209, for example, associates each of the reproduced one-dimensional elements with each element of the two-dimensional quantization matrix in order according to the scanning method shown in FIG. 9, thereby forming a two-dimensional quantum. Regenerate the quantization matrix.

復号部203は、分離復号部202から出力された画像の符号データを復号し、残差係数及び予測情報を再生する。 The decoding unit 203 decodes the code data of the image output from the separation decoding unit 202, and reproduces the residual coefficient and the prediction information.

逆量子化・逆変換部204は、図1の逆量子化・逆変換部106と同様、再生された量子化マトリクスと、量子化パラメータとを用いて残差係数に対して逆量子化を行い、逆量子化後の直交変換係数を得る。逆量子化・逆変換部204は、さらに、直交変換係数に対して逆直交変換を実行することで、予測誤差を再生する。前述のように、量子化マトリクスと量子化パラメータとを用いて、直交変換係数を再生(導出)する処理を逆量子化と称するものとする。また、逆量子化を行う機能と、逆直交変換を行う機能とは別々の構成にしてもよい。また、量子化パラメータを導出するための情報も復号部203によってビットストリームから復号される。 Similar to the inverse quantization / inverse conversion unit 106 of FIG. 1, the inverse quantization / inverse conversion unit 204 performs inverse quantization on the residual coefficient using the regenerated quantization matrix and the quantization parameter. , Obtain the orthogonal conversion coefficient after dequantization. The inverse quantization / inverse conversion unit 204 further reproduces the prediction error by executing the inverse orthogonal transformation with respect to the orthogonal transformation coefficient. As described above, the process of reproducing (deriving) the orthogonal transform coefficient using the quantization matrix and the quantization parameter is referred to as inverse quantization. Further, the function of performing inverse quantization and the function of performing inverse orthogonal transformation may be configured separately. The information for deriving the quantization parameter is also decoded from the bit stream by the decoding unit 203.

画像再生部205は、入力された予測情報に基づいてフレームメモリ206を適宜参照して予測画像データを生成する。画像再生部205は、イントラ予測及びインター予測の2種類の予測方法のいずれかを用いて、サブブロック単位に予測画像データを生成する。また、イントラ予測とインター予測とを組み合わせた予測方法が用いられてもよい。 The image reproduction unit 205 appropriately refers to the frame memory 206 based on the input prediction information to generate the prediction image data. The image reproduction unit 205 generates predicted image data in sub-block units by using one of two types of prediction methods, intra-prediction and inter-prediction. In addition, a prediction method that combines intra-prediction and inter-prediction may be used.

そして、画像再生部205は、この予測画像データと逆量子化・逆変換部204で再生された予測誤差から再生画像データを生成する。具体的には、画像再生部205は、予測画像データと予測誤差とを加算することによって画像データを再生し、フレームメモリ206に格納する。 Then, the image reproduction unit 205 generates the reproduced image data from the predicted image data and the prediction error reproduced by the inverse quantization / inverse conversion unit 204. Specifically, the image reproduction unit 205 reproduces the image data by adding the predicted image data and the prediction error, and stores the image data in the frame memory 206.

インループフィルタ部207は、図1のインループフィルタ部109と同様、フレームメモリ206に格納された再生画像データに対し、デブロッキングフィルタなどのインループフィルタ処理を行い、処理後の画像データをフレームメモリ206に再格納する。 Similar to the in-loop filter unit 109 of FIG. 1, the in-loop filter unit 207 performs in-loop filter processing such as a deblocking filter on the reproduced image data stored in the frame memory 206, and frames the processed image data. Restore in memory 206.

出力端子208は、フレームメモリ206に格納されたフレーム画像を順次、外部に出力する。出力先は表示装置が一般的であるが、他のデバイスであっても構わない。 The output terminal 208 sequentially outputs the frame images stored in the frame memory 206 to the outside. The output destination is generally a display device, but other devices may be used.

上記実施形態の画像復号装置200の画像の復号に係る動作をさらに詳しく説明する。本実施形態では、符号化されたビットストリームをフレーム単位で入力する構成となっている。 The operation related to image decoding of the image decoding apparatus 200 of the above embodiment will be described in more detail. In the present embodiment, the encoded bit stream is input in frame units.

図2において、入力端子201から入力された1フレーム分のビットストリームは分離復号部202に供給される。分離復号部202では、ビットストリームから復号処理に関する情報や係数に関する符号データに分離し、ビットストリームのヘッダ部に存在する符号データを復号する。 In FIG. 2, the bit stream for one frame input from the input terminal 201 is supplied to the separation / decoding unit 202. The separation / decoding unit 202 separates the bitstream into information related to the decoding process and code data related to the coefficient, and decodes the code data existing in the header unit of the bitstream.

そして、分離復号部202には、ヘッダ部に含まれていた量子化マトリクス符号データを量子化マトリクス復号部209に供給し、画像データの符号データを復号部203に供給する。具体的には、分離復号部202は、まず、図6(a)に示されるビットストリームのシーケンスヘッダから量子化マトリクス符号データを抽出し、量子化マトリクス復号部209に出力する。本実施形態では、図8(a)〜(e)に示される量子化マトリクスに対応する量子化マトリクス符号データが抽出、出力される。続いて、ピクチャデータの基本ブロック単位の符号データを抽出し、復号部203に出力する。 Then, the separation / decoding unit 202 supplies the quantization matrix code data included in the header unit to the quantization matrix decoding unit 209, and supplies the code data of the image data to the decoding unit 203. Specifically, the separation / decoding unit 202 first extracts the quantization matrix code data from the sequence header of the bitstream shown in FIG. 6A and outputs the quantization matrix code data to the quantization matrix decoding unit 209. In the present embodiment, the quantization matrix code data corresponding to the quantization matrix shown in FIGS. 8A to 8E is extracted and output. Subsequently, the code data of the basic block unit of the picture data is extracted and output to the decoding unit 203.

量子化マトリクス復号部209は、まず入力された量子化マトリクス符号データを復号し、図12に示されたシンタックステーブルに基づいて、符号化側で生成された各量子化マトリクスの符号化結果を再生する。まず、量子化マトリクス復号部209がscaling_matrix_for_lfnst_disabled_flagを復号し、値として0を得る。本実施形態では二次逆変換を用いていないため、この値による影響はない。続いてscaling_list_chroma_present_flagをビットストリームから復号する。ここでは、その値は0であるものとする。これにより、ビットストリームには色差成分に対応する量子化マトリクスが符号化されていないことが分かる。このように、復号対象の画像データがY成分とCb成分とCr成分とを有する場合において、scaling_list_chroma_present_flagが0の場合は、例えば、次のようになる。すなわち、量子化マトリクス復号部209は、符号化対象のブロックの処理のために、Y成分用の量子化マトリクスのみを復号し、Cb/Cr成分用の量子化マトリクスは復号しない。そして、逆量子化・逆変換部204は、Y成分用の量子化マトリクスを用いて、Cb/Cr成分の逆量子化も行う。 The quantization matrix decoding unit 209 first decodes the input quantization matrix code data, and based on the syntax table shown in FIG. 12, obtains the coding result of each quantization matrix generated on the coding side. Reproduce. First, the quantization matrix decoding unit 209 decodes scaling_matrix_for_lfnst_dismade_flag and obtains 0 as a value. Since the quadratic inverse transformation is not used in this embodiment, this value has no effect. Subsequently, scaling_list_chroma_present_flag is decoded from the bitstream. Here, it is assumed that the value is 0. From this, it can be seen that the quantization matrix corresponding to the color difference component is not encoded in the bit stream. As described above, when the image data to be decoded has a Y component, a Cb component, and a Cr component, and the scaling_list_chroma_present_flag is 0, for example, it is as follows. That is, the quantization matrix decoding unit 209 decodes only the quantization matrix for the Y component and does not decode the quantization matrix for the Cb / Cr component in order to process the block to be encoded. Then, the inverse quantization / inverse transformation unit 204 also performs the inverse quantization of the Cb / Cr component by using the quantization matrix for the Y component.

また、復号対象の画像データがY成分だけを有している(モノクローム)場合にも、復号部203はscaling_list_chroma_present_flagをビットストリームから復号するようにしてもよい。つまり、モノクロームである場合でもモノクロームではない場合にも、復号部203はscaling_list_chroma_present_flagをビットストリームに復号するようにしてもよい。画像データがY成分だけを有している場合にも、scaling_list_chroma_present_flagをビットストリームから復号することで次のような効果がある。つまり、画像データがモノクロームであるか否かに依存せずに、scaling_list_chroma_present_flagに基づいて、逆量子化処理や量子化マトリクスの復号処理の内容を判断することができる。よって、処理が複雑になることを抑制することができる。 Further, even when the image data to be decoded has only the Y component (monochrome), the decoding unit 203 may decode the scaling_list_chroma_present_flag from the bit stream. That is, the decoding unit 203 may decode the scaling_list_chroma_present_flag into a bitstream regardless of whether it is monochrome or not. Even when the image data has only the Y component, decoding the scaling_list_chroma_present_flag from the bitstream has the following effects. That is, the contents of the inverse quantization process and the decoding process of the quantization matrix can be determined based on scaling_list_chroma_present_flag, regardless of whether the image data is monochrome or not. Therefore, it is possible to prevent the processing from becoming complicated.

次に、idという量子化マトリクスの大きさや種類に基づいたパラメータによるforループがあるため、idの値に対応した量子化マトリクスの復号処理を行う。 Next, since there is a for loop with parameters based on the size and type of the quantization matrix called id, the decoding process of the quantization matrix corresponding to the id value is performed.

具体的には、id=0はインター予測を用いたCb成分用の2×2の量子化マトリクス、id=1はインター予測を用いたCr成分用の2×2の量子化マトリクスが対応している。id=2はイントラ予測を用いたY成分用の4×4の量子化マトリクス、id=3は同じくイントラ予測を用いたCb成分用の4×4の量子化マトリクス、id=4はイントラ予測を用いたCr成分用の4×4の量子化マトリクスが対応している。 Specifically, id = 0 corresponds to a 2 × 2 quantization matrix for the Cb component using inter-prediction, and id = 1 corresponds to a 2 × 2 quantization matrix for the Cr component using inter-prediction. There is. id = 2 is a 4x4 quantization matrix for the Y component using intra-prediction, id = 3 is a 4x4 quantization matrix for the Cb component that also uses intra-prediction, and id = 4 is an intra-prediction. The 4 × 4 quantization matrix for the Cr component used corresponds.

同様にid=5はインター予測を用いたY成分用の4×4の量子化マトリクス、id=6はインター予測を用いたCb成分用の4×4の量子化マトリクス、id=7はインター予測を用いたCr成分用の4×4の量子化マトリクスが対応している。さらには、id=8はイントラ予測を用いたY成分用の8×8の量子化マトリクス、id=9はインター予測を用いたY成分用の8×8の量子化マトリクスが対応している。 Similarly, id = 5 is a 4 × 4 quantization matrix for the Y component using inter-prediction, id = 6 is a 4 × 4 quantization matrix for the Cb component using inter-prediction, and id = 7 is inter-prediction. A 4 × 4 quantization matrix for the Cr component using is supported. Furthermore, id = 8 corresponds to an 8 × 8 quantization matrix for the Y component using intra-prediction, and id = 9 corresponds to an 8 × 8 quantization matrix for the Y component using inter-prediction.

よって、このidによるforループの処理を行うと、同じ大きさの量子化マトリクスが連続して復号されることとなる。すなわち、本実施形態では2×2の量子化マトリクス群が復号された後に、4×4の量子化マトリクス群、そして8×8の量子化マトリクス群といった順番に復号されることを意味している。VVCでは最小2×2から64×64の大きさの直交変換が用いられており、それぞれに対応する量子化マトリクスを符号化する構成とすることも可能である。しかしながら、本実施形態では、最大の直交変換サイズ、すなわちサブブロックのサイズは8×8であるため、forループの上限値を、インター予測を用いたY成分用の8×8量子化マトリクスに対応するid=9としている。 Therefore, when the for loop processing by this id is performed, the quantization matrix of the same size is continuously decoded. That is, in the present embodiment, it means that after the 2 × 2 quantization matrix group is decoded, the 4 × 4 quantization matrix group and the 8 × 8 quantization matrix group are decoded in this order. .. In VVC, orthogonal transformation with a minimum magnitude of 2 × 2 to 64 × 64 is used, and it is also possible to encode a quantization matrix corresponding to each. However, in this embodiment, since the maximum orthogonal transformation size, that is, the size of the subblock is 8 × 8, the upper limit of the for loop corresponds to the 8 × 8 quantization matrix for the Y component using inter-prediction. Id = 9.

このようにして、forループの上限値を実際に用いる直交変換サイズの最大値に基づいて設定することで、不必要な量子化マトリクスの符号化を省略し、冗長な符号の発生を防止したビットストリームを復号することができる。 In this way, by setting the upper limit of the for loop based on the maximum value of the orthogonal transform size actually used, unnecessary coding of the quantization matrix is omitted and the occurrence of redundant codes is prevented. The stream can be decoded.

続いて、各量子化マトリクスの復号手順について説明する。初めに、量子化マトリクス復号部209は、scaling_list_chroma_present_flagやidに基づいた判定を行う。idを3で割った余りが2である場合、もしくはidが9である場合は、いずれかのY成分用の量子化マトリクスに対応しているため、対象となるY成分用の復号を行う処理に移行する。一方、idがそれ以外の場合は、復号の対象が、CbまたはCr成分用の量子化マトリクスとなるため、scaling_list_chroma_present_flagが1の場合のみ、対象となる色差成分用の量子化マトリクスを復号する。本実施形態では、scaling_list_chroma_present_flagが0であるため、id=2、5、8、9に対応するY成分用の量子化マトリクスのみを復号する。 Subsequently, the decoding procedure of each quantization matrix will be described. First, the quantization matrix decoding unit 209 makes a determination based on scaling_list_chroma_present_flag and id. When the remainder obtained by dividing id by 3 is 2, or when id is 9, since it corresponds to the quantization matrix for any Y component, the process of decoding for the target Y component is performed. Move to. On the other hand, when id is other than that, the target of decoding is the quantization matrix for the Cb or Cr component. Therefore, only when the scalaring_list_chroma_present_flag is 1, the quantization matrix for the target color difference component is decoded. In this embodiment, since scaling_list_chroma_present_flag is 0, only the quantization matrix for the Y component corresponding to id = 2, 5, 8 and 9 is decoded.

それぞれの量子化マトリクスの復号においては、図12のシンタックステーブルでは、まず、scaling_list_copy_mode_flagを復号する。得られた値が1である場合、復号対象の量子化マトリクスが、復号済の量子化マトリクスと同一であることを意味し、0である場合はそうでないことを意味する。本実施形態では復号対象の量子化マトリクスに対応するscaling_list_copy_mode_flagは常に0であるため、復号済の量子化マトリクスには同一のものが無いことを意味している。 In decoding each quantization matrix, first, scaling_list_copy_mode_flag is decoded in the syntax table of FIG. When the obtained value is 1, it means that the quantization matrix to be decoded is the same as the decoded quantization matrix, and when it is 0, it means that it is not. In the present embodiment, the scalaring_list_copy_mode_flag corresponding to the quantization matrix to be decoded is always 0, which means that there is no identical quantization matrix that has been decoded.

続いて、scaling_list_copy_mode_flagが0の場合、符号化済の量子化マトリクスの各要素との予測差分符号化を用いるかを示すscaling_list_pred_mode_flagを復号する。得られた値が1の場合、復号済の量子化マトリクスの各要素との差分値を復号する予測差分符号化モードであることを意味し、0の場合、量子化マトリクス内の各要素とその直前の要素との差分値を復号するモードであることを意味する。本実施形態では、scaling_list_pred_mode_flagとして0が得られるため、量子化マトリクス内の各要素とその直前の要素との差分値を復号するモードで復号する。 Subsequently, when scaling_list_copy_mode_flag is 0, the scaling_list_pred_mode_flag indicating whether to use the predicted difference coding with each element of the encoded quantization matrix is decoded. When the obtained value is 1, it means that it is a predicted difference coding mode for decoding the difference value with each element of the decoded quantization matrix, and when it is 0, it means that each element in the quantization matrix and its element. It means that it is a mode to decode the difference value from the immediately preceding element. In the present embodiment, since 0 is obtained as scaling_list_pred_mode_flag, the difference value between each element in the quantization matrix and the element immediately before it is decoded in the mode of decoding.

次に、scaling_list_copy_mode_flagまたはscaling_list_pred_mode_flagが1の場合、scaling_list_pred_id_deltaを符号化する。scaling_list_pred_id_deltaは参照対象の符号化済量子化マトリクスの識別子を意味する。本実施形態では、scaling_list_copy_mode_flagもscaling_list_pred_mode_flagも0となるため、scaling_list_pred_id_deltaは符号化されない。 Next, when the scaling_list_copy_mode_flag or the scaling_list_pred_mode_flag is 1, the scaling_list_pred_id_delta is encoded. scaling_list_pred_id_delta means the identifier of the coded quantization matrix to be referenced. In this embodiment, neither the scaling_list_copy_mode_flag nor the scaling_list_pred_mode_flag is 0, so the scaling_list_pred_id_delta is not encoded.

続いて復号対象の量子化マトリクスの各要素の差分符号化に移る。例えば、id=2に対応する、イントラ予測を用いたY成分用の4×4の量子化マトリクスの復号について説明する。量子化マトリクス復号部209は差分情報、すなわち図12のシンタックステーブルにおけるscaling_list_delta_coefを量子化マトリクスの要素の個数分復号し、図10に示される一次元の差分行列を再生する。量子化マトリクス復号部209は、直前の要素に図10の一次元の差分行列内の各差分値を加算しつつ、図9(b)の走査方法を用いて二次元に配置し、図8(c)の量子化マトリクス802を再生する。同様にして、id=2、5、8、9に対応する輝度成分に対応する量子化マトリクス群である図8(a)、図8(b)、図8(c)、及び図8(d)の量子化マトリクスを再生する。 Next, we move on to the differential coding of each element of the quantization matrix to be decoded. For example, decoding of a 4 × 4 quantization matrix for the Y component using intra-prediction corresponding to id = 2 will be described. The quantization matrix decoding unit 209 decodes the difference information, that is, scaling_list_delta_coef in the syntax table of FIG. 12 by the number of elements of the quantization matrix, and reproduces the one-dimensional difference matrix shown in FIG. The quantization matrix decoding unit 209 is arranged in two dimensions using the scanning method of FIG. 9B while adding each difference value in the one-dimensional difference matrix of FIG. 10 to the immediately preceding element, and is arranged in two dimensions in FIG. 8 (b). The quantization matrix 802 of c) is reproduced. Similarly, FIGS. 8 (a), 8 (b), 8 (c), and 8 (d), which are quantization matrix groups corresponding to the luminance components corresponding to id = 2, 5, 8, and 9. ) Quantization matrix is regenerated.

一方で、量子化マトリクス復号部209は、本実施形態では復号処理が省略された色差成分に対応する量子化マトリクス群を復号済の輝度成分の量子化マトリクス群を用いて再生する。まず、id=0、1に対応するインター予測を用いたCb/Cr成分用の2×2量子化マトリクスは、復号済のid=5に対応する図8(d)の量子化マトリクスの偶数行偶数列の要素のみを抽出し、図8(e)の量子化マトリクスを再生する。 On the other hand, the quantization matrix decoding unit 209 reproduces the quantization matrix group corresponding to the color difference component whose decoding process is omitted in the present embodiment by using the quantization matrix group of the decoded luminance component. First, the 2 × 2 quantization matrix for the Cb / Cr component using the inter-prediction corresponding to id = 0 and 1, is an even number of rows of the quantization matrix of FIG. 8 (d) corresponding to the decoded id = 5. Only the elements of the even number of columns are extracted, and the quantization matrix of FIG. 8 (e) is reproduced.

id=3、4に対応するイントラ予測を用いたCb/Cr成分用の4×4量子化マトリクスには、id=2に対応する図8(c)の量子化マトリクスを用いる。同様に、id=6,7に対応するインター予測を用いたCb/Cr成分用の4×4量子化マトリクスには、id=5に対応する図8(d)の量子化マトリクスを用いる。 As the 4 × 4 quantization matrix for the Cb / Cr component using the intra prediction corresponding to id = 3 and 4, the quantization matrix of FIG. 8 (c) corresponding to id = 2 is used. Similarly, as the 4 × 4 quantization matrix for the Cb / Cr component using the inter-prediction corresponding to id = 6, 7, the quantization matrix of FIG. 8 (d) corresponding to id = 5 is used.

なお、本実施形態では差分情報の復号において、図11(a)の符号化テーブルを利用するものとするが、図11(b)の符号化テーブルを用いても構わない。要するに、符号化側と同じものを用いればよい。そして、量子化マトリクス復号部209は、このようにして再生され量子化マトリクス800〜804を保持する。ここでは符号化側の量子化マトリクス符号化部113の動作とは逆の動作を行うこととなる。 In the present embodiment, the coding table shown in FIG. 11A is used in decoding the difference information, but the coding table shown in FIG. 11B may be used. In short, the same one as the coding side may be used. Then, the quantization matrix decoding unit 209 is reproduced in this way and holds the quantization matrix 800 to 804. Here, the operation opposite to the operation of the quantization matrix coding unit 113 on the coding side is performed.

復号部203は、分離復号部202から供給された符号データを復号し、予測情報を再生し、さらに残差係数を再生する。まず、復号部203は、予測情報を再生し、当該サブブロックで用いられる予測モードを取得する。復号部203は、再生された残差係数を逆量子化・逆変換部204に出力し、再生された予測情報を画像再生部205に出力する。 The decoding unit 203 decodes the code data supplied from the separation decoding unit 202, reproduces the prediction information, and further reproduces the residual coefficient. First, the decoding unit 203 reproduces the prediction information and acquires the prediction mode used in the subblock. The decoding unit 203 outputs the reproduced residual coefficient to the inverse quantization / inverse conversion unit 204, and outputs the reproduced prediction information to the image reproduction unit 205.

逆量子化・逆変換部204は、入力された残差係数に対し、量子化マトリクス復号部209で再生された量子化マトリクスと、量子化パラメータとを用いて逆量子化を行って直交変換係数を生成し、さらに逆直交変換を施して予測誤差を再生する。 The inverse quantization / inverse conversion unit 204 performs inverse quantization on the input residual coefficient using the quantization matrix reproduced by the quantization matrix decoding unit 209 and the quantization parameter, and performs the orthogonal conversion coefficient. Is generated, and the prediction error is reproduced by performing inverse orthogonal transformation.

逆量子化・逆変換部204は、符号化側の逆量子化・逆変換部106と同様、復号対象サブブロックの大きさや色成分に対応した量子化マトリクスと、量子化パラメータとを用いて逆量子化を行うことになる。すなわち、サブブロック分割をせず、基本ブロックの大きさのままで、イントラ予測モードが用いられた場合、Y成分の直交変換係数には図8(a)、Cb・Cr成分の直交変換係数には図8(c)の量子化マトリクスが用いられる。また、同様にサブブロック分割をせず、代わりにインター予測モードが用いられた場合、Y成分の直交変換係数には図8(b)、Cb・Cr成分の直交変換係数には図8(d)の量子化マトリクスが用いられる。一方、図7(b)のサブブロック分割を行い、インター予測モードが用いられた場合、Y成分の直交変換係数には図8(d)、Cb・Cr成分の直交変換係数には図8(e)の量子化マトリクスが用いられる。こうして再生された直交変換係数に逆直交変換を施して再生された予測誤差は画像再生部205に出力される。ただし、使用される量子化マトリクスはこれに限定されず、符号化側の変換・量子化部105及び逆量子化・逆変換部106で用いられた量子化マトリクスと同一のものであればよい。 Similar to the inverse quantization / inverse conversion unit 106 on the coding side, the inverse quantization / inverse conversion unit 204 uses a quantization matrix corresponding to the size and color component of the decoding target subblock and a quantization parameter to reverse the quantization. Quantization will be performed. That is, when the intra prediction mode is used without subblock division and with the size of the basic block, the orthogonal transformation coefficient of the Y component is shown in FIG. 8A, and the orthogonal transformation coefficient of the Cb / Cr component is used. The quantization matrix of FIG. 8 (c) is used. Similarly, when the inter-prediction mode is used instead of the sub-block division, the orthogonal transformation coefficient of the Y component is shown in FIG. 8 (b), and the orthogonal transform coefficient of the Cb / Cr component is shown in FIG. 8 (d). ) Quantization matrix is used. On the other hand, when the sub-block division of FIG. 7B is performed and the inter-prediction mode is used, the orthogonal transformation coefficient of the Y component is shown in FIG. 8D, and the orthogonal transformation coefficient of the Cb / Cr component is shown in FIG. The quantization matrix of e) is used. The prediction error reproduced by applying the inverse orthogonal transformation to the orthogonal transformation coefficient reproduced in this way is output to the image reproduction unit 205. However, the quantization matrix used is not limited to this, and may be the same as the quantization matrix used in the conversion / quantization unit 105 and the inverse quantization / inverse conversion unit 106 on the coding side.

画像再生部205は、復号部203から入力された予測情報に基づいて、フレームメモリ206を適宜参照し、予測画像を再生する。本実施形態の画像再生部205は、符号化側の予測部104と同様、イントラ予測やインター予測が用いられる。具体的な予測の処理については、符号化側の予測部104と同様であるため、説明を省略する。画像再生部205は、この予測画像と逆量子化・逆変換部204から入力された予測誤差から画像データを再生し、フレームメモリ206に格納する。格納された画像データは予測の際の参照に用いられる。 The image reproduction unit 205 appropriately refers to the frame memory 206 based on the prediction information input from the decoding unit 203, and reproduces the predicted image. The image reproduction unit 205 of the present embodiment uses intra-prediction and inter-prediction as in the prediction unit 104 on the coding side. Since the specific prediction processing is the same as that of the prediction unit 104 on the coding side, the description thereof will be omitted. The image reproduction unit 205 reproduces the image data from the predicted image and the prediction error input from the inverse quantization / inverse conversion unit 204, and stores the image data in the frame memory 206. The stored image data is used as a reference when making a prediction.

インループフィルタ部207は、符号化側のインループフィルタ部109と同様、フレームメモリ206から再生画像を読み出し、デブロッキングフィルタなどのインループフィルタ処理を行う。そして、インループフィルタ部207は、フィルタ処理された画像をフレームメモリ206に再格納する。 Like the in-loop filter unit 109 on the coding side, the in-loop filter unit 207 reads the reproduced image from the frame memory 206 and performs in-loop filter processing such as a deblocking filter. Then, the in-loop filter unit 207 re-stores the filtered image in the frame memory 206.

フレームメモリ206に格納された再生画像は、最終的には出力端子208から外部(例えば表示装置)に出力される。 The reproduced image stored in the frame memory 206 is finally output from the output terminal 208 to the outside (for example, a display device).

図4は、実施形態に係る画像復号装置200における制御部205の復号処理を示すフローチャートである。 FIG. 4 is a flowchart showing a decoding process of the control unit 205 in the image decoding device 200 according to the embodiment.

まず、S401にて、制御部250は、分離復号部202を制御して、ビットストリームから復号処理に関する情報や係数に関する符号データに分離して、ヘッダ部分の符号データを復号する。より具体的には、分離復号部202は、量子化マトリクス符号データを量子化マトリクス復号部209に供給し、画像の符号データを復号部203に供給させる。 First, in S401, the control unit 250 controls the separation / decoding unit 202 to separate the bit stream into information related to the decoding process and code data related to the coefficient, and decode the code data of the header portion. More specifically, the separation / decoding unit 202 supplies the quantization matrix code data to the quantization matrix decoding unit 209, and supplies the image code data to the decoding unit 203.

S402にて、制御部250は、量子化マトリクス復号部209を制御し、S401で再生された量子化マトリクス符号データを図12のシンタックステーブルに基づいて復号させる。ここでの量子化マトリクス復号部209の具体的な動作は、説明済であるため省略する。本実施形態では、制御部250は、量子化マトリクス復号部209を制御し、S401で再生された量子化マトリクス符号データを図12のシンタックステーブルに基づいて復号し、図8(a)〜(e)に示された量子化マトリクス800〜804を再生し保持する。 In S402, the control unit 250 controls the quantization matrix decoding unit 209 to decode the quantization matrix code data reproduced in S401 based on the syntax table of FIG. The specific operation of the quantization matrix decoding unit 209 here has already been described and will be omitted. In the present embodiment, the control unit 250 controls the quantization matrix decoding unit 209 to decode the quantization matrix code data reproduced in S401 based on the syntax table of FIG. 12, and FIGS. The quantization matrix 800 to 804 shown in e) is regenerated and held.

S403にて、制御部250は、復号部203を制御し、S401で分離された符号データを復号し、予測情報を再生し、残差係数を再生する。 In S403, the control unit 250 controls the decoding unit 203, decodes the code data separated in S401, reproduces the prediction information, and reproduces the residual coefficient.

S404にて、制御部250は、逆量子化・逆変換部204を制御し、残差係数に対しS402で再生された量子化マトリクスと、量子化パラメータとを用いて逆量子化を行って直交変換係数を生成させる。逆量子化・逆変換部204は、さらに逆直交変換を行い、予測誤差を再生する。本実施形態では、復号対象サブブロックの色成分や大きさに応じて、逆量子化処理において使用される量子化マトリクスを決定する。すなわち、逆量子化・逆変換部204は、サブブロックのサイズや予測モード、色成分に応じて、図8(a)〜図8(e)の量子化マトリクスと、量子化パラメータとを用いて逆量子化する。ただし、使用される量子化マトリクスはこれに限定されず、符号化側で用いられた量子化マトリクスと同一のものであればよい。 In S404, the control unit 250 controls the inverse quantization / inverse conversion unit 204, performs inverse quantization using the quantization matrix reproduced in S402 with respect to the residual coefficient, and the quantization parameter, and is orthogonal to each other. Generate a conversion factor. The inverse quantization / inverse transformation unit 204 further performs inverse orthogonal transformation to reproduce the prediction error. In the present embodiment, the quantization matrix used in the inverse quantization process is determined according to the color component and size of the subblock to be decoded. That is, the inverse quantization / inverse conversion unit 204 uses the quantization matrix of FIGS. 8A to 8E and the quantization parameter according to the size of the subblock, the prediction mode, and the color component. Inverse quantize. However, the quantization matrix used is not limited to this, and may be the same as the quantization matrix used on the coding side.

S405にて、制御部250は画像再生部205を制御し、S403で生成された予測情報に基づき画像を再生させる。具体的には、画像再生部205は、予測情報に基づき、フレームメモリ206を参照して予測画像を再生する。このとき、画像再生部205は、符号化側のS305と同様、イントラ予測やインター予測が用いられる。そして、画像再生部205は、再生された予測画像とS404で生成された予測誤差から画像データを再生し、再生した画像データをフレームメモリ206に格納する。 In S405, the control unit 250 controls the image reproduction unit 205 to reproduce the image based on the prediction information generated in S403. Specifically, the image reproduction unit 205 reproduces the predicted image with reference to the frame memory 206 based on the prediction information. At this time, the image reproduction unit 205 uses intra-prediction and inter-prediction as in S305 on the coding side. Then, the image reproduction unit 205 reproduces the image data from the reproduced predicted image and the prediction error generated in S404, and stores the reproduced image data in the frame memory 206.

S406にて、制御部250は、着目フレーム内の全ての基本ブロックの復号が終了したか否かの判定を行い、終了していれば処理をS407に進み、未符号の基本ブロックが存在する場合は次の基本ブロックを復号対象とするための処理をS403に戻す。 In S406, the control unit 250 determines whether or not the decoding of all the basic blocks in the frame of interest has been completed, and if so, proceeds to S407, and if there is an unsigned basic block. Returns the process for decoding the next basic block back to S403.

S407にて、制御部250は、インループフィルタ部207を制御し、S405で再生された画像データに対し、インループフィルタ処理を行い、フィルタ処理された画像を生成し、処理を終了する。 In S407, the control unit 250 controls the in-loop filter unit 207, performs in-loop filter processing on the image data reproduced in S405, generates a filtered image, and ends the processing.

以上の構成と動作により、先に説明した画像符号化装置100で生成された、符号化ビットストリーム、すなわち、色差成分に対応する量子化マトリクスの符号化を省略し、量子化マトリクスによる発生符号量を抑制したビットストリームを復号することができる。 With the above configuration and operation, the coding of the coded bit stream generated by the image coding device 100 described above, that is, the quantization matrix corresponding to the color difference component is omitted, and the code amount generated by the quantization matrix is omitted. It is possible to decode a bitstream with suppressed.

なお、本実施形態では、色差成分に対応する2×2の量子化マトリクス804を輝度成分に対応する4×4の量子化マトリクス803の偶数成分を間引いて生成するものとしたが、色差成分に対応する2×2の量子化マトリクスの生成方法はこれに限定されない。例えば、図8(f)に示され、量子化マトリクスを用いない場合に基準となる、全ての要素が均一なフラットな量子化マトリクス805を用いる構成としても構わない。これにより、2×2の量子化マトリクスを生成するための演算処理を低減し、さらには周波数分解性能が相対的に劣る2×2直交変換における各周波数成分に対する量子化時の重みづけを軽減したビットストリームを復号することができる。 In the present embodiment, the 2 × 2 quantization matrix 804 corresponding to the color difference component is generated by thinning out the even components of the 4 × 4 quantization matrix 803 corresponding to the luminance component. The method for generating the corresponding 2 × 2 quantization matrix is not limited to this. For example, a configuration using a flat quantization matrix 805 in which all the elements are uniform, which is shown in FIG. 8 (f) and serves as a reference when the quantization matrix is not used, may be used. As a result, the arithmetic processing for generating the 2 × 2 quantization matrix is reduced, and the weighting at the time of quantization for each frequency component in the 2 × 2 orthogonal transformation in which the frequency decomposition performance is relatively inferior is reduced. The bitstream can be decoded.

また、本実施形態では、色差成分に対応する量子化マトリクスは、全て輝度成分に対応する量子化マトリクスと同一もしくは生成可能である形態において生成されたビットストリームの復号について説明したが、用いられる量子化マトリクスはこれに限定されない。 Further, in the present embodiment, the decoding of the bit stream generated in a form in which the quantization matrix corresponding to the color difference component is the same as or can be generated in the same manner as the quantization matrix corresponding to the luminance component is described, but the quantum used. The quantization matrix is not limited to this.

例えば、図13に示されたような量子化マトリクス群を用いて符号化したビットストリームを復号することも可能である。この場合、符号化側でscaling_list_chroma_present_flagとして1がビットストリームに符号化されているため、復号側では色差成分に対応する量子化マトリクスの復号を省略しない。つまり、復号対象の画像データがY成分とCb成分とCr成分とを有する場合において、scaling_list_chroma_present_flagが1の場合は次のようになる。すなわち、量子化マトリクス復号部209は、Y成分用の量子化マトリクスとCb/Cr成分用の量子化マトリクスとをそれぞれ復号する。そして、逆量子化・逆変換部204は、Y成分用の量子化マトリクスを用いてY成分の量子化を行う。そして、逆量子化・逆変換部204は、Cb/Cr成分用の量子化マトリクスを用いてCb/Cr成分の量子化を行う。結果としてそれぞれの量子化マトリクスを復号し、図13に示された量子化マトリクス群を復号し、再生することとなる。これにより、輝度成分と色差成分に対して異なる量子化制御を施したいときに、色成分ごとに異なる量子化マトリクスを設定し、符号化したビットストリームを復号することもできる。 For example, it is also possible to decode a bitstream encoded using the quantization matrix group as shown in FIG. In this case, since 1 is encoded in the bitstream as scaling_list_chroma_present_flag on the coding side, decoding of the quantization matrix corresponding to the color difference component is not omitted on the decoding side. That is, when the image data to be decoded has a Y component, a Cb component, and a Cr component, and the scaling_list_chroma_present_flag is 1, the result is as follows. That is, the quantization matrix decoding unit 209 decodes the quantization matrix for the Y component and the quantization matrix for the Cb / Cr component, respectively. Then, the inverse quantization / inverse transformation unit 204 quantizes the Y component using the quantization matrix for the Y component. Then, the inverse quantization / inverse transformation unit 204 quantizes the Cb / Cr component using the quantization matrix for the Cb / Cr component. As a result, each quantization matrix is decoded, and the quantization matrix group shown in FIG. 13 is decoded and reproduced. As a result, when it is desired to apply different quantization controls to the luminance component and the color difference component, it is possible to set a different quantization matrix for each color component and decode the encoded bit stream.

上記実施形態の画像符号化装置100及び画像復号装置200が有する各処理部は図5に示す各ハードウェアを用いて実現してもよい。 Each processing unit included in the image coding device 100 and the image decoding device 200 of the above embodiment may be realized by using the hardware shown in FIG.

図5は、上記実施形態に係る画像符号化装置100、画像復号装置200に適用可能なコンピュータのハードウェアの構成例を示すブロック図である。 FIG. 5 is a block diagram showing a configuration example of computer hardware applicable to the image coding device 100 and the image decoding device 200 according to the above embodiment.

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

RAM502は、外部記憶装置506、I/F(インターフェース)507を介して外部から取得したデータなどを一時的に記憶するためのエリアを有する。更に、RAM502は、CPU501が各種の処理を実行する際に用いるワークエリアとしても利用される。RAM502は、例えば、フレームメモリとして割り当てたり、その他の各種のエリアを適宜提供したりすることができる。 The RAM 502 has an area for temporarily storing data acquired from the outside via the external storage device 506 and the I / F (interface) 507. Further, the RAM 502 is also used as a work area used by the CPU 501 when executing various processes. The RAM 502 can be allocated as a frame memory, for example, or various other areas can be provided as appropriate.

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

外部記憶装置506は、ハードディスクドライブ装置に代表される、大容量情報記憶装置である。外部記憶装置506には、OS(オペレーティングシステム)や、図1、図2に示した各部の機能をCPU501に実現させるためのコンピュータプログラム(アプリケーションプログラム)が保存されている。更には、外部記憶装置506には、処理対象としての各画像データが保存されていてもよい。 The external storage device 506 is a large-capacity information storage device typified by a hard disk drive device. The external storage device 506 stores an OS (operating system) and a computer program (application program) for realizing the functions of the respective parts shown in FIGS. 1 and 2 in the CPU 501. Further, each image data as a processing target may be stored in the external storage device 506.

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

上記構成において、本装置に電源が投入されると、CPU501はROM503に格納されたブートプログラムを実行し、外部記憶装置506に格納されたOSをRAM502にロードし実行する。そして、CPU501は、OSの制御下にて、外部記憶装置506から符号化、或いは、復号に係るアプリケーションプログラムをRAM502にロードし、実行する。この結果、CPU501は、図1或いは図2の各処理部として機能し、本装置が画像符号化装置100、或いは、画像復号装置200として機能することになる。 In the above configuration, when the power is turned on to the present device, the CPU 501 executes the boot program stored in the ROM 503, loads the OS stored in the external storage device 506 into the RAM 502, and executes the boot program. Then, under the control of the OS, the CPU 501 loads the application program related to coding or decoding from the external storage device 506 into the RAM 502 and executes it. As a result, the CPU 501 functions as each processing unit of FIG. 1 or 2, and this device functions as an image coding device 100 or an image decoding device 200.

(その他の実施例)
上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other Examples)
It is also realized by supplying a program that realizes one or more functions of the above-described embodiment to a system or a device via a network or a storage medium, and reading and executing the program by one or more processors in the computer of the system or the device. It is possible. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.

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

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

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

101 入力端子
102 ブロック分割部
103 量子化マトリクス保持部
104 予測部
105 変換・量子化部
106 逆量子化・逆変換部
107 画像再生部
108 フレームメモリ
109 インループフィルタ部
110 符号化部
111 統合符号化部
112 出力端子
113 量子化マトリクス符号化部
101 Input terminal 102 Block division 103 Quantization matrix holding unit 104 Prediction unit 105 Conversion / quantization unit 106 Inverse quantization / inverse conversion unit 107 Image reproduction unit 108 Frame memory 109 In-loop filter unit 110 Coding unit 111 Integrated coding Part 112 Output terminal 113 Quantization matrix coding part

Claims (10)

輝度成分と第1の色差成分と第2の色差成分とを有する画像をビットストリームに符号化することが可能な画像符号化装置であって、
符号化対象の画像を複数のブロックに分割する分割手段と、
符号化対象のブロックに対して予測処理を行い、前記符号化対象のブロックの予測誤差を導出する予測手段と、
前記予測誤差を直交変換して直交変換係数を導出する変換手段と、
少なくとも第1の量子化マトリクスを用いて、前記直交変換係数を量子化する量子化手段と、
少なくとも前記第1の量子化マトリクスを符号化する符号化手段と
を有し、
前記符号化手段は、
前記第1の色差成分に対応する第2の量子化マトリクスと、前記第2の色差成分に対応する第3の量子化マトリクスとが、前記ビットストリームに符号化されているかを示す情報を、前記ビットストリームに符号化し、
前記量子化手段は、
前記輝度成分と前記第1の色差成分と第2の色差成分とを前記符号化対象の画像が有する場合において、前記第2の量子化マトリクスと前記第3の量子化マトリクスとが前記ビットストリームに符号化されていることを前記情報が示す場合、
前記符号化対象のブロックの前記輝度成分の予測誤差を前記第1の量子化マトリクスを用いて量子化し、
前記符号化対象のブロックの前記第1の色差成分の予測誤差を前記第2の量子化マトリクスを用いて量子化し、
前記符号化対象のブロックの前記第2の色差成分の予測誤差を前記第3の量子化マトリクスを用いて量子化し、
前記輝度成分と前記第1の色差成分と第2の色差成分とを前記符号化対象の画像が有する場合において、前記第2の量子化マトリクスと前記第3の量子化マトリクスとが前記ビットストリームに符号化されていないことを前記情報が示す場合、
前記符号化対象のブロックの前記輝度成分の前記予測誤差と、前記符号化対象のブロックの前記第1の色差成分の前記予測誤差と、前記符号化対象のブロックの前記第2の色差成分の前記予測誤差とを、第1の量子化マトリクスを用いて量子化する
ことを特徴とする画像符号化装置。
An image coding device capable of encoding an image having a luminance component, a first color difference component, and a second color difference component into a bit stream.
A partitioning means for dividing the image to be encoded into a plurality of blocks, and
A prediction means that performs prediction processing on the block to be coded and derives a prediction error of the block to be coded.
A conversion means for deriving the orthogonal conversion coefficient by orthogonally converting the prediction error,
A quantization means for quantizing the orthogonal transformation coefficient using at least the first quantization matrix, and
It has at least a coding means for encoding the first quantization matrix.
The coding means is
Information indicating whether the second quantization matrix corresponding to the first color difference component and the third quantization matrix corresponding to the second color difference component are encoded in the bit stream is provided. Encoded into a bitstream
The quantization means is
When the image to be encoded has the luminance component, the first color difference component, and the second color difference component, the second quantization matrix and the third quantization matrix are included in the bit stream. If the information indicates that it is encoded,
The prediction error of the luminance component of the block to be encoded is quantized by using the first quantization matrix.
The prediction error of the first color difference component of the block to be encoded is quantized by using the second quantization matrix.
The prediction error of the second color difference component of the block to be encoded is quantized by using the third quantization matrix.
When the image to be encoded has the luminance component, the first color difference component, and the second color difference component, the second quantization matrix and the third quantization matrix are included in the bit stream. If the information indicates that it is unencoded,
The prediction error of the brightness component of the block to be coded, the prediction error of the first color difference component of the block to be coded, and the second color difference component of the block to be coded. An image coding device characterized in that a prediction error is quantized using a first quantization matrix.
前記符号化手段は、
前記輝度成分と前記第1の色差成分と第2の色差成分とを前記符号化対象の画像が有する場合において、前記第2の量子化マトリクスと前記第3の量子化マトリクスとが前記ビットストリームに符号化されていることを前記情報が示す場合、前記第2の量子化マトリクスと前記第3の量子化マトリクスとを前記ビットストリームに符号化する
ことを特徴とする請求項1記載の画像符号化装置。
The coding means is
When the image to be encoded has the brightness component, the first color difference component, and the second color difference component, the second quantization matrix and the third quantization matrix are combined in the bit stream. The image coding according to claim 1, wherein when the information indicates that it is encoded, the second quantization matrix and the third quantization matrix are encoded in the bit stream. Device.
前記符号化手段は、
前記符号化対象の画像が前記第1の色差成分及び第2の色差成分を有していない場合にも、前記情報を前記ビットストリームに符号化する
ことを特徴とする請求項1又は2に記載の画像符号化装置。
The coding means is
The invention according to claim 1 or 2, wherein the information is encoded in the bit stream even when the image to be encoded does not have the first color difference component and the second color difference component. Image encoding device.
前記情報はフラグである
ことを特徴とする請求項1〜3のいずれか1項に記載の画像符号化装置。
The image coding apparatus according to any one of claims 1 to 3, wherein the information is a flag.
前記フラグは、scaling_list_chroma_present_flagである
ことを特徴とする請求項4記載の画像符号化装置。
The image coding apparatus according to claim 4, wherein the flag is scaling_list_chroma_present_flag.
画像が符号化されたビットストリームであって、輝度成分と第1の色差成分と第2の色差成分とを有するビットストリームを、復号することが可能な画像復号装置であって、
少なくとも第1の量子化マトリクスを前記ビットストリームから復号する復号手段と
少なくとも前記第1の量子化マトリクスを用いて、復号対象の画像における復号対象のブロックの残差係数を逆量子化して、直交変換係数を導出する逆量子化手段と、
前記直交変換係数を逆直交変換して予測誤差を導出する逆変換手段と、
前記予測誤差に対して予測処理を行い、前記復号対象のブロックの画像を生成する生成手段と
を有し、
前記復号手段は、
前記第1の色差成分に対応する第2の量子化マトリクスと、前記第2の色差成分に対応する第3の量子化マトリクスとが、前記ビットストリームに符号化されているかを示す情報を、前記ビットストリームから復号し、
前記逆量子化手段は、
前記輝度成分と前記第1の色差成分と第2の色差成分とを復号対象のビットストリームが有する場合において、前記第2の量子化マトリクスと前記第3の量子化マトリクスとが前記ビットストリームに符号化されていることを前記情報が示す場合、
前記復号対象のブロックの前記輝度成分の残差係数を前記第1の量子化マトリクスを用いて逆量子化し、
前記復号対象のブロックの前記第1の色差成分の残差係数を前記第2の量子化マトリクスを用いて逆量子化し、
前記復号対象のブロックの前記第2の色差成分の残差係数を前記第3の量子化マトリクスを用いて逆量子化し、
前記輝度成分と前記第1の色差成分と第2の色差成分とを前記復号対象のビットストリームが有する場合において、前記第2の量子化マトリクスと前記第3の量子化マトリクスとが前記ビットストリームに符号化されていないことを前記情報が示す場合、
前記復号対象のブロックの前記輝度成分の前記残差係数と、前記復号対象のブロックの前記第1の色差成分の前記残差係数と、前記復号対象のブロックの前記第2の色差成分の前記残差係数とを、第1の量子化マトリクスを用いて逆量子化する
ことを特徴とする画像復号装置。
An image decoding device capable of decoding a bitstream in which an image is encoded and having a luminance component, a first color difference component, and a second color difference component.
By using a decoding means for decoding at least the first quantization matrix from the bit stream and at least the first quantization matrix, the residual coefficient of the block to be decoded in the image to be decoded is inversely quantized and orthogonally transformed. Inverse quantization means to derive coefficients and
An inverse transformation means for deriving a prediction error by inversely transforming the orthogonal transformation coefficient,
It has a generation means that performs prediction processing on the prediction error and generates an image of the block to be decoded.
The decoding means
Information indicating whether the second quantization matrix corresponding to the first color difference component and the third quantization matrix corresponding to the second color difference component are encoded in the bit stream is provided. Decrypt from bitstream
The inverse quantization means
When the bit stream to be decoded has the brightness component, the first color difference component, and the second color difference component, the second quantization matrix and the third quantization matrix are coded in the bit stream. If the above information indicates that it has been quantized,
The residual coefficient of the luminance component of the block to be decoded is inversely quantized using the first quantization matrix.
The residual coefficient of the first color difference component of the block to be decoded is inversely quantized using the second quantization matrix.
The residual coefficient of the second color difference component of the block to be decoded is inversely quantized using the third quantization matrix.
When the bit stream to be decoded has the luminance component, the first color difference component, and the second color difference component, the second quantization matrix and the third quantization matrix are included in the bit stream. If the information indicates that it is unencoded,
The residual coefficient of the luminance component of the block to be decoded, the residual coefficient of the first color difference component of the block to be decoded, and the residual of the second color difference component of the block to be decoded. An image decoding device characterized in that the difference coefficient is inversely quantized using the first quantization matrix.
前記復号手段は、
前記輝度成分と前記第1の色差成分と第2の色差成分とを前記復号対象のビットストリームが有する場合において、前記第2の量子化マトリクスと前記第3の量子化マトリクスとが前記ビットストリームに符号化されていることを前記情報が示す場合、前記第2の量子化マトリクスと前記第3の量子化マトリクスとを前記ビットストリームから復号する
ことを特徴とする請求項6記載の画像復号装置。
The decoding means
When the bit stream to be decoded has the brightness component, the first color difference component, and the second color difference component, the second quantization matrix and the third quantization matrix are included in the bit stream. The image decoding apparatus according to claim 6, wherein when the information indicates that the information is encoded, the second quantization matrix and the third quantization matrix are decoded from the bit stream.
前記復号手段は、
前記復号対象のビットストリームが前記第1の色差成分及び第2の色差成分を有していない場合にも、前記情報を前記ビットストリームから復号する
ことを特徴とする6又は7に記載の画像復号装置。
The decoding means
The image decoding according to 6 or 7, wherein the information is decoded from the bit stream even when the bit stream to be decoded does not have the first color difference component and the second color difference component. Device.
前記情報はフラグである
ことを特徴とする請求項6〜8のいずれか1項に記載の画像復号装置。
The image decoding apparatus according to any one of claims 6 to 8, wherein the information is a flag.
前記フラグは、scaling_list_chroma_present_flagである
ことを特徴とする請求項9記載の画像復号装置。
The image decoding apparatus according to claim 9, wherein the flag is scaling_list_chroma_present_flag.
JP2020046696A 2020-03-17 2020-03-17 Image encoding device, image encoding method and program, and image decoding device, image decoding method and program Pending JP2021150723A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020046696A JP2021150723A (en) 2020-03-17 2020-03-17 Image encoding device, image encoding method and program, and image decoding device, image decoding method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2020046696A JP2021150723A (en) 2020-03-17 2020-03-17 Image encoding device, image encoding method and program, and image decoding device, image decoding method and program

Publications (1)

Publication Number Publication Date
JP2021150723A true JP2021150723A (en) 2021-09-27

Family

ID=77849494

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020046696A Pending JP2021150723A (en) 2020-03-17 2020-03-17 Image encoding device, image encoding method and program, and image decoding device, image decoding method and program

Country Status (1)

Country Link
JP (1) JP2021150723A (en)

Similar Documents

Publication Publication Date Title
US20210409772A1 (en) Image coding apparatus, image coding method, and storage media
US20240089439A1 (en) Image decoding device, method, and non-transitory computer-readable storage medium
JP2023164601A (en) Image coding device, image coding method, and program, image decoding device, image decoding method, and program
JP2023113858A (en) Image decoding device, image decoding method, and program
WO2020003740A1 (en) Image coding device, image decoding device, control methods therefor, and program
JP2021150723A (en) Image encoding device, image encoding method and program, and image decoding device, image decoding method and program
WO2021054012A1 (en) Image encoding device, image decoding device, control method therefor, and program
WO2020184223A1 (en) Image decoder, image decoding method, and program
WO2023181546A1 (en) Image encoding device, image decoding device, image encoding method, and image decoding method
CN113196760B (en) Image encoding device, image decoding device, control method, and storage medium
JP7090490B2 (en) Image coding device, image decoding device, image coding method, image decoding method
WO2020183859A1 (en) Image coding device, image decoding device, image coding method, image decoding method, and program
WO2021049277A1 (en) Image coding device and image decoding device
WO2020129498A1 (en) Image encoding device, image encoding method, image decoding device, and image decoding method
WO2020129489A1 (en) Image encoding device, image decoding device, and method and program for controlling same
JP2023164602A (en) Image coding device, image coding method, and program, image decoding device, image decoding method, and program
JP2021150788A (en) Image encoding device, image encoding method and program, and image decoding device, image decoding method and program

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20200616