JP2007074337A - Coding device and method therefor - Google Patents

Coding device and method therefor Download PDF

Info

Publication number
JP2007074337A
JP2007074337A JP2005258789A JP2005258789A JP2007074337A JP 2007074337 A JP2007074337 A JP 2007074337A JP 2005258789 A JP2005258789 A JP 2005258789A JP 2005258789 A JP2005258789 A JP 2005258789A JP 2007074337 A JP2007074337 A JP 2007074337A
Authority
JP
Japan
Prior art keywords
quantization
quantization parameter
encoding
circuit
coding
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
JP2005258789A
Other languages
Japanese (ja)
Inventor
Toshihiro Tanaka
俊啓 田中
Hiroshi Saito
浩 齋藤
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2005258789A priority Critical patent/JP2007074337A/en
Publication of JP2007074337A publication Critical patent/JP2007074337A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To resolve the issue that coding amount estimation cannot be precisely performed because probability distributions of symbols are different by quantization parameters, when a generated code amount after arithmetic coding is acquired by temporary coding with a certain quantization parameter and then coding is performed with another set quantization parameter, with respect to coding amount control using arithmetic coding. <P>SOLUTION: This coding device includes a context selection circuit 131 and an adaptive quantization control circuit 130. When a proper quantization parameter input to a quantization circuit 120 for coding is obtained from a generated code amount outputted from an arithmetic coding circuit 140 by entering an arbitrary quantization parameter to the quantization circuit 120 for temporary coding, the circuit 131 selects contexts of arithmetic coding per quantization parameter in the case of temporary coding and selects the same context independently of quantization parameters in the coding, and the circuit 130 generates a quantization parameter having a value periodically changed, in the temporary coding and generates a proper quantization parameter in the coding. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、算術符号化を適用したエンコーダの符号量制御の精度を向上させ、高能率・高画質の符号化を行う符号化装置に関する。   The present invention relates to an encoding apparatus that improves the accuracy of code amount control of an encoder to which arithmetic encoding is applied, and performs encoding with high efficiency and high image quality.

算術符号化は、情報源シンボルの発生確率に応じて情報量を理論限界まで可逆圧縮できる技術である。画像符号化の分野では、JPEG2000規格(ISO/IEC15444)、H.264/MPEG4−AVC規格(非特許文献1参照)等に採用されている。H.264においては、コンテキスト適応算術符号化(CABAC:Context Adaptive Binary Arithmetic Coding)として、シンタックスの確率特性に応じた効率の高い符号化を実現している。   Arithmetic coding is a technique that can reversibly compress the amount of information to the theoretical limit in accordance with the occurrence probability of the information source symbol. In the field of image coding, the JPEG2000 standard (ISO / IEC15444), H.264, etc. H.264 / MPEG4-AVC standard (see Non-Patent Document 1) and the like. H. In H.264, high-efficiency coding according to the probability characteristics of the syntax is realized as context adaptive arithmetic coding (CABAC).

H.264におけるコンテキスト適応算術符号化について、図9を用いて説明する。図9は、算術符号化回路を説明する図である。図9において算術符号化回路140は、2値化回路510、コンテキスト計算回路520、2値算術符号化回路530から構成される。以下、この回路の動作について説明する。   H. The context adaptive arithmetic coding in H.264 will be described with reference to FIG. FIG. 9 is a diagram for explaining the arithmetic coding circuit. In FIG. 9, the arithmetic coding circuit 140 includes a binarization circuit 510, a context calculation circuit 520, and a binary arithmetic coding circuit 530. The operation of this circuit will be described below.

フラグ等の符号化情報や変換係数データといった多値入力データ501に対し、2値化回路510が2値化を行う。2値化は、制御情報502から入力データの種類であるシンタックスエレメント(syntax element)を判別し、データの確率特性によって、ユーナリー・バイナライゼーション(unary binarization)や固定長バイナライゼーション(fixed−length binarization)といった複数の方式を使い分ける。2値算術符号化回路530は2値化されたバイナリ列503を算術符号化し、バイナリ列509を出力する。   A binarization circuit 510 binarizes multi-value input data 501 such as encoding information such as flags and conversion coefficient data. In the binarization, a syntax element (syntax element) which is a type of input data is determined from the control information 502, and unary binarization or fixed-length binarization (fixed-length binarization) is performed according to the probability characteristics of the data. ). The binary arithmetic coding circuit 530 arithmetically codes the binarized binary string 503 and outputs a binary string 509.

コンテキスト計算回路520は、シンタックスエレメントを示す制御情報502に基づいて、バイナリ列503における現在の1ビットを符号化するために用いるコンテキストインデックス(ctxIdx)の値を、規格で定められた表1より求める。   Based on the control information 502 indicating the syntax element, the context calculation circuit 520 determines the value of the context index (ctxIdx) used for encoding the current 1 bit in the binary string 503 from Table 1 defined by the standard. Ask.

Figure 2007074337
Figure 2007074337

表1より、ctxIdxは0から459までの460個の値を取りうる。1個のシンタックスエレメントに対して、スライスタイプによりctxIdxの選択が異なる。また、例えばスライスタイプIにおけるmb_field_decoding_flagのctxIdxが70−72となっているように、ctxIdxの値が複数個存在するシンタックスエレメントに対しては、シンタックスエレメント毎に決められた規則(非特許文献1参照)によってctxIdxの値が複数個の中から一意に決定される。   From Table 1, ctxIdx can take 460 values from 0 to 459. For one syntax element, the selection of ctxIdx differs depending on the slice type. In addition, for a syntax element in which a plurality of ctxIdx values exist, for example, ctxIdx of mb_field_decoding_flag in slice type I is 70-72, a rule determined for each syntax element (non-patent literature) 1), the value of ctxIdx is uniquely determined from a plurality of values.

コンテキスト計算回路520は、460個のctxIdxの値毎に発生確率情報を初期化して記憶する。発生確率情報とは、バイナリシンボル0又は1のうち発生確率の高い方のシンボルを示すMPSと、発生確率pStateの組である。求められたctxIdxの値に対応した発生確率情報を、コンテキスト情報504と呼ぶことにする。   The context calculation circuit 520 initializes and stores occurrence probability information for each of 460 ctxIdx values. The occurrence probability information is a set of an MPS indicating a symbol having a higher occurrence probability of binary symbols 0 or 1 and an occurrence probability pState. The occurrence probability information corresponding to the obtained ctxIdx value will be referred to as context information 504.

コンテキスト計算回路520は、コンテキスト情報504を生成して2値算術符号化回路530に入力する。このように、算術符号化を行うシンタックスエレメントによって2値算術符号化回路530に入力されるシンボルの発生確率つまりコンテキスト情報504が適応的に切り替わることにより、バイナリシンボルの発生確率が動的に変わるバイナリ列503に対して、最適な算術符号化が可能となる。   The context calculation circuit 520 generates context information 504 and inputs it to the binary arithmetic encoding circuit 530. As described above, the occurrence probability of a binary symbol is dynamically changed by adaptively switching the occurrence probability of a symbol input to the binary arithmetic encoding circuit 530 by the syntax element for performing arithmetic encoding, that is, the context information 504. Optimal arithmetic coding can be performed on the binary string 503.

2値算術符号化回路530の動作について、図10を用いて説明する。図10において、シンボル0の発生確率が0.75(2進数で0.11)、シンボル1の発生確率が0.25の情報源から{0,0,0,1}のバイナリ列が入力された場合を考える。この場合、現在のコンテキスト情報504は、発生確率の高い方のシンボルを示すMPS=0、発生確率pState=0.11で表される。pStateは、正規化された整数値で表現されるが、ここでは簡単のため2進数の確率値とする。コンテキスト情報504は、今回の2値算術符号化により更新され、コンテキスト計算回路520に戻される。コンテキスト計算回路520では、対応するctxIdxの発生確率情報を更新する。この値は、次回に同じコンテキストの符号化が行われる時に再利用される。   The operation of the binary arithmetic coding circuit 530 will be described with reference to FIG. In FIG. 10, a binary string {0, 0, 0, 1} is input from an information source having a symbol 0 occurrence probability of 0.75 (binary 0.11) and a symbol 1 occurrence probability of 0.25. Consider the case. In this case, the current context information 504 is represented by MPS = 0 and occurrence probability pState = 0.11 indicating the symbol having the higher occurrence probability. pState is expressed as a normalized integer value, but here it is assumed to be a binary probability value for simplicity. The context information 504 is updated by the current binary arithmetic coding and returned to the context calculation circuit 520. The context calculation circuit 520 updates the occurrence probability information of the corresponding ctxIdx. This value is reused the next time the same context is encoded.

図10において、1個目の入力バイナリ値0が入力されると、[0,1]の区間が確率0.11で区切られる0側に区間が狭められ、[0,0.11]になる。2個目の入力0が入力されると、[0,0.11]の区間が[0,0.1001]に狭められる。ここで、0.1001=0.11*0.11である。同様にして、3個目の入力0により区間が[0,0.011011]になる。4個目の入力1は、1側の区間に狭められるため、最終的な区間が[0.01010001,0.011011]に狭められる。ここで、この最終的な区間に含まれる値のうち、最短の語長を持つものが符号語となる。0.011は、この区間に含まれるので、小数点以下の011が出力バイナリ列となり、4ビットの入力値が3ビットに圧縮されたことになる。実際には、出力するビット(0もしくは1)が確定した時点で確率値の左ビットシフトを行うリノーマライゼーション(renormalization)と呼ばれる処理が行われる。
ISO/IEC14496−10 Advanced video coding for generic audiovisual services
In FIG. 10, when the first input binary value 0 is input, the section of [0, 1] is narrowed to the 0 side divided by the probability of 0.11, and becomes [0, 0.11]. . When the second input 0 is input, the interval [0, 0.11] is narrowed to [0, 0.1001]. Here, 0.1001 = 0.11 * 0.11. Similarly, the section becomes [0, 0.011011] by the third input 0. Since the fourth input 1 is narrowed to a section on one side, the final section is narrowed to [0.01010001, 0.011011]. Here, among the values included in the final section, the one having the shortest word length is the code word. Since 0.011 is included in this section, 011 after the decimal point becomes the output binary string, and the 4-bit input value is compressed to 3 bits. Actually, a process called renormalization is performed to shift the probability value to the left when the output bit (0 or 1) is determined.
ISO / IEC 14496-10 Advanced video coding for generic audiovisual services

動画像符号化においては、特定のビットレートの条件下で画質を最大限に高めるため、各マクロブロックを符号化する際の量子化幅を決定するための量子化パラメータを適切に制御して、符号量制御を行う必要がある。そのためには、現在のマクロブロックまたはフレームに対してどの程度の量子化パラメータで符号化すればどの程度の符号量が得られるか、という符号量予測を行うことが必須であり、様々な方式が用いられている。   In moving picture coding, in order to maximize the image quality under a specific bit rate condition, appropriately control the quantization parameter for determining the quantization width when coding each macroblock, It is necessary to perform code amount control. For this purpose, it is essential to perform code amount prediction such as how much code amount can be obtained by encoding with the current macroblock or frame with various quantization parameters. It is used.

そのための基本的な方式として、マクロブロックやフレームといった単位で一度ある量子化パラメータで仮符号化を行って発生符号量を測定した後に、符号化するための最適な量子化パラメータを算出する方式がある。例えば、リアルタイムエンコーダにおいて、1フレームの遅延を行って、1フレームの仮符号化を行った後に符号化を行う場合がある。また、フレームより小さいスライスといった単位で仮符号化と符号化を繰り返すこともできる。リアルタイムエンコーダでない場合には、GOP(Group Of Pictures)やシーケンス全体といったより大きな単位で実施する2パスエンコードと呼ばれる符号化を行うことができる。   As a basic method for that purpose, there is a method for calculating an optimal quantization parameter for encoding after performing temporary encoding with a quantization parameter once in units such as a macroblock and a frame and measuring a generated code amount. is there. For example, in a real-time encoder, there is a case where encoding is performed after a delay of one frame and a provisional encoding of one frame. Also, provisional encoding and encoding can be repeated in units such as slices smaller than a frame. If it is not a real-time encoder, encoding called 2-pass encoding performed in larger units such as GOP (Group Of Pictures) or the entire sequence can be performed.

しかし、算術符号化を用いた場合の符号量制御において、ある量子化パラメータで仮符号化を行って算術符号化後の発生符号量を取得した後に、改めて設定した量子化パラメータで符号化を行う場合、量子化パラメータの変更によりシンボルの確率分布が仮符号化のときと異なってしまうので、符号量予測が精度よく行えないという課題があった。   However, in code amount control when arithmetic coding is used, provisional coding is performed with a certain quantization parameter to obtain a generated code amount after arithmetic coding, and then coding is performed with a newly set quantization parameter. In this case, since the probability distribution of the symbol differs from that in the temporary encoding due to the change of the quantization parameter, there is a problem that the code amount prediction cannot be performed with high accuracy.

本発明はこのような課題に鑑み、算術符号化を適用した符号化装置の符号量制御の精度を向上させることを目的とする。   In view of such a problem, an object of the present invention is to improve the accuracy of code amount control of an encoding device to which arithmetic encoding is applied.

上記課題を解決するために本発明の符号化装置は、信号を符号化するための符号化装置であって、入力された信号を直交変換して係数データを出力する直交変換回路と、係数データを量子化するための量子化回路と、量子化回路で量子化するための量子化パラメータを生成する量子化制御回路と、量子化回路で量子化されたデータに対して量子化パラメータに基づいて算術符号化を行う算術符号化回路とを有し、仮符号化時において、量子化制御回路は、量子化パラメータとして仮量子化パラメータを複数の代表量子化パラメータから選択することにより生成し、算術符号化回路は、仮量子化パラメータに基づいて係数データの発生確率を示す情報を含むコンテキスト情報を選択し、コンテキスト情報に基づいて算術符号化を行うと共に算術符号化したデータの発生符号量を算出し、符号化時において、量子化制御回路は、仮量子化パラメータ、発生符号量及び符号化時に与えるべき所定の符号量に基づいて量子化パラメータとしての最適量子化パラメータを生成し、算術符号化回路は、最適量子化パラメータ及び所定のコンテキスト情報に基づいて算術符号化を行う構成とした。   In order to solve the above-described problems, an encoding apparatus according to the present invention is an encoding apparatus for encoding a signal, an orthogonal transform circuit that orthogonally transforms an input signal and outputs coefficient data, and coefficient data A quantization circuit for quantizing the data, a quantization control circuit for generating a quantization parameter for quantization by the quantization circuit, and a data quantized by the quantization circuit based on the quantization parameter An arithmetic encoding circuit that performs arithmetic encoding, and at the time of provisional encoding, the quantization control circuit generates the arithmetic by selecting the provisional quantization parameter as a quantization parameter from a plurality of representative quantization parameters, The encoding circuit selects context information including information indicating the probability of occurrence of coefficient data based on the temporary quantization parameter, performs arithmetic encoding based on the context information, and performs arithmetic The generated code amount of the encoded data is calculated, and at the time of encoding, the quantization control circuit determines the optimum quantization parameter based on the temporary quantization parameter, the generated code amount and a predetermined code amount to be given at the time of encoding. The quantization parameter is generated, and the arithmetic coding circuit is configured to perform arithmetic coding based on the optimum quantization parameter and predetermined context information.

本発明によれば、様々な量子化パラメータに対する予測符号量の精度を高め、算術符号化を適用したリアルタイムエンコーダの符号量制御の精度を向上させることが可能となるので、高能率・高画質の符号化を行う符号化装置を実現することが可能となる。   According to the present invention, it is possible to improve the accuracy of the prediction code amount for various quantization parameters and improve the accuracy of the code amount control of a real-time encoder to which arithmetic coding is applied. An encoding apparatus that performs encoding can be realized.

以下、本発明の実施の形態について、図面を参照しながら説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

(実施の形態1)
本発明の実施の形態1による映像符号化装置の例を図1に示す。図1において、映像符号化装置100は、直交変換回路としてのDCT回路110、逆DCT回路111、量子化回路120、逆量子化回路121、適応量子化制御回路130、コンテキスト選択回路131、算術符号化回路140、イントラ予測回路150、インター予測回路160、動き予測回路161、デブロックフィルタ回路170から構成される。以上のように構成された映像符号化装置について、以下その動作を説明する。
(Embodiment 1)
An example of a video encoding apparatus according to Embodiment 1 of the present invention is shown in FIG. In FIG. 1, a video encoding apparatus 100 includes a DCT circuit 110 as an orthogonal transform circuit, an inverse DCT circuit 111, a quantization circuit 120, an inverse quantization circuit 121, an adaptive quantization control circuit 130, a context selection circuit 131, an arithmetic code. And the intra prediction circuit 150, the inter prediction circuit 160, the motion prediction circuit 161, and the deblock filter circuit 170. The operation of the video encoding apparatus configured as described above will be described below.

最初に、映像符号化の流れについて図1を用いて説明する。まず、フレーム内のデータのみで復号可能となるイントラマクロブロックの符号化について説明する。マクロブロックとは、通常16x16画素のブロックであり、後述するDCT変換やイントラ予測の単位となるブロックを複数個含む。入力されたディジタル映像信号101において符号化対象のマクロブロックの各画素値は、イントラ予測回路150において作成された符号化対象のマクロブロックの画素予測値と、画素毎の差分値が計算され、16x16画素の差分値のブロックが生成される。   First, the flow of video encoding will be described with reference to FIG. First, encoding of an intra macroblock that can be decoded only with data in a frame will be described. The macro block is a block of 16 × 16 pixels in general, and includes a plurality of blocks serving as units of DCT conversion and intra prediction described later. For each pixel value of the macroblock to be encoded in the input digital video signal 101, the pixel prediction value of the macroblock to be encoded created in the intra prediction circuit 150 and the difference value for each pixel are calculated, and 16 × 16 A block of pixel difference values is generated.

次に、差分値のブロックに対してDCT回路110にてDCT変換が行われる。この処理は、通常4x4画素や8x8画素のブロック単位に行われ、周波数成分の係数データが出力される。係数データは量子化回路120に入力されて量子化される。量子化された係数データは、算術符号化回路140により算術符号化される。さらに、量子化後の係数データは逆量子化回路121と逆DCT回路111にて復号され、前記マクロブロックの画素予測値との画素ごとの加算が行われ、16x16画素の復号画素に変換される。得られた復号画素は、イントラ予測回路150に入力される。イントラ予測回路150では、後に符号化される周辺のマクロブロックのための画素予測値が作成される。   Next, DCT conversion is performed on the difference value block by the DCT circuit 110. This processing is normally performed in units of blocks of 4 × 4 pixels or 8 × 8 pixels, and coefficient data of frequency components is output. The coefficient data is input to the quantization circuit 120 and quantized. The quantized coefficient data is arithmetically encoded by the arithmetic encoding circuit 140. Further, the quantized coefficient data is decoded by the inverse quantization circuit 121 and the inverse DCT circuit 111, and is added for each pixel with the predicted pixel value of the macroblock, and converted into a decoded pixel of 16 × 16 pixels. . The obtained decoded pixel is input to the intra prediction circuit 150. In the intra prediction circuit 150, pixel prediction values for peripheral macroblocks to be encoded later are created.

次に、フレーム間の予測を用いるインターマクロブロックの符号化について説明する。動き予測回路161では、現在符号化するブロック(動き補償の単位となるブロック)と参照フレームの画素とのマッチング処理を行い、誤差が最小となるようなベクトル値が算出される。動き予測の結果に基づいてインター予測回路160が出力した、符号化対象のマクロブロックの画素予測値と、映像信号101における符号化対象のマクロブロックの画素値との差分値が計算され、DCT回路110に入力される。この後の処理は、基本的にイントラマクロブロックの符号化と同様である。逆DCT回路111にて復号された係数は、前記マクロブロックの画素予測値との画素ごとの加算が行われる。得られた復号画素は、視覚的なブロック歪みの低減のためにデブロックフィルタ回路170経由でインター予測回路160に入力する場合が多い。   Next, encoding of an inter macroblock using inter-frame prediction will be described. The motion prediction circuit 161 performs a matching process between a block to be encoded (a block serving as a unit for motion compensation) and a pixel of a reference frame, and calculates a vector value that minimizes an error. A difference value between the pixel prediction value of the encoding target macroblock output from the inter prediction circuit 160 based on the motion prediction result and the pixel value of the encoding target macroblock in the video signal 101 is calculated, and the DCT circuit 110 is input. The subsequent processing is basically the same as the encoding of the intra macroblock. The coefficient decoded by the inverse DCT circuit 111 is added for each pixel with the predicted pixel value of the macroblock. In many cases, the obtained decoded pixels are input to the inter prediction circuit 160 via the deblock filter circuit 170 in order to reduce visual block distortion.

本発明は、符号量予測を行う「仮符号化」と、最終的な出力のための符号化を行う「符号化」の2種類のフェーズから構成される。この2種類のフェーズを図1の映像符号化装置で実現する方法を、図2を用いて説明する。図2において、量子化幅を制御するための量子化パラメータを与えることのできる最小単位の個数をNとし、N個の最小単位の集合を動作単位と呼ぶ。通常は最小単位をマクロブロックとする。Nは任意の自然数とすることができる。Nは例えば、1個のスライスを構成するマクロブロック数、1フレームを構成するマクロブロック数、Mフレーム(Mは2以上の自然数)を構成するマクロブロック数などに設定することができる。後述するが、本実施の形態では動作単位を1スライスとして説明する。すなわちNとしては、1スライスを構成するマクロブロックの個数を採用する。図2のように動作単位毎に、0番目からN−1番目のマクロブロックまでのN回の仮符号化を行った後、0番目からN−1番目のマクロブロックまでのN回の符号化を行う。以降、この動作を繰り返す。   The present invention includes two types of phases, “provisional encoding” for performing code amount prediction and “encoding” for performing encoding for final output. A method of realizing these two types of phases with the video encoding device of FIG. 1 will be described with reference to FIG. In FIG. 2, the minimum number of units that can provide a quantization parameter for controlling the quantization width is N, and a set of N minimum units is called an operation unit. Usually, the minimum unit is a macroblock. N can be any natural number. N can be set to, for example, the number of macroblocks constituting one slice, the number of macroblocks constituting one frame, the number of macroblocks constituting M frame (M is a natural number of 2 or more), and the like. As will be described later, in this embodiment, the operation unit is described as one slice. That is, as N, the number of macroblocks constituting one slice is employed. As shown in FIG. 2, after performing N times of temporary encoding from the 0th to the (N-1) th macroblock for each operation unit, N times of encoding from the 0th to the (N-1) th macroblock are performed. I do. Thereafter, this operation is repeated.

図2における仮符号化#n(0≦n≦N−1)の動作を、図3を用いて説明する。図3は、図1の映像符号化装置の主要部分を抜き出したものである。DCT回路110から出力された1マクロブロック分の係数データ180が量子化回路120に入力されると、適応量子化制御回路130が決定した仮量子化パラメータQP1(n)181を量子化回路120に入力する。仮量子化パラメータQP1(n)181の決定方法については後述する。量子化回路120は、与えられた仮量子化パラメータQP1(n)181で量子化を行う。量子化された係数データ184は、算術符号化回路140bに入力される。算術符号化回路140bは、コンテキスト選択回路131より仮量子化パラメータQP1(n)181の値と1対1に対応したコンテキスト選択情報183を受け取り、算術符号化を行い、バイナリ列191を出力する。Q種類(Qは自然数)の仮量子化パラメータQP1(n)181を用いる場合、コンテキスト選択情報183は、0からQ−1までの整数値とすることができる。1マクロブロックに対する算術符号化によって出力されたバイナリ列191の長さ(ビット数)を示す発生符号量R1(n)182は、適応量子化制御回路130に入力される。 The operation of provisional encoding #n (0 ≦ n ≦ N−1) in FIG. 2 will be described with reference to FIG. FIG. 3 shows the main part of the video encoding apparatus shown in FIG. When the coefficient data 180 for one macroblock output from the DCT circuit 110 is input to the quantization circuit 120, the temporary quantization parameter QP 1 (n) 181 determined by the adaptive quantization control circuit 130 is converted into the quantization circuit 120. To enter. A method for determining the temporary quantization parameter QP 1 (n) 181 will be described later. The quantization circuit 120 performs quantization using the given temporary quantization parameter QP 1 (n) 181. The quantized coefficient data 184 is input to the arithmetic coding circuit 140b. The arithmetic coding circuit 140b receives the context selection information 183 corresponding to the value of the temporary quantization parameter QP 1 (n) 181 one-to-one from the context selection circuit 131, performs arithmetic coding, and outputs a binary string 191. . When Q types (Q is a natural number) of temporary quantization parameters QP 1 (n) 181 are used, the context selection information 183 can be an integer value from 0 to Q-1. The generated code amount R 1 (n) 182 indicating the length (number of bits) of the binary sequence 191 output by arithmetic encoding for one macroblock is input to the adaptive quantization control circuit 130.

本発明による算術符号化回路140bを図15に示す。算術符号化回路140bは、図9の算術符号化回路140のコンテキスト計算回路520を、量子化パラメータ適応コンテキスト計算回路521で置き換えたものである。量子化パラメータ適応コンテキスト計算回路521は、460個のコンテキストインデックスctxIdx及びQ種類(Qは自然数)の量子化パラメータの組み合わせ毎に、合計で460×Q個の発生確率情報を記憶する。量子化パラメータ適応コンテキスト計算回路521は、制御情報502から計算したctxIdxと、コンテキスト選択情報183を受け取り、記憶している460×Q個の発生確率情報の中から、ctxIdx及びコンテキスト選択情報の値に対応したコンテキスト情報504を出力する。   An arithmetic coding circuit 140b according to the present invention is shown in FIG. The arithmetic encoding circuit 140b is obtained by replacing the context calculation circuit 520 of the arithmetic encoding circuit 140 of FIG. 9 with a quantization parameter adaptive context calculation circuit 521. The quantization parameter adaptive context calculation circuit 521 stores a total of 460 × Q occurrence probability information for each combination of 460 context indexes ctxIdx and Q types (Q is a natural number) of quantization parameters. The quantization parameter adaptive context calculation circuit 521 receives the ctxIdx calculated from the control information 502 and the context selection information 183, and sets the values of ctxIdx and the context selection information from the stored 460 × Q occurrence probability information. Corresponding context information 504 is output.

以上のように出力されたコンテキスト情報504は、算術符号化回路140bに多値入力データ501として入力された係数データ184を符号化する際に、2値算術符号化回路530において参照される。つまり、係数データ184の算術符号化において、量子化パラメータにより異なる発生確率情報を参照していることになる。   The context information 504 output as described above is referred to in the binary arithmetic encoding circuit 530 when the coefficient data 184 input as the multi-value input data 501 is encoded in the arithmetic encoding circuit 140b. That is, in the arithmetic encoding of the coefficient data 184, different occurrence probability information is referred to depending on the quantization parameter.

次に、図2における符号化#n(0≦n≦N−1)の動作を、図4を用いて説明する。図4は、図1の映像符号化装置の主要部分を抜き出したものである。仮符号化後の発生符号量R1(n)182を入力された適応量子化制御回路130は、仮量子化パラメータQP1(n)181、発生符号量R1(n)182と、N個のマクロブロックに与えるべき符号量Tに基づいて、最適量子化パラメータQP2(n)185を算出して量子化回路120に入力する。QP2(n)185は、制御の状況などにより量子化回路120に入力される前に値を修正される場合もある。量子化回路120は、与えられた最適な量子化パラメータQP2(n)185で量子化を行う。量子化された係数データ187は算術符号化回路140bに入力される。符号化#nにおいて、コンテキスト選択回路131は動作しない。仮符号化とは異なり、算術符号化回路140bに入力されるコンテキスト選択情報183は常に固定であり、算術符号化回路140bは算術符号化回路140と同じ動作をする。算術符号化における発生符号量R2(n)186の値は、現在までの累積発生符号量として、最適量子化パラメータQP2(n)の値の修正に用いるため、適応量子化制御回路130に入力される。 Next, the operation of encoding #n (0 ≦ n ≦ N−1) in FIG. 2 will be described with reference to FIG. FIG. 4 shows the main part of the video encoding apparatus shown in FIG. The adaptive quantization control circuit 130 to which the generated code amount R 1 (n) 182 after provisional encoding is input has the provisional quantization parameter QP 1 (n) 181, the generated code amount R 1 (n) 182, N pieces The optimum quantization parameter QP 2 (n) 185 is calculated based on the code amount T to be given to the macroblock and input to the quantization circuit 120. The value of QP 2 (n) 185 may be corrected before being input to the quantization circuit 120 depending on the control situation or the like. The quantization circuit 120 performs quantization with the given optimum quantization parameter QP 2 (n) 185. The quantized coefficient data 187 is input to the arithmetic coding circuit 140b. In encoding #n, the context selection circuit 131 does not operate. Unlike temporary encoding, the context selection information 183 input to the arithmetic encoding circuit 140b is always fixed, and the arithmetic encoding circuit 140b performs the same operation as the arithmetic encoding circuit 140. The value of the generated code amount R 2 (n) 186 in arithmetic coding is used as the accumulated generated code amount up to the present time to correct the value of the optimal quantization parameter QP 2 (n). Entered.

図3の仮符号化の具体例を、図5のような1920x1080画素の1フレームの符号化においてスライス単位に最適な量子化パラメータを算出する例を用いて説明する。1920x1080画素のフレームは、16x16画素のマクロブロックが120x68=8160個で構成される。フレームを分割するスライスは、任意の連続したマクロブロックの集合として定義できるが、例えば1個のスライスが2040個のマクロブロックを含み、1フレームが4個のスライスで構成される場合を考える。この場合、N=2040と設定できる。   A specific example of provisional encoding in FIG. 3 will be described using an example in which an optimum quantization parameter is calculated for each slice in encoding of one frame of 1920 × 1080 pixels as shown in FIG. A frame of 1920 × 1080 pixels is composed of 120 × 68 = 8160 macroblocks of 16 × 16 pixels. A slice that divides a frame can be defined as a set of arbitrary continuous macroblocks. For example, a case where one slice includes 2040 macroblocks and one frame includes four slices is considered. In this case, N = 2040 can be set.

まず、仮量子化パラメータQP1(n)を決定する。仮量子化パラメータは、マクロブロック毎に複数の候補の中からひとつを選択して設定される。すなわち1個のマクロブロックに対する仮量子化パラメータQP1(n)は、任意の異なるQ種類の代表量子化パラメータqp1(x)(x=0,1,…,Q−1)から1個を選んで、当該マクロブロックの仮量子化パラメータQP1(n)に設定することで決定できる。例えば、0と20の2種類の代表量子化パラメータqp1(x)={0,20}を与える場合を考える。ここで、F(x)={A0,A1,…,AQ-1}(Aは整数)の表記は、F(0)=A0、F(1)=A1、…F(Q−1)=AQ-1を意味するものとする。各マクロブロックの仮量子化パラメータは、これら2種類のうちのいずれかを選択することになる。また、2種類の代表量子化パラメータの選択頻度は等しくなるようにする。この場合、半分のマクロブロックに量子化パラメータ0を、残り半分のマクロブロックに量子化パラメータ20を与える。また、仮量子化パラメータがスライス内で偏るのを防ぐため、スライス内に交互又はランダムに仮量子化パラメータを配置する。図5の例のように、プログレッシブにおいては通常のラスタスキャン順に交互に、インターレースではマクロブロックの対毎に交互に仮量子化パラメータを与えることができる。 First, the temporary quantization parameter QP 1 (n) is determined. The temporary quantization parameter is set by selecting one of a plurality of candidates for each macroblock. That is, the provisional quantization parameter QP 1 (n) for one macroblock is obtained by changing one of arbitrary different Q kinds of representative quantization parameters qp 1 (x) (x = 0, 1,..., Q−1). This can be determined by selecting and setting the provisional quantization parameter QP 1 (n) of the macroblock. For example, consider a case where two types of representative quantization parameters qp 1 (x) = {0, 20}, 0 and 20, are given. Here, the notation of F (x) = {A 0 , A 1 ,..., A Q-1 } (A n is an integer) is F (0) = A 0 , F (1) = A 1 ,. (Q-1) = A It shall mean Q-1 . One of these two types is selected as the provisional quantization parameter for each macroblock. Also, the selection frequencies of the two types of representative quantization parameters are made equal. In this case, the quantization parameter 0 is given to half the macroblocks, and the quantization parameter 20 is given to the other half macroblocks. Further, in order to prevent the temporary quantization parameter from being biased in the slice, the temporary quantization parameter is arranged alternately or randomly in the slice. As in the example of FIG. 5, provisional quantization parameters can be given alternately in the order of normal raster scan in progressive mode, and alternately in pairs of macroblocks in interlace.

仮符号化における代表量子化パラメータqp1(x)の種類Qと、値qp1(x)(x=0,1,…,Q−1)の決定方法について、図6を用いて説明する。適応量子化制御回路130が仮符号化のために用いる代表量子化パラメータの種類Qは、2040の約数、又はインターレースの符号化を行うためマクロブロックを対にする場合は1020の約数とすることができる。このように代表量子化パラメータの種類Qを設定すれば、スライス内で任意の代表量子化パラメータが出現する回数を一定にできる。例えばプログレッシブの場合、Qとしては2040の約数である5、10、20が選択できる。これらの場合、1個のスライス内における各代表量子化パラメータの出現回数はそれぞれ408回、204回、102回となる。 A method for determining the type Q of the representative quantization parameter qp 1 (x) and the value qp 1 (x) (x = 0, 1,..., Q−1) in provisional encoding will be described with reference to FIG. The representative quantization parameter type Q used by the adaptive quantization control circuit 130 for provisional encoding is a divisor of 2040, or a divisor of 1020 when pairing macroblocks for interlace encoding. be able to. By setting the representative quantization parameter type Q in this way, the number of times that an arbitrary representative quantization parameter appears in a slice can be made constant. For example, in the case of progressive, 5, 10, 20 which is a divisor of 2040 can be selected as Q. In these cases, the number of appearances of each representative quantization parameter in one slice is 408 times, 204 times, and 102 times, respectively.

代表量子化パラメータqp1(x)としては、エンコーダで選択できる量子化パラメータの範囲から異なる値をQ個選択するが、最適な符号化のための符号量予測が行い易くなるように、値を適度に分散させるのが好ましい。例えば、エンコーダで選択できる量子化パラメータQPが0から51の範囲である場合、一例として、Q=10、qp1(x)={0,4,8,12,16,22,28,34,42,51}を選択することができる。また、前もってフレームの符号化難易度や目標符号量の情報から、符号化時の量子化パラメータQP2(n)を任意の範囲に制限できる場合には、制限された範囲内でより細かい間隔で代表量子化パラメータqp1(x)を選択することが可能である。例えば、量子化パラメータQP2(n)として0から31までしか用いないことを決定している場合は、一例として、Q=10、qp1(x)={0,3,6,9,12,15,19,23,27,31}を選択することができる。 Representative quantization parameter qp 1 (x), so that a different value from a range of quantization parameters that can be selected by the encoder will be Q pieces selected, facilitated the code amount prediction for the optimum coding, the value It is preferable to disperse appropriately. For example, when the quantization parameter QP that can be selected by the encoder is in the range of 0 to 51, as an example, Q = 10, qp 1 (x) = {0, 4, 8, 12, 16, 22, 28, 34, 42, 51} can be selected. In addition, when the quantization parameter QP 2 (n) at the time of encoding can be limited to an arbitrary range from information on the encoding difficulty level of the frame and the target code amount in advance, at a finer interval within the limited range. It is possible to select the representative quantization parameter qp 1 (x). For example, when it is determined that only 0 to 31 are used as the quantization parameter QP 2 (n), as an example, Q = 10, qp 1 (x) = {0, 3, 6, 9, 12 , 15, 19, 23, 27, 31} can be selected.

仮量子化パラメータQP1(n)(n=0,1,…,N−1)をqp1(x)(x=0,1,…,Q−1)の中から選択する方法を説明する。この選択方法は、スライス内で代表量子化パラメータが分散して配置されるように設定された、nの値からxの値への写像の式で実現することができる。写像の式の好ましい例として、プログレッシブの場合は数式1を、インターレースの場合は数式2を用いることができる。
x=((n%mb_width)+d(n))%Q (数式1)
x=(((n/2)%mb_width)+d(n))%Q (数式2)
但し、演算A%Bは、整数Aを整数Bで割った剰余を与える演算である。また、nは現在符号化しているマクロブロック番号である。nは、スライス単位またはフレーム単位で0にリセットする。演算A/Bは、整数Aを整数Bで割った商を与える演算である。mb_widthは水平方向のマクロブロック数であり、図5の例では120である。d(n)は垂直方向の分散配置を行うための変数で、例えばプログレッシブの場合は数式3で、インターレースの場合は数式4で定義できる。
d(n)=((n/mb_width)*a)%Q (数式3)
d(n)=(((n/2)/mb_width)*a)%Q (数式4)
但し、aはQと互いに素になる整数である。このd(n)により、mb_width%Q=0となるQを選択している場合、代表量子化パラメータの並びが1ライン進む毎に(Q−a)個だけ右にシフトされる。図6の例ではa=7であり、1ライン進む毎に水平方向にQ−a=10−7=3マクロブロックずつQP1(n)の値がずれているのが確認できる。
A method of selecting the temporary quantization parameter QP 1 (n) (n = 0, 1,..., N−1) from qp 1 (x) (x = 0, 1,..., Q−1) will be described. . This selection method can be realized by a formula of mapping from the value of n to the value of x set so that representative quantization parameters are distributed and arranged in the slice. As a preferable example of the mapping formula, Formula 1 can be used for progressive, and Formula 2 can be used for interlace.
x = ((n% mb_width) + d (n))% Q (Formula 1)
x = ((((n / 2)% mb_width) + d (n))% Q (Formula 2)
However, the operation A% B is an operation that gives a remainder obtained by dividing the integer A by the integer B. N is a macroblock number currently encoded. n is reset to 0 in slice units or frame units. The operation A / B is an operation that gives a quotient obtained by dividing the integer A by the integer B. mb_width is the number of macroblocks in the horizontal direction, and is 120 in the example of FIG. d (n) is a variable for performing the vertical dispersive arrangement, and can be defined by, for example, Expression 3 for progressive and Expression 4 for interlace.
d (n) = ((n / mb_width) * a)% Q (Formula 3)
d (n) = (((n / 2) / mb_width) * a)% Q (Formula 4)
However, a is an integer which is relatively prime to Q. When Q that satisfies mb_width% Q = 0 is selected by d (n), the sequence of representative quantization parameters is shifted to the right by (Q−a) each time one line advances. In the example of FIG. 6, a = 7, and it can be confirmed that the value of QP 1 (n) is shifted by Qa = 10 −7 = 3 macroblocks in the horizontal direction every time one line is advanced.

図4の符号化における最適量子化パラメータQP2(n)の算出方法を、図7の具体例を用いて説明する。まず、2040個のマクロブロックを含むスライス1個を、仮量子化パラメータを使用して仮符号化する。次に、同じ代表量子化パラメータqp1(x)を使用して仮符号化されたマクロブロック毎に発生符号量R1(n)の総和を取り、スライス予測符号量r1(x)とする。qp1(x)={0,4,8,12,16,22,28,34,42,51}(x=0,1,…,9)の各々に対し、発生符号量R1(n)(n=0,1,…,N−1)を代表量子化パラメータ毎に総和を取った結果であるスライス予測符号量r1(x)がr1(x)={171248,120058,79390,56516,40760,24026,14864,7966,4742,2572}であるとする。ここで、例えばr1(0)=171248は以下のマクロブロックに対する符号量を加算することで求めることができる。mb_width=1920画素/16画素=120、a=7として、数式1及び数式3は、x=((n%120)+d(n))%10、d(n)=((n/120)*7)%10となる。よって、代表量子化パラメータqp1(0)=0を使用して仮符号化したマクロブロック、すなわちn=0,10,20,…,110,123,133,…,233,246,256,…,356,…,1928,1938,…,2038のマクロブロックに対する発生符号量R1(n)を合計した結果が、171248であったと仮定していることになる。また、ビットレート、フレームレート、フレームの複雑度、スライスの符号化タイプなどの情報を用いて割り当てたスライスの目標符号量T=300000ビットを仮定する。 A method of calculating the optimum quantization parameter QP 2 (n) in the encoding of FIG. 4 will be described using a specific example of FIG. First, one slice including 2040 macroblocks is provisionally encoded using provisional quantization parameters. Next, the sum of the generated code amount R 1 (n) is calculated for each macroblock temporarily encoded using the same representative quantization parameter qp 1 (x) to obtain a slice prediction code amount r 1 (x). . qp 1 (x) = {0, 4, 8, 12, 16, 22, 28, 34, 42, 51} (x = 0, 1,..., 9), the generated code amount R 1 (n ) (n = 0,1, ..., n-1) is the result of taking the sum for each representative quantization parameter slice prediction code amount r 1 (x) is r 1 (x) = {171248,120058,79390 , 56516, 40760, 24026, 14864, 7966, 4742, 2572}. Here, for example, r 1 (0) = 171248 can be obtained by adding code amounts for the following macroblocks. Assuming that mb_width = 1920 pixels / 16 pixels = 120 and a = 7, Equation 1 and Equation 3 are expressed as x = ((n% 120) + d (n))% 10, d (n) = ((n / 120) * 7)% 10. Therefore, a macroblock temporarily encoded using the representative quantization parameter qp 1 (0) = 0, that is, n = 0, 10, 20,..., 110, 123, 133,..., 233, 246, 256,. , 356,..., 1928, 1938,..., 2038 is assumed to be 171248 as a result of summing the generated code amounts R 1 (n) for the macroblocks. Further, it is assumed that the target code amount T = 300,000 bits of the slice allocated using information such as the bit rate, the frame rate, the frame complexity, and the coding type of the slice.

最初に、qp1(x)とr1(x)から、量子化パラメータQPとスライス予測符号量の関係を図7のように座標軸にプロットすることができる。r1(x)は、各x=QPに対して204個ずつのマクロブロックの発生符号量の総和になっているから、各QPに対するスライス予測符号量は、r1(x)を10倍することで求められる。また、QP値をプロットした後にQP値を線形補間して全てのQP値(0≦QP≦51)に対するスライス予測符号量のグラフを作成することができる。 First, from qp 1 (x) and r 1 (x), the relationship between the quantization parameter QP and the slice prediction code amount can be plotted on the coordinate axes as shown in FIG. Since r 1 (x) is the sum of generated code amounts of 204 macroblocks for each x = QP, the slice prediction code amount for each QP is 10 times r 1 (x). Is required. In addition, after plotting the QP value, the QP value can be linearly interpolated to create a graph of the slice prediction code amount for all the QP values (0 ≦ QP ≦ 51).

スライスの目標符号量T=300000とこのグラフの交点を求めることで、目標符号量を発生するのに最適な量子化パラメータQP2(n)=QPopt(0≦n≦2039)を求めることができる。QPoptの算出は、線形補間により、数式5で求められる。
QPopt=q+(QP1(q+1)−QP1(q))*(Q*r1(q)−T)/(Q*r1(q)−Q*r1(q+1)) (数式5)
但し、qは0≦q≦Q−1の整数であり、Q*r1(q+1)≦T≦Q*r1(q)を満たす値とする。ここでは、1スライスを通じてひとつの最適量子化パラメータを使用することとしている。また、すべてのqに対しT>Q*r1(q)となる場合はq=0、すべてのqに対しT<Q*r1(q)となる場合はq=Q−1とする。このため、あらかじめ仮量子化パラメータとしてQP1(0)=min(QP)=0、QP1(Q−1)=max(QP)=51としておくのが望ましい。
By obtaining the target code amount T = 300,000 of the slice and the intersection of this graph, the optimum quantization parameter QP 2 (n) = QP opt (0 ≦ n ≦ 2039) for generating the target code amount can be obtained. it can. The calculation of QP opt is obtained by Equation 5 by linear interpolation.
QP opt = q + (QP 1 (q + 1) −QP 1 (q)) * (Q * r 1 (q) −T) / (Q * r 1 (q) −Q * r 1 (q + 1)) (Formula 5 )
However, q is an integer of 0 ≦ q ≦ Q−1 and is a value satisfying Q * r 1 (q + 1) ≦ T ≦ Q * r 1 (q). Here, one optimal quantization parameter is used throughout one slice. Also, q = 0 when T> Q * r 1 (q) for all q, and q = Q−1 when T <Q * r 1 (q) for all q. For this reason, it is desirable to set QP 1 (0) = min (QP) = 0 and QP 1 (Q−1) = max (QP) = 51 in advance as temporary quantization parameters.

数式5を用いて、QPoptは、QPopt=16+(22−16)*(407600−300000)/(407600−240260)≒19.9となる。量子化パラメータは整数であるので、20を最適量子化パラメータQP2(n)とする。なお、小数点以下の値によっては小さい側の値19を選択する場合もある。 Using Equation 5, QP opt is QP opt = 16 + (22−16) * (407600−300000) / (407600−240260) ≈19.9. Since the quantization parameter is an integer, 20 is set as the optimum quantization parameter QP 2 (n). Depending on the value after the decimal point, the smaller value 19 may be selected.

本発明により符号量予測精度が向上する理由について説明する。仮符号化では、マクロブロック単位等の短い周期で仮量子化パラメータを変化させることで精度の高い符号量予測を行うことが可能となる。しかし従来の算術符号化回路140を仮符号化に用いた場合には、以下の問題がある。DCT変換による係数データのシンボルの確率分布は、量子化パラメータにより大きく異なる。これは例えば、大きな量子化パラメータで量子化した場合に係数データにゼロが出現する確率が高くなるが、小さな量子化パラメータではゼロが出現しにくくなることからわかる。よって、仮符号化においてN個のマクロブロックをQ種類の量子化パラメータで符号化する場合、様々な確率分布の量子化パラメータに対して状態遷移を行って得た発生符号量は、画像符号化として望ましい1種類の量子化パラメータで常に符号化し続けた場合と比較して誤差が大きくなる傾向がある。なぜなら、1種類の量子化パラメータの場合はある特定の確率をもって状態遷移し続けるからである。この結果、仮符号化と符号化の間で状態遷移の乖離が大きくなってしまう。これに対し本発明の算術符号化回路140bでは、係数データに相当するシンタックスに対してQ種類の代表量子化パラメータqp1(x)(x=0,1,…,Q−1)毎に状態値を保持して更新することにより、仮符号化における算術符号化の状態遷移が1種類の量子化パラメータで常に符号化した場合に近づき、結果として符号量予測精度を向上させることができる。また、符号化時には量子化パラメータによらず同じコンテキスト情報504を使用することで、通常のCABACによる符号化を行うため、符号化規格に合致したストリームを出力することができる。 The reason why the code amount prediction accuracy is improved by the present invention will be described. In provisional encoding, it is possible to perform highly accurate code amount prediction by changing the provisional quantization parameter in a short cycle such as a macroblock unit. However, when the conventional arithmetic encoding circuit 140 is used for provisional encoding, there are the following problems. The probability distribution of the symbol of the coefficient data by DCT transform varies greatly depending on the quantization parameter. This can be seen from the fact that, when quantized with a large quantization parameter, the probability that zero appears in the coefficient data is high, but it is difficult for zero to appear with a small quantization parameter. Therefore, when N macroblocks are encoded with Q types of quantization parameters in provisional encoding, the amount of generated codes obtained by performing state transitions on quantization parameters of various probability distributions is image encoding. As a result, the error tends to increase compared to the case where encoding is always continued with one kind of desired quantization parameter. This is because in the case of one kind of quantization parameter, state transition continues with a certain probability. As a result, the difference in state transition between the temporary encoding and the encoding becomes large. On the other hand, in the arithmetic coding circuit 140b of the present invention, for each of Q kinds of representative quantization parameters qp 1 (x) (x = 0, 1 ,. By holding and updating the state value, it is possible to approach the state transition of arithmetic encoding in temporary encoding that is always encoded with one kind of quantization parameter, and as a result, code amount prediction accuracy can be improved. In addition, since the same context information 504 is used regardless of the quantization parameter at the time of encoding, encoding by normal CABAC is performed, so that a stream conforming to the encoding standard can be output.

本実施の形態では、最適量子化パラメータQP2(n)として固定のQPoptを与える例を示したが、例えばQPoptをN個のマクロブロックの符号化に対する初期値として用い、それ以降の量子化パラメータはフィードバック制御による符号量制御を行い、最適量子化パラメータQP2(n)を動的に変更することが可能である。フィードバック制御は、あるマクロブロック番号mにおいて、符号化時の発生符号量R2(n)を0≦n≦mの範囲で加算した累積発生符号量Bと、ある時点(例えばマクロブロック番号N−1)までの目標符号量Tとの差分である残存符号量T−Bを、残存しているマクロブロックn(m<n≦N−1)の目標符号量Sに設定することで行うことができる。また、マクロブロックの輝度値や色差値、周波数領域での特徴等に基づいて量子化パラメータQP2(n)を動的に変更する処理も可能である。 In the present embodiment, an example in which a fixed QP opt is given as the optimum quantization parameter QP 2 (n) has been shown. For example, QP opt is used as an initial value for encoding N macroblocks, and the subsequent quantum The quantization parameter is subjected to code amount control by feedback control, and the optimal quantization parameter QP 2 (n) can be dynamically changed. In the feedback control, in a certain macroblock number m, the generated code amount R 2 (n) at the time of encoding is added within a range of 0 ≦ n ≦ m, and at a certain time (for example, the macroblock number N− The remaining code amount TB, which is the difference from the target code amount T until 1), is set to the target code amount S of the remaining macroblock n (m <n ≦ N−1). it can. In addition, it is possible to dynamically change the quantization parameter QP 2 (n) based on the luminance value and color difference value of the macroblock, the characteristics in the frequency domain, and the like.

本実施の形態では、Nをスライス単位として説明したが、より小さい単位で仮符号化と符号化を行うことで発生符号量R2(n)を得て、その結果を仮量子化パラメータの選択に反映するような場合や、フィードバック制御を小さい単位で行う場合には、数マクロブロック等の小さい単位で実施しても効果的である。Nを固定として説明したが、Nをフレーム単位又はその他の単位で動的に変更することも可能である。また、スライス予測符号量のグラフを線形補間して求める例を示したが、スプライン補間等、高度な数値補間も可能である。 In the present embodiment, N is described as a slice unit. However, the generated encoding amount R 2 (n) is obtained by performing temporary encoding and encoding in smaller units, and the result is selected as a temporary quantization parameter. In the case where it is reflected in the above, or when the feedback control is performed in a small unit, it is effective to implement it in a small unit such as several macroblocks. Although N is described as being fixed, it is also possible to dynamically change N in frame units or other units. Moreover, although the example which calculates | requires by performing the linear interpolation of the graph of a slice prediction code amount was shown, advanced numerical interpolations, such as spline interpolation, are also possible.

本実施の形態では仮符号化を1回のみ行う例を示したが、リアルタイムの符号化が必要でない場合や、仮符号化をパイプライン化又は並列化することにより一定の遅延で多くの処理が行える場合には、仮符号化を何回行っても良い。   In this embodiment, an example in which provisional encoding is performed only once has been shown. However, when real-time encoding is not necessary, or when provisional encoding is pipelined or parallelized, many processes can be performed with a certain delay. If possible, the provisional encoding may be performed any number of times.

本実施の形態では、映像符号化のH.264規格におけるコンテキスト適応算術符号化を例にとって説明したが、量子化された係数データに対して算術符号化を適用でき、量子化パラメータを適応的に変更できる符号化装置又は符号化方法であれば、これに限定されるものではない。   In the present embodiment, H.264 for video coding is used. The context adaptive arithmetic coding in the H.264 standard has been described as an example, but any coding apparatus or coding method that can apply arithmetic coding to quantized coefficient data and adaptively change the quantization parameter can be used. However, the present invention is not limited to this.

本実施の形態を用いて符号化したビットストリームは、テープ、光ディスク、磁気ディスク、半導体メモリといった記録媒体に記録して、高能率・高画質の映像を再配布可能な形式にすることができる。   The bit stream encoded using the present embodiment can be recorded on a recording medium such as a tape, an optical disk, a magnetic disk, or a semiconductor memory, so that a high-efficiency and high-quality video can be redistributed.

(実施の形態2)
本実施の形態は、実施の形態1に対して、仮符号化と符号化を行う回路を独立とした構成を示すものである。
(Embodiment 2)
This embodiment shows a configuration in which a circuit that performs provisional encoding and encoding is independent of the first embodiment.

図8に、本実施の形態における映像符号化装置の構成を示す。映像符号化装置600は、仮符号化回路610、符号化回路620、適応量子化制御回路630、FIFOバッファ640から構成される。仮符号化回路610および符号化回路620は、それぞれが実施の形態1で説明した映像符号化装置100と同等の構成を持つものとする。このように構成された映像符号化装置600について、以下動作を説明する。   FIG. 8 shows the configuration of the video encoding apparatus according to the present embodiment. The video encoding device 600 includes a temporary encoding circuit 610, an encoding circuit 620, an adaptive quantization control circuit 630, and a FIFO buffer 640. The temporary encoding circuit 610 and the encoding circuit 620 are assumed to have the same configuration as that of the video encoding apparatus 100 described in the first embodiment. The operation of the video encoding apparatus 600 configured as described above will be described below.

映像信号601が入力されると、仮符号化回路610にてN個のマクロブロックに対する仮符号化が行われる。発生符号量R1(n)は、適応量子化制御回路630に渡される。また映像信号601は、FIFOバッファ640に入力され、N個のマクロブロック分のデータとして保持される。適応量子化制御回路630において最適量子化パラメータQP2(n)の算出が終了すると、遅延された映像信号601がFIFOバッファ640から符号化回路620に入力され、N個のマクロブロックに対して最適量子化パラメータQP2(n)による符号化が行われる。その結果、出力ビットストリーム602を得る。 When the video signal 601 is input, the provisional encoding circuit 610 performs provisional encoding on N macroblocks. The generated code amount R 1 (n) is passed to the adaptive quantization control circuit 630. The video signal 601 is input to the FIFO buffer 640 and held as data for N macroblocks. When the adaptive quantization control circuit 630 finishes calculating the optimal quantization parameter QP 2 (n), the delayed video signal 601 is input from the FIFO buffer 640 to the encoding circuit 620 and is optimal for N macroblocks. Encoding with the quantization parameter QP 2 (n) is performed. As a result, an output bit stream 602 is obtained.

本実施の形態の利点は、仮符号化と符号化の回路を別とすることにより、図11の効果が得られる点である。図11のように、符号化回路620でマクロブロック#0から#N−1を符号化している時間に、仮符号化回路610で次のN個のマクロブロック#Nから#2N−1に対する仮符号化が行える。よって、リアルタイム動作が可能な符号化回路を2つ接続し、仮符号化回路610の内部にのみ、仮量子化パラメータを与える適応量子化制御回路130と、コンテキスト選択回路131を実装することにより、本実施の形態は容易に実現できる。   The advantage of this embodiment is that the effect of FIG. 11 can be obtained by separating the provisional encoding and encoding circuits. As shown in FIG. 11, at the time when the encoding circuit 620 encodes the macroblocks # 0 to # N-1, the temporary encoding circuit 610 performs provisional processing for the next N macroblocks #N to # 2N-1. Can be encoded. Therefore, by connecting two encoding circuits capable of real-time operation and implementing the adaptive quantization control circuit 130 that gives the temporary quantization parameter only inside the temporary encoding circuit 610, and the context selection circuit 131, This embodiment can be easily realized.

(実施の形態3)
本実施の形態は、実施の形態1の構成をソフトウェアで実現するための構成を示すものである。
(Embodiment 3)
The present embodiment shows a configuration for realizing the configuration of the first embodiment with software.

本発明による映像符号化処理を、図12のフローチャートを用いて説明する。映像符号化処理200が開始されると、動作単位を決定する(210)。Nは実施の形態1で説明した通りである。   The video encoding process according to the present invention will be described with reference to the flowchart of FIG. When the video encoding process 200 is started, an operation unit is determined (210). N is as described in the first embodiment.

仮量子化パラメータQP1(n)の決定ステップ220では、仮符号化処理230で量子化するための仮量子化パラメータを算出する。具体的には、N個のマクロブロックに対する仮量子化パラメータQP1(n)(n=0,1,…,N−1)を,Q種類の代表量子化パラメータqp1(x)(x=0,1,…,Q−1)の中から割り当てる。決定された仮量子化パラメータQP1(n)に基づいて、マクロブロックの仮符号化処理230をN回繰り返す(261)。 In the determination step 220 of the temporary quantization parameter QP 1 (n), a temporary quantization parameter for quantization in the temporary encoding process 230 is calculated. Specifically, the temporary quantization parameter QP 1 (n) (n = 0, 1,..., N−1) for N macroblocks is replaced with Q types of representative quantization parameters qp 1 (x) (x = 0, 1, ..., Q-1). Based on the determined temporary quantization parameter QP 1 (n), the macroblock temporary encoding process 230 is repeated N times (261).

最適量子化パラメータQP2(n)の算出ステップ240では、符号化処理250で量子化するための量子化パラメータを算出する。具体的には、仮符号化処理230における仮量子化パラメータQP1(n)と発生符号量R1(n)(n=0,1,…,N−1)、およびN個のマクロブロックに割り当てるべき目標符号量Tに基づいて、N個のマクロブロックの最適量子化パラメータQP2(n)(n=0,1,…,N−1)を算出する。算出された最適量子化パラメータQP2(n)に基づいて、マクロブロックの符号化処理250をN回繰り返す(262)。最後に、全ての映像データの符号化が完了していれば終了(290)し、完了していなければステップ220の仮量子化パラメータの算出ステップに戻り、次の映像データに対して同じ処理を繰り返す(260)。 In the calculation step 240 of the optimal quantization parameter QP 2 (n), a quantization parameter for quantization in the encoding process 250 is calculated. Specifically, the temporary quantization parameter QP 1 (n) and the generated code amount R 1 (n) (n = 0, 1,..., N−1) and N macroblocks in the temporary encoding process 230 Based on the target code amount T to be allocated, optimum quantization parameters QP 2 (n) (n = 0, 1,..., N−1) of N macroblocks are calculated. Based on the calculated optimal quantization parameter QP 2 (n), the macroblock encoding process 250 is repeated N times (262). Finally, if all the video data has been encoded, the process ends (290). If not completed, the process returns to the temporary quantization parameter calculation step of step 220, and the same processing is performed on the next video data. Repeat (260).

仮符号化処理230の動作を、図13のフローチャートを用いて説明する。最初にDCT処理270を行う。仮量子化パラメータQP1(n)による量子化(231)を行った後、QP1(n)に応じて異なる算術符号化のコンテキスト選択(232)を行う。この操作は、特にDCT変換による係数データに相当するシンタックスの算術符号化に際しては、コンテキスト即ち状態値(MPSやpState)を、量子化パラメータQP1(n)∈qp1(x)(x=0,1,…,Q−1)毎に切替えて使用するものである。つまり、CABACが使用するDCT変換による係数データに相当するシンタックスの状態値を、Q種類に増やしてqp1(x)毎に保持し、QP1(n)によって使う状態値を分けることになる。仮符号化における算術符号化(233)を行って発生符号量R1(n)を得る。その後、逆量子化処理272、逆DCT処理271、イントラ予測及びインター予測を含む予測処理280を行って終了(239)する。 The operation of the provisional encoding process 230 will be described with reference to the flowchart of FIG. First, DCT processing 270 is performed. After performing quantization (231) using the temporary quantization parameter QP 1 (n), different arithmetic coding context selection (232) is performed according to QP 1 (n). In this operation, in particular, in arithmetic coding of syntax corresponding to coefficient data by DCT transformation, a context, that is, a state value (MPS or pState) is converted into a quantization parameter QP 1 (n) ∈qp 1 (x) (x = It is used by switching every 0, 1, ..., Q-1). That is, syntax state values corresponding to coefficient data by DCT conversion used by CABAC are increased to Q types and held for each qp 1 (x), and the state values to be used are divided by QP 1 (n). . Arithmetic coding (233) in provisional coding is performed to obtain a generated code amount R 1 (n). Then, the prediction process 280 including the inverse quantization process 272, the inverse DCT process 271, the intra prediction and the inter prediction is performed, and the process ends (239).

符号化処理250の動作を、図14のフローチャートを用いて説明する。最初にDCT処理270を行う。量子化パラメータQP2(n)による量子化(251)を行った後、算術符号化のコンテキスト選択(252)を行う。この操作は、仮符号化処理230において代表量子化パラメータqp1(x)によって異なるコンテキスト情報を用いたのとは異なり、量子化パラメータによって異なるコンテキスト情報を用いることはしない。算術符号化(253)を行って発生符号量R2(n)を得る。その後、逆量子化処理272、逆DCT処理271、イントラ予測及びインター予測を含む予測処理280を行って終了(259)する。 The operation of the encoding process 250 will be described using the flowchart of FIG. First, DCT processing 270 is performed. After performing quantization (251) using the quantization parameter QP 2 (n), arithmetic context selection (252) is performed. This operation is different from using different context information depending on the representative quantization parameter qp 1 (x) in the provisional encoding process 230, and does not use different context information depending on the quantization parameter. Arithmetic coding (253) is performed to obtain a generated code amount R 2 (n). Then, the prediction process 280 including the inverse quantization process 272, the inverse DCT process 271, the intra prediction and the inter prediction is performed, and the process ends (259).

本実施の形態により、実施の形態1をソフトウェアで実現することが可能となる。   According to the present embodiment, the first embodiment can be realized by software.

本発明の符号化装置は、カメラレコーダや録画装置などリアルタイム動作が必要な記録装置に有効である。   The encoding apparatus of the present invention is effective for a recording apparatus that requires real-time operation, such as a camera recorder or a recording apparatus.

本発明の実施の形態1における映像符号化装置の構成図Configuration diagram of video encoding apparatus in Embodiment 1 of the present invention 同実施の形態1におけるフェーズのスケジューリングを説明する図The figure explaining the scheduling of the phase in Embodiment 1 同実施の形態1における仮符号化時の回路動作を説明する図The figure explaining the circuit operation at the time of provisional encoding in the first embodiment 同実施の形態1における符号化時の回路動作を説明する図The figure explaining the circuit operation | movement at the time of the encoding in Embodiment 1 同実施の形態1における1フレームの仮符号化の例を示す図The figure which shows the example of the temporary encoding of 1 frame in Embodiment 1 同実施の形態1における量子化パラメータの選択例を示す図The figure which shows the example of selection of the quantization parameter in Embodiment 1 同実施の形態1における最適量子化パラメータの算出例を示す図The figure which shows the example of calculation of the optimal quantization parameter in Embodiment 1 本発明の実施の形態2における映像符号化装置の構成図Configuration diagram of video encoding apparatus in Embodiment 2 of the present invention 算術符号化回路を説明する図The figure explaining the arithmetic coding circuit 2値算術符号化の動作を説明する図The figure explaining the operation | movement of binary arithmetic coding 本発明の実施の形態2におけるフェーズのスケジューリングを説明する図The figure explaining the scheduling of the phase in Embodiment 2 of this invention 本発明の実施の形態3における符号化処理を示すフローチャートThe flowchart which shows the encoding process in Embodiment 3 of this invention. 同実施の形態3における仮符号化処理を示すフローチャートFlowchart showing provisional encoding processing in the third embodiment 同実施の形態3における符号化処理を示すフローチャートFlowchart showing encoding processing in the third embodiment 本発明の実施の形態1における算術符号化回路を説明する図The figure explaining the arithmetic coding circuit in Embodiment 1 of this invention

符号の説明Explanation of symbols

100 映像符号化装置
101 映像信号入力
110 DCT回路
111 逆DCT回路
120 量子化回路
121 逆量子化回路
130 適応量子化制御回路
131 コンテキスト選択回路
140 算術符号化回路
150 イントラ予測回路
160 インター予測回路
161 動き予測回路
200 映像符号化処理
210 動作単位Nの決定ステップ
220 仮量子化パラメータQP1(n)の算出ステップ
230 仮符号化処理
231 仮量子化パラメータQP1(n)による量子化ステップ
232 QP1(n)に応じて異なる算術符号化のコンテキスト選択ステップ
233 仮符号化における算術符号化ステップ
240 最適量子化パラメータQP2(n)の算出ステップ
250 符号化処理
251 量子化パラメータQP2(n)による量子化ステップ
252 QP2(n)によらない算術符号化のコンテキスト選択ステップ
253 算術符号化ステップ
DESCRIPTION OF SYMBOLS 100 Video coding apparatus 101 Video signal input 110 DCT circuit 111 Inverse DCT circuit 120 Quantization circuit 121 Inverse quantization circuit 130 Adaptive quantization control circuit 131 Context selection circuit 140 Arithmetic coding circuit 150 Intra prediction circuit 160 Inter prediction circuit 161 Motion Prediction circuit 200 Video encoding process 210 Step of determining operation unit N 220 Calculation step of temporary quantization parameter QP 1 (n) 230 Temporary encoding process 231 Quantization step by temporary quantization parameter QP 1 (n) 232 QP 1 ( n) Context selection step of arithmetic coding that differs depending on n) 233 Arithmetic coding step in provisional coding 240 Calculation step of optimum quantization parameter QP 2 (n) 250 Encoding process 251 Quantization by quantization parameter QP 2 (n) Conversion 252 Context selection step of arithmetic coding not based on QP 2 (n) 253 Arithmetic coding step

Claims (13)

信号を符号化するための符号化装置であって、
入力された前記信号を直交変換して係数データを出力する直交変換回路と、
前記係数データを量子化するための量子化回路と、
前記量子化回路で量子化するための量子化パラメータを生成する量子化制御回路と、
前記量子化回路で量子化されたデータに対して前記量子化パラメータに基づいて算術符号化を行う算術符号化回路とを有し、
仮符号化時において、
前記量子化制御回路は、前記量子化パラメータとして仮量子化パラメータを複数の代表量子化パラメータから選択することにより生成し、
前記算術符号化回路は、前記仮量子化パラメータに基づいて前記係数データの発生確率を示す情報を含む前記コンテキスト情報を選択し、前記コンテキスト情報に基づいて算術符号化を行うと共に算術符号化したデータの発生符号量を算出し、
符号化時において、
前記量子化制御回路は、前記仮量子化パラメータ、前記発生符号量及び符号化時に与えるべき所定の符号量に基づいて前記量子化パラメータとしての最適量子化パラメータを生成し、
前記算術符号化回路は、前記最適量子化パラメータ及び所定のコンテキスト情報に基づいて算術符号化を行うことを特徴とする符号化装置。
An encoding device for encoding a signal,
An orthogonal transform circuit that orthogonally transforms the input signal and outputs coefficient data;
A quantization circuit for quantizing the coefficient data;
A quantization control circuit for generating a quantization parameter for quantization by the quantization circuit;
An arithmetic coding circuit that performs arithmetic coding on the data quantized by the quantization circuit based on the quantization parameter;
At the time of provisional encoding,
The quantization control circuit generates a temporary quantization parameter as the quantization parameter by selecting from a plurality of representative quantization parameters,
The arithmetic coding circuit selects the context information including information indicating the occurrence probability of the coefficient data based on the temporary quantization parameter, performs arithmetic coding based on the context information, and arithmetically encoded data The generated code amount of
When encoding,
The quantization control circuit generates an optimal quantization parameter as the quantization parameter based on the temporary quantization parameter, the generated code amount, and a predetermined code amount to be given at the time of encoding,
The coding apparatus according to claim 1, wherein the arithmetic coding circuit performs arithmetic coding based on the optimum quantization parameter and predetermined context information.
前記量子化制御回路は、N個(Nは2以上の自然数)の前記係数データを量子化するための前記量子化パラメータを生成するに際してQ個(Qは2以上の自然数)から成る代表量子化パラメータを設定し、前記Q個の代表量子化パラメータから任意の一個の量子化パラメータを選択して前記量子化パラメータを生成することを特徴とする、請求項1に記載の符号化装置。 The quantization control circuit generates Q quantization parameters (Q is a natural number of 2 or more) when generating the quantization parameter for quantizing the coefficient data of N (N is a natural number of 2 or more). The encoding apparatus according to claim 1, wherein a parameter is set, and any one quantization parameter is selected from the Q representative quantization parameters to generate the quantization parameter. 前記Nは、N=L*Q(Lは自然数)であり、
前記量子化制御回路における前記量子化パラメータの生成は、連続したQ個の前記係数データに対して互いに異なるQ個の量子化パラメータを選択することで行うことを特徴とする、請求項2に記載の符号化装置。
N is N = L * Q (L is a natural number),
The generation of the quantization parameter in the quantization control circuit is performed by selecting different Q quantization parameters for consecutive Q pieces of coefficient data. Encoding device.
信号を符号化するための符号化装置であって、
入力された前記信号を直交変換して係数データを出力する直交変換回路と、
複数の代表量子化パラメータから選択することにより第1の量子化パラメータを生成する第1の量子化制御回路と、
前記第1の量子化パラメータに基づいて前記係数データを量子化して第1の量子化データとする第1の量子化回路と、
前記第1の量子化パラメータに基づいて前記係数データの発生確率を示す情報を含む前記コンテキスト情報を選択し、前記コンテキスト情報を用いて前記第1の量子化データに対して算術符号化を行うと共に算術符号化したデータの発生符号量を算出する第1の算術符号化回路と、
前記第1の量子化パラメータ、前記発生符号量及び符号化時に与えるべき所定の符号量に基づいて第2の量子化パラメータを生成する第2の量子化制御回路と、
前記第2の量子化パラメータに基づいて前記係数データを量子化して第2の量子化データとする第2の量子化回路と、
前記第2の量子化パラメータ及び所定のコンテキスト情報に基づいて前記第2の量子化データに対して算術符号化を行う第2の算術符号化回路とを有することを特徴とする符号化装置。
An encoding device for encoding a signal,
An orthogonal transform circuit that orthogonally transforms the input signal and outputs coefficient data;
A first quantization control circuit that generates a first quantization parameter by selecting from a plurality of representative quantization parameters;
A first quantization circuit that quantizes the coefficient data based on the first quantization parameter to obtain first quantized data;
The context information including information indicating the occurrence probability of the coefficient data is selected based on the first quantization parameter, and arithmetic coding is performed on the first quantized data using the context information. A first arithmetic encoding circuit for calculating a generated code amount of the arithmetically encoded data;
A second quantization control circuit for generating a second quantization parameter based on the first quantization parameter, the generated code amount, and a predetermined code amount to be given at the time of encoding;
A second quantization circuit that quantizes the coefficient data based on the second quantization parameter to obtain second quantized data;
A coding apparatus comprising: a second arithmetic coding circuit that performs arithmetic coding on the second quantized data based on the second quantization parameter and predetermined context information.
前記第1の量子化制御回路は、N個(Nは2以上の自然数)の前記係数データを量子化するための前記第1の量子化パラメータを生成するに際してQ個(Qは2以上の自然数)から成る代表量子化パラメータを設定し、前記Q個の代表量子化パラメータから任意の一個の量子化パラメータを選択して前記第1の量子化パラメータを生成することを特徴とする、請求項4に記載の符号化装置。 The first quantization control circuit generates Q (Q is a natural number equal to or greater than 2) when generating the first quantization parameter for quantizing the N (N is a natural number equal to or greater than 2) the coefficient data. 5), the first quantization parameter is generated by selecting any one quantization parameter from the Q representative quantization parameters. The encoding device described in 1. 前記Nは、N=L*Q(Lは自然数)であり、
前記第1の量子化制御回路における前記第1の量子化パラメータの生成は、連続したQ個の前記係数データに対して互いに異なるQ個の代表量子化パラメータを選択することで行うことを特徴とする、請求項5に記載の符号化装置。
N is N = L * Q (L is a natural number),
The generation of the first quantization parameter in the first quantization control circuit is performed by selecting Q representative quantization parameters different from each other for consecutive Q pieces of coefficient data. The encoding device according to claim 5.
前記Q個の代表量子化パラメータは、量子化パラメータの最大値及び最小値を必ず含むように構成したことを特徴とする、請求項2、3、5、6のいずれかに記載の符号化装置。 7. The encoding apparatus according to claim 2, wherein the Q representative quantization parameters are configured to always include a maximum value and a minimum value of the quantization parameter. . 前記信号は映像信号であり、
前記コンテキスト情報は、少なくとも発生確率の高いシンボルを示すMPS値と、
前記シンボルの発生確率を示すpState値とを有し、
前記係数データは、前記信号を周波数成分に変換した係数であることを特徴とする、請求項1乃至7のうちいずれかに記載の符号化装置。
The signal is a video signal;
The context information includes at least an MPS value indicating a symbol having a high probability of occurrence;
A pState value indicating the probability of occurrence of the symbol,
8. The encoding apparatus according to claim 1, wherein the coefficient data is a coefficient obtained by converting the signal into a frequency component.
信号を符号化するための符号化方法であって、
入力された前記信号を直交変換して係数データを出力する直交変換処理ステップと、
第1の量子化パラメータを複数の代表量子化パラメータから選択することにより生成し、前記第1の量子化パラメータに基づいて前記係数データを量子化して第1の量子化データとする第1の量子化ステップと、
前記量子化パラメータに基づいて前記係数データの発生確率を示す情報を含む前記コンテキスト情報を選択し、前記コンテキスト情報に基づいて前記第1の量子化データに対して算術符号化を行うと共に算術符号化したデータの発生符号量を算出する第1の算術符号化ステップと、
符号化時において、
前記第1の量子化パラメータ、前記発生符号量及び符号化時に与えるべき所定の符号量に基づいて第2の量子化パラメータを生成し、前記第2の量子化パラメータに基づいて前記係数データを量子化して第2の量子化データとする第2の量子化ステップと、
前記第2の量子化パラメータ及び所定のコンテキスト情報に基づいて前記第2の量子化データに対して算術符号化を行う前記第2の算術符号化ステップとを有することを特徴とする符号化方法。
An encoding method for encoding a signal, comprising:
An orthogonal transform processing step of orthogonally transforming the input signal and outputting coefficient data;
A first quantum generated by selecting a first quantization parameter from a plurality of representative quantization parameters, and quantizing the coefficient data based on the first quantization parameter to obtain first quantized data Step,
The context information including information indicating the occurrence probability of the coefficient data is selected based on the quantization parameter, and arithmetic coding is performed on the first quantized data and arithmetic coding is performed based on the context information. A first arithmetic encoding step for calculating a generated code amount of the processed data;
When encoding,
A second quantization parameter is generated based on the first quantization parameter, the generated code amount and a predetermined code amount to be given at the time of encoding, and the coefficient data is quantized based on the second quantization parameter. A second quantization step that is converted into second quantized data;
And a second arithmetic encoding step for performing arithmetic encoding on the second quantized data based on the second quantization parameter and predetermined context information.
前記第1の量子化ステップは、N個(Nは2以上の自然数)の前記係数データを量子化するための前記量子化パラメータを生成するに際してQ個(Qは2以上の自然数)から成る代表量子化パラメータを設定し、
前記Q個の代表量子化パラメータから任意の一個の量子化パラメータを選択して前記量子化パラメータを生成することを特徴とする、請求項9に記載の符号化方法。
The first quantization step is representative of Q (Q is a natural number of 2 or more) when generating the quantization parameter for quantizing the coefficient data of N (N is a natural number of 2 or more). Set the quantization parameter,
The encoding method according to claim 9, wherein the quantization parameter is generated by selecting any one quantization parameter from the Q representative quantization parameters.
前記Nは、N=L*Q(Lは自然数)であり、
前記第1の量子化ステップにおける量子化パラメータの生成は、連続したQ個の前記係数データに対して互いに異なるQ個の代表量子化パラメータを選択することで行うことを特徴とする、請求項10に記載の符号化方法。
N is N = L * Q (L is a natural number),
The quantization parameter generation in the first quantization step is performed by selecting Q representative quantization parameters different from each other for consecutive Q pieces of coefficient data. The encoding method described in 1.
前記Q個の代表量子化パラメータは、量子化パラメータの最大値及び最小値を必ず含むように構成したことを特徴とする、請求項10又は11に記載の符号化方法。 The encoding method according to claim 10 or 11, wherein the Q representative quantization parameters are configured to necessarily include a maximum value and a minimum value of the quantization parameter. 前記信号は映像信号であり、
前記コンテキストは、少なくとも発生確率の高いシンボルを示すMPS値と、
前記シンボルの発生確率を示すpState値とを有し、
前記係数データは、前記信号を周波数成分に変換した係数であることを特徴とする、請求項9乃至12のうちいずれかに記載の符号化方法。
The signal is a video signal;
The context includes at least an MPS value indicating a symbol having a high probability of occurrence;
A pState value indicating the probability of occurrence of the symbol,
13. The encoding method according to claim 9, wherein the coefficient data is a coefficient obtained by converting the signal into a frequency component.
JP2005258789A 2005-09-07 2005-09-07 Coding device and method therefor Pending JP2007074337A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005258789A JP2007074337A (en) 2005-09-07 2005-09-07 Coding device and method therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005258789A JP2007074337A (en) 2005-09-07 2005-09-07 Coding device and method therefor

Publications (1)

Publication Number Publication Date
JP2007074337A true JP2007074337A (en) 2007-03-22

Family

ID=37935411

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005258789A Pending JP2007074337A (en) 2005-09-07 2005-09-07 Coding device and method therefor

Country Status (1)

Country Link
JP (1) JP2007074337A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6444576A (en) * 1987-08-12 1989-02-16 Matsushita Electric Ind Co Ltd Arithmetic circuit
JP2012523728A (en) * 2009-04-09 2012-10-04 トムソン ライセンシング Method and apparatus for encoding an input bit sequence and corresponding decoding method and apparatus
US8351500B2 (en) 2008-01-16 2013-01-08 Nec Corporation Entropy encoder, video coding apparatus, video coding method and video coding program
JP2013258465A (en) * 2012-06-11 2013-12-26 Nippon Hoso Kyokai <Nhk> Processing system, preprocessing device, postprocessing device, preprocessing program and postprocessing program
JP2015504292A (en) * 2012-01-19 2015-02-05 クゥアルコム・インコーポレイテッドQualcomm Incorporated Context-adaptive entropy coding with reduced initial value set

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6444576A (en) * 1987-08-12 1989-02-16 Matsushita Electric Ind Co Ltd Arithmetic circuit
US8351500B2 (en) 2008-01-16 2013-01-08 Nec Corporation Entropy encoder, video coding apparatus, video coding method and video coding program
JP2012523728A (en) * 2009-04-09 2012-10-04 トムソン ライセンシング Method and apparatus for encoding an input bit sequence and corresponding decoding method and apparatus
JP2015504292A (en) * 2012-01-19 2015-02-05 クゥアルコム・インコーポレイテッドQualcomm Incorporated Context-adaptive entropy coding with reduced initial value set
US9654772B2 (en) 2012-01-19 2017-05-16 Qualcomm Incorporated Context adaptive entropy coding with a reduced initialization value set
JP2017225132A (en) * 2012-01-19 2017-12-21 クゥアルコム・インコーポレイテッドQualcomm Incorporated Context adaptive entropy coding with reduced initialization value set
JP2013258465A (en) * 2012-06-11 2013-12-26 Nippon Hoso Kyokai <Nhk> Processing system, preprocessing device, postprocessing device, preprocessing program and postprocessing program

Similar Documents

Publication Publication Date Title
US11671599B2 (en) Data encoding and decoding
KR102424328B1 (en) Methods of coding block information using quadtree and appararuses for using the same
US11039142B2 (en) Encoding and decoding of significant coefficients in dependence upon a parameter of the significant coefficients
JP4354520B2 (en) Encoder
US10893273B2 (en) Data encoding and decoding
JP6400092B2 (en) Data encoding and decoding
JP5492206B2 (en) Image encoding method and image decoding method, and image encoding device and image decoding device
US9544599B2 (en) Context adaptive data encoding
US20140286417A1 (en) Data encoding and decoding
KR101974952B1 (en) Methods of coding intra prediction mode using two candidate intra prediction modes and apparatuses using the same
JP5231243B2 (en) Encoding apparatus and encoding method
JP5116704B2 (en) Image coding apparatus and image coding method
JP2009021775A (en) Coder and coding method
JP2007074337A (en) Coding device and method therefor
WO2013068733A1 (en) Context adaptive data encoding
GB2496193A (en) Context adaptive data encoding and decoding
JP2014068247A (en) Code amount calculation device and program and moving image encoder and program