JP2000036758A - Variable-length encoding and decoding device and recording medium where data or program used by the device is recorded - Google Patents

Variable-length encoding and decoding device and recording medium where data or program used by the device is recorded

Info

Publication number
JP2000036758A
JP2000036758A JP11196332A JP19633299A JP2000036758A JP 2000036758 A JP2000036758 A JP 2000036758A JP 11196332 A JP11196332 A JP 11196332A JP 19633299 A JP19633299 A JP 19633299A JP 2000036758 A JP2000036758 A JP 2000036758A
Authority
JP
Japan
Prior art keywords
decoding
code
decoded
codeword
variable length
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.)
Granted
Application number
JP11196332A
Other languages
Japanese (ja)
Other versions
JP3819638B2 (en
Inventor
Takeshi Nakajo
條 健 中
Toshiaki Watanabe
邊 敏 明 渡
Yoshihiro Kikuchi
池 義 浩 菊
Takeshi Nagai
井 剛 永
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP19633299A priority Critical patent/JP3819638B2/en
Publication of JP2000036758A publication Critical patent/JP2000036758A/en
Application granted granted Critical
Publication of JP3819638B2 publication Critical patent/JP3819638B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To decode a variable-length code both forward and backward, even when a synchronous section is set in every constant cycle by using a stuffing code and by increasing encoding efficiency with a small calculation quantity and small storage capacity by reducing unnecessary bit patterns. SOLUTION: This device has a code word table 102 which enables forward and backward decoding and which stores code words constituted so that the delimiter of a code word is known from the predetermined weight of the code word corresponding to different information symbols, an encoder 103 which selects the code word corresponding to an inputted information, symbol, and a synchronous section setting part 104 which generates encoded data in every specific synchronous section by using the code word selected with the encoder 103 and which inserts a stuffing code enabling the backward decoding.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】この発明は、動画像信号など
の圧縮符号化/復号化に用いられる可変長符号化/復号
化装置に係り、特に順方向からも逆方向からも復号化可
能な可変長符号化/復号化装置およびこの装置で用いら
れるデータまたはプログラムを記録する記録媒体に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a variable length encoding / decoding device used for compression encoding / decoding of a moving image signal and the like, and more particularly to a variable length encoding / decoding device capable of decoding from a forward direction and a reverse direction. The present invention relates to a long encoding / decoding device and a recording medium for recording data or a program used in the device.

【0002】[0002]

【従来の技術】可変長符号は、シンボルの発生頻度に基
づいて、頻繁に出現するシンボルは短い符号長の符号、
希にして出現しないシンボルは長い符号長の符号をそれ
ぞれ割り当てることにより、平均的に短い符号長となる
ようにした符号系である。従って、可変長符号を用いる
と、符号化前のデータと比較して、データ量を大幅に圧
縮することができる。このような可変長符号の構成方法
としては、無記録情報源で最適なハフマンのアルゴリズ
ムが知られている。
2. Description of the Related Art A variable-length code is based on the frequency of occurrence of a symbol.
A symbol system that rarely appears and is assigned a code having a long code length so that the code length is short on average. Therefore, when the variable length code is used, the data amount can be significantly reduced as compared with the data before encoding. As a method of constructing such a variable length code, an Huffman algorithm that is optimal for a non-recording information source is known.

【0003】可変長符号の一般的な問題として、符号化
データの伝送路誤りやその他の理由により符号内に誤り
が混入した場合に、誤りが混入した後のデータはその影
響が伝搬することにより復号化装置で正しく復号するこ
とができなくなってしまうという点が挙げられる。この
問題を避けるため、伝送路において誤りが生じる可能性
がある場合には、ある間隔で同期符号を挿入し、誤りの
伝搬を防止する方法がとられるのが一般的である。同期
符号には、可変長符号の組み合わせでは出現しないよう
なビットパターンが割り当てられる。この方法によれ
ば、符号化データに誤りが生じ、復号できなくなったと
しても、次の同期符号を見つけることにより、誤りの伝
搬を防止し、正しく復号を行なうことができる。
[0003] As a general problem of the variable length code, when an error is mixed in the code due to a transmission line error of the coded data or other reasons, the data after the error is mixed is propagated by the influence. The point is that decoding cannot be correctly performed by the decoding device. In order to avoid this problem, when there is a possibility that an error may occur in the transmission path, a method of inserting a synchronization code at a certain interval to prevent the propagation of the error is generally adopted. A bit pattern that does not appear in a combination of variable length codes is assigned to the synchronization code. According to this method, even if an error occurs in the encoded data and decoding becomes impossible, finding the next synchronization code prevents the propagation of the error and enables correct decoding.

【0004】しかし、同期符号を用いた場合でも、図7
1(a)に示すように誤りが生じて正しく復号できない
箇所から、次の同期符号が見つかる箇所までの間の符号
化データについては、復号を行なうことができない。
However, even when a synchronous code is used, FIG.
As shown in FIG. 1 (a), decoding cannot be performed on encoded data from a point where an error occurs and cannot be decoded correctly to a point where the next synchronization code is found.

【0005】そこで、可変長符号を図72に示す通常の
構成から図73に示すように変更して、図71(b)に
示すように通常の順方向から復号可能な性質だけでな
く、逆方向からも復号可能な符号構成にする方法が知ら
れている。また、このような符号は符号化データを逆方
向からも読めることから、符号化データを蓄積するディ
スクメモリなどの蓄積媒体において逆転再生に用いるこ
ともできる。このような順方向のみならず逆方向からも
復号可能な可変長符号のことを、ここではリバーシブル
符号と呼ぶこととする。
Therefore, the variable length code is changed from the normal configuration shown in FIG. 72 to that shown in FIG. 73, so that not only the characteristic that can be decoded from the normal forward direction as shown in FIG. There is known a method of making a code configuration that can be decoded also from a direction. In addition, since such a code can read encoded data in the reverse direction, it can be used for reverse reproduction in a storage medium such as a disk memory for storing encoded data. Such a variable length code that can be decoded not only in the forward direction but also in the reverse direction is referred to as a reversible code here.

【0006】リバーシブル符号の一例は、例えば特開平
5−300027号公報「可逆可変長符号化方式」に記
載されている。この公知例のリバーシブル符号は、図7
2に示した順方向から復号可能な可変長符号であるハフ
マン符号の符号語の末尾に、図73に示すようにそれぞ
れの符号語がそれより符号長の長い他の符号語の末尾と
一致しない条件でビットを追加することによって、逆方
向からも復号可能とした可変長符号である。しかし、こ
のリバーシブル符号は順方向からのみ復号可能な可変長
符号の符号語の末尾にビットを付加するために、無駄な
ビットが多くなって平均符号長が長くなる。この結果、
順方向からのみ復号可能な可変長符号と比較して符号化
効率が大きく低下してしまう。
An example of a reversible code is described in, for example, Japanese Patent Application Laid-Open No. 5-300027 "Reversible Variable Length Coding". The reversible code of this known example is shown in FIG.
At the end of the code word of the Huffman code which is a variable length code decodable from the forward direction shown in FIG. 2, each code word does not match the end of another code word having a longer code length as shown in FIG. This is a variable-length code that can be decoded in the reverse direction by adding bits according to conditions. However, this reversible code adds bits to the end of a codeword of a variable length code that can be decoded only in the forward direction, so that useless bits increase and the average code length increases. As a result,
The coding efficiency is greatly reduced as compared with a variable length code that can be decoded only from the forward direction.

【0007】また、従来のリバーシブル符号では同期区
間を一定区間を単位に設定すると、逆方向復号ができな
いという問題点があった。例えば、ITU−T H.2
63(1996)では、同期符号を8ビット(=1バイ
ト)毎にアライメントする、すなわち同期符号の挿入可
能位置を1バイト単位の位置に設定することが可能とな
っている。このような同期区間のアライメントを実現す
るために、同期符号の前に図34に示すようなスタッフ
ィング符号を挿入している。このような場合、従来のリ
バーシブル符号では、スタッフィング符号のために逆方
向復号を行なうことができなくなるという問題点があっ
た。
Further, in the case of the conventional reversible code, if the synchronization section is set in units of a fixed section, there is a problem that backward decoding cannot be performed. For example, ITU-TH. 2
63 (1996), the synchronization code can be aligned every 8 bits (= 1 byte), that is, the insertion position of the synchronization code can be set to a position in units of 1 byte. In order to realize such alignment of the synchronization section, a stuffing code as shown in FIG. 34 is inserted before the synchronization code. In such a case, the conventional reversible code has a problem that the backward decoding cannot be performed due to the stuffing code.

【0008】さらに、単純にリバーシブル符号を復号す
る場合には、通常の順方向のみ復号可能な可変長符号の
復号化装置と比較すると、逆方向に復号する分だけ2倍
の回路規模と演算量を必要とするという問題点があっ
た。
Furthermore, when decoding a reversible code simply, compared with a normal variable length code decoding device that can decode only in the forward direction, the circuit size and the amount of computation are twice as much as in the reverse direction. There was a problem that required.

【0009】従来のリバーシブル符号のもう一つの問題
点として、入力される情報のシンタクスによって逆方向
からの復号ができない場合が存在することが挙げられ
る。例えば図75(a)のシンタクスを持つ情報シンボ
ルの場合、シンボルAによってシンボルBの符号が決定
される。このようなシンタクスを持つ情報シンボルを符
号化した符号化データは、図75(b)のようにAが先
に復号できていなければBを復号できないので、逆方向
からは復号できないことになる。
As another problem of the conventional reversible code, there is a case where decoding in the reverse direction cannot be performed due to the syntax of input information. For example, in the case of an information symbol having the syntax of FIG. 75A, the symbol A determines the code of the symbol B. As shown in FIG. 75 (b), coded data obtained by coding an information symbol having such a syntax cannot be decoded in the reverse direction because B cannot be decoded unless A can be decoded first.

【0010】また、情報シンボル数が大きい場合に適用
される符号化方式として、エスケープ符号を用いた方式
がある。このエスケープ符号を用いた方式は、少数の出
現頻度の高い情報シンボルに対する符号語を符号語テー
ブルとして持ち、大多数の出現頻度の低い情報シンボル
をエスケープ符号と固定長符号の組み合わせで符号化す
る方法である。このエスケープ符号を用いた方式におい
ても、順方向にも逆方向にも復号可能な可変長符号の場
合と同様に、固定長符号の先頭と末尾にエスケープ符号
を付ける方式が提案されている。
As a coding method applied when the number of information symbols is large, there is a method using an escape code. The method using the escape code has a code word table for a small number of information symbols having a high appearance frequency as a code word table, and encodes a large number of the information symbols having a low appearance frequency with a combination of an escape code and a fixed length code. It is. In a system using this escape code, a system in which an escape code is added to the beginning and end of a fixed-length code has been proposed as in the case of a variable-length code that can be decoded in both forward and backward directions.

【0011】従来のエスケープ符号を用いた符号化/復
号化方式では、符号語テーブルに存在する符号語とエス
ケープ符号を用いて符号化する符号語を区別するため
に、何らかの方法で、符号語テーブルに符号語が存在す
るか検索する必要があった。
In a conventional encoding / decoding system using an escape code, in order to distinguish a codeword existing in a codeword table from a codeword to be encoded using an escape code, a codeword table is used in some way. It was necessary to search for the presence of a codeword in.

【0012】[0012]

【発明が解決しようとする課題】本発明は、少ない計算
量と記憶量で効率的に符号化/復号化することができる
順方向にも逆方向にも復号可能な可変長符号化/復号化
装置を提供することを目的とする。
SUMMARY OF THE INVENTION The present invention is directed to a variable-length encoding / decoding that can be efficiently encoded / decoded with a small amount of calculation and storage and that can be decoded in both forward and reverse directions. It is intended to provide a device.

【0013】つまり、上述したように、従来技術による
リバーシブル符号、すなわち順方向からも逆方向からも
復号可能な可変長符号は、順方向からのみ復号可能な可
変長符号の符号語の末尾にビットを付加することによっ
てリバーシブル符号を構成するため、無駄なビットパタ
ーンが多くなって平均符号長が長くなり、順方向からの
み復号可能な可変長符号と比較して符号化効率の低下が
著しくなるという問題があり、また、スタッフィング符
号を用いて同期区間を一定区間を単位に設定すると、ス
タッフィング符号のためにリバーシブル符号の逆方向復
号ができなくなるという問題があり、さらに、単純にリ
バーシブル符号を復号する場合には、通常の順方向のみ
復号可能な可変長符号の復号化装置と比較すると、逆方
向に復号する分だけ2倍の回路規模と演算量を必要と
し、また入力される情報シンボルのシンタクスによって
は逆方向からの復号が不可能である場合が存在するとい
う問題点があった。
That is, as described above, a reversible code according to the prior art, that is, a variable-length code that can be decoded in both the forward and reverse directions, has a bit at the end of the code word of the variable-length code that can be decoded only in the forward direction. Is added to form a reversible code, the useless bit pattern increases, the average code length increases, and the coding efficiency is significantly reduced compared to a variable length code that can be decoded only in the forward direction. There is a problem that if the synchronization interval is set in units of fixed intervals using the stuffing code, there is a problem that the reverse decoding of the reversible code cannot be performed due to the stuffing code, and further, the reversible code is simply decoded. In this case, when compared with a normal variable-length code decoding device that can decode only in the forward direction, Require the circuit scale and calculation amount doubled, and in some syntax information symbols input there is a problem that there are cases it is impossible to decode from the opposite direction.

【0014】本発明は、無駄なビットパターンを減らし
て符号化効率を高め、しかもスタッフィング符号を用い
て同期区間を一定区間を単位として設定する場合でも、
順方向にも逆方向にも復号可能な可変長符号化/復号化
装置を提供することを目的とする。
The present invention improves coding efficiency by reducing useless bit patterns, and even when a synchronization section is set in units of a fixed section using a stuffing code.
It is an object of the present invention to provide a variable length encoding / decoding device capable of decoding in both forward and reverse directions.

【0015】また、本発明は無駄なビットパターンを減
らして符号化効率を高めると共に、逐次的に復号処理を
行なうことで回路規模と演算量を削減して効率的に復号
できる、順方向にも逆方向にも復号可能な可変長符号化
/復号化装置を提供することを目的とする。
Further, the present invention increases the coding efficiency by reducing useless bit patterns, and reduces the circuit scale and the amount of calculation by performing decoding sequentially, thereby enabling efficient decoding. It is an object of the present invention to provide a variable length encoding / decoding device capable of decoding in the reverse direction.

【0016】さらに、本発明は入力される情報シンボル
のシンタクスによらず順方向にも逆方向にも復号可能で
あって、より誤りに強い可変長符号化/復号化装置を提
供することを目的とする。
A further object of the present invention is to provide a variable-length encoding / decoding apparatus which can decode in both the forward and reverse directions regardless of the syntax of an input information symbol and is more resistant to errors. And

【0017】[0017]

【課題を解決するための手段】本発明に係る可変長符号
化装置は、複数の情報シンボルに対して該情報シンボル
の生起確率に応じた符号長を有する符号語をそれぞれ割
り当て、入力された情報シンボルに対応した符号語を符
号化データとして出力する可変長符号化装置において、
入力された情報シンボルを重要度に応じて階層化する階
層化手段と、順方向にも逆方向にも復号可能であって、
符号語の予め定められた重みによって符号語の区切りが
分かるように構成された符号語を含む複数の符号語を情
報シンボルにそれぞれ対応させて格納した符号語テーブ
ルと、この符号語テーブルから階層化手段により階層化
された情報シンボルに対応する符号語を選択する符号語
選択手段と、この符号語選択手段により選択された符号
語を用いて所定の同期区間毎に階層毎の符号化データを
作成すると共に、該階層毎の符号化データを多重化する
多重化手段とを有することを特徴とする。
A variable length coding apparatus according to the present invention assigns a code word having a code length corresponding to the occurrence probability of an information symbol to each of a plurality of information symbols. In a variable-length encoding device that outputs a codeword corresponding to a symbol as encoded data,
Hierarchization means for hierarchizing input information symbols according to importance, capable of decoding both forward and backward,
A codeword table in which a plurality of codewords including codewords configured so that the delimiters of the codewords can be identified by predetermined weights of the codewords are stored in association with the information symbols, and the codeword table is hierarchized. Codeword selecting means for selecting a codeword corresponding to the information symbol hierarchized by the means, and using the codeword selected by the codeword selecting means to generate encoded data for each layer in each predetermined synchronization section And multiplexing means for multiplexing the coded data for each layer.

【0018】ここで、「符号語の重み」とは、その符号
語の最小値または最大値に対するハミング距離に相当す
るものである。符号語が2進符号である場合には、符号
語の最小値はオール“0”であり、最大値はオール
“1”であるから、符号語の重みは“1”または“0”
の数に相当する。この符号語の重みが予め定められた値
になった位置が可変長符号における符号の区切りを示
す。
Here, the "weight of a code word" corresponds to the Hamming distance for the minimum value or the maximum value of the code word. When the code word is a binary code, the minimum value of the code word is all “0” and the maximum value is all “1”, so that the weight of the code word is “1” or “0”.
Corresponds to the number of The position where the weight of the code word becomes a predetermined value indicates a code segment in the variable length code.

【0019】この可変長符号化装置では、符号語の重み
という符号語の順序関係に依存しない値によって符号の
区切り、つまりは符号長が定められた符号語からなる可
変長符号を構成する。従って、この可変長符号は順方向
からも逆方向からも符号の区切りが分かるので、これら
の両方向から復号可能なリバーシブル符号となる。ま
た、従来のリバーシブル符号のような順方向にのみ復号
可能な可変長符号の末尾にビットを付加する符号と異な
り、余分なビットを付加することなく、初めからリバー
シブル符号を構成するので、無駄なビットパターンが少
なく符号化効率の高い可変長符号が得られる。
In this variable length coding apparatus, a code length is defined by a code word weight, which does not depend on the code word order relation, that is, a variable length code composed of a code word having a predetermined code length. Accordingly, the variable length code can be recognized as a reversible code that can be decoded from both directions because the code segment can be identified from both the forward and reverse directions. Also, unlike a code in which a bit is added to the end of a variable-length code that can be decoded only in the forward direction, such as a conventional reversible code, a reversible code is formed from the beginning without adding extra bits. A variable length code with a small number of bit patterns and high coding efficiency can be obtained.

【0020】さらに、この可変長符号化装置では、一定
区間単位の同期区間の設定を行なう場合でも、逆方向に
復号可能なスタッフィング符号を用いることにより、リ
バーシブル符号を逆方向に復号することが可能となる。
すなわち、リバーシブル符号を逆方向復号する場合、リ
バーシブル符号の末尾(逆方向に見たときは先頭)が分
かる必要があるが、逆方向に復号可能なスタッフィング
符号を用いれば、リバーシブル符号の末尾が分かるの
で、リバーシブル符号の逆方向復号が実現できることに
なる。
Further, in this variable length coding apparatus, even when a synchronous section is set in fixed section units, a reversible code can be decoded in the reverse direction by using a stuffing code that can be decoded in the reverse direction. Becomes
That is, in the case of decoding the reversible code in the backward direction, the end of the reversible code (the head when viewed in the reverse direction) needs to be known, but the end of the reversible code can be known by using a stuffing code that can be decoded in the reverse direction. Therefore, reverse decoding of the reversible code can be realized.

【0021】この可変長符号化装置では、入力された情
報シンボルを階層化した上で先と同様の符号化テーブル
を用いて可変長符号化を行ない、さらに階層毎に同期区
間を設定することによって、入力された情報シンボルの
シンタクスによらず順方向にも逆方向にも復号可能であ
って、より誤りに強い可変長符号化が可能となる。
In this variable-length coding apparatus, the input information symbols are hierarchized, then variable-length coding is performed using the same coding table as above, and a synchronization section is set for each hierarchy. In addition, decoding can be performed in the forward direction and the reverse direction regardless of the syntax of the input information symbol, and variable-length coding that is more resistant to errors can be performed.

【0022】上記構成の可変長符号化装置において、符
号語テーブルに格納された複数の符号語のうち、順方向
にも逆方向にも復号可能であって、符号語の予め定めら
れた重みによって符号語の区切りが分かるように構成さ
れた符号語は、好ましくは、例えば順方向にも逆方向に
も復号可能な第1の符号語の先頭および末尾の少なくと
も一方に、順方向にも逆方向にも復号可能な第2の符号
語を付加して構成されるか、または順方向にも逆方向に
も復号可能な第1の符号語の各ビットの直前および直後
の少なくとも一方に、順方向にも逆方向にも復号可能な
第2の符号語を付加して構成される。
In the variable-length coding apparatus having the above-described configuration, of the plurality of codewords stored in the codeword table, the codeword can be decoded in both the forward and reverse directions, and can be decoded by a predetermined weight of the codeword. The codeword configured to identify the delimiters of the codewords is preferably, for example, at least one of the beginning and end of a first codeword that can be decoded in both the forward and reverse directions, A second code word that can be decoded also in the forward direction or at least one of immediately before and immediately after each bit of the first code word that can be decoded in the forward and reverse directions. And a second codeword that can be decoded in the opposite direction.

【0023】このように符号語を構成すると、より幅広
い情報シンボルの確率分布に対応することができるた
め、符号化効率が向上し、また符号語のビットパターン
の自由度が高い符号設計ができるため、同期符号を用い
て同期区間の設定を行なう場合でも、同期符号と符号語
のビットパターンが一致することによる擬似同期の問題
を回避できる。
By configuring a code word in this way, it is possible to cope with a wider probability distribution of information symbols, so that coding efficiency is improved and a code design with a high degree of freedom of a code word bit pattern can be performed. Even when the synchronization section is set using the synchronization code, the problem of pseudo-synchronization due to the coincidence between the bit pattern of the synchronization code and the code word can be avoided.

【0024】また、上記構成の可変長符号化装置におい
て、符号語テーブルに格納された複数の符号語のうち、
順方向にも逆方向にも復号可能であって、符号語の予め
定められた重みによって符号語の区切りが分かるように
構成された符号語は、順方向にも逆方向にも復号可能な
符号語の各ビットの間に、固定長符号の符号語が所定ビ
ットずつ挿入された符号語であってもよい。
Further, in the variable-length coding apparatus having the above-mentioned configuration, of the plurality of codewords stored in the codeword table,
A code word that can be decoded in both the forward and reverse directions, and is configured so that the delimiter of the code word can be identified by a predetermined weight of the code word, is a code that can be decoded in both the forward and reverse directions. A code word of a fixed-length code inserted between each bit of the word may be a code word.

【0025】また、符号語テーブルに格納された複数の
符号語のうち、順方向にも逆方向にも復号可能であっ
て、符号語の予め定められた重みによって符号語の区切
りが分かるように構成された符号語は、第1の順方向に
も逆方向にも復号可能な符号語の各ビットの間に、第2
の順方向にも逆方向にも復号可能な符号語が挿入された
符号語であってもよい。
Also, of the plurality of codewords stored in the codeword table, the codewords can be decoded in both the forward and reverse directions, and the codeword delimiters can be identified by the predetermined weights of the codewords. The constructed codeword is represented by a second codeword between each bit of the codeword that can be decoded in both the forward and reverse directions.
May be a codeword in which a codeword that can be decoded in both the forward and reverse directions is inserted.

【0026】このように符号語を構成すると、より幅広
い情報シンボルの確率分布に対応することができるた
め、符号化効率が向上し、また符号語のビットパターン
の自由度が高い符号設計ができるため、同期符号を用い
て同期区間の設定を行なう場合でも、同期符号と符号語
のビットパターンが一致することによる擬似同期の問題
を回避できる。
By configuring a code word in this manner, it is possible to cope with a wider probability distribution of information symbols, so that coding efficiency is improved, and a code design with a high degree of freedom of a code word bit pattern can be performed. Even when the synchronization section is set using the synchronization code, the problem of pseudo-synchronization due to the coincidence between the bit pattern of the synchronization code and the code word can be avoided.

【0027】本発明に係る第1の可変長復号化装置は、
第1の可変長符号化装置に対応した可変長復号化装置で
あり、順方向にも逆方向にも復号可能であって、所定の
同期区間毎に逆方向に復号可能なスタッフィング符号が
挿入された符号語を含む符号語で構成された可変長符号
からなる符号化データを復号する可変長復号化装置にお
いて、符号化データの同期区間を検出する同期区間検出
手段と、この同期区間検出手段により検出された同期区
間の符号化データを順方向から復号する順方向復号化手
段と、同期区間検出手段により検出された同期区間の符
号化データを逆方向から復号する逆方向復号化手段とを
有することを特徴とする。
The first variable length decoding device according to the present invention comprises:
A variable-length decoding device corresponding to the first variable-length encoding device, which is capable of decoding in both the forward and reverse directions, and in which a stuffing code that can be decoded in the reverse direction is inserted for each predetermined synchronization section. Variable-length decoding apparatus for decoding encoded data composed of variable-length codes composed of codewords including encoded codewords, a synchronous section detecting means for detecting a synchronous section of the encoded data, and a synchronous section detecting means for detecting a synchronous section of the encoded data. A forward decoding unit for decoding the encoded data of the detected synchronous section from the forward direction; and a backward decoding unit for decoding the encoded data of the synchronous section detected by the synchronous section detection unit from the backward direction. It is characterized by the following.

【0028】この可変長復号化装置は、順方向復号化手
段および逆方向復号化手段の復号結果から復号値を判定
する復号値判定手段とを有してもよい。
This variable length decoding device may include a decoded value judging means for judging a decoded value from the decoding results of the forward decoding means and the backward decoding means.

【0029】ここで、同期区間検出手段は、例えばスタ
ッフィング符号を逆方向から復号することで、符号化デ
ータのビット数を検出する。
Here, the synchronous section detecting means detects the number of bits of the encoded data by decoding, for example, the stuffing code in the reverse direction.

【0030】また、順方向復号化手段および逆方向復号
化手段の少なくとも一方は、可変長符号の符号語テーブ
ルに存在しない符号語が符号化データに出現したとき、
該符号語を誤りとして検出する可変長符号の符号語テー
ブルに存在しない符号語が符号化データに出現によって
誤りを検出するか、あるいは復号した符号化データのビ
ット数が伝送されてきた符号化データのビット数と一致
しない場合、誤りと検出する。
In addition, at least one of the forward decoding means and the backward decoding means is adapted to execute a codeword which does not exist in the codeword table of the variable length code in the encoded data.
Either a codeword that does not exist in the codeword table of the variable-length code that detects the codeword as an error detects an error by appearing in the encoded data, or the number of bits of the decoded encoded data transmitted. If the number of bits does not match, an error is detected.

【0031】また、順方向復号化手段および逆方向復号
化手段の少なくとも一方は、符号化データを復号して得
られた復号値が不適な場合に、復号処理の誤りとして検
出する。
At least one of the forward decoding means and the backward decoding means detects an error in the decoding process when the decoded value obtained by decoding the encoded data is inappropriate.

【0032】一方、復号値判定手段は、例えば順方向復
号化手段および逆方向復号化手段の少なくとも一方で誤
りが検出された場合は、順方向復号化手段および逆方向
復号化手段の復号結果のうち正しいと推定される復号結
果を使用し、いずれの復号結果でも復号できなかった部
分は放棄する。
On the other hand, when an error is detected in at least one of the forward decoding unit and the backward decoding unit, the decoded value determining unit determines whether the decoding result of the forward decoding unit and the backward decoding unit is correct. The decoding result that is estimated to be correct is used, and the portion that cannot be decoded in any decoding result is discarded.

【0033】具体的には、(a)前記順方向復号化手段
および逆方向復号化手段の両方で前記誤りが検出され、
かつそれらの誤り検出位置が交差しない場合は、誤りが
検出されなかった復号結果のみ復号値として使用し、
(b)前記順方向復号化手段および逆方向復号化手段の
両方で前記誤りが検出され、かつそれらの誤りが検出さ
れ、かつそれらの誤りが検出された位置が交差する場合
は、順方向復号化手段で誤りが発見された位置の直前ま
での符号語に対する復号値は順方向の復号結果を使用
し、それ以後の符号語に対する復号値は逆方向の復号結
果を使用し、(c)前記順方向復号化手段および逆方向
復号化手段のいずれか一方のみで前記誤りが検出された
場合は、該誤りが検出された位置の直前までの符号語に
対する復号値は順方向の復号結果を使用し、それ以後の
符号語に対する復号値は逆方向の復号結果を使用し、
(d)前記順方向復号化手段および逆方向復号化手段で
同一の符号語について前記誤りが検出された場合は、該
誤りが検出された位置の符号語に対する復号値を放棄
し、それ以後の符号語に対する復号値は逆方向の復号結
果を使用する。
Specifically, (a) the error is detected by both the forward decoding means and the backward decoding means;
And when those error detection positions do not intersect, only the decoding result in which no error is detected is used as a decoding value,
(B) when the error is detected by both the forward decoding means and the reverse decoding means, and the errors are detected, and the positions where the errors are detected intersect, the forward decoding Decoding values for codewords immediately before the position where the error is found by the decoding means use the results of decoding in the forward direction, and decoding values for codewords thereafter use the results of decoding in the reverse direction; If the error is detected by only one of the forward decoding unit and the backward decoding unit, the decoded value for the codeword immediately before the position where the error is detected uses the decoding result of the forward direction. And the decoded values for the subsequent codewords use the decoded result in the reverse direction,
(D) when the forward decoding means and the backward decoding means detect the error for the same codeword, abandon the decoded value for the codeword at the position where the error is detected, and The decoded value for the codeword uses the decoded result in the reverse direction.

【0034】なお、復号値判定手段は、順方向復号化手
段および逆方向復号化手段の少なくとも一方で誤りが検
出された場合は、誤りが入っている可能性のある部分を
全て放棄する構成でもよい。
Note that the decoding value judging means may be configured to discard all possibly errored parts when an error is detected in at least one of the forward decoding means and the backward decoding means. Good.

【0035】この可変長復号化装置では、可変長符号の
符号語の誤り検出機能を有する順方向復号化手段および
逆方向復号化手段の復号結果から復号値を判定する際、
順方向復号化手段および逆方向復号化手段での誤り検出
結果に応じて、符号化データの復号値を判定することに
より、上記のような可変長符号化装置から出力されるリ
バーシブル符号を伝送路誤りに対して効果的に復号する
ことが可能となる。
In this variable length decoding device, when a decoded value is determined from the decoding results of the forward decoding unit and the backward decoding unit having a function of detecting an error of a code word of a variable length code,
By determining the decoded value of the encoded data according to the error detection result in the forward decoding unit and the backward decoding unit, the reversible code output from the variable length encoding device as described above is transmitted through the transmission path. It is possible to effectively decode errors.

【0036】また、スタッフィング符号として逆方向に
復号可能な符号を用いているため、スタッフィング符号
を用いて一定区間単位の同期区間の設定が行なわれてい
る場合でも、リバーシブル符号の逆方向復号が可能とな
る。
Also, since a code that can be decoded in the reverse direction is used as the stuffing code, the reversible code can be decoded in the reverse direction even when the synchronization section is set in units of fixed sections using the stuffing code. Becomes

【0037】本発明に係る第2の可変長復号化装置は、
順方向にも逆方向にも復号可能な可変長符号からなり、
所定の同期区間毎に逆方向に復号可能なスタッフィング
符号が挿入された符号化データを復号する可変長復号化
装置において、符号化データの同期区間を検出する同期
区間検出手段と、この同期区間検出手段により検出され
た同期区間の符号化データを復号する順方向および逆方
向の両方向の復号が可能な双方向復号化手段とを有する
ことを特徴とする。
A second variable length decoding device according to the present invention comprises:
It consists of a variable length code that can be decoded in both the forward and reverse directions,
In a variable length decoding device for decoding coded data into which a stuffing code that can be decoded in the reverse direction is inserted for each predetermined synchronization section, a synchronization section detecting means for detecting a synchronization section of the coded data; Bidirectional decoding means capable of decoding in both the forward and reverse directions for decoding the encoded data of the synchronization section detected by the means.

【0038】ここで、双方向復号化手段は、順方向の復
号処理および逆方向の復号処理の少なくとも一方におい
て、符号化データを復号して得られた復号値が不適な場
合、復号処理の誤りとして検出する。
Here, in at least one of the forward-direction decoding process and the backward-direction decoding process, the bidirectional decoding means determines whether an error in the decoding process has occurred if the decoded value obtained by decoding the encoded data is inappropriate. Detected as

【0039】双方向復号化手段の復号方法としては、以
下の方法を用いることができる。
As a decoding method of the bidirectional decoding means, the following method can be used.

【0040】(a)順方向の復号処理を行なった後、符
号化データの末尾より逆方向の復号処理を行なう。
(A) After performing the forward decoding process, the backward decoding process is performed from the end of the encoded data.

【0041】(b)順方向の復号処理で誤りを検出した
場合に、該順方向の復号処理を中止し、符号化データの
末尾より逆方向の復号処理を行なう。
(B) When an error is detected in the forward decoding process, the forward decoding process is stopped and the backward decoding process is performed from the end of the encoded data.

【0042】(c)順方向の復号処理で誤りを検出した
場合に、該誤り位置より任意の距離離れた位置から順方
向の復号処理を再開する。
(C) When an error is detected in the forward decoding process, the forward decoding process is restarted from a position arbitrarily distant from the error position.

【0043】(d)順方向の復号処理で誤りを検出した
場合に、該誤り位置より任意の距離離れた位置から該誤
り位置まで逆方向の復号処理を行なう。
(D) When an error is detected in the forward decoding process, a reverse decoding process is performed from a position arbitrarily distant from the error position to the error position.

【0044】(e)順方向の復号処理において符号化デ
ータの末尾で誤りを検出した場合に限り、逆方向の復号
処理を行なう。
(E) Reverse decoding is performed only when an error is detected at the end of the encoded data in the forward decoding.

【0045】この第2の可変長復号化装置においても、
順方向復号化手段および逆方向復号化手段の復号結果か
ら復号値を判定する復号値判定手段を有してもよい。
In the second variable length decoding device,
The image processing apparatus may further include a decoded value determining unit that determines a decoded value from decoding results of the forward decoding unit and the backward decoding unit.

【0046】この第2の可変長復号化装置では、可変長
符号の符号語の誤り検出機能を有する双方向復号化手段
で復号処理を行なう際に、順方向復号処理での誤り検出
結果に応じて符号化データの復号処理を切り替えること
により、順方向と逆方向の復号処理手段を共用できるこ
とから、回路規模や演算量を大幅に増加させることな
く、上記のような可変長符号化装置から出力されるリバ
ーシブル符号を伝送路誤りに対して効果的に復号するこ
とが可能となる。
In the second variable-length decoding device, when decoding is performed by the bidirectional decoding means having a function of detecting an error in a code word of a variable-length code, the decoding is performed in accordance with the error detection result in the forward decoding. By switching the decoding process of the encoded data, the decoding processing means in the forward direction and the reverse direction can be shared, so that the output from the variable-length encoding device as described above can be performed without greatly increasing the circuit scale and the amount of calculation. It is possible to effectively decode the reversible code to be transmitted with respect to a transmission path error.

【0047】本発明に係る第3の可変長復号化装置は、
第3の可変長符号化装置に対応した可変長復号化装置で
あり、順方向にも逆方向にも復号可能な符号語を含む符
号語で構成された可変長符号からなり、階層化された情
報シンボルに対応する符号語により作成され、かつ多重
化された符号化データを所定の同期区間毎に復号する可
変長復号化装置において、多重化された符号化データを
階層毎に分離する分離手段と、この分離手段により分離
された符号化データの同期区間を検出する同期区間検出
手段と、この同期区間検出手段により検出された同期区
間の符号化データを順方向から復号する順方向復号化手
段と、同期区間検出手段により検出された同期区間の符
号化データを逆方向から復号する逆方向復号化手段と、
これら順方向復号化手段および逆方向復号化手段により
得られた階層毎の復号結果を合成する合成手段とを有す
ることを特徴とする。
A third variable length decoding device according to the present invention comprises:
A variable-length decoding device corresponding to the third variable-length coding device, comprising a variable-length code composed of codewords including codewords that can be decoded in both forward and backward directions, and hierarchized. In a variable length decoding device that decodes coded data created and multiplexed by a code word corresponding to an information symbol for each predetermined synchronization section, separating means for separating the multiplexed coded data for each layer Synchronization section detection means for detecting a synchronization section of the encoded data separated by the separation means, and forward decoding means for decoding the encoded data of the synchronization section detected by the synchronization section detection means from the forward direction And a backward decoding means for decoding the encoded data of the synchronization section detected by the synchronization section detection means from the reverse direction,
And a synthesizing unit for synthesizing the decoding result for each layer obtained by the forward decoding unit and the backward decoding unit.

【0048】この第3の可変長復号化装置においても、
順方向復号化手段および逆方向復号化手段の復号結果か
ら復号値を判定する復号値判定手段を有してもよい。
In the third variable length decoding device,
The image processing apparatus may further include a decoded value determining unit that determines a decoded value from decoding results of the forward decoding unit and the backward decoding unit.

【0049】この第3の可変長復号化装置を第3の可変
長符号化装置と合わせて用いることによって、情報シン
ボルのシンタクスによらず順方向にも逆方向にも復号可
能であって、より誤りに強い可変長符号化/復号化装置
を実現することができる。
By using the third variable length decoding device together with the third variable length coding device, decoding can be performed in both the forward and reverse directions regardless of the information symbol syntax. An error-resistant variable-length encoding / decoding device can be realized.

【0050】また、本発明に係る第1の可変符号化/復
号化装置が入出力可能な可変長符号化データを記録した
記録媒体において、順方向にも逆方向にも復号可能であ
って、符号語の予め定められた重みによって符号語の区
切りがわかるように構成された符号語を含む符号化デー
タと、前記符号化データに所定の同期区間毎に逆方向に
復号可能なスタッフィング符号を挿入したデータを記録
した読み取り可能であることを特徴とする。
Further, in the recording medium on which the variable length coded data which can be input / output by the first variable coding / decoding device according to the present invention can be decoded in both the forward and reverse directions, Insert coded data including a code word configured so that a delimiter of the code word can be identified by a predetermined weight of the code word, and insert a stuffing code that can be decoded in the reverse direction into the coded data every predetermined synchronization section The recorded data is readable.

【0051】さらに、本発明に係る可変長符号化/復号
化装置を適応した画像符号化/復号化装置でブロック単
位の直交変換を行なって生成され得る変換係数データを
記録した記録媒体において、前記変換係数データは、前
記画像符号化/復号化装置がもつ複数の符号化モード毎
に、順方向にも逆方向にも復号可能であ複数の符号後
を、ブロックの最後以外の直交変換係数のうち出現頻度
の高いものに対してそれぞれ対応させたデータと、前記
画像符号化/復号化装置の複数の符号化モードに対して
共通に設けられて、順方向にも逆方向にも復号可能であ
複数の符号後を、ブロックの最後の直交変換係数のうち
出現頻度の高いものに対してそれぞれ対応させたデータ
と、出現頻度の低い変換係数データを固定長符号で記述
し、その先頭と末尾に順方向にも逆方向にも復号可能な
符号語を付加したデータと、前記符号化データに所定の
同期区間毎に逆方向に復号可能なスタッフィング符号を
挿入したデータを記録した読み取り可能であことを特徴
とする。
Further, in a recording medium in which transform coefficient data which can be generated by performing an orthogonal transform in block units by an image encoding / decoding apparatus to which the variable length encoding / decoding apparatus according to the present invention is applied is recorded. The transform coefficient data can be decoded in both the forward and reverse directions for each of a plurality of encoding modes of the image encoding / decoding device, and after a plurality of codes, an orthogonal transform coefficient other than the end of the block is obtained. Among them, data respectively corresponding to those having a high frequency of appearance and common to a plurality of encoding modes of the image encoding / decoding device can be decoded in both forward and reverse directions. After a plurality of codes, the data corresponding to the most frequently occurring of the last orthogonal transform coefficients of the block and the less frequently occurring transform coefficient data are described with fixed-length codes, and the beginning and end thereof are described. It is readable to record data to which a codeword that can be decoded in both the forward and reverse directions has been added and data in which a stuffing code that can be decoded in the reverse direction has been inserted into the coded data for each predetermined synchronization section. It is characterized by.

【0052】また、本発明に係る可変符号化/復号化装
置が入出力可能な可変長符号化データを記録した記録媒
体は、順方向にも逆方向にも復号可能であって、符号語
の予め定められた重みによって符号語の区切りがわかる
ように構成された符号語を含む符号化データと、前記符
号化データに所定の同期区間毎に逆方向に復号可能なス
タッフィング符号を挿入したデータと、を記録すること
を特徴としている。
The recording medium storing the variable length coded data which can be input / output by the variable coding / decoding device according to the present invention can be decoded in both the forward and reverse directions, Coded data including a codeword configured so that a delimiter of a codeword can be recognized by a predetermined weight, and data obtained by inserting a stuffing code that can be decoded in the reverse direction for each predetermined synchronization interval in the coded data. , Is recorded.

【0053】さらに、本発明に係る画像符号化/復号化
装置でブロック単位の直交変換を行なって生成され得る
変換係数データを記録した記録媒体は、前記変換係数デ
ータが前記画像符号化/復号化装置がもつ複数の符号化
モード毎に、順方向にも逆方向にも復号可能である複数
の符号語を、ブロックの最後以外の直交変換係数のうち
出現頻度の高いものに対してそれぞれ対応させたデータ
と、前記画像符号化/復号化装置の複数の符号化モード
に対して共通に設けられ、順方向にも逆方向にも復号可
能である複数の符号語を、ブロックの最後の直交変換係
数のうち出現頻度の高いものに対してそれぞれ対応させ
たデータと、出現頻度の低い変換係数データを固定長符
号で記述し、その先頭と末尾に順方向にも逆方向にも復
号可能な符号語を付加したデータと、前記符号化データ
に所定の同期区間毎に逆方向に復号可能なスッフィング
符号を挿入したデータと、を記録することを特徴として
いる。
Further, the recording medium which records the transform coefficient data which can be generated by performing the orthogonal transform on a block basis by the image encoding / decoding apparatus according to the present invention is characterized in that the transform coefficient data is stored in the image encoding / decoding apparatus. For each of a plurality of encoding modes of the device, a plurality of codewords that can be decoded in both the forward and reverse directions are respectively associated with the most frequently occurring orthogonal transform coefficients other than the end of the block. Data and a plurality of codewords which are provided in common for a plurality of encoding modes of the image encoding / decoding device and which can be decoded in both the forward and reverse directions are converted to the last orthogonal transform of the block. Codes that correspond to high-frequency coefficients and low-frequency transform coefficient data are described using fixed-length codes, and codes that can be decoded in the forward and reverse directions at the beginning and end. Words A pressure data, is characterized in that for recording, and data Suffingu inserting the code decodable in the opposite direction for each predetermined synchronization interval on the coded data.

【0054】また、複数の情報シンボルに対して該情報
シンボルの生起確率に応じた符号長を有する符号語をそ
れぞれ割り当て、入力された情報シンボルに対応した符
号語を符号化データとして出力する可変長符号化装置で
用いられるプログラムを記録した記録媒体は、順方向に
も逆方向にも復号可能であって、符号語の予め定められ
た重みによって符号語の区切りが分かるように構成され
た符号語を含む複数の符号語を情報シンボルにそれぞれ
対応させた符号語テーブルを格納する手順と、前記符号
語テーブルから前記入力された情報シンボルに対応する
符号語を選択する手順と、前記符号語を選択する手順に
より選択された符号語を用いて所定の同期区間毎に符号
化データを作成すると共に、逆方向に復号可能なスタッ
フィング符号を挿入することにより前記符号語に同期区
間を設定する手順と、を少なくとも含むプログラムを記
録することを特徴としている。
A variable length code code having a code length corresponding to the occurrence probability of the information symbol is assigned to each of a plurality of information symbols, and a code word corresponding to the input information symbol is output as coded data. A recording medium on which a program used in the encoding device is recorded can be decoded in both the forward and reverse directions, and a code word configured so that a delimiter of the code word can be identified by a predetermined weight of the code word. Storing a codeword table in which a plurality of codewords each including an information symbol are associated with the information symbol, selecting a codeword corresponding to the input information symbol from the codeword table, and selecting the codeword Using the codeword selected by the above procedure, encoded data is created for each predetermined synchronization section, and a stuffing code that can be decoded in the reverse direction is inserted. It is characterized by recording at least including programs, and procedures for setting the synchronization period to the code word by.

【0055】さらに、順方向にも逆方向にも復号可能な
符号語を含む符号語で構成された可変長符号からなり、
所定の同期区間毎に逆方向に復号可能なスタッフィング
符号が挿入された符号化データを復号する可変長復号化
装置で用いられるプログラムを記録した記録媒体は、前
記符号化データの同期区間を検出する手順と、前記手順
により検出された同期区間の符号化データを順方向から
復号する手順と、前記同期区間を検出する手順により検
出された同期区間の符号化データを逆方向から復号する
手順と、を少なくとも含むプログラムを記録することを
特徴とする。
Further, the variable length code comprises a code word including a code word which can be decoded in both the forward and reverse directions,
A recording medium storing a program used in a variable-length decoding device that decodes encoded data in which a stuffing code that can be decoded in the backward direction is inserted for each predetermined synchronization section detects a synchronization section of the encoded data. A step of decoding the encoded data of the synchronous section detected by the procedure from the forward direction, and a step of decoding the encoded data of the synchronous section detected by the step of detecting the synchronous section from the backward direction. And recording a program including at least the following.

【0056】[0056]

【発明の実施の形態】以下、図面を参照して本発明の実
施形態を説明する。
Embodiments of the present invention will be described below with reference to the drawings.

【0057】(第1実施形態)図1は、本発明の第1実
施形態の可変長符号化/復号化装置の構成を示すブロッ
ク図である。
(First Embodiment) FIG. 1 is a block diagram showing a configuration of a variable length encoding / decoding device according to a first embodiment of the present invention.

【0058】第1実施形態の可変長符号化/復号化装置
は、大きく分けて符号語テーブル作成部101、符号化
部113、伝送系または蓄積系105および復号化部1
14からなる。まず、これら各部の機能について簡単に
説明すると、符号語テーブル作成部101は情報シンボ
ルの生起確率に基づいて符号語テーブルを作成し、符号
化部113内の符号語テーブル102と、復号化部11
4内の順方向符号語テーブル111および逆方向符号語
テーブル112に符号語を送る。
The variable-length encoding / decoding device according to the first embodiment is roughly divided into a codeword table creating unit 101, an encoding unit 113, a transmission or storage system 105, and a decoding unit 1.
Consists of fourteen. First, the function of each of these units will be briefly described. The codeword table creation unit 101 creates a codeword table based on the occurrence probabilities of information symbols, and the codeword table 102 in the encoding unit 113 and the decoding unit 11
4 is sent to the forward codeword table 111 and the backward codeword table 112.

【0059】符号化部113は、情報シンボルを可変長
符号に符号化し、その可変長符号を符号化データとして
伝送系または蓄積系105へ出力する。復号化部114
は、伝送系または蓄積系105を介して入力されてきた
符号化データを復号して元の情報シンボルを再生する。
The encoding section 113 encodes the information symbol into a variable length code, and outputs the variable length code to the transmission system or storage system 105 as encoded data. Decryption unit 114
Decodes the coded data input via the transmission system or the storage system 105 to reproduce the original information symbols.

【0060】次に、この第1実施形態の各部の詳細な構
成と動作を説明する。
Next, the detailed configuration and operation of each part of the first embodiment will be described.

【0061】符号化部113において、入力された情報
シンボルは符号化器103に入力される。符号化部11
3は、符号語テーブル102と符号化器103および同
期区間設定部104により構成される。符号語テーブル
102は、符号語テーブル作成部101によって予め作
成された情報シンボルと可変長符号の符号語とを対応さ
せて格納している。符号化器103は、符号語テーブル
102に格納されている符号語の中から、入力された情
報シンボルに対応した符号語を選択して出力する。同期
区間設定部104では、符号化器103が選択した符号
語を同期区間毎にまとめ、さらに順方向にも逆方向にも
復号可能なスタッフィング符号を挿入して、同期区間毎
に符号化データを出力する。この符号化データは、伝送
系または蓄積系105を通して復号化部114に送られ
る。
[0061] In the coding section 113, the input information symbols are input to the encoder 103. Encoding unit 11
3 includes a codeword table 102, an encoder 103, and a synchronization section setting unit 104. The codeword table 102 stores information symbols created in advance by the codeword table creation unit 101 and codewords of variable-length codes in association with each other. The encoder 103 selects and outputs a codeword corresponding to the input information symbol from the codewords stored in the codeword table 102. In the synchronization section setting unit 104, the codewords selected by the encoder 103 are grouped for each synchronization section, and a stuffing code that can be decoded in both the forward and reverse directions is inserted. Output. The encoded data is sent to the decoding unit 114 through the transmission system or the storage system 105.

【0062】前記復号化部114は、同期区間検出部1
06、バッファ107、順方向復号化器108、逆方向
復号化器109、復号値判定部110、順方向復号化テ
ーブル111および逆方向復号化テーブル112により
構成される。復号化部114では、伝送系または蓄積系
105より入力された符号化データから同期区間検出部
106で符号化データの同期区間を検出し、符号化デー
タをバッファ107に蓄積する。順方向復号化器108
では、バッファ107に蓄積された符号化データの先頭
から復号を開始する。逆方向復号化器109では、バッ
ファ107に蓄積された符号化データの末尾から復号を
開始する。
The decoding section 114 is provided with the synchronous section detecting section 1
06, a buffer 107, a forward decoder 108, a backward decoder 109, a decoded value determination unit 110, a forward decoding table 111, and a backward decoding table 112. In the decoding section 114, the synchronization section of the coded data is detected by the synchronization section detection section 106 from the coded data input from the transmission system or the storage system 105, and the coded data is stored in the buffer 107. Forward decoder 108
Then, the decoding is started from the head of the encoded data stored in the buffer 107. The backward decoder 109 starts decoding from the end of the encoded data stored in the buffer 107.

【0063】順方向復号化器108では、符号化データ
に順方向符号語テーブル111に存在しないビットパタ
ーンが出現した場合、およびバッファ107のビット数
と異なるビット数の符号化データが復号された場合、誤
り検出と判定する。同様に逆方向復号化器109でも、
符号化データに逆方向符号語テーブル112に存在しな
いビットパターンが出現した場合、およびバッファ10
7のビット数と異なるビット数の符号化データが復号さ
れた場合、誤り検出と判定する。
In the forward decoder 108, when a bit pattern that does not exist in the forward codeword table 111 appears in the encoded data, and when the encoded data having a bit number different from the bit number of the buffer 107 is decoded. Is determined as error detection. Similarly, in the reverse decoder 109,
When a bit pattern that does not exist in the backward codeword table 112 appears in the encoded data,
If encoded data having a bit number different from 7 is decoded, it is determined that an error has been detected.

【0064】復号値判定部110は、順方向復号化器1
08によって得られた復号結果(順方向復号結果とい
う)と、逆方向復号化器109によって得られた復号結
果(逆方向復号器という)から復号値を判定し、最終的
な復号結果を出力する。図2は符号語テーブル作成部1
01の構成を示すブロック図である。符号選択部21は
情報シンボルの生起確率の情報が入力され、選択可能な
符号系の中から最も平均符号長の小さいものを選択し
て、選択結果を符号語構成部22に送る。符号語構成部
22では、符号語選択部21で選択された符号の符号語
を構成する。
The decoded value judging section 110 is a
08 and a decoding result (referred to as a backward decoder) obtained by the backward decoder 109 and a decoding value are determined, and a final decoding result is output. . FIG. 2 shows a codeword table creation unit 1
FIG. 2 is a block diagram showing a configuration of the first embodiment. The code selection unit 21 receives information on the occurrence probabilities of the information symbols, selects the code system with the smallest average code length from the selectable code systems, and sends the selection result to the codeword configuration unit 22. The codeword configuration unit 22 configures a codeword of the code selected by the codeword selection unit 21.

【0065】符号語構成部22で構成される符号語は、
符号語の予め定められた重みにより符号の区切りが分か
るように構成された順方向にも逆方向にも復号可能な可
変長符号(以下、リバーシブル符号という)であり、例
えば特願平7−89772、特願平7−260383に
記載された符号である。
The code word constituted by the code word forming unit 22 is
It is a variable-length code (hereinafter, referred to as a reversible code) that can be decoded in both the forward direction and the reverse direction and that is configured so that the delimitation of the code can be recognized by a predetermined weight of the code word. For example, Japanese Patent Application No. 7-89772. And Japanese Patent Application No. 7-260383.

【0066】この第1実施形態においては、より幅広い
確率分布に対応し、符号語のビットパターンの自由度を
上げるために、符号語構成部22における符号語の構成
方法として以下に示す方法を用いている。
In the first embodiment, in order to cope with a wider probability distribution and increase the degree of freedom of the bit pattern of the code word, the following method is used as the code word configuration method in the code word configuration unit 22. ing.

【0067】図3は、符号語構成部22におけるリバー
シブル符号の符号語の第1の構成方法を示している。ま
ず、図3の左側に示すように、符号長が短い順にそれぞ
れの系列の重み(この場合、“1”の数)が一定で異な
る重みを持つ2つの2進系列(この場合、重みは0個と
1個)を作成する。次に、図3の中央に示すように、こ
の2進系列のそれぞれ先頭と末尾に“1”を追加して2
進系列のビットを反転させた後、これら2つの2進系列
を図3の右側に示すように合成する。
FIG. 3 shows a first method of forming a codeword of a reversible code in the codeword forming unit 22. First, as shown on the left side of FIG. 3, two binary sequences (in this case, weights of 0) in which the weight of each sequence (in this case, the number of “1”) is constant and different weights are arranged in ascending order of code length. And one). Next, as shown in the center of FIG. 3, "1" is added to the beginning and end of each
After inverting the bits of the binary sequence, these two binary sequences are combined as shown on the right side of FIG.

【0068】この可変長符号では、各符号の最初にある
シンボルの個数をカウントすることによって符号長が分
かる。図3の例では、最初が“0”ならば、“0”が2
つ出現したら符号の区切り(符号長)が分かり、最初が
“1”ならば、“1”が3つ出現したら符号の区切りが
分かる符号構成となっている。また、この図3に示す可
変長符号は、全ての情報シンボルA〜Jに対応する符号
語が図4(a)に示す順方向の復号木の葉にも、図4
(b)の逆方向の復号木の葉にも割り当てられることか
ら、順方向にも逆方向にも復号可能であることが分か
る。
In this variable length code, the code length can be determined by counting the number of symbols at the beginning of each code. In the example of FIG. 3, if “0” is the first, “0” is 2
When the number of occurrences is one, the code division (code length) is known. If the number is "1" at the beginning, the code division is known when three "1" s appear. The variable-length code shown in FIG. 3 is such that the codewords corresponding to all the information symbols A to J also appear on the leaves of the decoding tree in the forward direction shown in FIG.
Since it is also assigned to the leaf of the decoding tree in the backward direction of (b), it can be seen that decoding is possible in both the forward and backward directions.

【0069】図5は、符号語構成部22におけるリバー
シブル符号の符号語の第2の構成方法を示している。ま
ず、図5の左側に示すように、第1のリバーシブル符号
と第2のリバーシブル符号を用意する。次に、図5の中
央に示すように、第1のリバーシブル符号の全ての符号
語の末尾に、第2のリバーシブル符号の最初の1つの符
号語を追加する。以下、同様に第1のリバーシブル符号
の全ての符号語の末尾に、第2のリバーシブル符号の全
ての符号語を1つずつ追加した後、図5の右側に示すよ
うに並べ替えを行なって、新たなリバーシブル符号を構
成する。このような構成方法によって、第1のリバーシ
ブル符号の符号語数A(この例ではA=9)と第2のリ
バーシブル符号の符号語数B(この例ではB=3)を乗
算した数A×B個(この例では27個)の新たなリバー
シブル符号を構成することができる。
FIG. 5 shows a second method of forming a codeword of a reversible code in the codeword forming unit 22. First, as shown on the left side of FIG. 5, a first reversible code and a second reversible code are prepared. Next, as shown in the center of FIG. 5, the first one codeword of the second reversible code is added to the end of all codewords of the first reversible code. Hereinafter, similarly, after adding all the code words of the second reversible code one by one to the end of all the code words of the first reversible code, rearrangement is performed as shown on the right side of FIG. Construct a new reversible code. According to such a configuration method, the number A × B obtained by multiplying the number A of codewords of the first reversible code (A = 9 in this example) and the number B of codewords of the second reversible code (B = 3 in this example) (27 in this example) new reversible codes can be configured.

【0070】この構成方法によるリバーシブル符号の復
号に当たっては、順方向から復号する時は、まず第1の
リバーシブル符号を復号し、次に第2のリバーシブル符
号を復号するようにする。逆方向から復号する時は、ま
ず第2のリバーシブル符号を復号し、次に第1のリバー
シブル符号を復号する。従って、順方向にも逆方向にも
復号可能であることが分かる。
In decoding a reversible code according to this configuration method, when decoding in the forward direction, the first reversible code is decoded first, and then the second reversible code is decoded. When decoding from the reverse direction, first, the second reversible code is decoded, and then the first reversible code is decoded. Therefore, it can be seen that decoding can be performed in both the forward direction and the reverse direction.

【0071】なお、この例では第1のリバーシブル符号
の符号語の末尾に第2のリバーシブル符号を追加した
が、第1のリバーシブル符号の先頭に第2のリバーシブ
ル符号を追加してもよく、また第1のリバーシブル符号
の末尾と先頭の両方に固定長符号を追加しても構わな
い。また、この例では第1のリバーシブル符号と第2の
リバーシブル符号は異なるものを用いたが、同一のもの
を使用しても構わない。さらに、本実施形態では第1の
リバーシブル符号も第2のリバーシブル符号も可変長符
号を用いたが、どちらかを固定長符号に変更しても構わ
ない。
In this example, the second reversible code is added to the end of the code word of the first reversible code. However, the second reversible code may be added to the head of the first reversible code. A fixed-length code may be added to both the end and the head of the first reversible code. Also, in this example, the first reversible code and the second reversible code are different, but the same code may be used. Further, in the present embodiment, both the first reversible code and the second reversible code use a variable length code, but either one may be changed to a fixed length code.

【0072】図6は、符号語構成部21におけるリバー
シブル符号の第3の符号構成方法を示している。まず、
図6の左側に示すように、可変長のリバーシブル符号と
固定長のリバーシブル符号を用意する。次に、図6の右
側に示すように、リバーシブル符号の符号語の各ビット
の直後に固定長のリバーシブル符号を追加する。この構
成方法により、Kビットの固定長のリバーシブル符号を
用いた場合、Hビットの符号語を(K+1)Hビットに
して符号語数を2KH倍にすることができる。なお、こ
の例ではリバーシブル符号の符号語の各ビット毎の直後
に固定長符号を追加したが、各ビットの直前に固定長符
号を追加してもよく、また直前と直後の両方に固定長符
号を追加しても構わない。
FIG. 6 shows a third code construction method of the reversible code in the code word construction section 21. First,
As shown on the left side of FIG. 6, a variable-length reversible code and a fixed-length reversible code are prepared. Next, as shown on the right side of FIG. 6, a fixed-length reversible code is added immediately after each bit of the code word of the reversible code. According to this configuration method, when a K-bit fixed-length reversible code is used, the number of codewords can be increased to 2KH times by changing the H-bit codeword to (K + 1) H bits. In this example, the fixed-length code is added immediately after each bit of the code word of the reversible code. However, the fixed-length code may be added immediately before each bit, or the fixed-length code may be added immediately before and after each bit. May be added.

【0073】次に、図7を用いて同期区間設定部104
における符号化データの同期区間の設定方法の具体例に
ついて説明する。図7(a)は、同期符号を挿入するこ
とにより同期区間を設定する方法を示している。この場
合、同期区間検出部106では符号化データの最初と最
後の同期符号を検出することにより、同期区間を検出す
ることができる。ここで、同期符号の挿入可能位置をあ
る一定区間単位(この場合は、Mビット単位)に設定す
るようにするため、符号化データの末尾に1〜Mビット
のスタッフィング符号を挿入している。
Next, referring to FIG. 7, the synchronous section setting section 104
A specific example of the method of setting the synchronization section of the encoded data in will be described. FIG. 7A shows a method of setting a synchronization section by inserting a synchronization code. In this case, the synchronization section detection unit 106 can detect the synchronization section by detecting the first and last synchronization codes of the encoded data. Here, in order to set the position where the synchronization code can be inserted in a certain section (in this case, in units of M bits), a stuffing code of 1 to M bits is inserted at the end of the encoded data.

【0074】図7(b)は、符号化データの先頭に同期
区間の符号量を記述する方法、言い換えれば同期区間の
終了位置を示すポインタを挿入する方法を示している。
この場合、同期区間検出部106では、まず符号化デー
タの先頭の同期区間の符号量の記述を復号することで、
同期区間を検出することができる。そして、符号量の記
述の単位はMビット単位となっているため、符号化デー
タの末尾に1〜Mビットのスタッフィング符号を挿入す
る。
FIG. 7B shows a method of describing the code amount of the synchronous section at the head of the encoded data, in other words, a method of inserting a pointer indicating the end position of the synchronous section.
In this case, the synchronous section detection unit 106 first decodes the description of the code amount of the first synchronous section of the encoded data,
Synchronous sections can be detected. Since the unit of description of the code amount is an M-bit unit, a stuffing code of 1 to M bits is inserted at the end of the encoded data.

【0075】ここで、図7(a)(b)で用いられるス
タッフィング符号は、少なくとも逆方向に復号可能な構
成となっていることが特徴である。図8は、このような
スタッフィング符号の具体例を示した図であり、このス
タッフィング符号は順方向にも逆方向にも復号可能に構
成されている。このスタッフィング符号の場合、1ビッ
トの時は“1”が出現すればそれが区切りで、それ以外
では“0”が2度出現すると区切りが分かるような、順
方向にも逆方向にも復号可能な可変長符号となってい
て、同期区間の最後からも逆方向に復号可能となってい
ると同時に、符号化データのビット数を計算することが
可能になっている。符号化データのビット数の計算結果
は、後述する誤り検出に用いられる。
Here, the stuffing codes used in FIGS. 7A and 7B are characterized in that they are configured to be decoded at least in the reverse direction. FIG. 8 is a diagram showing a specific example of such a stuffing code. The stuffing code is configured to be decodable in both forward and reverse directions. In the case of this stuffing code, in the case of 1 bit, if "1" appears, it is a delimiter; otherwise, if "0" appears twice, the delimiter can be recognized. It is a variable length code that can be decoded in the reverse direction even from the end of the synchronization section, and at the same time, the number of bits of the encoded data can be calculated. The calculation result of the number of bits of the encoded data is used for error detection described later.

【0076】なお、この例ではスタッフィング符号を符
号化データの末尾に挿入したが、符号化データの先頭で
も符号化データの内部でもよく、同期区間の内部で文法
上問題ない位置ならば、その挿入位置はどこでもよい。
また、スタッフィング符号は図9に示すような逆方向に
のみ復号可能な符号でもよい。この符号の場合は、逆方
向から復号して“0”が出現したら区切りになるような
符号となっている。
In this example, the stuffing code is inserted at the end of the coded data. However, the stuffing code may be inserted at the beginning of the coded data or inside the coded data. The position can be anywhere.
Further, the stuffing code may be a code that can be decoded only in the reverse direction as shown in FIG. In the case of this code, the code is such that it becomes a delimiter when "0" appears after decoding in the reverse direction.

【0077】次に、図10を用いて復号値判定部110
における復号値の判定方法について説明する。図10
(a)に示すように、順方向復号結果と逆方向復号結果
で誤りが検出される復号語の位置(誤り検出位置)が交
差しない場合は、誤りが検出されなかった復号結果のみ
を復号値として使用し、2つの誤り検出位置の復号結果
は復号値として使用せず放棄する。また、図10(b)
に示すように、順方向復号結果と逆方向復号結果の誤り
検出位置が交差する場合は、順方向復号結果の誤り検出
位置までの復号値は順方向復号結果を使用し、それ以降
の部分は逆方向復号結果を復号値として使用する。
Next, referring to FIG.
The method of determining the decoded value in will be described. FIG.
As shown in (a), when the position of a decoded word at which an error is detected in the forward decoding result and the backward decoding result (error detection position) does not intersect, only the decoding result in which no error is detected is decoded. And the results of decoding at the two error detection positions are discarded without being used as decoded values. FIG. 10 (b)
As shown in, when the error detection positions of the forward decoding result and the reverse decoding result intersect, the decoded values up to the error detection position of the forward decoding result use the forward decoding result, and the subsequent parts are used. The reverse decoding result is used as a decoding value.

【0078】なお、逆方向復号結果を優先して、逆方向
復号結果の誤り検出位置までの復号値としては逆方向復
号結果を使用し、それ以前の部分は順方向復号結果を復
号値として使用してもよい。
The backward decoding result is prioritized, the backward decoding result is used as the decoded value up to the error detection position of the backward decoding result, and the forward decoding result is used as the decoded value for the part before that. May be.

【0079】また、図10(c)に示すように、順方向
復号結果および逆方向復号結果のうち片方向の復号結果
にしか誤りが検出されない場合(この例では、順方向復
号結果のみ誤りが検出されている)は、誤り検出位置ま
での復号値は、順方向復号結果を使用し、それ以降の部
分は逆方向復号結果を復号値として使用する。さらに図
10(d)に示すように、同一の符号語について順方向
復号結果および逆方向復号結果の両方に誤りが検出され
る場合は、誤り検出位置の符号語に対する復号値を放棄
し、それ以後の符号語に対する復号値として、逆方向復
号結果を使用する。なお、順方向復号化器108および
逆方向復号化器109での誤り判定に際しては、符号語
として存在しないビットパターンが生じた場合、検出位
置はその場所とし、前記の判定方法で誤りが検出されな
い場合で、復号したビット数が同期区間内の符号化デー
タのビット数と一致しない場合は、復号化の最初の位置
を誤り検出位置とする。
As shown in FIG. 10 (c), when an error is detected only in a one-way decoding result out of the forward decoding result and the backward decoding result (in this example, only the forward decoding result has an error. Is detected), the decoded value up to the error detection position uses the forward decoded result, and the subsequent portion uses the backward decoded result as the decoded value. Further, as shown in FIG. 10D, when an error is detected in both the forward decoding result and the backward decoding result for the same codeword, the decoded value for the codeword at the error detection position is discarded, and The backward decoding result is used as a decoded value for the subsequent codeword. Note that, when an error is determined by the forward decoder 108 and the backward decoder 109, if a bit pattern that does not exist as a codeword occurs, the detection position is set to that position, and no error is detected by the above-described determination method. In this case, if the number of decoded bits does not match the number of bits of the encoded data in the synchronization section, the first position of decoding is set as the error detection position.

【0080】この第1実施形態では、4つの誤り検出位
置のパターンによる復号値判定方法の1つの例を示した
が、復号値判定部は順方向復号結果および逆方向復号結
果の両方あるいはいずれか一方で誤りが検出された場合
は、正しいと推定される順方向復号結果もしくは逆方向
復号結果を使用し、いずれの復号結果でも復号できなか
った部分は放棄すれば、どのような方法でもよいことは
いうまでもない。
In the first embodiment, one example of the decoded value determination method using the patterns of the four error detection positions has been described. However, the decoded value determination unit determines whether or not both the forward decoding result and the reverse decoding result. On the other hand, if an error is detected, any method may be used as long as the forward decoding result or the backward decoding result estimated to be correct is used, and the portion that could not be decoded in any of the decoding results is discarded. Needless to say.

【0081】(第2実施形態)次に、本発明の第2実施
形態として本発明による可変長符号化/復号化装置の応
用例について説明する。図11は、本発明の第2実施形
態に係る可変長符号化/復号化装置が組み込まれた動画
像符号化/復号化システムの概念図である。まず、動画
像符号化器709においては、情報源符号化器702で
符号化されたデータに対して動画像多重化器703で可
変長符号化と多重化等が行なわれ、送信バッファ704
で平滑化された後、符号化データとして伝送系または蓄
積系705に送り出される。符号化制御部701は、送
信バッファ704のバッファ量を考慮して、情報源符号
化器702と動画像多重化器703の制御を行なう。
(Second Embodiment) Next, as a second embodiment of the present invention, an application example of the variable length coding / decoding device according to the present invention will be described. FIG. 11 is a conceptual diagram of a moving image encoding / decoding system incorporating the variable length encoding / decoding device according to the second embodiment of the present invention. First, in the moving picture encoder 709, the moving picture multiplexer 703 performs variable-length coding and multiplexing on the data encoded by the information source encoder 702, and the transmission buffer 704.
After that, the data is sent to the transmission system or storage system 705 as encoded data. The encoding control unit 701 controls the information source encoder 702 and the video multiplexer 703 in consideration of the buffer amount of the transmission buffer 704.

【0082】一方、動画像復号化器710においては、
伝送系または蓄積系705からの符号化データが受信バ
ッファ706に溜められ、動画像多重化分離器707で
符号化データの多重化分離と可変長復号化が行なわれた
後、情報源復号化器708に送られ、最終的に動画像情
報が復号化される。ここで、動画像多重化器703およ
び動画像多重化分離器707には第1実施形態で説明し
た可変長符号化/復号化装置が適用されている。
On the other hand, in the moving picture decoder 710,
The coded data from the transmission system or the storage system 705 is stored in the reception buffer 706, and the multiplexed data is demultiplexed and variable-length decoded by the video demultiplexer 707. 708, and finally the moving picture information is decoded. Here, the variable length coding / decoding device described in the first embodiment is applied to the moving image multiplexer 703 and the moving image demultiplexer 707.

【0083】図12は、第2実施形態における動画像多
重化器703および動画像多重化分離器707における
動画像符号化方式のシンタクスを示している。マクロブ
ロックのモード情報、動きベクトル情報およぴINTR
A DC(フレーム内符号化におけるDCT係数の直流
成分)の情報を上位階層とし、INTRA DC以外の
DCT係数情報を下位階層として、下位階層にリバーシ
ブル符号を適用している。
FIG. 12 shows the syntax of a moving picture coding method in the moving picture multiplexer 703 and the moving picture demultiplexer 707 in the second embodiment. Macroblock mode information, motion vector information and INTR
Reversible codes are applied to lower layers, with ADC (direct current component of DCT coefficients in intra-frame coding) information being the upper layer and DCT coefficient information other than INTRA DC being the lower layer.

【0084】図13(a)(b)は、この第2実施形態
における動画像多重化器703および動画像多重化分離
器707の構成を示すブロック図である。
FIGS. 13A and 13B are block diagrams showing the configuration of the moving picture multiplexer 703 and moving picture demultiplexer 707 in the second embodiment.

【0085】図13(a)に示す動画像多重化器703
においては、図11中の情報源符号化器702で符号化
されたデータのうち、マクロブロックのモード情報、動
きベクトル情報およびINTRA DCなどの情報を上
位階層とし、上位階層可変長符号化器901で通常の可
変長符号化が行なわれ、多重化器903に送られる。ま
た、情報源符号化器702で符号化されたデータのう
ち、INTRA DC以外のDCT係数は下位階層可変
長符号化器903においてリバーシブル符号で符号化さ
れ、多重化器903に送られる。多重化器903では、
上位階層の符号化データと下位階層の符号化データを多
重化し、送信バッファ704に送る。
A moving image multiplexer 703 shown in FIG.
In the data encoded by the information source encoder 702 in FIG. 11, information such as macroblock mode information, motion vector information, and INTRA DC is set as an upper layer, and an upper layer variable length encoder 901 is used. Perform normal variable-length coding, and send the result to the multiplexer 903. Further, among the data encoded by the information source encoder 702, DCT coefficients other than INTRA DC are encoded by a reversible code in a lower layer variable length encoder 903, and sent to a multiplexer 903. In the multiplexer 903,
The encoded data of the upper layer and the encoded data of the lower layer are multiplexed and sent to the transmission buffer 704.

【0086】一方、図13(b)に示す動画像復号化器
707においては、上位階層の符号化データと下位階層
の符号化データが多重化分離部904により分離され、
これらが上位階層可変長復号化器905および下位階層
可変長復号化器906によりそれぞれ可変長復号化され
る。
On the other hand, in the moving picture decoder 707 shown in FIG. 13B, the coded data of the upper layer and the coded data of the lower layer are separated by the demultiplexer 904.
These are variable-length decoded by the upper layer variable length decoder 905 and the lower layer variable length decoder 906, respectively.

【0087】図14〜図16、図17〜図18および図
19は、下位階層可変長符号化器902で用いられる符
号語テーブルの一例である。この符号語テーブルに格納
された符号は、前述した符号語構成部22におけるリバ
ーシブル符号の符号語の第1の構成方法によって作成し
た符号を末尾に2ビットの固定長符号を追加した符号で
ある。
FIGS. 14 to 16, FIGS. 17 to 18, and FIG. 19 are examples of codeword tables used in the lower layer variable length encoder 902. The code stored in the codeword table is a code obtained by adding a 2-bit fixed-length code to the end of a code created by the first method of forming a reversible codeword in the codeword forming unit 22 described above.

【0088】情報源符号化器702では、量子化後の8
×8のDCT係数のブロック毎にブロック内のスキャン
を行ない、LAST(0:ブロックの最後でない非零係
数、1:ブロックの最後の非零係数)、RUN(非零係
数までの零ランの数)およびLEVEL(係数の量子化
値)を求め、動画像多重化部703に送る。
In the information source encoder 702, the 8
A scan within the block is performed for each block of DCT coefficients of × 8, and LAST (0: non-zero coefficient not at the end of the block, 1: non-zero coefficient at the end of the block), RUN (number of zero runs up to the non-zero coefficient) ) And LEVEL (quantized value of coefficient) are obtained and sent to the moving image multiplexing unit 703.

【0089】動画像多重化部703内の下位階層可変長
符号化器902は、図14〜図16に示すINTRA
(フレーム内符号化)およびINTER(フレーム間符
号化)の非LAST係数、RUN、LEVELにリバー
シブル符号の符号語(VLC_CODE)を対応させた
非LAST係数の符号語テーブルと、図17〜図18に
示すINTRAおよびINTERのLAST係数、RU
N、LEVELにリバーシブル符号の符号語(VLC_
CODE)を対応させたLAST係数の符号語テーブル
を持っている。
The lower layer variable length encoder 902 in the moving picture multiplexing unit 703 includes the INTRA shown in FIGS.
(Intra-frame coding) and INTER (inter-frame coding) non-LAST coefficient, code word table of non-LAST coefficient in which RUN and LEVEL correspond to a code word (VLC_CODE) of a reversible code, and FIGS. Last coefficient of INTRA and INTER shown, RU
N, LEVEL to the reversible codeword (VLC_
CODE) corresponding to a LAST coefficient codeword table.

【0090】そして、モード情報に基づいて、INTR
Aの時はINTRAの非LAST係数とLAST係数の
符号語テーブル、INTERの時はINTERの非LA
ST係数とLAST係数の符号語テーブルを選択して符
号化を行なう。符号語の最終ビットの“s”は、LEV
ELの符号を表し、“s”が“0”の時、LEVELの
符号は正、“s”が“1”の時、LEVELの符号は負
である。
Then, based on the mode information, the INTR
In the case of A, the code word table of the non-LAST coefficient and the LAST coefficient of INTRA, and in the case of INTER, the non-LAST of INTER
An encoding is performed by selecting a codeword table of ST coefficients and LAST coefficients. The “s” of the last bit of the code word is LEV
The sign of EL represents that when "s" is "0", the sign of LEVEL is positive, and when "s" is "1", the sign of LEVEL is negative.

【0091】また、この符号語テーブルに存在しない係
数は、図20に示すようにLAST係数どうかの1ビッ
トとRUNとLEVELの絶対値を固定長符号化し、こ
の固定長符号部の先頭に2つのエスケープ符号のうち、
“00001”を付加し、末端にもエスケープ符号を付
加する。図19は、エスケープ符号の符号語テーブルで
あり、エスケープ(ESCAPE)符号として用いられ
るVLC_ CODEの最終ビットの“s”はLEVEL
の符号を表し、“s”が“0”ならばLEVELは正、
“1”ならばLEVELは負である。
As shown in FIG. 20, for the coefficients not present in the code word table, as shown in FIG. 20, one bit of the LAST coefficient and the absolute value of RUN and LEVEL are fixed-length coded. Of the escape codes,
“00001” is added, and an escape code is also added to the end. FIG. 19 is a codeword table of an escape code. The last bit “s” of VLC_CODE used as an escape (ESCAPE) code is LEVEL.
If “s” is “0”, LEVEL is positive,
If "1", LEVEL is negative.

【0092】図21はこの符号語テーブルを用いた時の
零ランが最大になる場合を示している。通常、同期符号
は零ランが続いた後に“1”を付加するビットパターン
が選択されている。例えばITU−T H.263では
16個の“0”の後に“1”が付くようなビットパター
ンが同期符号となっている。DCT係数の可変長符号化
では、零ランが最大になるのを、エスケープ符号を使う
係数で、LEVELが+64で、次もエスケープ符号を
使う符号が出現する場合で、15個“0”が連続するの
が最大となる。ゆえに“0”が16個連続するようなビ
ットパターンを同期符号にすれば、擬似同期符号が生じ
るおそれはない。
FIG. 21 shows a case where the zero run becomes maximum when this code word table is used. Normally, a bit pattern to which "1" is added after the zero run continues is selected as the synchronization code. For example, ITU-TH. In H.263, a bit pattern in which "1" is added after 16 "0" is the synchronization code. In variable-length coding of DCT coefficients, the maximum zero run is a coefficient using an escape code, when LEVEL is +64 and a code using an escape code appears again, and 15 “0” s are consecutive. It is the largest to do. Therefore, if a bit pattern in which 16 “0” s are continuous is used as the synchronization code, there is no possibility that a pseudo synchronization code is generated.

【0093】復号値判定部110では、順方向復号化器
108により得られた復号結果(順方向復号結果とい
う)と、逆方向復号化器109により得られた復号結果
(逆方向復号結果という)から復号値を判定し、最終的
な復号結果を出力する。
The decoding value determination unit 110 decodes the decoding result obtained by the forward decoder 108 (referred to as a forward decoding result) and the decoding result obtained by the backward decoder 109 (referred to as a backward decoding result). , And a final decoding result is output.

【0094】順方向復号化器108および逆方向復号化
器109での誤り判定は、符号語として存在しないビッ
トパターンが生じた場合、およびチェックビット等で誤
りを検出した場合、検出位置はその場所とし、前記の判
定方法で誤りが検出されない場合で、復号したビット数
が同期区間内の符号化データのビット数と一致しない場
合は、復号化の最初の位置を誤り検出位置とする。
The error determination in the forward decoder 108 and the backward decoder 109 is performed when a bit pattern that does not exist as a code word occurs, and when an error is detected by a check bit or the like, the detected position is determined by the location. If no error is detected by the above-described determination method, and if the number of decoded bits does not match the number of bits of the encoded data in the synchronization interval, the first position of decoding is set as the error detection position.

【0095】図22は、下位階層の復号値判定方法を示
している。まず、図22(a)に示すように、順方向復
号結果と逆方向復号結果で誤りが検出されるマクロブロ
ック(MB)の位置(誤り検出位置)が交差しない場合
は、誤りが検出されなかったマクロブロックの復号結果
のみを復号値として使用し、二つの誤り検出位置の復号
結果は復号値として使用せず、上位階層のモード情報の
復号結果に基づいて、INTRAマクロブロック(フレ
ーム内符号化されたマクロブロック)については前フレ
ームをそのまま表示するように、INTERマクロブロ
ック(フレーム間符号化されたマクロブロック)につい
ては前フレームより動き補償のみで表示するように、上
位階層の復号結果を書き換える。
FIG. 22 shows a method of determining a decoded value of a lower layer. First, as shown in FIG. 22A, if the position (error detection position) of a macroblock (MB) where an error is detected in the forward decoding result and the backward decoding result does not intersect, no error is detected. Only the decoding result of the decoded macroblock is used as a decoding value, the decoding result of the two error detection positions is not used as a decoding value, and the INTRA macroblock (intra-frame encoding) is performed based on the decoding result of the mode information of the upper layer. The decoding result of the upper layer is rewritten such that the previous frame is displayed as it is for the macro block that has been subjected to the coding, and the macro block (inter-frame coded macro block) is displayed only with the motion compensation from the previous frame for the INTER macro block. .

【0096】また、図22(b)に示すように、順方向
復号結果と逆方向復号結果の誤りの検出位置が交差する
場合は、順方向復号の結果で誤りが検出されたマクロブ
ロックまでの復号値は、順方向復号結果を使用し、それ
以降の部分は、逆方向復号結果を復号値として使用す
る。なお、逆方向復号結果を優先して、逆方向復号の結
果で誤りが検出されたマクロブロックまでの復号値は、
逆方向復号結果を使用し、それ以前の部分は、順方向復
号結果を復号値として使用してもよい。
Further, as shown in FIG. 22B, when the error detection positions of the forward decoding result and the reverse decoding result cross each other, up to the macroblock where the error is detected as a result of the forward decoding. The decoded value uses the forward decoding result, and the subsequent portion uses the backward decoding result as the decoded value. Note that priority is given to the result of reverse decoding, and the decoded value up to the macroblock in which an error is detected in the result of reverse decoding is as follows:
The backward decoding result may be used, and the previous part may use the forward decoding result as a decoded value.

【0097】また、図22(c)に示すように、順方向
復号結果および逆方向復号結果のうち片方向の復号結果
にしか誤りが検出されない場合(この例では、順方向復
号結果のみ誤りが検出されている)は、誤り検出位置以
降のマクロブロックに対する復号値は逆方向の復号結果
を使用する。さらに、図22(d)に示すように、同一
のマクロブロックで順方向復号結果および逆方向復号結
果の両方に誤りが検出される場合は、誤り検出位置のマ
クロブロックの復号値は放棄し、復号値として使用せず
に、上位階層のモード情報の復号結果に基づいて、IN
TRAマクロブロックについては前フレームをそのまま
表示するように、INTERマクロブロックについては
前フレームよりの動き補償のみで表示するように、上位
階層の復号結果を書き換え、それ以降のマクロブロック
に対する復号値は逆方向の復号結果を使用する。
Further, as shown in FIG. 22C, when an error is detected only in a one-way decoding result out of a forward decoding result and a backward decoding result (in this example, only an error is detected in the forward decoding result. Is detected), the decoded value for the macroblock after the error detection position uses the decoding result in the reverse direction. Further, as shown in FIG. 22D, when an error is detected in both the forward decoding result and the backward decoding result in the same macroblock, the decoded value of the macroblock at the error detection position is discarded, Instead of using it as a decoded value, based on the decoding result of the mode information of the upper layer, IN
The decoding result of the upper layer is rewritten so that the previous frame is displayed as it is for the TRA macroblock, and only the motion compensation from the previous frame is displayed for the INTER macroblock, and the decoded values for the subsequent macroblocks are inverted. Use the result of decoding in the direction.

【0098】なお、図22の復号値判定方法では、マク
ロブロックを単位に復号値の判定を行なったが、ブロッ
クの単位あるいは符号語の単位で判定を行なってもよ
い。また、この第2実施形態ではDCT係数の可変長符
号化に本発明を適用したが、可変長符号化を行なう場合
には、他の情報シンボルについても適用することができ
ることは言うまでもない。
In the decoding value determination method shown in FIG. 22, the decoding value is determined for each macroblock. However, the determination may be performed for each block or each codeword. In the second embodiment, the present invention is applied to variable-length coding of DCT coefficients. However, when performing variable-length coding, it is needless to say that the present invention can be applied to other information symbols.

【0099】(第3実施形態)次に、図23を参照しな
がら本発明の第3実施形態に係る可変長符号化/復号化
装置について説明する。
(Third Embodiment) Next, a variable length encoding / decoding device according to a third embodiment of the present invention will be described with reference to FIG.

【0100】この第3実施形態に係る可変長符号化/復
号化装置は、大きく分けて符号語テーブル作成部10
1、符号化部113、伝送系または蓄積系105および
復号化部121からなる。まず、これら各部の機能につ
いて簡単に説明すると、符号語テーブル作成部101は
情報シンボルの生起確率に基づいて符号語テーブルを作
成し、符号化部113内の符号語テーブル102と、復
号化部121内の順方向符号語テーブル111および逆
方向符号語テーブル112に符号語を送る。符号化部1
13は、情報シンボルを可変長符号に符号化し、その可
変長符号を符号化データとして伝送系または蓄積系10
4へ出力する。復号化部121は、伝送系または蓄積系
105を介して入力されてきた符号化データを復号して
元の情報シンボルを再生する。
The variable length encoding / decoding device according to the third embodiment is roughly divided into a codeword table creating unit 10
1. It comprises an encoding unit 113, a transmission system or storage system 105, and a decoding unit 121. First, the function of each of these units will be briefly described. The codeword table creation unit 101 creates a codeword table based on the occurrence probabilities of information symbols, and the codeword table 102 in the encoding unit 113 and the decoding unit 121 The codewords are sent to the forward codeword table 111 and the backward codeword table 112 in. Encoding unit 1
13 encodes the information symbol into a variable length code, and uses the variable length code as encoded data in a transmission system or a storage system 10;
Output to 4. Decoding section 121 decodes the coded data input via transmission system or storage system 105 to reproduce the original information symbols.

【0101】次に、第3実施形態の各部の詳細な構成と
動作を説明する。符号化部113は図1に示した第1実
施形態と同様である。すなわち、符号化部113におい
て、入力された情報シンボルは符号化器103に入力さ
れる。符号語テーブル102は、符号語テーブル作成部
101によって予め作成された情報シンボルと可変長符
号の符号語とを対応させて格納している。符号化器10
3は符号語テーブル102に格納されている符号語の中
から、入力された情報シンボルに対応した符号語を選択
する。同期区間設定部104では、符号化器103が選
択した符号語を同期区間毎にまとめ、さらに順方向にも
逆方向にも復号可能なスタッフィング符号を挿入して、
同期区間毎に符号化データを出力する。この符号化デー
タは、伝送系または蓄積系104を通して復号化部12
1に送られる。
Next, the detailed configuration and operation of each part of the third embodiment will be described. The encoding unit 113 is the same as in the first embodiment shown in FIG. That is, in encoding section 113, the input information symbols are input to encoder 103. The codeword table 102 stores information symbols created in advance by the codeword table creation unit 101 and codewords of variable-length codes in association with each other. Encoder 10
3 selects a codeword corresponding to the input information symbol from the codewords stored in the codeword table 102. In the synchronization section setting unit 104, the codewords selected by the encoder 103 are grouped for each synchronization section, and a stuffing code that can be decoded in both the forward and reverse directions is inserted.
The encoded data is output for each synchronization section. The encoded data is transmitted to the decoding unit 12 through the transmission system or the storage system 104.
Sent to 1.

【0102】復号化部121は、同期区間検出部10
6、バッファ107、符号化データ切替器122、復号
化器124、符号語テーブル切替器125、復号値判定
部110、順方向復号化テーブル111および逆方向復
号化テーブル112により構成される。符号化データ切
替器122および符号語テーブル切替器125は、復号
化器124により制御されて切り替わる。
[0102] The decoding section 121
6, a buffer 107, a coded data switch 122, a decoder 124, a codeword table switch 125, a decoded value determination unit 110, a forward decoding table 111, and a backward decoding table 112. The coded data switch 122 and the codeword table switch 125 are switched by being controlled by the decoder 124.

【0103】復号化部121では、伝送系または蓄積系
105より入力された符号化データから同期区間検出部
106で符号化データの同期区間を検査しながら、符号
化データを復号化器124へ入力する。その際、符号化
データをバッファ107にも蓄積する。復号化器124
は、入力された符号化データの復号(順方向復号化とい
う)を開始する。ここで、復号化器124は符号化デー
タに順方向符号語テーブル111に存在しないビットパ
ターンが出現した場合、およびバッファ107のビット
数と異なるビット数の符号化データが復号された場合、
誤り検出と判定する。
The decoding section 121 inputs the encoded data to the decoder 124 while checking the synchronous section of the encoded data by the synchronous section detecting section 106 from the encoded data inputted from the transmission system or the storage system 105. I do. At this time, the encoded data is also stored in the buffer 107. Decoder 124
Starts decoding of input encoded data (referred to as forward decoding). Here, when a bit pattern that does not exist in the forward codeword table 111 appears in the coded data, and when the coded data having a different number of bits from the buffer 107 is decoded,
Judge as error detection.

【0104】誤り検出と判定された場合、復号化器12
4は符号語テーブル切替器123で符号語テーブルを順
方向符号語テーブル111から逆方向符号語テーブル1
12に切り替えると同時に、符号化データ切替器122
により復号化器124への入力をバッファ107側に切
り替える。バッファ107は、同期区間検出部106に
より次の同期を検出した場合、蓄積した符号化データを
末尾から読み出し、復号化器124へ出力する。復号化
器124では、入力された符号化データの復号(逆方向
復号化という)を開始する。ここで、復号化器124は
順方向復号化と同様に、符号化データに逆方向符号語テ
ーブル112に存在しないビットパターンが出現した場
合、およびバッファ107のビット数と異なるビット数
の符号化データが復号された場合、誤り検出と判定す
る。復号値判定部110では、順方向復号化によって得
られた復号結果(順方向復号結果という)と、逆方向復
号化によって得られた復号結果(逆方向復号結果とい
う)から復号値を判定し、最終的な復号結果を出力す
る。
When it is determined that an error has been detected, the decoder 12
Reference numeral 4 denotes a codeword table switch 123 which changes the codeword table from the forward codeword table 111 to the backward codeword table 1
12 and at the same time, the encoded data switch 122
To switch the input to the decoder 124 to the buffer 107 side. When the next synchronization is detected by the synchronization section detection unit 106, the buffer 107 reads out the stored encoded data from the end and outputs it to the decoder 124. The decoder 124 starts decoding the input coded data (referred to as backward decoding). Here, as in the case of the forward decoding, the decoder 124 determines whether a bit pattern that does not exist in the backward codeword table 112 appears in the encoded data, and that the encoded data has a bit number different from the bit number of the buffer 107. Is decoded, it is determined that an error has been detected. The decoding value determination unit 110 determines a decoding value from a decoding result obtained by forward decoding (referred to as a forward decoding result) and a decoding result obtained by backward decoding (referred to as a backward decoding result). Output the final decryption result.

【0105】この第3実施形態における符号語テーブル
作成部101は、基本的に第1の実施形態と同様であ
り、図2に示したように、情報シンボルの生起確率の情
報を入力し、選択可能な符号系の中から最も平均符号長
の小さいものを選択する符号選択部21と、この符号語
選択部21で選択された符号の符号語を構成する符号語
構成部22からなる。ただし、本実施形態ではより幅広
い確率分布に対応し、符号語のビットパターンを自由度
を上げるために、符号語構成部22における符号語の構
成方法として以下の方法を用いている。
The codeword table creation unit 101 in the third embodiment is basically the same as that in the first embodiment. As shown in FIG. 2, information on the occurrence probabilities of information symbols is input and selected. It comprises a code selector 21 for selecting a code having the smallest average code length from among possible code systems, and a codeword constructing unit 22 for forming a codeword of the code selected by the codeword selector 21. However, in the present embodiment, the following method is used as a codeword configuration method in the codeword configuration unit 22 in order to correspond to a wider probability distribution and increase the degree of freedom of the bit pattern of the codeword.

【0106】図24は、符号語構成部22におけるリバ
ーシブル符号の符号語の第1の構成方法を示している。
まず、図24の左側に示すように、第1のリバーシブル
符号を用意する。次に、図24の中央に示すように、第
1のリバーシブル符号のそれぞれの符号語に対して、破
線で囲まれた(符号長−1)ビットの固定長符号を用意
し、図24の右側に示すように、第1のリバーシブル符
号の符号語の各ビットの間に固定長符号の符号語を破線
で囲むように1ビットずつ挿入する。この図24の可変
長符号は、第1のリバーシブル符号を復号しながら、1
ビット毎に固定長符号を復号することにより、順方向に
も逆方向にも復号可能であることが分かる。図24の例
では、第1のリバーシブル符号の符号語の各ビットの間
に固定長符号の符号語を1ビットずつ挿入したが、第1
のリバーシブル符号のそれぞれの符号語に対して、(符
号長−1)×nビットの固定長符号を用意し、第1のリ
バーシブル符号の符号語の各ビットの間に固定長符号の
符号語をnビットずつ付加してもよい。
FIG. 24 shows a first method of forming a codeword of a reversible code in the codeword forming unit 22.
First, as shown on the left side of FIG. 24, a first reversible code is prepared. Next, as shown in the center of FIG. 24, for each code word of the first reversible code, a fixed-length code of (code length-1) surrounded by a dashed line is prepared. As shown in (1), a fixed-length code word is inserted between the bits of the first reversible code code bit by bit so as to be surrounded by a broken line. The variable length code shown in FIG. 24 decodes the first reversible code while
It can be seen that by decoding the fixed-length code for each bit, decoding can be performed in both the forward and reverse directions. In the example of FIG. 24, the fixed-length codeword is inserted one bit at a time between each bit of the first reversible codeword.
, A fixed-length code of (code length −1) × n bits is prepared for each codeword of the reversible code, and a fixed-length codeword is inserted between each bit of the first reversible code. You may add n bits at a time.

【0107】図25は、符号語構成部22におけるリバ
ーシブル符号の符号語の第2の構成方法を示している。
図25の左側に示すように、第1のリバーシブル符号を
用意する。次に、図25の上側に破線で囲んで示すよう
に、第2のリバーシブル符号を用意し、図25の右側に
示すように、第1のリバーシブル符号の符号語の各ビッ
トの間に破線で囲んだように第2のリバーシブル符号を
挿入する。この図25の可変長符号は、第1のリバーシ
ブル符号を復号しながら、1ビット毎に第2のリバーシ
ブル符号を復号することにより、順方向にも逆方向にも
復号可能であることが分かる。なお、図25の例では、
第1のリバーシブル符号と第2のリバーシブル符号を同
じ符号として示したが、異なる符号を用いても構わな
い。
FIG. 25 shows a second method of forming a codeword of a reversible code in the codeword forming unit 22.
As shown on the left side of FIG. 25, a first reversible code is prepared. Next, a second reversible code is prepared as shown by being surrounded by a broken line on the upper side of FIG. 25, and as shown on the right side of FIG. 25, a broken line is provided between each bit of the code word of the first reversible code. The second reversible code is inserted as enclosed. It can be seen that the variable length code in FIG. 25 can be decoded in both the forward and reverse directions by decoding the second reversible code for each bit while decoding the first reversible code. In the example of FIG. 25,
Although the first reversible code and the second reversible code are shown as the same code, different codes may be used.

【0108】この第3実施形態においては、図26に示
すように図23中の順方向符号語テーブル111と逆方
向符号語テーブル112を共通化した双方向符号語テー
ブル51を用いてもよい。この場合、図23中の復号化
器124から順方向復号化/逆方向復号化の区別を示す
識別信号53を入力し、この識別信号53によりアドレ
ス変換器52を動作させて、双方向符号語テーブル51
から符号語を読み出すためのアドレスを生成する。そし
て、このアドレスに対応する符号値を双方向符号語テー
ブル51から読み出す。
In the third embodiment, as shown in FIG. 26, a bidirectional codeword table 51 in which the forward codeword table 111 and the backward codeword table 112 in FIG. 23 are shared may be used. In this case, an identification signal 53 indicating the distinction of forward decoding / reverse decoding is input from the decoder 124 in FIG. 23, and the address converter 52 is operated by the identification signal 53 to generate a bidirectional codeword. Table 51
Generates an address for reading a codeword from. Then, the code value corresponding to this address is read from the bidirectional codeword table 51.

【0109】また、この第3実施形態においては、図2
7に示すように復号化器124に誤り検出機能が付加さ
れる。復号化器61に接続された誤り検出部62は、復
号化器61の内部状態を監視し、これが異常となった場
合、誤り検出信号を出力する。異常な内部状態とは、例
えば以下のような状態をいう。
Further, in the third embodiment, FIG.
As shown in FIG. 7, an error detection function is added to the decoder 124. The error detection unit 62 connected to the decoder 61 monitors the internal state of the decoder 61, and outputs an error detection signal when the state becomes abnormal. The abnormal internal state refers to, for example, the following state.

【0110】(1)符号語テーブルに存在しない符号化
データを受信した場合。
(1) When coded data not existing in the code word table is received.

【0111】(2)符号化データの長さと、実際に復号
化器61で復号したデータの長さが一致しない場合。
(2) When the length of the encoded data does not match the length of the data actually decoded by the decoder 61.

【0112】(3)符号語テーブルには値が存在するた
め復号値を求めることは可能であるが、その値が不適な
値である場合。この(3)の具体例としては(3−1)
復号値が存在範囲を超えている場合、(3−2)データ
の個数が上限を超えた場合、および(3−3)前に復号
した復号値と整合性の合わない復号値を出力した場合等
が挙げられる。
(3) A decoded value can be obtained because a value exists in the code word table, but the value is an inappropriate value. As a specific example of this (3), (3-1)
When the decoded value exceeds the existing range, (3-2) when the number of data exceeds the upper limit, and (3-3) When a decoded value inconsistent with the decoded value decoded before is output. And the like.

【0113】(4)誤り検出符号等により、誤りを検出
した場合。
(4) When an error is detected by an error detection code or the like.

【0114】次に、図28を用いてこの第3実施形態に
おける復号方法を説明する。先の説明では、復号化器1
24での順方向および逆方向の復号処理は図28(a)
に示すように順方向、逆方向双方で復号処理を並行して
同時に行ない、それぞれが誤りを検出するまで復号を実
行し復号値を求めていた。本実施形態はこれに限られ
ず、図28(b)(c)(d)に示すような方法で復号
を行なってもよい。なお、図28(a)(b)(c)
(d)において、Xは誤り検出点を示し、また右側に向
かう矢印は順方向の復号処理、左側に示す矢印は逆方向
の復号処理をそれぞれ示している。
Next, a decoding method according to the third embodiment will be described with reference to FIG. In the above description, the decoder 1
The decoding process in the forward direction and the reverse direction at 24 is shown in FIG.
As shown in (1), decoding processing is performed simultaneously in both the forward direction and the reverse direction, and decoding is performed until each of them detects an error to obtain a decoded value. The present embodiment is not limited to this, and decoding may be performed by a method as shown in FIGS. 28 (b), (c) and (d). 28 (a), (b) and (c)
In (d), X indicates an error detection point, and the arrow toward the right indicates forward decoding processing, and the arrow on the left indicates reverse decoding processing.

【0115】図28(b)に示す方法では、順方向の復
号処理を行ない、誤りが検出された場合は、そこで順方
向の復号処理を停止し、同期区間の符号化データの末尾
から逆方向に、誤りが検出されるまで復号処理を行な
う。図28(c)に示す方法では、順方向の復号処理で
誤りが検出された場合、その誤り検出位置のnビット先
から順方向の復号処理を再開する。この処理を現在の同
期区間内の符号化データを全て処理するまで繰り返し行
なう。順方向の復号処理の最後に、もし同期区間の符号
化データ数と復号処理により復号を行なったデータ数と
が一致しない場合は誤り検出とみなし、符号化データの
末尾から逆方向の復号処理を誤りが発見されるまで行な
う。図28(d)に示す方法では、順方向の復号処理で
誤りが検出された場合、一旦その誤り検出位置のnビッ
ト先から逆方向にnビット分復号処理を行なう。その
後、順方向の復号処理を誤り検出位置のnビット先(逆
方向の復号処理を開始した位置)から行なう。この処理
を現在の同期区間内の符号化データを全て処理するまで
繰り返し行なう。最後に、もし同期区間の符号化データ
数と復号処理により復号を行なったデータ数が一致しな
い場合は誤り検出とみなし、符号化データの末尾から逆
方向の復号処理を誤りが発見されるまで行なう。次に、
図29を用いてこの第3実施形態における復号値判定部
111での復号値の判定方法を説明する。なお、復号値
判定部111で最終的に利用する復号値の選択にも、以
下のような方法を用いることができる。図29(a)に
示す復号値判定方法は、誤りを検出した場合、それ以降
は復号を行なわない方法である。すなわち、誤りを検出
した場合には、それ以降の復号は誤復号する可能性があ
るため、そのような誤復号の可能性のある復号値は利用
せず、誤り検出位置までの復号値のみを利用する。
In the method shown in FIG. 28 (b), a forward decoding process is performed. If an error is detected, the forward decoding process is stopped there, and a backward decoding process is performed from the end of the encoded data in the synchronous section. Then, decoding processing is performed until an error is detected. In the method shown in FIG. 28C, when an error is detected in the forward decoding process, the forward decoding process is restarted from n bits ahead of the error detection position. This process is repeated until all the encoded data in the current synchronization section is processed. At the end of the forward decoding process, if the number of coded data in the synchronous section does not match the number of data decoded by the decoding process, it is regarded as error detection, and the decoding process in the backward direction from the end of the coded data is performed. Repeat until an error is found. In the method shown in FIG. 28D, when an error is detected in the decoding process in the forward direction, the decoding process is performed for n bits in the reverse direction from the n bit ahead of the error detection position. Thereafter, the forward decoding process is performed n bits ahead of the error detection position (the position where the backward decoding process was started). This process is repeated until all the encoded data in the current synchronization section is processed. Finally, if the number of encoded data in the synchronous section does not match the number of data decoded by the decoding processing, it is regarded as error detection, and decoding processing in the reverse direction from the end of the encoded data is performed until an error is found. . next,
With reference to FIG. 29, a method of determining a decoded value in the decoded value determining unit 111 according to the third embodiment will be described. Note that the following method can also be used for selecting a decoding value to be finally used by the decoding value determination unit 111. The decoding value determination method shown in FIG. 29A is a method in which, when an error is detected, decoding is not performed thereafter. In other words, when an error is detected, subsequent decoding may be erroneously decoded, so that a decoded value having such an erroneous decoding is not used, and only the decoded value up to the error detection position is used. Use.

【0116】図29(b)に示す復号値判定方法は、誤
りを検出しても復号を続けてなるべく復号を行ない、利
用できる復号値は全て利用するようにする方法である。
可変長符号には、同期が外れた場合でも復号処理を続け
ると、自動的に同期が回復する特徴を有する符号が存在
する。これを自己同期回復性と呼ぶ。この自己同期回復
能力が高い符号語の場合には、図29(a)のように誤
り検出後に復号処理を停止せずに、図29(b)のよう
にそのまま復号を続けることで正しい復号値をより多く
得ることができる。ただし、この場合には復号値に誤っ
て復号された値を含む可能性がある。このような誤復号
の可能性を許容するシステムにおいては、図29(b)
の復号値判定方法を用いることも可能である。
The decoding value determination method shown in FIG. 29B is a method in which decoding is continued as much as possible even if an error is detected, and all available decoded values are used.
Among variable-length codes, there is a code having a feature that synchronization is automatically restored when decoding processing is continued even when synchronization is lost. This is called self-synchronization recovery. In the case of a code word having a high self-synchronization recovery capability, the decoding process is not stopped after error detection as shown in FIG. 29 (a), and decoding is continued as shown in FIG. Can be obtained more. However, in this case, there is a possibility that the decoded value includes an erroneously decoded value. In a system that allows the possibility of such erroneous decoding, FIG.
Can be used.

【0117】(第4実施形態)次に、図30を参照しな
がら本発明の第4実施形態に係る可変長符号化/復号化
装置について説明する。
(Fourth Embodiment) Next, a variable length encoding / decoding device according to a fourth embodiment of the present invention will be described with reference to FIG.

【0118】第4実施形態の可変長符号化/復号化装置
は、大きく分けて符号語テーブル作成部201、符号化
部213、伝送系または蓄積系205および復号化部2
14からなる。まず、これら各部の機能について簡単に
説明すると、符号語テーブル作成部201は情報シンボ
ルの生起確率に基づいて符号語テーブルを作成し、符号
化部213内の符号語テーブル、復号化部214内の順
方向符号語テーブルおよび逆方向符号語テーブルに符号
語を送る。
The variable length encoding / decoding device according to the fourth embodiment is roughly divided into a codeword table creation unit 201, an encoding unit 213, a transmission or storage system 205, and a decoding unit 2
Consists of fourteen. First, the function of each of these units will be briefly described. The codeword table creation unit 201 creates a codeword table based on the occurrence probabilities of information symbols, the codeword table in the encoding unit 213, and the codeword table in the decoding unit 214. Send codewords to forward and backward codeword tables.

【0119】符号化部213は、入力データとして与え
られる情報シンボルを階層化して、各階層毎に可変長符
号に符号化し、それらの可変長符号を多重化して符号化
データとして伝送系または蓄積系205へ出力する。復
号化部214は、伝送系または蓄積系205を介して入
力されてきた符号化データを多重化分離し、各階層毎に
可変長復号を行ない、階層毎の復号結果を合成して元の
情報シンボルを再生し、再生データを出力する。
The encoding section 213 hierarchizes the information symbols given as input data, encodes the information symbols into variable-length codes for each layer, multiplexes these variable-length codes, and multiplexes the variable-length codes as transmission data or storage data. Output to 205. The decoding unit 214 multiplexes and separates the coded data input via the transmission system or the storage system 205, performs variable length decoding for each layer, synthesizes the decoding result for each layer, and obtains the original information. The symbol is reproduced and reproduced data is output.

【0120】次に、第4実施形態の各部の詳細な構成と
動作を説明する。符号化部213においては、入力デー
タである情報シンボルはデータ階層化部202により重
要度に応じて1からnまで(nは2以上の自然数)の階
層に分離される。分離された各階層i(i=1,2,
…,n)の情報シンボルは、階層i毎に用意された可変
長符号化部203−iに入力され、符号化される。可変
長符号化部203−iで得られた各階層iの符号化デー
タは、多重化部204で多重化され、伝送系または蓄積
系205を通して復号化部214に送られる。
Next, the detailed configuration and operation of each part of the fourth embodiment will be described. In the coding unit 213, the information symbols as input data are separated by the data hierarchy unit 202 into hierarchies from 1 to n (n is a natural number of 2 or more) according to importance. Each separated hierarchy i (i = 1, 2,
, N) are input to the variable-length coding units 203-i prepared for each layer i and are coded. The coded data of each layer i obtained by the variable length coding unit 203-i is multiplexed by the multiplexing unit 204 and sent to the decoding unit 214 through the transmission system or the storage system 205.

【0121】復号化部214では、伝送系または蓄積系
205より入力された符号化データが多重化分離部20
6で各階層iの符号化データに分離される。分離された
各階層の符号化データは、階層i毎に用意された可変長
復号化部207−iに入力され、復号化される。可変長
復号化部207−iで得られた各階層iの復号結果はデ
ータ合成部208で合成され、再生データとして出力さ
れる。
In the decoding unit 214, the coded data input from the transmission system or the storage system 205 is demultiplexed.
At 6, it is separated into encoded data of each layer i. The separated encoded data of each layer is input to the variable-length decoding unit 207-i prepared for each layer i and decoded. The decoding result of each layer i obtained by the variable length decoding unit 207-i is synthesized by the data synthesis unit 208 and output as reproduction data.

【0122】符号語テーブル作成部201の構成は、第
1の実施形態で用いた図2に示した符号語テーブル作成
部101と同様であり、情報シンボルの生起確率の情報
に基づいて、選択可能な符号系の中から最も平均符号長
の小さいものを選択し、選択した符号の符号語を構成す
る。その符号語は、符号語の予め定められた重みによっ
て符号の区切りが分かるように構成された順方向にも逆
方向にも復号可能な可変長符号(リバーシブル符号)で
ある。
The structure of the codeword table creation unit 201 is the same as that of the codeword table creation unit 101 shown in FIG. 2 used in the first embodiment, and can be selected based on information on the occurrence probabilities of information symbols. The code having the smallest average code length is selected from the various code systems, and the code word of the selected code is formed. The code word is a variable-length code (reversible code) that can be decoded in both the forward direction and the reverse direction and that is configured so that the delimitation of the code can be recognized by a predetermined weight of the code word.

【0123】次に、図30中の各階層iの可変長符号化
部203−iの構成は図31に示す通りであり、図1中
に示した符号化部113と同様に、符号語テーブル10
2と符号化器103および同期区間設定部104により
構成される。すなわち、図30中のデータ階層化部20
2から入力された情報シンボルは、符号化器103に入
力される。符号語テーブル102は、図30中の符号語
テーブル作成部201によって予め作成された情報シン
ボルと可変長符号の符号語とを対応させて格納してい
る。
Next, the configuration of the variable length coding unit 203-i of each layer i in FIG. 30 is as shown in FIG. 31, and the code word table is similar to the coding unit 113 shown in FIG. 10
2 and an encoder 103 and a synchronization section setting unit 104. That is, the data hierarchy unit 20 shown in FIG.
2 is input to the encoder 103. The codeword table 102 stores information symbols created in advance by the codeword table creation unit 201 in FIG. 30 and codewords of variable-length codes in association with each other.

【0124】符号化器103は、符号語テーブル102
に格納されている符号語の中から、データ階層化部20
2より入力された情報シンボルに対応した符号語を選択
して出力する。同期区間設定部104では、符号化器1
03が選択した符号語を同期区間毎にまとめ、さらに必
要に応じて順方向にも逆方向にも復号可能なスタッフィ
ング符号を挿入して、同期区間毎に符号化データを出力
する。この符号化データは図30中の多重化部204に
送られる。
The encoder 103 outputs the code word table 102
Out of the codewords stored in the
2 to select and output a codeword corresponding to the input information symbol. In the synchronous section setting unit 104, the encoder 1
The codewords selected by 03 are grouped for each synchronization section, and if necessary, stuffing codes that can be decoded in the forward and backward directions are inserted, and encoded data is output for each synchronization section. This encoded data is sent to multiplexing section 204 in FIG.

【0125】一方、図30中の各階層iの可変長復号化
部207−iの構成は図32に示す通りであり、図1中
に示した復号化部114と同様に、同期区間検出部10
6、バッファ107、順方向復号化器108、逆方向復
号化器109、復号値判定部110、順方向復号化テー
ブル111および逆方向復号化テーブル112により構
成される。すなわち、可変長復号化部207−iでは、
伝送系または蓄積系205より入力された符号化データ
から同期区間検出部106で符号化データの同期区間を
検出して、符号化データをバッファ107に蓄積する。
順方向復号化器108では、バッファ107に蓄積され
た符号化データの先頭から復号を開始する。逆方向復号
化器109では、バッファ107に蓄積された符号化デ
ータの末尾から復号を開始する。
On the other hand, the configuration of the variable length decoding section 207-i of each layer i in FIG. 30 is as shown in FIG. 32, and, like the decoding section 114 shown in FIG. 10
6, a buffer 107, a forward decoder 108, a backward decoder 109, a decoded value determination unit 110, a forward decoding table 111 and a backward decoding table 112. That is, in the variable length decoding unit 207-i,
The synchronization section of the coded data is detected by the synchronization section detection unit 106 from the coded data input from the transmission system or the storage system 205, and the coded data is stored in the buffer 107.
The forward decoder 108 starts decoding from the head of the encoded data stored in the buffer 107. The backward decoder 109 starts decoding from the end of the encoded data stored in the buffer 107.

【0126】順方向復号化器108では、符号化データ
に順方向符号語テーブル111に存在しないビットパタ
ーンが出現した場合、およびバッファ107のビット数
と異なるビット数の符号化データが復号された場合、誤
り検出と判定する。同様に逆方向復号化器109でも、
符号化データに逆方向符号語テーブル112に存在しな
いビットパターンが出現した場合、およびバッファ10
7のビット数と異なるビット数の符号化データが復号さ
れた場合、誤り検出と判定する。復号値判定部110で
は、順方向復号化器108によって得られた復号結果
(順方向復号結果)と、逆方向復号化器109によって
得られた復号結果(逆方向復号値)から復号値を判定
し、最終的な復号結果を出力する。これらの各階層iの
復号結果は、データ合成部208に送られる。
In forward decoder 108, when a bit pattern that does not exist in forward codeword table 111 appears in the encoded data, and when the encoded data having a bit number different from the bit number of buffer 107 is decoded. Is determined as error detection. Similarly, in the reverse decoder 109,
When a bit pattern that does not exist in the backward codeword table 112 appears in the encoded data,
If encoded data having a bit number different from 7 is decoded, it is determined that an error has been detected. The decoding value determination unit 110 determines a decoding value from the decoding result (forward decoding result) obtained by the forward decoder 108 and the decoding result (reverse decoding value) obtained by the backward decoder 109. And outputs the final decryption result. The decoding result of each layer i is sent to the data synthesizing unit 208.

【0127】図33に、データ階層化部202でのデー
タ階層化および多重化部204で多重化の例を示す。図
33(a)に示すようなn階層に分けることが可能なシ
ンタクスの入力データ(情報シンボル列)があるとする
と、データ階層化部202では図33(b)に示すよう
に各階層i毎に入力データが繰り返されるようにシンタ
クスを変更してデータ階層化を行ない、各階層i毎の情
報シンボルを可変長符号化部203−iに送る。多重化
部204では、図33(c)に示すように可変長符号化
部203−iにより階層i毎に可変長符号化され、かつ
同期符号iの付加により同期区間が設定された符号化デ
ータを多重化して出力する。
FIG. 33 shows an example of data hierarchization in data hierarchization section 202 and multiplexing in multiplexing section 204. Assuming that there is input data (information symbol sequence) of syntax that can be divided into n layers as shown in FIG. 33 (a), the data layering unit 202 sets each layer i as shown in FIG. 33 (b). Then, the syntax is changed so that the input data is repeated, and the data is hierarchized, and the information symbol for each hierarchy i is sent to the variable-length coding unit 203-i. In the multiplexing unit 204, as shown in FIG. 33C, the coded data in which the variable-length coding unit 203-i performs variable-length coding for each layer i and sets a synchronization section by adding a synchronization code i Are multiplexed and output.

【0128】図34は、図32中の復号値判定部110
での復号値の判定方法の例を示している。各階層i毎の
可変長復号化部207−iでは、それぞれ双方向復号が
行なわれる。もし、ある階層の可変長復号化部に入力さ
れる符号化データに誤りがあった場合、その影響は当該
階層より上位の階層と下位の階層の復号値に影響を与え
るので、各階層iの可変長復号化部207−i内の復号
値判定部110で情報をやりとりして、最終的な復号値
を決定するようにする。
FIG. 34 is a block diagram showing a decoded value judging section 110 shown in FIG.
2 shows an example of a method of determining a decoded value in the above. In the variable length decoding unit 207-i for each layer i, bidirectional decoding is performed. If there is an error in the coded data input to the variable length decoding unit of a certain layer, the influence affects the decoded values of the layers higher and lower than the corresponding layer. Information is exchanged by the decoded value determination unit 110 in the variable length decoding unit 207-i to determine the final decoded value.

【0129】この図34の例では、上位階層に誤りがあ
り、復号できない部分がある場合、それに関連する下位
階層の符号化データで復号できない部分ができる。ま
た、下位階層の符号化データに誤りがあり、復号できな
い部分がある場合、それに対応する上位階層の符号化デ
ータの復号値を変更するようにする。図34はあくまで
復号値判定方法の一つの例であり、各階層iの可変長復
号化部207−i内の復号値判定部110では、上位階
層と下位階層の復号結果を用いて順方向復号結果および
逆方向復号結果の少なくとも一方で誤りが検出された場
合は、順方向復号結果および逆方向復号結果のうち正し
いと推定される方の復号結果を使用し、順方向復号およ
び逆方向復号のいずれでも復号ができなかった部分につ
いては、その復号結果を放棄する方法であれば、どのよ
うな方法でもよいことはいうまでもない。また、この第
4実施形態では全ての階層で順方向にも逆方向にもリバ
ーシブル符号を用いる構成としたが、一部の階層のみに
リバーシブル符号を用いる構成でも構わない。
In the example of FIG. 34, when there is an error in the upper layer and there is a part that cannot be decoded, there is a part that cannot be decoded in the coded data of the lower layer related thereto. If there is an error in the lower layer encoded data and there is a part that cannot be decoded, the decoding value of the corresponding upper layer encoded data is changed. FIG. 34 is merely an example of the decoding value determination method. The decoding value determination unit 110 in the variable length decoding unit 207-i of each layer i uses the decoding results of the upper layer and the lower layer to perform forward decoding. If an error is detected in at least one of the result and the backward decoding result, a decoding result of the forward decoding result and the backward decoding result that is estimated to be correct is used, and the forward decoding and the backward decoding It goes without saying that any method may be used for the part that could not be decoded in any case, as long as the decoding result is discarded. In the fourth embodiment, the reversible code is used in all the layers in both the forward direction and the reverse direction. However, the reversible code may be used only in some layers.

【0130】(第5実施形態)次に、図11に示した動
画像符号化/復号化システムの動画像多重化部703お
よび動画像多重化分離部707に第4実施形態で説明し
た可変長符号化/復号化装置を適用した第5実施形態に
ついて説明する。この場合の動画像符号化/復号化シス
テムの基本的な構成と動作は第2の実施形態と同様であ
り、動画像多重化部703および動画像多重化分離部7
07における可変長符号化および可変長復号化の処理が
階層毎に行なわれる点が異なる。
(Fifth Embodiment) Next, the moving image multiplexing unit 703 and the moving image multiplexing / demultiplexing unit 707 of the moving image encoding / decoding system shown in FIG. A fifth embodiment to which an encoding / decoding device is applied will be described. The basic configuration and operation of the video encoding / decoding system in this case are the same as in the second embodiment, and the video multiplexing unit 703 and the video multiplexing / demultiplexing unit 7
07 in that variable length coding and variable length decoding are performed for each layer.

【0131】図35、図36、図37および図38は、
第5実施形態における動画像多重化部703での動画像
符号化方式のシンタクスの種々の例を示している。ま
ず、図35に示すシンタクスについて説明する。このシ
ンタクスでは、符号化データである入力された情報シン
ボルを上位階層と下位階層の2つに階層化し、それぞれ
に対して同期符号RMおよびMMにより同期区間を設定
している。下位階層のシンタクスの末尾のSTは、図9
に示したような逆方向から復号可能なスタッフィング符
号である。
FIG. 35, FIG. 36, FIG. 37 and FIG.
15 illustrates various examples of syntax of a moving image encoding method in the moving image multiplexing unit 703 according to the fifth embodiment. First, the syntax shown in FIG. 35 will be described. In this syntax, an input information symbol, which is encoded data, is hierarchized into two layers, an upper layer and a lower layer, and a synchronization section is set for each of them by using synchronization codes RM and MM. The ST at the end of the syntax of the lower hierarchy is shown in FIG.
Is a stuffing code that can be decoded in the reverse direction as shown in FIG.

【0132】上位階層は、図35(a)に示したように
ヘッダ情報と、マクロブロック毎の符号化モード、各ブ
ロックを符号化するか否かの情報およびINTRA D
Cの値をモード情報として先頭側に固めて、これらを通
常の順方向復号が可能な可変長符号で記述し、その後に
動きベクトル情報を図39〜図46に示した符号化テー
ブルによりリバーシブル符号に可変長符号化して配置す
る。図39〜図46に示す符号化テーブルにおいて、
“VECTOR DIFFERENCES”は動きベク
トルの予測値(差分値)、“BIT NUMBER”は
可変長符号の符号長、そして“VLC CODE”は可
変長符号を表す。
As shown in FIG. 35 (a), the upper layer includes header information, a coding mode for each macroblock, information on whether or not each block is coded, and INTRA D.
The value of C is fixed at the beginning as mode information, and these are described with a variable length code that can be decoded in a normal forward direction. After that, the motion vector information is converted into a reversible code by the coding tables shown in FIGS. And variable-length coded. In the encoding tables shown in FIGS.
“VECTOR DIFFERENCES” represents a predicted value (difference value) of a motion vector, “BIT NUMBER” represents a code length of a variable length code, and “VLC CODE” represents a variable length code.

【0133】ここで、動きベクトルは図47に示すよう
に一次元予測により得られ、予測値は差分値で表され
る。動きベクトルの予測方向を図47中に矢印で示す。
図47に示すように、動きベクトルはマクロブロック
(図47中に大きな四角で示す)に1本存在する場合
と、各輝度ブロック(図47中に小さな四角で示す)毎
に各1本の計4本存在する場合とがあるが、これらにつ
いて一次元予測を行ない、予測値を図39〜図46に示
した符号化テーブルに従って可変長符号で記述する。な
お、予測で得られない動きベクトルについては、その動
きベクトルの値そのものを図39〜図46に示した符号
化テーブルに従って可変長符号により記述する。図35
(a)の末尾の動きベクトル情報がこれに相当する。一
方、下位階層は図35(b)に示したようにINTRA
DCを除くDCT係数情報であり、例えば図14〜図
20や特願平7−260383に記載されたリバーシブ
ル符号で記述される。
Here, the motion vector is obtained by one-dimensional prediction as shown in FIG. 47, and the predicted value is represented by a difference value. The motion vector prediction direction is indicated by an arrow in FIG.
As shown in FIG. 47, one motion vector exists in a macroblock (shown by a large square in FIG. 47), and one motion vector exists in each luminance block (shown by a small square in FIG. 47). There are cases where there are four, but one-dimensional prediction is performed for these, and the predicted values are described using variable length codes according to the encoding tables shown in FIGS. For a motion vector that cannot be obtained by prediction, the value of the motion vector itself is described by a variable length code according to the encoding tables shown in FIGS. FIG.
The motion vector information at the end of (a) corresponds to this. On the other hand, the lower layer is INTRA as shown in FIG.
This is DCT coefficient information excluding DC, and is described by, for example, a reversible code described in FIGS. 14 to 20 and Japanese Patent Application No. 7-260383.

【0134】次に、図36に示すシンタクスについて説
明する。このシンタクスでは、上位階層は図36(a)
に示すようにヘッダ情報とマクロ符号化毎の動きベクト
ルの数を表したモード情報1を先頭側に固めて、通常の
順方向復号が可能な可変長符号で記述し、その後に動き
ベクトル情報の可変長符号を記述する。動きベクトル情
報の可変長符号は、図35のシンタクスと同様である。
下位階層は、図36(b)に示すように各ブロックのD
CT係数があるか否かを示すモード情報2およびINT
RA DCを先頭側に固めて、これらを通常の順方向復
号が可能な可変長符号で記述し、その後にINTRA
DCを除くDCT係数情報を図35のシンタクスと同様
にリバーシブル符号で記述する。
Next, the syntax shown in FIG. 36 will be described. In this syntax, the upper hierarchy is shown in FIG.
As shown in (1), header information and mode information 1 indicating the number of motion vectors for each macro coding are fixed at the head side, and are described with a variable-length code capable of normal forward decoding. Describe the variable length code. The variable length code of the motion vector information is the same as the syntax in FIG.
As shown in FIG. 36 (b), the lower hierarchy is the D of each block.
Mode information 2 indicating whether there is a CT coefficient and INT
RADCs are fixed at the head side, and they are described with a variable length code capable of normal forward decoding.
DCT coefficient information excluding DC is described by reversible codes as in the syntax of FIG.

【0135】次に、図37に示すシンタクスについて説
明する。このシンタクスでは、上位階層に順方向復号が
可能な可変長符号のみを用いている。すなわち、上位階
層は図37(a)に示すように、ヘッダ情報、モード情
報および動きベクトル情報を順方向復号が可能な可変長
符号で記述し、下位階層は図37(b)に示すように、
DCT係数情報を図35のシンタクスと同様にリバーシ
ブル符号により記述している。
Next, the syntax shown in FIG. 37 will be described. In this syntax, only variable-length codes that can be forward decoded in the upper layer are used. That is, as shown in FIG. 37A, the upper layer describes the header information, the mode information and the motion vector information with a variable length code capable of decoding in the forward direction, and the lower layer as shown in FIG. 37B. ,
The DCT coefficient information is described by reversible codes as in the syntax of FIG.

【0136】図38に示すシンタックスも、上位階層に
順方向復号が可能な可変長符号のみを用いている。すな
わち、上位階層は図38(a)に示すように、ヘッダ情
報、マクロ符号化毎の動きベクトルの数を表したモード
情報1および動きベクトル情報を順方向復号可能な可変
長符号で記述する。下位階層は図38(b)に示すよう
に、各ブロックのDCT係数があるか否かを示すモード
情報2およびINTRA DCを先頭側に固めて、これ
らを通常の順方向復号が可能な可変長符号で記述し、そ
の後にINTRA DC以外のDCT係数情報を図36
のシンタクスと同様にリバーシブル符号で記述する。
The syntax shown in FIG. 38 also uses only variable-length codes that can be forward decoded in the upper layer. That is, as shown in FIG. 38A, header information, mode information 1 representing the number of motion vectors for each macro coding, and motion vector information are described in a variable length code capable of forward decoding, as shown in FIG. In the lower layer, as shown in FIG. 38 (b), mode information 2 indicating whether or not there is a DCT coefficient of each block and INTRA DC are fixed at the head side, and these are variable-length capable of normal forward decoding. 36, DCT coefficient information other than INTRA DC is described in FIG.
The reversible code is used in the same way as the syntax of.

【0137】第5実施形態における動画像多重化部70
3および動画像多重化分離部707の基本構成は図13
(a)(b)に示す通りであるが、上位階層可変長符号
化器901、下位階層可変長符号化器903および上位
階層可変長復号化器905、下位階層可変長復号化器9
06の構成が第2実施形態とは異なっている。すなわ
ち、情報源符号化器702で符号化されたデータのう
ち、例えば図35(a)または図36(a)のシンタク
スで示された上位階層のデータが上位階層可変長符号化
器901で可変長符号化され、多重化部903に送られ
る。また、情報源符号化器702で符号化されたデータ
のうち、図35(b)または図36(b)のシンタクス
で示された下位階層のデータが可変長符号化器903で
可変長符号化され、多重化部903に送られる。多重化
部903では、上位階層の符号化データおよび下位階層
の符号化データを多重化し、送信バッファ704に送
る。
Moving image multiplexing unit 70 in the fifth embodiment
3 and the basic configuration of the moving image demultiplexing / separating unit 707 are shown in FIG.
(A) As shown in (b), upper layer variable length encoder 901, lower layer variable length encoder 903, upper layer variable length decoder 905, lower layer variable length decoder 9
06 differs from the second embodiment. That is, of the data encoded by the information source encoder 702, for example, data of an upper layer indicated by the syntax of FIG. 35A or FIG. 36A is variable by an upper layer variable length encoder 901. The data is long-coded and sent to the multiplexing unit 903. Also, of the data encoded by the information source encoder 702, data of a lower hierarchy indicated by the syntax in FIG. 35B or FIG. 36B is subjected to variable length encoding by the variable length encoder 903. Then, it is sent to the multiplexing unit 903. The multiplexing unit 903 multiplexes the encoded data of the upper layer and the encoded data of the lower layer, and sends the multiplexed data to the transmission buffer 704.

【0138】そして、この第5実施形態では上位階層可
変長復号化器905および下位階層可変長復号化器90
6内の図32中に示した復号値判定部110では、順方
向復号化器108によって得られた順方向復号結果から
復号値を判定し、最終的な復号結果を出力する。各階層
の順方向復号化器108および逆方向復号化器109で
の誤り判定は、符号語として存在しないビットパターン
が出現した場合、およびチェックビット等で誤りを検出
した場合には、検出位置はその場所とし、前記の判定方
法で誤りが検出されない場合で、復号したビット数が同
期区間内の符号化データのビット数と一致しない場合
は、復号化の最初の位置を誤り検出位置とする。
In the fifth embodiment, the upper layer variable length decoder 905 and the lower layer variable length decoder 90
In FIG. 32, the decoded value determining unit 110 shown in FIG. 32 determines a decoded value from the forward decoding result obtained by the forward decoder 108 and outputs a final decoded result. The error determination in the forward decoder 108 and the backward decoder 109 of each layer is performed when a bit pattern that does not exist as a codeword appears, and when an error is detected by a check bit or the like, the detection position is If no error is detected by the above-described determination method, and if the number of decoded bits does not match the number of bits of the encoded data in the synchronization interval, the first position of decoding is set as the error detection position.

【0139】次に、第5実施形態における復号値判定方
法について説明する。図48は、動画像多重化部703
での動画像符号化方式のシンタクスが図35に示すシン
タクスである場合の復号値判定方法を示している。図3
5のシンタクスでは、上位階層の動きベクトル情報と下
位階層のDCT係数情報にリバーシブル符号を用いてい
るので、上位階層および下位階層の両者で双方向復号が
可能である。
Next, a decoding value determination method according to the fifth embodiment will be described. FIG. 48 shows a moving image multiplexing unit 703.
35 shows a decoded value determination method in a case where the syntax of the moving picture coding method in the above is the syntax shown in FIG. FIG.
In the syntax of No. 5, since the reversible code is used for the motion vector information of the upper layer and the DCT coefficient information of the lower layer, bidirectional decoding can be performed in both the upper layer and the lower layer.

【0140】上位階層では、まずヘッダ情報とモード情
報が復号される。ヘッダ情報やモード情報で誤りが発見
されて全てが復号できない場合、誤りが生じた同期区間
のマクロブロックの復号値は全てNot Codedと
され、前画面がそのまま表示される。もし、ヘッダ情報
とモード情報が全て復号できた場合は、次に動きベクト
ル情報が双方向復号される。動きベクトル情報で復号が
できない部分については、やはりNot Codedと
される。下位階層では、動きベクトルまで復号できたマ
クロブロックについてのみ、下位階層のDCT係数情報
を使用される。誤りのためにDCT係数情報を放棄した
マクロブロックは、Not Codedとされる。
In the upper layer, first, header information and mode information are decoded. If an error is found in the header information or mode information and cannot be decoded at all, the decoded values of the macroblock in the synchronous section where the error has occurred are all Not Coded, and the previous screen is displayed as it is. If the header information and the mode information can all be decoded, the motion vector information is then bidirectionally decoded. The part that cannot be decoded by the motion vector information is also Not Coded. In the lower layer, DCT coefficient information of the lower layer is used only for a macroblock that can be decoded up to a motion vector. A macroblock in which DCT coefficient information has been discarded due to an error is regarded as Not Coded.

【0141】図49は、動画像多重化部703での動画
像符号化方式のシクタクスが図36に示すシンタクスで
ある場合の復号値判定方法を示している。図36のシン
タクスによると、上位階層ではまずヘッダ情報とモード
情報1が復号される。ヘッダ情報やモード情報1で誤り
が発見され、全てが復号できない場合は、誤りが生じた
同期区間のマクロブロックの復号値は全てNot Co
dedとされ、前画面がそのまま表示される。もし、ヘ
ッダ情報とモード情報1が全て復号できた場合は、次に
動きベクトル情報が双方向復号される。この動きベクト
ル情報で復号ができない部分については、やはりNot
Codedとされる。下位階層では、動きベクトルま
で復号できたマクロブロックについてのみ下位階層のD
CT係数情報が使用される。誤りのためにDCT係数情
報を放棄したマクロブロックは、Not Codedと
される。
FIG. 49 shows a decoding value determination method in the case where the syntax of the moving picture coding method in the moving picture multiplexing unit 703 is the syntax shown in FIG. According to the syntax of FIG. 36, first, header information and mode information 1 are decoded in the upper layer. If an error is found in the header information or the mode information 1 and cannot be decoded at all, the decoded values of all the macroblocks in the synchronous section where the error has occurred are Not Co
ded and the previous screen is displayed as it is. If the header information and the mode information 1 can all be decoded, the motion vector information is bidirectionally decoded next. For the part that cannot be decoded with this motion vector information,
Coded. In the lower layer, the D of the lower layer is used only for the macroblock that can be decoded up to the motion vector.
CT coefficient information is used. A macroblock in which DCT coefficient information has been discarded due to an error is regarded as Not Coded.

【0142】なお、図48および図49に示した復号値
判定方法では、マクロブロック単位に復号値の判定を行
なったが、ブロック単位でも符号語の単位で復号値の判
定を行なってもよい。また、この第5実施形態では動き
ベクトル情報とDCT係数情報の可変長符号化に本発明
を適用した場合について述べたが、可変長符号化を行な
う他の情報シンボルについても本発明を適用できること
はいうまでもない。
In the decoded value determination method shown in FIGS. 48 and 49, the decoded value is determined for each macroblock, but the decoded value may be determined for each block or each codeword. In the fifth embodiment, the case where the present invention is applied to variable length coding of motion vector information and DCT coefficient information has been described. However, the present invention can be applied to other information symbols that perform variable length coding. Needless to say.

【0143】(第6実施形態)次に、本発明の第6実施
形態に係る可変長符号化/復号化装置について説明す
る。この第6実施形態の基本的な構成は第1実施形態の
構成を示す図1のブロック図と同一なので、図1を参照
しながら説明する。
(Sixth Embodiment) Next, a variable length encoding / decoding device according to a sixth embodiment of the present invention will be described. The basic configuration of the sixth embodiment is the same as the block diagram of FIG. 1 showing the configuration of the first embodiment, and will be described with reference to FIG.

【0144】符号化部113において、入力された情報
シンボルは符号化器103に入力される。符号語テーブ
ル102は、符号語テーブル作成部101によって予め
作成された情報シンボルと可変長符号の符号語とを対応
させて格納している。符号化器103は符号語テーブル
102に格納されている符号語の中から、入力された情
報シンボルに対応した符号語を選択する。同期区間設定
部では、符号化器が選択した符号語を同期区間毎にまと
めて符号化データとして出力する。この符号化データ
は、伝送系または蓄積系104を通して復号化部111
に送られる。
[0144] In the coding section 113, the input information symbols are input to the encoder 103. The codeword table 102 stores information symbols created in advance by the codeword table creation unit 101 and codewords of variable-length codes in association with each other. The encoder 103 selects a codeword corresponding to the input information symbol from the codewords stored in the codeword table 102. The synchronization section setting unit collectively outputs the codewords selected by the encoder for each synchronization section and outputs the data as encoded data. This encoded data is transmitted to the decoding unit 111 through the transmission system or the storage system 104.
Sent to

【0145】復号化部114では、伝送系または蓄積系
105より入力された符号化データから同期区間検出部
106で符号化データの同期区間を検出し、符号化デー
タをバッファ107に蓄積する。順方向復号化器109
では、バッファに蓄積された符号化データの先頭から復
号を開始し、逆方向復号化器111では、バッファに蓄
積された符号化データの末尾から復号を開始する。
In the decoding section 114, the synchronization section of the coded data is detected by the synchronization section detection section 106 from the coded data input from the transmission system or the storage system 105, and the coded data is stored in the buffer 107. Forward decoder 109
Then, decoding starts from the head of the encoded data stored in the buffer, and the backward decoder 111 starts decoding from the end of the encoded data stored in the buffer.

【0146】順方向復号化器では、符号化データに、順
方向符号語テーブルに存在しないビットパターンが出現
した場合、及びバッファのビット数と異なるビット数の
符号化データが復号された場合、誤り検出と判定する。
同様に逆方向復号化器でも、符号化データに、逆方向符
号語テーブルに存在しないビットパターンが出現した場
合、及びバッファのビット数と異なるビット数の符号化
データが復号された場合、誤り検出と判定する。
In the forward decoder, if a bit pattern that does not exist in the forward codeword table appears in the encoded data, or if encoded data having a bit number different from the number of bits in the buffer is decoded, an error occurs. Judge as detection.
Similarly, in the backward decoder, if a bit pattern that does not exist in the backward codeword table appears in the coded data, or if the coded data having a bit number different from the number of bits in the buffer is decoded, error detection is performed. Is determined.

【0147】復号値判定部では、順方向復号化器によっ
て得られた復号結果(順方向復号結果という)と、逆方
向復号化器によって得られた復号結果(逆方向復号値と
いう)から復号値を判定し、最終的な復号結果を出力す
る。
[0147] The decoded value determination unit determines a decoded value from a decoded result obtained by the forward decoder (referred to as forward decoded result) and a decoded result obtained by the backward decoder (referred to as backward decoded value). And outputs the final decoding result.

【0148】図50は、符号語テーブル作成部101の
ブロック図である。情報シンボルの生起確率は、確率モ
デル作成部23に入力され、確率モデルを作成し、符号
選択部21に入力され、選択可能な符号系の中から最も
平均符号長の小さいものを選択し、選択結果を符号語構
成部22に送る。符号語構成部22では、符号語選択部
21で選択された符号の符号語を構成する。
FIG. 50 is a block diagram of the codeword table creation unit 101. The occurrence probability of the information symbol is input to the probability model generation unit 23, generates a probability model, is input to the code selection unit 21, selects the code system with the smallest average code length from the selectable code systems, and selects The result is sent to the codeword construction unit 22. The codeword configuration unit 22 configures a codeword of the code selected by the codeword selection unit 21.

【0149】この第6実施形態における確率モデルの設
計方法は以下の通りである。第6実施形態では、様々な
情報源の確率分布に対して、より汎用的で符号化効率の
より確率モデルの設計方法について示す。
The design method of the probability model in the sixth embodiment is as follows. In the sixth embodiment, a method of designing a more general-purpose and more efficient coding probability model with respect to probability distributions of various information sources will be described.

【0150】まず、記法を示す。 θi 情報源(i=1,…,n) X 情報源の情報シンボルX=(x1 ,x2 ,…,xm ) P(X| θi ) θi の頻度分布 一例としては、複数のテスト画像を情報源として、その
テスト画像を符号化して得られた頻度分布を考えればよ
い。
First, the notation will be described. .theta.i information source (i = 1,..., n) X information symbol of information source X = (x1, x2,..., xm) P (X | .theta.i) Frequency distribution of .theta.i It is sufficient to consider a frequency distribution obtained by encoding the test image.

【0151】ここで、設計する確率モデルQ(X)は、
複数の情報源から得れた頻度分布を重み付けして平均し
て求めるものとする。
Here, the probability model Q (X) to be designed is
It is assumed that frequency distributions obtained from a plurality of information sources are weighted and averaged.

【0152】 w(θi ) 重み付け係数 w(θ1 )+…+w(θ
n )=1 この時、いかに重み付け係数w(θi )を求めるかが問
題となる。
[0152] w (θi) weighting coefficient w (θ1) + ... + w (θ
n) = 1 At this time, how to determine the weighting coefficient w (θi) becomes a problem.

【0153】情報源θi をQ(X)で符号化した時の理
想符号長L(X| θi )は、 となる。各情報源に対して平均的に理想符号長L(X|
θi )を最小化するには
The ideal code length L (X | θi) when the information source θi is encoded by Q (X) is Becomes On average, the ideal code length L (X |
θi)

【0154】この関数が最小になるのは、U(X)=Q
(X)の時で、 w(θ1 )=…=w(θn )=1/n となる。
This function is minimized because U (X) = Q
In the case of (X), w (θ1) =... = W (θn) = 1 / n.

【0155】別の確率モデルQ(X)の設計方法とし
て、最悪の情報源を想定して確率モデルQ(X)を設計
する手法を示す。
As another design method of the probability model Q (X), a method of designing the probability model Q (X) assuming the worst information source will be described.

【0156】情報源θi をQ(X)で符号化した時の冗
長度R(X| θi )は、 となる。この冗長度の各情報源に対する重みづけ平均S
(X)は、 となって、事象Xと事象θの相互情報量を示す関数にな
っている。この関数の最大値を求める方法は、 S.Arimoto,"An algorithm for computing the capacity
of arbitrary discretememoryless channels,"IEEE Tr
ans.Inform.Theory,Vol.IT-18,pp.14-20,1972.R.E.Blah
ut,"Computation of channel capacity and rate-disto
rtion functions,"IEEE Trans.Inform.Theory,Vol.IT-1
8,pp.460-473,1972. に示されるArimoto-Blahutのアルゴリズム等が知られて
おり、これらのアルゴリズムによってS(X)を最大化
するつまり最悪の場合のw(θi )(i=1,…n )を求め
ることができる。
The redundancy R (X | θi) when the information source θi is encoded by Q (X) is Becomes Weighted average S for each information source of this redundancy
(X) Is a function indicating the mutual information amount between the event X and the event θ. To find the maximum value of this function, see S. Arimoto, "An algorithm for computing the capacity
of arbitrary discretememoryless channels, "IEEE Tr
ans.Inform.Theory, Vol.IT-18, pp.14-20,1972.REBlah
ut, "Computation of channel capacity and rate-disto
rtion functions, "IEEE Trans.Inform.Theory, Vol.IT-1
8, pp. 460-473, 1972. are known, and these algorithms maximize S (X), that is, w (θi) (i = 1) in the worst case. , ... n).

【0157】確率モデルQ(X)の設計方法として、理
想符号長を平均的に最小にする方法と、平均的に最悪を
想定する方法を示したが、2つの方法を組み合わせて、
情報源をグループ化して前者の方法で確率モデルをいく
つか作成し、その確率モデルに対して後者の方法を用い
るなどの方法を適用してもよい。
As a method of designing the probability model Q (X), a method for averaging the ideal code length and a method for assuming the worst on average have been described.
Information sources may be grouped to create some probability models by the former method, and a method of using the latter method may be applied to the probability model.

【0158】図50に示す符号選択部21では、確率モ
デル作成部23で作成した確率モデルQ(X)を、情報
シンボルXを確率の高い順にソーティングしたQ(Y)
を作成し、一方、符号構成部22で作成されたリバーシ
ブル符号の符号長を短い順にソーティングしたものF
(Z)を作成し、 を計算して最も値が小さいものを選択し、情報シンボル
と符号語を対応させて符号語テーブルを作成する。
In the code selecting section 21 shown in FIG. 50, the probability models Q (X) created by the probability model creating section 23 are sorted by the information symbols X in descending order of probability to Q (Y).
, On the other hand, the code lengths of the reversible codes generated by the code configuration unit 22 are sorted in ascending order.
Create (Z), Is calculated and the one with the smallest value is selected, and a codeword table is created by associating information symbols with codewords.

【0159】符号語構成部22で構成する符号は、例え
ば特願平7−89772および特願平7−260383
並びに第1および第3実施形態で示されている符号語の
重みを用いた順方向にも逆方向にも復号可能な可変長符
号が用いられる。
The codes formed by the code word forming unit 22 are described in, for example, Japanese Patent Application Nos. 7-89772 and 7-260383.
In addition, a variable-length code that can be decoded in both the forward and backward directions using the weight of the code word shown in the first and third embodiments is used.

【0160】(第7実施形態)次に、本発明の第7実施
形態を説明する。図51は、本発明の第7実施形態によ
る可変長符号化/復号化装置が組み込まれた動画像符号
化/復号化装置の概念図である。動画像符号化器709
では、情報源符号化器702で符号化されたデータは、
動画像多重化部703で可変長符号化、多重化等がおこ
なわれ、伝送バッファ704で平滑化されたのちに、符
号化データとして、伝送系または蓄積系705に送り出
される。符号化制御部701は、伝送バッファ704の
バッファ量を考慮して、情報源符号化器702、動画像
多重化部703の制御を行なう。一方、動画像復号化器
710では、伝送系または蓄積系705からの符号化デ
ータを受信バッファ706にためてから、動画像多重化
分離部707で、符号化データの多重化分離、可変長復
号化が行なわれ、情報源復号化器708に送られ、最終
的に動画像が復号化される。
(Seventh Embodiment) Next, a seventh embodiment of the present invention will be described. FIG. 51 is a conceptual diagram of a video encoding / decoding device incorporating the variable length encoding / decoding device according to the seventh embodiment of the present invention. Video encoder 709
Then, the data encoded by the information source encoder 702 is
The moving image multiplexing unit 703 performs variable-length coding, multiplexing, and the like, smoothes the data in a transmission buffer 704, and sends out the coded data to a transmission system or a storage system 705. The encoding control unit 701 controls the information source encoder 702 and the video multiplexing unit 703 in consideration of the buffer amount of the transmission buffer 704. On the other hand, the moving picture decoder 710 stores the coded data from the transmission system or the storage system 705 in the reception buffer 706, and the moving picture multiplex / separation unit 707 demultiplexes the coded data and performs variable length decoding. The decoding is performed and sent to the information source decoder 708, and the moving picture is finally decoded.

【0161】第7実施形態において追加されたシンタク
スについて説明する。図53は、第7実施形態における
動画像多重化部703および、動画像多重化分離部70
7での動画像符号化方式のシンタクスを示している。符
号化データは、上位階層と下位階層に階層化し、それぞ
れを同期符号RMとMMによって、同期区間を設定して
いる。また、下位階層のSTは、図62で示すような逆
方向から復号可能なスタッフィング符号である。フレー
ム内符号化フレームは、図63のように、マクロブロッ
クのモード情報の一部とINTRA DCを上位階層と
し、モード情報の一部とAC−DCT係数情報を下位階
層として、AC−DCT係数情報にリバーシブル符号を
適用している。フレーム間符号化フレームは、図64の
ように、マクロブロックのモード情報の一部と動きベク
トル情報を上位階層とし、モード情報の一部とINTR
A DCとAC−DCT係数情報を下位階層として、A
C−DCT係数情報にリバーシブル符号を適用してい
る。
The syntax added in the seventh embodiment will be described. FIG. 53 shows a moving image multiplexing unit 703 and a moving image multiplexing / demultiplexing unit 70 according to the seventh embodiment.
7 shows the syntax of the moving picture encoding method. The encoded data is hierarchized into an upper layer and a lower layer, and a synchronization section is set by using synchronization codes RM and MM. The ST in the lower layer is a stuffing code that can be decoded in the reverse direction as shown in FIG. As shown in FIG. 63, the intra-coded frame includes a part of the mode information of the macroblock and INTRA DC as an upper layer, a part of the mode information and AC-DCT coefficient information as a lower layer, and AC-DCT coefficient information. Is applied with a reversible code. As shown in FIG. 64, an inter-coded frame has a part of mode information of a macro block and motion vector information as an upper layer, and a part of mode information and INTR.
A and A-DCT coefficient information as lower layers
A reversible code is applied to C-DCT coefficient information.

【0162】図53に示す上位階層と下位階層の符号化
および復号化は、図52に示す動画像多重化部とにより
行なわれている。これらの構成は、第5実施形態に係る
符号化装置/復号化装置の構成と略同一である。すなわ
ち、図51の動画像多重化部703および動画像多重化
分離部707の基本構成は、図53(a)(b)に示す
通りであるが、上位階層可変長符号化器801、下位階
層可変長符号化器803および上位階層可変長復号化器
805、下位階層可変長復号化器806の構成が第2実
施形態とは異なっている。すなわち、情報源符号化器7
02で符号化されたデータのうち、例えば図53(a)
のシンタクスで示された上位階層のデータが上位階層可
変長符号化器801で可変長符号化され、多重化部80
3に送られる。また、情報源符号化器702で符号化さ
れたデータのうち、図53(b)のシンタクスで示され
た下位階層のデータが可変長符号化器803で可変長符
号化され、多重化部803に送られる。多重化部803
では、上位階層の符号化データおよび下位階層の符号化
データを多重化し、送信バッファ704に送る。
Encoding and decoding of the upper layer and the lower layer shown in FIG. 53 are performed by the moving picture multiplexing section shown in FIG. These configurations are substantially the same as the configurations of the encoding device / decoding device according to the fifth embodiment. That is, the basic configuration of the video multiplexing section 703 and the video multiplexing / demultiplexing section 707 in FIG. 51 is as shown in FIGS. 53 (a) and 53 (b), but the upper layer variable length encoder 801 and the lower layer The configurations of the variable length encoder 803, the upper layer variable length decoder 805, and the lower layer variable length decoder 806 are different from those of the second embodiment. That is, the source coder 7
02 of the data coded in FIG.
Is variable-length coded by the upper-layer variable-length encoder 801 and the multiplexing unit 80
Sent to 3. Also, of the data encoded by the information source encoder 702, data of a lower hierarchy indicated by the syntax in FIG. 53B is subjected to variable length encoding by a variable length encoder 803, and Sent to Multiplexer 803
Then, the encoded data of the upper layer and the encoded data of the lower layer are multiplexed and sent to the transmission buffer 704.

【0163】そして、この第7実施形態では上位階層可
変長復号化器805および下位階層可変長復号化器80
6内の図32中に示した復号値判定部110では、順方
向復号化器108によって得られた順方向復号結果から
復号値を判定し、最終的な復号結果を出力する。各階層
の順方向復号化器108および逆方向復号化器109で
の誤り判定は、符号語として存在しないビットパターン
が出現した場合、およびチェックビット等で誤りを検出
した場合には、検出位置はその場所とし、前記の判定方
法で誤りが検出されない場合で、復号したビット数が同
期区間内の符号化データのビット数と一致しない場合
は、復号化の最処理位置を誤り検出位置とする。
In the seventh embodiment, the upper layer variable length decoder 805 and the lower layer variable length decoder 80
In FIG. 32, the decoded value determining unit 110 shown in FIG. 32 determines a decoded value from the forward decoding result obtained by the forward decoder 108 and outputs a final decoded result. The error determination in the forward decoder 108 and the backward decoder 109 of each layer is performed when a bit pattern that does not exist as a codeword appears, and when an error is detected by a check bit or the like, the detection position is If no error is detected by the above-described determination method, and if the number of decoded bits does not match the number of bits of the coded data in the synchronization section, the position where decoding is most performed is set as the error detection position.

【0164】(第8実施形態)図54,図55は、本発
明の第8実施形態に係る符号化/復号化装置における情
報源符号化器702,情報源復号化器708の一例をそ
れぞれ示している。まず、図54において、入力画像信
号は、ブロック化回路401でマクロブロックに分割さ
れる。マクロブロックに分割された入力画像信号は、減
算器402に入力され、予測画像信号との差分がとられ
て、予測残差信号が生成される。この予測残差信号と、
ブロック化回路401からの入力画像信号のいずれか一
方を、モード選択スイッチ403により選択し、DCT
(離散コサイン変換)回路404により離散コサイン変
換される。DCT回路で得られたDCT係数データは、
量子化回路405で量子化される。量子化されたデータ
は、2分岐され、一方はDCT係数情報として、動画像
多重化器703におくられる。もう一方は、逆量子化回
路406およびIDCT(逆離散コサイン変換)回路4
07により量子化回路405およびDCT回路406の
処理と逆の処理が順次行なわれた後、加算器408でス
イッチ410を介して入力される予測画像信号と加算さ
れることにより、局部復号信号が生成される。この局部
復号信号は、フレームメモリに蓄えられ、動き補償回路
411に入力される。動き補償回路A010では、入力
画像信号と局部復号信号との間で動き補償を行ない、動
きベクトルを求め、予測画像信号を生成する。このとき
求めめられた動きベクトル情報は、動画像多重化器70
3に送られる。モード選択回路412では、動き補償回
路410からの情報に基づいて、各マクロブロックをど
のような予測方式で符号化するかを決定し、その結果が
量子化パラメータ等ともにモード情報として動画像多重
化器703に送られる。なお、図54において、出力さ
れる符号化データはDCT符号化係数,動きベクトル情
報,モード情報の3つが1つに纏められたデータであ
る。
(Eighth Embodiment) FIGS. 54 and 55 show examples of an information source encoder 702 and an information source decoder 708 in an encoding / decoding device according to an eighth embodiment of the present invention. ing. First, in FIG. 54, an input image signal is divided into macroblocks by a blocking circuit 401. The input image signal divided into macroblocks is input to the subtractor 402, and the difference between the input image signal and the predicted image signal is calculated to generate a prediction residual signal. This prediction residual signal,
One of the input image signals from the blocking circuit 401 is selected by the mode selection switch 403, and the DCT
(Discrete cosine transform) The circuit 404 performs discrete cosine transform. DCT coefficient data obtained by the DCT circuit is
The quantization is performed by the quantization circuit 405. The quantized data is split into two, one of which is sent to the video multiplexer 703 as DCT coefficient information. The other is an inverse quantization circuit 406 and an IDCT (inverse discrete cosine transform) circuit 4
07, the processing inverse to the processing of the quantization circuit 405 and the DCT circuit 406 is sequentially performed, and then added to the predicted image signal input via the switch 410 by the adder 408 to generate a local decoded signal. Is done. This local decoded signal is stored in the frame memory and input to the motion compensation circuit 411. The motion compensation circuit A010 performs motion compensation between the input image signal and the local decoded signal, obtains a motion vector, and generates a predicted image signal. The motion vector information obtained at this time is
Sent to 3. The mode selection circuit 412 determines what prediction method is used to encode each macroblock based on the information from the motion compensation circuit 410, and the result is used to multiplex the moving image as mode information together with the quantization parameter and the like. Is sent to the container 703. In FIG. 54, the coded data to be output is data in which three of DCT coding coefficients, motion vector information, and mode information are combined into one.

【0165】次に、図54により符号化されたデータを
復号化する情報源復号化器708の構成について図55
を参照しながら説明する。図55は、図54に対応する
情報源復号化器708の一例を示している。図55にお
いて、情報源復号化器708は、動画像多重化分離回路
707で分離したモード情報、動きベクトル情報、DC
T係数情報等が入力される。
Next, the configuration of the information source decoder 708 for decoding the data encoded in FIG. 54 will be described with reference to FIG.
This will be described with reference to FIG. FIG. 55 shows an example of the information source decoder 708 corresponding to FIG. In FIG. 55, an information source decoder 708 includes mode information, motion vector information, DC
T coefficient information and the like are input.

【0166】モード情報が入力されるモード判定回路5
04では、モード情報がINTRAならば、モード切替
スイッチ505をオフに選択して、DCT係数情報を、
逆量子化回路501で逆量子化し、IDCT回路502
で逆離散コサイン変換処理を行なうことにより、再生画
像信号を生成させる。この再生画像信号は、フレームメ
モリ506に参照画像として蓄積される一方、再生画像
信号として出力する。モード情報かINTERならば、
モード切替スイッチ505をオフに選択して、DCT係
数情報を、逆量子化回路501で逆量子化し、IDCT
回路502で逆離散コサイン変換処理をおこない、動き
ベクトル情報に基づいて、フレームメモリ504におい
て参照画像を動き補償し、加算器503で足しあわせ
て、再生画像信号を生成させる。この再生画像信号は、
フレームメモリ504に参照画像として蓄積される一
方、再生画像信号として出力する。
Mode determining circuit 5 to which mode information is input
In mode 04, if the mode information is INTRA, the mode changeover switch 505 is selected to be off, and the DCT coefficient information is
Inverse quantization is performed by an inverse quantization circuit 501, and an IDCT circuit 502
Performs a discrete cosine transform process to generate a reproduced image signal. The reproduced image signal is stored as a reference image in the frame memory 506 and is output as a reproduced image signal. If mode information or INTER,
The mode changeover switch 505 is turned off, and the DCT coefficient information is inversely quantized by the inverse quantization circuit 501, and the IDCT
The circuit 502 performs an inverse discrete cosine transform process, motion-compensates the reference image in the frame memory 504 based on the motion vector information, and adds the reference image by the adder 503 to generate a reproduced image signal. This reproduced image signal is
While being stored in the frame memory 504 as a reference image, it is output as a reproduced image signal.

【0167】(第9実施形態)次に、本発明の応用例と
して、本発明の可変長符号化/復号化装置が組み込まれ
た第9実施形態に係る動画像符号化/復号化システムを
適用した画像送受信装置の実施形態を図56を用いて説
明する。パーソナルコンピュータ(PC)1001に備
え付けられたカメラ1002より入力された画像信号
は、PC1001に組み込まれた動画像符号化器709
によって符号化される。動画像符号化器709から出力
される符号化データは、他の音声やデータの情報と多重
化された後、無線機1003より無線で送信され、他の
無線機1004によって受信される。無線機1004で
受信された信号は、画像信号の符号化データおよび音声
データに分解される。これらのうち、画像信号の符号化
データはワークステーション(EWS)1005に組み
込まれた動画像復号化器710によって復号され、EW
S1005のディスプレイに表示される。
(Ninth Embodiment) Next, as an application example of the present invention, a moving picture coding / decoding system according to a ninth embodiment incorporating the variable length coding / decoding device of the present invention is applied. An embodiment of the image transmitting / receiving apparatus described above will be described with reference to FIG. An image signal input from a camera 1002 provided in a personal computer (PC) 1001 is a moving image encoder 709 incorporated in the PC 1001.
Encoded by The coded data output from the video encoder 709 is multiplexed with other audio and data information, transmitted wirelessly from the wireless device 1003, and received by the other wireless device 1004. The signal received by the wireless device 1004 is decomposed into encoded data and audio data of an image signal. Among them, the coded data of the image signal is decoded by the moving image decoder 710 incorporated in the workstation (EWS) 1005, and the EW is decoded.
This is displayed on the display of S1005.

【0168】一方、EWS1005に備え付けられたカ
メラ1006より入力された画像信号は、EWS100
5に組み込まれた動画像符号化器709を用いて上記と
同様に符号化される。符号化データは、他の音声やデー
タの情報と多重化され、無線機1004により無線で送
信され、無線機1003によって受信される。無線機1
003によって受信された信号は、画像信号の符号化デ
ータおよび音声やデータの情報に分解される。これらの
うち、画像信号の符号化データはPC1001に組み込
まれた動画像復号化器710によって復号され、PC1
001のディスプレイに表示される。
On the other hand, the image signal input from the camera 1006 provided in the EWS 1005 is
5 is encoded in the same manner as described above using the moving image encoder 709 incorporated in the image encoding unit 5. The encoded data is multiplexed with other voice or data information, transmitted wirelessly by the wireless device 1004, and received by the wireless device 1003. Radio 1
The signal received by 003 is decomposed into coded data of an image signal and audio and data information. Among them, the coded data of the image signal is decoded by the moving image decoder 710 incorporated in the PC 1001, and the PC 1
001 is displayed on the display.

【0169】(第10実施形態)なお、上述した第1な
いし第9実施形態に係る動画像符号化/復号化装置は、
ハードウェアとしての構成として発明を捉えていたが、
本発明はこれを発展させて上記各々の実施形態に係る符
号化/復号化装置において用いられるデータまたはプロ
グラムを記録する記録媒体としても捉えることができ
る。以下、第10実施形態に係るデータまたはプログラ
ムを記録した記録媒体について説明する。
(Tenth Embodiment) The moving picture coding / decoding devices according to the first to ninth embodiments are described below.
Although the invention was considered as a configuration as hardware,
The present invention can be developed as a recording medium for recording data or a program used in the encoding / decoding device according to each of the above-described embodiments. Hereinafter, a recording medium on which data or a program according to the tenth embodiment is recorded will be described.

【0170】図51に示す情報源符号化器702では、
量子化語の8×8のDCT係数のブロックについてブロ
ックないのスキャンを行なって、LAST(0:ブロッ
クの最後でない非零係数,1:ブロックの最後の非零係
数),RUN(非零係数までの零ランの数)及びLEV
EL(係数の量子化値)を求め、動画像多重化部703
に送る。
In the information source encoder 702 shown in FIG.
A block-free scan is performed on the block of 8 × 8 DCT coefficients of the quantized word, and LAST (0: non-zero coefficient not at the end of the block, 1: non-zero coefficient at the end of the block), RUN (up to the non-zero coefficient) Number of zero runs) and LEV
The EL (quantized value of the coefficient) is obtained, and a moving image multiplexing unit 703 is obtained.
Send to

【0171】動画像多重化部703内の下位階層可変長
符号化器802は、図60に示すINTRA(フレーム
内符号化)の非LAST係数のRUN,LEVELにリ
バーシブル符号の符号語(VLC_CODE)のIND
EXを対応させたINDEXテーブルと、図61に示す
INTER(フレーム間符号化)の非LAST係数のR
UN,LEVELにリバーシブル符号の符号語(VLC
_CODE)のINDEXを対応させたINDEXにテ
ーブルと、図62に示すINTRA,INTER共通の
LAST係数のRUN,LEVELにリバーシブル符号
の符号語(VLC−CODE)のINDEXを対応させ
たINDEXテーブルと、図63,図64に示すIND
EX値と符号語を対応させた符号語テーブルを持ってい
る。
The lower layer variable length encoder 802 in the video multiplexing unit 703 converts the reversible codeword (VLC_CODE) into the RUN and LEVEL of the non-LAST coefficient of INTRA (intra-frame encoding) shown in FIG. IND
INDEX table corresponding to EX and R of non-LAST coefficient of INTER (interframe coding) shown in FIG.
The code word (VLC) of the reversible code is stored in UN and LEVEL.
INDEX corresponding to INDEX of _CODE), an INDEX table in which INDEX of a reversible code word (VLC-CODE) corresponds to RUN and LEVEL of LAST coefficients common to INTRA and INTER shown in FIG. 63, IND shown in FIG.
It has a code word table that associates EX values with code words.

【0172】下位階層可変長符号化器802の動作を、
図57のフローチャートに従って説明する。まず、モー
ド情報に基づいて、INTERの時はINTRAの非L
AST係数とLAST係数の符号語テーブル,INTE
Rの時はINTERの非LAST係数とLAST係数の
INDEXテーブルを選択する。(S101)次に、符
号語テーブルを用いて符号化するにあたって、(RU
N,LEVEL)がINDEXテーブルのRUNの最大
値R_max,LEVELの最大値L_maxと比較し
て、INDEXテーブル内に存在するかどうか確認す
る。(S102)もし、存在した場合、図60〜図62
のINDEXテーブルを引きINDEXの値が0である
かどうかチェックを行ない(S104),0でなけれ
ば、図12の符号語テーブルのINDEXの符号語を出
力する。符号語テーブルの符号語の最終ビットの“s”
は、LEVELの符号を表し、“s”が“0”のとき
は、LEVELの符号は正、“s”が“1”のときは、
LEVELの符号は負である(S105)。INDEX
の値が0であった場合と、範囲外であった場合は、符号
語テーブルに存在しない係数で、図67に示すようにE
SCAPE符号を続けて、LAST係数かどうかの1ビ
ットと図65および図66のRUNとLEVELの絶対
値を固定長符号化し、この固定長符号化部の先頭に2つ
のエスケープのうち“00001”を付加し、末端にも
エスケープ符号を付加する。図63,図64のINDE
X値が0の符号語が、エスケープ符号であり、エスケー
プ(ESCAPE)符号として用いられるVLC_CO
DEの最終ビット“s”はLEVELの符号を表し、
“s”が“0”ならばLEVELは正、“1”ならばL
EVELは負である(S106)。
The operation of the lower layer variable length encoder 802 is
This will be described with reference to the flowchart in FIG. First, based on the mode information, at the time of INTER, INTRA non-L
AST coefficient and LAST coefficient codeword table, INTE
At the time of R, the INDEX table of the LAST non-LAST coefficient and the LAST coefficient is selected. (S101) Next, when encoding using the codeword table, (RU
(N, LEVEL) is compared with the maximum value R_max of the RUN of the INDEX table, and the maximum value L_max of the LEVEL in the INDEX table to confirm whether or not it exists in the INDEX table. (S102) If it exists, FIGS.
INDEX table is checked to see if the value of INDEX is 0 (S104). If not, the INDEX code word of the code word table of FIG. 12 is output. "S" of the last bit of the codeword in the codeword table
Represents the sign of LEVEL. When "s" is "0", the sign of LEVEL is positive, and when "s" is "1",
The sign of LEVEL is negative (S105). INDEX
Is 0 or out of the range, a coefficient that does not exist in the codeword table, as shown in FIG.
Following the SCAPE code, one bit of the LAST coefficient and the absolute value of RUN and LEVEL in FIG. 65 and FIG. 66 are fixed-length coded, and “00001” of the two escapes is added to the head of this fixed-length coder. And an escape code at the end. INDE in FIGS. 63 and 64
A code word whose X value is 0 is an escape code, and VLC_CO used as an escape (ESCAPE) code.
The last bit “s” of DE indicates the sign of LEVEL,
If “s” is “0”, LEVEL is positive; if “s”, “L” is L
EVEL is negative (S106).

【0173】以上説明したように、INDEXテーブル
を用いることにより、ESCAPE符号を用いた場合に
も、探索することなく効率的に、符号語を出力できる。
下位階層可変長復号化器802は、図68,図69の復
号値テーブルを備えており、可変長符号を復号した結果
得られるINDEX値に基づいて動作する。
As described above, by using the INDEX table, even when an ESCAPE code is used, a codeword can be output efficiently without searching.
The lower layer variable length decoder 802 includes the decoded value tables of FIGS. 68 and 69, and operates based on the INDEX value obtained as a result of decoding the variable length code.

【0174】次に、下位階層可変長復号化器の動作を、
図58と図59のフローチャートに従って説明する。図
58は、順方向の場合の復号動作である。まず、可変長
復号を順方向復号する(S201)。次に、復号して得
られたINDEX値が0かどうかをチェックし(S20
2)、0以外の場合は、上位階層のモード情報に基づい
て、図68の復号値テーブルのINTRAとINTER
を選択して、LAST,RUN,LEVELの復号値を
得る(S203)。INDEX値が0の場合は、ESA
PE符号であるから、次に続く固定長符号を復号して、
LAST,RUN,LEVELの復号値を得る(S20
4)。つづいて、末尾のESCAPE符号を復号する
(S205)。LEVELの正負は、符号語の最終ビッ
トが“0”ならば、正であり、“1”ならば、負である
(S206)。
Next, the operation of the lower layer variable length decoder will be described.
This will be described with reference to the flowcharts of FIGS. 58 and 59. FIG. 58 shows the decoding operation in the forward direction. First, the variable length decoding is forward decoded (S201). Next, it is checked whether the INDEX value obtained by decryption is 0 (S20).
2) In cases other than 0, INTRA and INTER of the decoded value table in FIG.
To obtain the decoded values of LAST, RUN, and LEVEL (S203). If the INDEX value is 0, ESA
Since it is a PE code, the following fixed length code is decoded, and
The decoded values of LAST, RUN, and LEVEL are obtained (S20
4). Subsequently, the last ESCAPE code is decoded (S205). The sign of LEVEL is positive if the last bit of the codeword is "0", and negative if it is "1" (S206).

【0175】図59は、逆方向の場合の復号動作であ
る。まず、符号語の最初の1ビットで、LEVELの正
負を決定する。もし、“0”ならば、正であり、“1”
ならば負である(S301)。次に可変長符号を逆方向
復号する(S302)。逆方向復号して得られたIND
EX値が0かどうかチェックし(S303)、0以外の
場合は、上位階層のモード情報に基づいて、図68の復
号値テーブルのINTRAとINTERを選択して、L
AST,RUN,LEVELの復号値を得る(S30
4)。INDEX値が0の場合には、ESCAPE符号
であるから、次に続く固定長符号を復号して、LEVE
L,RUN,LASTの復号値を得る(S305)。つ
づいて、先頭のESCAPE符号を復号する(S30
6)。以上説明したように、復号値テーブルを用いるこ
とで、ESCAPE符号を使った場合にも記憶量を節約
し、効率的に双方向に復号することができる。
FIG. 59 shows the decoding operation in the reverse direction. First, the first bit of the code word determines the sign of LEVEL. If "0", it is positive and "1"
If so, it is negative (S301). Next, the variable length code is decoded in the backward direction (S302). IND obtained by reverse decoding
It is checked whether the EX value is 0 (S303). If the EX value is not 0, INTRA and INTER in the decoded value table of FIG. 68 are selected based on the mode information of the upper layer, and L
The decoded values of AST, RUN, and LEVEL are obtained (S30
4). If the INDEX value is 0, it is an ESCAPE code, so the next fixed-length code is decoded and
The decoded values of L, RUN, and LAST are obtained (S305). Subsequently, the first ESCAPE code is decoded (S30).
6). As described above, by using the decoded value table, even when the ESCAPE code is used, the storage amount can be saved, and efficient bidirectional decoding can be performed.

【0176】上記第10実施形態におけるデコードプロ
セスの補強例について説明する。すなわち、動画像多重
化部703での動画像符号化方式のシンタクスが図53
に示すシンタクスである場合の復号値判定方法について
説明する。
A description will be given of an example of reinforcing the decoding process in the tenth embodiment. That is, the syntax of the moving picture coding method in the moving picture multiplexing unit 703 is shown in FIG.
A method for determining a decoded value in the case of the syntax shown in FIG.

【0177】フレーム内符号化フレームでは、まず、上
位階層のモード情報1とINTRADCが復号される。
もし、誤りが発見されて全てを復号できない場合は、誤
りの生じた同期区間のマクロブロックの復号値を全てN
ot Codedとする。もし、符号化が最初のフレー
ムで時間的に前のフレームが存在しない場合は、灰色あ
るいは特定の色でマクロブロックを埋める。
In the intra-coded frame, first, mode information 1 of the upper layer and INTRADC are decoded.
If all errors cannot be decoded because an error is found, the decoded values of the macroblocks in the synchronous section where the error has occurred are all set to N.
ot Coded. If the encoding is the first frame and no previous frame exists, the macroblock is filled with gray or a specific color.

【0178】下位階層では、モード情報2が誤りのため
復号できない場合、下位階層の符号化データを全て放棄
し、上位階層の復号値を書き換えて、Not Code
dとするか、INTRA DCのみで表示する。また、
誤りのためDCT係数を放棄したマクロブロックは、N
ot Codedとするか、INTRA DCのみで表
示する。
In the lower layer, if the mode information 2 cannot be decoded due to an error, all the coded data in the lower layer is discarded, the decoded value in the upper layer is rewritten, and the Not Code is rewritten.
d or display only with INTRA DC. Also,
Macroblocks that have abandoned DCT coefficients due to errors
ot Coded or display only with INTRA DC.

【0179】また、INTRAモードのマクロブロック
で、AC−DCT係数の予測を行なっているマクロブロ
ックがある場合は、可変長符号は復号できるが、周辺の
マクロブロックからの予測を行なっているので、周辺の
マクロブロックが復号できていないために復号できない
場合、Not Codedとする。
If there is a macroblock in the INTRA mode in which the AC-DCT coefficient is predicted, the variable length code can be decoded, but the prediction is performed from the neighboring macroblocks. If decoding is not possible because the surrounding macroblocks have not been decoded, it is set to Not Coded.

【0180】フレーム間符号化フレームでは、まず、上
位階層のモード情報1と動きベクトルが復号される。も
し、誤りが発見されて全てを復号できない場合は、誤り
が生じた同期区間のマクロブロックの復号値は全てNo
t Codedとされる。もし、全て復号できた場合、
同期符号MMが存在することを確認し、もし、存在しな
ければ、やはり、同期区間のマクロブロックの復号値を
全てNot Codedとする。
In the inter-coded frame, first, mode information 1 of the upper layer and a motion vector are decoded. If all errors cannot be decoded because an error is found, the decoded values of macroblocks in the synchronous section where the error occurred are all No.
t Coded. If everything is decrypted,
It is confirmed that the synchronization code MM exists, and if it does not exist, all decoded values of the macroblock in the synchronization section are set to Not Coded.

【0181】下位階層では、モード情報2及びINTR
A DCで誤りのため復号されない場合、下位階層の符
号化データを放棄し、Not Codedと表示する
か、または、前フレームからの動き補償のみでの表示
(MC Not Coded)に上位階層の復号値を書
き換える。また、誤りのためDCT係数を放棄したマク
ロブロックは、MC Not Codedとする。
In the lower hierarchy, mode information 2 and INTR
If the decoding is not performed due to an error in the ADC, the encoded data of the lower layer is discarded and displayed as Not Coded, or the decoded value of the upper layer is displayed in the motion compensation only from the previous frame (MC Not Coded). Is rewritten. A macroblock in which the DCT coefficient has been abandoned due to an error is referred to as MC Not Coded.

【0182】また、INTRAモードのマクロブロック
で、AC−DCT係数の予測を行なっているマクロブロ
ックがある場合は、可変長符号は復号できるが、周辺の
マクロブロックからの予測を行なっているので、周辺の
マクロブロックが復号できていないために復号できない
場合、Not Codedとする。
If there is a macroblock in the INTRA mode where AC-DCT coefficients are predicted, the variable-length code can be decoded, but prediction is performed from neighboring macroblocks. If decoding is not possible because the surrounding macroblocks have not been decoded, it is set to Not Coded.

【0183】図70はフレーム間符号化フレームのAC
−DCT係数部の詳しい復号値判定方法を示している。
FIG. 70 shows the AC of the inter-coded frame.
13 shows a detailed decoded value determination method for the DCT coefficient section.

【0184】まず、図70(a)に示すように順方向復
号結果と逆方向復号結果で誤りが検出されるマクロブロ
ックの位置(誤り検出位置)が交差しない場合は、誤り
が検出されなかったマクロブロックの復号結果のみを復
号値として使用し、二つの誤り検出位置の復号結果は復
号値として使用せず、上位階層のモード情報の復号結果
に基づいて、INTRAマクロブロックについては、前
フレームをそのまま表示するように、INTRAマクロ
ブロックについては、前フレームより動き補償のみで表
示するように、上位階層の復号結果を書き換える。
First, as shown in FIG. 70 (a), when the position of a macroblock (error detection position) where an error is detected in the forward decoding result and the reverse decoding result does not intersect, no error is detected. Only the decoding result of the macroblock is used as the decoding value, the decoding result of the two error detection positions is not used as the decoding value, and based on the decoding result of the mode information of the upper layer, the previous frame is determined for the INTRA macroblock. For the INTRA macroblock to be displayed as it is, the decoding result of the upper layer is rewritten so as to display only the motion compensation from the previous frame.

【0185】また、図70(b)に示すように順方向復
号結果と逆方向復号結果の誤りの検出位置が交差する場
合は、順方向復号の結果で誤りが検出されたマクロブロ
ックまでの復号値は、順方向復号結果を使用し、それ以
降の部分は、逆方向復号結果を復号値として使用する。
When the error detection positions of the forward decoding result and the reverse decoding result intersect as shown in FIG. 70 (b), decoding up to the macroblock where the error is detected in the result of the forward decoding. The value uses the forward decoding result, and the subsequent part uses the backward decoding result as the decoded value.

【0186】なお、逆方向復号結果を優先して、逆方向
復号の結果で誤りが検出されたマクロブロックまでの復
号値は、逆方向復号結果を使用し、それ以前の部分は、
順方向復号結果を復号値として使用してもよい。
By giving priority to the result of the backward decoding, the decoded values up to the macroblock in which the error is detected in the result of the backward decoding use the result of the backward decoding.
The forward decoding result may be used as a decoded value.

【0187】さらに、図70(c)に示すように同一の
マクロブロックで順方向復号結果および逆方向復号結果
の両方に誤りが検出される場合は、誤り検出位置のマク
ロブロックの復号値は放棄し、復号値として使用せず
に、上位階層のモード情報の復号結果に基づいて、IN
TRAマクロブロックについては、前フレームをそのま
ま表示するように、INTERマクロブロックについて
は、前フレームよりの動き補償のみで表示するように、
上位階層の復号結果を書き換え、それ以後のマクロブロ
ックに対する復号値は逆方向の復号結果を使用する。
Further, as shown in FIG. 70 (c), when an error is detected in both the forward decoding result and the backward decoding result in the same macroblock, the decoded value of the macroblock at the error detection position is discarded. Then, instead of using it as a decoding value, based on the decoding result of the mode information of the upper layer, IN
For the TRA macroblock, the previous frame is displayed as it is, and for the INTER macroblock, only the motion compensation from the previous frame is displayed.
The decoding result of the upper layer is rewritten, and the decoding value for the subsequent macroblock uses the decoding result in the reverse direction.

【0188】また、図70(d)に示すようにスタッフ
ィング符号で誤りが検出され、逆方向に復号できない場
合は、順方向復号のみ復号を行ない、誤りが検出された
場合、誤り検出位置以降のマクロブロックは、上位階層
のモード情報の復号結果に基づいて、INTRAマクロ
ブロックについては、前フレームをそのまま表示するよ
うに、INTERマクロブロックについては、前フレー
ムよりの動き補償のみで表示するように、上位階層の復
号結果を書き換え、それ以後のマクロブロックに対する
復号値は逆方向の復号結果を使用する。
As shown in FIG. 70 (d), when an error is detected by the stuffing code and decoding cannot be performed in the backward direction, decoding is performed only in the forward direction. When an error is detected, the error after the error detection position is detected. Based on the decoding result of the mode information of the upper layer, the macro block displays the previous frame as it is for the INTRA macro block, and displays only the motion compensation from the previous frame for the INTER macro block, The decoding result of the upper layer is rewritten, and the decoding value for the subsequent macroblock uses the decoding result in the reverse direction.

【0189】図70の復号値判定方法では、マクロブロ
ックを単位に復号値の判定をおこなったが、ブロックの
単位でも、符号語の単位で判定をおこなってもよい。
In the decoded value determination method shown in FIG. 70, the decoded value is determined for each macroblock. However, the determination may be performed for each block or each codeword.

【0190】以上実施形態で説明したように、本発明の
可変長符号化/復号化装置は、従来と比較して、より少
ない計算量と記憶量で十分であり、効率的である。
As described in the above embodiment, the variable length coding / decoding device of the present invention requires less calculation and storage than the conventional device, and is more efficient.

【0191】具体的には、動画像符号化/復号化装置に
も適用することが可能であり、より少ない計算量と記憶
量で効率的な動画像符号化/復号化装置を提供すること
ができる。
More specifically, the present invention can be applied to a moving picture encoding / decoding apparatus, and it is possible to provide an efficient moving picture encoding / decoding apparatus with a smaller amount of calculation and a smaller amount of storage. it can.

【0192】[0192]

【発明の効果】以上、説明したように本発明によれば、
より少ない計算量と記憶量で効率的に符号化/復号化す
ることができる順方向にも逆方向にも復号可能な可変長
符号化/復号化装置を提供することができる。
As described above, according to the present invention,
It is possible to provide a variable-length encoding / decoding device capable of performing encoding / decoding efficiently with less calculation amount and storage amount and capable of decoding in both the forward and reverse directions.

【0193】また、本発明によれば無駄なビットパター
ンを減らして符号化効率を高め、しかもスタッフィング
符号を用いて同期区間を一定区間を単位に設定する場合
でも、順方向にも逆方向にも復号可能な可変長符号化/
復号化装置を提供することができる。
Further, according to the present invention, useless bit patterns are reduced to improve coding efficiency, and even when a synchronization section is set in units of a fixed section using a stuffing code, it can be used in both the forward and reverse directions. Decodable variable length coding /
A decoding device can be provided.

【0194】また、本発明における符号語の構成方法に
よれば、より幅広い情報シンボルの確率分布に対応で
き、従来適用することのできなかったような情報シンボ
ル数が大きな符号化に対しても適用が可能となる。具体
的には、動画像符号化/復号化システムにも適用するこ
とが可能であり、誤りに強い動画像符号化/復号化シス
テムを提供することができる。
Further, according to the method of constructing a code word in the present invention, it is possible to cope with a wider probability distribution of information symbols, and it is also applicable to coding with a large number of information symbols which could not be applied conventionally. Becomes possible. Specifically, the present invention can be applied to a video encoding / decoding system, and can provide a video encoding / decoding system that is resistant to errors.

【0195】しかも、この符号語の構成法によれば符号
化効率が向上し、また符号語のビットパターンの自由度
が高い符号設計ができるため、同期符号を用いて同期区
間の設定を行なう場合でも、同期符号と符号語のビット
パターンが一致することによる疑似同期の問題を回避す
ることができる。
Furthermore, according to this codeword construction method, the coding efficiency is improved, and a code can be designed with a high degree of freedom in the bit pattern of the codeword. However, it is possible to avoid the problem of pseudo-synchronization due to the coincidence between the bit pattern of the synchronization code and the code word.

【0196】さらに、本発明によれば順方向および逆方
向の復号結果から復号値を判定する際、順方向および逆
方向復号を行なう際の誤り検出結果に応じて、符号化デ
ータの復号値を判定することにより、リバーシブル符号
を伝送路誤りに対して効果的に復号することが可能とな
る。
Further, according to the present invention, when determining the decoded value from the decoded results in the forward and reverse directions, the decoded value of the coded data is determined according to the error detection result when performing the forward and reverse decoding. By making the determination, the reversible code can be effectively decoded with respect to the transmission path error.

【0197】また、本発明によれば可変長符号の符号語
の誤り検出機能を有する双方向復号化手段で復号処理を
行なう際に、順方向復号処理での誤り検出結果に応じて
符号化データの復号処理を切り替えることで、順方向と
逆方向の復号処理を共用することができることから、回
路規模や演算量を大幅に増加させることなく、伝送路誤
りに対して効果的に復号を行なうことができる。
Further, according to the present invention, when the decoding process is performed by the bidirectional decoding means having the function of detecting the error of the code word of the variable length code, the encoded data is determined according to the error detection result in the forward decoding process. By switching between the decoding processes of (1) and (2), the decoding process in the forward direction and in the reverse direction can be shared, so that decoding can be effectively performed against transmission path errors without significantly increasing the circuit scale and the amount of computation. Can be.

【0198】さらに、本発明によれば符号化側で情報シ
ンボルを重要度に応じて階層化した上で可変長符号化を
行ない、同期区間毎に階層毎の符号化データを作成し、
かつ階層毎の符号化データを多重化することにより、情
報シンボルのシンタクスによらず順方向にも逆方向にも
復号可能であって、より誤りに強い可変長符号化/復号
化を行なうことが可能となる。
Further, according to the present invention, the information symbol is hierarchized according to the importance on the encoding side, and then variable-length encoding is performed to generate encoded data for each layer in each synchronization section.
Also, by multiplexing the encoded data for each layer, it is possible to decode in both the forward and reverse directions regardless of the syntax of the information symbol, and to perform variable-length encoding / decoding that is more resistant to errors. It becomes possible.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の第1実施形態に係る可変長符号化/復
号化装置の構成を示すブロック図。
FIG. 1 is a block diagram showing a configuration of a variable-length encoding / decoding device according to a first embodiment of the present invention.

【図2】図1における符号語テーブル作成部を示すブロ
ック図。
FIG. 2 is a block diagram showing a codeword table creation unit in FIG. 1;

【図3】図2における符号語構成部での第1の符号語構
成方法を説明する図。
FIG. 3 is a view for explaining a first codeword configuration method in a codeword configuration unit in FIG. 2;

【図4】第1の符号構成方法で構成した符号語から作成
した順方向および逆方向の復号木を示す図。
FIG. 4 is a diagram showing forward and backward decoding trees created from codewords configured by a first code configuration method.

【図5】図2における符号語構成部での第2の符号語構
成方法を説明する図。
FIG. 5 is a view for explaining a second codeword configuration method in the codeword configuration unit in FIG. 2;

【図6】図2における符号語構成部での第3の符号語構
成方法を説明する図。
FIG. 6 is a view for explaining a third codeword configuration method in the codeword configuration unit in FIG. 2;

【図7】図2における同期区間設定部での同期区間設定
方法を説明する図。
FIG. 7 is a view for explaining a method of setting a synchronous section in a synchronous section setting unit in FIG. 2;

【図8】スタッフィング符号の第1の例を示す図。FIG. 8 is a diagram showing a first example of a stuffing code.

【図9】スタッフィング符号の第2の例を示す図。FIG. 9 is a diagram showing a second example of a stuffing code.

【図10】図2における復号値判定部の動作を説明する
図。
FIG. 10 is a view for explaining the operation of a decoded value determination unit in FIG. 2;

【図11】本発明の第2実施形態に係る動画像符号化/
復号化システムの概略構成を示すブロック図。
FIG. 11 shows video encoding / coding according to the second embodiment of the present invention.
FIG. 2 is a block diagram showing a schematic configuration of a decoding system.

【図12】第2実施形態に係る動画像符号化/復号化シ
ステムにおける符号化データのシンタックスを示す図。
FIG. 12 is a view showing the syntax of encoded data in the video encoding / decoding system according to the second embodiment.

【図13】図11における動画像多重化部および動画像
多重化分離部の構成を示すブロック図。
FIG. 13 is a block diagram showing a configuration of a moving image multiplexing unit and a moving image multiplexing / demultiplexing unit in FIG. 11;

【図14】第2実施形態におけるINTRAおよびIN
TERの非LAST係数の符号語テーブルの一部を示す
図。
FIG. 14 shows INTRA and IN in the second embodiment.
The figure which shows a part of codeword table of the non-LAST coefficient of TER.

【図15】第2実施形態におけるINTRAおよびIN
TERの非LAST係数の符号語テーブルの他の一部を
示す図。
FIG. 15 shows INTRA and IN in the second embodiment.
The figure which shows another part of codeword table of the non-LAST coefficient of TER.

【図16】第2実施形態におけるINTRAおよびIN
TERの非LAST係数の符号語テーブルのさらに別の
一部を示す図。
FIG. 16 shows INTRA and IN in the second embodiment.
The figure which shows another part of the code word table of the non-LAST coefficient of TER.

【図17】第2実施形態におけるINTRAおよびIN
TERのLAST係数の符号語テーブルの一部を示す
図。
FIG. 17 shows INTRA and IN according to the second embodiment.
The figure which shows a part of code word table of LAST coefficient of TER.

【図18】第2実施形態におけるINTRAおよびIN
TERのLAST係数の符号語テーブルの他の一部を示
す図。
FIG. 18 shows INTRA and IN according to the second embodiment.
The figure which shows another part of codeword table of the LAST coefficient of TER.

【図19】第2実施形態におけるエスケープ符号の符号
語テーブルを示す図。
FIG. 19 is a diagram illustrating a codeword table of an escape code according to the second embodiment.

【図20】第2実施形態における符号語テーブルにない
符号語の符号化方式を示す図。
FIG. 20 is a diagram showing a coding method of a codeword not included in a codeword table in the second embodiment.

【図21】第2実施形態における最大の零ランの場合を
示す図。
FIG. 21 is a diagram showing a case of a maximum zero run in the second embodiment.

【図22】第2実施形態における復号値判定部の動作を
説明するためたの図。
FIG. 22 is a diagram for explaining the operation of a decoded value determination unit according to the second embodiment.

【図23】本発明の第3実施形態に係る可変長符号化/
復号化装置の構成を示すブロック図。
FIG. 23 is a diagram illustrating a variable-length encoding / decoding method according to a third embodiment of the present invention.
FIG. 2 is a block diagram showing a configuration of a decoding device.

【図24】図23における符号語構成部での第1の符号
語構成方法を説明する図。
FIG. 24 is a view for explaining a first codeword configuration method in the codeword configuration unit in FIG. 23;

【図25】図23における符号語構成部での第2の符号
語構成方法を説明する図。
FIG. 25 is an exemplary view for explaining a second codeword forming method in the codeword forming unit in FIG. 23;

【図26】順方向符号語テーブルと逆方向符号語テーブ
ルを共通化した双方向符号語テーブルの構成を示す図。
FIG. 26 is a diagram showing a configuration of a bidirectional codeword table in which a forward codeword table and a backward codeword table are shared.

【図27】復号化器に誤り検出部を付加した場合の構成
を示すブロック図。
FIG. 27 is a block diagram showing a configuration when an error detection unit is added to the decoder.

【図28】第3実施形態における復号化方法を説明する
図。
FIG. 28 is a view for explaining a decoding method according to the third embodiment;

【図29】第3実施形態における復号値判定部の復号値
判定方法を説明するための図。
FIG. 29 is an exemplary view for explaining a decoding value judgment method of a decoding value judgment unit in the third embodiment.

【図30】本発明の第4の実施形態に係る可変長符号化
/復号化装置の構成を示すブロック図。
FIG. 30 is a block diagram showing a configuration of a variable-length encoding / decoding device according to a fourth embodiment of the present invention.

【図31】図30における一つの階層の可変長符号化部
の構成を示すブロック図。
FIG. 31 is a block diagram showing a configuration of a variable length coding unit of one layer in FIG. 30;

【図32】図30における一つの階層の可変長復号化部
の構成を示すブロック図。
FIG. 32 is a block diagram showing a configuration of a variable length decoding unit for one layer in FIG. 30;

【図33】図30におけるデータ階層化部および多重化
部でのデータ階層化および多重化の例を示す図。
FIG. 33 is a diagram showing an example of data hierarchization and multiplexing in the data hierarchization unit and the multiplexing unit in FIG. 30;

【図34】図32における復号値判定部の復号値判定方
法の例を示す図。
FIG. 34 is a diagram showing an example of a decoding value determination method of a decoding value determination unit in FIG. 32;

【図35】第4実施形態に係る可変長符号化/復号化装
置を図11の動画像符号化/復号化システムに組み込ん
だ場合の動画像多重化部および動画像多重化分離部での
動画像符号化方式のシンタックスの第1の例を示す図。
35 shows a moving picture multiplexing section and a moving picture multiplexing / demultiplexing section when the variable length coding / decoding device according to the fourth embodiment is incorporated in the moving picture coding / decoding system of FIG. 11; FIG. 4 is a diagram illustrating a first example of syntax of an image encoding method.

【図36】第4実施形態に係る可変長符号化/復号化装
置を図11の動画像符号化/復号化システムに組み込ん
だ場合の動画像多重化部および動画像多重化分離部での
動画像符号化方式のシンタックスの第2の例を示す図。
FIG. 36 shows a moving image in a moving image multiplexing unit and a moving image multiplexing / demultiplexing unit when the variable length coding / decoding device according to the fourth embodiment is incorporated in the moving image coding / decoding system of FIG. 11; FIG. 9 is a diagram illustrating a second example of the syntax of the image encoding method.

【図37】第4実施形態に係る可変長符号化/復号化装
置を図11の動画像符号化/復号化システムに組み込ん
だ場合の動画像多重化部および動画像多重化分離部での
動画像符号化方式のシンタックスの第3の例を示す図。
FIG. 37 shows a moving picture multiplexing section and a moving picture multiplexing / demultiplexing section when the variable length coding / decoding device according to the fourth embodiment is incorporated in the moving picture coding / decoding system of FIG. 11; The figure which shows the 3rd example of the syntax of an image coding system.

【図38】第4実施形態に係る可変長符号化/復号化装
置を図11の動画像符号化/復号化システムに組み込ん
だ場合の動画像多重化部および動画像多重化分離部での
動画像符号化方式のシンタックスの第4の例を示す図。
FIG. 38 shows a moving image in a moving image multiplexing unit and a moving image multiplexing / demultiplexing unit when the variable length coding / decoding device according to the fourth embodiment is incorporated in the moving image coding / decoding system of FIG. 11; The figure which shows the 4th example of the syntax of an image coding system.

【図39】第4実施形態における動きベクトルの符号化
テーブルを示す図。
FIG. 39 is a diagram showing a motion vector encoding table in the fourth embodiment.

【図40】第4実施形態における動きベクトルの符号化
テーブルを示す図。
FIG. 40 is a diagram showing an encoding table of a motion vector in the fourth embodiment.

【図41】第4実施形態における動きベクトルの符号化
テーブルを示す図。
FIG. 41 is a diagram showing an encoding table of a motion vector in the fourth embodiment.

【図42】第4実施形態における動きベクトルの符号化
テーブルを示す図。
FIG. 42 is a diagram showing a motion vector encoding table in the fourth embodiment.

【図43】第4実施形態における動きベクトルの符号化
テーブルを示す図。
FIG. 43 is a diagram showing a motion vector encoding table in the fourth embodiment.

【図44】第4実施形態における動きベクトルの符号化
テーブルを示す図。
FIG. 44 is a diagram showing a motion vector encoding table in the fourth embodiment.

【図45】第4実施形態における動きベクトルの符号化
テーブルを示す図。
FIG. 45 is a view showing an encoding table of a motion vector in the fourth embodiment.

【図46】第4実施形態における動きベクトルの符号化
テーブルを示す図。
FIG. 46 is a diagram showing a motion vector encoding table in the fourth embodiment.

【図47】第4実施形態における動きベクトルの一次元
予測を説明するための図。
FIG. 47 is a view for explaining one-dimensional prediction of a motion vector in the fourth embodiment.

【図48】図35のシンタクスの場合の復号値判定方法
を説明する図。
FIG. 48 is an exemplary view for explaining a decoded value determination method in the case of the syntax in FIG. 35;

【図49】図36のシンタクスの場合の復号値判定方法
を説明する図。
FIG. 49 is an exemplary view for explaining a decoded value determination method in the case of the syntax in FIG. 36;

【図50】本発明の第6実施形態に係る符号化/復号化
装置であり、図1における符号語テーブル作成部の詳細
構成を示すブロック図。
50 is a block diagram showing a coding / decoding device according to a sixth embodiment of the present invention, showing a detailed configuration of a codeword table creation unit in FIG. 1; FIG.

【図51】本発明の第7実施形態に係る動画像符号化/
復号化システムの概略構成を示すブロック図。
FIG. 51 is a diagram illustrating moving picture encoding / coding according to the seventh embodiment of the present invention.
FIG. 2 is a block diagram showing a schematic configuration of a decoding system.

【図52】図50における動画像多重化部および動画像
多重化分離部の構成を示すブロック図。
FIG. 52 is a block diagram showing a configuration of a video multiplexing unit and a video multiplexing / demultiplexing unit in FIG. 50;

【図53】第7実施形態に係る動画像多重化部および動
画像多重化分離部での動画像符号化方式のシンタクスの
例を示す図。
FIG. 53 is a view showing an example of the syntax of a moving image encoding method in the moving image multiplexing unit and the moving image multiplexing / demultiplexing unit according to the seventh embodiment.

【図54】本発明の第8実施形態に係る情報源符号化器
の一例を示すブロック図。
FIG. 54 is a block diagram showing an example of an information source encoder according to the eighth embodiment of the present invention.

【図55】本発明の第8実施形態に係る情報源復号化器
の一例を示すブロック図。
FIG. 55 is a block diagram showing an example of an information source decoder according to the eighth embodiment of the present invention.

【図56】本発明の第9実施形態に係る可変長符号化/
復号化装置が組み込まれるシステムの一例を示す図。
FIG. 56 shows a variable-length encoding /
FIG. 2 is a diagram illustrating an example of a system in which a decoding device is incorporated.

【図57】本発明の第10実施形態の可変長符号化器の
動作を示すフローチャート。
FIG. 57 is a flowchart showing the operation of the variable length encoder according to the tenth embodiment of the present invention.

【図58】第10実施形態の順方向可変長復号化器の動
作を示すフローチャート。
FIG. 58 is a flowchart showing the operation of the forward variable length decoder according to the tenth embodiment;

【図59】第10実施形態の逆方向可変長復号化器の動
作を示すフローチャート。
FIG. 59 is a flowchart showing the operation of the backward variable length decoder according to the tenth embodiment;

【図60】INTRA係数のINDEXテーブルを示す
図。
FIG. 60 is a view showing an INDEX table of INTRA coefficients.

【図61】INTER係数のINDEXテーブルを示す
図。
FIG. 61 is a view showing an INDEX table of INTER coefficients.

【図62】LASR係数のINDEXテーブルを示す
図。
FIG. 62 is a view showing an INDEX table of LASR coefficients;

【図63】第10実施形態における符号語テーブルを示
す図。
FIG. 63 is a view showing a codeword table in the tenth embodiment;

【図64】第10実施形態における符号語テーブルを示
す図。
FIG. 64 is a view showing a codeword table in the tenth embodiment;

【図65】第10実施形態におけるRUNの固定長符号
語テーブルを示す図。
FIG. 65 is a view showing a fixed-length codeword table of RUN in the tenth embodiment;

【図66】第10実施形態におけるLEVELの固定長
符号語テーブルを示す図。
FIG. 66 is a view showing a LEVEL fixed-length codeword table according to the tenth embodiment;

【図67】符号語テーブルにない符号語の符号化方式を
示す図
FIG. 67 is a diagram showing an encoding method of a codeword not included in the codeword table.

【図68】第10実施形態における復号値テーブルFIG. 68 is a decryption value table in the tenth embodiment.

【図69】第10実施形態における復号値テーブルFIG. 69 is a decoded value table in the tenth embodiment.

【図70】復号値判定部の動作を説明するための図FIG. 70 is a view for explaining the operation of a decoded value determination unit;

【図71】リバーシブル符号の一般的な復号方法を示す
図。
FIG. 71 is a view showing a general decoding method of a reversible code.

【図72】通常の可変長符号の説明図。FIG. 72 is an explanatory diagram of a normal variable length code.

【図73】従来のリバーシブル符号の説明図。FIG. 73 is an explanatory view of a conventional reversible code.

【図74】従来のスタッフィング符号を示す図。FIG. 74 is a view showing a conventional stuffing code.

【図75】従来の逆復号ができない情報シンボルのシン
タックスを説明するための図。
FIG. 75 is a view for explaining the syntax of an information symbol that cannot be inversely decoded in the related art.

【符号の説明】[Explanation of symbols]

51 双方向符号語テーブル 52 アドレス変換器 53 識別信号 61 誤り検出部 101 符号語テーブル作成部 102 符号語テーブル 103 符号化器 104 同期区間設定部 105,205,705 伝送系または蓄積系 106 同期区間検出部 107 バッファ 108 順方向復号化器 109 逆方向復号化器 110 復号値判定部 111 順方向符号語テーブル 112 逆方向符号語テーブル 113,213 符号化部 114,121,214 復号化部 122 符号化データ切替器 123 符号語テーブル切替器 124,62 復号化器 201 符号化テーブル作成部 202 データ階層化部 203 階層別可変長符号化部 204 多重化部 206 多重化分離部 207 階層別復号化部 208 データ合成部 401 ブロック化回路 402 減算器 403 モード選択スイッチ 404 DCT回路 405 量子化回路 406 逆量子化回路 407 IDCT回路 408 加算器 409 フレームメモリ 410 動き補償回路 411 スイッチ 412 モード選択回路 501 逆量子化回路 502 IDCT回路 503 加算器 504 モード判定回路 505 モード切替スイッチ 506 フレームメモリ 701 符号化制御部 702 情報源符号化器 703 動画像多重化器 704 送信バッファ 706 受信バッファ 707 動画像多重化分離器 708 情報源復号化器 709 動画像符号化器 710 動画像復号化器 901 上位階層可変長符号化器 902 下位階層可変長符号化器 903 多重化器 904 多重化分離器 905 上位階層可変長復号化器 906 下位階層可変長復号化器 1001 パーソナルコンピュータ 1002 ワークステーション 1003,1004 無線機 1005,1006 カメラ Reference Signs List 51 bidirectional codeword table 52 address converter 53 identification signal 61 error detector 101 codeword table generator 102 codeword table 103 encoder 104 synchronous section setting section 105, 205, 705 transmission system or storage system 106 synchronous section detection Unit 107 buffer 108 forward decoder 109 backward decoder 110 decoded value determination unit 111 forward codeword table 112 backward codeword table 113,213 encoding unit 114,121,214 decoding unit 122 encoded data Switch 123 Codeword Table Switch 124, 62 Decoder 201 Coding Table Creation Unit 202 Data Hierarchy Unit 203 Variable Length Encoding Unit 204 Hierarchical Unit 204 Multiplexing Unit 206 Demultiplexing Unit 207 Hierarchical Decoding Unit 208 Data Combiner 401 Blocking circuit 402 Subtraction 403 Mode selection switch 404 DCT circuit 405 Quantization circuit 406 Inverse quantization circuit 407 IDCT circuit 408 Adder 409 Frame memory 410 Motion compensation circuit 411 Switch 412 Mode selection circuit 501 Inverse quantization circuit 502 IDCT circuit 503 Adder 504 Mode decision circuit 505 Mode switch 506 Frame memory 701 Encoding controller 702 Information source encoder 703 Video multiplexer 704 Transmit buffer 706 Receive buffer 707 Video multiplexer / demultiplexer 708 Information source decoder 709 Video encoder 710 Video decoder 901 Upper layer variable length encoder 902 Lower layer variable length encoder 903 Multiplexer 904 Demultiplexer 905 Upper layer variable length decoder 906 Lower layer variable length decoder 1001 Par Naru computer 1002 workstations 1003 and 1004 radio 1005 and 1006 camera

───────────────────────────────────────────────────── フロントページの続き (72)発明者 菊 池 義 浩 神奈川県川崎市幸区小向東芝町1 株式会 社東芝研究開発センター内 (72)発明者 永 井 剛 神奈川県川崎市幸区小向東芝町1 株式会 社東芝研究開発センター内 ──────────────────────────────────────────────────続 き Continuing from the front page (72) Inventor Yoshihiro Kikuchi 1 Komukai Toshiba-cho, Saiwai-ku, Kawasaki-shi, Kanagawa Prefecture Inside Toshiba R & D Center (72) Inventor Tsuyoshi Nagai Small, Sachi-ku, Kawasaki-shi, Kanagawa Muko Toshiba 1 Inside Toshiba R & D Center

Claims (29)

【特許請求の範囲】[Claims] 【請求項1】複数の情報シンボルに対して該情報シンボ
ルの生起確率に応じた符号長を有する符号語をそれぞれ
割り当て、入力された情報シンボルに対応した符号語を
符号化データとして出力する可変長符号化装置におい
て、 入力された情報シンボルを重要度に応じて階層化する階
層化手段と、 順方向にも逆方向にも復号可能であって、符号語の予め
定められた重みによって符号語の区切りが分かるように
構成された符号語を含む複数の符号語を情報シンボルに
それぞれ対応させて格納した符号語テーブルと、 前記符号語テーブルから前記階層化手段により階層化さ
れた情報シンボルに対応する符号語を選択する符号語選
択手段と、 前記符号語選択手段により選択された符号語を用いて所
定の同期区間毎に階層毎の符号化データを作成すると共
に、該階層毎の符号化データを多重化する多重化手段
と、 を有することを特徴とする可変長符号化装置。
A variable length code code having a code length corresponding to a probability of occurrence of an information symbol is assigned to each of a plurality of information symbols, and a code word corresponding to an input information symbol is output as coded data. An encoding device comprising: a layering means for layering input information symbols according to importance; decoding means capable of decoding in both forward and backward directions; A codeword table in which a plurality of codewords including a codeword configured to be able to recognize the delimiter are stored in association with the information symbols, and a codeword table corresponding to the information symbols hierarchized by the hierarchy means from the codeword table. Codeword selecting means for selecting a codeword, and using the codeword selected by the codeword selecting means, to generate encoded data for each layer for each predetermined synchronization section And multiplexing means for multiplexing the coded data for each layer. A variable length coding device, comprising:
【請求項2】前記順方向にも逆方向にも復号可能であっ
て、符号語の予め定められた重みによって符号語の区切
りが分かるように構成された符号語は、順方向にも逆方
向にも復号可能な第1の符号語の先頭および末尾の少な
くとも一方に、順方向にも逆方向にも復号可能な第2の
符号語を付加して構成されることを特徴とする請求項1
に記載の可変長符号化装置。
2. A code word which can be decoded in both the forward and reverse directions, and is configured so that a code word delimiter can be identified by a predetermined weight of the code word. 2. The method according to claim 1, wherein a second codeword that can be decoded in both the forward and reverse directions is added to at least one of the beginning and end of the first codeword that can be decoded.
3. The variable length encoding device according to 1.
【請求項3】前記順方向にも逆方向にも復号可能であっ
て、符号語の予め定められた重みによって符号語の区切
りが分かるように構成された符号語は、順方向にも逆方
向にも復号可能な第1の符号語の各ビットの直前および
直後の少なくとも一方に、順方向にも逆方向にも復号可
能な第2の符号語を付加して構成されることを特徴とす
る請求項1に記載の可変長符号化装置。
3. A code word which is decodable in both the forward and reverse directions, and which is configured so that the delimiter of the code word can be identified by a predetermined weight of the code word. And a second code word that can be decoded in both the forward direction and the backward direction is added to at least one of immediately before and immediately after each bit of the first code word that can be decoded. The variable length coding device according to claim 1.
【請求項4】順方向にも逆方向にも復号可能な符号語を
含む符号語で構成された可変長符号からなり、所定の同
期区間毎に逆方向に復号可能なスタッフィング符号が挿
入された符号化データを復号する可変長復号化装置にお
いて、 前記符号化データの同期区間を検出する同期区間検出手
段と、 前記同期区間検出手段により検出された同期区間の符号
化データを順方向から復号する順方向復号化手段と、 前記同期区間検出手段により検出された同期区間の符号
化データを逆方向から復号する逆方向復号化手段と、を
有することを特徴とする可変長復号化装置。
4. A variable length code composed of a code word including a code word that can be decoded in both the forward and reverse directions, and a stuffing code that can be decoded in the reverse direction is inserted for each predetermined synchronization section. In a variable length decoding device for decoding encoded data, a synchronous section detecting means for detecting a synchronous section of the encoded data; and decoding the encoded data of the synchronous section detected by the synchronous section detecting means from a forward direction. A variable length decoding apparatus comprising: a forward decoding unit; and a backward decoding unit that decodes encoded data of a synchronization section detected by the synchronization section detection unit from a backward direction.
【請求項5】順方向にも逆方向にも復号可能な符号語を
含む符号語で構成された可変長符号からなり、所定の同
期区間毎に逆方向に復号可能なスタッフィング符号が挿
入された符号化データを復号する可変長復号化装置にお
いて、 前記符号化データの同期区間を検出する同期区間検出手
段と、 前記同期区間検出手段により検出された同期区間の符号
化データを順方向から復号する順方向復号化手段と、 前記同期区間検出手段により検出された同期区間の符号
化データを逆方向から復号する逆方向復号化手段と、 前記順方向復号化手段および逆方向復号化手段の復号結
果から復号値を判定して最終的な復号結果を出力する復
号値判定手段と、 を有することを特徴とする可変長復号化装置。
5. A variable length code composed of codewords including codewords that can be decoded in both the forward and reverse directions, and a stuffing code that can be decoded in the reverse direction is inserted for each predetermined synchronization section. In a variable length decoding device for decoding encoded data, a synchronous section detecting means for detecting a synchronous section of the encoded data; and decoding the encoded data of the synchronous section detected by the synchronous section detecting means from a forward direction. Forward decoding means; backward decoding means for decoding coded data of the synchronization section detected by the synchronization section detection means from the backward direction; decoding results of the forward decoding means and the backward decoding means And a decoded value judging means for judging a decoded value from and outputting a final decoding result.
【請求項6】順方向にも逆方向にも復号可能な符号語を
含む符号語で構成された可変長符号からなり、階層化さ
れた情報シンボルに対応する符号語により作成され、か
つ多重化された符号化データを所定の同期区間毎に復号
する可変長復号化装置において、 前記多重化された符号化データを階層毎に分離する分離
手段と、 前記分離手段により分離された符号化データの同期区間
を検出する同期区間検出手段と、 前記同期区間検出手段により検出された同期区間の符号
化データを順方向から復号する順方向復号化手段と、 前記同期区間検出手段により検出された同期区間の符号
化データを逆方向から復号する逆方向復号化手段と、 前記順方向復号化手段および逆方向復号化手段により得
られた階層毎の復号結果を合成する合成手段と、 を有することを特徴とする可変長復号化装置。
6. A variable length code composed of codewords including codewords that can be decoded in both the forward and reverse directions. The variable length code is formed by codewords corresponding to hierarchical information symbols and multiplexed. A variable-length decoding device that decodes the coded data that has been multiplexed for each predetermined synchronization section, comprising: a separating unit that separates the multiplexed coded data for each layer; Synchronous section detecting means for detecting a synchronous section; forward decoding means for decoding encoded data of the synchronous section detected by the synchronous section detecting means from the forward direction; synchronous section detected by the synchronous section detecting means Backward decoding means for decoding the encoded data in the backward direction; and combining means for combining the decoding results for each layer obtained by the forward decoding means and the backward decoding means. Variable length decoding apparatus according to claim Rukoto.
【請求項7】順方向にも逆方向にも復号可能な符号語を
含む符号語で構成された可変長符号からなり、階層化さ
れた情報シンボルに対応する符号語により作成され、か
つ多重化された符号化データを所定の同期区間毎に復号
する可変長復号化装置において、 前記多重化された符号化データを階層毎に分離する分離
手段と、 前記分離手段により分離された符号化データの同期区間
を検出する同期区間検出手段と、 前記同期区間検出手段により検出された同期区間の符号
化データを順方向から復号する順方向復号化手段と、 前記同期区間検出手段により検出された同期区間の符号
化データを逆方向から復号する逆方向復号化手段と、 前記順方向復号化手段および逆方向復号化手段により得
られた階層毎の復号結果から復号値を判定して最終的な
復号結果を出力する復号値判定手段と、 前記復号値判定手段により得られた階層毎の最終的な復
号結果を合成する合成手段と、 を有することを特徴とする可変長復号化装置。
7. A variable length code composed of codewords including codewords that can be decoded in both the forward and reverse directions. The variable length code is formed by codewords corresponding to hierarchical information symbols and multiplexed. A variable-length decoding device that decodes the coded data that has been multiplexed for each predetermined synchronization section, comprising: a separating unit that separates the multiplexed coded data for each layer; Synchronous section detecting means for detecting a synchronous section; forward decoding means for decoding encoded data of the synchronous section detected by the synchronous section detecting means from the forward direction; synchronous section detected by the synchronous section detecting means A backward decoding means for decoding the coded data in the backward direction, and a decoding value determined from the decoding result for each layer obtained by the forward decoding means and the backward decoding means. A decoding value determining means for outputting the decoding result, the variable length decoding apparatus characterized by having a synthesizing means for synthesizing the final decoded results obtained for each hierarchy by the decoding value determining means.
【請求項8】前記順方向復号化手段および逆方向復号化
手段の少なくとも一方は、可変長符号の符号語テーブル
に存在しない符号語が符号化データに出現したとき、該
符号語を誤りとして検出することを特徴とする請求項4
ないし請求項7の何れか1項に記載の可変長復号化装
置。
8. When at least one of the forward decoding unit and the backward decoding unit detects a codeword that does not exist in a codeword table of a variable length code in encoded data, the codeword is detected as an error. 5. The method according to claim 4, wherein
8. The variable length decoding device according to claim 7.
【請求項9】前記順方向復号化手段および逆方向復号化
手段の少なくとも一方は、復号した符号化データのビッ
ト数が伝送されてきた符号化データのビット数と一致し
ない場合、誤りと検出することを特徴とする請求項4な
いし請求項7の何れか1項に記載の可変長復号化装置。
9. At least one of the forward decoding means and the backward decoding means detects an error when the number of bits of decoded encoded data does not match the number of bits of transmitted encoded data. 8. The variable length decoding device according to claim 4, wherein
【請求項10】前記順方向復号化手段および逆方向復号
化手段の少なくとも一方は、符号化データを復号して得
られた復号値が不適な場合、復号処理の誤りとして検出
することを特徴とする請求項4ないし請求項7の何れか
1項に記載の可変長復号化装置。
10. The apparatus according to claim 1, wherein at least one of said forward decoding means and said backward decoding means detects an error in decoding processing when a decoded value obtained by decoding encoded data is inappropriate. The variable length decoding device according to claim 4, wherein
【請求項11】前記復号値判定手段は、前記順方向復号
化手段および逆方向復号化手段の少なくとも一方で誤り
が検出された場合は、該順方向復号化手段および逆方向
復号化手段の復号結果のうち正しいと推定される復号結
果を使用し、いずれの復号結果でも復号できなかった部
分は放棄することを特徴とする請求項5または請求項7
に記載の可変長復号化装置。
11. The decoding value judging means, when an error is detected in at least one of the forward decoding means and the backward decoding means, performs decoding of the forward decoding means and the backward decoding means. 8. The method according to claim 5, wherein a decoding result that is estimated to be correct among the results is used, and a portion that cannot be decoded in any of the decoding results is discarded.
3. The variable length decoding device according to [1].
【請求項12】前記復号値判定手段は、 (a)前記順方向復号化手段および逆方向復号化手段の
両方で前記誤りが検出され、かつそれらの誤り検出位置
が交差しない場合は、誤りが検出されなかった復号結果
のみ復号値として使用し、 (b)前記順方向復号化手段および逆方向復号化手段の
両方で前記誤りが検出され、かつそれらの誤りが検出さ
れ、かつそれらの誤りが検出された位置が交差する場合
は、順方向復号化手段で誤りが発見された位置の直前ま
での符号語に対する復号値は順方向の復号結果を使用
し、それ以後の符号語に対する復号値は逆方向の復号結
果を使用し、 (c)前記順方向復号化手段および逆方向復号化手段の
いずれか一方のみで前記誤りが検出された場合は、該誤
りが検出された位置の直前までの符号語に対する復号値
は順方向の復号結果を使用し、それ以後の符号語に対す
る復号値は逆方向の復号結果を使用し、 (d)前記順方向復号化手段および逆方向復号化手段で
同一の符号語について前記誤りが検出された場合は、該
誤りが検出された位置の符号語に対する復号値を放棄
し、それ以後の符号語に対する復号値は逆方向の復号結
果を使用することを特徴とする請求項5または請求項7
に記載の可変長復号化装置。
12. The decoding value judging means comprises: (a) when the error is detected by both the forward decoding means and the backward decoding means and the error detection positions do not intersect, (B) Both the forward decoding means and the backward decoding means detect the error, detect the error, and determine whether the error is detected. If the detected positions intersect, the decoded values for the codewords immediately before the position where the error is found by the forward decoding means use the results of the forward decoding, and the decoded values for the subsequent codewords are (C) when the error is detected by only one of the forward decoding means and the backward decoding means, using the result of decoding in the backward direction; For codeword The code value uses the forward decoding result, and the decoded values for the subsequent code words use the reverse decoding result. (D) The same code word is used by the forward decoding means and the reverse decoding means. When the error is detected, the decoded value for the codeword at the position where the error is detected is discarded, and the decoded values for the subsequent codewords use the decoding result in the reverse direction. Claim 5 or Claim 7
3. The variable length decoding device according to [1].
【請求項13】前記復号値判定手段は、前記順方向復号
化手段および前記逆方向復号化手段の少なくとも一方で
誤りが検出された場合は、誤りが存在している可能性の
ある復号結果を全て放棄することを特徴とする請求項5
または請求項7に記載の可変長復号化装置。
13. The decoding value judging means, when an error is detected in at least one of the forward decoding means and the backward decoding means, judges a decoding result which may have an error. 6. The method according to claim 5, wherein all of them are abandoned.
Alternatively, the variable length decoding device according to claim 7.
【請求項14】前記順方向にも逆方向にも復号可能であ
って、符号語の予め定められた重みによって符号語の区
切りが分かるように構成された符号語は、順方向にも逆
方向にも復号可能な符号語の各ビットの間に、固定長符
号の符号語が所定ビットずつ挿入された符号語であるこ
とを特徴とする請求項1に記載の可変長符号化装置。
14. A code word which can be decoded in both the forward and reverse directions, and is configured so that a code word delimiter can be identified by a predetermined weight of the code word. The variable-length encoding apparatus according to claim 1, wherein a fixed-length codeword is a codeword in which predetermined bits are inserted between each bit of the codeword that can be decoded.
【請求項15】前記順方向にも逆方向にも復号可能であ
って、符号語の予め定められた重みによって符号語の区
切りが分かるように構成された符号語は、第1の順方向
にも逆方向にも復号可能な符号語の各ビットの間に、第
2の順方向にも逆方向にも復号可能な符号語が挿入され
た符号語であることを特徴とする請求項1に記載の可変
長符号化装置。
15. A codeword which is decodable in both the forward and reverse directions, and which is configured so that a delimiter of the codeword can be identified by a predetermined weight of the codeword, is provided in a first forward direction. 2. A code word in which a code word that can be decoded in both the forward and reverse directions is inserted between each bit of the code word that can be decoded in both the forward and reverse directions. The variable-length encoding device according to any one of the preceding claims.
【請求項16】順方向にも逆方向にも復号可能な符号語
を含む符号語で構成された可変長符号からなり、所定の
同期区間毎に逆方向に復号可能なスタッフィング符号が
挿入された符号化データを復号する可変長復号化装置に
おいて、 前記符号化データの同期区間を検出する同期区間検出手
段と、 前記同期区間検出手段により検出された同期区間の符号
化データを復号する順方向および逆方向の両方向の復号
が可能な双方向復号化手段と、 を有することを特徴とする可変長復号化装置。
16. A stuffing code which is composed of a variable length code composed of a code word including a code word which can be decoded in both the forward direction and the backward direction, and which can be decoded in the backward direction for each predetermined synchronization section. In a variable length decoding device for decoding encoded data, a synchronous section detecting means for detecting a synchronous section of the encoded data, and a forward direction for decoding encoded data of a synchronous section detected by the synchronous section detecting means; A variable length decoding device, comprising: bidirectional decoding means capable of decoding in both directions in the reverse direction.
【請求項17】前記同期区間検出手段は、前記スタッフ
ィング符号を逆方向から復号することにより前記符号化
データのビット数を検出することを特徴とする請求項
4、請求項5および請求項16の何れか1項に記載の可
変長復号化装置。
17. The method according to claim 4, wherein said synchronous section detecting means detects the number of bits of said encoded data by decoding said stuffing code in a reverse direction. The variable length decoding device according to claim 1.
【請求項18】前記双方向復号化手段は、順方向の復号
処理および逆方向の復号処理の少なくとも一方におい
て、可変長符号の符号語テーブルに存在しない符号語が
符号化データに出現したとき、該符号語を誤りとして検
出することを特徴とする請求項16に記載の可変長復号
化装置。
18. The method according to claim 18, wherein at least one of the decoding process in the forward direction and the decoding process in the backward direction, when a codeword that does not exist in the codeword table of the variable length code appears in the encoded data. 17. The variable length decoding device according to claim 16, wherein the codeword is detected as an error.
【請求項19】前記双方向復号化手段は、順方向の復号
処理および逆方向の復号処理の少なくとも一方におい
て、復号した符号化データのビット数が伝送されてきた
符号化データのビット数と一致しない場合、誤りと検出
することを特徴とする請求項16に記載の可変長復号化
装置。
19. The bidirectional decoding means, wherein at least one of a forward decoding process and a backward decoding process, the bit number of the decoded encoded data matches the bit number of the transmitted encoded data. 17. The variable-length decoding device according to claim 16, wherein an error is detected when not performed.
【請求項20】前記双方向復号化手段は、順方向の復号
処理および逆方向の復号処理の少なくとも一方におい
て、符号化データを復号して得られた復号値が不適な場
合、復号処理の誤りとして検出することを特徴とする請
求項16に記載の可変長復号化装置。
20. The bidirectional decoding means according to claim 11, wherein at least one of the forward decoding process and the reverse decoding process decodes an error in the decoding process if a decoded value obtained by decoding the encoded data is inappropriate. 17. The variable length decoding device according to claim 16, wherein the detection is performed as
【請求項21】前記双方向復号化手段は、順方向の復号
処理を行なった後、前記符号化データの末尾より逆方向
の復号処理を行なうことを特徴とする請求項16または
請求項20に記載の可変長復号化装置。
21. The method according to claim 16, wherein the bidirectional decoding means performs a decoding process in a backward direction from the end of the encoded data after performing a decoding process in a forward direction. A variable-length decoding device according to claim 1.
【請求項22】前記双方向復号化手段は、順方向の復号
処理で誤りを検出した場合に、該順方向の復号処理を中
止し、符号化データの末尾より逆方向の復号処理を行な
うことを特徴とする請求項21に記載の可変長復号化装
置。
22. When the bidirectional decoding means detects an error in the forward decoding process, the bidirectional decoding means stops the forward decoding process and performs a backward decoding process from the end of the encoded data. 22. The variable length decoding device according to claim 21, wherein:
【請求項23】前記双方向復号化手段は、順方向の復号
処理で誤りを検出した場合に、該誤り位置より任意の距
離離れた位置から順方向の復号処理を再開することを特
徴とする請求項21に記載の可変長復号化装置。
23. The bidirectional decoding means, when an error is detected in the forward decoding process, restarts the forward decoding process from a position arbitrarily distant from the error position. The variable length decoding device according to claim 21.
【請求項24】前記双方向復号化手段は、順方向の復号
処理で誤りを検出した場合に、該誤り位置より任意の距
離離れた位置から該誤り位置まで逆方向の復号処理を行
なうことを特徴とする請求項21または請求項23に記
載の可変長復号化装置。
24. The bidirectional decoding means, when an error is detected in a forward decoding process, performs a reverse decoding process from a position at an arbitrary distance from the error position to the error position. The variable length decoding device according to claim 21 or claim 23.
【請求項25】前記双方向復号化手段は、順方向の復号
処理において符号化データの末尾で誤りを検出した場合
に限り、逆方向の復号処理を行なうことを特徴とする請
求項21または請求項23に記載の可変長復号化装置。
25. The method according to claim 21, wherein said bidirectional decoding means performs a reverse decoding process only when an error is detected at the end of encoded data in a forward decoding process. Item 24. The variable length decoding device according to item 23.
【請求項26】可変符号化/復号化装置が入出力可能な
可変長符号化データを記録した記録媒体であって、 順方向にも逆方向にも復号可能であって、符号語の予め
定められた重みによって符号語の区切りがわかるように
構成された符号語を含む符号化データと、 前記符号化データに所定の同期区間毎に逆方向に復号可
能なスタッフィング符号を挿入したデータと、 を記録することを特徴とする可変長符号化/復号化装置
に用いられるデータを記録した記録媒体。
26. A recording medium on which variable-length encoded data which can be input / output by a variable encoding / decoding apparatus is recordable, which can be decoded in both forward and reverse directions, and a predetermined codeword is defined. Coded data including a code word configured so that a delimiter of a code word can be identified by the weight given; and data obtained by inserting a stuffing code that can be decoded in the backward direction into the coded data for each predetermined synchronization section. A recording medium on which data used for a variable-length encoding / decoding device is recorded.
【請求項27】画像符号化/復号化装置でブロック単位
の直交変換を行なって生成され得る変換係数データを記
録した記録媒体であって、 前記変換係数データは、前記画像符号化/復号化装置が
もつ複数の符号化モード毎に、順方向にも逆方向にも復
号可能である複数の符号語を、ブロックの最後以外の直
交変換係数のうち出現頻度の高いものに対してそれぞれ
対応させたデータと、 前記画像符号化/復号化装置の複数の符号化モードに対
して共通に設けられ、順方向にも逆方向にも復号可能で
ある複数の符号語を、ブロックの最後の直交変換係数の
うち出現頻度の高いものに対してそれぞれ対応させたデ
ータと、 出現頻度の低い変換係数データを固定長符号で記述し、
その先頭と末尾に順方向にも逆方向にも復号可能な符号
語を付加したデータと、 前記符号化データに所定の同期区間毎に逆方向に復号可
能なスッフィング符号を挿入したデータと、 を記録することを特徴とする可変長符号化/復号化装置
に用いられるデータを記録した記録媒体。
27. A recording medium recording transform coefficient data that can be generated by performing an orthogonal transform on a block basis by an image encoding / decoding device, wherein said transform coefficient data is stored in said image encoding / decoding device. For each of a plurality of encoding modes of, a plurality of codewords that can be decoded in both the forward and reverse directions are respectively associated with the most frequently occurring orthogonal transform coefficients other than the end of the block. Data and a plurality of codewords that are provided in common for a plurality of encoding modes of the image encoding / decoding device and can be decoded in both forward and backward directions, The data corresponding to those with high appearance frequency and the conversion coefficient data with low appearance frequency are described using fixed-length codes.
Data obtained by adding a codeword that can be decoded in both the forward and backward directions to the beginning and end thereof, and data in which a suffix code that can be decoded in the backward direction is inserted into the coded data for each predetermined synchronization section. A recording medium on which data used for a variable-length encoding / decoding device is recorded.
【請求項28】複数の情報シンボルに対して該情報シン
ボルの生起確率に応じた符号長を有する符号語をそれぞ
れ割り当て、入力された情報シンボルに対応した符号語
を符号化データとして出力する可変長符号化装置で用い
られるプログラムを記録した記録媒体において、 順方向にも逆方向にも復号可能であって、符号語の予め
定められた重みによって符号語の区切りが分かるように
構成された符号語を含む複数の符号語を情報シンボルに
それぞれ対応させた符号語テーブルを格納する手順と、 前記符号語テーブルから前記入力された情報シンボルに
対応する符号語を選択する手順と、 前記符号語を選択する手順により選択された符号語を用
いて所定の同期区間毎に符号化データを作成すると共
に、逆方向に復号可能なスタッフィング符号を挿入する
ことにより前記符号語に同期区間を設定する手順と、 を少なくとも含むプログラムを記録した記録媒体。
28. A variable length code code having a code length corresponding to the occurrence probability of an information symbol is assigned to each of a plurality of information symbols, and a code word corresponding to the input information symbol is output as coded data. A recording medium on which a program used in an encoding device is recorded, wherein the codeword is configured to be decodable in both forward and backward directions, and to be able to identify a codeword delimiter by a predetermined weight of the codeword. Storing a codeword table in which a plurality of codewords each corresponding to an information symbol are included; selecting a codeword corresponding to the input information symbol from the codeword table; and selecting the codeword. A stuffing code that creates encoded data for each predetermined synchronization section using the codeword selected by the Recording medium for recording a program comprising at least, a step of setting the synchronization period to the code word by inserting.
【請求項29】順方向にも逆方向にも復号可能な符号語
を含む符号語で構成された可変長符号からなり、所定の
同期区間毎に逆方向に復号可能なスタッフィング符号が
挿入された符号化データを復号する可変長復号化装置で
用いられるプログラムを記録した記録媒体において、 前記符号化データの同期区間を検出する手順と、 前記手順により検出された同期区間の符号化データを順
方向から復号する手順と、 前記同期区間を検出する手順により検出された同期区間
の符号化データを逆方向から復号する手順と、 を少なくとも含むプログラムを記録した記録媒体。
29. A variable length code composed of codewords including codewords that can be decoded in both the forward and reverse directions, and a stuffing code that can be decoded in the reverse direction is inserted for each predetermined synchronization section. In a recording medium storing a program used in a variable length decoding device for decoding encoded data, a procedure for detecting a synchronous section of the encoded data, and a step of forwardly encoding the encoded data of the synchronous section detected by the procedure. And a decoding step of decoding the encoded data of the synchronization section detected by the step of detecting the synchronization section from the reverse direction.
JP19633299A 1996-09-06 1999-07-09 Variable length coding device Expired - Lifetime JP3819638B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP19633299A JP3819638B2 (en) 1996-09-06 1999-07-09 Variable length coding device

Applications Claiming Priority (7)

Application Number Priority Date Filing Date Title
JP8-236779 1996-09-06
JP23677996 1996-09-06
JP29877996 1996-11-11
JP8-298779 1996-11-11
JP8161497 1997-03-31
JP9-81614 1997-03-31
JP19633299A JP3819638B2 (en) 1996-09-06 1999-07-09 Variable length coding device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP24151497A Division JP3011680B2 (en) 1996-09-06 1997-09-05 Variable length coding apparatus and method

Related Child Applications (2)

Application Number Title Priority Date Filing Date
JP2006022122A Division JP4199240B2 (en) 1996-09-06 2006-01-31 Variable length decoding device and recording medium recording data or program used in this device
JP2006022647A Division JP4131977B2 (en) 1996-09-06 2006-01-31 Variable length decoding device

Publications (2)

Publication Number Publication Date
JP2000036758A true JP2000036758A (en) 2000-02-02
JP3819638B2 JP3819638B2 (en) 2006-09-13

Family

ID=27466597

Family Applications (1)

Application Number Title Priority Date Filing Date
JP19633299A Expired - Lifetime JP3819638B2 (en) 1996-09-06 1999-07-09 Variable length coding device

Country Status (1)

Country Link
JP (1) JP3819638B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5149454B1 (en) * 2012-07-28 2013-02-20 義尚 神山 Recording medium on which YKM format compression program is recorded

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5149454B1 (en) * 2012-07-28 2013-02-20 義尚 神山 Recording medium on which YKM format compression program is recorded

Also Published As

Publication number Publication date
JP3819638B2 (en) 2006-09-13

Similar Documents

Publication Publication Date Title
US6104754A (en) Moving picture coding and/or decoding systems, and variable-length coding and/or decoding system
JP3657971B2 (en) Decoding method and apparatus
JP3762392B2 (en) Video coding method and apparatus
US6704494B1 (en) Moving picture coding and/or decoding systems, and variable-length coding and/or decoding system
JP3011680B2 (en) Variable length coding apparatus and method
JP3275003B2 (en) Computer-readable recording medium for recording data relating to variable-length codes
JP4131977B2 (en) Variable length decoding device
JP2002009626A (en) Recording medium for recording program used for variable length coding/decoding device
JP3217771B2 (en) Computer-readable recording medium recording a program relating to variable-length codes
JP3030028B2 (en) Variable length decoding apparatus and method
JP2000036758A (en) Variable-length encoding and decoding device and recording medium where data or program used by the device is recorded
JP4199240B2 (en) Variable length decoding device and recording medium recording data or program used in this device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040906

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20051128

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20051202

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060131

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060214

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060412

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060428

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060525

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20060609

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20060615

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

Free format text: PAYMENT UNTIL: 20090623

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20100623

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100623

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20110623

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20120623

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120623

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20130623

Year of fee payment: 7

EXPY Cancellation because of completion of term