Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7825447B2 - Encoding device, program, and model generation method - Google Patents
[go: Go Back, main page]

JP7825447B2 - Encoding device, program, and model generation method - Google Patents

Encoding device, program, and model generation method

Info

Publication number
JP7825447B2
JP7825447B2 JP2022020537A JP2022020537A JP7825447B2 JP 7825447 B2 JP7825447 B2 JP 7825447B2 JP 2022020537 A JP2022020537 A JP 2022020537A JP 2022020537 A JP2022020537 A JP 2022020537A JP 7825447 B2 JP7825447 B2 JP 7825447B2
Authority
JP
Japan
Prior art keywords
transform coefficients
quantization
unit
values
dimensional
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2022020537A
Other languages
Japanese (ja)
Other versions
JP2023117786A (en
Inventor
大地 新井
俊輔 岩村
裕一 日下部
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Japan Broadcasting Corp
Original Assignee
Japan Broadcasting Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Japan Broadcasting Corp filed Critical Japan Broadcasting Corp
Priority to JP2022020537A priority Critical patent/JP7825447B2/en
Publication of JP2023117786A publication Critical patent/JP2023117786A/en
Application granted granted Critical
Publication of JP7825447B2 publication Critical patent/JP7825447B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Description

本発明は、符号化装置、プログラム、及びモデル生成方法に関する。 The present invention relates to an encoding device, a program, and a model generation method.

一般的に、動画像を符号化する符号化装置は、原画像と予測画像との差分を表す残差信号に対して変換処理を行って得られる変換係数に対して量子化を行う量子化部と、量子化部により得られる量子化後の変換係数をエントロピー符号化するエントロピー符号化部とを有する。量子化部は、例えば、量子化パラメータQPから算出される量子化ステップ(Qstep)により変換係数を除算することで、実数で表されるスケール後変換係数を導出したうえで、スケール後変換係数を丸め処理により整数に変換(すなわち、量子化)した量子化後変換係数を導出する。 In general, a coding device for coding a moving image includes a quantization unit that quantizes transform coefficients obtained by performing a transform process on a residual signal representing the difference between an original image and a predicted image, and an entropy coding unit that entropy codes the quantized transform coefficients obtained by the quantization unit. The quantization unit derives scaled transform coefficients expressed as real numbers by, for example, dividing the transform coefficients by a quantization step (Q step ) calculated from a quantization parameter QP, and then converts the scaled transform coefficients to integers by a rounding process (i.e., quantizes them) to derive quantized transform coefficients.

HEVC(High Efficiency Video Coding)方式及びVVC(Versatile Video Coding)方式では、量子化部が量子化後の変換係数を導出(量子化)する際に、RDOQ(Rate Distortion Quantized Optimization)と呼ばれる技術が用いられている。RDOQでは、式(1)に示すようにRD(Rate Distortion)コストを最小化することで最適な量子化処理を決定する。 In the High Efficiency Video Coding (HEVC) and Versatile Video Coding (VVC) formats, a technique called Rate Distortion Quantized Optimization (RDOQ) is used when the quantization unit derives (quantizes) the transform coefficients after quantization. RDOQ determines the optimal quantization process by minimizing the Rate Distortion (RD) cost, as shown in equation (1).

ここで、λはQPなどの量子化パラメータによって決定される定数であり、xは量子化前の変換係数であり、qは量子化後の変換係数である。また、D(q,x)は量子化歪みであり、一般的にx及びqの残差二乗和で表される。R(q)はqをエントロピー符号化したビットレートである。 Here, λ is a constant determined by quantization parameters such as QP, x is the transform coefficient before quantization, and q is the transform coefficient after quantization. Furthermore, D(q, x) is the quantization distortion, generally expressed as the residual sum of squares of x and q. R(q) is the bit rate when q is entropy coded.

エントロピー符号化では、入力データに対して、その発生確率に基づいて異なる長さの符号を割り当てることで、入力データを効率的に符号化する。動画像符号化では、例えば、高効率な符号化方式であるCABAC(Context-based Adaptive Binary Arithmetic Coding)を用いてシンタックス要素のロスレス圧縮を行う。上記(1)式の第2項に相当するビットレートR(q)を算出する際には、変換係数用のシンタックス要素及びそのコンテキスト値を用いる。 Entropy coding efficiently encodes input data by assigning codes of different lengths to the input data based on its occurrence probability. In video coding, for example, lossless compression of syntax elements is performed using CABAC (Context-based Adaptive Binary Arithmetic Coding), a highly efficient coding method. When calculating the bit rate R(q), which corresponds to the second term in equation (1) above, syntax elements for transform coefficients and their context values are used.

CABACは、二値算術符号化、及び2値シンボルの生起確率を周囲のパラメータの状態(コンテキスト値)に基づいて推定するコンテキスト適応処理を用いたエントロピー符号化手法である。具体的には、入力される2値シンボルの値及びMPS(Most Probable Symbol:0及び1のうち出現する確率が高いシンボル)生起確率に基づいて数直線を区間分割していき、最終的に得られた区間の2進数表現を入力2値シンボル系列の符号語とする。ここで、2値シンボルのMPS生起確率を表すコンテキスト値は、シンタックス要素ごとに異なる定まった法則に従い算出される。 CABAC is an entropy coding technique that uses binary arithmetic coding and context adaptive processing, which estimates the probability of occurrence of a binary symbol based on the state of surrounding parameters (context values). Specifically, a number line is divided into intervals based on the value of the input binary symbol and the probability of occurrence of an MPS (Most Probable Symbol: a symbol with a high probability of appearing between 0 and 1), and the binary representation of the final interval is used as the codeword for the input binary symbol sequence. Here, the context value, which represents the MPS probability of occurrence of a binary symbol, is calculated according to a set rule that differs for each syntax element.

一方、非特許文献1には、符号化効率を向上させるために、貪欲法による量子化結果を教師データとして用いてニューラルネットワークに学習させてニューラルネットワークモデルを生成し、量子化部がニューラルネットワークモデルを用いて量子化処理を決定する技術が記載されている。このような技術(以下、「先行研究」と呼ぶ)では、量子化部は、量子化前の変換係数及び量子化後の変換係数をニューラルネットワークモデルに入力して得られる量子化調整値を用いて当該量子化後の変換係数を調整する。 On the other hand, Non-Patent Document 1 describes a technique for improving coding efficiency in which a neural network is trained using greedy quantization results as training data to generate a neural network model, and a quantization unit determines the quantization process using the neural network model. In this technique (hereinafter referred to as "prior research"), the quantization unit adjusts the quantized transform coefficients using a quantization adjustment value obtained by inputting the transform coefficients before and after quantization into a neural network model.

D. Kianfar, A. Wiggers, A. Said, R. Pourreza, T. Cohen, Parallelized Rate-Distortion Optimized Quantization using Deep Learning, IEEE MMSP 2020D. Kianfar, A. Wiggers, A. Said, R. Pourreza, T. Cohen, Parallelized Rate-Distortion Optimized Quantization using Deep Learning, IEEE MMSP 2020

エントロピー符号化では、量子化部による量子化後の変換係数のシンタックス要素値をそのコンテキスト値を用いて符号化する。量子化後の変換係数の決定にはシンタックス要素値及びコンテキスト値も用いているため、ニューラルネットワークを用いた量子化処理においてもシンタックス要素値及びコンテキスト値を考慮することで、符号化効率が向上すると考えられる。 In entropy coding, the syntax element values of the transform coefficients after quantization by the quantization unit are coded using their context values. Since syntax element values and context values are also used to determine the transform coefficients after quantization, it is believed that coding efficiency can be improved by taking syntax element values and context values into account in quantization processing using a neural network.

しかしながら、先行研究では、量子化後の変換係数をニューラルネットワークモデルへの入力として用いているが、量子化後の変換係数を決定する際に計算されるシンタックス要素値及びコンテキスト値をニューラルネットワークモデルへの入力として用いておらず、ニューラルネットワークモデルを用いた量子化処理を改善する余地がある。 However, in previous studies, while the quantized transform coefficients were used as inputs to the neural network model, the syntax element values and context values calculated when determining the quantized transform coefficients were not used as inputs to the neural network model. This leaves room for improvement in the quantization process using neural network models.

そこで、本発明は、ニューラルネットワークモデルを用いた量子化処理を改善可能な符号化装置、プログラム、及びモデル生成方法を提供することを目的とする。 Therefore, the present invention aims to provide an encoding device, program, and model generation method that can improve quantization processing using a neural network model.

第1の態様に係る符号化装置は、原画像と予測画像との差分を表す残差信号に対して変換処理を行って得られる変換係数に対して量子化を行う量子化部と、前記変換係数のためのシンタックス要素値を当該シンタックス要素値のコンテキスト値を用いてエントロピー符号化するエントロピー符号化部と、を備える。前記量子化部は、量子化前の前記変換係数と、量子化後の前記変換係数と、前記シンタックス要素値及び前記コンテキスト値と、をニューラルネットワークモデルに入力して得られる出力に応じて当該量子化後の前記変換係数を調整することにより、最適量子化後の前記変換係数を出力する。 The encoding device according to the first aspect includes a quantization unit that quantizes transform coefficients obtained by performing a transform process on a residual signal representing the difference between an original image and a predicted image, and an entropy encoding unit that entropy encodes syntax element values for the transform coefficients using context values for the syntax element values. The quantization unit adjusts the quantized transform coefficients in accordance with the output obtained by inputting the transform coefficients before quantization, the transform coefficients after quantization, the syntax element values, and the context values into a neural network model, thereby outputting the transform coefficients after optimal quantization.

第2の態様に係るプログラムは、コンピュータを第1の態様に係る符号化装置として機能させる。 The program according to the second aspect causes a computer to function as the encoding device according to the first aspect.

第3の態様に係るモデル生成方法は、符号化のための学習済みニューラルネットワークモデルを生成する方法である。前記モデル生成方法は、量子化前の変換係数と、量子化後の当該変換係数と、当該変換係数のためのシンタックス要素値と、当該シンタックス要素値のコンテキスト値と、全探索又は貪欲法を用いて導出された最適量子化後の当該変換係数とを教師データとして取得するステップと、前記教師データを用いた機械学習を行うステップと、量子化前の変換係数と、量子化後の当該変換係数と、当該変換係数のためのシンタックス要素値と、当該シンタックス要素値のコンテキスト値とを入力とし、かつ、当該量子化後の当該変換係数を最適化するよう調整するための調整値を出力とするニューラルネットワークモデルを生成するステップと、を有する。 A model generation method according to a third aspect is a method for generating a trained neural network model for encoding. The model generation method includes the steps of acquiring, as training data, transform coefficients before quantization, the transform coefficients after quantization, syntax element values for the transform coefficients, context values for the syntax element values, and the transform coefficients after optimal quantization derived using a full search or greedy algorithm; performing machine learning using the training data; and generating a neural network model that receives as input the transform coefficients before quantization, the transform coefficients after quantization, the syntax element values for the transform coefficients, and the context values for the syntax element values, and outputs adjustment values for adjusting the transform coefficients after quantization to optimize them.

本発明によれば、ニューラルネットワークモデルを用いた量子化処理を改善可能な符号化装置、プログラム、及びモデル生成方法を提供できる。 The present invention provides an encoding device, program, and model generation method that can improve quantization processing using a neural network model.

実施形態に係る符号化装置の構成を示す図である。FIG. 1 is a diagram illustrating a configuration of an encoding device according to an embodiment. スキャン順の種類の一例を示す図である。FIG. 10 is a diagram illustrating an example of types of scan orders. 実施形態に係る量子化処理の概要を説明するための図である。FIG. 2 is a diagram for explaining an overview of a quantization process according to the embodiment. 実施形態に係るRDOQ処理部の構成例を示す図である。FIG. 2 is a diagram illustrating an example of the configuration of an RDOQ processing unit according to the embodiment. エントロピー符号化部による変換係数の符号化の一例を示す図である。FIG. 10 is a diagram illustrating an example of encoding of transform coefficients by an entropy encoding unit. 実施形態に係る最適化処理部の構成例を示す図である。FIG. 2 is a diagram illustrating an example of the configuration of an optimization processing unit according to the embodiment. 実施形態に係る最適化処理部の構成の変更例を示す図である。FIG. 10 is a diagram illustrating a modified example of the configuration of an optimization processing unit according to the embodiment. 実施形態に係るニューラルネットワークモデルの一例を示す図である。FIG. 2 is a diagram illustrating an example of a neural network model according to the embodiment. 実施形態に係るモデル生成方法を示す図である。FIG. 1 is a diagram illustrating a model generation method according to an embodiment.

図面を参照して、実施形態について説明する。以下の図面の記載において、同一又は類似の部分には同一又は類似の符号を付している。 Embodiments will be described with reference to the drawings. In the following description of the drawings, identical or similar parts are designated by identical or similar reference numerals.

(実施形態の概要)
実施形態に係る符号化装置は、原画像と予測画像との差分を表す残差信号に対して変換処理を行って得られる変換係数に対して量子化を行う量子化部と、前記変換係数のためのシンタックス要素値を当該シンタックス要素値のコンテキスト値を用いてエントロピー符号化するエントロピー符号化部と、を備える。前記量子化部は、量子化前の前記変換係数と、量子化後の前記変換係数と、前記シンタックス要素値及び前記コンテキスト値と、をニューラルネットワークモデルに入力して得られる出力に応じて当該量子化後の前記変換係数を調整することにより、最適量子化後の前記変換係数を出力する。
(Outline of the embodiment)
An encoding device according to an embodiment includes a quantization unit that quantizes transform coefficients obtained by performing a transform process on a residual signal representing a difference between an original image and a predicted image, and an entropy encoding unit that entropy encodes syntax element values for the transform coefficients using context values of the syntax element values. The quantization unit adjusts the quantized transform coefficients according to an output obtained by inputting the transform coefficients before quantization, the quantized transform coefficients, the syntax element values, and the context values into a neural network model, thereby outputting the optimally quantized transform coefficients.

このように、量子化前の変換係数及び量子化後の変換係数だけではなく、変換係数のシンタックス要素値及びそのコンテキスト値をニューラルネットワークモデルへの入力として用いる。すなわち、ニューラルネットワークモデルへの新たな入力パラメータとしてシンタックス要素値及びそのコンテキスト値を導入する。これにより、量子化後の変換係数をより適切に調整可能になる。よって、ニューラルネットワークモデルを用いた量子化処理を改善できるため、符号化効率が向上する。 In this way, not only the transform coefficients before and after quantization, but also the syntax element values of the transform coefficients and their context values are used as input to the neural network model. In other words, the syntax element values and their context values are introduced as new input parameters to the neural network model. This makes it possible to more appropriately adjust the transform coefficients after quantization. This improves the quantization process using the neural network model, thereby increasing coding efficiency.

(符号化装置)
(1)符号化装置の構成
まず、本実施形態に係る符号化装置の構成について説明する。本実施形態に係る符号化装置は、MPEGに代表される動画像の符号化を行う。図1は、本実施形態に係る符号化装置1の構成を示す図である。符号化装置1は、画像を分割して得たブロック単位で符号化を行う装置である。
(encoding device)
(1) Configuration of the Encoding Device First, the configuration of the encoding device according to this embodiment will be described. The encoding device according to this embodiment encodes moving images as typified by MPEG. Fig. 1 is a diagram showing the configuration of an encoding device 1 according to this embodiment. The encoding device 1 is a device that encodes an image in units of blocks obtained by dividing the image.

図1に示すように、符号化装置1は、ブロック分割部100と、減算部110と、変換・量子化部120と、エントロピー符号化部130と、逆量子化・逆変換部140と、合成部150と、メモリ160と、予測部170とを有する。 As shown in FIG. 1, the encoding device 1 includes a block division unit 100, a subtraction unit 110, a transformation/quantization unit 120, an entropy encoding unit 130, an inverse quantization/inverse transform unit 140, a synthesis unit 150, a memory 160, and a prediction unit 170.

ブロック分割部100は、動画像を構成するフレーム(或いはピクチャ)単位の入力画像を複数の画像ブロックに分割し、分割により得た画像ブロックを減算部110に出力する。画像ブロックのサイズは、例えば32×32画素、16×16画素、8×8画素、又は4×4画素等である。画像ブロックの形状は正方形に限らず矩形(非正方形)であってもよい。画像ブロックは、符号化装置1が符号化を行う単位(符号化対象ブロック)であり、且つ復号装置が復号を行う単位(復号対象ブロック)である。このような画像ブロックはCU(Coding Unit)と呼ばれることがある。 The block division unit 100 divides an input image, which is made up of frames (or pictures) constituting a moving image, into multiple image blocks and outputs the image blocks obtained by division to the subtraction unit 110. The size of the image blocks is, for example, 32x32 pixels, 16x16 pixels, 8x8 pixels, or 4x4 pixels. The shape of the image blocks is not limited to squares and may be rectangular (non-square). An image block is a unit of coding performed by the encoding device 1 (a block to be encoded) and a unit of decoding performed by the decoding device (a block to be decoded). Such an image block is sometimes called a CU (Coding Unit).

減算部110は、ブロック分割部100が出力する符号化対象ブロックと、符号化対象ブロックを予測部170が予測して得た予測ブロックとの差分(誤差)を表す予測残差を算出する。減算部110は、ブロックの各画素値から予測ブロックの各画素値を減算することにより予測残差を算出し、算出した予測残差を変換・量子化部120に出力する。 The subtraction unit 110 calculates a prediction residual that represents the difference (error) between the current block to be coded output by the block division unit 100 and the predicted block obtained by predicting the current block to be coded by the prediction unit 170. The subtraction unit 110 calculates the prediction residual by subtracting each pixel value of the predicted block from each pixel value of the block, and outputs the calculated prediction residual to the transformation/quantization unit 120.

変換・量子化部120は、ブロック単位で変換処理及び量子化処理を行う。変換・量子化部120は、変換部121と、量子化部122とを有する。 The transform/quantization unit 120 performs transform processing and quantization processing on a block-by-block basis. The transform/quantization unit 120 includes a transform unit 121 and a quantization unit 122.

変換部121は、減算部110が出力する予測残差に対して変換処理を行って周波数成分ごとの変換係数を算出し、算出した変換係数を量子化部122に出力する。変換処理(変換)とは、画素領域の信号を周波数領域の信号に変換する処理をいい、例えば、離散コサイン変換(DCT)や離散サイン変換(DST)、カルーネンレーブ変換(KLT)、及びそれらを整数化した変換等をいう。また、変換処理には、画素領域の信号を周波数領域の信号に変換することなくスケーリング等により調整する変換スキップを含んでもよい。 The transform unit 121 performs a transform process on the prediction residual output by the subtraction unit 110 to calculate transform coefficients for each frequency component, and outputs the calculated transform coefficients to the quantization unit 122. Transform process (conversion) refers to a process of converting a pixel-domain signal into a frequency-domain signal, such as a discrete cosine transform (DCT), a discrete sine transform (DST), a Karhunen-Loeve transform (KLT), or an integer equivalent of any of these. The transform process may also include a transform skip, which adjusts the pixel-domain signal by scaling or the like without converting it into a frequency-domain signal.

量子化部122は、変換部121が出力する変換係数に対して量子化処理を行い、量子化後の変換係数をエントロピー符号化部130及び逆量子化・逆変換部140に出力する。具体的には、量子化部122は、原画像のブロックと予測画像のブロックとの差分を表す残差信号に対して変換処理を行って得られる2次元の変換係数に対して量子化処理を行い、2次元の量子化後変換係数を出力する。本実施形態に係る量子化処理には、予め生成された学習済みモデルとしてニューラルネットワークモデルが用いられる。量子化部122の詳細については後述する。 The quantization unit 122 performs quantization processing on the transform coefficients output by the transform unit 121, and outputs the quantized transform coefficients to the entropy coding unit 130 and the inverse quantization and inverse transform unit 140. Specifically, the quantization unit 122 performs quantization processing on two-dimensional transform coefficients obtained by performing a transform processing on a residual signal representing the difference between a block of the original image and a block of the predicted image, and outputs two-dimensional quantized transform coefficients. The quantization processing according to this embodiment uses a neural network model as a pre-generated trained model. Details of the quantization unit 122 will be described later.

エントロピー符号化部130は、量子化部122が出力する量子化後の変換係数に対してエントロピー符号化を行い、データ圧縮を行って符号化ストリーム(ビットストリーム)を生成し、符号化ストリームを符号化装置1の外部に出力する。具体的には、エントロピー符号化部130は、量子化部122により得られる2次元の量子化後変換係数をスキャン順に応じて1次元に変換(すなわち、シリアライズ)したうえでエントロピー符号化を行う。エントロピー符号化には、ハフマン符号やCABAC等を用いることができる。本実施形態において、エントロピー符号化にCABACを用いる一例について説明するが、他のエントロピー符号化を用いてもよい。 The entropy coding unit 130 performs entropy coding on the quantized transform coefficients output by the quantization unit 122, compresses the data, generates a coded stream (bit stream), and outputs the coded stream to the outside of the coding device 1. Specifically, the entropy coding unit 130 converts the two-dimensional quantized transform coefficients obtained by the quantization unit 122 into one dimension (i.e., serializes) according to the scan order, and then performs entropy coding. Huffman coding, CABAC, etc. can be used for entropy coding. In this embodiment, an example of using CABAC for entropy coding is described, but other entropy coding methods may also be used.

エントロピー符号化部130が用いるスキャン順は1種類のみであってもよいし、イントラ予測モード又は変換スキップに応じて複数種類のスキャン順の中から1つのスキャン順を選択してもよい。図2は、スキャン順の種類の一例を示す図である。例えば、符号化対象ブロックが8×8のサイズを有し、エントロピー符号化部130が4×4の係数グループ(CG:Coefficient Group)単位でスキャンを行う。スキャン順は、図2(a)に示すdiagonal、図2(b)に示すhorizontal、及び図2(c)に示すverticalの3種類を含む。エントロピー符号化部130は、イントラ予測モード又は変換スキップに応じて選択したスキャン順により2次元の量子化後変換係数を1次元に変換(すなわち、シリアライズ)したうえで、CABAC等のエントロピー符号化を行う。このようなシリアライズにより、8×8変換係数の場合は64×1の変換係数に変換されることになる。エントロピー符号化部130は、複数種類のスキャン順の中から1つのスキャン順を選択する場合、選択したスキャン順を示す情報を量子化部122に出力してもよい。 The entropy coding unit 130 may use only one type of scan order, or may select one of multiple types of scan orders depending on the intra-prediction mode or transform skip. Figure 2 shows an example of scan orders. For example, suppose the block to be coded has an 8x8 size, and the entropy coding unit 130 scans in 4x4 coefficient groups (CGs). Scan orders include three types: diagonal (shown in Figure 2(a)), horizontal (shown in Figure 2(b)), and vertical (shown in Figure 2(c)). The entropy coding unit 130 converts (i.e., serializes) the two-dimensional quantized transform coefficients into one dimension using the scan order selected depending on the intra-prediction mode or transform skip, and then performs entropy coding such as CABAC. As a result of this serialization, 8x8 transform coefficients are converted into 64x1 transform coefficients. When the entropy coding unit 130 selects one scan order from multiple scan orders, it may output information indicating the selected scan order to the quantization unit 122.

なお、CABACは、二値算術符号化、及び2値シンボルの生起確率を周囲のパラメータの状態(コンテキスト)に基づいて推定するコンテキスト適応処理を用いたエントロピー符号化手法である。入力される2値シンボルの値及びMPS生起確率に基づいて数直線を区間分割していき、最終的に得られた区間の2進数表現を入力2値シンボル系列の符号語とする。2値シンボルのMPS生起確率は、それまでに出現した2値シンボルの値に基づいて推定する。すなわち、所定の確率推定モデルに基づき、2値シンボルがMPSであった場合はMPS生起確率を高め、MPSでなかった場合はMPS生起確率を低下させる制御により、その後に出現する2値シンボルのMPS生起確率を更新する。 CABAC is an entropy coding technique that uses binary arithmetic coding and context adaptive processing, which estimates the probability of occurrence of a binary symbol based on the state (context) of surrounding parameters. A number line is divided into intervals based on the value of the input binary symbol and the MPS occurrence probability, and the binary representation of the final interval is used as the codeword for the input binary symbol sequence. The MPS occurrence probability of a binary symbol is estimated based on the values of the binary symbols that have appeared up to that point. That is, based on a predetermined probability estimation model, the MPS occurrence probability is increased if the binary symbol is an MPS, and decreased if it is not an MPS, thereby updating the MPS occurrence probability of binary symbols that appear subsequently.

また、エントロピー符号化部130は、ブロック分割部100から各符号化対象ブロックのサイズ・形状等の制御情報を取得し、量子化部122から量子化処理に関する制御情報を取得し、予測部170から予測に関する制御情報(例えば、予測モードや動きベクトルの情報)を取得し、これらの制御情報の符号化も行う。 The entropy coding unit 130 also obtains control information such as the size and shape of each block to be coded from the block division unit 100, obtains control information related to the quantization process from the quantization unit 122, and obtains control information related to prediction (e.g., prediction mode and motion vector information) from the prediction unit 170, and encodes this control information.

逆量子化・逆変換部140は、ブロック単位で逆量子化処理及び逆変換処理を行う。逆量子化・逆変換部140は、逆量子化部141と、逆変換部142とを有する。 The inverse quantization and inverse transform unit 140 performs inverse quantization and inverse transform processing on a block-by-block basis. The inverse quantization and inverse transform unit 140 includes an inverse quantization unit 141 and an inverse transform unit 142.

逆量子化部141は、量子化部122が行う量子化処理に対応する逆量子化処理を行う。具体的には、逆量子化部141は、量子化部122が出力する量子化後変換係数に対して逆量子化処理を行うことにより変換係数を復元し、復元した変換係数を逆変換部142に出力する。 The inverse quantization unit 141 performs inverse quantization processing corresponding to the quantization processing performed by the quantization unit 122. Specifically, the inverse quantization unit 141 restores the transform coefficients by performing inverse quantization processing on the quantized transform coefficients output by the quantization unit 122, and outputs the restored transform coefficients to the inverse transform unit 142.

逆変換部142は、変換部121が行う変換処理に対応する逆変換処理を行う。例えば、変換部121がDCTを行った場合には、逆変換部142は逆DCTを行う。逆変換部142は、逆量子化部141が出力する変換係数に対して逆変換処理を行って予測残差を復元し、復元した予測残差である復元予測残差を合成部150に出力する。 The inverse transform unit 142 performs inverse transform processing corresponding to the transform processing performed by the transform unit 121. For example, if the transform unit 121 performs DCT, the inverse transform unit 142 performs inverse DCT. The inverse transform unit 142 performs inverse transform processing on the transform coefficients output by the inverse quantization unit 141 to restore the prediction residual, and outputs the restored prediction residual, or the restored prediction residual, to the synthesis unit 150.

合成部150は、逆変換部142が出力する復元予測残差を、予測部170が出力する予測ブロックと画素単位で合成する。合成部150は、復元予測残差の各画素値と予測ブロックの各画素値を加算して符号化対象ブロックを復号(再構成)し、復号済みブロックをメモリ160に出力する。なお、合成部150とメモリ160との間にループフィルタが設けられてもよい。ループフィルタは、デブロッキングフィルタ処理及びSAO(sample adaptive offset)のうち少なくとも1つを含んでもよい。 The synthesis unit 150 synthesizes the reconstructed prediction residual output by the inverse transform unit 142 with the predicted block output by the prediction unit 170 on a pixel-by-pixel basis. The synthesis unit 150 adds each pixel value of the reconstructed prediction residual to each pixel value of the predicted block to decode (reconstruct) the block to be coded, and outputs the decoded block to the memory 160. Note that a loop filter may be provided between the synthesis unit 150 and the memory 160. The loop filter may include at least one of deblocking filter processing and SAO (sample adaptive offset).

メモリ160は、復号済みブロックをフレーム単位で復号画像として蓄積する。メモリ160は、記憶している復号画像を予測部170に出力する。 Memory 160 accumulates the decoded blocks as decoded images on a frame-by-frame basis. Memory 160 outputs the stored decoded images to prediction unit 170.

予測部170は、ブロック単位で予測処理を行うことにより、符号化対象ブロックに対応する予測ブロックを生成し、生成した予測ブロックを減算部110及び合成部150に出力する。予測部170は、インター予測及びイントラ予測を行う。インター予測では、メモリ160に記憶された復号画像を参照画像として用いて、ブロックマッチング等の手法により動きベクトルを算出し、符号化対象ブロックを予測してインター予測ブロックを生成し、生成したインター予測ブロックを出力する。イントラ予測では、メモリ160に記憶された復号画像のうち、符号化対象ブロックに隣接する復号済み画素値を参照してイントラ予測ブロックを生成し、生成したイントラ予測ブロックを出力する。 The prediction unit 170 performs prediction processing on a block-by-block basis to generate a prediction block corresponding to the block to be coded, and outputs the generated prediction block to the subtraction unit 110 and the synthesis unit 150. The prediction unit 170 performs inter prediction and intra prediction. In inter prediction, the decoded image stored in memory 160 is used as a reference image to calculate a motion vector using a technique such as block matching, predict the block to be coded, generate an inter prediction block, and output the generated inter prediction block. In intra prediction, the decoded image stored in memory 160 is used to generate an intra prediction block by referring to decoded pixel values adjacent to the block to be coded, and the generated intra prediction block is output.

(2)量子化処理
次に、本実施形態に係る量子化処理について説明する。
(2) Quantization Processing Next, the quantization processing according to this embodiment will be described.

(2.1)量子化処理の概要
図3は、本実施形態に係る量子化処理の概要を説明するための図である。図3に示すように、本実施形態に係る量子化部122は、RDOQ処理部122Aと、最適化処理部122Bとを有する。
(2.1) Overview of Quantization Processing Fig. 3 is a diagram for explaining an overview of the quantization processing according to this embodiment. As shown in Fig. 3, the quantization unit 122 according to this embodiment includes an RDOQ processing unit 122A and an optimization processing unit 122B.

RDOQ処理部122Aは、変換部121がブロック単位で出力する2次元の変換係数を量子化し、量子化後の変換係数をエントロピー符号化部130に出力する。例えば、符号化対象ブロックが8×8のサイズを有する場合、RDOQ処理部122Aには8×8の変換係数が入力される。RDOQ処理部122Aは、上述のように、式(1)に示すようにRDコストを最小化することで最適な量子化処理を決定する。 The RDOQ processing unit 122A quantizes the two-dimensional transform coefficients output by the transform unit 121 on a block-by-block basis, and outputs the quantized transform coefficients to the entropy coding unit 130. For example, if the block to be coded has a size of 8x8, 8x8 transform coefficients are input to the RDOQ processing unit 122A. As described above, the RDOQ processing unit 122A determines the optimal quantization process by minimizing the RD cost as shown in equation (1).

ここで、λはQPなどの量子化パラメータによって決定される定数であり、xは量子化前の変換係数であり、qは量子化後の変換係数である。また、D(q,x)は量子化歪みであり、一般的にx及びqの残差二乗和で表される。R(q)はqをエントロピー符号化したビットレートである。 Here, λ is a constant determined by quantization parameters such as QP, x is the transform coefficient before quantization, and q is the transform coefficient after quantization. Furthermore, D(q, x) is the quantization distortion, generally expressed as the residual sum of squares of x and q. R(q) is the bit rate when q is entropy coded.

RDコストの算出の際に、エントロピー符号化部130は、量子化後の変換係数のシンタックス要素値を当該シンタックス要素値のコンテキスト値を用いてエントロピー符号化する。但し、RDコストの最適解を求めるには探索する候補の数が膨大である。本実施形態では、実用的な手法として、HEVC方式のテストモデルであるHMのRDOQ処理を採用する。このようなRDOQ処理の詳細については後述する。 When calculating the RD cost, the entropy coding unit 130 entropy codes the syntax element values of the quantized transform coefficients using the context values of those syntax element values. However, to find the optimal solution for the RD cost, the number of candidates to search is enormous. In this embodiment, as a practical method, RDOQ processing of HM, which is a test model for the HEVC system, is adopted. Details of this RDOQ processing will be described later.

最適化処理部122Bは、RDOQ処理部122Aにより得られた量子化後の変換係数を、ニューラルネットワークモデルを用いて最適化する最適量子化を行い、最適量子化後の変換係数をエントロピー符号化部130に出力する。具体的には、量子化部122は、量子化前の変換係数と、量子化後の変換係数と、シンタックス要素値及びコンテキスト値と、をニューラルネットワークモデルに入力して得られる出力に応じて当該量子化後の変換係数を調整することにより、最適量子化後の変換係数を出力する。 The optimization processing unit 122B performs optimal quantization on the quantized transform coefficients obtained by the RDOQ processing unit 122A using a neural network model, and outputs the optimally quantized transform coefficients to the entropy coding unit 130. Specifically, the quantization unit 122 inputs the pre-quantization transform coefficients, the quantized transform coefficients, the syntax element values, and the context values into a neural network model, and adjusts the quantized transform coefficients according to the output obtained, thereby outputting the optimally quantized transform coefficients.

ここで、量子化前の変換係数とは、RDOQ処理部122Aによる量子化が行われる前の変換係数をいう。本実施形態では、量子化前の変換係数は、量子化パラメータQPから算出される量子化ステップ(Qstep)により変換係数を除算して得られる、実数で表される変換係数(すなわち、スケール後変換係数)である。量子化後の変換係数とは、RDOQ処理部122Aによる量子化が行われた後の変換係数をいう。シンタックス要素値及びコンテキスト値とは、RDOQ処理部122Aによる量子化を行う際に導出されたシンタックス要素値及びコンテキスト値をいう。 Here, the transform coefficients before quantization refer to the transform coefficients before quantization by the RDOQ processing unit 122A. In this embodiment, the transform coefficients before quantization are transform coefficients expressed as real numbers (i.e., scaled transform coefficients) obtained by dividing the transform coefficients by a quantization step (Q step ) calculated from the quantization parameter QP. The transform coefficients after quantization refer to the transform coefficients after quantization by the RDOQ processing unit 122A. The syntax element values and context values refer to the syntax element values and context values derived when quantization is performed by the RDOQ processing unit 122A.

ニューラルネットワークモデルは、予め生成された学習済みニューラルネットワークモデルである。本実施形態に係るニューラルネットワークモデルは、量子化前の変換係数と、量子化後の変換係数と、シンタックス要素値及びコンテキスト値と、を入力として、量子化後の変換係数を最適化するよう調整するための調整値を出力する。本実施形態に係るニューラルネットワークモデルの詳細については後述する。 The neural network model is a trained neural network model that has been generated in advance. The neural network model according to this embodiment receives as input the transform coefficients before quantization, the transform coefficients after quantization, syntax element values, and context values, and outputs adjustment values for adjusting the transform coefficients after quantization to optimize them. Details of the neural network model according to this embodiment will be described later.

エントロピー符号化部130は、最終的に、最適化処理部122Bにより得られた最適量子化後の変換係数をエントロピー符号化することにより、ビットストリームを出力する。 The entropy coding unit 130 finally outputs a bitstream by entropy coding the optimally quantized transform coefficients obtained by the optimization processing unit 122B.

(2.2)RDOQ処理
図4は、本実施形態に係るRDOQ処理部122Aの構成例を示す図である。RDOQ処理部122Aは、量子化前の変換係数、具体的には、実数で表されるスケール後変換係数を、丸め処理により整数に変換(量子化)して量子化後の変換係数を出力する。
4 is a diagram showing an example of the configuration of the RDOQ processing unit 122A according to this embodiment. The RDOQ processing unit 122A converts (quantizes) pre-quantization transform coefficients, specifically, scaled transform coefficients expressed as real numbers, into integers by rounding, and outputs the quantized transform coefficients.

図4に示すように、RDOQ処理部122Aは、スカラー量子化(SQ:Scaler Quantization)処理部122A1と、レベル推定(LE:Level Estimation)処理部122A2と、AZ(All-zero CG)処理部122A3と、最終有意係数処理(LAST処理)部122A4と、SBH(Sign Bit Hiding)処理部122A5とを有する。 As shown in FIG. 4, the RDOQ processing unit 122A includes a scalar quantization (SQ) processing unit 122A1, a level estimation (LE) processing unit 122A2, an all-zero CG (AZ) processing unit 122A3, a last significant coefficient processing (LAST processing) unit 122A4, and a sign bit hiding (SBH) processing unit 122A5.

SQ処理部122A1は、2次元のスケール後変換係数に対してスカラー量子化処理を行い、2次元のスケール後変換係数の各変換係数を丸め処理する。LE処理部122A2は、レベル推定処理を行い、各変換係数を「-1」又は「±0」(変化させない)した際のRDコストを算出し、RDコストがより最適となるレベルを推定する。スカラー量子化処理及びレベル推定処理は、4×4の変換係数のグループであるCGごとに各変換係数について行われる。 The SQ processing unit 122A1 performs scalar quantization on the two-dimensional scaled transform coefficients and rounds each of the two-dimensional scaled transform coefficients. The LE processing unit 122A2 performs level estimation, calculating the RD cost when each transform coefficient is set to "-1" or "±0" (unchanged), and estimating the level at which the RD cost is most optimal. The scalar quantization and level estimation processes are performed on each transform coefficient for each CG, which is a group of 4x4 transform coefficients.

AZ処理部122A3は、RDコストに基づいて各CG内の変換係数を全て0にするかどうかを決定する。LAST処理部122A4は、RDコストに基づいて最後の非ゼロとなる係数のブロック内での最適な位置を推定する。SBH処理部122A5は、変換の総和が偶数か奇数かに応じて、最後の変換係数の正負を暗黙的に決定するための処理を行う。 The AZ processing unit 122A3 determines whether to set all transform coefficients in each CG to zero based on the RD cost. The LAST processing unit 122A4 estimates the optimal position within the block of the last non-zero coefficient based on the RD cost. The SBH processing unit 122A5 performs processing to implicitly determine the sign of the last transform coefficient depending on whether the total transform sum is even or odd.

このように、SQ処理部122A1、LE処理部122A2、AZ処理部122A3、LAST処理部122A4、及びSBH処理部122A5は、それぞれ候補となる量子化後の変換係数に対してRDコストを算出し、コストが最も小さくなる場合の量子化後の変換係数を導出する。RDコストを算出する際には、エントロピー符号化部130が量子化後の変換係数をエントロピー符号化した場合のビットレートR(q)を推定する。 In this way, the SQ processing unit 122A1, LE processing unit 122A2, AZ processing unit 122A3, LAST processing unit 122A4, and SBH processing unit 122A5 each calculate an RD cost for each candidate quantized transform coefficient, and derive the quantized transform coefficient that minimizes the cost. When calculating the RD cost, the entropy coding unit 130 estimates the bit rate R(q) when entropy coding the quantized transform coefficient.

ここで、エントロピー符号化部130による変換係数の符号化の一例について説明する。図5は、エントロピー符号化部130による変換係数の符号化の一例を示す図である。図5において、符号化対象ブロックが8×8のサイズを有する変換ブロック(TU:Transform Unit)であり、スキャン順が図2(a)に示したdiagonalである一例を示している。 Here, an example of encoding of transform coefficients by the entropy encoding unit 130 will be described. Figure 5 is a diagram showing an example of encoding of transform coefficients by the entropy encoding unit 130. Figure 5 shows an example in which the block to be encoded is a transform block (TU: Transform Unit) having a size of 8x8, and the scan order is the diagonal order shown in Figure 2(a).

図5に示すように、エントロピー符号化部130は、量子化後の変換係数の有意な成分(Significant coefficient)、すなわち、非ゼロとなる係数について、その位置や値をエントロピー符号化して出力する。具体的には、エントロピー符号化部130は、ブロック内の変換係数を高周波から低周波に向かってあらかじめ規定したスキャン順によりシリアライズし、シリアライズされた変換係数をエントロピー符号化する。その際に、シリアライズされた変換係数のうち、最も高周波側の最後の非ゼロ係数(Last significant coeff)の位置を示すシンタックス要素を復号側にシグナリングし、当該最後の非ゼロ係数からDC成分までの有意係数の位置や値を効率的にエントロピー符号化する。 As shown in FIG. 5, the entropy coding unit 130 entropy codes the positions and values of significant components (significant coefficients) of the quantized transform coefficients, i.e., non-zero coefficients, and outputs the results. Specifically, the entropy coding unit 130 serializes the transform coefficients in a block from high to low frequencies in a predefined scan order and entropy codes the serialized transform coefficients. At this time, the entropy coding unit 130 signals to the decoding side a syntax element indicating the position of the last non-zero coefficient (last significant coeff) on the highest frequency side among the serialized transform coefficients, and efficiently entropy codes the positions and values of the significant coefficients from the last non-zero coefficient to the DC component.

具体的には、HEVCにおける変換係数用のシンタックス要素には、
・last_sig_coeff_x_prefix
・last_sig_coeff_y_prefix
・last_sig_coeff_x_suffix
・last_sig_coeff_y_suffix
・coded_sub_block_flag
・sig_coeff_flag
・coeff_abs_level_greater1_flag
・coeff_abs_level_greater2_flag
・coeff_abs_level_remaining
・coeff_sign_flag
が存在する。
Specifically, syntax elements for transform coefficients in HEVC include:
・last_sig_coeff_x_prefix
・last_sig_coeff_y_prefix
・last_sig_coeff_x_suffix
・last_sig_coeff_y_suffix
・coded_sub_block_flag
・sig_coeff_flag
・coeff_abs_level_greater1_flag
・coeff_abs_level_greater2_flag
・coeff_abs_level_remaining
・coeff_sign_flag
exists.

ここで、last_sig_coeff_x_prefix、last_sig_coeff_y_prefix、last_sig_coeff_x_suffix、及びlast_sig_coeff_y_suffixは、LAST処理部122A4で決定した最後の非ゼロとなる係数のx,y座標を表すシンタックス要素である。coded_sub_block_flagはサブブロック(CG)内の非ゼロの係数の有無を表すシンタックス要素であり、sig_coeff_flagは係数の絶対値が1以上であることを表すシンタックス要素であり、coeff_abs_level_greater1_flagは係数の絶対値が2以上であることを表すシンタックス要素であり、coeff_abs_level_greater2_flagは係数の絶対値が3以上であることを表すシンタックス要素であり、coeff_abs_level_remainingは係数の絶対値から3を減算した値を表すシンタックス要素であり、coeff_sign_flagは係数の正負を表すシンタックス要素である。 Here, last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix are syntax elements representing the x and y coordinates of the last non-zero coefficient determined by the LAST processing unit 122A4. coded_sub_block_flag is a syntax element that indicates whether there are any non-zero coefficients in a sub-block (CG), sig_coeff_flag is a syntax element that indicates that the absolute value of the coefficient is 1 or greater, coeff_abs_level_greater1_flag is a syntax element that indicates that the absolute value of the coefficient is 2 or greater, coeff_abs_level_greater2_flag is a syntax element that indicates that the absolute value of the coefficient is 3 or greater, coeff_abs_level_remaining is a syntax element that indicates the value obtained by subtracting 3 from the absolute value of the coefficient, and coeff_sign_flag is a syntax element that indicates whether the coefficient is positive or negative.

ここで、last_sig_coeff_x_prefix、last_sig_coeff_y_prefix、last_sig_coeff_x_suffix、last_sig_coeff_y_suffixは、ひとつの変換係数に対してそれぞれひとつの値となるシンタックス要素であり、coded_sub_block_flagは、変換係数のサブブロック(CG)の個数分の値となるシンタックス要素であり、sig_coeff_flag、coeff_abs_level_greater1_flag、coeff_abs_level_greater2_flag、coeff_abs_level_remaining、及びcoeff_sign_flagは、変換係数の値や変換係数の最後の非ゼロとなる係数の位置に応じて変化する個数分の値で表される。 Here, last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix are syntax elements that each have one value for one transform coefficient, coded_sub_block_flag is a syntax element that has a value equal to the number of sub-blocks (CGs) of the transform coefficients, and sig_coeff_flag, coeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag, coeff_abs_level_remaining, and coeff_sign_flag are expressed as a number of values that change depending on the value of the transform coefficient and the position of the last non-zero coefficient of the transform coefficients.

これらのシンタックス要素のうち、last_sig_coeff_x_prefix、last_sig_coeff_y_prefix、coded_sub_block_flag、sig_coeff_flag、coeff_abs_level_greater1_flag、coeff_abs_level_greater2_flagは、コンテキスト値を用いたエントロピー符号化が行われるシンタックス要素である。一方、last_sig_coeff_x_suffix、last_sig_coeff_y_suffix、coeff_abs_level_remaining、coeff_sign_flagは、コンテキスト値を用いないバイパス処理によりエントロピー符号化が行われるシンタックス要素である。 Of these syntax elements, last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, coded_sub_block_flag, sig_coeff_flag, coeff_abs_level_greater1_flag, and coeff_abs_level_greater2_flag are syntax elements for which entropy coding is performed using context values. On the other hand, last_sig_coeff_x_suffix, last_sig_coeff_y_suffix, coeff_abs_level_remaining, and coeff_sign_flag are syntax elements for which entropy coding is performed using bypass processing without using context values.

(2.3)最適化処理
図6は、本実施形態に係る最適化処理部122Bの構成例を示す図である。上述のように、最適化処理部122Bには、DCTやDSTなどの変換処理を施した変換係数に対して量子化パラメータQPから算出されるQstepにより除算した実数で表される量子化前の変換係数と、当該量子化前の変換係数をHEVC方式やVVC方式のテストモデルであるHMやVTMなどで量子化した量子化後の変換係数と、当該量子化を行う際に算出した変換係数用のシンタックス要素値及びコンテキスト値と、が入力される。ここで、量子化前の変換係数及び量子化後の変換係数のそれぞれは、2次元に配列されており、例えば8×8の変換係数からなる形状を有する。最適化処理部122Bは、入力された量子化後の変換係数を最適化する最適量子化を行い、最適量子化後の変換係数を出力する。
(2.3) Optimization Processing FIG. 6 is a diagram showing an example of the configuration of the optimization processing unit 122B according to this embodiment. As described above, the optimization processing unit 122B receives as input pre-quantization transform coefficients expressed as real numbers obtained by dividing transform coefficients subjected to transform processing such as DCT or DST by a Q step calculated from a quantization parameter QP, quantized transform coefficients obtained by quantizing the pre-quantization transform coefficients using HM or VTM, which are test models for the HEVC or VVC system, and syntax element values and context values for the transform coefficients calculated during the quantization. Here, the pre-quantization transform coefficients and the quantized transform coefficients are each arranged two-dimensionally, and have a shape consisting of, for example, 8×8 transform coefficients. The optimization processing unit 122B performs optimal quantization to optimize the input quantized transform coefficients, and outputs the optimally quantized transform coefficients.

図6に示すように、本実施形態に係る最適化処理部122Bは、符号取得部122B2と、符号除去部122B3と、形状変換部122B4と、調整値取得部122B6と、調整値適用部122B7とを有する。 As shown in FIG. 6, the optimization processing unit 122B according to this embodiment includes a code acquisition unit 122B2, a code removal unit 122B3, a shape conversion unit 122B4, an adjustment value acquisition unit 122B6, and an adjustment value application unit 122B7.

符号取得部122B2は、入力された量子化前の変換係数及び量子化後の変換係数のいずれかの正負符号を取得し、取得した正負符号を調整値適用部122B7に出力する。例えば、符号取得部122B2は、2次元の量子化後の変換係数を構成する各変換係数の正負符号を取得し、取得した各正負符号を調整値適用部122B7に出力する。 The sign acquisition unit 122B2 acquires the positive or negative sign of either the input pre-quantization transform coefficients or the quantized transform coefficients, and outputs the acquired positive or negative sign to the adjustment value application unit 122B7. For example, the sign acquisition unit 122B2 acquires the positive or negative sign of each transform coefficient that constitutes the two-dimensional post-quantization transform coefficients, and outputs each acquired positive or negative sign to the adjustment value application unit 122B7.

符号除去部122B3は、入力された量子化前の変換係数及び量子化後の変換係数のそれぞれの正負符号を除去し、正負符号が除去された量子化前の変換係数と正負符号が除去された量子化後の変換係数とを調整値取得部122B6に出力する。具体的には、符号除去部122B3は、2次元の量子化前の変換係数を構成する各変換係数の正負符号を除去するとともに、2次元の量子化後の変換係数を構成する各変換係数の正負符号を除去する。これにより、正負符号に依らないニューラルネットワークモデルの処理が可能になる。なお、ニューラルネットワークモデルを生成する際の学習においても正負符号を除去したものを用いる。 The sign removal unit 122B3 removes the positive and negative signs from the input pre-quantization transform coefficients and post-quantization transform coefficients, and outputs the pre-quantization transform coefficients with the signs removed and the quantization transform coefficients with the signs removed to the adjustment value acquisition unit 122B6. Specifically, the sign removal unit 122B3 removes the positive and negative signs from each transform coefficient constituting the two-dimensional pre-quantization transform coefficients, and also removes the positive and negative signs from each transform coefficient constituting the two-dimensional post-quantization transform coefficients. This enables processing of the neural network model independent of positive and negative signs. Note that the data with the signs removed is also used for learning when generating the neural network model.

形状変換部122B4は、入力されたシンタックス要素値及びコンテキスト値のそれぞれを変換係数と同一形状に変換し、形状変換後のシンタックス要素値及び形状変換後のコンテキスト値を調整値取得部122B6に出力する。上述のように、入力された変換係数は、m×n(m、n:1以上の整数)の変換係数からなる2次元の形状を有し、本実施形態では、8×8の変換係数からなる2次元の形状を有する。そのため、形状変換部122B4は、入力されたシンタックス要素値及びコンテキスト値のそれぞれを8×8の形状に変換する。 The shape conversion unit 122B4 converts each of the input syntax element values and context values into the same shape as the transformation coefficients, and outputs the shape-converted syntax element values and shape-converted context values to the adjustment value acquisition unit 122B6. As described above, the input transformation coefficients have a two-dimensional shape consisting of mxn (m, n: integers greater than or equal to 1) transformation coefficients, and in this embodiment, they have a two-dimensional shape consisting of 8x8 transformation coefficients. Therefore, the shape conversion unit 122B4 converts each of the input syntax element values and context values into an 8x8 shape.

例えば、last_sig_coeff_x_prefix、last_sig_coeff_y_prefix、last_sig_coeff_x_suffix、及びlast_sig_coeff_y_suffixのそれぞれは、ひとつの値で表される。そのため、形状変換部122B4は、8×8の変換係数の場合、これらのシンタックス要素値及びコンテキスト値を64個ずつ複製し、変換係数と同一形状に並べる。 For example, last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix are each represented by a single value. Therefore, in the case of 8x8 transform coefficients, the shape conversion unit 122B4 replicates these syntax element values and context values 64 times each and arranges them in the same shape as the transform coefficients.

coded_sub_block_flagは、変換係数のサブブロック(CG)の個数分の値で表される。そのため、形状変換部122B4は、8×8の変換係数の場合、4個のcoded_sub_block_flagが存在し、シンタックス要素値及びコンテキスト値をサブブロック内が同一の値となるようにそれぞれ16個ずつ複製し、変換係数と同一形状に並べる。 The coded_sub_block_flag is expressed as a value equal to the number of sub-blocks (CG) of the transform coefficients. Therefore, in the case of 8x8 transform coefficients, there are four coded_sub_block_flag, and the shape conversion unit 122B4 duplicates the syntax element values and context values by 16 each so that they are the same within the sub-block, and arranges them in the same shape as the transform coefficients.

sig_coeff_flag、coeff_abs_level_greater1_flag、coeff_abs_level_greater2_flag、coeff_abs_level_remaining、及びcoeff_sign_flagは、変換係数の値や変換係数の最後の非ゼロとなる係数の位置に応じて個数が変化する。そのため、形状変換部122B4は、シンタックス要素値及びコンテキスト値が存在しない位置については発生し得ない値、例えば-1で穴埋めすることで変換係数と同一形状に並べる。 The number of sig_coeff_flag, coeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag, coeff_abs_level_remaining, and coeff_sign_flag changes depending on the value of the transform coefficient and the position of the last non-zero transform coefficient. Therefore, the shape conversion unit 122B4 arranges the syntax element values and context values in the same shape as the transform coefficients by filling in positions where they do not exist with a value that cannot occur, such as -1.

上記の操作により、どのシンタックス要素値及びコンテキスト値も変換係数と同一形状で表すことが可能となる。 The above operations allow all syntax element values and context values to be represented in the same form as transform coefficients.

調整値取得部122B6は、符号除去部122B3により正負符号が除去された量子化前の変換係数と、符号除去部122B3により正負符号が除去された量子化後の変換係数と、形状変換部122B4により形状が変換されたシンタックス要素値及びコンテキスト値と、をニューラルネットワークモデルに入力し、ニューラルネットワークモデルから出力される調整値を取得し、取得した調整値を調整値適用部122B7に出力する。調整値は、例えば、変換係数ごとに、「-1」及び「±0」の2種類のうちいずれかの調整値とすることができるが、3種類以上の調整値を用いてもよい。 The adjustment value acquisition unit 122B6 inputs the pre-quantization transform coefficients from which the positive and negative signs have been removed by the sign removal unit 122B3, the quantized transform coefficients from which the positive and negative signs have been removed by the sign removal unit 122B3, and the syntax element values and context values whose shapes have been converted by the shape conversion unit 122B4 into a neural network model, acquires the adjustment values output from the neural network model, and outputs the acquired adjustment values to the adjustment value application unit 122B7. For each transform coefficient, the adjustment value can be one of two types, "-1" and "±0," for example, but three or more types of adjustment values may also be used.

ここで、ニューラルネットワークモデルは、入力が、量子化前の変換係数、量子化後の変換係数、変換係数のシンタックス要素値及びコンテキスト値であって、出力が、量子化後の変換係数に対する調整値となるニューラルネットワークであればよく、任意のモデルを用いてもよい。ニューラルネットワークモデルは、量子化前の変換係数と、量子化後の当該変換係数と、当該変換係数のためのシンタックス要素値と、当該シンタックス要素値のコンテキスト値と、全探索又は貪欲法を用いて導出された最適量子化後の当該変換係数とを教師データとして用いた機械学習により生成されたものであってもよい。ニューラルネットワークモデルの構成例については後述する。 Here, the neural network model may be any model as long as it is a neural network whose inputs are transform coefficients before quantization, transform coefficients after quantization, syntax element values of the transform coefficients, and context values, and whose output is adjustment values for the transform coefficients after quantization. The neural network model may be generated by machine learning using as training data the transform coefficients before quantization, the transform coefficients after quantization, syntax element values for the transform coefficients, context values for the syntax element values, and the transform coefficients after optimal quantization derived using a full search or greedy algorithm. An example of the configuration of a neural network model will be described later.

調整値適用部122B7は、符号除去部122B3により正負符号が除去された量子化後の変換係数に対して、調整値取得部122B6が取得した調整値と、符号取得部122B2が取得した正負符号とを適用することにより、最適量子化後の変換係数を出力する。例えば、調整値適用部122B7は、符号除去部122B3により正負符号が除去された量子化後の各変換係数から、調整値取得部122B6が取得した各調整値を減算することにより、当該量子化後の各変換係数を調整する。そして、調整値適用部122B7は、調整された量子化後の各変換係数に対して、符号取得部122B2が取得した各正負符号を付与(乗算)することにより、最適量子化後の変換係数を出力する。 The adjustment value application unit 122B7 applies the adjustment values acquired by the adjustment value acquisition unit 122B6 and the positive/negative signs acquired by the sign acquisition unit 122B2 to the quantized transform coefficients from which the positive/negative signs have been removed by the sign removal unit 122B3, thereby outputting the optimally quantized transform coefficients. For example, the adjustment value application unit 122B7 adjusts each quantized transform coefficient by subtracting the adjustment values acquired by the adjustment value acquisition unit 122B6 from each quantized transform coefficient from which the positive/negative signs have been removed by the sign removal unit 122B3. The adjustment value application unit 122B7 then assigns (multiplies) the positive/negative signs acquired by the sign acquisition unit 122B2 to each adjusted quantized transform coefficient, thereby outputting the optimally quantized transform coefficients.

このように、本実施形態に係る最適化処理部122Bによれば、量子化前の変換係数及び量子化後の変換係数だけではなく、変換係数のシンタックス要素値及びそのコンテキスト値をニューラルネットワークモデルへの入力として用いる。これにより、量子化後の変換係数をより適切に調整可能になる。よって、ニューラルネットワークモデルを用いた量子化処理を改善できるため、符号化装置1における符号化効率が向上する。 In this way, the optimization processing unit 122B according to this embodiment uses not only the transform coefficients before and after quantization, but also the syntax element values of the transform coefficients and their context values as input to the neural network model. This makes it possible to more appropriately adjust the transform coefficients after quantization. Therefore, the quantization process using the neural network model can be improved, thereby improving the coding efficiency of the coding device 1.

(2.4)最適化処理の変更例
図7は、本実施形態に係る最適化処理部122Bの構成の変更例を示す図である。以下では、ニューラルネットワークのモデルとして1次元のニューラルネットワークであるLSTMを用いるものとし、第1に、入力された量子化前の変換係数、量子化後の変換係数、変換係数のシンタックス要素値及びコンテキスト値を2次元から1次元に変換する。エントロピー符号化順序を表す変換係数のスキャン順に応じて2次元から1次元に変換することで、ニューラルネットワークがエントロピー符号化順序を考慮することが可能となる。
(2.4) Modified Example of Optimization Processing Fig. 7 is a diagram showing a modified example of the configuration of the optimization processing unit 122B according to this embodiment. In the following, it is assumed that a one-dimensional neural network, LSTM, is used as a neural network model. First, the input pre-quantization transform coefficients, post-quantization transform coefficients, syntax element values of the transform coefficients, and context values are converted from two dimensions to one dimension. By converting from two dimensions to one dimension according to the scan order of the transform coefficients, which represents the entropy coding order, it becomes possible for the neural network to take the entropy coding order into consideration.

図7に示すように、本変更例に係る最適化処理部122Bは、シリアライズ部122B1と、シリアライズ部122B5と、デシリアライズ部122B8とをさらに有する点で、図6に示した最適化処理部122Bと異なる。 As shown in FIG. 7, the optimization processing unit 122B according to this modified example differs from the optimization processing unit 122B shown in FIG. 6 in that it further includes a serialization unit 122B1, a serialization unit 122B5, and a deserialization unit 122B8.

上述のように、エントロピー符号化部130は、量子化後の2次元の変換係数をスキャン順に応じて1次元に変換(シリアライズ)したうえでエントロピー符号化を行っている。 As described above, the entropy coding unit 130 converts (serializes) the quantized two-dimensional transform coefficients into one dimension according to the scan order and then performs entropy coding.

シリアライズ部122B1は、入力された量子化前の2次元の変換係数と、入力された量子化後の2次元の変換係数と、のそれぞれをスキャン順に応じて1次元に変換(シリアライズ)し、量子化前の1次元の変換係数と量子化後の1次元の変換係数とを符号除去部122B3及び符号取得部122B2に出力する。 The serialization unit 122B1 converts (serializes) the input two-dimensional transform coefficients before quantization and the input two-dimensional transform coefficients after quantization into one dimension according to the scan order, and outputs the one-dimensional transform coefficients before quantization and the one-dimensional transform coefficients after quantization to the code removal unit 122B3 and the code acquisition unit 122B2.

シリアライズ部122B5は、形状変換部122B4により形状が変換された2次元のシンタックス要素値及び2次元のコンテキスト値のそれぞれをスキャン順に応じて1次元に変換(シリアライズ)し、1次元のシンタックス要素値及び1次元のコンテキスト値を調整値取得部122B6に出力する。 The serialization unit 122B5 converts (serializes) each of the two-dimensional syntax element values and two-dimensional context values whose shapes have been converted by the shape conversion unit 122B4 into one dimension according to the scan order, and outputs the one-dimensional syntax element values and one-dimensional context values to the adjustment value acquisition unit 122B6.

このように、シリアライズ部122B1及びシリアライズ部122B5は、量子化前の2次元の変換係数と、量子化後の2次元の変換係数と、2次元のシンタックス要素値と、2次元のコンテキスト値と、のそれぞれをスキャン順に応じて1次元に変換する。例えば、HEVC方式では、予測画像のモードに応じて図2に示したdiagonal、horizontal、verticalの3種類のスキャン順が存在する。シリアライズ部122B1及びシリアライズ部122B5は、該当の変換係数に採用されているスキャン順に応じて1次元に変換する。8×8の変換係数の場合、シリアライズによって64×1の形状に変換されることになる。 In this way, serialization unit 122B1 and serialization unit 122B5 convert the two-dimensional transform coefficients before quantization, the two-dimensional transform coefficients after quantization, the two-dimensional syntax element values, and the two-dimensional context values into one dimension according to the scan order. For example, in the HEVC format, there are three types of scan orders depending on the mode of the predicted image: diagonal, horizontal, and vertical, as shown in Figure 2. Serialization unit 122B1 and serialization unit 122B5 convert into one dimension according to the scan order used for the corresponding transform coefficients. In the case of 8x8 transform coefficients, they will be converted into a 64x1 shape by serialization.

本変更例において、調整値取得部122B6は、量子化前の1次元の変換係数と、量子化後の1次元の変換係数と、1次元のシンタックス要素値と、1次元のコンテキスト値と、をニューラルネットワークモデルに入力し、ニューラルネットワークモデルから出力される調整値を取得し、取得した調整値を調整値適用部122B7に出力する。 In this modified example, the adjustment value acquisition unit 122B6 inputs the one-dimensional transform coefficients before quantization, the one-dimensional transform coefficients after quantization, the one-dimensional syntax element values, and the one-dimensional context values into a neural network model, acquires the adjustment values output from the neural network model, and outputs the acquired adjustment values to the adjustment value application unit 122B7.

ここで、ニューラルネットワークモデルは、スキャン順ごとに準備されてもよい。例えば、図2(a)に示すdiagonalに対応する1次元ニューラルネットワークモデルと、図2(b)に示すhorizontalに対応する1次元ニューラルネットワークモデルと、図2(c)に示すverticalに対応する1次元ニューラルネットワークモデルとが生成されていてもよい。調整値取得部122B6は、複数のスキャン順に対応する複数のニューラルネットワークモデルのうち、エントロピー符号化部130により選択されたスキャン順に対応するニューラルネットワークモデルを特定し、当該特定したニューラルネットワークモデルを用いて調整値を取得してもよい。 Here, a neural network model may be prepared for each scan order. For example, a one-dimensional neural network model corresponding to the diagonal scan order shown in FIG. 2(a), a one-dimensional neural network model corresponding to the horizontal scan order shown in FIG. 2(b), and a one-dimensional neural network model corresponding to the vertical scan order shown in FIG. 2(c) may be generated. The adjustment value acquisition unit 122B6 may identify, from among multiple neural network models corresponding to multiple scan orders, the neural network model corresponding to the scan order selected by the entropy coding unit 130, and acquire the adjustment value using the identified neural network model.

デシリアライズ部122B8は、調整値適用部122B7が出力する最適量子化後の1次元の変換係数に対して、シリアライズ部122B1及びシリアライズ部122B5が行うシリアライズの逆処理(デシリアライズ)を行う。すなわち、デシリアライズ部122B8は、調整値適用部122B7が出力する最適量子化後の1次元の変換係数をスキャン順に応じて2次元に逆変換し、最適量子化後の2次元の変換係数を出力する。 The deserialization unit 122B8 performs the reverse process (deserialization) of the serialization performed by the serialization unit 122B1 and the serialization unit 122B5 on the one-dimensional transform coefficients after optimal quantization output by the adjustment value application unit 122B7. In other words, the deserialization unit 122B8 inversely transforms the one-dimensional transform coefficients after optimal quantization output by the adjustment value application unit 122B7 into two dimensions according to the scan order, and outputs the two-dimensional transform coefficients after optimal quantization.

このように、本変更例によれば、量子化前の1次元の変換係数及び量子化後の1次元の変換係数を1次元ニューラルネットワークモデルに入力して得られる出力に応じて、量子化後の1次元の変換係数を調整する。上述のように、エントロピー符号化部130は、量子化部122により得られる2次元の量子化後変換係数をスキャン順に応じて1次元に変換したうえでCABAC等のエントロピー符号化を行う。CABACにおける2値シンボルのMPS生起確率は、それまでに出現した2値シンボルの値に基づいて推定される。 In this manner, according to this modified example, the one-dimensional transform coefficients after quantization are adjusted according to the output obtained by inputting the one-dimensional transform coefficients before quantization and the one-dimensional transform coefficients after quantization into a one-dimensional neural network model. As described above, the entropy coding unit 130 converts the two-dimensional quantized transform coefficients obtained by the quantization unit 122 into one dimension according to the scan order, and then performs entropy coding such as CABAC. The MPS occurrence probability of a binary symbol in CABAC is estimated based on the values of the binary symbols that have appeared up to that point.

2次元ニューラルネットワークモデルを用いる先行研究では、エントロピー符号化におけるスキャン順が考慮されておらず、エントロピー符号化におけるスキャン順において隣り合わない係数の特徴も2次元ニューラルネットワークモデルにおいて抽出している。そのため、関係性の小さい特徴により誤った予測(すなわち、誤った量子化調整値の導出)につながるという問題がある。 Previous research using two-dimensional neural network models did not take into account the scan order in entropy coding, and the two-dimensional neural network model also extracted features of coefficients that are not adjacent in the scan order in entropy coding. As a result, there is a problem in that features with little correlation can lead to incorrect predictions (i.e., the derivation of incorrect quantization adjustment values).

これに対し、本変更例では、エントロピー符号化におけるスキャン順を考慮している。これにより、エントロピー符号化におけるスキャン順において隣り合う部分の係数の特徴を1次元ニューラルネットワークモデルにおいて抽出可能であり、最適な調整値を導出することが可能になる。よって、ニューラルネットワークモデルを用いた量子化処理において、エントロピー符号化におけるスキャン順を考慮することにより、符号化効率を向上させることができる。 In contrast, this modified example takes into account the scan order in entropy coding. This makes it possible to extract the characteristics of adjacent coefficients in the scan order in entropy coding using a one-dimensional neural network model, making it possible to derive optimal adjustment values. Therefore, by taking into account the scan order in entropy coding in quantization processing using a neural network model, it is possible to improve coding efficiency.

(2.5)ニューラルネットワークモデルの一例
図8は、本実施形態に係るニューラルネットワークモデルの一例を示す図である。上述のように、本実施形態に係るニューラルネットワークモデルは、入力が、符号を取り除いた量子化前の変換係数、符号を取り除いた量子化後の変換係数、シンタックス要素値及びコンテキスト値である。これらをニューラルネットワークモデルへ入力すると、量子化後の変換係数に対する-1又は±0の調整値が出力される。
(2.5) Example of Neural Network Model Fig. 8 is a diagram showing an example of a neural network model according to this embodiment. As described above, the neural network model according to this embodiment receives inputs including transform coefficients before quantization with their signs removed, transform coefficients after quantization with their signs removed, syntax element values, and context values. When these are input to the neural network model, an adjustment value of -1 or ±0 for the transform coefficients after quantization is output.

図8において、括弧内の値は次元を表しており、batchはバッチサイズ、blockはブロックサイズ、channelsはチャネル数、embedding_dimsはエンベディングの次元数をそれぞれ示している。channelsやembedding_dimsの値は、前段の全結合(FC)やエンベディングの次元数に依存しているが、各全結合やエンベディングによって異なるチャネル数や次元数としてもよい。 In Figure 8, the values in parentheses represent the dimensions, where batch is the batch size, block is the block size, channels is the number of channels, and embedding_dims is the number of dimensions of the embedding. The values of channels and embedding_dims depend on the number of dimensions of the previous fully connected (FC) and embedding, but the number of channels and dimensions may differ depending on each fully connected and embedding.

入力及び出力で用いている値は、
・transform_cofficient: 量子化前の変換係数
・quantized_cofficient: HMのRDOQ処理により量子化した変換係数
・last_sig_coeff_x: 最後の非ゼロとなる係数の位置のx座標
・last_sig_coeff_y: 最後の非ゼロとなる係数の位置のy座標
・coeff_abs_level_remaining: 量子化係数の絶対値から3を減算した値
・last_sig_coeff_x_prefix_ctx: last_sig_coeff_x_prefixのコンテキスト値
・last_sig_coeff_y_prefix_ctx: last_sig_coeff_y_prefixのコンテキスト値
・coded_sub_block_flag: サブブロック内の非ゼロの係数の有無を表すフラグ
・coded_sub_block_flag_ctx: coded_sub_block_flagのコンテキスト値
・sig_coeff_flag: 量子化係数の絶対値が1以上であることを表すフラグ
・sig_coeff_flag_ctx: sig_coeff_flagのコンテキスト値
・coeff_abs_level_greater1_flag: 量子化係数の絶対値が2以上であることを表すフラグ
・coeff_abs_level_greater1_flag_ctx: coeff_abs_level_greater1_flagのコンテキスト値
・coeff_abs_level_greater2_flag: 量子化係数の絶対値が3以上であることを表すフラグ
・coeff_abs_level_greater2_flag_ctx: coeff_abs_level_greater2_flagのコンテキスト値
・coeff_sign_flag: 量子化係数の正負を表すフラグ
・adjustments: RDOQ処理により量子化した変換係数と最適量子化後の変換係数の差分である調整値
である。形状変換部122B4においてシンタックス要素値及びコンテキスト値を変換係数と同一形状に変換しているため、入力はそれぞれバッチサイズ×64×1の形状で表される。
The values used in the input and output are:
・transform_cofficient: Transform coefficient before quantization ・quantized_cofficient: Transform coefficient quantized by HM RDOQ processing ・last_sig_coeff_x: X coordinate of the position of the last non-zero coefficient ・last_sig_coeff_y: Y coordinate of the position of the last non-zero coefficient ・coeff_abs_level_remaining: Value obtained by subtracting 3 from the absolute value of the quantized coefficient ・last_sig_coeff_x_prefix_ctx: Context value of last_sig_coeff_x_prefix ・last_sig_coeff_y_prefix_ctx: Context value of last_sig_coeff_y_prefix ・coded_sub_block_flag: Flag indicating whether there are any non-zero coefficients in the sub-block ・coded_sub_block_flag_ctx: Context value of coded_sub_block_flag ・sig_coeff_flag: Flag indicating that the absolute value of the quantization coefficient is 1 or greater. ・sig_coeff_flag_ctx: Context value of sig_coeff_flag ・coeff_abs_level_greater1_flag: Flag indicating that the absolute value of the quantization coefficient is 2 or greater. ・coeff_abs_level_greater1_flag_ctx: Context value of coeff_abs_level_greater1_flag ・coeff_abs_level_greater2_flag: Flag indicating that the absolute value of the quantization coefficient is 3 or greater. ・coeff_abs_level_greater2_flag_ctx: Context value of coeff_abs_level_greater2_flag ・coeff_sign_flag: Flag indicating whether the quantization coefficient is positive or negative. ・adjustments: Adjustment value that is the difference between the transform coefficient quantized by RDOQ processing and the transform coefficient after optimal quantization. Since the syntax element values and context values are converted into the same form as the transform coefficients in the form conversion unit 122B4, the inputs are each represented in the form of batch size×64×1.

第1に、transform_cofficient及びquantized_cofficientを結合し、全結合層によりバッチサイズ×64×チャネル数の形状に変形する。このような処理の際に、Relu(活性化関数)、Dropout、Layer Normalizationによる処理も施してもよい。 First, transform_cofficient and quantized_cofficient are combined, and a fully connected layer is used to transform the shape into batch size x 64 x number of channels. During this process, Relu (activation function), Dropout, and Layer Normalization may also be used.

第2に、last_sig_coeff_x及びlast_sig_coeff_yを結合し、全結合層によりバッチサイズ×64×チャネル数の形状に変形する。処理の際、Relu、Dropout、Layer Normalizationによる処理も施してもよい。また、coeff_abs_level_remainingについても、全結合層によりバッチサイズ×64×チャネル数の形状に変形する。処理の際、Relu、Dropout、Layer Normalizationによる処理も施してもよい。その他の入力については、エンベディングすることによりバッチサイズ×64×エンベディング次元数の形状に変形する。 Second, last_sig_coeff_x and last_sig_coeff_y are combined and transformed into a shape of batch size × 64 × number of channels using a fully connected layer. During processing, Relu, Dropout, and Layer Normalization may also be used. Coeff_abs_level_remaining is also transformed into a shape of batch size × 64 × number of channels using a fully connected layer. During processing, Relu, Dropout, and Layer Normalization may also be used. Other inputs are transformed into a shape of batch size × 64 × number of embedding dimensions by embedding.

第3に、全ての1段目の出力を結合し、全結合層によりバッチサイズ×64×チャネル数の形状に変形する。このような処理の際に、Relu、Dropout、Layer Normalizationによる処理も施してもよい。 Third, all first-stage outputs are combined and transformed into a shape equal to batch size x 64 x number of channels using a fully connected layer. During this process, Relu, Dropout, and Layer Normalization may also be used.

第4に、双方向LSTM及び全結合層へ入力することで、調整値を表す確率が出力される。調整値を表す確率が最大となるものを選択することで調整値を決定する。このような処理の際、Relu、Dropout、Layer Normalizationによる処理も施してもよい。双方向LSTMについては1層ではなく、2以上の層数としてもよい。調整値は1,0の2つの出力に限らず、3つ以上の複数の調整値を推定してもよい。 Fourth, by inputting data into the bidirectional LSTM and fully connected layer, a probability representing the adjustment value is output. The adjustment value is determined by selecting the value with the highest probability of representing the adjustment value. When performing this processing, Relu, Dropout, and Layer Normalization may also be used. The bidirectional LSTM may have two or more layers instead of one. The adjustment values are not limited to two outputs, 1 and 0, and three or more adjustment values may be estimated.

(モデル生成方法)
次に、本実施形態に係るモデル生成方法について説明する。本実施形態に係るモデル生成方法は、符号化のための学習済みモデルとして、上述のニューラルネットワークモデルを生成するための方法である。このモデル生成方法は、符号化装置1と異なるコンピュータにより実行されてもよいし、符号化装置1により実行されてもよい。以下において、モデル生成方法を実行する装置をモデル生成方法装置と呼ぶ。図9は、本実施形態に係るモデル生成方法を示す図である。
(Model generation method)
Next, a model generation method according to this embodiment will be described. The model generation method according to this embodiment is a method for generating the above-mentioned neural network model as a trained model for encoding. This model generation method may be executed by a computer different from the encoding device 1, or may be executed by the encoding device 1. Hereinafter, an apparatus that executes the model generation method will be referred to as a model generation method apparatus. FIG. 9 is a diagram showing the model generation method according to this embodiment.

図9に示すように、ステップS11において、モデル生成装置は、量子化前の変換係数、量子化後の当該変換係数、当該変換係数のシンタックス要素値、当該シンタックス要素値のコンテキスト値、全探索又は貪欲法を用いて導出された最適量子化後の当該変換係数を教師データとして取得する。 As shown in FIG. 9, in step S11, the model generation device acquires, as training data, the transform coefficients before quantization, the transform coefficients after quantization, syntax element values of the transform coefficients, context values of the syntax element values, and the transform coefficients after optimal quantization derived using a full search or greedy algorithm.

ステップS12において、モデル生成装置は、ステップS11で取得された教師データを用いた機械学習を行う。 In step S12, the model generation device performs machine learning using the training data acquired in step S11.

ステップS13において、モデル生成装置は、量子化前の変換係数、量子化後の当該変換係数、当該変換係数のシンタックス要素値、及び当該シンタックス要素値のコンテキスト値を入力とし、最適な量子化後の変換係数を導出するための調整値を出力とする学習済みモデルであるニューラルネットワークモデルを生成する。 In step S13, the model generation device generates a neural network model, which is a trained model, that receives as input the transform coefficients before quantization, the transform coefficients after quantization, the syntax element values of the transform coefficients, and the context values of the syntax element values, and outputs adjustment values for deriving optimal transform coefficients after quantization.

(その他の実施形態)
上述の実施形態において、符号化対象ブロックのサイズ(すなわち、2次元の変換係数のサイズ)が8×8である一例について説明したが、ブロックサイズは8×8に限らず、任意のサイズとしてもよい。また、ブロックの形状(すなわち、2次元の変換係数の形状)は非正方形の形状であってもよい。
(Other embodiments)
In the above embodiment, an example has been described in which the size of the block to be coded (i.e., the size of the two-dimensional transform coefficients) is 8 × 8, but the block size is not limited to 8 × 8 and may be any size. Furthermore, the shape of the block (i.e., the shape of the two-dimensional transform coefficients) may be non-square.

変換部121が用いる変換処理の種類の候補が複数存在する場合、変換処理の種類ごとに個別のニューラルネットワークモデルが生成されていてもよい。例えば、DCT-2に対応するニューラルネットワークモデルと、DST-7に対応するニューラルネットワークモデルとが生成されていてもよい。このような場合、調整値取得部122B6は、複数種類の変換処理に対応する複数のニューラルネットワークモデルのうち、変換部121により選択された種類の変換処理に対応するニューラルネットワークモデルを特定し、当該特定したニューラルネットワークモデルを用いて量子化調整値を取得(導出)してもよい。 If there are multiple candidate types of conversion processing used by the conversion unit 121, a separate neural network model may be generated for each type of conversion processing. For example, a neural network model corresponding to DCT-2 and a neural network model corresponding to DST-7 may be generated. In such a case, the adjustment value acquisition unit 122B6 may identify, from among multiple neural network models corresponding to multiple types of conversion processing, the neural network model corresponding to the type of conversion processing selected by the conversion unit 121, and acquire (derive) the quantization adjustment value using the identified neural network model.

変換部121が出力する2次元の変換係数は、予め定められた複数種類のブロックサイズの中から選択されたブロックサイズを有していてもよい。すなわち、ブロックサイズの候補が複数存在してもよい。ブロックサイズは、ブロック分割部100により選択されてもよい。このような場合、ブロックサイズごとに個別のニューラルネットワークモデルが生成されていてもよい。例えば、4×4のブロックサイズに対応するニューラルネットワークモデルと、8×8のブロックサイズに対応するニューラルネットワークモデルとが生成されていてもよい。このような場合、調整値取得部122B6は、複数種類のブロックサイズに対応する複数のニューラルネットワークモデルのうち、ブロック分割部100により選択されたブロックサイズに対応するニューラルネットワークモデルを特定し、当該特定したニューラルネットワークモデルを用いて量子化調整値を取得(導出)してもよい。 The two-dimensional transform coefficients output by the transform unit 121 may have a block size selected from a plurality of predetermined block sizes. That is, there may be a plurality of candidate block sizes. The block size may be selected by the block division unit 100. In such a case, a separate neural network model may be generated for each block size. For example, a neural network model corresponding to a 4x4 block size and a neural network model corresponding to an 8x8 block size may be generated. In such a case, the adjustment value acquisition unit 122B6 may identify, from among the plurality of neural network models corresponding to the plurality of block sizes, the neural network model corresponding to the block size selected by the block division unit 100, and acquire (derive) the quantization adjustment value using the identified neural network model.

符号化装置1が行う各処理をコンピュータに実行させるプログラムが提供されてもよい。モデル生成方法の各ステップをコンピュータに実行させるプログラムが提供されてもよい。プログラムは、コンピュータ読取り可能媒体に記録されていてもよい。コンピュータ読取り可能媒体を用いれば、コンピュータにプログラムをインストールすることが可能である。ここで、プログラムが記録されたコンピュータ読取り可能媒体は、非一過性の記録媒体であってもよい。非一過性の記録媒体は、特に限定されるものではないが、例えば、CD-ROMやDVD-ROM等の記録媒体であってもよい。また、符号化装置1が行う各処理を実行する回路を集積化し、符号化装置1を半導体集積回路(チップセット、SoC)により構成してもよい。 A program may be provided that causes a computer to execute each process performed by the encoding device 1. A program may be provided that causes a computer to execute each step of the model generation method. The program may be recorded on a computer-readable medium. Using a computer-readable medium, the program can be installed on a computer. Here, the computer-readable medium on which the program is recorded may be a non-transitory recording medium. The non-transitory recording medium is not particularly limited, and may be, for example, a recording medium such as a CD-ROM or DVD-ROM. Furthermore, the circuits that execute each process performed by the encoding device 1 may be integrated, and the encoding device 1 may be configured as a semiconductor integrated circuit (chip set, SoC).

以上、図面を参照して実施形態について詳しく説明したが、具体的な構成は上述のものに限られることはなく、要旨を逸脱しない範囲内において様々な設計変更等をすることが可能である。 The above describes the embodiments in detail with reference to the drawings, but the specific configuration is not limited to that described above, and various design changes can be made without departing from the spirit of the invention.

1 :符号化装置
100 :ブロック分割部
110 :減算部
120 :変換・量子化部
121 :変換部
122 :量子化部
122A :RDOQ処理部
122A1 :SQ処理部
122A2 :LE処理部
122A3 :AZ処理部
122A4 :LAST処理部
122A5 :SBH処理部
122B :最適化処理部
122B1 :シリアライズ部
122B2 :符号取得部
122B3 :符号除去部
122B4 :形状変換部
122B5 :シリアライズ部
122B6 :調整値取得部
122B7 :調整値適用部
122B8 :デシリアライズ部
130 :エントロピー符号化部
140 :逆変換部
141 :逆量子化部
142 :逆変換部
150 :合成部
160 :メモリ
170 :予測部
1: Encoding device 100: Block division unit 110: Subtraction unit 120: Transform/quantization unit 121: Transformation unit 122: Quantization unit 122A: RDOQ processing unit 122A1: SQ processing unit 122A2: LE processing unit 122A3: AZ processing unit 122A4: LAST processing unit 122A5: SBH processing unit 122B: Optimization processing unit 122B1: Serialization unit 122B2: Code acquisition unit 122B3: Code removal unit 122B4: Shape conversion unit 122B5: Serialization unit 122B6: Adjustment value acquisition unit 122B7: Adjustment value application unit 122B8: Deserialization unit 130: Entropy encoding unit 140: Inverse transformation unit 141: Inverse quantization unit 142: Inverse transformation unit 150: Combining unit 160 : Memory 170 : Prediction unit

Claims (7)

原画像と予測画像との差分を表す残差信号に対して変換処理を行って得られる変換係数に対して量子化を行う量子化部と、
前記変換係数のためのシンタックス要素値を当該シンタックス要素値のコンテキスト値を用いてエントロピー符号化するエントロピー符号化部と、を備える符号化装置であって、
前記量子化部は、量子化前の前記変換係数と、量子化後の前記変換係数と、前記シンタックス要素値及び前記コンテキスト値と、をニューラルネットワークモデルに入力して得られる出力に応じて当該量子化後の前記変換係数を調整することにより、最適量子化後の前記変換係数を出力することを特徴とする符号化装置。
a quantization unit that quantizes transform coefficients obtained by performing a transform process on a residual signal representing a difference between an original image and a predicted image;
an entropy coding unit that entropy codes syntax element values for the transform coefficients using context values of the syntax element values,
the quantization unit adjusts the quantized transform coefficients according to an output obtained by inputting the transform coefficients before quantization, the transform coefficients after quantization, the syntax element values, and the context values into a neural network model, thereby outputting the transform coefficients after optimal quantization.
前記量子化部は、
量子化前の前記変換係数及び量子化後の前記変換係数のいずれかの正負符号を取得する符号取得部と、
量子化前の前記変換係数及び量子化後の前記変換係数のそれぞれの正負符号を除去する符号除去部と、
前記正負符号が除去された量子化前の前記変換係数と、前記正負符号が除去された量子化後の前記変換係数と、前記シンタックス要素値及び前記コンテキスト値と、を前記ニューラルネットワークモデルに入力し、前記ニューラルネットワークモデルから出力される調整値を取得する調整値取得部と、
前記正負符号が除去された量子化後の前記変換係数に対して、前記調整値取得部が取得した前記調整値と、前記符号取得部が取得した正負符号とを適用することにより、前記最適量子化後の変換係数を出力する調整値適用部と、を備えることを特徴とする請求項1に記載の符号化装置。
The quantization unit
a sign acquisition unit that acquires a positive or negative sign of either the transform coefficient before quantization or the transform coefficient after quantization;
a sign removal unit that removes positive and negative signs from the transform coefficients before quantization and the transform coefficients after quantization;
an adjustment value acquisition unit that inputs the transform coefficients before quantization from which the positive and negative signs have been removed, the transform coefficients after quantization from which the positive and negative signs have been removed, the syntax element values, and the context values to the neural network model, and acquires adjustment values output from the neural network model;
2. The encoding device according to claim 1, further comprising: an adjustment value application unit that applies the adjustment value acquired by the adjustment value acquisition unit and the positive/negative sign acquired by the sign acquisition unit to the quantized transform coefficient from which the positive/negative sign has been removed, thereby outputting the optimally quantized transform coefficient.
前記変換係数は、m×n(m、n:1以上の整数)の変換係数からなる2次元の形状を有し、
前記量子化部は、前記シンタックス要素値及び前記コンテキスト値のそれぞれを前記変換係数と同一形状に変換する形状変換部をさらに備え、
前記調整値取得部は、前記形状変換部による変換後の前記シンタックス要素値及び前記コンテキスト値を前記ニューラルネットワークモデルに入力することを特徴とする請求項2に記載の符号化装置。
the transform coefficients have a two-dimensional shape made up of m×n transform coefficients (m and n are integers equal to or greater than 1);
the quantization unit further includes a shape conversion unit that converts each of the syntax element values and the context values into the same shape as the transform coefficients;
3. The encoding device according to claim 2, wherein the adjustment value acquisition unit inputs the syntax element values and the context values converted by the shape conversion unit to the neural network model.
前記エントロピー符号化部は、量子化後の2次元の前記変換係数をスキャン順に応じて1次元に変換したうえでエントロピー符号化を行っており、
前記量子化部は、量子化前の2次元の前記変換係数と、量子化後の2次元の前記変換係数と、2次元の前記シンタックス要素値と、2次元の前記コンテキスト値と、のそれぞれを前記スキャン順に応じて1次元に変換するシリアライズ部をさらに備え、
前記調整値取得部は、量子化前の1次元の前記変換係数と、量子化後の1次元の前記変換係数と、1次元の前記シンタックス要素値と、1次元の前記コンテキスト値と、を前記ニューラルネットワークモデルに入力することを特徴とする請求項3に記載の符号化装置。
the entropy coding unit converts the two-dimensional transform coefficients after quantization into one-dimensional transform coefficients according to a scan order and then performs entropy coding;
the quantization unit further includes a serialization unit that converts each of the two-dimensional transform coefficients before quantization, the two-dimensional transform coefficients after quantization, the two-dimensional syntax element values, and the two-dimensional context values into one-dimensional values according to the scan order;
4. The encoding device according to claim 3, wherein the adjustment value acquisition unit inputs the one-dimensional transform coefficients before quantization, the one-dimensional transform coefficients after quantization, the one-dimensional syntax element values, and the one-dimensional context values to the neural network model.
前記エントロピー符号化部は、予め定められた複数のスキャン順の中から選択されたスキャン順に応じて次元の量子化後変換係数を1次元に変換し、
前記調整値取得部は、前記複数のスキャン順に対応する複数のニューラルネットワークモデルのうち、前記選択されたスキャン順に対応するニューラルネットワークモデルを特定し、当該特定したニューラルネットワークモデルを用いて前記調整値を取得することを特徴とする請求項2乃至3のいずれか1項に記載の符号化装置。
the entropy coding unit converts two- dimensional quantized transform coefficients into one-dimensional ones in accordance with a scan order selected from a plurality of predetermined scan orders;
4. The encoding device according to claim 2, wherein the adjustment value acquisition unit identifies a neural network model corresponding to the selected scan order from among a plurality of neural network models corresponding to the plurality of scan orders, and acquires the adjustment value using the identified neural network model.
コンピュータを請求項1乃至5のいずれか1項に記載の符号化装置として機能させることを特徴とするプログラム。 A program that causes a computer to function as the encoding device described in any one of claims 1 to 5. 符号化のための学習済みニューラルネットワークモデルを生成するモデル生成方法であって、
量子化前の変換係数と、量子化後の当該変換係数と、当該変換係数のためのシンタックス要素値と、当該シンタックス要素値のコンテキスト値と、全探索又は貪欲法を用いて導出された最適量子化後の当該変換係数とを教師データとして取得するステップと、
前記教師データを用いた機械学習を行うステップと、
量子化前の変換係数と、量子化後の当該変換係数と、当該変換係数のためのシンタックス要素値と、当該シンタックス要素値のコンテキスト値とを入力とし、かつ、当該量子化後の当該変換係数を最適化するよう調整するための調整値を出力とするニューラルネットワークモデルを生成するステップと、を有する
モデル生成方法。
A model generation method for generating a trained neural network model for encoding, comprising:
A step of acquiring, as training data, transform coefficients before quantization, the transform coefficients after quantization, syntax element values for the transform coefficients, context values of the syntax element values, and the transform coefficients after optimal quantization derived using a full search or a greedy algorithm;
performing machine learning using the training data;
and generating a neural network model that receives as input transform coefficients before quantization, the transform coefficients after quantization, syntax element values for the transform coefficients, and context values for the syntax element values, and that outputs adjustment values for adjusting the transform coefficients after quantization to optimize them.
JP2022020537A 2022-02-14 2022-02-14 Encoding device, program, and model generation method Active JP7825447B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2022020537A JP7825447B2 (en) 2022-02-14 2022-02-14 Encoding device, program, and model generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2022020537A JP7825447B2 (en) 2022-02-14 2022-02-14 Encoding device, program, and model generation method

Publications (2)

Publication Number Publication Date
JP2023117786A JP2023117786A (en) 2023-08-24
JP7825447B2 true JP7825447B2 (en) 2026-03-06

Family

ID=87654253

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2022020537A Active JP7825447B2 (en) 2022-02-14 2022-02-14 Encoding device, program, and model generation method

Country Status (1)

Country Link
JP (1) JP7825447B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007110618A (en) 2005-10-17 2007-04-26 Nippon Hoso Kyokai <Nhk> Image improvement device
JP2010118729A (en) 2008-11-11 2010-05-27 Sony Corp Image decoding apparatus, image decoding method, and computer program
JP2020088740A (en) 2018-11-29 2020-06-04 ピクシブ株式会社 Image processing device, image processing method, and image processing program
WO2021211270A1 (en) 2020-04-17 2021-10-21 Qualcomm Incorporated Parallelized rate-distortion optimized quantization using deep learning

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007110618A (en) 2005-10-17 2007-04-26 Nippon Hoso Kyokai <Nhk> Image improvement device
JP2010118729A (en) 2008-11-11 2010-05-27 Sony Corp Image decoding apparatus, image decoding method, and computer program
JP2020088740A (en) 2018-11-29 2020-06-04 ピクシブ株式会社 Image processing device, image processing method, and image processing program
WO2021211270A1 (en) 2020-04-17 2021-10-21 Qualcomm Incorporated Parallelized rate-distortion optimized quantization using deep learning
JP2023522575A (en) 2020-04-17 2023-05-31 クゥアルコム・インコーポレイテッド Parallelized Rate-Distortion Optimal Quantization Using Deep Learning

Also Published As

Publication number Publication date
JP2023117786A (en) 2023-08-24

Similar Documents

Publication Publication Date Title
CN110024392B (en) Low-complexity symbol prediction for video coding
RU2543519C2 (en) Method and apparatus for image encoding and decoding using large transformation unit
CN108293113B (en) Modeling-based image decoding method and apparatus in image encoding system
CN103329522B (en) Method for encoding video using a dictionary
JP5957561B2 (en) Video encoding / decoding method and apparatus using large size transform unit
JP5733590B2 (en) A context modeling technique for encoding transform coefficient levels.
CN102396229B (en) Image encoding device, method, and image decoding device, method
CN104272735A (en) Transform Coefficient Coding for Context-Adaptive Binary Entropy Coding for Video
KR20100017453A (en) A method and an apparatus for processing a video signal
JP6476900B2 (en) Moving picture coding apparatus, moving picture coding method, and computer program for moving picture coding
CN101779463A (en) Method for processing images and the corresponding electronic device
GB2496201A (en) Context adaptive data encoding and decoding
CN112806017B (en) Method and apparatus for encoding transform coefficients
JP7825447B2 (en) Encoding device, program, and model generation method
JP7664750B2 (en) Encoding device, program, and model generation method
JP6402520B2 (en) Encoding apparatus, method, program, and apparatus
US8532413B2 (en) Entropy encoding/decoding method and apparatus for hierarchical image processing and symbol encoding/decoding apparatus for the same
RU2575868C2 (en) Method and apparatus for image encoding and decoding using large transformation unit
JP6846134B2 (en) Video coding device and video decoding device
WO2013068732A1 (en) Context adaptive data encoding

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20250117

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20251015

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20251021

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20251125

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20260127

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20260224

R150 Certificate of patent or registration of utility model

Ref document number: 7825447

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150