JP4453398B2 - Encoding apparatus, program, and encoding processing method - Google Patents

Encoding apparatus, program, and encoding processing method Download PDF

Info

Publication number
JP4453398B2
JP4453398B2 JP2004056501A JP2004056501A JP4453398B2 JP 4453398 B2 JP4453398 B2 JP 4453398B2 JP 2004056501 A JP2004056501 A JP 2004056501A JP 2004056501 A JP2004056501 A JP 2004056501A JP 4453398 B2 JP4453398 B2 JP 4453398B2
Authority
JP
Japan
Prior art keywords
data
unit
encoding
processing
arithmetic
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.)
Expired - Fee Related
Application number
JP2004056501A
Other languages
Japanese (ja)
Other versions
JP2005252374A (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.)
Sony Corp
Original Assignee
Sony 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 Sony Corp filed Critical Sony Corp
Priority to JP2004056501A priority Critical patent/JP4453398B2/en
Publication of JP2005252374A publication Critical patent/JP2005252374A/en
Application granted granted Critical
Publication of JP4453398B2 publication Critical patent/JP4453398B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Description

本発明は、例えば、画像データや音声データ等のデータを算術符号化等の符号化処理を行う符号化装置、プログラム、および符号化処理方法に関する。   The present invention relates to an encoding device, a program, and an encoding processing method that perform encoding processing such as arithmetic encoding on data such as image data and audio data.

近年、画像データをデジタルとして取り扱い、その際、効率の高い情報の伝送、蓄積を目的とし、画像情報特有の冗長性を利用して、離散コサイン変換等の直交変換と動き補償により圧縮するMPEG(Moving Picture Experts Group)などの方式に準拠した装置が、放送局などの情報配信、及び一般家庭における情報受信の双方において普及しつつある。   In recent years, image data has been handled as digital data. At that time, MPEG (compressed by orthogonal transform such as discrete cosine transform and motion compensation is used for the purpose of efficient transmission and storage of information, and using redundancy unique to image information. A device conforming to a system such as Moving Picture Experts Group) is becoming popular in both information distribution at broadcasting stations and information reception in general households.

このMPEG方式に続いて、さらなる高圧縮率を実現するJVT(Joint Video Team)と呼ばれる符号化方式が提案されている(例えば、非特許文献1参照)。
JVT方式では、構文要素(SE:Syntax Element)の符号化処理として、CAVLC(Context Based Adaptive Variable Length Coding )と、CABAC(Context Adaptive Binary Arithmetic Coding )の2種類の符号化処理を規定している。
CABACは、構文要素(SE:Syntax Element)をコンテクスト(Context)にわけて、それぞれのコンテクストについて算術符号化処理を行う符号化処理である。
トーマス・ウィーガント,ゲーリー・J・サリバン,ギスレ・ビョンテガード,アジャイ・ルスラ(Thomas Wiegand, Gary J.Sullivan, Gisle Bjontegaard, and Ajay Luthra),ビデオコーディングスタンダードの概要(Overview of the H.264/AVC Video Coding Standard),「IEEEのビデオ技術用の処理回路およびシステム」(IEEE TRANSACTIONS CIRCUITS AND SYSTEMS FOR VIDEO TECHNOLOGY),(米国),,2003年7月,
Following this MPEG system, an encoding system called JVT (Joint Video Team) that realizes a higher compression rate has been proposed (see, for example, Non-Patent Document 1).
In the JVT system, two types of encoding processing, CAVLC (Context Based Adaptive Variable Length Coding) and CABAC (Context Adaptive Binary Arithmetic Coding), are defined as encoding processing of a syntax element (SE).
CABAC is an encoding process in which syntax elements (SE) are divided into contexts, and arithmetic encoding processes are performed on the respective contexts.
Thomas Wiegand, Gary J. Sullivan, Gisle Bjontegaard, and Ajay Luthra, Overview of the Video Coding Standard (Overview of the H.264 / AVC Video Coding Standard), "Processing Circuits and Systems for IEEE Video Technology" (IEEE TRANSACTIONS CIRCUITS AND SYSTEMS FOR VIDEO TECHNOLOGY), (USA), July 2003,

上述したCABACによる算術符号化処理において、デコーダの負荷を考慮して、圧縮率を制限するCabacZeroWord という機能が知られている。
詳細には、CABACによる符号化処理の結果、圧縮率が高い符号化データを生成した際に、デコーダがその圧縮率の高い符号化データをデコード処理を行うと、その符号化データを所定時間内に処理しきれない場合がある。
そのため符号化処理の際に、例えば1画像の内の複数のスライス(Slice )それぞれの最後に付加データを付加する。具体的には、例えば付加データは0x000003を1単位としたスタッフィングバイト(StuffingByte)を付加することで、デコーダの負荷を軽減する。付加データは、CabacZeroWordに相当する。
In the arithmetic coding process by CABAC described above, a function called CabacZeroWord for limiting the compression rate in consideration of the load on the decoder is known.
Specifically, when encoded data having a high compression rate is generated as a result of the encoding processing by CABAC, if the decoder performs decoding processing on the encoded data having a high compression rate, the encoded data is stored within a predetermined time. There are cases where it cannot be fully processed.
Therefore, at the time of encoding processing, for example, additional data is added to the end of each of a plurality of slices (Slice) in one image. Specifically, for example, the additional data adds a stuffing byte (Stuffing Byte) with 0x000003 as one unit, thereby reducing the load on the decoder. Additional data corresponds to CabacZeroWord.

しかし、上述した符号化処理において、CabacZeroWord により1スライスの最後に付加するデータのデータ長は、1スライス分のデータの符号化処理が終了するまで不確定であるので、マクロブロック単位で画像データを量子化処理する際の量子化レートを制御できない場合がある。
また、符号化処理の結果、高圧縮率の符号化データが生成され、大量のCabacZeroWord が急激に発生した場合には、バッファがオーバーフローを起こす場合がある。
このため、1スライスよりも短い処理単位で付加データを予測できる符号化装置が望まれている。
However, in the encoding process described above, the data length of the data added to the end of one slice by CabacZeroWord is uncertain until the encoding process for one slice of data is completed. There are cases where the quantization rate at the time of quantization processing cannot be controlled.
As a result of the encoding process, encoded data with a high compression rate is generated, and if a large amount of CabacZeroWord occurs suddenly, the buffer may overflow.
For this reason, an encoding apparatus that can predict additional data in a processing unit shorter than one slice is desired.

本発明は、かかる事情に鑑みてなされたものであり、その目的は、符号化処理において、画像データのうち付加データの所定単位よりも小さい単位で付加データを予測できる符号化装置、プログラム、および符号化処理方法を提供することにある。   The present invention has been made in view of such circumstances, and an object of the present invention is to provide an encoding device, a program, and an encoding method capable of predicting additional data in a unit smaller than a predetermined unit of additional data in image data in encoding processing, and An object of the present invention is to provide an encoding processing method.

また、他の目的は、画像データのうち所定単位で付加データを予測し、予測したデータに基づいて高精度に量子化処理を行うことができる符号化装置、プログラム、および符号化処理方法を提供することにある。   Another object of the present invention is to provide an encoding device, a program, and an encoding processing method capable of predicting additional data in predetermined units of image data and performing quantization processing with high accuracy based on the predicted data. There is to do.

前記目的を達成するために、本発明の第1の観点の符号化装置は、画像データをマクロブロック単位で算術符号化処理を行い符号化データを生成する算術符号化手段と、前記算術符号化手段が生成した符号化データに、前記算術符号化手段の算術符号化処理によって生成された複数のマクロブロックを含むスライスまたはピクチャ単位での前記画像データの圧縮の度合いを示す指標データに応じた付加データを付加する付加手段と、前記マクロブロック単位で、前記算術符号化手段による算術符号化処理の対象のデータのデータ長、および、前記算術符号化手段が生成した符号化データのデータ長に基づいて、前記付加手段が付加する付加データを予測する予測手段と、前記マクロブロック単位で、前記予測手段が予測した前記付加データに応じた所定処理を行う処理手段とを有する。 In order to achieve the above object, an encoding apparatus according to a first aspect of the present invention includes an arithmetic encoding unit that performs arithmetic encoding processing on image data in units of macroblocks to generate encoded data, and the arithmetic encoding means the generated encoded data, said arithmetic coding means is generated I by the arithmetic coding process, index data indicating the degree of compression of the image data in the slice or picture unit including a plurality of macroblocks adding means for adding additional data corresponding to, in the macro-block unit, the data length of the target data for arithmetic coding by the arithmetic coding means and the coded data said arithmetic coding means to generate based on the data length, and predicting means for predicting the additional data to which the additional means for adding, at the macro-block basis, the additional data the prediction means predicts And a processing means for performing predetermined processing corresponding.

さらに、前記目的を達成するために、本発明の第2の観点の符号化装置は、複数の異なるサイズのマクロブロックを単位として、動き補償の対象となる画像データと、前記動き補償で参照される参照画像データの間の差分に基づいて動きベクトルを生成する動きベクトル生成手段と、前記動き補償の対象となる画像データと、予測画像データとの差分に直交変換処理および量子化処理を順に施す第1の処理手段と、前記第1の処理手段で生成したデータに、逆量子化処理および逆直交変換処理を順に施して参照データを生成する第2の処理手段と、前記動きベクトルおよび前記参照画像データを基に前記予測画像データを生成する第3の処理手段と、設定された量子化の度合いを示すデータに基づいて量子化処理を行い、前記符号化手段の処理対象のデータを生成する量子化手段と、前記量子化手段が生成したデータ、および前記動きベクトルを、前記マクロブロック単位で算術符号化処理を行い符号化データを生成する算術符号化手段と、前記算術符号化手段が生成した符号化データに、前記算術符号化手段の算術符号化処理によって生成された、複数のマクロブロックを含むスライスまたはピクチャ単位での前記画像データの圧縮の度合いを示す指標データに応じた付加データを付加する付加手段と、前記マクロブロック単位で、前記算術符号化手段による算術符号化処理の対象のデータのデータ長、および、前記算術符号化手段が生成した符号化データのデータ長に基づいて、前記付加手段が付加する前記指標データに応じた付加データを予測する予測手段と、前記マクロブロック単位で、前記予測手段が予測した前記付加データに基づいて、前記量子化手段の量子化の度合いを示すデータを設定する量子化データ設定手段とを有する。Furthermore, in order to achieve the above object, the encoding apparatus according to the second aspect of the present invention refers to the image data to be subjected to motion compensation and the motion compensation in units of a plurality of macro blocks having different sizes. Motion vector generating means for generating a motion vector based on the difference between the reference image data, and the difference between the motion compensation target image data and the predicted image data are subjected to orthogonal transform processing and quantization processing in order. A first processing unit; a second processing unit configured to sequentially perform an inverse quantization process and an inverse orthogonal transform process on the data generated by the first processing unit; and generate the reference data; the motion vector and the reference A third processing unit that generates the predicted image data based on the image data, a quantization process based on the set data indicating the degree of quantization, and a process of the encoding unit; Quantization means for generating target data; data generated by the quantization means; and arithmetic coding means for generating encoded data by performing arithmetic coding processing of the motion vector in units of the macroblocks; Index data indicating the degree of compression of the image data in units of slices or pictures including a plurality of macroblocks generated by the arithmetic encoding process of the arithmetic encoding unit in the encoded data generated by the arithmetic encoding unit An additional means for adding additional data in accordance with the data length of the data to be subjected to arithmetic coding processing by the arithmetic coding means, and the encoded data generated by the arithmetic coding means in the macroblock unit. Prediction means for predicting additional data corresponding to the index data added by the adding means based on the data length; In click units, and a the prediction means on the basis of the additional data predicted, quantized data setting means for setting data indicating the degree of quantization of the quantization means.

さらに、前記目的を達成するために、本発明の第3の観点のプログラムは、符号化手段と、付加手段と、予測手段と、処理手段と、を有する情報処理装置に実行させるプログラムであって、前記符号化手段が、画像データをマクロブロック単位で算術符号化処理を行い符号化データを生成する第1の手順と、前記付加手段が、前記算術符号化手段が生成した符号化データに、前記算術符号化手段の算術符号化処理によって生成された、複数のマクロブロックを含むスライスまたはピクチャ単位での前記画像データの圧縮の度合いを示す指標データに応じた付加データを付加する第2の手順と、前記予測手段が、前記マクロブロック単位で、前記第1の手順における算術符号化処理の対象のデータのデータ長、および、前記第1の手順で生成した符号化データのデータ長に基づいて、前記第2の手順において付加する付加データを予測する第3の手順と、前記処理手段が、前記マクロブロック単位で、前記第3のステップで予測した前記付加データに応じた所定処理を行う第4の手順と、を前記情報処理装置に実行させる。Furthermore, in order to achieve the above object, a program according to a third aspect of the present invention is a program that is executed by an information processing apparatus that includes an encoding unit, an adding unit, a prediction unit, and a processing unit. The encoding means performs arithmetic encoding processing on image data in units of macroblocks to generate encoded data, and the adding means adds the encoded data generated by the arithmetic encoding means to the encoded data, A second procedure of adding additional data corresponding to index data indicating the degree of compression of the image data in units of slices or pictures including a plurality of macroblocks generated by the arithmetic encoding process of the arithmetic encoding means And the prediction means generates, in the macroblock unit, the data length of the data subject to the arithmetic coding process in the first procedure, and the first procedure. A third procedure for predicting additional data to be added in the second procedure based on a data length of encoded data, and the addition predicted by the processing unit in the third step in units of the macroblocks; And causing the information processing apparatus to execute a fourth procedure for performing predetermined processing according to data.

さらに、前記目的を達成するために、本発明の第4の観点の符号化処理方法は、符号化手段と、付加手段と、予測手段と、処理手段と、を有する情報処理装置が行う符号化処理方法であって、前記符号化手段が、画像データをマクロブロック単位で算術符号化処理を行い符号化データを生成する第1のステップと、前記付加手段が、前記算術符号化手段が生成した符号化データに、前記算術符号化手段の算術符号化処理によって生成された、複数のマクロブロックを含むスライスまたはピクチャ単位での前記画像データの圧縮の度合いを示す指標データに応じた付加データを付加する第2のステップと、前記予測手段が、前記マクロブロック単位で、前記第1のステップにおける算術符号化処理の対象のデータのデータ長、および、前記第1のステップで生成した符号化データのデータ長に基づいて、前記第2のステップにおいて付加する付加データを予測する第3のステップと、前記処理手段が、前記マクロブロック単位で、前記第3のステップで予測した前記付加データに応じた所定処理を行う第4のステップと、を有する。Furthermore, in order to achieve the above object, an encoding processing method according to a fourth aspect of the present invention is an encoding performed by an information processing apparatus having an encoding unit, an adding unit, a prediction unit, and a processing unit. A processing method, wherein the encoding means performs arithmetic encoding processing of image data in units of macroblocks to generate encoded data, and the adding means is generated by the arithmetic encoding means. Additional data according to index data indicating the degree of compression of the image data in units of slices or pictures including a plurality of macroblocks generated by the arithmetic encoding process of the arithmetic encoding unit is added to the encoded data. And the prediction means includes, in units of the macroblock, a data length of data to be subjected to arithmetic coding processing in the first step, and the first A third step of predicting additional data to be added in the second step based on the data length of the encoded data generated in the step; and the processing means in the third step in units of the macroblocks. And a fourth step of performing a predetermined process according to the predicted additional data.

本発明によれば、符号化処理において、画像データのうち付加データの所定単位よりも小さい単位で付加データを予測できる符号化装置、プログラム、および符号化処理方法を提供することができる。   According to the present invention, it is possible to provide an encoding device, a program, and an encoding processing method capable of predicting additional data in a unit smaller than a predetermined unit of additional data in image data.

また、予測したデータに基づいて高精度に量子化処理行うことができる符号化装置、プログラム、および符号化処理方法を提供することができる。   In addition, it is possible to provide an encoding device, a program, and an encoding processing method that can perform quantization processing with high accuracy based on predicted data.

以下、本発明の実施形態に係る符号化処理を採用したJVT方式の符号化装置について説明する。   Hereinafter, a JVT encoding apparatus employing an encoding process according to an embodiment of the present invention will be described.

図1は、本発明の一実施形態に係る符号化装置を採用した通信システム1の概念図である。
図1に示すように、本実施形態に係る通信システム1は、送信側に設けられた符号化装置2と、受信側に設けられた復号装置3とを有する。
通信システム1では、送信側の符号化装置2において、離散コサイン変換やカルーネン・レーベ変換などの直交変換と動き補償によって圧縮したフレーム画像データ(ビットストリーム)を生成し、当該フレーム画像データを変調した後に、衛星放送波、ケーブルTV網、電話回線網、携帯電話回線網などの伝送媒体を介して送信する。
受信側では、受信した画像信号を復調した後に、上記変調時の直交変換の逆変換と動き補償によって伸張したフレーム画像データを生成して利用する。
なお、上記伝送媒体は、光ディスク、磁気ディスクおよび半導体メモリなどの記録媒体であってもよい。
図1に示す復号装置3は符号化装置2の符号化に対応した復号を行い、従来と同じ構成を有している
FIG. 1 is a conceptual diagram of a communication system 1 that employs an encoding apparatus according to an embodiment of the present invention.
As shown in FIG. 1, a communication system 1 according to the present embodiment includes an encoding device 2 provided on the transmission side and a decoding device 3 provided on the reception side.
In the communication system 1, the encoding device 2 on the transmission side generates frame image data (bit stream) compressed by orthogonal transformation such as discrete cosine transformation and Karhunen-Labe transformation and motion compensation, and modulates the frame image data. Later, it is transmitted via a transmission medium such as a satellite broadcast wave, a cable TV network, a telephone line network, or a mobile phone line network.
On the receiving side, after demodulating the received image signal, frame image data expanded by inverse transformation of orthogonal transformation and motion compensation at the time of modulation is generated and used.
The transmission medium may be a recording medium such as an optical disk, a magnetic disk, and a semiconductor memory.
The decoding device 3 shown in FIG. 1 performs decoding corresponding to the encoding of the encoding device 2 and has the same configuration as the conventional one.

以下、図1に示す符号化装置2について説明する。
図2は、図1に示す符号化装置2の全体構成図である。
図2に示すように、符号化装置(情報処理装置)2は、例えば、A/D変換回路22、画面並べ替え回路23、演算回路24、直交変換回路25、量子化回路26、符号化回路(符号化装置とも言う)27、バッファ28、逆量子化回路29、逆直交変換回路30、レート制御回路32、フレームメモリ34、デブロックフィルタ38、および動き予測・補償回路39を主構成要素として有する。
量子化回路26,レート制御回路32は本発明に係る処理手段に相当する。
Hereinafter, the encoding device 2 shown in FIG. 1 will be described.
FIG. 2 is an overall configuration diagram of the encoding device 2 shown in FIG.
As shown in FIG. 2, the encoding device (information processing device) 2 includes, for example, an A / D conversion circuit 22, a screen rearrangement circuit 23, an arithmetic circuit 24, an orthogonal transformation circuit 25, a quantization circuit 26, and an encoding circuit. (Also referred to as an encoding device) 27, buffer 28, inverse quantization circuit 29, inverse orthogonal transform circuit 30, rate control circuit 32, frame memory 34, deblock filter 38, and motion prediction / compensation circuit 39 as main components Have.
The quantization circuit 26 and the rate control circuit 32 correspond to processing means according to the present invention.

以下、符号化装置2の構成要素について説明する。
A/D変換回路22は、入力されたアナログの輝度信号Y、色差信号Cb,Crから構成される原画像信号(画像データ)S10をデジタルのフレームデータS22に変換し、これを画面並べ替え回路23に出力する。
画面並べ替え回路23は、A/D変換回路22から入力したフレームデータS22を、そのピクチャタイプI,P,BからなるGOP(Group Of Pictures )構造に応じて、符号化する順番に並べ替えたフレームデータS23を演算回路24、演算回路24、レート制御回路32および動き予測・補償回路39に出力する。
Hereinafter, components of the encoding device 2 will be described.
The A / D conversion circuit 22 converts the original image signal (image data) S10 composed of the input analog luminance signal Y and color difference signals Cb and Cr into digital frame data S22, and this is a screen rearrangement circuit. To 23.
The screen rearrangement circuit 23 rearranges the frame data S22 input from the A / D conversion circuit 22 in the encoding order according to the GOP (Group Of Pictures) structure composed of the picture types I, P, and B. The frame data S23 is output to the arithmetic circuit 24, the arithmetic circuit 24, the rate control circuit 32, and the motion prediction / compensation circuit 39.

演算回路24は、フレームデータS23内の処理対象の動き補償ブロックMCB(マクロブロックともいう)と、それに対応して動き予測・補償回路39から入力した予測画像データPIの動き補償ブロックMCBとの差分を示す画像データS24を生成し、これを直交変換回路25に出力する。
直交変換回路25は、画像データS24に離散コサイン変換やカルーネン・レーベ変換などの直交変換を施して画像データ(例えばDCT係数)S25を生成し、これを量子化回路26に出力する。
量子化回路26は、画像データS25をレート制御回路32により設定された量子化の度合いを示すデータに基づいて量子化処理を行い、符号化回路27の処理対象のデータを生成する。
詳細には、量子化回路26は、レート制御回路32から入力した量子化スケールで、画像データS25を量子化して画像データS26を生成し、これを符号化回路27および逆量子化回路29に出力する。
The arithmetic circuit 24 calculates the difference between the motion compensation block MCB (also referred to as a macro block) to be processed in the frame data S23 and the motion compensation block MCB of the predicted image data PI input from the motion prediction / compensation circuit 39 corresponding thereto. Is generated and output to the orthogonal transformation circuit 25.
The orthogonal transformation circuit 25 performs orthogonal transformation such as discrete cosine transformation and Karhunen-Labe transformation on the image data S24 to generate image data (for example, DCT coefficient) S25, and outputs this to the quantization circuit 26.
The quantization circuit 26 performs a quantization process on the image data S25 based on the data indicating the degree of quantization set by the rate control circuit 32, and generates data to be processed by the encoding circuit 27.
Specifically, the quantization circuit 26 quantizes the image data S25 with the quantization scale input from the rate control circuit 32 to generate image data S26, and outputs this to the encoding circuit 27 and the inverse quantization circuit 29. To do.

符号化回路27は、画像データS26、動きベクトル等を示す文脈エレメント(SE:Syntax Element )に基づいて、算術符号化処理を行い、処理結果の画像データをバッファ28に格納する。
このとき、符号化回路27は、例えばインター予測符号化が行われた場合には、動き予測・補償回路39から入力した動きベクトルMVを符号化してヘッダデータに格納する。
The encoding circuit 27 performs arithmetic encoding processing based on the image data S26, a context element (SE: Syntax Element) indicating a motion vector, and stores the image data as a processing result in the buffer 28.
At this time, for example, when inter prediction encoding is performed, the encoding circuit 27 encodes the motion vector MV input from the motion prediction / compensation circuit 39 and stores it in the header data.

バッファ28に格納された画像データは、変調等された後に送信される。
逆量子化回路29は、他の動き補償ブロックMCBから参照される参照画像データの動き補償ブロックMCBの画像データS26を逆量子化した信号を生成し、これを逆直交変換回路30に出力する。
逆直交変換回路30は、逆量子化回路29から入力したデータに、直交変換回路25における直交変換の逆変換を施して生成した画像データS30をデブロックフィルタ38を介してフレームメモリ34に書き込む。
デブロックフィルタ38は、画像データS30のブロック歪みを除去した画像データを、フレームメモリ34に出力する。
The image data stored in the buffer 28 is transmitted after being modulated or the like.
The inverse quantization circuit 29 generates a signal obtained by inversely quantizing the image data S26 of the motion compensation block MCB of the reference image data referenced from the other motion compensation block MCB, and outputs the signal to the inverse orthogonal transform circuit 30.
The inverse orthogonal transform circuit 30 writes the image data S30 generated by performing the inverse transform of the orthogonal transform in the orthogonal transform circuit 25 to the data input from the inverse quantization circuit 29, and writes the image data S30 to the frame memory 34 via the deblock filter 38.
The deblock filter 38 outputs the image data from which the block distortion of the image data S30 is removed to the frame memory 34.

レート制御回路32は、例えば、画面並べ替え回路23から入力したフレームデータS23を基に、画像中の複雑度が高い部分は細かく量子化し、画像中の複雑度が低い部分は粗く量子化するように量子化パラメータQpを生成する。
そして、レート制御回路32は、上記生成した量子化パラメータQp、並びにバッファ28から読み出した画像データを基に量子化スケールを生成し、これを量子化回路26に出力する。
また、レート制御回路32は、上記生成した量子化パラメータQpを、動き予測・補償回路39に出力する。
For example, the rate control circuit 32 finely quantizes a portion with high complexity in the image and coarsely quantizes a portion with low complexity in the image based on the frame data S23 input from the screen rearrangement circuit 23. The quantization parameter Qp is generated.
Then, the rate control circuit 32 generates a quantization scale based on the generated quantization parameter Qp and the image data read from the buffer 28, and outputs this to the quantization circuit 26.
Further, the rate control circuit 32 outputs the generated quantization parameter Qp to the motion prediction / compensation circuit 39.

動き予測・補償回路39は、符号化対象のフレームデータS23およびフレームメモリ34からの参照画像データREFを基に、参照画像データ内の探索範囲SRを探索して、動き予測・補償処理を行って動き補償ブロックMCBを単位として、動きベクトルMVを算出する。   The motion prediction / compensation circuit 39 searches the search range SR in the reference image data based on the frame data S23 to be encoded and the reference image data REF from the frame memory 34, and performs motion prediction / compensation processing. A motion vector MV is calculated using the motion compensation block MCB as a unit.

この際、動き予測・補償回路39は、Iピクチャ、Pピクチャ、Bピクチャを符号化する。ここでIピクチャは、当該Iピクチャの情報だけから符号化し、フレーム間予測(インター予測符号化)を行わない画像データを示す。
Pピクチャは、表示順が前(過去)のIピクチャまたはPピクチャを基に予測を行って符号化される画像データを示す。
Bピクチャは、表示順が前(過去)および後(未来)のIピクチャおよびPピクチャを基に双方向予測によって符号化される画像データを示す。
At this time, the motion prediction / compensation circuit 39 encodes an I picture, a P picture, and a B picture. Here, the I picture indicates image data that is encoded only from the information of the I picture and does not perform inter-frame prediction (inter prediction encoding).
The P picture indicates image data that is encoded by performing prediction based on the previous (previous) I picture or P picture.
The B picture indicates image data encoded by bi-directional prediction based on an I picture and a P picture whose display order is the previous (past) and subsequent (future).

動き予測ブロック(マクロブロックMB)のブロックサイズには、16×16,8×16,16×8,8×8画素のサイズが規定され、また、8×8,4×8,8×4,および4×4画素のサイズが規定される。
動き予測・補償回路39は、フレームデータS23内の処理対象の動き補償ブロックMCBとの差異が最も小さい動き補償ブロックMCBの位置を参照画像データREFの探索範囲SR内で特定し、これらの位置関係に対応した動きベクトルMVを算出する。
また、動き予測・補償回路39は、上記選択した動きベクトルMVを基に、動き補償ブロックMCBについての予測画像データPIを生成する。
動き予測・補償回路39は、上記選択した動きベクトルMVを符号化回路27に出力し、上記生成した予測画像データPIを演算回路24に出力する。
As the block size of the motion prediction block (macroblock MB), sizes of 16 × 16, 8 × 16, 16 × 8, and 8 × 8 pixels are defined, and 8 × 8, 4 × 8, 8 × 4, and so on. And a size of 4 × 4 pixels is defined.
The motion prediction / compensation circuit 39 specifies the position of the motion compensation block MCB having the smallest difference from the motion compensation block MCB to be processed in the frame data S23 within the search range SR of the reference image data REF, and the positional relationship between these positions. The motion vector MV corresponding to is calculated.
Further, the motion prediction / compensation circuit 39 generates predicted image data PI for the motion compensation block MCB based on the selected motion vector MV.
The motion prediction / compensation circuit 39 outputs the selected motion vector MV to the encoding circuit 27, and outputs the generated predicted image data PI to the arithmetic circuit 24.

以下、符号化回路27の符号化処理について詳細に説明する。
JVT方式の符号化処理では、文脈エレメント(SE:Syntax Element )の符号化方法として、CAVLCとCABACの2種類が規定されている。CABACは、一般的にCAVLCと比べてSEを高効率に圧縮する。本実施形態に係る符号化回路27は、CABACにより符号化処理を行う。
Hereinafter, the encoding process of the encoding circuit 27 will be described in detail.
In the JVT encoding process, two types of CAVLC and CABAC are defined as encoding methods of a context element (SE). CABAC generally compresses SE more efficiently than CAVLC. The encoding circuit 27 according to the present embodiment performs encoding processing by CABAC.

JVTで規定するCABACでは、SEをVLCや固定長符号によりシンボル列に変換する。ここで変換されたシンボル列の各シンボルをbin (binary symbol )という。
符号化処理では、bin を入力として、算術符号化処理(AC:Arithmetic Coding )を行い、処理結果を基に出力ビットが決定されビットストリームに出力される。
In CABAC defined by JVT, SE is converted into a symbol string by VLC or fixed length code. Each symbol of the converted symbol string is called bin (binary symbol).
In the encoding process, bin is input and arithmetic encoding (AC) is performed. Based on the processing result, output bits are determined and output to the bit stream.

図3は、算術符号化処理を説明するための図である。
算術符号化処理は、例えば符号化対象のデータ列、例えばシンボルや2値(0および1)の系列を出現確率に応じて、区間[0,1]に射影し、数直線上の確率空間を区間内の数でバイナリ表現して符号化する。
例えば算術符号化処理は、図3に示すように、0.00…以上、1.00…未満の区間を、符号化対象のデータ内の個々のデータの出現確率を基に区間を分割し、個々のデータを基に分割した区間を選択する再帰的処理を行い、符号化対象のデータに対応する区間を示すデータを符号とする。
FIG. 3 is a diagram for explaining the arithmetic encoding process.
Arithmetic encoding processing, for example, projects a data sequence to be encoded, for example, a symbol or binary (0 and 1) series to an interval [0, 1] according to the appearance probability, and creates a probability space on the number line. Encode the binary representation with the number in the interval.
For example, in the arithmetic encoding process, as shown in FIG. 3, a section of 0.00... Or more and less than 1.00... Is divided based on the appearance probability of individual data in the encoding target data. A recursive process of selecting a section divided based on individual data is performed, and data indicating a section corresponding to the data to be encoded is used as a code.

以下、説明を簡単とするため符号化対象のデータを2値とする。
算術符号化処理は、具体的には図3(A)に示すように、符号化対象のデータの内、出現確率が大きいデータをMPS(Most Probable Symbol)、出現確率が小さいデータをLPS(Least Probable Symbol )とし、それぞれの出現確率pMPS、pLPSに応じて所定の区間Aを分割する。この際、現区間のサイズをレンジRange 、現区間の境界値、例えば下限値をLow とする。また、出現確率pMPSは、1−pLPSである。
Hereinafter, in order to simplify the description, the data to be encoded is binary.
Specifically, as shown in FIG. 3A, the arithmetic coding process is performed by using MPS (Most Probable Symbol) for data with a high appearance probability and LPS (Least for data with a low appearance probability). Probable Symbol), and a predetermined section A is divided according to the appearance probabilities pMPS and pLPS. At this time, the size of the current section is set to Range, and the boundary value of the current section, for example, the lower limit value is set to Low. The appearance probability pMPS is 1-pLPS.

初期状態では、図3(A)に示すように、レンジRange ,ロウLow の値は、A,0.00…である。
符号化対象のデータ列の最初のデータがMPSの場合には、図3(A)に示すように、区間Aを出現確率pMPS,pLPSに応じて分割し、分割された区間の内、図3(B)に示すようにMPSに対応する区間を選択する。このときのレンジRange ,ロウLow の値は、p0(=pMPS),0.00…である。
In the initial state, as shown in FIG. 3A, the values of the range Range and low Low are A, 0.00.
When the first data of the data string to be encoded is MPS, as shown in FIG. 3A, the section A is divided according to the appearance probabilities pMPS and pLPS, and among the divided sections, FIG. As shown in (B), the section corresponding to MPS is selected. The values of Range Range and Low Low at this time are p0 (= pMPS), 0.00.

次に、符号化対象のデータ列の内の2番目のデータがMPSの場合には、図3(B)に示すように、区間を出現確率pMPS,pLPSに応じて分割し、分割された区間の内、図3(C)に示すようにMPSに対応する区間を選択する。このときのレンジRange ,ロウLow の値は、p00(=p0×pMPS),0.00…である。   Next, when the second data in the data string to be encoded is MPS, the section is divided according to the appearance probabilities pMPS and pLPS as shown in FIG. Of these, the section corresponding to the MPS is selected as shown in FIG. The values of the range Range and low Low at this time are p00 (= p0 × pMPS), 0.00.

次に、符号化対象のデータ列の内の3番目のデータがLPSの場合には、図3(C)に示すように、区間を出現確率pMPS,pLPSに応じて分割し、分割された区間の内、図3(D)に示すようにLPSに対応する区間を選択する。このときのレンジRange ,ロウLow の値は、p001(=p00×pLPS),p001(Low +pMPS)である。
つまり、上述した符号化処理においてLPSの場合には、下限値Low の値にpMPSが加算されて、下限値Low が更新される。
Next, when the third data in the data string to be encoded is LPS, the section is divided according to the appearance probabilities pMPS and pLPS as shown in FIG. Of these, the section corresponding to LPS is selected as shown in FIG. The values of Range Range and Low Low at this time are p001 (= p00 × pLPS) and p001 (Low + pMPS).
That is, in the case of LPS in the above-described encoding process, pMPS is added to the value of the lower limit value Low, and the lower limit value Low is updated.

また、符号化対象のデータ列のビット長が大きくなるに従いレンジRange が小さくなり、レンジRange を示すデータのビット数も多くなる。このため符号化処理の結果、確定したビットを出力することで、メモリの容量を削減する。   Further, as the bit length of the data string to be encoded increases, the range Range decreases and the number of bits of data indicating the range Range also increases. For this reason, the capacity of the memory is reduced by outputting determined bits as a result of the encoding process.

また、計算精度を保つために、図3(E)に示すように、レンジRange が所定値よりも大きくなるように拡大する正規化処理(リノーマライズ)を行う。例えば正規化処理は、レンジRange の値を2倍して、所定値よりも大きくなるように拡大する。   Further, in order to maintain the calculation accuracy, as shown in FIG. 3E, normalization processing (renormalization) for expanding the range Range so as to be larger than a predetermined value is performed. For example, in the normalization process, the value of the range Range is doubled and expanded so as to be larger than a predetermined value.

図4は、符号化処理における正規化処理を説明するための図である。
例えば、上述したように、符号化対象のデータ列を1ビット単位で符号化処理を行う毎に、図4に示すような正規化処理を行う。
具体的には、まず、レンジRange が予め設定された所定値よりも小さいか否が判別され(ST1)、所定値よりも小さい場合には、下限値Low の値の上位1ビットに応じた符号を出力した後(ST2)、レンジRange と下限値Low の値を左シフト演算することで2倍に拡大し(ST3,ST4)し、ステップST1の処理に戻る。
そして、ステップST1からST4の動作をレンジRange の値が所定値以上になるまで繰り返す。
一方、ステップST1において、レンジRange の値が所定値以上の場合には、正規化処理を終了する。
FIG. 4 is a diagram for explaining the normalization process in the encoding process.
For example, as described above, every time a data string to be encoded is encoded in units of 1 bit, the normalization process as shown in FIG. 4 is performed.
Specifically, first, it is determined whether or not the range Range is smaller than a predetermined value (ST1). If the range is smaller than the predetermined value, a code corresponding to the upper 1 bit of the value of the lower limit value Low is determined. Is output (ST2), the range Range and the lower limit value Low are left-shifted to perform double expansion (ST3, ST4), and the process returns to step ST1.
Then, the operations of steps ST1 to ST4 are repeated until the value of the range Range becomes a predetermined value or more.
On the other hand, if the value of the range Range is greater than or equal to a predetermined value in step ST1, the normalization process is terminated.

図5は、図2に示した符号化回路の機能ブロック図である。
符号化回路27は、例えば図5に示すように、2値化部(BINR)271、コンテクスト(CTX)272、更新部(UPDT)273、算術符号化部274、付加部275、および予測部276を有する。
算術符号化部274は本発明に係る算術符号化手段に相当し、付加部275は本発明に係る付加手段に相当し、予測部276は、本発明に係る予測手段に相当する。
FIG. 5 is a functional block diagram of the encoding circuit shown in FIG.
For example, as illustrated in FIG. 5, the encoding circuit 27 includes a binarization unit (BINR) 271, a context (CTX) 272, an update unit (UPDT) 273, an arithmetic encoding unit 274, an addition unit 275, and a prediction unit 276. Have
The arithmetic encoding unit 274 corresponds to the arithmetic encoding unit according to the present invention, the adding unit 275 corresponds to the adding unit according to the present invention, and the prediction unit 276 corresponds to the predicting unit according to the present invention.

2値化部(BINR)271は、2値化処理、例えば量子化回路26や動き予測・補償回路39から入力されたSEを、VLCや固定長符号によりシンボルbin (binary symbol )の列(バイナリデータ)に変換し、信号S271として出力する。
具体的には、2値化部271は、入力されたデータが、非バイナリ値(Non Binary Value)、例えば動きベクトル(Motion vector )やtransform coeff 等の場合には、バイナリデータに変換する。
A binarization unit (BINR) 271 performs binarization processing, for example, an SE input from the quantization circuit 26 or the motion prediction / compensation circuit 39 by using a VLC or a fixed-length code as a string (binary symbol) string (binary symbol). Data) and output as a signal S271.
Specifically, the binarization unit 271 converts the input data into binary data when the input data is a non-binary value (Non Binary Value), for example, a motion vector or a motion coeff.

コンテクスト(CTX)272は、例えば算術符号化部274で符号化されたデータの統計値によって更新され、算術符号化部274による算術符号化処理の際に参照されるデータである。
コンテクスト272には、例えば遷移状態を示すインデックスと、MPSの出現確率pMPSとが関連付けられて記憶されている。コンテクスト272のインデックスは、例えば算術符号化部274の処理結果を示す信号S274に基づいて、更新部273により更新される。
具体的には、更新部273は、例えば信号S274を基に符号化した値が1の場合には、1の出現確率が増えるようにコンテクスト272のインデックスを更新し、例えば符号化した値が0の場合には、0の出現確率が増えるようにインデックスを更新する。
こうすることにより、CTX273のインデックスは、入力されるSEに依存した出現確率に近づいていく。
The context (CTX) 272 is data that is updated with, for example, a statistical value of data encoded by the arithmetic encoding unit 274 and is referred to during arithmetic encoding processing by the arithmetic encoding unit 274.
In the context 272, for example, an index indicating a transition state and an MPS appearance probability pMPS are stored in association with each other. The index of the context 272 is updated by the updating unit 273 based on the signal S274 indicating the processing result of the arithmetic coding unit 274, for example.
Specifically, for example, when the value encoded based on the signal S274 is 1, the update unit 273 updates the index of the context 272 so that the appearance probability of 1 increases, and for example, the encoded value is 0. In this case, the index is updated so that the appearance probability of 0 increases.
By doing so, the index of CTX 273 approaches the appearance probability depending on the input SE.

図6は、画像データにおいてピクチャ、スライス、マクロブロックを説明するための図である。図6(a)は、画像データ内の1ピクチャが、横方向に複数のスライスにより構成されていることを示す図であり、図6(b)は、1スライスがマクロブロックにより構成されていることを示す図である。   FIG. 6 is a diagram for explaining pictures, slices, and macroblocks in image data. FIG. 6A shows that one picture in the image data is composed of a plurality of slices in the horizontal direction, and FIG. 6B shows that one slice is composed of macro blocks. FIG.

算術符号化部274は、例えば、画像データをブロック単位、例えば図6(b)に示すように、マクロブロック単位で算術符号化処理を行い、処理結果の符号化データを信号S274として出力する。
例えば、算術符号化部274は、コンテクスト272の確率を示すインデックスに基づいて、入力されたデータを算術符号化処理を行う。本実施形態では算術符号化部274は、例えば図3に示すような算術符号化処理を行う。
マクロブロックは本発明に係る第1のブロック単位に相当し、1スライスや1ピクチャは本発明に係る第2のブロック単位に相当する。
For example, the arithmetic coding unit 274 performs arithmetic coding processing on the image data on a block basis, for example, on a macroblock basis, for example, as shown in FIG. 6B, and outputs the encoded data of the processing result as a signal S274.
For example, the arithmetic encoding unit 274 performs arithmetic encoding processing on the input data based on an index indicating the probability of the context 272. In the present embodiment, the arithmetic encoding unit 274 performs an arithmetic encoding process as shown in FIG. 3, for example.
A macro block corresponds to a first block unit according to the present invention, and one slice or one picture corresponds to a second block unit according to the present invention.

付加部275は、算術符号化部274から出力された符号化データとしての信号S274を、算術符号化部274の算術符号化処理によるブロック単位よりも大きい所定単位、例えば1スライスでの画像データの圧縮の度合いを示す指標データに応じた付加データを付加する。付加データは、CabacZeroWordに相当する。
この付加データは、算術符号化部274による符号化処理の結果、圧縮率が高い符号化データを生成した際に、デコーダがその圧縮率の高い符号化データをデコード処理すると、その符号化データを所定時間内に処理しきれない場合があるので、例えば図6(a)に示すように、1画像の内の複数のスライス(Slice )それぞれの最後に付加される。
付加部275は、例えば付加データとして、0x000003を1単位としたスタッフィングバイト(StuffingByte)を付加することで、デコーダの負荷を軽減する。
The adding unit 275 outputs the signal S274 as encoded data output from the arithmetic encoding unit 274 to a predetermined unit larger than the block unit obtained by the arithmetic encoding process of the arithmetic encoding unit 274, for example, image data in one slice. Additional data corresponding to the index data indicating the degree of compression is added. Additional data corresponds to CabacZeroWord.
As a result of the encoding process performed by the arithmetic encoding unit 274, the additional data is generated when the decoder decodes the encoded data having a high compression rate when the encoded data having a high compression rate is generated. Since processing may not be completed within a predetermined time, for example, as shown in FIG. 6 (a), it is added to the end of each of a plurality of slices (Slice) in one image.
The adding unit 275 reduces the load on the decoder by adding a stuffing byte (Stuffing Byte) having 0x000003 as one unit, for example, as additional data.

具体的には、付加部275は、数式(1)に示すように指標データKを算出し、指標データKが正の場合には、1スライスの最後に、(K×3)バイト分のビットを付加データとして、算術符号化部274から出力された符号化データに付加する。   Specifically, the adding unit 275 calculates the index data K as shown in Equation (1), and when the index data K is positive, the bit for (K × 3) bytes is added at the end of one slice. Is added to the encoded data output from the arithmetic encoding unit 274 as additional data.

〔数1〕
K=Ceil((Ceil((3×BinCountsInNALUnits−3×96×PicSizeInMbs)/32)−NumBytesInVclNALUnits)/3)…(1)
[Equation 1]
K = Ceil ((Ceil ((3 × BinCountsInNALUnits−3 × 96 × PicSizeInMbs) / 32) −NumBytesInVclNALUnits) / 3) (1)

数式(1)において、BinCountsInNALUnits は、算術符号化部274による算術符号化処理の前のデータであり、例えば2値化部271により出力されたデータの所定単位、例えば1ピクチャでのデータ長である。
NumBytesInVclNALUnits は、算術符号化部274により算術符号化処理されたデータの所定単位、例えば1ピクチャでのデータ長である。
PicSizeInMbsは、所定単位、例えば1ピクチャ内のマクロブロック数である。本実施形態では固定値である。
また、Ceil(A)は、値Aよりも大きい最小の整数値を示す。
In Equation (1), BinCountsInNALUnits is data before arithmetic coding processing by the arithmetic coding unit 274, and is, for example, a predetermined unit of data output by the binarizing unit 271, for example, a data length in one picture. .
NumBytesInVclNALUnits is a predetermined unit of data subjected to arithmetic coding processing by the arithmetic coding unit 274, for example, a data length in one picture.
PicSizeInMbs is the number of macroblocks in a predetermined unit, for example, one picture. In this embodiment, it is a fixed value.
Ceil (A) indicates a minimum integer value larger than the value A.

1スライスの最後に付加する付加データのデータ長は、コンテクスト272、算術符号化部274、および更新部273により、入力されるデータに応じて確率モデルを更新しながら符号化処理を行うので、1スライス分のデータを符号化処理するまで不確定である。このため付加部275が付加する付加データのデータ長も不確定である。
例えば一般的なレート制御回路では、算術符号化部274が生成した符号化データと付加データとに基づいて、量子化レートを制御するので、制御できない場合がある。
The data length of the additional data added at the end of one slice is 1 because the context 272, the arithmetic encoding unit 274, and the updating unit 273 perform the encoding process while updating the probability model according to the input data. It is indeterminate until the data for the slice is encoded. For this reason, the data length of the additional data added by the adding unit 275 is also uncertain.
For example, in a general rate control circuit, the quantization rate is controlled based on the encoded data generated by the arithmetic encoding unit 274 and the additional data.

本発明では、後述する予測部276を設けることにより、1スライスよりも小さい単位、例えばマクロブロック単位で付加データを予測する。以下、詳細に説明する。   In the present invention, by providing a prediction unit 276, which will be described later, the additional data is predicted in units smaller than one slice, for example, macroblock units. Details will be described below.

予測部276は、ブロック単位で、例えばマクロブロック単位で算術符号化部274による算術符号化処理の対象のデータのデータ長、および、算術符号化部274が生成した符号化データのデータ長に基づいて、付加部275が付加する所定単位での指標データに応じた付加データを予測する。   The prediction unit 276 is based on the data length of the data to be subjected to the arithmetic coding processing by the arithmetic coding unit 274 and the data length of the encoded data generated by the arithmetic coding unit 274 in block units, for example, in macroblock units. Thus, the additional data corresponding to the index data in a predetermined unit added by the adding unit 275 is predicted.

詳細には、予測部276は、算術符号化部274がマクロブロック単位で、1スライス分のデータを符号化処理する途中で、算術符号化部274が算術符号化処理を行う前の処理対象のデータ、つまり2値化部271が生成したデータのデータ長と、算術符号化部274による算術符号化処理後のデータに基づいて所定単位、例えば1ピクチャー分の付加データを予測する。   Specifically, the prediction unit 276 is a processing target before the arithmetic coding unit 274 performs arithmetic coding processing while the arithmetic coding unit 274 performs coding processing of data for one slice in units of macroblocks. Based on the data, that is, the data length of the data generated by the binarization unit 271 and the data after the arithmetic encoding process by the arithmetic encoding unit 274, additional data for a predetermined unit, for example, one picture is predicted.

レート制御回路32は、ブロック単位、例えばマクロブロック単位で予測部276が予測した付加データに基づいて、量子化回路26の量子化の度合いを示すデータ、詳細には量子化レートを設定する。
また、レート制御回路32は、ブロック単位よりも大きい単位、例えば1スライス単位で符号化データに、付加部275が生成した付加データを付加したデータのデータ長に基づいて、量子化回路26の量子化の度合いを示すデータ、詳細には量子化レートを設定する。
量子化回路26は、設定された量子化レートに応じた量子化処理を行う。
The rate control circuit 32 sets data indicating the degree of quantization of the quantization circuit 26, specifically, a quantization rate, based on the additional data predicted by the prediction unit 276 in block units, for example, macroblock units.
Further, the rate control circuit 32 determines the quantum of the quantization circuit 26 based on the data length of the data obtained by adding the additional data generated by the adding unit 275 to the encoded data in a unit larger than the block unit, for example, one slice unit. Data indicating the degree of quantization, more specifically, a quantization rate is set.
The quantization circuit 26 performs a quantization process according to the set quantization rate.

図7は、図2に示した符号化回路27の動作を説明するためのフローチャートである。図7を参照しながら符号化回路27の動作を中心に説明する。
ステップST1において、2値化部271は、2値化処理、例えば量子化回路26や動き予測・補償回路39から入力されたSEを、VLCや固定長符号によりシンボルbin (binary symbol )の列(バイナリデータ)に変換し、信号S271として出力する。
FIG. 7 is a flowchart for explaining the operation of the encoding circuit 27 shown in FIG. The operation of the encoding circuit 27 will be mainly described with reference to FIG.
In step ST1, the binarization unit 271 converts the SE input from the binarization process, for example, the quantization circuit 26 or the motion prediction / compensation circuit 39, into a sequence of symbols bin (binary symbol) using VLC or a fixed-length code ( Binary data) and output as a signal S271.

ステップST2において、信号S271がコンテクスト272に入力され、算術符号化部274は、コンテクスト272により設定された確率モデルに応じて算術符号化処理を行い符号化データS274を生成する。更新部273は信号S274に応じてコンテクスト272を更新する。   In step ST2, the signal S271 is input to the context 272, and the arithmetic encoding unit 274 performs arithmetic encoding processing according to the probability model set by the context 272 to generate encoded data S274. The updating unit 273 updates the context 272 according to the signal S274.

ステップST3において、予測部276は、ブロック単位で、例えばマクロブロック単位で、算術符号化部274の処理の対象のデータのデータ長、および、算術符号化部274が生成した符号化データS274のデータ長に基づいて、付加部275が符号化データS274に付加する、算術符号化処理によるブロック単位よりも大きい所定単位で、例えば1ピクチャ単位での画像データの圧縮の度合いを示す指標データKに応じた付加データを予測する。   In step ST3, the prediction unit 276, in units of blocks, for example, in units of macroblocks, the data length of data to be processed by the arithmetic encoding unit 274, and the data of the encoded data S274 generated by the arithmetic encoding unit 274 Depending on the index data K indicating the degree of compression of image data in units of one picture, for example, in a predetermined unit larger than the block unit by arithmetic coding processing, which is added to the encoded data S274 by the addition unit 275 based on the length Predict additional data.

ステップST4において、現在処理したカレントマクロブロックCurrentMB が、1スライスの途中であるか否かが判別される。具体的には、例えば現在処理したカレントマクロブロックCurrentMB が1スライス中のマクロブロック数より小さいか否かが判別される。
現在処理したカレントマクロブロックCurrentMB が、1スライスの途中ではないと判別した場合、具体的には、現在処理したカレントマクロブロックCurrentMB が1スライス中のマクロブロック数より小さくないと判別した場合には、つまり、1スライス分のデータを算術符号化部274が処理した場合には、付加部275が1スライス分の算術符号化処理の前後のデータ長に基づいて数式(1)に示すように指標データKを算出し、指標データKに応じた付加データを、1スライス分の符号化データに付加する。
レート制御回路32は、ブロック単位よりも大きい単位、例えば1スライス単位で符号化データに、付加部275が生成した付加データを付加したデータのデータ長に基づいて、量子化回路26の量子化の度合いを示すデータ、詳細には量子化レートを設定する。
量子化回路26は、その量子化レートに応じた量子化処理を行う。
In step ST4, it is determined whether or not the currently processed current macroblock CurrentMB is in the middle of one slice. Specifically, for example, it is determined whether or not the currently processed current macroblock CurrentMB is smaller than the number of macroblocks in one slice.
When it is determined that the current macroblock CurrentMB processed at present is not in the middle of one slice, specifically, when it is determined that the current macroblock CurrentMB processed at present is not smaller than the number of macroblocks in one slice, That is, when the arithmetic coding unit 274 processes the data for one slice, the adding unit 275 uses the index data as shown in Equation (1) based on the data length before and after the arithmetic coding processing for one slice. K is calculated, and additional data corresponding to the index data K is added to the encoded data for one slice.
The rate control circuit 32 performs quantization of the quantization circuit 26 based on the data length of the data obtained by adding the additional data generated by the adding unit 275 to the encoded data in a unit larger than the block unit, for example, one slice unit. Data indicating the degree, specifically, a quantization rate is set.
The quantization circuit 26 performs a quantization process according to the quantization rate.

一方、ステップST4において、現在処理したカレントマクロブロックCurrentMB が、1スライスの途中であると判別した場合、具体的には、例えば現在処理したカレントマクロブロックCurrentMB が1スライス中のマクロブロック数より小さいと判別した場合には、レート制御回路32は、ブロック単位、例えばマクロブロック単位で予測部276が予測した付加データに基づいて、量子化回路26の量子化の度合いを示すデータ、詳細には量子化レートを設定する(ST5)。また、量子化回路26は、設定された量子化レートに応じた量子化処理を行う。   On the other hand, when it is determined in step ST4 that the currently processed current macroblock CurrentMB is in the middle of one slice, specifically, for example, if the currently processed current macroblock CurrentMB is smaller than the number of macroblocks in one slice. If it is determined, the rate control circuit 32 determines the quantization level of the quantization circuit 26 based on the additional data predicted by the prediction unit 276 on a block basis, for example, on a macroblock basis. A rate is set (ST5). In addition, the quantization circuit 26 performs a quantization process according to the set quantization rate.

図8は、図5に示した算術符号化部274の動作の一具体例を示すフローチャートである。次に、図8を参照しながら、算術符号化部274の動作の一具体例を説明する。
具体的には、算術符号化部274は、指定されたコンテクスト272のインデックスctxIdxと、エンコードするシンボルbinValを入力として、符号化処理を行う。
例えば図3に示した、codIRange ,codILow は、出現確率幅(レンジRange ),下限値Low を表す。コンテクストCTX272は、インデックスctxIdxによって管理され、各コンテクストにはMPS値と遷移状態番号を示すvalMPS,pStateIdx が割り当てられる。
FIG. 8 is a flowchart showing a specific example of the operation of the arithmetic encoding unit 274 shown in FIG. Next, a specific example of the operation of the arithmetic encoding unit 274 will be described with reference to FIG.
Specifically, the arithmetic encoding unit 274 performs an encoding process with the index ctxIdx of the designated context 272 and the symbol binVal to be encoded as inputs.
For example, codIRange and codILow shown in FIG. 3 represent an appearance probability width (range Range) and a lower limit value Low. The context CTX 272 is managed by an index ctxIdx, and valMPS and pStateIdx indicating an MPS value and a transition state number are assigned to each context.

ステップST101において、算術符号化部274は、codIRange の値をqCodIRangeIdx という値に量子化し、規定されたテーブル値rangeTabLPS を使って、LPS の確率幅 codIRangeLPS を求める。また、codIRange をMPS の確率幅に変更する。   In step ST101, the arithmetic encoding unit 274 quantizes the value of codIRange into a value qCodIRangeIdx, and obtains the LPS probability width codIRangeLPS using the specified table value rangeTabLPS. Also change codIRange to the MPS probability range.

ステップST102において、算術符号化部274は、入力シンボルbin がMPS か否かで処理を分岐する。シンボルがMPS の時は、規格で規定しているテーブル値transIdxMPS によって状態を遷移させ、pStateIdxを更新する(ST103)。   In step ST102, the arithmetic encoding unit 274 branches the process depending on whether or not the input symbol bin is MPS. When the symbol is MPS, the state is changed by the table value transIdxMPS defined in the standard, and pStateIdx is updated (ST103).

一方,ステップST102において、入力シンボルbin がLPS のときは、codILow値、codIRange 値を更新する。
具体的には、codILowとcodIRangeを加算した値をcodILowに代入し、codIRangeにcodIRangeLPSを代入する(ST104)。
ステップST105において、pStateIdx が0でないか否が判別され、pStateIdx が0の場合にはvalMPSに1−valMPSを代入し(ST106)、ステップST107の処理に進む。ステップST105においてpStateIdx が0でない場合にもステップST107の処理に進む。
ステップST107において、pStateIdx を更新する。
ステップST108において、算術符号化部274は、後述する正規化処理を行う。
On the other hand, in step ST102, when the input symbol bin is LPS, the codILow value and the codIRange value are updated.
Specifically, a value obtained by adding codILow and codIRange is substituted into codILow, and codIRangeLPS is substituted into codIRange (ST104).
In step ST105, it is determined whether or not pStateIdx is 0. If pStateIdx is 0, 1-valMPS is substituted for valMPS (ST106), and the process proceeds to step ST107. Even when pStateIdx is not 0 in step ST105, the process proceeds to step ST107.
In step ST107, pStateIdx is updated.
In step ST108, the arithmetic encoding unit 274 performs a normalization process described later.

図9は、図8に示した正規化処理の一具体例を説明するためのフローチャートである。算術符号化部274は、図8に示したステップST108の正規化処理を以下に示すように処理を行う。
ステップST111に示すように、算術符号化部274は、codIRange の値が所定値、例えば0x100よりも小さいか否かを判別し、codIRange の値が所定値、例えば0x100よりも小さくないと判別した場合には、正規化処理を行わない。
FIG. 9 is a flowchart for explaining a specific example of the normalization process shown in FIG. The arithmetic coding unit 274 performs the normalization process in step ST108 shown in FIG. 8 as follows.
As shown in step ST111, the arithmetic encoding unit 274 determines whether or not the value of codIRange is smaller than a predetermined value, for example, 0x100, and determines that the value of codIRange is not smaller than a predetermined value, for example, 0x100 Does not perform normalization processing.

一方、ステップST111において、codIRange の値が所定値、例えば0x100よりも小さいと判別した場合には、算術符号化部274は、codILowの値が所定値、例えば0x100よりも小さいか否かを判別する(ST112)。
codILowの値が所定値、例えば0x100よりも小さいと判別した場合には、算術符号化部274は、後述する符号化データを出力するための処理PutBit(0)を行い(ST113)、codIRange 値を1/2倍し、codILow値を1/2倍する。詳細には、codIRange 値およびcodILow値を1ビット分左シフト演算を行うことで、それぞれの値を1/2倍し(ST114)、ステップST111の処理に戻る。
On the other hand, if it is determined in step ST111 that the value of codIRange is smaller than a predetermined value, for example, 0x100, the arithmetic encoding unit 274 determines whether the value of codILow is smaller than a predetermined value, for example, 0x100. (ST112).
When it is determined that the value of codILow is smaller than a predetermined value, for example, 0x100, the arithmetic encoding unit 274 performs a process PutBit (0) for outputting encoded data, which will be described later (ST113), and sets the codIRange value. Multiply by 1/2 and codILow value by 1/2. Specifically, the codIRange value and the codILow value are left-shifted by 1 bit to double each value (ST114), and the process returns to step ST111.

一方、ステップST112において、codIRange の値が所定値、例えば0x100よりも小さくないと判別した場合には、算術符号化部274は、codILowの値が所定値、例えば0x200以上であるか否かを判別する(ST115)。codILowの値が所定値、例えば0x200以上でないと判別した場合には、codILow値から所定値、例えば0x100を減算し、bitsOutstandingの値に1を加算し(ST116)、ステップST114の処理に進む。
このbitsOutstandingは、正規化処理の際にキャリーオーバ防止のために設けられたデータであり、bitsOutstandingのデータは、所定単位の符号化処理が終了した時点で0にリセットされる。
On the other hand, when it is determined in step ST112 that the value of codIRange is not smaller than a predetermined value, for example, 0x100, the arithmetic encoding unit 274 determines whether the value of codILow is a predetermined value, for example, 0x200 or more. (ST115). When it is determined that the value of codILow is not a predetermined value, for example, 0x200 or more, a predetermined value, for example, 0x100 is subtracted from the codILow value, 1 is added to the value of bitsOutstanding (ST116), and the process proceeds to step ST114.
The bitsOutstanding is data provided to prevent carryover during the normalization process, and the bitsOutstanding data is reset to 0 when the encoding process of a predetermined unit is completed.

一方、ステップST115の判別において、codILowの値が所定値、例えば0x200以上であると判別した場合には、codILow値から所定値、例えば0x200を減算し(ST117)、後述する符号化データを出力するための処理PutBit(1)を行い(ST118)、ステップST114の処理に進む。   On the other hand, if it is determined in step ST115 that the value of codILow is a predetermined value, for example, 0x200 or more, a predetermined value, for example, 0x200 is subtracted from the codILow value (ST117), and encoded data described later is output. Process BitBit (1) is performed (ST118), and the process proceeds to step ST114.

図10は、図9に示した符号化処理のPutBit(B)の処理を説明するためのフローチャートである。図10を参照しながら、算術符号化処理のステップST113,ST118におけるPutBit(B)の動作を説明する。
算術符号化部274は、符号化データを出力する際に、最初のビットであるか否かを判別する。この判断には例えば最初のビットを示すfirstbitFlagが用いられる。firstbitFlagが0以外の場合には、最初のビットであることを示し、firstbitFlagが0の場合には、最初のビット以外であることを示す。
詳細には、算術符号化部274は、ステップST210において、firstbitFlagが0以外の場合には、firstbitFlagに0を代入して最初のビットを出力しない。
一方、ステップST210において、算術符号化部274は、firstbitFlagが0の場合には、WriteBits(B,1)の処理を行う。ここでWriteBits(B,1)は、1ビット長の値Bを出力する処理である。
FIG. 10 is a flowchart for explaining the process of PutBit (B) in the encoding process shown in FIG. The operation of PutBit (B) in steps ST113 and ST118 of the arithmetic coding process will be described with reference to FIG.
The arithmetic encoding unit 274 determines whether or not it is the first bit when outputting encoded data. For this determination, for example, firstbitFlag indicating the first bit is used. When firstbitFlag is other than 0, it indicates that it is the first bit, and when firstbitFlag is 0, it indicates that it is other than the first bit.
Specifically, when the firstbitFlag is other than 0 in step ST210, the arithmetic encoding unit 274 assigns 0 to the firstbitFlag and does not output the first bit.
On the other hand, in step ST210, when the firstbitFlag is 0, the arithmetic encoding unit 274 performs WriteBits (B, 1) processing. Here, WriteBits (B, 1) is a process of outputting a value B having a 1-bit length.

ステップST213において、算術符号化部274は、bitsOutstandingが0より大きいか否かを判別し、0よりも大きいと判別した場合には、WriteBits(1-B,1)の処理を行い(ST214)、bitsOutstandingから1減算しステップST213の処理に戻る。ここでWriteBits(1-B,1)の処理は、1ビット長のBの補数を出力する処理である。   In step ST213, the arithmetic encoding unit 274 determines whether or not bitsOutstanding is greater than 0. If it is determined that the bits Outstanding is greater than 0, the arithmetic coding unit 274 performs WriteBits (1-B, 1) (ST214). 1 is subtracted from bitsOutstanding, and the process returns to step ST213. Here, the process of WriteBits (1-B, 1) is a process of outputting B's complement of 1 bit length.

一方、ステップST213において、算術符号化部274は、bitsOutstandingが0以下であると判別した場合には、一連の処理を中止する。
以上説明した動作を行うことで、算術符号化部274は、キャリーオーバを起こすことなく、符号化処理を行うことができる。
On the other hand, in Step ST213, when the arithmetic encoding unit 274 determines that bitsOutstanding is 0 or less, the arithmetic encoding unit 274 stops a series of processes.
By performing the operation described above, the arithmetic encoding unit 274 can perform the encoding process without causing carryover.

算術符号化部274は、マクロブロック単位で算術符号化処理を行う際に、順に符号化データを出力するのではなく、上述したようにbitsOutstanding を用いて算術符号化処理を行う場合には、bitsOutstanding の値に応じて符号化データが出力する。
このため予測部276は、このbitsOutstanding を考慮して予測を行うことが好ましい。
以下、予測部276の一具体例を詳細に説明する。
The arithmetic encoding unit 274 does not output encoded data in order when performing arithmetic encoding processing in units of macroblocks, but when performing arithmetic encoding processing using bitsOutstanding as described above, bitsOutstanding. The encoded data is output according to the value of.
For this reason, it is preferable that the prediction unit 276 performs prediction in consideration of the bitsOutstanding.
Hereinafter, a specific example of the prediction unit 276 will be described in detail.

予測部276は、例えば1スライスの内で現在処理中のマクロブロックまでに、2値化部271が生成したデータのデータ長、つまり算術符号化部274の処理対象のデータのデータ長BitCounts を計算する。   The prediction unit 276 calculates the data length of the data generated by the binarization unit 271, that is, the data length BitCounts of the data to be processed by the arithmetic encoding unit 274 until, for example, the macroblock currently being processed within one slice. To do.

また、予測部276は、現在処理中のマクロブロックまでに生成された符号化データのデータ長NumBytesを計算する。
具体的には、予測部276は、データ長NumBytesとして、例えば数式(2)に示すように、現在処理中のマクロブロック(CurrentMB とも言う)までに生成した符号化データのデータ長GenBits と、その時点でのbitsOutstanding の値を加算して求める。
Also, the prediction unit 276 calculates the data length NumBytes of the encoded data generated up to the macro block currently being processed.
Specifically, the prediction unit 276, as the data length NumBytes, for example, as shown in Formula (2), the data length GenBits of the encoded data generated up to the currently processed macroblock (also referred to as CurrentMB), Calculate by adding the value of bitsOutstanding at the time.

〔数2〕
NumBytes = (GenBits +bitsOutstanding) / 8 …(2)
[Equation 2]
NumBytes = (GenBits + bitsOutstanding) / 8 (2)

上述したように、bitsOutstanding を加算するのは、正規化処理の際にキャリーオーバを避けるために、bitsOutstanding に本来その時点でバッファに出力されるビット量をカウントしているためである。
数式(2)に示した計算により、予測部276は、より高精度に現在処理中のマクロブロックまでに生成された符号化データのデータ長NumBytesを計算することができる。
As described above, bitsOutstanding is added because bitsOutstanding originally counts the amount of bits output to the buffer at that time in order to avoid carryover during normalization processing.
By the calculation shown in Expression (2), the prediction unit 276 can calculate the data length NumBytes of the encoded data generated up to the macro block currently being processed with higher accuracy.

また、GenBitsには、実際に符号化処理されバッファに出力されたビットであるので、エミュレーションプリベンションバイトを含む。   Since GenBits is a bit that is actually encoded and output to the buffer, it includes an emulation prevention byte.

また、予測部276は、1ピクチャ分のデータを処理中にマクロブロック単位で、例えば数式(3)に示すように、1ピクチャ分の2値化部271による2値化後のデータのデータ長の予測値EstimateBinCountsInNALUnits を、CurrentMBまでの2値化後のデータのデータ長CurrentBinarizationNum と、1ピクチャーのマクロブロック数PicSizeInMbs と、現在処理中のマクロブロックを示すデータMbNoを用いて計算する。   In addition, the prediction unit 276 processes the data for one picture in units of macroblocks, for example, as shown in Equation (3), the data length of the data after binarization by the binarization unit 271 for one picture The estimated value EstimateBinCountsInNALUnits is calculated using the data length CurrentBinarizationNum of the binarized data up to CurrentMB, the number of macroblocks PicSizeInMbs of one picture, and the data MbNo indicating the currently processed macroblock.

〔数3〕
EstimateBinCountsInNALUnits=CurrentBinarizationNum ×(PicSizeInMbs /MbNo)…(3)
[Equation 3]
EstimateBinCountsInNALUnits = CurrentBinarizationNum x (PicSizeInMbs / MbNo) (3)

また、予測部276は、1ピクチャ分のデータを処理中にマクロブロック単位で、例えば数式(4)に示すように、
1ピクチャ分の符号化データのデータ長の予測値EstimateNumByteInVclNALUnitsを、算術符号化部274が1ピクチャ分の算術符号化処理により出力したデータのデータ長GenBitsと、bitsOutstandingの値、および、1ピクチャーのマクロブロック数PicSizeInMbs と、現在処理中のマクロブロックを示すデータMbNoとを用いて計算する。
また、MbNoは現在処理中のマクロブロックであるが、これは1マクロブロック毎に加算されるため、これまでのエンコードしたマクロブロックの総和となる。
Further, the prediction unit 276 processes one picture data in units of macroblocks, for example, as shown in Equation (4),
Data length prediction value EstimateNumByteInVclNALUnits of encoded data for one picture, data length GenBits, bitsOutstanding value of data output by arithmetic encoding unit 274 through arithmetic encoding for one picture, and macro of one picture Calculation is performed using the number of blocks PicSizeInMbs and the data MbNo indicating the currently processed macroblock.
MbNo is a macro block currently being processed. Since this is added for each macro block, it is the sum of the macro blocks encoded so far.

〔数4〕
EstimateNumByteInVclNALUnits=(GenBits +bitsOutstanding)×(PicSizeInMbs /MbNo)/8…(4)
[Equation 4]
EstimateNumByteInVclNALUnits = (GenBits + bitsOutstanding) x (PicSizeInMbs / MbNo) / 8 ... (4)

予測部276は、数式(1)に示した、BinCountsInNALUnitsおよびNumBytesInVclNALUnitsに、予測値EstimateBinCountsInNALUnitsおよびEstimateNumByteInVclNALUnitsを代入することで、1ピクチャ分の圧縮の度合いを示す指標データKを予測する。   The prediction unit 276 predicts index data K indicating the degree of compression for one picture by substituting the predicted values EstimateBinCountsInNALUnits and EstimateNumByteInVclNALUnits into BinCountsInNALUnits and NumBytesInVclNALUnits shown in Equation (1).

詳細には、予測部276は、数式(5)に示すような計算を行うことで、指標データKを予測する。   Specifically, the prediction unit 276 predicts the index data K by performing a calculation as shown in Equation (5).

〔数5〕
K=Ceil((Ceil((3×EstimateBinCountsInNALUnits−3×96×PicSizeInMbs)/32)−EstimateNumByteInVclNALUnits)/3)…(5)
[Equation 5]
K = Ceil ((Ceil ((3 × EstimateBinCountsInNALUnits−3 × 96 × PicSizeInMbs) / 32) −EstimateNumByteInVclNALUnits) / 3) (5)

また、予測部276は、その予測した指標データKに応じた付加データのデータ長を予測する。
レート制御回路32は、その予測した指標データKに応じた付加データのデータ長に応じて、マクロブロック単位で量子化レートの制御を行う。
Further, the prediction unit 276 predicts the data length of the additional data according to the predicted index data K.
The rate control circuit 32 controls the quantization rate in units of macroblocks according to the data length of the additional data corresponding to the predicted index data K.

上述したように予測部276は、1マクロブロック単位で付加部275が生成する付加データを予測することができる。また、予測部276が予測する指標データKや付加データは、算術符号化処理が進み1ピクチャの最後のマクロブロックに近づくにつれて付加部275が生成する指標データKや付加データに近づく。
各構成要素の動作は、図7に示したフローチャートと同様であるので説明を省略する。
相違点は、予測部276がbitsOutstandingを考慮し、数式(2)〜数式(5)に基づいて付加データを予測する点である。これにより、より高精度に付加データを予測することができる。
As described above, the prediction unit 276 can predict the additional data generated by the addition unit 275 in units of one macroblock. Also, the index data K and additional data predicted by the prediction unit 276 approach the index data K and additional data generated by the addition unit 275 as the arithmetic coding process proceeds and approaches the last macroblock of one picture.
Since the operation of each component is the same as that of the flowchart shown in FIG.
The difference is that the prediction unit 276 predicts additional data based on Equations (2) to (5) in consideration of bitsOutstanding. Thereby, additional data can be predicted with higher accuracy.

以上説明したように、画像データをマクロブロック単位で算術符号化処理を行い符号化データを生成する算術符号化部274と、算術符号化部274が生成した符号化データに、算術符号化部274の算術符号化処理によるマクロブロック単位よりも大きい所定単位での画像データの圧縮の度合いを示す指標データKに応じた付加データを付加する付加部275と、マクロブロック単位で、算術符号化部274による算術符号化処理の対象のデータのデータ長、および、算術符号化部274が生成した符号化データのデータ長に基づいて、付加部275が付加する所定単位での指標データKに応じた付加データを予測する予測部276と、マクロブロック単位で、予測部276が予測した付加データに応じた所定処理を行うレート制御回路32および量子化回路26とを設けたので、符号化処理において、画像データのうち付加データの所定単位よりも小さい単位で付加データを予測できる。   As described above, the arithmetic coding unit 274 that performs arithmetic coding processing on image data in units of macro blocks to generate coded data, and the coded data generated by the arithmetic coding unit 274 are added to the arithmetic coding unit 274. An addition unit 275 for adding additional data corresponding to the index data K indicating the degree of compression of the image data in a predetermined unit larger than the macroblock unit by the arithmetic coding process, and the arithmetic coding unit 274 in the macroblock unit. Addition according to the index data K in a predetermined unit added by the adding unit 275 based on the data length of the data to be subjected to arithmetic coding processing by and the data length of the encoded data generated by the arithmetic coding unit 274 A prediction unit 276 that predicts data, and a rate control circuit 3 that performs predetermined processing according to additional data predicted by the prediction unit 276 in units of macroblocks And since there is provided a quantization circuit 26, in the encoding process, we can predict the additional data in units smaller than the predetermined unit of additional data of the image data.

また、算術符号化部274による正規化処理に係るビットアウトスタンディングデータbitsOutstanding、および算術符号化部274が画像データの1ピクチャのうち算術符号化処理したブロックまでの符号化データのデータ長、および1ピクチャのうち算術符号化処理前のデータのデータ長に基づいて、所定単位での指標データに応じた付加データを予測するので、より高精度に指標データおよび付加データを予測することができる。   Also, the bit outstanding data bitsOutstanding related to the normalization processing by the arithmetic encoding unit 274, the data length of the encoded data up to the block that the arithmetic encoding unit 274 has arithmetically processed among one picture of the image data, and 1 Since the additional data corresponding to the index data in a predetermined unit is predicted based on the data length of the data before arithmetic coding processing in the picture, the index data and the additional data can be predicted with higher accuracy.

なお、本発明は本実施形態に限られるものではなく、任意好適な改変が可能である。
本実施形態に係る符号化装置では、ハードウェアにより、本発明に係る機能を実現したが、この形態に限られるものではない。例えば、コンピュータ(データ処理装置)が上述した本発明に係る機能を有するプログラムを実行することにより、本発明に係る機能を実現してもよい。
Note that the present invention is not limited to this embodiment, and any suitable modification can be made.
In the encoding apparatus according to the present embodiment, the functions according to the present invention are realized by hardware, but the present invention is not limited to this form. For example, the function according to the present invention may be realized by executing a program having the function according to the present invention described above by a computer (data processing apparatus).

本発明の一実施形態に係る符号化装置を採用した通信システム1の概念図である。It is a conceptual diagram of the communication system 1 which employ | adopted the encoding apparatus which concerns on one Embodiment of this invention. 図1に示す符号化装置2の全体構成図である。It is a whole block diagram of the encoding apparatus 2 shown in FIG. 算術符号化処理を説明するための図である。It is a figure for demonstrating arithmetic coding processing. 符号化処理における正規化処理を説明するための図である。It is a figure for demonstrating the normalization process in an encoding process. 図2に示した符号化回路の機能ブロック図である。FIG. 3 is a functional block diagram of the encoding circuit shown in FIG. 2. 画像データにおいてピクチャ、スライス、マクロブロックを説明するための図である。(a)は、画像データ内の1ピクチャが、横方向に複数のスライスにより構成されていることを示す図であるり、(b)は、1スライスがマクロブロックにより構成されていることを示す図である。It is a figure for demonstrating a picture, a slice, and a macroblock in image data. (A) is a diagram showing that one picture in the image data is composed of a plurality of slices in the horizontal direction, and (b) shows that one slice is composed of macroblocks. FIG. 図2に示した符号化回路の動作を説明するためのフローチャートである。3 is a flowchart for explaining the operation of the encoding circuit shown in FIG. 2. 図5に示した算術符号化部の動作の一具体例を示すフローチャートである。6 is a flowchart illustrating a specific example of the operation of the arithmetic encoding unit illustrated in FIG. 5. 図8に示した正規化処理の一具体例を説明するためのフローチャートである。It is a flowchart for demonstrating one specific example of the normalization process shown in FIG. 図9に示した符号化処理のPutBit(B)の処理を説明するためのフローチャートである。10 is a flowchart for explaining a process of PutBit (B) of the encoding process shown in FIG. 9.

符号の説明Explanation of symbols

1…通信システム、2…符号化装置(データ処理装置:コンピュータ)、3…復号装置、22…A/D変換回路、23…画面並べ替え回路、24…演算回路、25…直交変換回路、26…量子化回路、27…符号化回路、28…バッファ、29…逆量子化回路、30…逆直交変換回路、32…レート制御回路、34…フレームメモリ、38…デブロックフィルタ、39…動き予測・補償回路、271…2値化部(BINR)、272…コンテクスト(CTX)、273…更新部(UPDT)、274…算術符号化部、275…付加部、276…予測部、Range …レンジ、Low …下限値。
DESCRIPTION OF SYMBOLS 1 ... Communication system, 2 ... Encoding apparatus (data processing apparatus: Computer), 3 ... Decoding apparatus, 22 ... A / D conversion circuit, 23 ... Screen rearrangement circuit, 24 ... Arithmetic circuit, 25 ... Orthogonal transformation circuit, 26 DESCRIPTION OF SYMBOLS ... Quantization circuit, 27 ... Coding circuit, 28 ... Buffer, 29 ... Inverse quantization circuit, 30 ... Inverse orthogonal transformation circuit, 32 ... Rate control circuit, 34 ... Frame memory, 38 ... Deblock filter, 39 ... Motion prediction Compensation circuit, 271 ... binarization unit (BINR), 272 ... context (CTX), 273 ... update unit (UPDT), 274 ... arithmetic coding unit, 275 ... addition unit, 276 ... prediction unit, Range ... range, Low: Lower limit.

Claims (6)

画像データをマクロブロック単位で算術符号化処理を行い符号化データを生成する算術符号化手段と、
前記算術符号化手段が生成した符号化データに、前記算術符号化手段の算術符号化処理によって生成された複数のマクロブロックを含むスライスまたはピクチャ単位での前記画像データの圧縮の度合いを示す指標データに応じた付加データを付加する付加手段と、
前記マクロブロック単位で、前記算術符号化手段による算術符号化処理の対象のデータのデータ長、および、前記算術符号化手段が生成した符号化データのデータ長に基づいて、前記付加手段が付加する付加データを予測する予測手段と、
前記マクロブロック単位で、前記予測手段が予測した前記付加データに応じた所定処理を行う処理手段と
を有する符号化装置。
Arithmetic coding means for performing coded coding of image data on a macroblock basis to generate coded data;
Wherein the arithmetic coding unit generated encoded data, the degree of the generated I by the arithmetic coding process in the arithmetic encoding means, of the image data in the slice or picture unit including a plurality of macro blocks compressed adding means for adding additional data corresponding to the index data indicating,
In the macro-block unit, the data length of the arithmetic coding unit target data arithmetic coding process by, and, on the basis of the data length of the coded data arithmetic coding means is generated, the additional means for adding A prediction means for predicting additional data;
And a processing unit that performs predetermined processing according to the additional data predicted by the prediction unit in units of the macroblock .
前記算術符号化手段は、前記算術符号化処理を行う際に、処理対象のデータを所定倍する正規化処理を含み、
前記予測手段は、前記算術符号化手段による前記正規化処理に係るビットアウトスタンディングデータ、および前記算術符号化手段が前記画像データのピクチャのうち前記算術符号化処理したマクロブロックまでの符号化データのデータ長、および前記1ピクチャのうち前記算術符号化処理前のデータのデータ長に基づいて、前記指標データに応じた付加データを予測する
請求項1に記載の符号化装置。
The arithmetic encoding means includes a normalization process for multiplying the data to be processed by a predetermined number when performing the arithmetic encoding process,
The prediction means includes bit-outstanding data related to the normalization processing by the arithmetic coding means, and encoded data up to a macroblock that has been arithmetically coded by the arithmetic coding means in the picture of the image data. The encoding apparatus according to claim 1, wherein additional data corresponding to the index data is predicted based on a data length and a data length of the data before the arithmetic encoding process in the one picture.
前記処理手段は、前記画像データを設定された量子化の度合いを示すデータに基づいて量子化処理を行い、前記算術符号化手段の処理対象のデータを生成する量子化手段と、
前記マクロブロック単位で、前記予測手段が予測した前記付加データに基づいて、前記量子化手段の量子化の度合いを示すデータを設定する量子化データ設定手段と
を含む請求項1に記載の符号化装置。
The processing means performs quantization processing based on data indicating a set degree of quantization of the image data, and generates quantization target processing data of the arithmetic encoding means;
In the macro-block basis, on the basis of the said additional data predicting means predicts the encoding of claim 1 including the quantized data setting means for setting data indicating the degree of quantization of the quantization means apparatus.
複数の異なるサイズのマクロブロックを単位として、動き補償の対象となる画像データと、前記動き補償で参照される参照画像データの間の差分に基づいて動きベクトルを生成する動きベクトル生成手段と、
前記動き補償の対象となる画像データと、予測画像データとの差分に直交変換処理および量子化処理を順に施す第1の処理手段と、
前記第1の処理手段で生成したデータに、逆量子化処理および逆直交変換処理を順に施して参照データを生成する第2の処理手段と、
前記動きベクトルおよび前記参照画像データを基に前記予測画像データを生成する第3の処理手段と、
設定された量子化の度合いを示すデータに基づいて量子化処理を行い、前記符号化手段の処理対象のデータを生成する量子化手段と、
前記量子化手段が生成したデータ、および前記動きベクトルを、前記マクロブロック単位で算術符号化処理を行い符号化データを生成する算術符号化手段と、
前記算術符号化手段が生成した符号化データに、前記算術符号化手段の算術符号化処理によって生成された、複数のマクロブロックを含むスライスまたはピクチャ単位での前記画像データの圧縮の度合いを示す指標データに応じた付加データを付加する付加手段と、
前記マクロブロック単位で、前記算術符号化手段による算術符号化処理の対象のデータのデータ長、および、前記算術符号化手段が生成した符号化データのデータ長に基づいて、前記付加手段が付加する前記指標データに応じた付加データを予測する予測手段と、
前記マクロブロック単位で、前記予測手段が予測した前記付加データに基づいて、前記量子化手段の量子化の度合いを示すデータを設定する量子化データ設定手段と
を有する符号化装置。
Motion vector generation means for generating a motion vector based on a difference between image data to be subjected to motion compensation and reference image data referred to in the motion compensation in units of a plurality of macro blocks of different sizes;
First processing means for sequentially performing orthogonal transformation processing and quantization processing on the difference between the image data to be subjected to motion compensation and the predicted image data;
Second processing means for generating reference data by sequentially performing inverse quantization processing and inverse orthogonal transform processing on the data generated by the first processing means;
Third processing means for generating the predicted image data based on the motion vector and the reference image data;
Quantization means for performing quantization processing based on data indicating a set degree of quantization and generating data to be processed by the encoding means;
Arithmetic encoding means for generating encoded data by performing arithmetic encoding on the data generated by the quantization means and the motion vector in units of the macroblocks ;
Wherein the arithmetic coding unit generated encoded data, the degree of the generated I by the arithmetic coding process in the arithmetic encoding means, of the image data in the slice or picture unit including a plurality of macro blocks compressed Adding means for adding additional data according to the index data indicating
In the macro-block unit, the data length of the arithmetic coding unit target data arithmetic coding process by, and, on the basis of the data length of the coded data arithmetic coding means is generated, the additional means for adding prediction means for predicting the additional data corresponding to the index data,
And a quantized data setting unit configured to set data indicating a degree of quantization of the quantizing unit based on the additional data predicted by the predicting unit for each macroblock .
符号化手段と、付加手段と、予測手段と、処理手段と、を有する情報処理装置に実行させるプログラムであって、
前記符号化手段が、画像データをマクロブロック単位で算術符号化処理を行い符号化データを生成する第1の手順と、
前記付加手段が、前記算術符号化手段が生成した符号化データに、前記算術符号化手段の算術符号化処理によって生成された、複数のマクロブロックを含むスライスまたはピクチャ単位での前記画像データの圧縮の度合いを示す指標データに応じた付加データを付加する第2の手順と、
前記予測手段が、前記マクロブロック単位で、前記第1の手順における算術符号化処理の対象のデータのデータ長、および、前記第1の手順で生成した符号化データのデータ長に基づいて、前記第2の手順において付加する付加データを予測する第の手順と、
前記処理手段が、前記マクロブロック単位で、前記第のステップで予測した前記付加データに応じた所定処理を行う第の手順と、
前記情報処理装置に実行させるプログラム。
A program to be executed by an information processing apparatus having an encoding unit, an adding unit, a predicting unit, and a processing unit ,
A first procedure in which the encoding means performs an arithmetic encoding process on image data in units of macroblocks to generate encoded data;
The adding unit compresses the image data in units of slices or pictures including a plurality of macroblocks generated by the arithmetic encoding process of the arithmetic encoding unit in the encoded data generated by the arithmetic encoding unit. A second procedure for adding additional data according to the index data indicating the degree of
The prediction means is based on the data length of the data subject to arithmetic coding processing in the first procedure and the data length of the coded data generated in the first procedure in units of the macroblocks. a third step for predicting the additional data to be added in the second step,
A fourth procedure in which the processing means performs a predetermined process according to the additional data predicted in the third step in units of the macroblock ;
A program for causing the information processing apparatus to execute.
符号化手段と、付加手段と、予測手段と、処理手段と、を有する情報処理装置が行う符号化処理方法であって、
前記符号化手段が、画像データをマクロブロック単位で算術符号化処理を行い符号化データを生成する第1のステップと、
前記付加手段が、前記算術符号化手段が生成した符号化データに、前記算術符号化手段の算術符号化処理によって生成された、複数のマクロブロックを含むスライスまたはピクチャ単位での前記画像データの圧縮の度合いを示す指標データに応じた付加データを付加する第2のステップと、
前記予測手段が、前記マクロブロック単位で、前記第1のステップにおける算術符号化処理の対象のデータのデータ長、および、前記第1のステップで生成した符号化データのデータ長に基づいて、前記第2のステップにおいて付加する付加データを予測する第のステップと、
前記処理手段が、前記マクロブロック単位で、前記第のステップ予測した前記付加データに応じた所定処理を行う第のステップと、
を有する符号化処理方法。
An encoding processing method performed by an information processing apparatus including an encoding unit, an adding unit, a prediction unit, and a processing unit ,
It said encoding means, a first step of generating encoded data subjected to arithmetic encoding processing image data in units of macroblocks,
The adding unit compresses the image data in units of slices or pictures including a plurality of macroblocks generated by the arithmetic encoding process of the arithmetic encoding unit in the encoded data generated by the arithmetic encoding unit. A second step of adding additional data according to the index data indicating the degree of
The prediction means, in the macro-block unit, the data length of the target data of the arithmetic encoding processing in the first step, and, based on the data length of the coded data generated in said first step, said a third step of predicting the additional data to be added in the second step,
It said processing means, in the macro block, and a fourth step of performing a predetermined process corresponding to the additional data predicted in the third step,
An encoding processing method comprising:
JP2004056501A 2004-03-01 2004-03-01 Encoding apparatus, program, and encoding processing method Expired - Fee Related JP4453398B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004056501A JP4453398B2 (en) 2004-03-01 2004-03-01 Encoding apparatus, program, and encoding processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004056501A JP4453398B2 (en) 2004-03-01 2004-03-01 Encoding apparatus, program, and encoding processing method

Publications (2)

Publication Number Publication Date
JP2005252374A JP2005252374A (en) 2005-09-15
JP4453398B2 true JP4453398B2 (en) 2010-04-21

Family

ID=35032494

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004056501A Expired - Fee Related JP4453398B2 (en) 2004-03-01 2004-03-01 Encoding apparatus, program, and encoding processing method

Country Status (1)

Country Link
JP (1) JP4453398B2 (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4878262B2 (en) * 2006-10-31 2012-02-15 キヤノン株式会社 Entropy encoding device
JP4717780B2 (en) * 2006-11-01 2011-07-06 キヤノン株式会社 Encoding apparatus and control method thereof
US8170359B2 (en) 2006-11-28 2012-05-01 Panasonic Corporation Encoding device and encoding method
EP2091257B1 (en) 2006-11-30 2017-12-27 Panasonic Corporation Coder
JP4742018B2 (en) * 2006-12-01 2011-08-10 キヤノン株式会社 Image coding apparatus and image coding method
JP2008141530A (en) * 2006-12-01 2008-06-19 Canon Inc Image coder and image coding method
WO2008142956A1 (en) * 2007-05-21 2008-11-27 Nec Corporation Video encoding device, video encoding method, and video encoding program
JP4936574B2 (en) * 2011-03-02 2012-05-23 キヤノン株式会社 Encoding apparatus and control method thereof
US20130279597A1 (en) * 2012-04-24 2013-10-24 Magnum Semiconductor, Inc. Apparatuses and methods for bitstream bitstuffing
JP6059572B2 (en) * 2013-03-22 2017-01-11 株式会社メガチップス Image processing device
JP6159240B2 (en) * 2013-12-09 2017-07-05 日本電信電話株式会社 Binary arithmetic encoding device, binary arithmetic encoding method, and binary arithmetic encoding program

Also Published As

Publication number Publication date
JP2005252374A (en) 2005-09-15

Similar Documents

Publication Publication Date Title
US7132964B2 (en) Coding apparatus, program and data processing method
CN101682773B (en) Method and apparatus for entropy-coding/entropy-decoding video data
JP4540585B2 (en) Encoding device and decoding device
JP2004135251A (en) Method of encoding image information, and method of decoding the image information
JP2014518466A (en) Context adaptive coding of video data
JP2006054865A (en) Binary arithmetic decoding apparatus and methods using pipelined structure
JP2007142637A (en) Image information encoder
KR20070118978A (en) Method and system for video compression using an iterative encoding algorithm
CA3075491A1 (en) Binary arithmetic coding with progressive modification of adaptation parameters
JP4453398B2 (en) Encoding apparatus, program, and encoding processing method
JP5116704B2 (en) Image coding apparatus and image coding method
CN109565596B (en) Method and apparatus for context adaptive binary arithmetic coding
JP4687998B2 (en) Encoding apparatus and encoding method
JP5057497B2 (en) Decoding device and decoding method
JP5041061B2 (en) Decoding device and decoding method
JP5041060B2 (en) Encoding apparatus and encoding method
JP5892203B2 (en) Decoding device, decoding method, and decoding program
JP5057498B2 (en) Decoding device and decoding method
JP5057496B2 (en) Encoding apparatus and encoding method
JP5692172B2 (en) Decoding device, decoding method, and decoding program.
JP5057495B2 (en) Decoding device and decoding method
JP5062320B2 (en) Encoding apparatus and encoding method
JP5057494B2 (en) Encoding apparatus and encoding method
JP5500210B2 (en) Encoding apparatus, encoding method, and encoding program
JP5041062B2 (en) Decoding device and decoding method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070201

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20091008

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20091020

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20091209

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100125

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130212

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130212

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees