JP2008098751A - Arithmetic encoding device and arithmetic decoding device - Google Patents

Arithmetic encoding device and arithmetic decoding device Download PDF

Info

Publication number
JP2008098751A
JP2008098751A JP2006275211A JP2006275211A JP2008098751A JP 2008098751 A JP2008098751 A JP 2008098751A JP 2006275211 A JP2006275211 A JP 2006275211A JP 2006275211 A JP2006275211 A JP 2006275211A JP 2008098751 A JP2008098751 A JP 2008098751A
Authority
JP
Japan
Prior art keywords
arithmetic
flag
value
arithmetic decoding
determined
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
JP2006275211A
Other languages
Japanese (ja)
Inventor
Takashi Masuno
貴司 増野
Hiroaki Shimazaki
浩昭 島崎
Takuma Chiba
琢麻 千葉
Hiroshi Tasaka
啓 田坂
Kenjiro Tsuda
賢治郎 津田
Tatsuro Shigesato
達郎 重里
Kazuo Saigo
賀津雄 西郷
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 JP2006275211A priority Critical patent/JP2008098751A/en
Publication of JP2008098751A publication Critical patent/JP2008098751A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an arithmetic encoding device capable of putting values of a development probability table back to the state right before arithmetic encoding processing. <P>SOLUTION: The arithmetic encoding device includes: a storage unit 17 which stores a table 0 as one of doubled development probability tables and a table 1 as the other of the doubled development probability tables; an initialization unit 14 which initializes the tables 0 and table 1 in slice units; an arithmetic encoding unit 12 which performs arithmetic encoding processing using the table 0; a table management unit 15 which updates the table 0 based upon the result of the arithmetic encoding processing; a decision unit 13 which decides whether arithmetic encoding processing for one macroblock included in a slice each time the arithmetic encoding processing for the macroblock is completed; and a flag management unit 16 which performs control such that the table 1 have values of the table 0 when it is decided that the arithmetic encoding processing is effective, or the table 0 have values of the table 1 otherwise. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、算術符号化装置及び算術復号化装置に関し、特に、H.264/AVCで規定されているCABACを用いた算術符号化装置及び算術復号化装置に関する。   The present invention relates to an arithmetic coding apparatus and an arithmetic decoding apparatus. The present invention relates to an arithmetic coding apparatus and an arithmetic decoding apparatus using CABAC defined by H.264 / AVC.

動画像の符号化技術において、符号化効率の向上が図られている。これにより、携帯電話機で滑らかな動きのテレビ電話を実現したり、高画質な動画像を撮影したりすることも可能になりつつある。このような符号化技術の進展において、最新の動画像符号化技術の国際基準であるH.264/AVCでは、シンタックス要素のエントロピー符号化方式として、CAVLCとCABACという2つの方式を規定している。シンタックス要素とは、DCT係数や動きベクトルなど、シンタックス(データ列の表現規則)に従って伝送することが定められている情報のことである。   In the moving picture coding technique, the coding efficiency is improved. As a result, it is becoming possible to realize a smooth-moving videophone or to shoot a high-quality moving image on a mobile phone. In the progress of such coding technology, H.B., which is the international standard for the latest video coding technology. H.264 / AVC defines two systems, CAVLC and CABAC, as syntax element entropy encoding systems. The syntax element is information that is determined to be transmitted according to syntax (data string expression rules), such as DCT coefficients and motion vectors.

CAVLCは、Context−Adaptive Variable Length Coding(コンテキスト適応型可変長符号化方式)の略である。CAVLCでは、DCT係数を符号化する際、連続する0の長さであるランとレベルとを可変長符号化テーブルを用いてスキャンの方向と反対の方向から符号化を行なう。CABACは、Context−based Adaptive Binary Arithmac Coding(コンテキスト適応型2値算術符号化方式)の略である。すなわち、時間とともに変化する符号化対象の発生確率を変化させる方式であり、一般に算術符号化と呼ばれる方式である(例えば、特許文献1参照)。CABACでは、通常の算術符号化のほかに、圧縮すべき符号毎にコンテキストを付け、そのコンテキストごとに発生確率の変更を行なっている。   CAVLC is an abbreviation for Context-Adaptive Variable Length Coding (context adaptive variable length coding system). In CAVLC, when a DCT coefficient is encoded, a run and a level, which are continuous zero lengths, are encoded from a direction opposite to the scan direction using a variable length encoding table. CABAC is an abbreviation for Context-based Adaptive Binary Arithmac Coding (context adaptive binary arithmetic coding system). In other words, this is a method of changing the occurrence probability of a coding target that changes with time, and is generally called arithmetic coding (see, for example, Patent Document 1). In CABAC, in addition to normal arithmetic coding, a context is assigned to each code to be compressed, and the occurrence probability is changed for each context.

図11は、CABACを用いた従来の2値算術符号化装置の構成図である。この2値算術符号化装置は、通常の2値算術符号化部に加えて2値化部とコンテキスト算出部とを備えている。2値化部は、+3や+4などの多値信号を0と1の2値信号に変換する。コンテキスト算出部は、コンテキスト変数テーブルを備えている。コンテキスト変数テーブルとは、コンテキストの番号と、コンテキストの発生確率を示すテーブルの番号と、発生確率の高いシンボル(1又は0)とを対応付けたテーブルである。コンテキスト算出部は、コンテキスト変数テーブルを参照することにより、符号化すべき2値信号の発生確率を周囲の状況に応じて算出するとともに、実際に符号化した結果に基づいて発生確率テーブルを更新する。2値算術符号化部は、コンテキスト算出部から与えられた発生確率に従って2値信号の符号化を行なう。   FIG. 11 is a block diagram of a conventional binary arithmetic coding apparatus using CABAC. This binary arithmetic coding apparatus includes a binarization unit and a context calculation unit in addition to a normal binary arithmetic coding unit. The binarization unit converts a multilevel signal such as +3 or +4 into a binary signal of 0 and 1. The context calculation unit includes a context variable table. The context variable table is a table in which a context number, a table number indicating the occurrence probability of a context, and a symbol (1 or 0) having a high occurrence probability are associated with each other. The context calculation unit refers to the context variable table to calculate the occurrence probability of the binary signal to be encoded according to the surrounding situation, and updates the occurrence probability table based on the actual encoding result. The binary arithmetic encoding unit encodes a binary signal according to the occurrence probability given from the context calculation unit.

H.264/AVCによると、前記したようにコンテキスト毎にその発生確率テーブルが存在することになるが、以下では簡単のため、複数の発生確率テーブルを1つのテーブルと考えることにする。すなわち、複数のコンテキストとその発生確率とを対応付けたテーブルのことを「発生確率テーブル」と呼ぶことにする。この発生確率テーブルは、前記したコンテキスト変数テーブルに相当することになる。   H. According to H.264 / AVC, an occurrence probability table exists for each context as described above. However, for the sake of simplicity, a plurality of occurrence probability tables are considered as one table. That is, a table in which a plurality of contexts and their occurrence probabilities are associated is referred to as an “occurrence probability table”. This occurrence probability table corresponds to the context variable table described above.

図12は、CABACを用いた2値算術符号化の概念図である。この図に示されるように、CABACを用いた2値算術符号化では、あらかじめ2値信号の発生確率が与えられたうえで、入力信号に応じて実数0.0から1.0の間で区間をどんどん狭めていく。ここでは、入力信号のうちの“0”の発生確率が0.8、“1”の発生確立が0.2となっているので、入力信号のうち“0”が符号化されると前の区間の下0.8の部分が、“1”が符号化されると前の区間の上0.2の部分が新しい区間として更新される。   FIG. 12 is a conceptual diagram of binary arithmetic coding using CABAC. As shown in this figure, in binary arithmetic coding using CABAC, a probability of occurrence of a binary signal is given in advance, and an interval between 0.0 and 1.0 is real according to the input signal. Narrowing down more and more. Here, since the probability of occurrence of “0” in the input signal is 0.8 and the probability of occurrence of “1” is 0.2, when “0” in the input signal is encoded, When “1” is encoded in the lower 0.8 part of the section, the upper 0.2 part of the previous section is updated as a new section.

具体的には、最初のSTEP1では“0”が符号化されたため、初期区間の0.0−1.0の下0.8にあたる0.0−0.8が新しい区間として更新される。その後、“1”“0”が順次符号化され、最終的な区間は0.64−0.768となる。算術符号の符号語は、最終区間を特定する実数値の2進表現になる。この例の場合は0.64−0.768が最終区間になるので、その間に入る実数としては0.75をとることができる。0.75の2進表現は0.11になるので、常に0となる最初の桁を除いた、小数点以下の“11”が符号語として出力される。   Specifically, since “0” is encoded in the first STEP 1, 0.0-0.8 corresponding to the lower 0.8 of 0.0-1.0 of the initial section is updated as a new section. Thereafter, “1” and “0” are sequentially encoded, and the final interval is 0.64 to 0.768. The code word of the arithmetic code is a binary representation of a real value that specifies the last interval. In the case of this example, 0.64 to 0.768 is the final section, and therefore, a real number that falls between them can be 0.75. Since the binary representation of 0.75 is 0.11, “11” below the decimal point is output as a code word except for the first digit that is always 0.

図13は、スライスが符号化の基本単位となっている様子を示す図である。例えば、スライス#3についての処理時間T1は、発生確率テーブルの初期化処理に要する時間T2と、スライス#3についての符号化処理に要する時間T3との合計となる。このように、CABACを用いた2値算術符号化では、スライス毎に符号化処理が行われ、実際に符号化した結果に基づいて発生確率テーブルが更新される。すなわち、1スライスについて符号化する前に発生確率テーブル全体が初期化されることになる。   FIG. 13 is a diagram illustrating a state in which a slice is a basic unit of encoding. For example, the processing time T1 for slice # 3 is the sum of time T2 required for initialization processing of the occurrence probability table and time T3 required for encoding processing for slice # 3. As described above, in binary arithmetic encoding using CABAC, encoding processing is performed for each slice, and the occurrence probability table is updated based on the actual encoding result. That is, the entire occurrence probability table is initialized before encoding for one slice.

図14は、1スライスに含まれるマクロブロック毎の発生符号量を示す図である。ここでは、図14(A)に示されるように、1スライスには8つのマクロブロック#1〜#8が含まれていると仮定する。このようなスライスについて算術符号化処理を行なった場合は、図14(B)に示されるように、8つのマクロブロック#1〜#8毎に、その算術符号化処理によって発生した符号量が検出される。   FIG. 14 is a diagram illustrating the generated code amount for each macroblock included in one slice. Here, as shown in FIG. 14A, it is assumed that one macro includes eight macro blocks # 1 to # 8. When arithmetic coding processing is performed on such a slice, as shown in FIG. 14B, the amount of code generated by the arithmetic coding processing is detected for each of the eight macro blocks # 1 to # 8. Is done.

ここで、1マクロブロックについての発生符号量は、H.264/AVCにおいて規定されている制限値を越えてはならない。例えば、図14(B)に示されるように、マクロブロック#5についての発生符号量が制限値を超えている場合は、マクロブロック#5部分のストリームデータをPCM(Pulse Code Modulation)データに差し替えるか、又は、発生符号量を抑える制約を加えて再度マクロブロック#5について算術符号化処理(再エンコード)を行なう必要がある。
特開2004−135251号公報
Here, the generated code amount for one macroblock is H.264. The limit value specified in H.264 / AVC must not be exceeded. For example, as shown in FIG. 14B, when the generated code amount for the macro block # 5 exceeds the limit value, the stream data of the macro block # 5 part is replaced with PCM (Pulse Code Modulation) data. Alternatively, it is necessary to perform the arithmetic coding process (re-encoding) on the macroblock # 5 again by adding a restriction to suppress the generated code amount.
JP 2004-135251 A

しかしながら、従来技術によると、マクロブロック#5について算術符号化処理を行なう直前の状態に発生確率テーブルの値を戻すことができない。すなわち、発生確率テーブルの値は、実際に符号化した結果に基づいて更新されているので、マクロブロック#5部分のストリームデータをPCMデータに差し替える場合は、マクロブロック#5について算術符号化処理を行なう前の状態に発生確率テーブルの値を戻す必要がある。しかしながら、従来技術では、このような状態に発生確率テーブルの値を戻すことができないので、マクロブロック#5部分のストリームデータをPCMデータに差し替えることはできない。マクロブロック#5について再エンコードを行なう場合にしても、マクロブロック#5について算術符号化処理を行なう直前の状態に発生確率テーブルの値を戻すことはできない。そこで、この場合は、発生確率テーブルを初期化したうえで、スライスの先頭に戻って算術符号化処理をやり直す必要がある。例えば、図14(B)に示されるように、マクロブロック#5についての発生符号量が制限値を超えている場合は、発生確率テーブルを初期化したうえで、マクロブロック#1から順に算術符号化処理をやり直さなければならない。このような問題は、発生符号量が制限値を超えている場合だけでなく、1マクロブロックについての算術符号化処理が有効でない場合であれば同様に発生する。   However, according to the conventional technique, the value of the occurrence probability table cannot be returned to the state immediately before the arithmetic coding process is performed on the macroblock # 5. That is, since the value of the occurrence probability table is updated based on the actual encoding result, when the stream data of the macro block # 5 portion is replaced with the PCM data, the arithmetic encoding process is performed on the macro block # 5. It is necessary to return the value of the occurrence probability table to the state before execution. However, in the prior art, since the value of the occurrence probability table cannot be returned to such a state, the stream data of the macroblock # 5 portion cannot be replaced with PCM data. Even when re-encoding is performed for macro block # 5, the value in the occurrence probability table cannot be returned to the state immediately before the arithmetic coding process is performed for macro block # 5. Therefore, in this case, it is necessary to initialize the occurrence probability table and then return to the top of the slice and perform the arithmetic coding process again. For example, as shown in FIG. 14B, when the generated code amount for the macroblock # 5 exceeds the limit value, the occurrence probability table is initialized, and the arithmetic code is sequentially started from the macroblock # 1. You must redo the process. Such a problem occurs not only when the generated code amount exceeds the limit value but also when the arithmetic coding process for one macroblock is not effective.

本発明は、前記課題を解決するものであって、1マクロブロックについての算術符号化処理が有効でない場合は、そのマクロブロックについて算術符号化処理を行なう直前の状態に発生確率テーブルの値を戻すことが可能な算術符号化装置を提供することを目的とする。   The present invention solves the above-mentioned problem. When the arithmetic coding process for one macroblock is not effective, the value of the occurrence probability table is returned to the state immediately before the arithmetic coding process is performed for the macroblock. It is an object of the present invention to provide an arithmetic coding device capable of performing the above.

前記目的を達成するために、本発明に係る算術符号化装置は、発生確率テーブルを使用して算術符号化処理を行なう算術符号化装置であって、2重化された前記発生確率テーブルの一方である第1テーブルと、2重化された前記発生確率テーブルの他方である第2テーブルとを記憶するテーブル記憶手段と、前記第1テーブルと前記第2テーブルとをスライス単位に初期化する初期化手段と、前記第1テーブルを使用して前記算術符号化処理を行なう算術符号化手段と、前記算術符号化処理の結果に基づいて前記第1テーブルを更新する更新手段と、前記スライスに含まれる1マクロブロックについて前記算術符号化処理が完了する度に、そのマクロブロックについての算術符号化処理が有効であるか否かを判定する判定手段と、前記算術符号化処理が有効であると判定された場合は、前記第2テーブルの値が前記第1テーブルの値となるように制御し、前記算術符号化処理が有効でないと判定された場合は、前記第1テーブルの値が前記第2テーブルの値となるように制御する制御手段とを備える。これにより、2重化された発生確率テーブルの一方である第1テーブルは最新のテーブルとして、また、2重化された発生確率テーブルの他方である第2テーブルはバックアップ用のテーブルとして使用されることになるので、1マクロブロックについての算術符号化処理が有効でない場合は、そのマクロブロックについて算術符号化処理を行なう直前の状態に発生確率テーブルの値を戻すことが可能となる。   In order to achieve the above object, an arithmetic coding apparatus according to the present invention is an arithmetic coding apparatus that performs an arithmetic coding process using an occurrence probability table, and is one of the duplicated occurrence probability tables. Table storage means for storing a first table that is the second table and a second table that is the other of the duplicated occurrence probability tables, and an initial stage for initializing the first table and the second table in units of slices Included in the slice, an arithmetic encoding unit that performs the arithmetic encoding process using the first table, an update unit that updates the first table based on a result of the arithmetic encoding process, and the slice Determination means for determining whether or not the arithmetic encoding process for the macroblock is valid each time the arithmetic encoding process is completed for one macroblock, and the arithmetic code If it is determined that the encoding process is valid, the value of the second table is controlled to be the value of the first table, and if it is determined that the arithmetic encoding process is not effective, the second table Control means for controlling the value of one table to be the value of the second table. Accordingly, the first table that is one of the duplicated occurrence probability tables is used as the latest table, and the second table that is the other of the duplicated occurrence probability tables is used as a backup table. Therefore, when the arithmetic coding process for one macroblock is not effective, the value of the occurrence probability table can be returned to the state immediately before the arithmetic coding process is performed for the macroblock.

ここで、前記判定手段は、前記算術符号化処理が有効でないと判定した場合、そのマクロブロック部分のストリームデータをPCMデータに差し替えてもよい。これにより、前記算術符号化処理が有効でないマクロブロック部分のストリームデータをPCMデータに差し替えることが可能となる。   Here, when the determination unit determines that the arithmetic coding process is not effective, the stream data of the macroblock portion may be replaced with PCM data. As a result, it is possible to replace the stream data of the macro block portion where the arithmetic coding process is not effective with the PCM data.

また、前記算術符号化手段は、前記算術符号化処理が有効でないと判定された場合、発生符号量を抑える制約を加えて再度そのマクロブロックについて算術符号化処理を行なってもよい。これにより、再エンコードを行なう場合は、発生確率テーブルを初期化する時間と、前記算術符号化処理が有効であったマクロブロックについて算術符号化処理をやり直す時間とを削減することが可能となる。   Further, the arithmetic coding means may perform the arithmetic coding process for the macroblock again by adding a constraint for suppressing the generated code amount when it is determined that the arithmetic coding process is not effective. As a result, when re-encoding is performed, it is possible to reduce the time for initializing the occurrence probability table and the time for redoing the arithmetic coding process for the macroblock for which the arithmetic coding process has been effective.

また、前記算術符号化装置は、さらに、前記第1テーブル及び前記第2テーブルのエントリー毎に、前記第1テーブル又は前記第2テーブルを示す第1フラグと第2フラグとを対応付けて記憶するフラグ記憶手段を備え、前記算術符号化手段は、前記第2フラグによって示されるテーブルを使用し、前記更新手段は、前記第1フラグによって示されないテーブルを更新し、前記制御手段は、前記第1フラグによって示されないテーブルが更新された場合は、前記第1フラグによって示されないテーブルを示すように前記第2フラグの値を変更し、前記算術符号化処理が有効であると判定された場合は、前記第1フラグの値を前記第2フラグに複製し、前記算術符号化処理が有効でないと判定された場合は、前記第2フラグの値を前記第1フラグに複製してもよい。これにより、第1フラグによって示されるテーブルはバックアップ用のテーブルとして、また、第2フラグによって示されるテーブルは最新のテーブルとして使用されることになる。従って、フラグの値を変えるだけでバックアップ用のテーブルと最新のテーブルとを簡便に切り替えることが可能となる。   The arithmetic coding apparatus further stores a first flag indicating the first table or the second table in association with a second flag for each entry of the first table and the second table. Flag storing means, the arithmetic encoding means uses a table indicated by the second flag, the updating means updates a table not indicated by the first flag, and the control means includes the first flag When the table not indicated by the flag is updated, the value of the second flag is changed to indicate the table not indicated by the first flag, and when it is determined that the arithmetic encoding process is valid, If the value of the first flag is copied to the second flag and it is determined that the arithmetic coding process is not valid, the value of the second flag is set to the first flag. It may be replicated to. As a result, the table indicated by the first flag is used as a backup table, and the table indicated by the second flag is used as the latest table. Therefore, it is possible to easily switch between the backup table and the latest table simply by changing the flag value.

また、前記判定手段は、前記算術符号化処理によって発生した符号量が所定量を越えていない場合は、前記算術符号化処理が有効であると判定し、前記算術符号化処理によって発生した符号量が所定量を超えている場合は、前記算術符号化処理が有効でないと判定してもよい。これにより、1マクロブロックについての算術符号化処理によって発生した符号量が所定量を超えている場合は、そのマクロブロックについて算術符号化処理を行なう直前の状態に発生確率テーブルの値を戻すことが可能となる。   The determination unit determines that the arithmetic encoding process is effective when the code amount generated by the arithmetic encoding process does not exceed a predetermined amount, and the code amount generated by the arithmetic encoding process. May exceed the predetermined amount, it may be determined that the arithmetic coding process is not effective. As a result, when the amount of code generated by the arithmetic coding process for one macroblock exceeds a predetermined amount, the value of the occurrence probability table can be returned to the state immediately before the arithmetic coding process is performed for that macroblock. It becomes possible.

前記目的を達成するために、本発明に係る算術復号化装置は、発生確率テーブルを使用して算術復号化処理を行なう算術復号化装置であって、2重化された前記発生確率テーブルの一方である第1テーブルと、2重化された前記発生確率テーブルの他方である第2テーブルとを記憶するテーブル記憶手段と、前記第1テーブルと前記第2テーブルとをスライス単位に初期化する初期化手段と、前記第1テーブルを使用して前記算術復号化処理を行なう算術復号化手段と、前記算術復号化処理の結果に基づいて前記第1テーブルを更新する更新手段と、前記スライスに含まれる1マクロブロックについて前記算術復号化処理が完了する度に、そのマクロブロックについての算術復号化処理が有効であるか否かを判定する判定手段と、前記算術復号化処理が有効であると判定された場合は、前記第2テーブルの値が前記第1テーブルの値となるように制御し、前記算術復号化処理が有効でないと判定された場合は、前記第1テーブルの値が前記第2テーブルの値となるように制御する制御手段とを備える。これにより、2重化された発生確率テーブルの一方である第1テーブルは最新のテーブルとして、また、2重化された発生確率テーブルの他方である第2テーブルはバックアップ用のテーブルとして使用されることになるので、1マクロブロックについての算術復号化処理が有効でない場合は、そのマクロブロックについて算術復号化処理を行なう直前の状態に発生確率テーブルの値を戻すことが可能となる。   In order to achieve the above object, an arithmetic decoding apparatus according to the present invention is an arithmetic decoding apparatus that performs an arithmetic decoding process using an occurrence probability table, and includes one of the occurrence probability tables that are duplicated. Table storage means for storing a first table that is the second table and a second table that is the other of the duplicated occurrence probability tables, and an initial stage for initializing the first table and the second table in units of slices Included in the slice, an arithmetic decoding unit that performs the arithmetic decoding process using the first table, an updating unit that updates the first table based on a result of the arithmetic decoding process, Determination means for determining whether or not the arithmetic decoding process for the macroblock is valid each time the arithmetic decoding process is completed for the one macroblock; If it is determined that the conversion process is effective, the value of the second table is controlled to be the value of the first table, and if it is determined that the arithmetic decoding process is not effective, the second table Control means for controlling the value of one table to be the value of the second table. Accordingly, the first table that is one of the duplicated occurrence probability tables is used as the latest table, and the second table that is the other of the duplicated occurrence probability tables is used as a backup table. Therefore, when the arithmetic decoding process for one macroblock is not effective, the value of the occurrence probability table can be returned to the state immediately before the arithmetic decoding process is performed for the macroblock.

ここで、前記判定手段は、前記算術復号化処理が有効でないと判定した場合、そのマクロブロック部分のストリームデータをPCMデータに差し替えてもよい。これにより、前記算術復号化処理が有効でないマクロブロック部分のストリームデータをPCMデータに差し替えることが可能となる。   Here, when it is determined that the arithmetic decoding process is not valid, the determination unit may replace the stream data of the macroblock portion with PCM data. As a result, it is possible to replace the stream data of the macro block portion where the arithmetic decoding process is not effective with the PCM data.

また、前記算術復号化手段は、前記算術復号化処理が有効でないと判定された場合、発生符号量を抑える制約を加えて再度そのマクロブロックについて算術復号化処理を行なってもよい。これにより、再エンコードを行なう場合は、発生確率テーブルを初期化する時間と、前記算術復号化処理が有効であったマクロブロックについて算術復号化処理をやり直す時間とを削減することが可能となる。   In addition, when it is determined that the arithmetic decoding process is not effective, the arithmetic decoding unit may perform the arithmetic decoding process on the macroblock again by adding a constraint that suppresses the generated code amount. As a result, when re-encoding is performed, it is possible to reduce the time for initializing the occurrence probability table and the time for redoing the arithmetic decoding process for the macroblock for which the arithmetic decoding process is effective.

また、前記算術復号化装置は、さらに、前記第1テーブル及び前記第2テーブルのエントリー毎に、前記第1テーブル又は前記第2テーブルを示す第1フラグと第2フラグとを対応付けて記憶するフラグ記憶手段を備え、前記算術復号化手段は、前記第2フラグによって示されるテーブルを使用し、前記更新手段は、前記第1フラグによって示されないテーブルを更新し、前記制御手段は、前記第1フラグによって示されないテーブルが更新された場合は、前記第1フラグによって示されないテーブルを示すように前記第2フラグの値を変更し、前記算術復号化処理が有効であると判定された場合は、前記第1フラグの値を前記第2フラグに複製し、前記算術復号化処理が有効でないと判定された場合は、前記第2フラグの値を前記第1フラグに複製してもよい。これにより、第1フラグによって示されるテーブルはバックアップ用のテーブルとして、また、第2フラグによって示されるテーブルは最新のテーブルとして使用されることになる。従って、フラグの値を変えるだけでバックアップ用のテーブルと最新のテーブルとを簡便に切り替えることが可能となる。   The arithmetic decoding apparatus further stores a first flag indicating the first table or the second table and a second flag in association with each other for each entry of the first table and the second table. Flag storage means, the arithmetic decoding means uses a table indicated by the second flag, the updating means updates a table not indicated by the first flag, and the control means includes the first flag When the table not indicated by the flag is updated, the value of the second flag is changed to indicate the table not indicated by the first flag, and when it is determined that the arithmetic decoding process is valid, If the value of the first flag is copied to the second flag and it is determined that the arithmetic decoding process is not valid, the value of the second flag is set to the first flag. It may be replicated to. As a result, the table indicated by the first flag is used as a backup table, and the table indicated by the second flag is used as the latest table. Therefore, it is possible to easily switch between the backup table and the latest table simply by changing the flag value.

また、前記判定手段は、前記算術復号化処理によって発生した符号量が所定量を越えていない場合は、前記算術復号化処理が有効であると判定し、前記算術復号化処理によって発生した符号量が所定量を超えている場合は、前記算術復号化処理が有効でないと判定してもよい。これにより、1マクロブロックについての算術復号化処理によって発生した符号量が所定量を超えている場合は、そのマクロブロックについて算術復号化処理を行なう直前の状態に発生確率テーブルの値を戻すことが可能となる。   The determination means determines that the arithmetic decoding process is valid when the code amount generated by the arithmetic decoding process does not exceed a predetermined amount, and the code amount generated by the arithmetic decoding process. May exceed the predetermined amount, it may be determined that the arithmetic decoding process is not effective. As a result, when the amount of codes generated by the arithmetic decoding process for one macroblock exceeds a predetermined amount, the value of the occurrence probability table can be returned to the state immediately before the arithmetic decoding process is performed for that macroblock. It becomes possible.

なお、本発明は、このような算術符号化装置又は算術復号化装置として実現することができるだけでなく、このような算術符号化装置又は算術復号化装置が備える特徴的な手段をステップとする算術符号化方法又は算術復号化方法として実現したり、それらのステップをコンピュータに実行させるプログラムとして実現したりすることもできる。そして、そのようなプログラムは、CD−ROM等の記録媒体やインターネット等の伝送媒体を介して配信することができるのは言うまでもない。   Note that the present invention can be realized not only as such an arithmetic coding device or arithmetic decoding device, but also as an arithmetic step including steps characteristic of the arithmetic coding device or arithmetic decoding device. It can also be realized as an encoding method or an arithmetic decoding method, or as a program for causing a computer to execute these steps. Needless to say, such a program can be distributed via a recording medium such as a CD-ROM or a transmission medium such as the Internet.

以上の説明から明らかなように、本発明に係る算術符号化装置によれば、2重化された発生確率テーブルの一方である第1テーブルは最新のテーブルとして、また、2重化された発生確率テーブルの他方である第2テーブルはバックアップ用のテーブルとして使用されることになるので、1マクロブロックについての算術符号化処理が有効でない場合は、そのマクロブロックについて算術符号化処理を行なう直前の状態に発生確率テーブルの値を戻すことが可能となる。しかも、2つのフラグを用いて制御する構成を採用すれば、フラグの値を変えるだけでバックアップ用のテーブルと最新のテーブルとを簡便に切り替えることが可能となる。   As is clear from the above description, according to the arithmetic coding apparatus of the present invention, the first table that is one of the occurrence probability tables that are duplicated is the latest table and the occurrence that is duplicated. Since the second table, which is the other of the probability tables, is used as a backup table, if the arithmetic coding process for one macroblock is not valid, the immediately preceding arithmetic coding process for that macroblock is performed. It becomes possible to return the value of the occurrence probability table to the state. In addition, if a configuration in which control is performed using two flags is employed, it is possible to easily switch between the backup table and the latest table simply by changing the value of the flag.

これにより、算術符号化処理が有効でないマクロブロック部分のストリームデータをPCMデータに差し替えることが可能となる。また、再エンコードを行なう場合は、発生確率テーブルを初期化する時間と、算術符号化処理が有効であったマクロブロックについて算術符号化処理をやり直す時間とを削減することが可能となる。このように処理時間が削減されると電力消費量も削減されるので、電力消費量を抑えることが必要な装置に本発明を適用すると効果的である。   As a result, it is possible to replace the stream data of the macro block portion where the arithmetic coding process is not effective with the PCM data. Further, when re-encoding is performed, it is possible to reduce the time for initializing the occurrence probability table and the time for performing the arithmetic encoding process again for a macroblock for which the arithmetic encoding process is effective. When the processing time is thus reduced, the power consumption is also reduced. Therefore, it is effective to apply the present invention to an apparatus that needs to suppress the power consumption.

同様に、本発明に係る算術復号化装置によれば、2重化された発生確率テーブルの一方である第1テーブルは最新のテーブルとして、また、2重化された発生確率テーブルの他方である第2テーブルはバックアップ用のテーブルとして使用されることになるので、1マクロブロックについての算術復号化処理が有効でない場合は、そのマクロブロックについて算術復号化処理を行なう直前の状態に発生確率テーブルの値を戻すことが可能となる。しかも、2つのフラグを用いて制御する構成を採用すれば、フラグの値を変えるだけでバックアップ用のテーブルと最新のテーブルとを簡便に切り替えることが可能となる。   Similarly, according to the arithmetic decoding apparatus of the present invention, the first table that is one of the duplicated occurrence probability tables is the latest table and the other one of the duplicated occurrence probability tables. Since the second table is used as a backup table, if the arithmetic decoding process for one macroblock is not valid, the occurrence probability table of the occurrence table immediately before the arithmetic decoding process for the macroblock is set. The value can be returned. In addition, if a configuration in which control is performed using two flags is employed, it is possible to easily switch between the backup table and the latest table simply by changing the value of the flag.

これにより、算術復号化処理が有効でないマクロブロック部分のストリームデータをPCMデータに差し替えることが可能となる。また、再エンコードを行なう場合は、発生確率テーブルを初期化する時間と、算術復号化処理が有効であったマクロブロックについて算術復号化処理をやり直す時間とを削減することが可能となる。このように処理時間が削減されると電力消費量も削減されるので、電力消費量を抑えることが必要な装置に本発明を適用すると効果的である。   As a result, it is possible to replace the stream data of the macro block portion where the arithmetic decoding process is not effective with the PCM data. Also, when re-encoding is performed, it is possible to reduce the time for initializing the occurrence probability table and the time for performing the arithmetic decoding process again for the macroblocks for which the arithmetic decoding process is effective. When the processing time is thus reduced, the power consumption is also reduced. Therefore, it is effective to apply the present invention to an apparatus that needs to suppress the power consumption.

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

(実施の形態1)
図1は、本発明の概要を説明するための図である。既に説明した通り、従来技術によると、マクロブロック#5についての発生符号量が制限値を超えている場合は、そのマクロブロック#5について算術符号化処理を行なう直前の状態に発生確率テーブルの値を戻すことができないので、マクロブロック#5部分のストリームデータをPCMデータに差し替えることはできない。また、マクロブロック#5について再エンコードを行なう場合は、図14(B)に示されるように、発生確率テーブルを初期化したうえで、マクロブロック#1から順に算術符号化処理をやり直さなければならない。それに対して、本発明では、図1(B)に示されるように、マクロブロック#5についての発生符号量が制限値を超えている場合でも、そのマクロブロック#5について算術符号化処理を行なう直前の状態に発生確率テーブルの値を戻すことができる。
(Embodiment 1)
FIG. 1 is a diagram for explaining the outline of the present invention. As already described, according to the prior art, when the generated code amount for the macroblock # 5 exceeds the limit value, the value of the occurrence probability table is in a state immediately before the arithmetic coding process is performed for the macroblock # 5. Therefore, the stream data of the macro block # 5 cannot be replaced with PCM data. Further, when re-encoding is performed for the macroblock # 5, as shown in FIG. 14B, after the occurrence probability table is initialized, the arithmetic coding process must be performed again in order from the macroblock # 1. . On the other hand, in the present invention, as shown in FIG. 1B, even when the generated code amount for the macroblock # 5 exceeds the limit value, the arithmetic coding process is performed for the macroblock # 5. The value in the occurrence probability table can be returned to the previous state.

図2は、本発明の実施の形態1における算術符号化装置10の構成図である。この算術符号化装置10は、発生確率テーブルを使用して算術符号化処理を行なう装置であって、解析部11と、算術符号化部12と、判定部13と、初期化部14と、テーブル管理部15と、フラグ管理部16と、記憶部17とを備えている。ここでは、2値化部については図示を省略している。2値化部は、解析部11の前段にあればよく、算術符号化装置10内にあっても算術符号化装置10外にあってもよい。   FIG. 2 is a configuration diagram of the arithmetic coding apparatus 10 according to Embodiment 1 of the present invention. The arithmetic coding device 10 is a device that performs arithmetic coding processing using an occurrence probability table, and includes an analysis unit 11, an arithmetic coding unit 12, a determination unit 13, an initialization unit 14, and a table. A management unit 15, a flag management unit 16, and a storage unit 17 are provided. Here, illustration of the binarization unit is omitted. The binarization unit may be in the preceding stage of the analysis unit 11, and may be in the arithmetic encoding device 10 or outside the arithmetic encoding device 10.

解析部11は、2値化部からの入力信号を解析する。そして、入力信号にスライスの先頭が現れた場合はその旨を初期化部14に出力し、入力信号にマクロブロックの終端が現れた場合はその旨をフラグ管理部16に出力する。なお、2値化部からの入力信号は、解析部11を介して(又は、解析部11を介すことなく直接)算術符号化部12に入力される。   The analysis unit 11 analyzes the input signal from the binarization unit. When the head of the slice appears in the input signal, the fact is output to the initialization unit 14, and when the end of the macroblock appears in the input signal, the fact is outputted to the flag management unit 16. The input signal from the binarization unit is input to the arithmetic encoding unit 12 via the analysis unit 11 (or directly without going through the analysis unit 11).

記憶部17は、本発明に係るテーブル記憶手段及びフラグ記憶手段の一例であり、例えばRAM(Random Access Memory)である。記憶部17は、テーブル0及びテーブル1のエントリー毎に第1フラグと第2フラグとを対応付けて記憶している。テーブル0は、本発明に係る第1テーブル又は第2テーブルの一例であり、2重化された発生確率テーブルの一方である。テーブル1は、本発明に係る第1テーブル又は第2テーブルの一例であり、2重化された発生確率テーブルの他方である。第1フラグは、テーブル0又はテーブル1を示すフラグである。第1フラグの値が0である場合、その第1フラグはテーブル0を示していることになり、第1フラグの値が1である場合、その第1フラグはテーブル1を示していることになる。同様に、第2フラグは、テーブル0又はテーブル1を示すフラグである。第2フラグの値が0である場合、その第2フラグはテーブル0を示していることになり、第2フラグの値が1である場合、その第2フラグはテーブル1を示していることになる。   The storage unit 17 is an example of a table storage unit and a flag storage unit according to the present invention, and is, for example, a RAM (Random Access Memory). The storage unit 17 stores a first flag and a second flag in association with each entry of the table 0 and the table 1. The table 0 is an example of the first table or the second table according to the present invention, and is one of the duplicate occurrence probability tables. Table 1 is an example of the first table or the second table according to the present invention, and is the other of the duplicate occurrence probability tables. The first flag is a flag indicating the table 0 or the table 1. If the value of the first flag is 0, the first flag indicates table 0, and if the value of the first flag is 1, the first flag indicates table 1 Become. Similarly, the second flag is a flag indicating the table 0 or the table 1. When the value of the second flag is 0, the second flag indicates table 0, and when the value of the second flag is 1, the second flag indicates table 1 Become.

初期化部14は、本発明に係る初期化手段の一例であり、テーブル0とテーブル1とをスライス単位に初期化する。初期化部14の機能は、2重化されたテーブル0及びテーブル1を初期化する点を除き、従来と同様である。なお、初期化部14がテーブル0及びテーブル1を初期化する際にはテーブル管理部15を介すことになる。   The initialization unit 14 is an example of an initialization unit according to the present invention, and initializes table 0 and table 1 in units of slices. The function of the initialization unit 14 is the same as the conventional one except that the duplicated table 0 and table 1 are initialized. When the initialization unit 14 initializes the table 0 and the table 1, the table management unit 15 is used.

算術符号化部12は、本発明に係る算術符号化手段の一例であり、第2フラグによって示されるテーブルを使用して算術符号化処理を行なう。例えば、第2フラグの値が0である場合はテーブル0を使用し、第2フラグの値が1である場合はテーブル1を使用する。算術符号化部12の機能は、テーブル0又はテーブル1を使用して算術符号化処理を行なう点を除き、従来と同様である。なお、算術符号化部12がテーブル0又はテーブル1を使用する際にはテーブル管理部15を介すことになる。   The arithmetic encoding unit 12 is an example of arithmetic encoding means according to the present invention, and performs arithmetic encoding processing using a table indicated by the second flag. For example, when the value of the second flag is 0, the table 0 is used, and when the value of the second flag is 1, the table 1 is used. The function of the arithmetic encoding unit 12 is the same as the conventional one except that the arithmetic encoding process is performed using the table 0 or the table 1. Note that when the arithmetic coding unit 12 uses the table 0 or the table 1, the table management unit 15 is used.

テーブル管理部15は、本発明に係る更新手段の一例であり、第1フラグによって示されないテーブル、言い換えると、第1フラグによって示されるテーブルと逆のテーブルを算術符号化処理の結果に基づいて更新する。例えば、第1フラグの値が0である場合はテーブル1を更新し、第1フラグの値が1である場合はテーブル0を更新する。テーブル管理部15の機能は、テーブル0又はテーブル1を更新する点を除き、従来と同様である。   The table management unit 15 is an example of an updating unit according to the present invention, and updates a table not indicated by the first flag, in other words, a table opposite to the table indicated by the first flag based on the result of the arithmetic encoding process. To do. For example, when the value of the first flag is 0, the table 1 is updated, and when the value of the first flag is 1, the table 0 is updated. The function of the table management unit 15 is the same as the conventional one except that the table 0 or the table 1 is updated.

判定部13は、本発明に係る判定手段の一例であり、スライスに含まれる1マクロブロックについて算術符号化処理が完了する度に、そのマクロブロックについての算術符号化処理が有効であるか否かを判定する。例えば、算術符号化処理によって発生した符号量が所定量を越えていない場合は、そのマクロブロックについての算術符号化処理が有効であると判定し、算術符号化処理によって発生した符号量が所定量を超えている場合は、そのマクロブロックについての算術符号化処理が有効でないと判定する。ここでいう所定量とは、H.264/AVCにおいて規定されている制限値を意味する。判定部13は、発生符号量が制限値を超えているか否かを示す判定結果信号をフラグ管理部16に出力する。また、後述する廃棄指示信号をフラグ管理部16から受けた場合は、当該マクロブロックについての算術符号化処理の結果を廃棄する。   The determination unit 13 is an example of a determination unit according to the present invention, and whether or not the arithmetic encoding process for the macroblock is valid each time the arithmetic encoding process is completed for one macroblock included in the slice. Determine. For example, if the code amount generated by the arithmetic encoding process does not exceed a predetermined amount, it is determined that the arithmetic encoding process for the macroblock is valid, and the code amount generated by the arithmetic encoding process is a predetermined amount. Is exceeded, it is determined that the arithmetic coding process for the macroblock is not effective. The predetermined amount here is H.264. It means a limit value defined in H.264 / AVC. The determination unit 13 outputs a determination result signal indicating whether or not the generated code amount exceeds the limit value to the flag management unit 16. In addition, when a discard instruction signal described later is received from the flag management unit 16, the result of the arithmetic coding process for the macroblock is discarded.

フラグ管理部16は、本発明に係る制御手段の一例であり、第1フラグによって示されないテーブルが更新された場合は、第1フラグによって示されないテーブルを示すように第2フラグの値を変更する。また、発生符号量が制限値を超えていない旨の判定結果信号を判定部13から受けた場合など、算術符号化処理が有効であると判定された場合は、第1フラグの値を第2フラグに複製する。他方、発生符号量が制限値を超えている旨の判定結果信号を判定部13から受けた場合など、算術符号化処理が有効でないと判定された場合は、第2フラグの値を第1フラグに複製する。そして、このように第1フラグの値を第2フラグに複製した場合は、当該マクロブロックについての算術符号化処理の結果を廃棄する旨の信号(廃棄指示信号)を判定部13に出力する。   The flag management unit 16 is an example of a control unit according to the present invention, and when a table not indicated by the first flag is updated, the value of the second flag is changed to indicate a table not indicated by the first flag. . Further, when it is determined that the arithmetic encoding process is effective, such as when a determination result signal indicating that the generated code amount does not exceed the limit value is received from the determination unit 13, the value of the first flag is set to the second value. Duplicate the flag. On the other hand, when it is determined that the arithmetic encoding process is not effective, such as when a determination result signal indicating that the generated code amount exceeds the limit value is received from the determination unit 13, the value of the second flag is set to the first flag. Duplicate to. When the value of the first flag is copied to the second flag in this way, a signal (discard instruction signal) to discard the result of the arithmetic coding process for the macroblock is output to the determination unit 13.

図3は、発生確率テーブル内のコンテキスト配置を示す図である。発生確率テーブルは、コンテキストとその発生確率とを対応付けたテーブルである。本発明では、発生確率テーブルを2重化し、一方をテーブル0、他方をテーブル1と呼んでいる。図中に示す文字はシンタックス要素を示しており、図中の1レコードは1ビットに相当する。「mb_skip_run」や「mb_skip_flag」等は1ビットのシンタックス要素であるため1レコード内に表記し、「mb_type」は4ビットのシンタックス要素であるため4レコード内に表記している。コンテキスト(エントリー)は、シンタックス要素を構成する各符号に対応する情報であるため、図中の1レコードは1コンテキストに相当することにもなる。なお、この図3に示されるコンテキストの配置は単なる一例であって、実際はこのような配置にはなっていない。   FIG. 3 is a diagram showing a context arrangement in the occurrence probability table. The occurrence probability table is a table in which contexts and their occurrence probabilities are associated with each other. In the present invention, the occurrence probability table is duplicated, one is called table 0 and the other is called table 1. The characters shown in the figure indicate syntax elements, and one record in the figure corresponds to one bit. “Mb_skip_run”, “mb_skip_flag”, and the like are 1-bit syntax elements and are therefore described in one record, and “mb_type” is a 4-bit syntax element and are described in 4 records. Since the context (entry) is information corresponding to each code constituting the syntax element, one record in the figure corresponds to one context. Note that the arrangement of contexts shown in FIG. 3 is merely an example, and is not actually such an arrangement.

図4は、算術符号化装置10が行なう処理の手順を示すフローチャートである。以下、算術符号化の基本単位である1スライスについての動作について説明する。   FIG. 4 is a flowchart showing a procedure of processing performed by the arithmetic coding apparatus 10. The operation for one slice, which is the basic unit of arithmetic coding, will be described below.

まず、入力信号にスライスの先頭が現れた場合、初期化部14は、テーブル0とテーブル1とを初期化する(ステップS1)。その後、当該スライス内のマクロブロック数だけ、ステップS2〜S8の処理が繰り返される。   First, when the head of a slice appears in the input signal, the initialization unit 14 initializes table 0 and table 1 (step S1). Thereafter, the processes in steps S2 to S8 are repeated for the number of macroblocks in the slice.

すなわち、算術符号化部12は、発生確率テーブルを参照(使用)する必要が生じた場合、第2フラグによって示されるテーブルを参照する(ステップS2)。そして、参照した発生確率値を使用して算術符号化処理を行ない(ステップS3)、その算術符号化処理の結果に基づいて、第1フラグによって示されないテーブルを更新する(ステップS4)。前記した通り、テーブル参照(ステップS2)及びテーブル更新(ステップS4)はテーブル管理部15を介して行なわれる。その後、フラグ管理部16は、第1フラグによって示されないテーブルを示すように第2フラグの値を変更する(ステップS5)。   That is, when it becomes necessary to refer to (use) the occurrence probability table, the arithmetic encoding unit 12 refers to the table indicated by the second flag (step S2). Then, an arithmetic coding process is performed using the referenced occurrence probability value (step S3), and a table not indicated by the first flag is updated based on the result of the arithmetic coding process (step S4). As described above, the table reference (step S2) and the table update (step S4) are performed via the table management unit 15. Thereafter, the flag management unit 16 changes the value of the second flag so as to indicate a table not indicated by the first flag (step S5).

全てのコンテキスト数だけステップS2〜S5の処理が繰り返されると、判定部13は、当該マクロブロックについての発生符号量が制限値を超えているか否かを判定する(ステップS6)。フラグ管理部16は、発生符号量が制限値を超えていないと判定された場合は、第2フラグの値を第1フラグに複製する(ステップS7)。他方、発生符号量が制限値を越えていると判定された場合は、第1フラグの値を第2フラグに複製する(ステップS8)。   When the processes in steps S2 to S5 are repeated for all the context numbers, the determination unit 13 determines whether or not the generated code amount for the macroblock exceeds the limit value (step S6). If it is determined that the generated code amount does not exceed the limit value, the flag management unit 16 copies the value of the second flag to the first flag (step S7). On the other hand, when it is determined that the generated code amount exceeds the limit value, the value of the first flag is copied to the second flag (step S8).

以上の処理が全てのスライスについて完了すると、全体の処理が終了する。
なお、発生符号量が制限値を越えていると判定された場合(ステップS6)、判定部13は、そのマクロブロック部分のストリームデータをPCMデータに差し替える。これにより、発生符号量が制限値を超えているマクロブロック部分のストリームデータをPCMデータに差し替えることが可能となる。発生符号量が制限値を越えていると判定された場合(ステップS6)、算術符号化部12は、発生符号量を抑える制約を加えたうえで、そのマクロブロックについて算術符号化部12が再エンコードを行なうようにしてもよい。この場合は、発生確率テーブルを初期化する時間と、発生符号量が制限値を超えていなかったマクロブロックについて算術符号化処理をやり直す時間とを削減することが可能となる。
When the above processing is completed for all slices, the entire processing is completed.
When it is determined that the generated code amount exceeds the limit value (step S6), the determination unit 13 replaces the stream data of the macroblock portion with PCM data. As a result, it is possible to replace the stream data of the macro block portion where the generated code amount exceeds the limit value with the PCM data. When it is determined that the generated code amount exceeds the limit value (step S6), the arithmetic encoding unit 12 adds a constraint to suppress the generated code amount, and the arithmetic encoding unit 12 re-executes the macroblock. Encoding may be performed. In this case, it is possible to reduce the time for initializing the occurrence probability table and the time for redoing the arithmetic coding process for the macroblock whose generated code amount did not exceed the limit value.

ここで、第1フラグによって示されるテーブルは、算術符号化処理中のマクロブロックについて算術符号化処理を行なう直前の発生確率テーブル、すなわちバックアップ用のテーブルと考えることができる。また、第2フラグによって示されるテーブルは、算術符号化処理中に更新される発生確率テーブル、すなわち最新のテーブルと考えることができる。   Here, the table indicated by the first flag can be considered as an occurrence probability table immediately before the arithmetic coding process is performed on the macroblock being subjected to the arithmetic coding process, that is, a backup table. The table indicated by the second flag can be considered as an occurrence probability table updated during the arithmetic encoding process, that is, the latest table.

そこで、算術符号化処理中にテーブルを参照する場合は、最新のテーブル、すなわち第2フラグによって示されるテーブルを参照するようにしている(ステップS2)。また、算術符号化処理中にテーブル更新する場合は、バックアップ用のテーブルでないテーブル、すなわち第1フラグによって示されないテーブルを更新するようにしている(ステップS4)。   Therefore, when referring to the table during the arithmetic encoding process, the latest table, that is, the table indicated by the second flag is referred to (step S2). When updating the table during the arithmetic coding process, a table that is not a backup table, that is, a table not indicated by the first flag is updated (step S4).

そして、このようにバックアップ用のテーブルでないテーブルが更新された場合は、バックアップ用のテーブルでないテーブルを示すように第2フラグの値を変更するようにしている(ステップS5)。バックアップ用のテーブルでないテーブルを示すように第2フラグの値を変更すれば、それ以降は、バックアップ用のテーブルでないテーブルを最新のテーブルと考えることができるからである。   When a table that is not a backup table is updated in this way, the value of the second flag is changed to indicate a table that is not a backup table (step S5). This is because if the value of the second flag is changed to indicate a table that is not a backup table, the table that is not a backup table can be considered as the latest table thereafter.

また、発生符号量が制限値を超えていない場合は、第2フラグの値を第1フラグに複製するようにしている(ステップS7)。第2フラグの値を第1フラグに複製すれば、最新のテーブルの値をバックアップ用のテーブルに複製した場合と同じ効果を得ることができるからである。他方、発生符号量が制限値を越えている場合は、第1フラグの値を第2フラグに複製するようにしている(ステップS8)。第1フラグの値を第2フラグに複製すれば、バックアップ用のテーブルの値を最新のテーブルに複製した場合と同じ効果を得ることができるからである。   If the generated code amount does not exceed the limit value, the value of the second flag is copied to the first flag (step S7). This is because if the value of the second flag is copied to the first flag, the same effect as that obtained when the latest table value is copied to the backup table can be obtained. On the other hand, if the generated code amount exceeds the limit value, the value of the first flag is copied to the second flag (step S8). This is because if the value of the first flag is duplicated to the second flag, the same effect as when the value of the backup table is duplicated to the latest table can be obtained.

図5は、テーブル参照とテーブル更新を詳細に説明するための図である。以下、テーブル更新前のフラグの値と、テーブル参照更新態様と、テーブル更新後のフラグの値とを具体的に説明する。テーブル更新前における第1フラグの値と第2フラグの値の組み合わせとしては、(第1フラグの値,第2フラグの値)と表記すると、(0,0)(0,1)(1,0)(1,1)の4通りが存在する。そこで、ここでは、テーブル更新前における第1フラグの値と第2フラグの値の組み合わせが(0,0)の場合をケース1、(0,1)の場合をケース2、(1,0)の場合をケース3、(1,1)の場合をケース4という。   FIG. 5 is a diagram for explaining the table reference and the table update in detail. Hereinafter, the flag value before the table update, the table reference update mode, and the flag value after the table update will be described in detail. The combination of the value of the first flag and the value of the second flag before the table update is expressed as (0, 0) (0, 1) (1, 0) There are four types of (1, 1). Therefore, here, the case where the combination of the value of the first flag and the value of the second flag before the table update is (0, 0) is case 1, the case of (0, 1) is case 2, and (1, 0). Case 3 is referred to as case 3, and case (1,1) is referred to as case 4.

ケース1では、テーブル更新前における第1フラグの値と第2フラグの値は(0,0)である。第1フラグの値が0であるということは、バックアップ用のテーブルはテーブル0であることを意味している。また、第2フラグの値が0であるということは、最新のテーブルはテーブル0であることを意味している。そこで、算術符号化処理中にテーブルを参照する場合は、最新のテーブル、すなわちテーブル0を参照することになる。また、算術符号化処理中にテーブル更新する場合は、バックアップ用のテーブルでないテーブル、すなわちテーブル1を更新することになる。そして、このようにテーブル1が更新された場合は、テーブル1を示すように第2フラグの値を変更する。その結果、テーブル更新後における第1フラグの値と第2フラグの値は(0,1)となる。   In case 1, the values of the first flag and the second flag before the table update are (0, 0). The value of the first flag being 0 means that the backup table is table 0. In addition, the value of the second flag being 0 means that the latest table is table 0. Therefore, when referring to the table during the arithmetic encoding process, the latest table, that is, the table 0 is referred to. When updating the table during the arithmetic encoding process, the table that is not a backup table, that is, the table 1 is updated. When the table 1 is updated in this way, the value of the second flag is changed so as to indicate the table 1. As a result, the value of the first flag and the value of the second flag after the table update are (0, 1).

ケース2では、テーブル更新前における第1フラグの値と第2フラグの値は(0,1)である。第1フラグの値が0であるということは、バックアップ用のテーブルはテーブル0であることを意味している。また、第2フラグの値が1であるということは、最新のテーブルはテーブル1であることを意味している。そこで、算術符号化処理中にテーブルを参照する場合は、最新のテーブル、すなわちテーブル1を参照することになる。また、算術符号化処理中にテーブル更新する場合は、バックアップ用のテーブルでないテーブル、すなわちテーブル1を更新することになる。そして、このようにテーブル1が更新された場合は、テーブル1を示すように第2フラグの値を変更する。その結果、テーブル更新後における第1フラグの値と第2フラグの値は(0,1)となる。なお、このケース2では、第2フラグの値は元々1であるため、実質的には第2フラグの値は変わらない。   In Case 2, the values of the first flag and the second flag before the table update are (0, 1). The value of the first flag being 0 means that the backup table is table 0. Further, the value of the second flag being 1 means that the latest table is table 1. Therefore, when referring to the table during the arithmetic encoding process, the latest table, that is, the table 1 is referred to. When updating the table during the arithmetic encoding process, the table that is not a backup table, that is, the table 1 is updated. When the table 1 is updated in this way, the value of the second flag is changed so as to indicate the table 1. As a result, the value of the first flag and the value of the second flag after the table update are (0, 1). In Case 2, since the value of the second flag is originally 1, the value of the second flag is not substantially changed.

ケース3では、テーブル更新前における第1フラグの値と第2フラグの値は(1,0)である。第1フラグの値が1であるということは、バックアップ用のテーブルはテーブル1であることを意味している。また、第2フラグの値が0であるということは、最新のテーブルはテーブル0であることを意味している。そこで、算術符号化処理中にテーブルを参照する場合は、最新のテーブル、すなわちテーブル0を参照することになる。また、算術符号化処理中にテーブル更新する場合は、バックアップ用のテーブルでないテーブル、すなわちテーブル0を更新することになる。そして、このようにテーブル0が更新された場合は、テーブル0を示すように第2フラグの値を変更する。その結果、テーブル更新後における第1フラグの値と第2フラグの値は(1,0)となる。なお、このケース3では、第2フラグの値は元々0であるため、実質的には第2フラグの値は変わらない。   In Case 3, the value of the first flag and the value of the second flag before the table update are (1, 0). That the value of the first flag is 1 means that the backup table is table 1. In addition, the value of the second flag being 0 means that the latest table is table 0. Therefore, when referring to the table during the arithmetic encoding process, the latest table, that is, the table 0 is referred to. When updating the table during the arithmetic coding process, a table that is not a backup table, that is, table 0 is updated. When the table 0 is updated in this way, the value of the second flag is changed so as to indicate the table 0. As a result, the value of the first flag and the value of the second flag after the table update are (1, 0). In Case 3, since the value of the second flag is originally 0, the value of the second flag is not substantially changed.

ケース4では、テーブル更新前における第1フラグの値と第2フラグの値は(1,1)である。第1フラグの値が1であるということは、バックアップ用のテーブルはテーブル1であることを意味している。また、第2フラグの値が1であるということは、最新のテーブルはテーブル1であることを意味している。そこで、算術符号化処理中にテーブルを参照する場合は、最新のテーブル、すなわちテーブル1を参照することになる。また、算術符号化処理中にテーブル更新する場合は、バックアップ用のテーブルでないテーブル、すなわちテーブル0を更新することになる。そして、このようにテーブル0が更新された場合は、テーブル0を示すように第2フラグの値を変更する。その結果、テーブル更新後における第1フラグの値と第2フラグの値は(1,0)となる。   In Case 4, the values of the first flag and the second flag before the table update are (1, 1). That the value of the first flag is 1 means that the backup table is table 1. Further, the value of the second flag being 1 means that the latest table is table 1. Therefore, when referring to the table during the arithmetic encoding process, the latest table, that is, the table 1 is referred to. When updating the table during the arithmetic coding process, a table that is not a backup table, that is, table 0 is updated. When the table 0 is updated in this way, the value of the second flag is changed so as to indicate the table 0. As a result, the value of the first flag and the value of the second flag after the table update are (1, 0).

図6は、フラグの値を複製する処理を詳細に説明するための図である。前記したように、発生符号量が制限値を超えていないと判定された場合は、第2フラグの値が第1フラグに複製され、発生符号量が制限値を越えていると判定された場合は、第1フラグの値が第2フラグに複製される。図6(A)では、第2フラグの値が第1フラグに複製される場合を想定し、その複製前後の第1フラグの値と第2フラグの値を示している。図6(B)では、第1フラグの値が第2フラグに複製される場合を想定し、その複製前後の第1フラグの値と第2フラグの値を示している。複製前における第1フラグの値と第2フラグの値の組み合わせとしては(0,0)(0,1)(1,0)(1,1)の4通りが存在するので、ここでは、その組み合わせが(0,0)の場合をケース1、(0,1)の場合をケース2、(1,0)の場合をケース3、(1,1)の場合をケース4という。   FIG. 6 is a diagram for explaining in detail the process of copying the flag value. As described above, when it is determined that the generated code amount does not exceed the limit value, the value of the second flag is copied to the first flag, and it is determined that the generated code amount exceeds the limit value The value of the first flag is copied to the second flag. In FIG. 6A, it is assumed that the value of the second flag is duplicated in the first flag, and the values of the first flag and the second flag before and after the duplication are shown. In FIG. 6B, it is assumed that the value of the first flag is duplicated to the second flag, and the values of the first flag and the second flag before and after the duplication are shown. There are four combinations (0, 0) (0, 1) (1, 0) (1, 1) as combinations of the value of the first flag and the value of the second flag before duplication. The case where the combination is (0, 0) is referred to as case 1, the case where (0, 1) is referred to as case 2, the case where (1, 0) is referred to as case 3, and the case where (1, 1) is referred to as case 4.

まず、図6(A)を用いて第2フラグの値が第1フラグに複製される場合を説明する。
ケース1では、複製前における第1フラグの値と第2フラグの値は(0,0)である。第1フラグの値が0であるということは、バックアップ用のテーブルはテーブル0であることを意味している。また、第2フラグの値が0であるということは、最新のテーブルはテーブル0であることを意味している。この状態で発生符号量が制限値を超えていないと判定された場合は、第2フラグの値が第1フラグに複製される。その結果、複製後における第1フラグの値と第2フラグの値は(0,0)となる。なお、このケース1では、第1フラグの値は元々0であるため、実質的には第1フラグの値は変わらない。以降、引き続きテーブル0をバックアップ用のテーブルとして、また、引き続きテーブル0を最新のテーブルとして、次のマクロブロックが処理されることになる。
First, the case where the value of the second flag is copied to the first flag will be described with reference to FIG.
In case 1, the value of the first flag and the value of the second flag before duplication are (0, 0). The value of the first flag being 0 means that the backup table is table 0. In addition, the value of the second flag being 0 means that the latest table is table 0. When it is determined that the generated code amount does not exceed the limit value in this state, the value of the second flag is copied to the first flag. As a result, the value of the first flag and the value of the second flag after copying are (0, 0). In Case 1, since the value of the first flag is originally 0, the value of the first flag is not substantially changed. Thereafter, the next macroblock is processed with the table 0 as the backup table and the table 0 as the latest table.

ケース2では、複製前における第1フラグの値と第2フラグの値は(0,1)である。第1フラグの値が0であるということは、バックアップ用のテーブルはテーブル0であることを意味している。また、第2フラグの値が1であるということは、最新のテーブルはテーブル1であることを意味している。この状態で発生符号量が制限値を超えていないと判定された場合は、第2フラグの値が第1フラグに複製される。その結果、複製後における第1フラグの値と第2フラグの値は(1,1)となる。以降、新たにテーブル1をバックアップ用のテーブルとして、また、引き続きテーブル1を最新のテーブルとして、次のマクロブロックが処理されることになる。   In Case 2, the value of the first flag and the value of the second flag before duplication are (0, 1). The value of the first flag being 0 means that the backup table is table 0. Further, the value of the second flag being 1 means that the latest table is table 1. When it is determined that the generated code amount does not exceed the limit value in this state, the value of the second flag is copied to the first flag. As a result, the value of the first flag and the value of the second flag after duplication are (1, 1). Thereafter, the next macroblock is processed with the table 1 as a new backup table and the table 1 as the latest table.

ケース3では、複製前における第1フラグの値と第2フラグの値は(1,0)である。第1フラグの値が1であるということは、バックアップ用のテーブルはテーブル1であることを意味している。また、第2フラグの値が0であるということは、最新のテーブルはテーブル0であることを意味している。この状態で発生符号量が制限値を超えていないと判定された場合は、第2フラグの値が第1フラグに複製される。その結果、複製後における第1フラグの値と第2フラグの値は(0,0)となる。以降、新たにテーブル0をバックアップ用のテーブルとして、また、引き続きテーブル0を最新のテーブルとして、次のマクロブロックが処理されることになる。   In Case 3, the value of the first flag and the value of the second flag before duplication are (1, 0). That the value of the first flag is 1 means that the backup table is table 1. In addition, the value of the second flag being 0 means that the latest table is table 0. When it is determined that the generated code amount does not exceed the limit value in this state, the value of the second flag is copied to the first flag. As a result, the value of the first flag and the value of the second flag after copying are (0, 0). Thereafter, the next macroblock is processed with the table 0 as a new backup table and the table 0 as the latest table.

ケース4では、複製前における第1フラグの値と第2フラグの値は(1,1)である。第1フラグの値が1であるということは、バックアップ用のテーブルはテーブル1であることを意味している。また、第2フラグの値が1であるということは、最新のテーブルはテーブル1であることを意味している。この状態で発生符号量が制限値を超えていないと判定された場合は、第2フラグの値が第1フラグに複製される。その結果、複製後における第1フラグの値と第2フラグの値は(1,1)となる。なお、このケース4では、第1フラグの値は元々1であるため、実質的には第1フラグの値は変わらない。以降、引き続きテーブル1をバックアップ用のテーブルとして、また、引き続きテーブル1を最新のテーブルとして、次のマクロブロックが処理されることになる。   In Case 4, the value of the first flag and the value of the second flag before duplication are (1, 1). That the value of the first flag is 1 means that the backup table is table 1. Further, the value of the second flag being 1 means that the latest table is table 1. When it is determined that the generated code amount does not exceed the limit value in this state, the value of the second flag is copied to the first flag. As a result, the value of the first flag and the value of the second flag after duplication are (1, 1). In Case 4, since the value of the first flag is originally 1, the value of the first flag is not substantially changed. Thereafter, the next macroblock is processed with the table 1 as the backup table and the table 1 as the latest table.

次に、図6(B)を用いて第1フラグの値が第2フラグに複製される場合を説明する。
ケース1では、複製前における第1フラグの値と第2フラグの値は(0,0)である。第1フラグの値が0であるということは、バックアップ用のテーブルはテーブル0であることを意味している。また、第2フラグの値が0であるということは、最新のテーブルはテーブル0であることを意味している。この状態で発生符号量が制限値を超えていると判定された場合は、第1フラグの値が第2フラグに複製される。その結果、複製後における第1フラグの値と第2フラグの値は(0,0)となる。なお、このケース1では、第2フラグの値は元々0であるため、実質的には第2フラグの値は変わらない。以降、引き続きテーブル0をバックアップ用のテーブルとして、また、引き続きテーブル0を最新のテーブルとして、次のマクロブロックが処理されることになる。
Next, a case where the value of the first flag is copied to the second flag will be described with reference to FIG.
In case 1, the value of the first flag and the value of the second flag before duplication are (0, 0). The value of the first flag being 0 means that the backup table is table 0. In addition, the value of the second flag being 0 means that the latest table is table 0. In this state, when it is determined that the generated code amount exceeds the limit value, the value of the first flag is copied to the second flag. As a result, the value of the first flag and the value of the second flag after copying are (0, 0). In Case 1, since the value of the second flag is originally 0, the value of the second flag is not substantially changed. Thereafter, the next macroblock is processed with the table 0 as the backup table and the table 0 as the latest table.

ケース2では、複製前における第1フラグの値と第2フラグの値は(0,1)である。第1フラグの値が0であるということは、バックアップ用のテーブルはテーブル0であることを意味している。また、第2フラグの値が1であるということは、最新のテーブルはテーブル1であることを意味している。この状態で発生符号量が制限値を超えていると判定された場合は、第1フラグの値が第2フラグに複製される。その結果、複製後における第1フラグの値と第2フラグの値は(0,0)となる。以降、引き続きテーブル0をバックアップ用のテーブルとして、また、新たにテーブル0を最新のテーブルとして、次のマクロブロックが処理されることになる。   In Case 2, the value of the first flag and the value of the second flag before duplication are (0, 1). The value of the first flag being 0 means that the backup table is table 0. Further, the value of the second flag being 1 means that the latest table is table 1. In this state, when it is determined that the generated code amount exceeds the limit value, the value of the first flag is copied to the second flag. As a result, the value of the first flag and the value of the second flag after copying are (0, 0). Subsequently, the next macroblock is processed with the table 0 as the backup table and the new table 0 as the latest table.

ケース3では、複製前における第1フラグの値と第2フラグの値は(1,0)である。第1フラグの値が1であるということは、バックアップ用のテーブルはテーブル1であることを意味している。また、第2フラグの値が0であるということは、最新のテーブルはテーブル0であることを意味している。この状態で発生符号量が制限値を超えていると判定された場合は、第1フラグの値が第2フラグに複製される。その結果、複製後における第1フラグの値と第2フラグの値は(1,1)となる。以降、引き続きテーブル1をバックアップ用のテーブルとして、また、新たにテーブル1を最新のテーブルとして、次のマクロブロックが処理されることになる。   In Case 3, the value of the first flag and the value of the second flag before duplication are (1, 0). That the value of the first flag is 1 means that the backup table is table 1. In addition, the value of the second flag being 0 means that the latest table is table 0. In this state, when it is determined that the generated code amount exceeds the limit value, the value of the first flag is copied to the second flag. As a result, the value of the first flag and the value of the second flag after duplication are (1, 1). Subsequently, the next macroblock is processed with the table 1 as the backup table and the new table 1 as the latest table.

ケース4では、複製前における第1フラグの値と第2フラグの値は(1,1)である。第1フラグの値が1であるということは、バックアップ用のテーブルはテーブル1であることを意味している。また、第2フラグの値が1であるということは、最新のテーブルはテーブル1であることを意味している。この状態で発生符号量が制限値を超えていると判定された場合は、第1フラグの値が第2フラグに複製される。その結果、複製後における第1フラグの値と第2フラグの値は(1,1)となる。なお、このケース4では、第2フラグの値は元々1であるため、実質的には第2フラグの値は変わらない。以降、引き続きテーブル1をバックアップ用のテーブルとして、また、引き続きテーブル1を最新のテーブルとして、次のマクロブロックが処理されることになる。   In Case 4, the value of the first flag and the value of the second flag before duplication are (1, 1). That the value of the first flag is 1 means that the backup table is table 1. Further, the value of the second flag being 1 means that the latest table is table 1. In this state, when it is determined that the generated code amount exceeds the limit value, the value of the first flag is copied to the second flag. As a result, the value of the first flag and the value of the second flag after duplication are (1, 1). In this case 4, since the value of the second flag is originally 1, the value of the second flag is not substantially changed. Thereafter, the next macroblock is processed with the table 1 as the backup table and the table 1 as the latest table.

図7は、フラグとテーブルの状態遷移を示す図である。ここでは、発生符号量が制限値を超えていないと判定された場合の状態遷移について説明する。   FIG. 7 is a diagram showing state transitions of flags and tables. Here, the state transition when it is determined that the generated code amount does not exceed the limit value will be described.

図7(A)は、テーブル0及びテーブル1が初期化された直後の状態を示している。テーブル0及びテーブル1が初期化された直後の状態では、第1フラグの値と第2フラグの値は(0,0)である。このケースは、図5でいうケース1に相当する。すなわち、第1フラグの値が0であるということは、バックアップ用のテーブルはテーブル0であることを意味している。また、第2フラグの値が0であるということは、最新のテーブルはテーブル0であることを意味している。ここでは図示を省略しているが、テーブル0及びテーブル1の同一エントリーには、同一の発生確率値(初期値)が設定されている。   FIG. 7A shows a state immediately after the table 0 and the table 1 are initialized. In the state immediately after the table 0 and the table 1 are initialized, the value of the first flag and the value of the second flag are (0, 0). This case corresponds to case 1 in FIG. That is, the value of the first flag being 0 means that the backup table is table 0. In addition, the value of the second flag being 0 means that the latest table is table 0. Although not shown here, the same occurrence probability value (initial value) is set to the same entry in Table 0 and Table 1.

図7(B)は、テーブル0及びテーブル1が初期化された後、テーブル参照とテーブル更新とが行なわれた直後の状態を示している。テーブル0及びテーブル1が初期化された直後の状態では、バックアップ用のテーブルはテーブル0であり、最新のテーブルはテーブル0である。そこで、図5のケース1で説明した通り、算術符号化処理中にテーブルを参照する場合は、最新のテーブル、すなわちテーブル0を参照することになる。また、算術符号化処理中にテーブル更新する場合は、バックアップ用のテーブルでないテーブル、すなわちテーブル1を更新することになる。そして、このようにテーブル1が更新された場合は、テーブル1を示すように第2フラグの値を変更する。その結果、テーブル更新後における第1フラグの値と第2フラグの値は(0,1)となる。   FIG. 7B shows a state immediately after table 0 and table 1 are initialized and table reference and table update are performed. In a state immediately after the table 0 and the table 1 are initialized, the backup table is the table 0, and the latest table is the table 0. Therefore, as described in case 1 of FIG. 5, when referring to the table during the arithmetic encoding process, the latest table, that is, table 0 is referred to. When updating the table during the arithmetic encoding process, the table that is not a backup table, that is, the table 1 is updated. When the table 1 is updated in this way, the value of the second flag is changed so as to indicate the table 1. As a result, the value of the first flag and the value of the second flag after the table update are (0, 1).

ここでは、先頭のエントリーが参照された結果、先頭のエントリーが更新される状態を示しているが、参照されるエントリーと更新されるエントリーは同一であるとは限らない。例えば、先頭のエントリーが参照された結果、先頭のエントリーと先頭から2番目のエントリーとが更新される場合もある。このようなテーブル参照とテーブル更新とは、全てのコンテキスト数だけ繰り返されることになるが、ここでは簡単のため1回ずつ行なわれたものと仮定して説明する。   Here, the state in which the top entry is updated as a result of referring to the top entry is shown, but the entry to be referred to and the entry to be updated are not necessarily the same. For example, as a result of referring to the top entry, the top entry and the second entry from the top may be updated. Such table reference and table update are repeated by the number of all contexts. Here, for the sake of simplicity, it is assumed that the table reference and table update are performed once.

図7(C)は、テーブル参照とテーブル更新とが行なわれた後、発生符号量が制限値を超えていないと判定された直後の状態を示している。テーブル参照とテーブル更新とが行なわれた直後の状態では、バックアップ用のテーブルはテーブル0であり、最新のテーブルはテーブル1である。このケースは、図6(A)でいうケース2に相当する。すなわち、発生符号量が制限値を超えていないと判定された場合は、第2フラグの値が第1フラグに複製される。その結果、複製後における第1フラグの値と第2フラグの値は(1,1)となる。以降、新たにテーブル1をバックアップ用のテーブルとして、また、引き続きテーブル1を最新のテーブルとして、次のマクロブロックが処理されることになる。   FIG. 7C shows a state immediately after it is determined that the generated code amount does not exceed the limit value after table reference and table update are performed. In a state immediately after the table reference and the table update are performed, the backup table is the table 0, and the latest table is the table 1. This case corresponds to Case 2 in FIG. That is, when it is determined that the generated code amount does not exceed the limit value, the value of the second flag is copied to the first flag. As a result, the value of the first flag and the value of the second flag after duplication are (1, 1). Thereafter, the next macroblock is processed with the table 1 as a new backup table and the table 1 as the latest table.

図7(D)は、第2フラグの値が第1フラグに複製された後、テーブル参照とテーブル更新とが行なわれた直後の状態を示している。第2フラグの値が第1フラグに複製された直後の状態では、バックアップ用のテーブルはテーブル1であり、最新のテーブルはテーブル1である。そこで、図5のケース4で説明した通り、算術符号化処理中にテーブルを参照する場合は、最新のテーブル、すなわちテーブル1を参照することになる。また、算術符号化処理中にテーブル更新する場合は、バックアップ用のテーブルでないテーブル、すなわちテーブル0を更新することになる。そして、このようにテーブル0が更新された場合は、テーブル0を示すように第2フラグの値を変更する。その結果、テーブル更新後における第1フラグの値と第2フラグの値は(1,0)となる。   FIG. 7D shows a state immediately after the table reference and the table update are performed after the value of the second flag is copied to the first flag. In a state immediately after the value of the second flag is copied to the first flag, the backup table is table 1, and the latest table is table 1. Therefore, as described in case 4 of FIG. 5, when the table is referred to during the arithmetic encoding process, the latest table, that is, the table 1 is referred to. When updating the table during the arithmetic coding process, a table that is not a backup table, that is, table 0 is updated. When the table 0 is updated in this way, the value of the second flag is changed so as to indicate the table 0. As a result, the value of the first flag and the value of the second flag after the table update are (1, 0).

図8は、フラグとテーブルの状態遷移を示す図である。ここでは、発生符号量が制限値を超えていると判定された場合の状態遷移について説明する。   FIG. 8 is a diagram showing state transitions of flags and tables. Here, the state transition when it is determined that the generated code amount exceeds the limit value will be described.

図8(A)の内容は、図7(A)と同じである。すなわち、テーブル0及びテーブル1が初期化された直後の状態を示している。第1フラグの値が0であるということは、バックアップ用のテーブルはテーブル0であることを意味している。また、第2フラグの値が0であるということは、最新のテーブルはテーブル0であることを意味している。   The contents of FIG. 8A are the same as those of FIG. That is, it shows a state immediately after the table 0 and the table 1 are initialized. The value of the first flag being 0 means that the backup table is table 0. In addition, the value of the second flag being 0 means that the latest table is table 0.

図8(B)の内容は、図7(B)と同じである。すなわち、算術符号化処理中にテーブルを参照する場合は、最新のテーブル、すなわちテーブル0を参照することになる。また、算術符号化処理中にテーブル更新する場合は、バックアップ用のテーブルでないテーブル、すなわちテーブル1を更新することになる。そして、このようにテーブル1が更新された場合は、テーブル1を示すように第2フラグの値を変更する。その結果、テーブル更新後における第1フラグの値と第2フラグの値は(0,1)となる。   The content of FIG. 8 (B) is the same as FIG. 7 (B). That is, when referring to the table during the arithmetic encoding process, the latest table, that is, the table 0 is referred to. When updating the table during the arithmetic encoding process, the table that is not a backup table, that is, the table 1 is updated. When the table 1 is updated in this way, the value of the second flag is changed so as to indicate the table 1. As a result, the value of the first flag and the value of the second flag after the table update are (0, 1).

図8(C)は、テーブル参照とテーブル更新とが行なわれた後、発生符号量が制限値を超えていると判定された直後の状態を示している。テーブル参照とテーブル更新とが行なわれた直後の状態では、バックアップ用のテーブルはテーブル0であり、最新のテーブルはテーブル1である。このケースは、図6(B)でいうケース2に相当する。すなわち、発生符号量が制限値を超えていると判定された場合は、第1フラグの値が第2フラグに複製される。その結果、複製後における第1フラグの値と第2フラグの値は(0,0)となる。以降、引き続きテーブル0をバックアップ用のテーブルとして、また、新たにテーブル0を最新のテーブルとして、次のマクロブロックが処理されることになる。   FIG. 8C shows a state immediately after it is determined that the generated code amount exceeds the limit value after table reference and table update are performed. In a state immediately after the table reference and the table update are performed, the backup table is the table 0, and the latest table is the table 1. This case corresponds to Case 2 in FIG. That is, when it is determined that the generated code amount exceeds the limit value, the value of the first flag is copied to the second flag. As a result, the value of the first flag and the value of the second flag after copying are (0, 0). Subsequently, the next macroblock is processed with the table 0 as the backup table and the new table 0 as the latest table.

図8(D)は、第1フラグの値が第2フラグに複製された後、テーブル参照とテーブル更新とが行なわれた直後の状態を示している。第1フラグの値が第2フラグに複製された直後の状態では、バックアップ用のテーブルはテーブル0であり、最新のテーブルはテーブル0である。そこで、図5のケース1で説明した通り、算術符号化処理中にテーブルを参照する場合は、最新のテーブル、すなわちテーブル0を参照することになる。また、算術符号化処理中にテーブル更新する場合は、バックアップ用のテーブルでないテーブル、すなわちテーブル1を更新することになる。そして、このようにテーブル1が更新された場合は、テーブル1を示すように第2フラグの値を変更する。その結果、テーブル更新後における第1フラグの値と第2フラグの値は(0,1)となる。   FIG. 8D shows a state immediately after the table reference and the table update are performed after the value of the first flag is copied to the second flag. In a state immediately after the value of the first flag is copied to the second flag, the backup table is table 0, and the latest table is table 0. Therefore, as described in case 1 of FIG. 5, when referring to the table during the arithmetic encoding process, the latest table, that is, table 0 is referred to. When updating the table during the arithmetic encoding process, the table that is not a backup table, that is, the table 1 is updated. When the table 1 is updated in this way, the value of the second flag is changed so as to indicate the table 1. As a result, the value of the first flag and the value of the second flag after the table update are (0, 1).

以上のように、本発明に係る算術符号化装置によれば、第1フラグによって示されるテーブルはバックアップ用のテーブルとして、また、第2フラグによって示されるテーブルは最新のテーブルとして使用されることになるので、1マクロブロックについての算術符号化処理によって発生した符号量が制限値を超えている場合は、そのマクロブロックについて算術符号化処理を行なう直前の状態に発生確率テーブルの値を戻すことが可能となる。しかも、2つのフラグを用いて制御する構成を採用しているので、フラグの値を変えるだけでバックアップ用のテーブルと最新のテーブルとを簡便に切り替えることが可能である。   As described above, according to the arithmetic coding apparatus according to the present invention, the table indicated by the first flag is used as a backup table, and the table indicated by the second flag is used as the latest table. Therefore, if the amount of code generated by the arithmetic coding process for one macroblock exceeds the limit value, the value of the occurrence probability table may be returned to the state immediately before the arithmetic coding process is performed for that macroblock. It becomes possible. In addition, since the control is performed using two flags, it is possible to easily switch between the backup table and the latest table simply by changing the value of the flag.

これにより、発生符号量が制限値を超えているマクロブロック部分のストリームデータをPCMデータに差し替えることが可能となる。また、再エンコードを行なう場合は、発生確率テーブルを初期化する時間と、発生符号量が制限値を超えていなかったマクロブロックについて算術符号化処理をやり直す時間とを削減することが可能となる。このように処理時間が削減されると電力消費量も削減されるので、電力消費量を抑えることが必要な装置に本発明を適用すると効果的である。   As a result, it is possible to replace the stream data of the macro block portion in which the generated code amount exceeds the limit value with the PCM data. Also, when re-encoding is performed, it is possible to reduce the time for initializing the occurrence probability table and the time for performing the arithmetic coding process again for a macroblock whose generated code amount does not exceed the limit value. When the processing time is thus reduced, the power consumption is also reduced. Therefore, it is effective to apply the present invention to an apparatus that needs to suppress the power consumption.

なお、ここでは、第1フラグと第2フラグという2つのフラグを用いて制御することとしているが、本発明はこれに限定されるものではない。すなわち、テーブル0を最新のテーブルとして、また、テーブル1をバックアップ用のテーブルとして固定的に使用する構成を採用すれば、フラグを用いることなく同様の効果を得ることができる。ただし、このような構成を採用した場合は、第1フラグと第2フラグとの間でフラグの値を相互に複製する処理に代えて、テーブル0とテーブル1との間でテーブルの値を相互に複製する処理が必要となる。すなわち、発生符号量が制限値を超えている場合は、バックアップ用のテーブルであるテーブル1の値を最新のテーブルであるテーブル0に複製する処理が必要となる。他方、発生符号量が制限値を超えていない場合は、最新のテーブルであるテーブル0の値をバックアップ用のテーブルであるテーブル1に複製する処理が必要となる。このようにテーブルの値を複製するよりもフラグの値を複製する方が処理速度の面で好ましいのはいうまでもない。   Here, the control is performed using the two flags of the first flag and the second flag, but the present invention is not limited to this. That is, if a configuration in which the table 0 is fixedly used as the latest table and the table 1 is fixedly used as a backup table, the same effect can be obtained without using a flag. However, when such a configuration is adopted, instead of the process of mutually copying the flag values between the first flag and the second flag, the table values are mutually exchanged between the table 0 and the table 1. It is necessary to copy the file. That is, when the generated code amount exceeds the limit value, it is necessary to copy the value of the table 1 as the backup table to the table 0 as the latest table. On the other hand, when the generated code amount does not exceed the limit value, it is necessary to copy the value of the table 0 as the latest table to the table 1 as the backup table. Needless to say, it is more preferable in terms of processing speed to duplicate the flag value than to duplicate the table value.

また、ここでは、発生符号量が制限値を超えている場合に本発明の効果が得られる旨の説明をしたが、本発明はこれに限定されるものではない。すなわち、1マクロブロックについての算術符号化処理が有効でない場合であれば、前記と同様の効果を得ることができる。   Further, here, it has been described that the effect of the present invention can be obtained when the generated code amount exceeds the limit value, but the present invention is not limited to this. That is, if the arithmetic coding process for one macroblock is not effective, the same effect as described above can be obtained.

また、図4では、第2フラグの値を変更するステップS5を全てのコンテキスト数だけ繰り返すこととしているが、本発明はこれに限定されるものではない。すなわち、第2フラグの値が変更されるタイミングは、図9に示されるように、判定処理が行なわれた直後と、判定処理が行なわれた後にテーブル更新が行なわれた直後だけである。判定処理が行なわれた直後に第2フラグの値が変わるのは、ステップS8の複製が原因でありステップS5とは関係がない。従って、第2フラグの値を変更するステップS5は、判定処理が行なわれた後にテーブル更新が行なわれた直後だけ実行するようにしてもよい。   In FIG. 4, step S5 for changing the value of the second flag is repeated for all the context numbers, but the present invention is not limited to this. That is, as shown in FIG. 9, the timing at which the value of the second flag is changed is only immediately after the determination process is performed and immediately after the table update is performed after the determination process is performed. The reason why the value of the second flag changes immediately after the determination process is performed is due to duplication in step S8 and is not related to step S5. Therefore, step S5 for changing the value of the second flag may be executed only immediately after the table update is performed after the determination process is performed.

(実施の形態2)
前記実施の形態1では、CABACを用いてデータを符号化する算術符号化装置に本発明を適用した場合ついて説明したが、本実施の形態2では、CABACを用いて符号化されたデータを復号化する算術復号化装置に本発明を適用した場合について説明する。
(Embodiment 2)
In the first embodiment, the case where the present invention is applied to an arithmetic coding apparatus that encodes data using CABAC has been described. In the second embodiment, data encoded using CABAC is decoded. A case will be described in which the present invention is applied to an arithmetic decoding device to be realized.

図10は、本発明の実施の形態における算術復号化装置20の構成図である。この算術復号化装置20は、発生確率テーブルを使用して算術復号化処理を行なう装置であって、解析部21と、算術復号化部22と、判定部23と、初期化部24と、テーブル管理部25と、フラグ管理部26と、記憶部27とを備えている。以下に説明するように、本算術復号化装置20の構成は、算術符号化をするか算術復号化をするかという点を除き、前記実施の形態1における算術符号化装置10と基本的に同じである。   FIG. 10 is a configuration diagram of the arithmetic decoding device 20 according to the embodiment of the present invention. The arithmetic decoding device 20 is a device that performs arithmetic decoding processing using an occurrence probability table, and includes an analysis unit 21, an arithmetic decoding unit 22, a determination unit 23, an initialization unit 24, and a table. A management unit 25, a flag management unit 26, and a storage unit 27 are provided. As will be described below, the configuration of the present arithmetic decoding device 20 is basically the same as that of the arithmetic coding device 10 in the first embodiment except that arithmetic coding or arithmetic decoding is performed. It is.

解析部21は、算術符号化された入力信号を解析する。そして、入力信号にスライスの先頭が現れた場合はその旨を初期化部24に出力し、入力信号にマクロブロックの終端が現れた場合はその旨をフラグ管理部26に出力する。なお、算術符号化された入力信号は、解析部21を介して(又は、解析部21を介すことなく直接)算術復号化部22に入力される。   The analysis unit 21 analyzes the input signal that has been arithmetically encoded. When the head of the slice appears in the input signal, the fact is output to the initialization unit 24, and when the end of the macroblock appears in the input signal, the fact is outputted to the flag management unit 26. The arithmetically encoded input signal is input to the arithmetic decoding unit 22 via the analysis unit 21 (or directly without going through the analysis unit 21).

記憶部27は、本発明に係るテーブル記憶手段及びフラグ記憶手段の一例であり、例えばRAMである。記憶部27は、テーブル0及びテーブル1のエントリー毎に第1フラグと第2フラグとを対応付けて記憶している。   The storage unit 27 is an example of a table storage unit and a flag storage unit according to the present invention, and is a RAM, for example. The storage unit 27 stores a first flag and a second flag in association with each entry of the table 0 and the table 1.

初期化部24は、本発明に係る初期化手段の一例であり、テーブル0とテーブル1とをスライス単位に初期化する。なお、初期化部24がテーブル0及びテーブル1を初期化する際にはテーブル管理部25を介すことになる。   The initialization unit 24 is an example of an initialization unit according to the present invention, and initializes table 0 and table 1 in units of slices. When the initialization unit 24 initializes the table 0 and the table 1, the table management unit 25 is used.

算術復号化部22は、本発明に係る算術復号化手段の一例であり、第2フラグによって示されるテーブルを使用して算術復号化処理を行なう。なお、算術復号化部22がテーブル0又はテーブル1を使用する際にはテーブル管理部25を介すことになる。   The arithmetic decoding unit 22 is an example of the arithmetic decoding unit according to the present invention, and performs arithmetic decoding using the table indicated by the second flag. In addition, when the arithmetic decoding unit 22 uses the table 0 or the table 1, it goes through the table management unit 25.

テーブル管理部25は、本発明に係る更新手段の一例であり、第1フラグによって示されないテーブル、言い換えると、第1フラグによって示されるテーブルと逆のテーブルを算術復号化処理の結果に基づいて更新する。   The table management unit 25 is an example of an updating unit according to the present invention, and updates a table not indicated by the first flag, in other words, a table opposite to the table indicated by the first flag based on the result of the arithmetic decoding process. To do.

判定部23は、本発明に係る判定手段の一例であり、スライスに含まれる1マクロブロックについて算術復号化処理が完了する度に、そのマクロブロックについての算術復号化処理が有効であるか否かを判定する。例えば、算術復号化処理によって発生した符号量が所定量を越えていない場合は、そのマクロブロックについての算術復号化処理が有効であると判定し、算術復号化処理によって発生した符号量が所定量を超えている場合は、そのマクロブロックについての算術復号化処理が有効でないと判定する。判定部23は、発生符号量が制限値を超えているか否かを示す判定結果信号をフラグ管理部26に出力する。また、廃棄指示信号をフラグ管理部26から受けた場合は、当該マクロブロックについての算術復号化処理の結果を廃棄する。   The determination unit 23 is an example of a determination unit according to the present invention, and whether or not the arithmetic decoding process for the macroblock is valid each time the arithmetic decoding process is completed for one macroblock included in the slice. Determine. For example, if the code amount generated by the arithmetic decoding process does not exceed a predetermined amount, it is determined that the arithmetic decoding process for the macroblock is valid, and the code amount generated by the arithmetic decoding process is a predetermined amount. Is exceeded, it is determined that the arithmetic decoding process for the macroblock is not valid. The determination unit 23 outputs a determination result signal indicating whether or not the generated code amount exceeds the limit value to the flag management unit 26. When the discard instruction signal is received from the flag management unit 26, the result of the arithmetic decoding process for the macroblock is discarded.

フラグ管理部26は、本発明に係る制御手段の一例であり、第1フラグによって示されないテーブルが更新された場合は、第1フラグによって示されないテーブルを示すように第2フラグの値を変更する。また、発生符号量が制限値を超えていない旨の判定結果信号を判定部23から受けた場合など、算術復号化処理が有効であると判定された場合は、第1フラグの値を第2フラグに複製する。他方、発生符号量が制限値を超えている旨の判定結果信号を判定部23から受けた場合など、算術復号化処理が有効でないと判定された場合は、第2フラグの値を第1フラグに複製する。そして、このように第1フラグの値を第2フラグに複製した場合は、当該マクロブロックについての廃棄指示信号を判定部23に出力する。   The flag management unit 26 is an example of a control unit according to the present invention, and when a table not indicated by the first flag is updated, the value of the second flag is changed to indicate a table not indicated by the first flag. . Also, when it is determined that the arithmetic decoding process is valid, such as when a determination result signal indicating that the generated code amount does not exceed the limit value is received from the determination unit 23, the value of the first flag is set to the second value. Duplicate the flag. On the other hand, when it is determined that the arithmetic decoding process is not effective, such as when a determination result signal indicating that the generated code amount exceeds the limit value is received from the determination unit 23, the value of the second flag is set to the first flag. Duplicate to. When the value of the first flag is copied to the second flag in this way, a discard instruction signal for the macroblock is output to the determination unit 23.

以上のように、本発明に係る算術復号化装置によれば、2重化された発生確率テーブルの一方である第1テーブルは最新のテーブルとして、また、2重化された発生確率テーブルの他方である第2テーブルはバックアップ用のテーブルとして使用されることになるので、1マクロブロックについての算術復号化処理が有効でない場合は、そのマクロブロックについて算術復号化処理を行なう直前の状態に発生確率テーブルの値を戻すことが可能となる。しかも、2つのフラグを用いて制御する構成を採用しているので、フラグの値を変えるだけでバックアップ用のテーブルと最新のテーブルとを簡便に切り替えることが可能である。   As described above, according to the arithmetic decoding apparatus according to the present invention, the first table that is one of the duplicated occurrence probability tables is the latest table, and the other one of the duplicated occurrence probability tables. Since the second table is used as a backup table, if the arithmetic decoding process for one macroblock is not effective, the occurrence probability immediately before the arithmetic decoding process is performed for that macroblock. It is possible to return the value of the table. In addition, since the control is performed using two flags, it is possible to easily switch between the backup table and the latest table simply by changing the value of the flag.

これにより、算術復号化処理が有効でないマクロブロック部分のストリームデータをPCMデータに差し替えることが可能となる。また、再エンコードを行なう場合は、発生確率テーブルを初期化する時間と、算術復号化処理が有効であったマクロブロックについて算術復号化処理をやり直す時間とを削減することが可能となる。このように処理時間が削減されると電力消費量も削減されるので、電力消費量を抑えることが必要な装置に本発明を適用すると効果的である。   As a result, it is possible to replace the stream data of the macro block portion where the arithmetic decoding process is not effective with the PCM data. Also, when re-encoding is performed, it is possible to reduce the time for initializing the occurrence probability table and the time for performing the arithmetic decoding process again for the macroblocks for which the arithmetic decoding process is effective. When the processing time is thus reduced, the power consumption is also reduced. Therefore, it is effective to apply the present invention to an apparatus that needs to suppress the power consumption.

本発明は、1マクロブロックについての算術符号化処理が有効でない場合は、そのマクロブロックについて算術符号化処理を行なう直前の状態に発生確率テーブルの値を戻すことが必要な算術符号化装置等の用途に適用することができる。   The present invention relates to an arithmetic coding apparatus or the like that needs to return the value of the occurrence probability table to a state immediately before performing the arithmetic coding process for the macroblock when the arithmetic coding process for one macroblock is not effective. It can be applied for use.

本発明の概要を説明するための図The figure for demonstrating the outline | summary of this invention 本発明の実施の形態1における算術符号化装置の構成図Configuration diagram of arithmetic coding apparatus according to Embodiment 1 of the present invention 発生確率テーブル内のコンテキスト配置を示す図The figure which shows the context arrangement in the occurrence probability table 算術符号化装置が行なう処理の手順を示すフローチャートThe flowchart which shows the procedure of the process which an arithmetic coding apparatus performs テーブル参照とテーブル更新を詳細に説明するための図Diagram for explaining table reference and table update in detail フラグの値を複製する処理を詳細に説明するための図Diagram for explaining in detail the process of copying the flag value フラグとテーブルの状態遷移を示す図Diagram showing state transition of flags and table フラグとテーブルの状態遷移を示す図Diagram showing state transition of flags and table 第1フラグの値と第2フラグの値との組み合わせの遷移を示す図The figure which shows the transition of the combination of the value of a 1st flag, and the value of a 2nd flag 本発明の実施の形態2における算術復号化装置の構成図Configuration diagram of arithmetic decoding apparatus according to Embodiment 2 of the present invention CABACを用いた従来の2値算術符号化装置の構成図Configuration diagram of a conventional binary arithmetic coding apparatus using CABAC CABACを用いた2値算術符号化の概念図Schematic diagram of binary arithmetic coding using CABAC スライスが符号化の基本単位となっている様子を示す図Diagram showing how a slice is the basic unit of encoding 1スライスに含まれるマクロブロック毎の発生符号量を示す図The figure which shows the generated code amount for every macroblock contained in 1 slice

符号の説明Explanation of symbols

10 算術符号化装置
11 算術符号化装置の解析部
12 算術符号化装置の算術符号化部
13 算術符号化装置の判定部
14 算術符号化装置の初期化部
15 算術符号化装置のテーブル管理部
16 算術符号化装置のフラグ管理部
17 算術符号化装置の記憶部
20 算術復号化装置
21 算術復号化装置の解析部
22 算術復号化装置の算術符号化部
23 算術復号化装置の判定部
24 算術復号化装置の初期化部
25 算術復号化装置のテーブル管理部
26 算術復号化装置のフラグ管理部
27 算術復号化装置の記憶部
DESCRIPTION OF SYMBOLS 10 Arithmetic coding apparatus 11 Analyzing part 12 of arithmetic coding apparatus Arithmetic coding part 13 of arithmetic coding apparatus 13 Determination part 14 of arithmetic coding apparatus Initialization part 15 of arithmetic coding apparatus Table management part 16 of arithmetic coding apparatus Flag management unit 17 of arithmetic coding device Storage unit 20 of arithmetic coding device 20 Arithmetic decoding device 21 Analyzing unit 22 of arithmetic decoding device Arithmetic coding unit 23 of arithmetic decoding device Determination unit 24 of arithmetic decoding device Arithmetic decoding Initialization unit 25 of the decoding device Table management unit 26 of the arithmetic decoding device Flag management unit 27 of the arithmetic decoding device Storage unit of the arithmetic decoding device

Claims (14)

発生確率テーブルを使用して算術符号化処理を行なう算術符号化装置であって、
2重化された前記発生確率テーブルの一方である第1テーブルと、2重化された前記発生確率テーブルの他方である第2テーブルとを記憶するテーブル記憶手段と、
前記第1テーブルと前記第2テーブルとをスライス単位に初期化する初期化手段と、
前記第1テーブルを使用して前記算術符号化処理を行なう算術符号化手段と、
前記算術符号化処理の結果に基づいて前記第1テーブルを更新する更新手段と、
前記スライスに含まれる1マクロブロックについて前記算術符号化処理が完了する度に、そのマクロブロックについての算術符号化処理が有効であるか否かを判定する判定手段と、
前記算術符号化処理が有効であると判定された場合は、前記第2テーブルの値が前記第1テーブルの値となるように制御し、前記算術符号化処理が有効でないと判定された場合は、前記第1テーブルの値が前記第2テーブルの値となるように制御する制御手段と
を備えることを特徴とする算術符号化装置。
An arithmetic encoding device that performs arithmetic encoding processing using an occurrence probability table,
Table storage means for storing a first table that is one of the duplicated occurrence probability tables and a second table that is the other of the duplicated occurrence probability tables;
Initialization means for initializing the first table and the second table in units of slices;
Arithmetic coding means for performing the arithmetic coding processing using the first table;
Updating means for updating the first table based on a result of the arithmetic encoding process;
A determination unit that determines whether or not the arithmetic coding process for the macroblock is valid each time the arithmetic coding process is completed for one macroblock included in the slice;
When it is determined that the arithmetic encoding process is valid, the value of the second table is controlled to be the value of the first table, and when it is determined that the arithmetic encoding process is not effective. And an arithmetic coding apparatus comprising: control means for controlling the value of the first table to be the value of the second table.
前記判定手段は、前記算術符号化処理が有効でないと判定した場合、そのマクロブロック部分のストリームデータをPCM(Pulse Code Modulation)データに差し替える
ことを特徴とする請求項1に記載の算術符号化装置。
2. The arithmetic coding apparatus according to claim 1, wherein the determination unit replaces the stream data of the macroblock portion with PCM (Pulse Code Modulation) data when determining that the arithmetic encoding processing is not effective. .
前記算術符号化手段は、前記算術符号化処理が有効でないと判定された場合、発生符号量を抑える制約を加えて再度そのマクロブロックについて算術符号化処理を行なう
ことを特徴とする請求項1に記載の算術符号化装置。
2. The arithmetic coding unit according to claim 1, wherein, when it is determined that the arithmetic coding process is not effective, the arithmetic coding process is performed again on the macroblock with a constraint for reducing a generated code amount. 3. The described arithmetic coding device.
前記算術符号化装置は、さらに、
前記第1テーブル及び前記第2テーブルのエントリー毎に、前記第1テーブル又は前記第2テーブルを示す第1フラグと第2フラグとを対応付けて記憶するフラグ記憶手段を備え、
前記算術符号化手段は、前記第2フラグによって示されるテーブルを使用し、
前記更新手段は、前記第1フラグによって示されないテーブルを更新し、
前記制御手段は、前記第1フラグによって示されないテーブルが更新された場合は、前記第1フラグによって示されないテーブルを示すように前記第2フラグの値を変更し、前記算術符号化処理が有効であると判定された場合は、前記第1フラグの値を前記第2フラグに複製し、前記算術符号化処理が有効でないと判定された場合は、前記第2フラグの値を前記第1フラグに複製する
ことを特徴とする請求項1に記載の算術符号化装置。
The arithmetic encoding device further includes:
For each entry of the first table and the second table, a flag storage means for storing a first flag indicating the first table or the second table and a second flag in association with each other is provided.
The arithmetic encoding means uses a table indicated by the second flag,
The updating means updates a table not indicated by the first flag;
When the table not indicated by the first flag is updated, the control means changes the value of the second flag so as to indicate the table not indicated by the first flag, and the arithmetic coding process is effective. If it is determined that there is, the value of the first flag is copied to the second flag, and if it is determined that the arithmetic coding process is not valid, the value of the second flag is set to the first flag. The arithmetic coding apparatus according to claim 1, wherein the arithmetic coding apparatus is duplicated.
前記判定手段は、前記算術符号化処理によって発生した符号量が所定量を越えていない場合は、前記算術符号化処理が有効であると判定し、前記算術符号化処理によって発生した符号量が所定量を超えている場合は、前記算術符号化処理が有効でないと判定する
ことを特徴とする請求項1に記載の算術符号化装置。
The determination unit determines that the arithmetic encoding process is effective when the code amount generated by the arithmetic encoding process does not exceed a predetermined amount, and the code amount generated by the arithmetic encoding process is determined. The arithmetic coding apparatus according to claim 1, wherein the arithmetic coding process is determined not to be effective when the amount exceeds a fixed amount.
発生確率テーブルを使用して算術復号化処理を行なう算術復号化装置であって、
2重化された前記発生確率テーブルの一方である第1テーブルと、2重化された前記発生確率テーブルの他方である第2テーブルとを記憶するテーブル記憶手段と、
前記第1テーブルと前記第2テーブルとをスライス単位に初期化する初期化手段と、
前記第1テーブルを使用して前記算術復号化処理を行なう算術復号化手段と、
前記算術復号化処理の結果に基づいて前記第1テーブルを更新する更新手段と、
前記スライスに含まれる1マクロブロックについて前記算術復号化処理が完了する度に、そのマクロブロックについての算術復号化処理が有効であるか否かを判定する判定手段と、
前記算術復号化処理が有効であると判定された場合は、前記第2テーブルの値が前記第1テーブルの値となるように制御し、前記算術復号化処理が有効でないと判定された場合は、前記第1テーブルの値が前記第2テーブルの値となるように制御する制御手段と
を備えることを特徴とする算術復号化装置。
An arithmetic decoding device that performs an arithmetic decoding process using an occurrence probability table,
Table storage means for storing a first table that is one of the duplicated occurrence probability tables and a second table that is the other of the duplicated occurrence probability tables;
Initialization means for initializing the first table and the second table in units of slices;
Arithmetic decoding means for performing the arithmetic decoding process using the first table;
Updating means for updating the first table based on a result of the arithmetic decoding process;
Determination means for determining whether or not the arithmetic decoding process for the macroblock is valid each time the arithmetic decoding process is completed for one macroblock included in the slice;
When it is determined that the arithmetic decoding process is valid, the value of the second table is controlled to be the value of the first table, and when it is determined that the arithmetic decoding process is not effective. And an arithmetic decoding device comprising: control means for controlling the value of the first table to be the value of the second table.
前記判定手段は、前記算術復号化処理が有効でないと判定した場合、そのマクロブロック部分のストリームデータをPCM(Pulse Code Modulation)データに差し替える
ことを特徴とする請求項6に記載の算術復号化装置。
7. The arithmetic decoding device according to claim 6, wherein, when it is determined that the arithmetic decoding process is not effective, the determining unit replaces the stream data of the macroblock portion with PCM (Pulse Code Modulation) data. .
前記算術復号化手段は、前記算術復号化処理が有効でないと判定された場合、発生符号量を抑える制約を加えて再度そのマクロブロックについて算術復号化処理を行なう
ことを特徴とする請求項6に記載の算術復号化装置。
7. The arithmetic decoding unit according to claim 6, wherein, when it is determined that the arithmetic decoding process is not effective, the arithmetic decoding process is performed again for the macroblock with a restriction for suppressing a generated code amount added. 7. The arithmetic decoding device described.
前記算術復号化装置は、さらに、
前記第1テーブル及び前記第2テーブルのエントリー毎に、前記第1テーブル又は前記第2テーブルを示す第1フラグと第2フラグとを対応付けて記憶するフラグ記憶手段を備え、
前記算術復号化手段は、前記第2フラグによって示されるテーブルを使用し、
前記更新手段は、前記第1フラグによって示されないテーブルを更新し、
前記制御手段は、前記第1フラグによって示されないテーブルが更新された場合は、前記第1フラグによって示されないテーブルを示すように前記第2フラグの値を変更し、前記算術復号化処理が有効であると判定された場合は、前記第1フラグの値を前記第2フラグに複製し、前記算術復号化処理が有効でないと判定された場合は、前記第2フラグの値を前記第1フラグに複製する
ことを特徴とする請求項6に記載の算術復号化装置。
The arithmetic decoding device further includes:
For each entry of the first table and the second table, a flag storage means for storing a first flag indicating the first table or the second table and a second flag in association with each other is provided.
The arithmetic decoding means uses a table indicated by the second flag;
The updating means updates a table not indicated by the first flag;
When the table not indicated by the first flag is updated, the control means changes the value of the second flag to indicate the table not indicated by the first flag, and the arithmetic decoding process is effective. If it is determined that there is, the value of the first flag is copied to the second flag, and if it is determined that the arithmetic decoding process is not valid, the value of the second flag is set to the first flag. The arithmetic decoding device according to claim 6, wherein the arithmetic decoding device is duplicated.
前記判定手段は、前記算術復号化処理によって発生した符号量が所定量を越えていない場合は、前記算術復号化処理が有効であると判定し、前記算術復号化処理によって発生した符号量が所定量を超えている場合は、前記算術復号化処理が有効でないと判定する
ことを特徴とする請求項6に記載の算術復号化装置。
The determination means determines that the arithmetic decoding process is valid when the code amount generated by the arithmetic decoding process does not exceed a predetermined amount, and the code amount generated by the arithmetic decoding process is determined. The arithmetic decoding device according to claim 6, wherein if the amount exceeds a fixed amount, it is determined that the arithmetic decoding process is not effective.
発生確率テーブルを使用して算術符号化処理を行なう算術符号化方法であって、
2重化された前記発生確率テーブルの一方である第1テーブルと、2重化された前記発生確率テーブルの他方である第2テーブルとをスライス単位に初期化する初期化ステップと、
前記第1テーブルを使用して前記算術符号化処理を行なう算術符号化ステップと、
前記算術符号化処理の結果に基づいて前記第1テーブルを更新する更新ステップと、
前記スライスに含まれる1マクロブロックについて前記算術符号化処理が完了する度に、そのマクロブロックについての算術符号化処理が有効であるか否かを判定する判定ステップと、
前記算術符号化処理が有効であると判定された場合は、前記第2テーブルの値が前記第1テーブルの値となるように制御し、前記算術符号化処理が有効でないと判定された場合は、前記第1テーブルの値が前記第2テーブルの値となるように制御する制御ステップと
を含むことを特徴とする算術符号化方法。
An arithmetic encoding method for performing an arithmetic encoding process using an occurrence probability table,
An initialization step of initializing, in slice units, a first table that is one of the duplicated occurrence probability tables and a second table that is the other of the duplicated occurrence probability tables;
An arithmetic encoding step of performing the arithmetic encoding process using the first table;
An update step of updating the first table based on a result of the arithmetic encoding process;
A determination step of determining whether or not the arithmetic encoding process for the macroblock is valid each time the arithmetic encoding process is completed for one macroblock included in the slice;
When it is determined that the arithmetic encoding process is valid, the value of the second table is controlled to be the value of the first table, and when it is determined that the arithmetic encoding process is not effective. And a control step of controlling the value of the first table to be the value of the second table.
発生確率テーブルを使用して算術復号化処理を行なう算術復号化方法であって、
2重化された前記発生確率テーブルの一方である第1テーブルと、2重化された前記発生確率テーブルの他方である第2テーブルとをスライス単位に初期化する初期化ステップと、
前記第1テーブルを使用して前記算術復号化処理を行なう算術復号化ステップと、
前記算術復号化処理の結果に基づいて前記第1テーブルを更新する更新ステップと、
前記スライスに含まれる1マクロブロックについて前記算術復号化処理が完了する度に、そのマクロブロックについての算術復号化処理が有効であるか否かを判定する判定ステップと、
前記算術復号化処理が有効であると判定された場合は、前記第2テーブルの値が前記第1テーブルの値となるように制御し、前記算術復号化処理が有効でないと判定された場合は、前記第1テーブルの値が前記第2テーブルの値となるように制御する制御ステップと
を含むことを特徴とする算術復号化方法。
An arithmetic decoding method for performing an arithmetic decoding process using an occurrence probability table,
An initialization step of initializing, in slice units, a first table that is one of the duplicated occurrence probability tables and a second table that is the other of the duplicated occurrence probability tables;
An arithmetic decoding step for performing the arithmetic decoding process using the first table;
An update step of updating the first table based on a result of the arithmetic decoding process;
A determination step of determining whether or not the arithmetic decoding process for the macroblock is valid each time the arithmetic decoding process is completed for one macroblock included in the slice;
When it is determined that the arithmetic decoding process is valid, the value of the second table is controlled to be the value of the first table, and when it is determined that the arithmetic decoding process is not effective. And a control step for controlling the value of the first table to be the value of the second table.
発生確率テーブルを使用して算術符号化処理を行なうためのプログラムであって、
2重化された前記発生確率テーブルの一方である第1テーブルと、2重化された前記発生確率テーブルの他方である第2テーブルとをスライス単位に初期化する初期化ステップと、
前記第1テーブルを使用して前記算術符号化処理を行なう算術符号化ステップと、
前記算術符号化処理の結果に基づいて前記第1テーブルを更新する更新ステップと、
前記スライスに含まれる1マクロブロックについて前記算術符号化処理が完了する度に、そのマクロブロックについての算術符号化処理が有効であるか否かを判定する判定ステップと、
前記算術符号化処理が有効であると判定された場合は、前記第2テーブルの値が前記第1テーブルの値となるように制御し、前記算術符号化処理が有効でないと判定された場合は、前記第1テーブルの値が前記第2テーブルの値となるように制御する制御ステップと
をコンピュータに実行させるためのプログラム。
A program for performing arithmetic coding using an occurrence probability table,
An initialization step of initializing, in slice units, a first table that is one of the duplicated occurrence probability tables and a second table that is the other of the duplicated occurrence probability tables;
An arithmetic encoding step of performing the arithmetic encoding process using the first table;
An update step of updating the first table based on a result of the arithmetic encoding process;
A determination step of determining whether or not the arithmetic encoding process for the macroblock is valid each time the arithmetic encoding process is completed for one macroblock included in the slice;
When it is determined that the arithmetic encoding process is valid, the value of the second table is controlled to be the value of the first table, and when it is determined that the arithmetic encoding process is not effective. A program for causing a computer to execute a control step of controlling the value of the first table to be the value of the second table.
発生確率テーブルを使用して算術復号化処理を行なうためのプログラムであって、
2重化された前記発生確率テーブルの一方である第1テーブルと、2重化された前記発生確率テーブルの他方である第2テーブルとをスライス単位に初期化する初期化ステップと、
前記第1テーブルを使用して前記算術復号化処理を行なう算術復号化ステップと、
前記算術復号化処理の結果に基づいて前記第1テーブルを更新する更新ステップと、
前記スライスに含まれる1マクロブロックについて前記算術復号化処理が完了する度に、そのマクロブロックについての算術復号化処理が有効であるか否かを判定する判定ステップと、
前記算術復号化処理が有効であると判定された場合は、前記第2テーブルの値が前記第1テーブルの値となるように制御し、前記算術復号化処理が有効でないと判定された場合は、前記第1テーブルの値が前記第2テーブルの値となるように制御する制御ステップと
をコンピュータに実行させるためのプログラム。
A program for performing an arithmetic decoding process using an occurrence probability table,
An initialization step of initializing, in slice units, a first table that is one of the duplicated occurrence probability tables and a second table that is the other of the duplicated occurrence probability tables;
An arithmetic decoding step for performing the arithmetic decoding process using the first table;
An update step of updating the first table based on a result of the arithmetic decoding process;
A determination step of determining whether or not the arithmetic decoding process for the macroblock is valid each time the arithmetic decoding process is completed for one macroblock included in the slice;
When it is determined that the arithmetic decoding process is valid, the value of the second table is controlled to be the value of the first table, and when it is determined that the arithmetic decoding process is not effective. A program for causing a computer to execute a control step of controlling the value of the first table to be the value of the second table.
JP2006275211A 2006-10-06 2006-10-06 Arithmetic encoding device and arithmetic decoding device Pending JP2008098751A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006275211A JP2008098751A (en) 2006-10-06 2006-10-06 Arithmetic encoding device and arithmetic decoding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006275211A JP2008098751A (en) 2006-10-06 2006-10-06 Arithmetic encoding device and arithmetic decoding device

Publications (1)

Publication Number Publication Date
JP2008098751A true JP2008098751A (en) 2008-04-24

Family

ID=39381182

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006275211A Pending JP2008098751A (en) 2006-10-06 2006-10-06 Arithmetic encoding device and arithmetic decoding device

Country Status (1)

Country Link
JP (1) JP2008098751A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013123226A (en) * 2008-10-08 2013-06-20 Fraunhofer Ges Zur Foerderung Der Angewandten Forschung Ev Voice coder, voice signal coding method, computer program, and digital storage device
US8731948B2 (en) 2008-07-11 2014-05-20 Fraunhofer-Gesellschaft Zur Foerderung Der Angewandten Forschung E.V. Audio signal synthesizer for selectively performing different patching algorithms

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8731948B2 (en) 2008-07-11 2014-05-20 Fraunhofer-Gesellschaft Zur Foerderung Der Angewandten Forschung E.V. Audio signal synthesizer for selectively performing different patching algorithms
US10014000B2 (en) 2008-07-11 2018-07-03 Fraunhofer-Gesellschaft Zur Foerderung Der Angewandten Forschung E.V. Audio signal encoder and method for generating a data stream having components of an audio signal in a first frequency band, control information and spectral band replication parameters
US10522168B2 (en) 2008-07-11 2019-12-31 Fraunhofer-Gesellschaft Zur Foerderung Der Angewandten Forschung E.V. Audio signal synthesizer and audio signal encoder
JP2013123226A (en) * 2008-10-08 2013-06-20 Fraunhofer Ges Zur Foerderung Der Angewandten Forschung Ev Voice coder, voice signal coding method, computer program, and digital storage device

Similar Documents

Publication Publication Date Title
JP6310524B2 (en) Image encoding and decoding method, encoding and decoding device, and computer program corresponding thereto
KR100717055B1 (en) Method of decoding bin values using pipeline architecture, and decoding apparatus therefor
JP5221047B2 (en) CABAC encoding method and apparatus using improved context model selection for improved compression ratio, and CABAC decoding method and apparatus
US7769088B2 (en) Context adaptive binary arithmetic code decoding engine
US6014095A (en) Variable length encoding system
KR101907043B1 (en) Method for encoding and decoding images, encoding and decoding device, and corresponding computer programs
US7894532B2 (en) Variable-length encoding apparatus and method
JP2007300517A (en) Moving image processing method, program of moving image processing method, recording medium with program of moving image processing method recorded thereon and moving image processor
US20070103347A1 (en) Method and device for decoding syntax element in CABAC decoder
JP2006054877A (en) Adaptive arithmetic decoding method and apparatus thereof
US7528749B2 (en) Decoding apparatus and decoding method
TWI397268B (en) Entropy processor for decoding
JP2009081726A (en) Entropy coding device, entropy coding method, and computer program
JP2008098751A (en) Arithmetic encoding device and arithmetic decoding device
CN107105249B (en) Image quantization parameter decoding method
JP2008199100A (en) Device for decoding variable length code
JP2009159599A (en) Moving image coding apparatus, and moving image coding method
JP2005217871A (en) Arithmetic decoding apparatus and arithmetic decoding program
JP2007074648A (en) Cabac decoding apparatus
JP2008098735A (en) Arithmetic encoder, and arithmetic decoder
JP2008131526A (en) Moving image coding apparatus, and moving image coding program
JP2009177356A (en) Image decoding apparatus and image decoding method
JP2008219648A (en) Arithmetic coding device
JPH10285590A (en) Image encoding method and device, image decoding method and device and image recording medium
JP2004247942A (en) Image encoding method