JP3425143B2 - Data compression method, data decompression method, data compression device, and data decompression device - Google Patents

Data compression method, data decompression method, data compression device, and data decompression device

Info

Publication number
JP3425143B2
JP3425143B2 JP2001402031A JP2001402031A JP3425143B2 JP 3425143 B2 JP3425143 B2 JP 3425143B2 JP 2001402031 A JP2001402031 A JP 2001402031A JP 2001402031 A JP2001402031 A JP 2001402031A JP 3425143 B2 JP3425143 B2 JP 3425143B2
Authority
JP
Japan
Prior art keywords
code
data
context
tree
leaf
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2001402031A
Other languages
Japanese (ja)
Other versions
JP2002232298A (en
Inventor
君孝 村下
佳之 岡田
茂 吉田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2001402031A priority Critical patent/JP3425143B2/en
Publication of JP2002232298A publication Critical patent/JP2002232298A/en
Application granted granted Critical
Publication of JP3425143B2 publication Critical patent/JP3425143B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、データ圧縮方法及
びデータ復元方法並びにデータ圧縮装置及びデータ復元
装置に関する。近年、文字コード、ベクトル情報,画像
など様々な種類のデータがコンピュータで扱われるよう
になっており、扱われるデータ量も急速に増加してきて
いる。これに伴い、大量のデータを扱うときは、データ
の中の冗長な部分を省いてデータ量を圧縮することで、
記憶容量を減らしたり速く伝送したりすることが行なわ
れている。また、様々なデータを一つの方式でデータ圧
縮できる方法としてユニバーサル符号化が提案されてい
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data compression method, a data decompression method, a data compression device and a data decompression device. In recent years, various types of data such as character codes, vector information, and images have been handled by computers, and the amount of data handled has been increasing rapidly. Along with this, when dealing with a large amount of data, by omitting redundant parts in the data and compressing the data amount,
BACKGROUND OF THE INVENTION Reduction of storage capacity and fast transmission are being carried out. Universal coding has been proposed as a method of compressing various data by one method.

【0002】ここで、本発明の分野は文字コードの圧縮
に限らず、様々なデータに適用できるが、以下では情報
理論で用いられている呼称を踏襲し、データの1ワード
単位を文字といい、データが任意ワードつながったもの
を文字列と呼ぶようにする。
Here, the field of the present invention is not limited to compression of character codes, but can be applied to various data. In the following, the word used in information theory is followed, and one word unit of data is called a character. , A string in which data is connected to arbitrary words is called a character string.

【0003】[0003]

【従来の技術】テキストデータやフィアル等を圧縮する
方式には、データ系列の類似性を利用いた辞書型符号化
方式と、データ列の出現頻度を利用した確率統計型符号
化方式(statistical coding) がある。この内、確率統
計型符号化の代表的な手法が、上述のユニバーサル符号
化である。
2. Description of the Related Art As a method for compressing text data, a file, etc., a dictionary type coding method that uses the similarity of data series and a stochastic statistical coding method (statistical coding) that uses the appearance frequency of a data string. There is. Among them, a typical method of probability statistical coding is the above-mentioned universal coding.

【0004】さらに、算術符号化と呼ばれる符号化があ
る。この算術符号化とは、各文字の出現確率に適応した
符号を、符号表をもたずに、計算しながら生成するもの
であり、情報源の文字の出現頻度が分かっている場合に
最大の効率で圧縮できるといわれている方法であり、2
値算術符号化と3値以上の多値算術符号化とがある。
Furthermore, there is a coding called arithmetic coding. This arithmetic coding is to generate a code adapted to the appearance probability of each character while calculating without using a code table. When the appearance frequency of the character of the information source is known, the maximum It is said that it can be compressed efficiently.
There are value arithmetic coding and multi-value arithmetic coding of three or more values.

【0005】以下に、多値算術符号化の方法について述
べる。多値算術符号化では、まず0≦P<1(以下、
〔0,1)と記述する)の数直線を、出現した文字の事
象(以下、シンボルという)の数で分割する。ここで、
各区間の幅はシンボルの出現頻度の比に比例するように
取り、出現頻度が高い順に区間を配置する。
The method of multivalued arithmetic coding will be described below. In multi-valued arithmetic coding, first, 0 ≦ P <1 (hereinafter,
The number line of [0, 1) is divided by the number of occurrences of character events (hereinafter referred to as symbols). here,
The width of each section is taken to be proportional to the ratio of the appearance frequencies of the symbols, and the sections are arranged in descending order of appearance frequency.

【0006】そして、出現したシンボルに対応する区間
を選択し、次のシンボルでは選択した区間をさらに全シ
ンボル数分の区間に分割し対応するシンボルの区間を選
択するという具合に、再帰的に選択した区間を細分す
る。上述の処理について、図70(a),図70(b)
に示す多値算術符号化の原理を説明する図を参照しなが
ら具体的に述べる。
Then, a section corresponding to the symbol that appears is selected, and in the next symbol, the selected section is further divided into sections corresponding to the total number of symbols and the section of the corresponding symbol is selected recursively. Subdivided sections. Regarding the above processing, FIG. 70 (a) and FIG. 70 (b)
A detailed description will be given with reference to a diagram for explaining the principle of multivalued arithmetic coding shown in FIG.

【0007】ここで、図70(a)はシンボルと出現頻
度の一例を示す図、同図70(b)はシンボルの区間分
割の例を示す図である。そして、文字列“abe”の区
間を分割する場合を例にとり、説明を進める。まず、数
直線〔0,1)を、図70(a)で示すような文字a,
b,c,d,eの5つの区間に分割する。
Here, FIG. 70A is a diagram showing an example of symbols and appearance frequencies, and FIG. 70B is a diagram showing an example of section division of symbols. Then, the description will be advanced by taking the case of dividing the section of the character string “abe” as an example. First, the number line [0, 1) is converted into the character a, as shown in FIG.
It is divided into five sections b, c, d, and e.

【0008】そして、最初に出現したシンボル“a”の
区間〔0,0.2)を選択し、この選択した区間〔0,
0.2)を、さらに、全シンボルa〜eの5つの区間に
分割する。次に、第2に出現したシンボル“b”の区間
〔0.04,0.06)を選択し、この区間〔0.0
4,0.06)を、さらに全シンボルa〜eの5つの区
間に分割する。こうして、第3に出現したシンボル
“e”の区間を選択することにより、文字列“abe”
の区間〔0.05,0.06)が得られる。
Then, the section [0, 0.2) of the first appearing symbol "a" is selected, and the selected section [0, 0.2] is selected.
0.2) is further divided into 5 sections of all symbols a to e. Next, the section [0.04, 0.06) of the second appearing symbol “b” is selected, and this section [0.0
4, 0.06) is further divided into five sections of all symbols a to e. Thus, by selecting the section of the symbol "e" that appears third, the character string "abe"
The section [0.05, 0.06) of is obtained.

【0009】このように、全入力データについて、上述
のような処理を繰り返すことで、符号化する文字列の区
間を決定することができ、最終的に定まった文字列の区
間内の任意の点を2進表示で表したものを、圧縮符号と
して出力するのである。「算術符号化」という名称は、
符号語が〔0.11011・・〕のように、2進数の小
数点以下の数値で表現され、それを計算で求められるこ
とからきている。
As described above, by repeating the above-described processing for all input data, the section of the character string to be encoded can be determined, and any point within the finally determined section of the character string can be determined. Is expressed in binary notation and is output as a compression code. The name "arithmetic coding" is
This is because the code word is represented by a numerical value below the decimal point of a binary number such as [0.11011 ...] And can be calculated.

【0010】また、上述のような出現頻度に応じた区間
の分割方法には、文字列の実際の出現頻度によらず、予
め設定した出現頻度に従って区間を分割する静的符号化
方式(static)、最初に全文字列を走査することにより得
られた出現頻度で区間を分割する準適応型符号化方式(s
emi-adaptive) 、又は文字が出現する毎に頻度を再計算
して1文字毎に区間を再設定する適応型符号化方式(ada
ptive)とがある。
In addition, as a method of dividing an interval according to the appearance frequency as described above, a static encoding method (static) that divides an interval according to a preset appearance frequency regardless of the actual appearance frequency of a character string is used. , A semi-adaptive coding method that divides an interval by the appearance frequency obtained by first scanning the entire character string (s
emi-adaptive), or an adaptive coding method (adaptive coding method that recalculates the frequency each time a character appears and resets the interval for each character)
ptive).

【0011】ところで、上述の多値算術符号化をファイ
ル圧縮に用い、バイト(文字)単位にデータを圧縮する
方法は、例えば、以下の2つの文献,に記載されて
いる。 "Arithmetic Coding for Data Compression," Commu
n. of ACM, Vol.30, No.6 PP.520 −540(1986) "An Adaptive Dependency Source Model for Data Co
mpression Scheme," Commun. of ACM, Vol.32 No.1 PP.
77 −83 ここで、文献は、多値算術符号化の具体的なアルゴリ
ズムを開示している。また、この文献での多値算術符
号化は、1文字単位に符号化・圧縮するエントロピー符
号化と呼ばれる方法の一つであり、注目文字の出現確率
を多値算術符号化するとともに、各文字の出現確率をそ
の文字が表れるごとに逐次更新し、種々のデータに動的
に適応して符号化を行なうものである。また、この多値
算術符号化では、詳細には図71(a)のフローチャー
トに示すような処理が行なわれる。
By the way, a method of compressing data in byte (character) units by using the above-described multi-valued arithmetic coding for file compression is described in, for example, the following two documents. "Arithmetic Coding for Data Compression," Commu
n. of ACM, Vol.30, No.6 PP.520 −540 (1986) "An Adaptive Dependency Source Model for Data Co
mpression Scheme, "Commun. of ACM, Vol.32 No.1 PP.
77-83 Here, the literature discloses a specific algorithm of multi-valued arithmetic coding. In addition, the multi-value arithmetic coding in this document is one of the methods called entropy coding that encodes and compresses in units of one character, and multi-value arithmetic coding the appearance probability of the target character The appearance probability is sequentially updated every time the character appears, and is dynamically adapted to various data for encoding. Further, in this multi-valued arithmetic coding, the processing shown in detail in the flowchart of FIG. 71A is performed.

【0012】一方、文献の方法は、注目文字を直前文
字を用いた条件付確率で表し、その条件付確率を多値算
術符号化することで高圧縮率を得る方法を与え、各条件
付確率を逐次更新し、種々のデータに動的に適応して符
号化を行なうものである。この多値算術符号化において
も、図71(b)のフローチャートに示すような処理が
行なわれる。
On the other hand, the method of the literature gives a method of obtaining a high compression rate by expressing the character of interest with a conditional probability using the immediately preceding character, and multi-value arithmetic coding of the conditional probability to give a method of obtaining each conditional probability. Are sequentially updated and are dynamically adapted to various data for encoding. Also in this multi-valued arithmetic coding, the processing as shown in the flowchart of FIG. 71 (b) is performed.

【0013】ここで、多値算術符号化の代わりに、ハフ
マン符号化の変形であるダイナミック・ハフマン符号化
("Variation a Theme by Huffman", IEEE Trans. Info
rm.Theory, Vol.24, No.6 1978, または、"Design and
Analysis of Dynamic Huffman Codes", Journal of AC
M, Vol.34, No.4 1987 参照)を用いる方法も考えられ
るが、このダイナミック・ハフマン符号化は、符号化効
率が多値算術符号化より劣る上、処理に時間がかかるた
め、条件付確率をダイナミック・ハフマン符号化する方
法は実際には使用されていない。
Here, instead of multi-valued arithmetic coding, dynamic Huffman coding ("Variation a Theme by Huffman", IEEE Trans. Info) is a modification of Huffman coding.
rm.Theory, Vol.24, No.6 1978, or "Design and
Analysis of Dynamic Huffman Codes ", Journal of AC
M, Vol.34, No.4 1987) can be considered, but this dynamic Huffman coding is less efficient than multi-valued arithmetic coding and takes a long time to process. The method of dynamic Huffman coding of probabilities is not used in practice.

【0014】なお、図72は、この多値算術符号化・復
号化のアルゴリズムの一例を示す図である。また、算術
符号化とは別にスプレイ(Splay-Tree)符号化方法と呼
ばれるものがある(例えば、文献"Application of Spla
y Tree to Data Compression"DOUGLAS W.JONES著 Commu
n.of ACM,Vol31 No.8 P996-1007 参照) 。
FIG. 72 is a diagram showing an example of this multilevel arithmetic coding / decoding algorithm. In addition to the arithmetic coding, there is a method called a Splay-Tree coding method (see, for example, the document "Application of Spla").
y Tree to Data Compression "by DOUGLAS W. JONES Commu
n.of ACM, Vol31 No.8 P996-1007).

【0015】このスプレイ符号化方法では、図73
(a)に示すような木構造の符号表( 以下、符号木と称
する) を用い、符号木の終端( 一般的に葉、あるいはリ
ーフと呼ばれる)にシンボルを登録し、符号木の頂点
(一般的に根,あるいはルートと呼ばれる)から入力デ
ータが格納されているリーフまでの距離を符号語として
出力する。
In this splay coding method, FIG.
Using a tree-structured code table as shown in (a) (hereinafter referred to as a code tree), symbols are registered at the ends of the code tree (generally called leaves or leaves), and the vertices of the code tree (generally called leaves) are registered. The distance from the root (or root) to the leaf where the input data is stored is output as a code word.

【0016】具体的に述べると、符号語には、ルートか
らリーフへ下るとき、右へ分岐したときは“1”、左へ
分岐したときは“0”を割り当てるのである。つまり、
図73(a)の例では、シンボルAの符号は〔1011
0〕となり、シンボルBの符号は〔001〕となる。そ
して、符号長を変更する(符号更新する)場合は、符号
化したリーフと他のリーフ、あるいは符号木上の接点
(節、あるいはノードと呼ばれる)とを組み替えること
により行なう。
More specifically, the code word is assigned "1" when descending from the root to the leaf, when branching to the right, and "0" when branching to the left. That is,
In the example of FIG. 73A, the code of the symbol A is [1011
0], and the code of the symbol B becomes [001]. When the code length is changed (the code is updated), the coded leaf is replaced with another leaf or a contact (called a node or a node) on the code tree.

【0017】図73(b)に上述の符号更新の例を示
す。この図73(b)に示すように、入力されたデータ
の中に、初めシンボルA,B,C,Dの各符号が符号木
のリーフに格納されている。そして、まずシンボルAと
シンボルCとのノードを組み替え、さらにシンボルAの
上位ノードDとシンボルEとのノードを組み替えること
により、図73(b)に示すように、シンボルAの符号
は、〔10110〕から〔110〕となり符号の更新が
行なわれる。
FIG. 73B shows an example of the above code update. As shown in FIG. 73 (b), the codes of the symbols A, B, C, and D are initially stored in the leaves of the code tree in the input data. Then, first, by changing the nodes of the symbol A and the symbol C, and further changing the nodes of the upper node D and the symbol E of the symbol A, as shown in FIG. 73 (b), the code of the symbol A is [10110 ] To [110] and the code is updated.

【0018】ここで、上述の説明は1文字毎の出現確率
を動的に可変長符号化する場合であるが、さらに、圧縮
率を高めるためには、入力信号と直前の文字との依存関
係を取り入れた条件付き出現確率を動的可変長符号化す
ることで行なわれる。この方法は、データの確率統計的
な性質を用いる確率統計型符号化であり、図74に示す
ように、文脈収集処理511と動的可変長符号化処理5
12との2段階の処理からなる。
The above description is for the case where the appearance probability of each character is dynamically variable-length coded. However, in order to further increase the compression rate, the dependency relationship between the input signal and the immediately preceding character is used. It is performed by dynamically variable-length coding the conditional occurrence probability that incorporates. This method is a probabilistic statistic type encoding that uses the probabilistic statistic property of data, and as shown in FIG. 74, a context collection process 511 and a dynamic variable length encoding process 5
It is composed of two steps of 12 and.

【0019】そして、図75(a)に示すように、文脈
収集により入力データから文字列の前後関係の文脈を収
集し、図75(b)に示すような文脈の木構造を作成
し、条件付き確率を求めて動的可変長符号化する。ここ
で、上述の条件付き確率は、図75(b)に示すような
木構造の文脈木上において、各ノードの文字を通る文字
列が出現する毎に出現回数を計数しておくことによって
求められる。
As shown in FIG. 75 (a), contextual contexts of character strings are collected from the input data by context collection to create a context tree structure as shown in FIG. 75 (b). Dynamic variable-length coding is performed by obtaining the attached probability. Here, the above-mentioned conditional probability is obtained by counting the number of appearances every time a character string passing through a character of each node appears on a context tree having a tree structure as shown in FIG. 75 (b). To be

【0020】ところで、条件付き確率を求める文脈収集
の方法には、主に以下の2つの方法がある。なお、以
下、条件(文脈)の文字数を次数と呼ぶことにする(文
献"Data Compression Using Adaptive Coding and Part
ial String Matching"JOHN G.CLEARY 他著IEEE Vol.COM
-32,No.4 APRIL 1984 P396-402参照) 。 (1)固定次数の文脈収集方法 この方法は、条件付き確率の条件を固定の文字数にする
方法である。
By the way, there are mainly the following two methods of context collection for obtaining conditional probabilities. In the following, the number of characters in the condition (context) will be referred to as the degree (reference "Data Compression Using Adaptive Coding and Part").
ial String Matching "JOHN G. CLEARY et al. IEEE Vol.COM
-32, No. 4 APRIL 1984 P396-402). (1) Fixed Order Context Collection Method This method is a method of setting the condition of conditional probability to a fixed number of characters.

【0021】例えば2次の文脈では、直前2文字につな
がる文字の文脈を収集し、条件付き確率p(y|x1,
x2)を符号化する。ただし、yは注目符号化文字,x
1,x2はそれぞれ直前の第1文字,第2文字である。 (2)Blending文脈収集方法 上述の固定次数の文脈収集方法では、直前の条件文字列
が出にくい場合、条件付き確率の推定は不正確になり、
逆に直前の条件付き文字列が出やすい場合は条件付き確
率の推定は正確になり、さらに次数を上げ得る可能性を
残す。
For example, in the quadratic context, the contexts of the characters connected to the immediately preceding two characters are collected, and the conditional probability p (y | x1,
x2) is encoded. However, y is the coded character of interest, x
1 and x2 are the first character and the second character immediately before, respectively. (2) Blending context collection method In the fixed-order context collection method described above, if the immediately preceding condition character string is difficult to come out, the estimation of the conditional probability becomes inaccurate,
On the contrary, when the immediately preceding conditional character string is likely to appear, the estimation of the conditional probability becomes accurate, and there is a possibility that the order can be further increased.

【0022】一般に、高次の文脈を使うほど文字間の相
関が大きいデータに対しては高圧縮率が得られるが、逆
に高次文脈を使うほど相関が小さくなるデータでは、か
えって圧縮率が悪くなる。これを解決するのが文脈のBl
ending(次数の混合)である。この方法は、直前の次数
を固定せずに出やすい場合には次数を上げ、出にくい場
合には低い次数のままという具合に文脈の次数を入力デ
ータに適応させて伸ばす方法である。
Generally, a higher compression ratio is obtained for data in which the correlation between characters is larger as the higher-order context is used, but conversely, the compression ratio is reduced for data in which the correlation is smaller as the higher-order context is used. become worse. The solution to this is the context Bl
ending (mixed order). This method is a method of adapting the order of the context to the input data such that the order is raised when it is easy to appear without fixing the immediately preceding order, and the order is kept low when it is difficult to come out.

【0023】[0023]

【発明が解決しようとする課題】しかしながら、算術符
号化を動的可変長符号に用いた確率統計型符号化方式に
は、データが入力されてくる度にそれまで入力された全
てのデータの累積頻度を再計算し、〔0,1)の数直線
を再分割するので、複雑で大量な演算処理を必要であ
り、処理の高速化が行なえないという課題がある。
However, in the stochastic statistic coding method using the arithmetic coding for the dynamic variable length code, every time data is input, the accumulation of all the data input up to that time is accumulated. Since the frequency is recalculated and the number line of [0, 1) is redivided, a complicated and large amount of arithmetic processing is required, and there is a problem that the processing cannot be speeded up.

【0024】本発明は、このような課題に鑑み創案され
たもので、算術符号の区間計算の代わりにスプレイ符号
化を適用し、このスプレイ符号化における符号木に新規
データを登録することで、高速な符号登録処理を可能に
してデータ圧縮/復元処理を高速化できるようにした、
データ圧縮方法及びデータ復元方法並びにデータ圧縮装
置及びデータ復元装置を提供することを目的とする。
The present invention was devised in view of the above problems. By applying spray coding instead of interval calculation of arithmetic codes and registering new data in a code tree in this spray coding, Enables high-speed code registration processing and speeds up data compression / decompression processing.
An object of the present invention is to provide a data compression method, a data decompression method, a data compression device, and a data decompression device.

【0025】[0025]

【課題を解決するための手段】このため、本発明のデー
タ圧縮方法は、入力データを過去に出現した履歴に応じ
て符号化して圧縮するデータ圧縮方法において、次のよ
うな過程をとることを特徴としている(請求項1)。 (1)入力データとそれまでに連続したn個のデータか
らなる文脈との組み合わせを登録した文脈木を保持する
文脈木保持過程。 (2)文脈毎に独立した符号木を保持する符号木保持過
程。 (3)の入力データと文脈との組み合わせが文脈木保持
過程に保持されていないとき、文脈木保持過程の文脈木
にデータを新規に登録する文脈木新規登録過程。 (4)入力データと文脈との組み合わせが文脈木保持過
程に保持されていないとき、符号木保持過程の符号木の
データ格納点としてのリーフを分岐して得た新規リーフ
にデータを格納する符号木新規登録過程。 (5)入力データと文脈との組み合わせが文脈木保持過
程に保持されていないとき文脈を変更する文脈変更過
程。 (6)符号木の頂点からの入力データあるいは符号木中
の特定コードが登録してあるリーフまでの分岐に従って
符号を出力する符号出力過程。 (7)入力データあるいは符号木中の特定コードが登録
してあるリーフと他のリーフあるいは符号木の頂点以外
の分岐点として定義されるノードとを取り替える符号長
変更過程。 (8)符号木新規登録過程では、特定コードを登録して
あるリーフを分岐し、得た2つの新規リーフに特定コー
ドと新規データとを登録する過程。
Therefore, in the data compression method of the present invention, the following steps are taken in the data compression method in which the input data is encoded and compressed according to the history that has appeared in the past. It is characterized (Claim 1). (1) A context tree holding process for holding a context tree in which a combination of input data and a context made up of consecutive n data is registered. (2) Code tree holding process for holding an independent code tree for each context. The context tree new registration process of newly registering data in the context tree of the context tree holding process when the combination of the input data and the context of (3) is not held in the context tree holding process. (4) Code for storing data in a new leaf obtained by branching a leaf as a data storage point of a code tree in the code tree holding process when a combination of input data and context is not held in the context tree holding process Tree new registration process. (5) A context changing process for changing the context when the combination of the input data and the context is not held in the context tree holding process. (6) A code output process of outputting a code according to a branch to input data from the top of the code tree or a leaf to which a specific code in the code tree is registered. (7) A code length changing process for replacing a leaf in which a specific code in the input data or the code tree is registered with another leaf or a node defined as a branch point other than the vertex of the code tree. (8) In the code tree new registration process, the leaf in which the specific code is registered is branched, and the specific code and the new data are registered in the obtained two new leaves.

【0026】また、本発明のデータ圧縮方法は、入力デ
ータを過去に出現した履歴に応じて符号化して圧縮する
データ圧縮方法において、次のような過程をとることを
特徴としている(請求項2)。 (1)予め未登録を示すデータとして定義されるエスケ
ープコードを登録した符号木を保持する符号木保持過
程。 (2)入力データとそれまでに連続したn個のデータか
らなる文脈との組み合わせを登録した文脈木を保持する
文脈木保持過程。 (3)入力データと文脈との組み合わせが文脈木保持過
程に保持されていないとき、文脈木保持過程の文脈木に
データを新規に登録する文脈木新規登録過程。 (4)入力データと文脈との組み合わせが文脈木保持過
程に保持されていないとき、符号木保持過程の符号木の
データ格納点としてのリーフを分岐して得た新規リーフ
にデータを格納する符号木新規登録過程。 (5)入力データと文脈との組み合わせが文脈木保持過
程に保持されていないとき文脈を変更する文脈変更過
程。 (6)符号木の頂点からの入力データあるいはエスケー
プコードが登録してあるリーフまでの分岐に従って符号
を出力する符号出力過程。 (7)の入力データあるいはエスケープコードが登録し
てあるリーフと他のリーフあるいは符号木の頂点以外の
分岐点として定義されるノードとを取り替える符号長変
更過程。 (8)符号木新規登録過程では、エスケープコードを登
録してあるリーフを分岐し、得た2つの新規リーフにエ
スケープコードと新規データとを登録する過程。
Further, the data compression method of the present invention is characterized in that the following steps are taken in the data compression method of encoding and compressing the input data according to the history of appearance in the past (claim 2). ). (1) A code tree holding process of holding a code tree in which an escape code defined as data indicating unregistered is registered in advance. (2) A context tree holding process for holding a context tree in which a combination of input data and a context made up of consecutive n data is registered. (3) A context tree new registration process of newly registering data in the context tree of the context tree holding process when the combination of the input data and the context is not held in the context tree holding process. (4) Code for storing data in a new leaf obtained by branching a leaf as a data storage point of a code tree in the code tree holding process when a combination of input data and context is not held in the context tree holding process Tree new registration process. (5) A context changing process for changing the context when the combination of the input data and the context is not held in the context tree holding process. (6) A code output process of outputting a code in accordance with a branch to a leaf in which input data from the top of the code tree or an escape code is registered. (7) A code length changing process for replacing a leaf in which input data or an escape code is registered with another leaf or a node defined as a branch point other than the vertex of the code tree. (8) In the code tree new registration process, the leaf in which the escape code is registered is branched, and the escape code and the new data are registered in the obtained two new leaves.

【0027】さらに、上述の符号木新規登録過程(4)
は、同じ文脈の下にあるリーフのうち、符号木の頂点と
して定義されるルートからの距離が最も長いリーフを分
岐し、得た2つの新規リーフに、分岐したリーフに格納
していたデータと、新規データとを登録するようにとっ
てもよく(請求項3)、同じ文脈の下にあるリーフのう
ち、最後に登録したリーフを分岐し、得た2つの新規リ
ーフに、分岐したリーフに格納していたデータと、新規
データとを登録するようにとってもよい(請求項4)。
Further, the above-mentioned code tree new registration process (4)
Is the leaf that has the longest distance from the root defined as the vertex of the code tree among the leaves under the same context, and the two new leaves obtained are the data stored in the branched leaf. , It is also possible to register new data (Claim 3), of the leaves under the same context, the last registered leaf is branched, and the obtained two new leaves are stored in the branched leaf. The existing data and the new data may be registered (claim 4).

【0028】一方、本発明のデータ復元方法は、入力デ
ータを過去の入力データの履歴に応じて符号化した符号
を復号するデータ復元方法において、次のような過程を
とることを特徴としている(請求項5)。 (1)復号したデータと文脈との組み合わせを登録した
文脈木を保持する文脈木保持過程。 (2)文脈に応じておのおの独立した符号木を保持する
符号木保持過程。 (3)直前までに復号したデータから符号の符号木を決
定する符号木決定過程。 (4)符号に従って符号木の頂点を意味するルートから
データ格納点としてのリーフへと走査して符号を復号す
る復号過程。 (5)到達したリーフが符号木中の特定コードであった
場合、文脈を変更する文脈変更過程。 (6)復号したデータ及び特定コードのリーフを他のリ
ーフあるいは分岐点としてのノードと組み替える符号長
変更過程。 (7)特定コードを復号したとき符号木に復号したデー
タを新規に登録する新規登録過程。 (8)新規登録過程で登録したデータを文脈木保持過程
の文脈木に登録する文脈木登録過程。 (9)新規登録過程では符号化側で分岐に選択したリー
フと同じリーフを分岐して新規データを登録する過程。
On the other hand, the data restoration method of the present invention is characterized by the following steps in the data restoration method of decoding the code obtained by coding the input data according to the history of the past input data ( Claim 5). (1) A context tree holding process for holding a context tree in which a combination of decoded data and a context is registered. (2) Code tree holding process for holding independent code trees depending on the context. (3) Code tree determination process of determining the code tree of the code from the data decoded up to immediately before. (4) A decoding process in which the code is decoded by scanning from the root, which means the vertex of the code tree according to the code, to the leaf as the data storage point. (5) A context changing process of changing the context if the leaf that arrived is a specific code in the code tree. (6) A code length changing process of recombining the leaf of the decoded data and the specific code with another leaf or a node as a branch point. (7) A new registration process of newly registering the decoded data in the code tree when the specific code is decoded. (8) A context tree registration process of registering the data registered in the new registration process in the context tree of the context tree holding process. (9) In the new registration process, the same leaf as the leaf selected for branching on the encoding side is branched and new data is registered.

【0029】さらに、本発明のデータ復元方法は、入力
データを過去の入力データの履歴に応じて符号化した符
号を復号するデータ復元方法において、次のような過程
をとることを特徴としている(請求項6)。 (1)予めデータ未登録を示すデータとして定義される
エスケープコードを登録した符号木を保持する符号木保
持過程。 (2)復号したデータと文脈との組み合わせを登録した
文脈木を保持する文脈木保持過程。 (3)直前までに復号したデータから符号の符号木を決
定する符号木決定過程。 (4)符号に従って符号木の頂点を意味するルートから
データ格納点としてのリーフへと走査して符号を復号す
る復号過程。 (5)到達したリーフがエスケープコードであった場
合、文脈を変更する文脈変更過程。 (6)復号したデータ及びエスケープコードのリーフを
他のリーフあるいは分岐点としてのノードと組み替える
符号長変更過程。 (7)エスケープコードを復号したとき符号木に復号し
たデータを新規に登録する新規登録過程。 (8)新規登録過程で登録したデータを文脈木保持過程
の文脈木に登録する文脈木登録過程。 (9)新規登録過程では符号化側で分岐に選択したリー
フと同じリーフを分岐して新規データを登録する過程。
Further, the data restoration method of the present invention is characterized in that the following steps are taken in the data restoration method of decoding the code obtained by coding the input data according to the history of the past input data ( Claim 6). (1) A code tree holding process of holding a code tree in which an escape code defined as data indicating data unregistered is registered in advance. (2) A context tree holding process for holding a context tree in which a combination of decoded data and a context is registered. (3) Code tree determination process of determining the code tree of the code from the data decoded up to immediately before. (4) A decoding process in which the code is decoded by scanning from the root, which means the vertex of the code tree according to the code, to the leaf as the data storage point. (5) A context change process for changing the context if the leaf that arrived is an escape code. (6) A code length changing process in which the leaf of the decoded data and the escape code is recombined with another leaf or a node as a branch point. (7) A new registration process of newly registering the decoded data in the code tree when the escape code is decoded. (8) A context tree registration process of registering the data registered in the new registration process in the context tree of the context tree holding process. (9) In the new registration process, the same leaf as the leaf selected for branching on the encoding side is branched and new data is registered.

【0030】また、請求項1に記載の本発明のデータ圧
縮方法を実施するための装置の構成を、図9の原理ブロ
ック図に示す。この図9に示すデータ圧縮装置は、入力
データを過去に出現した履歴に応じて符号化するもので
ある。ここで、301は符号木保持手段、302は文脈
木保持手段、303は文脈登録手段、304は符号登録
手段、305は文脈変更手段、306は符号化手段、3
07は符号更新手段である。
The configuration of an apparatus for carrying out the data compression method of the present invention according to claim 1 is shown in the principle block diagram of FIG. The data compression apparatus shown in FIG. 9 encodes the input data according to the history of past appearances. Here, 301 is a code tree holding means, 302 is a context tree holding means, 303 is a context registration means, 304 is a code registration means, 305 is a context changing means, 306 is an encoding means, 3
Reference numeral 07 is a code updating means.

【0031】符号木保持手段301は、予めデータ未登
録を示すデータとして定義されるエスケープコードを登
録した符号木を保持するものであり、文脈木保持手段3
02は、入力データと文脈との組み合わせを登録した文
脈木を保持するものであり、文脈登録手段303は、エ
スケープコードを符号化したのち、文脈木にデータを新
規に登録するものである。
The code tree holding means 301 holds a code tree in which an escape code defined as data indicating data unregistered is registered in advance, and the context tree holding means 3
Reference numeral 02 is for holding a context tree in which a combination of input data and context is registered, and the context registration means 303 is for newly registering data in the context tree after encoding an escape code.

【0032】さらに、符号登録手段304は、エスケー
プコードを符号化したのち符号木のエスケープコードの
データ格納点としてのリーフを分岐してデータを新規に
登録するものであり、文脈変更手段305は、入力デー
タと文脈との組み合わせが文脈木に保持されていないと
き、文脈を変更するものである。また、符号化手段30
6は、符号木の頂点からの入力データあるいはエスケー
プコードが登録してあるリーフまでの分岐に従って符号
を出力するものであり、符号更新手段307は、符号化
したデータ及びエスケープコードが登録してあるリーフ
と他のリーフあるいはノードとを取り替えるものである
(以上、請求項7)。
Further, the code registering means 304 is for registering new data by branching a leaf as a data storage point of the escape code of the code tree after encoding the escape code, and the context changing means 305. When the combination of the input data and the context is not stored in the context tree, the context is changed. Also, the encoding means 30
Reference numeral 6 is for outputting a code in accordance with input data from the apex of the code tree or branching to a leaf in which an escape code is registered, and the code updating means 307 is registered with encoded data and escape code. The leaf is replaced with another leaf or node (above, claim 7).

【0033】また、請求項2に記載の本発明のデータ圧
縮方法を実施するための装置の構成を、図10の原理ブ
ロック図に示す。この図10に示データ圧縮装置も、入
力データを過去に出現した履歴に応じて符号化するもの
である。この図10に示すデータ圧縮装置は、前述の図
9におけるものと同様の符号木保持手段301,文脈木
保持手段302,文脈登録手段303,文脈変更手段3
05,符号化手段306,符号更新手段307をそなえ
ており、これらの説明は省略する。
The configuration of an apparatus for carrying out the data compression method of the present invention according to claim 2 is shown in the principle block diagram of FIG. The data compression apparatus shown in FIG. 10 also encodes the input data according to the history of past appearances. The data compression apparatus shown in FIG. 10 has the same code tree holding means 301, context tree holding means 302, context registration means 303, and context changing means 3 as those in FIG. 9 described above.
05, an encoding unit 306, and a code updating unit 307, and the description thereof will be omitted.

【0034】また、310は分岐位置検索手段であり、
この分岐位置検索手段310は、符号木上の最長の符号
長を持つリーフを検索するものである。311は符号登
録手段であり、この符号登録手段311は、エスケープ
コードを符号化したのち、分岐位置検索手段110に検
索されたデータ格納点としてのリーフを分岐してデータ
を新規に登録するものである(以上、請求項8)。
Further, 310 is a branch position searching means,
The branch position searching means 310 searches for a leaf having the longest code length on the code tree. Reference numeral 311 is a code registration means. This code registration means 311 is for coding the escape code and then branching the leaf as the data storage point searched by the branch position searching means 110 to newly register the data. Yes (above, claim 8).

【0035】さらに、請求項3に記載の本発明のデータ
圧縮方法を実施するための装置の構成を、図11の原理
ブロック図に示す。この図11に示すデータ圧縮装置
も、入力データを過去に出現した履歴に応じて符号化す
るものである。ここで、この図11に示すデータ圧縮装
置においても、前述の図9におけるものと同様の符号木
保持手段301,文脈木保持手段302,文脈登録手段
303,文脈変更手段305,符号化手段306,符号
更新手段307をそなえており、これらの説明は省略す
る。
Further, the configuration of an apparatus for carrying out the data compression method of the present invention according to claim 3 is shown in the principle block diagram of FIG. The data compression apparatus shown in FIG. 11 also encodes the input data according to the history of past appearances. Here, also in the data compression apparatus shown in FIG. 11, the code tree holding means 301, the context tree holding means 302, the context registration means 303, the context changing means 305, the coding means 306, which are similar to those in FIG. The code updating means 307 is provided, and a description thereof will be omitted.

【0036】308は分岐位置保持手段であり、この分
岐位置保持手段308は、符号木に新規に登録されたデ
ータ格納点としてのリーフの位置を保持するものであ
る。さらに、309は符号登録手段であり、この符号登
録手段309は、エスケープコードを符号化したのち、
分岐位置保持手段308に保持されている位置にあるリ
ーフを分岐してデータを新規に登録するものである(以
上、請求項9)。
Reference numeral 308 is a branch position holding means, and this branch position holding means 308 holds the position of a leaf as a data storage point newly registered in the code tree. Further, 309 is a code registration means, and this code registration means 309 encodes the escape code,
The leaf at the position held by the branching position holding means 308 is branched to newly register the data (above, claim 9).

【0037】一方、請求項4に記載の本発明のデータ復
元方法を実施するための装置の構成を、図12の原理ブ
ロック図に示す。この図12に示すデータ復元装置は、
入力データを過去の入力データの履歴に応じて符号化し
た符号を復号するものである。ここで、401は符号木
保持手段、402は文脈木保持手段、403は符号木決
定手段、404は復号手段、405は文脈変更手段、4
06は符号更新手段、407は符号登録手段、408は
文脈木登録手段である。
On the other hand, the configuration of an apparatus for carrying out the data restoration method of the present invention according to claim 4 is shown in the principle block diagram of FIG. The data restoration device shown in FIG.
It is a code for decoding input data, which is encoded according to the history of past input data. Here, 401 is a code tree holding means, 402 is a context tree holding means, 403 is a code tree determining means, 404 is a decoding means, 405 is a context changing means, 4
Reference numeral 06 is a code updating unit, 407 is a code registration unit, and 408 is a context tree registration unit.

【0038】符号木保持手段401は、予めデータ未登
録を示すデータとして定義されるエスケープコードを登
録した符号木を保持するものであり文脈木保持手段40
2は、復号したデータと文脈との組み合わせを登録した
文脈木を保持するものであり、符号木決定手段403
は、直前までに復号したデータから符号の符号木を決定
するものである。
The code tree holding means 401 holds a code tree in which an escape code defined as data indicating data unregistered is registered in advance, and the context tree holding means 40.
Reference numeral 2 holds a context tree in which a combination of the decoded data and the context is registered, and the code tree determining means 403.
Is to determine the code tree of the code from the data decoded up to immediately before.

【0039】さらに、復号手段404は、符号に従って
符号木の頂点を意味するルートからデータ格納点として
のリーフへと走査して符号を復号するものであり、文脈
変更手段405は、到達したリーフがエスケープコード
であった場合、文脈を変更するものであり、符号更新手
段406は、復号したデータ及びエスケープコードのリ
ーフを他のリーフあるいは分岐点としてのノードと組み
替えるものである。
Further, the decoding means 404 decodes the code by scanning from the root, which means the vertices of the code tree, to the leaf as the data storage point according to the code, and the context changing means 405, If it is an escape code, the context is changed, and the code updating means 406 replaces the leaf of the decoded data and escape code with another leaf or a node as a branch point.

【0040】また、符号登録手段407は、エスケープ
コードを復号したとき、エスケープコードのリーフを分
岐して復号したデータを新規に登録するものであり、文
脈木登録手段408は、符号登録手段407で登録した
データを文脈保持手段402の文脈木に登録するもので
ある(以上、請求項10)。
When the escape code is decoded, the code registration means 407 newly branches the decoded data by branching the leaf of the escape code, and the context tree registration means 408 uses the code registration means 407. The registered data is registered in the context tree of the context holding unit 402 (above, claim 10).

【0041】さらに、請求項5に記載の本発明のデータ
復元方法を実施するための装置の構成を、図13の原理
ブロック図に示す。この図13に示すデータ復元装置
も、入力データを過去の入力データの履歴に応じて符号
化した符号を復号するもので、ここで、この図13に示
すデータ復元装置は、前述の図12に示すものと同様の
符号木保持手段401,文脈木保持手段402,符号木
決定手段403,復号手段404,文脈変更手段40
5,符号更新手段406をそなえており、これらの説明
は省略する。
Further, the configuration of an apparatus for carrying out the data restoration method of the present invention according to claim 5 is shown in the principle block diagram of FIG. The data restoration device shown in FIG. 13 also decodes the code obtained by encoding the input data according to the history of past input data. Here, the data restoration device shown in FIG. Code tree holding means 401, context tree holding means 402, code tree determining means 403, decoding means 404, context changing means 40 similar to those shown.
5, the code updating means 406 is provided, and the description thereof will be omitted.

【0042】また、411は分岐位置検索手段であり、
この分岐位置検索手段411は、符号木内の最長の符号
長を持つリーフの位置を検索するものである。そして、
412は符号登録手段であり、この符号登録手段412
は、エスケープコードを符号化したのち分岐位置検索手
段411で検索されたリーフを分岐してデータを新規に
登録するものである。
Reference numeral 411 is a branch position searching means,
The branch position search means 411 searches the position of the leaf having the longest code length in the code tree. And
Reference numeral 412 is a code registration means, and this code registration means 412
Is to encode the escape code and then branch the leaf searched by the branch position searching means 411 to newly register the data.

【0043】さらに、413は文脈木登録手段であり、
この文脈木登録手段413は、符号登録手段412で登
録したデータを文脈木保持手段402の文脈木に登録す
るものである(以上、請求項11)。さらに、請求項6
に記載の本発明のデータ復元方法を実施するための装置
の構成を、図14の原理ブロック図に示す。この図14
に示すデータ復元装置も、入力データを過去の入力デー
タの履歴に応じて符号化した符号を復号するものであ
る。
Further, 413 is a context tree registration means,
The context tree registration means 413 is for registering the data registered by the code registration means 412 in the context tree of the context tree holding means 402 (above, claim 11). Further, claim 6
The principle block diagram of FIG. 14 shows the configuration of an apparatus for carrying out the data restoration method of the present invention described in FIG. This FIG.
The data restoration device shown in (1) also decodes the code obtained by coding the input data according to the history of the past input data.

【0044】ここで、この図14に示すデータ復元装置
においても、前述の図12に示すものと同様の符号木保
持手段401,文脈木保持手段402,符号木決定手段
403,復号手段404,文脈変更手段405,符号更
新手段406をそなえており、これらの説明は省略す
る。また、409は分岐位置保持手段であり、この分岐
位置保持手段409は、符号木に新規に登録されたリー
フの位置を保持するものである。
Here, also in the data restoration device shown in FIG. 14, the code tree holding means 401, the context tree holding means 402, the code tree determining means 403, the decoding means 404, the context similar to those shown in FIG. The changing means 405 and the code updating means 406 are provided, and the description thereof will be omitted. Further, 409 is a branch position holding unit, and this branch position holding unit 409 holds the position of the leaf newly registered in the code tree.

【0045】さらに、410は符号登録手段であり、こ
の符号登録手段410は、エスケープコードを符号化し
たのち、分岐位置保持手段409に保持されている位置
にあるリーフを分岐してデータを新規に登録するもので
ある。414は文脈木登録手段であり、この文脈木登録
手段414は、符号登録手段410で登録したデータを
文脈保持手段402の文脈木に登録するものである(以
上、請求項12)。そして、本発明のデータ圧縮方法
は、次のような作用がある(請求項1)。 (1)文脈木保持過程により、入力データとそれまでに
連続したn個のデータからなる文脈との組み合わせを登
録した文脈木を保持することができる。 (2)符号木保持過程により、文脈毎に独立した符号木
を保持することができる。 (3)文脈木新規登録過程により、入力データと文脈と
の組み合わせが文脈木保持過程に保持されていないと
き、文脈木保持過程の文脈木にデータを新規に登録する
ことができる。 (4)符号木新規登録過程により、入力データと文脈と
の組み合わせが文脈木保持過程に保持されていないと
き、符号木保持過程の符号木のデータ格納点としてのリ
ーフを分岐して得た新規リーフにデータを格納すること
ができる。 (5)文脈変更過程により、入力データと文脈との組み
合わせが文脈木保持過程に保持されていないとき文脈を
変更することができる。 (6)符号出力過程により、符号木の頂点からの入力デ
ータあるいは符号木中の特定コードが登録してあるリー
フまでの分岐に従って符号を出力することができる。 (7)符号長変更過程により、入力データあるいは符号
木中の特定コードが登録してあるリーフと他のリーフあ
るいは符号木の頂点以外の分岐点として定義されるノー
ドとを取り替えることができる。 (8)符号木新規登録過程では、特定コードを登録して
あるリーフを分岐し、得た2つの新規リーフに特定コー
ドと新規データとを登録することができる。
Further, reference numeral 410 is a code registration means. This code registration means 410 encodes the escape code and then branches the leaf at the position held by the branch position holding means 409 to newly write data. It is to register. Reference numeral 414 is a context tree registration means, and this context tree registration means 414 registers the data registered by the code registration means 410 in the context tree of the context holding means 402 (above, claim 12). The data compression method of the present invention has the following effects (claim 1). (1) By the context tree holding process, it is possible to hold a context tree in which a combination of input data and a context consisting of n pieces of continuous data is registered. (2) By the code tree holding process, it is possible to hold an independent code tree for each context. (3) By the context tree new registration process, when the combination of the input data and the context is not held in the context tree holding process, the data can be newly registered in the context tree of the context tree holding process. (4) When the combination of the input data and the context is not held in the context tree holding process by the code tree new registration process, the leaf obtained as a data storage point of the code tree holding process is branched and obtained. Data can be stored in the leaf. (5) The context changing process allows the context to be changed when the combination of the input data and the context is not held in the context tree holding process. (6) By the code output process, the code can be output according to the input data from the vertex of the code tree or the branch to the leaf in which the specific code in the code tree is registered. (7) By the code length changing process, it is possible to replace a leaf in which a specific code in the input data or the code tree is registered with another leaf or a node defined as a branch point other than the vertex of the code tree. (8) In the code tree new registration process, the leaf in which the specific code is registered can be branched, and the specific code and the new data can be registered in the obtained two new leaves.

【0046】さらに、本発明のデータ圧縮方法は、次の
ような作用がある(請求項2)。 (1)符号木保持過程により、予め未登録を示すデータ
として定義されるエスケープコードを登録した符号木を
保持することができる。 (2)文脈木保持過程により、入力データとそれまでに
連続したn個のデータからなる文脈との組み合わせを登
録した文脈木を保持することができる。 (3)文脈木新規登録過程により、入力データと文脈と
の組み合わせが文脈木保持過程に保持されていないと
き、文脈木保持過程の文脈木にデータを新規に登録する
ことができる。 (4)符号木新規登録過程により、入力データと文脈と
の組み合わせが文脈木保持過程に保持されていないと
き、符号木保持過程の符号木のデータ格納点としてのリ
ーフを分岐して得た新規リーフにデータを格納すること
ができる。 (5)文脈変更過程により、入力データと文脈との組み
合わせが文脈木保持過程に保持されていないとき文脈を
変更することができる。 (6)符号出力過程により、符号木の頂点からの入力デ
ータあるいはエスケープコードが登録してあるリーフま
での分岐に従って符号を出力することができる。 (7)符号長変更過程により、入力データあるいはエス
ケープコードが登録してあるリーフと他のリーフあるい
は符号木の頂点以外の分岐点として定義されるノードと
を取り替えることができる。 (8)符号木新規登録過程では、エスケープコードを登
録してあるリーフを分岐し、得た2つの新規リーフにエ
スケープコードと新規データとを登録することができ
る。
Furthermore, the data compression method of the present invention has the following operation (claim 2). (1) By the code tree holding process, it is possible to hold a code tree in which an escape code defined as data indicating unregistered is registered in advance. (2) By the context tree holding process, it is possible to hold the context tree in which the combination of the input data and the context consisting of n pieces of continuous data is registered. (3) By the context tree new registration process, when the combination of the input data and the context is not held in the context tree holding process, the data can be newly registered in the context tree of the context tree holding process. (4) When the combination of the input data and the context is not held in the context tree holding process by the code tree new registration process, the leaf obtained as a data storage point of the code tree holding process is branched and obtained. Data can be stored in the leaf. (5) The context changing process allows the context to be changed when the combination of the input data and the context is not held in the context tree holding process. (6) By the code output process, the code can be output according to the branch to the input data from the vertex of the code tree or the leaf in which the escape code is registered. (7) By the code length changing process, it is possible to replace a leaf in which input data or escape code is registered with another leaf or a node defined as a branch point other than the vertex of the code tree. (8) In the code tree new registration process, the leaf in which the escape code is registered can be branched, and the escape code and the new data can be registered in the obtained two new leaves.

【0047】また、上述の(4)の符号木新規登録過程
では、同じ文脈の下にあるリーフのうち、符号木の頂点
として定義されるルートからの距離が最も長いリーフを
分岐し、得た2つの新規リーフに、分岐したリーフに格
納していたデータと、新規データとを登録することもで
き(請求項3)、同じ文脈の下にあるリーフのうち、最
後に登録したリーフを分岐し、得た2つの新規リーフ
に、分岐したリーフに格納していたデータと、新規デー
タとを登録することもできる(請求項4)。
In the code tree new registration process (4) described above, among leaves under the same context, the leaf having the longest distance from the root defined as the vertex of the code tree is branched and obtained. The data stored in the branched leaf and the new data can be registered in the two new leaves (Claim 3). Of the leaves under the same context, the last registered leaf is branched. The data stored in the branched leaf and the new data can be registered in the obtained two new leaves (claim 4).

【0048】一方、本発明のデータ復元方法は、次のよ
うな作用がある(請求項5)。 (1)文脈木保持過程により、復号したデータと文脈と
の組み合わせを登録した文脈木を保持することができ
る。 (2)符号木保持過程により、文脈に応じておのおの独
立した符号木を保持することができる。 (3)符号木決定過程により、直前までに復号したデー
タから符号の符号木を決定することができる。 (4)復号過程により、符号に従って符号木の頂点を意
味するルートからデータ格納点としてのリーフへと走査
して符号を復号することができる。 (5)文脈変更過程により、到達したリーフが符号木中
の特定コードであった場合、文脈を変更することができ
る。 (6)符号長変更過程により、復号したデータ及び特定
コードのリーフを他のリーフあるいは分岐点としてのノ
ードと組み替えることができる。 (7)新規登録過程により、特定コードを復号したとき
符号木に復号したデータを新規に登録することができ
る。 (8)文脈木登録過程により、新規登録過程で登録した
データを文脈木保持過程の文脈木に登録することができ
る。 (9)新規登録過程では符号化側で分岐に選択したリー
フと同じリーフを分岐して新規データを登録することが
できる。
On the other hand, the data restoration method of the present invention has the following actions (claim 5). (1) By the context tree holding process, it is possible to hold the context tree in which the combination of the decoded data and the context is registered. (2) By the code tree holding process, each independent code tree can be held according to the context. (3) In the code tree determination process, the code tree of the code can be determined from the data decoded up to immediately before. (4) By the decoding process, the code can be decoded by scanning from the root meaning the apex of the code tree to the leaf as the data storage point according to the code. (5) The context can be changed by the context changing process when the leaf that arrived is a specific code in the code tree. (6) By the code length changing process, the decoded data and the leaf of the specific code can be recombined with another leaf or a node as a branch point. (7) By the new registration process, the decoded data can be newly registered in the code tree when the specific code is decoded. (8) By the context tree registration process, the data registered in the new registration process can be registered in the context tree in the context tree holding process. (9) In the new registration process, the same leaf as the leaf selected for branching on the encoding side can be branched to register new data.

【0049】さらに、本発明のデータ復元方法は、次の
ような作用がある(請求項6)。 (1)符号木保持過程により、予めデータ未登録を示す
データとして定義されるエスケープコードを登録した符
号木を保持することができる。 (2)文脈木保持過程により、復号したデータと文脈と
の組み合わせを登録した文脈木を保持することができ
る。 (3)符号木決定過程により、直前までに復号したデー
タから符号の符号木を決定することができる。 (4)復号過程により、符号に従って符号木の頂点を意
味するルートからデータ格納点としてのリーフへと走査
して符号を復号することができる。 (5)文脈変更過程により、到達したリーフがエスケー
プコードであった場合、文脈を変更することができる。 (6)符号長変更過程により、復号したデータ及びエス
ケープコードのリーフを他のリーフあるいは分岐点とし
てのノードと組み替えることができる。 (7)新規登録過程により、エスケープコードを復号し
たとき符号木に復号したデータを新規に登録することが
できる。 (8)文脈木登録過程により、新規登録過程で登録した
データを文脈木保持過程の文脈木に登録することができ
る。 (9)新規登録過程では符号化側で分岐に選択したリー
フと同じリーフを分岐して新規データを登録することが
できる。
Furthermore, the data restoration method of the present invention has the following action (claim 6). (1) By the code tree holding process, it is possible to hold a code tree in which an escape code defined as data indicating data unregistered is registered in advance. (2) By the context tree holding process, it is possible to hold the context tree in which the combination of the decoded data and the context is registered. (3) In the code tree determination process, the code tree of the code can be determined from the data decoded up to immediately before. (4) By the decoding process, the code can be decoded by scanning from the root meaning the apex of the code tree to the leaf as the data storage point according to the code. (5) The context change process allows the context to be changed if the leaf that arrived is an escape code. (6) Through the process of changing the code length, the leaf of the decoded data and the escape code can be recombined with another leaf or a node as a branch point. (7) By the new registration process, the decoded data can be newly registered in the code tree when the escape code is decoded. (8) By the context tree registration process, the data registered in the new registration process can be registered in the context tree in the context tree holding process. (9) In the new registration process, the same leaf as the leaf selected for branching on the encoding side can be branched to register new data.

【0050】また、図9を用いて説明した構成をもつ、
本発明のデータ圧縮方法を実施するための装置、すなわ
ち入力データを過去に出現した履歴に応じて符号化する
データ圧縮装置においては、符号木保持手段301が、
予めデータ未登録を示すデータとして定義されるエスケ
ープコードを登録した符号木を保持し、文脈木保持手段
302が、入力データと文脈との組み合わせを登録した
文脈木を保持する。
Further, it has the configuration described with reference to FIG.
In the device for implementing the data compression method of the present invention, that is, in the data compression device that encodes the input data according to the history that has appeared in the past, the code tree holding unit 301 is
A code tree in which an escape code defined as data indicating unregistered data is registered is held in advance, and a context tree holding unit 302 holds a context tree in which a combination of input data and a context is registered.

【0051】そして、文脈登録手段303が、エスケー
プコードを符号化したのち、文脈木にデータを新規に登
録し、符号登録手段304が、エスケープコードを符号
化したのち符号木のエスケープコードのデータ格納点と
してのリーフを分岐してデータを新規に登録し、文脈変
更手段305が、入力データと文脈との組み合わせが文
脈木に保持されていないとき、文脈を変更する。
Then, the context registration means 303 encodes the escape code, then newly registers the data in the context tree, and the code registration means 304 encodes the escape code and then stores the escape code data of the code tree. The leaf as a point is branched to newly register the data, and the context changing unit 305 changes the context when the combination of the input data and the context is not held in the context tree.

【0052】さらに、符号化手段306が、符号木の頂
点からの入力データあるいはエスケープコードが登録し
てあるリーフまでの分岐に従って符号を出力し、符号更
新手段307が、符号化したデータ及びエスケープコー
ドが登録してあるリーフと他のリーフあるいはノードと
を取り替える(以上、請求項7)。さらに、図10を用
いて説明した構成をもつ、本発明のデータ圧縮方法を実
施するための装置、すなわち入力データを過去に出現し
た履歴に応じて符号化するデータ圧縮装置においては、
符号木保持手段301が、予めデータ未登録を示すデー
タとして定義されるエスケープコードを登録した符号木
を保持し、文脈木保持手段302が、入力データと文脈
との組み合わせを登録した文脈木を保持する。
Further, the coding means 306 outputs a code according to the branch to the input data from the vertex of the code tree or the leaf in which the escape code is registered, and the code updating means 307 outputs the coded data and the escape code. Replace the leaf registered with the other leaf or node (above, claim 7). Furthermore, in the device for implementing the data compression method of the present invention, which has the configuration described with reference to FIG. 10, that is, in the data compression device that encodes the input data according to the history that has appeared in the past,
The code tree holding unit 301 holds a code tree in which an escape code defined as data indicating unregistered data is registered in advance, and the context tree holding unit 302 holds a context tree in which a combination of input data and context is registered. To do.

【0053】そして、文脈登録手段303が、エスケー
プコードを符号化したのち、文脈木にデータを新規に登
録し、分岐位置検索手段310が、符号木上の最長の符
号長を持つリーフを検索し、符号登録手段311が、エ
スケープコードを符号化したのち、分岐位置検索手段3
10に検索されたデータ格納点としてのリーフを分岐し
てデータを新規に登録する。
Then, the context registration means 303 encodes the escape code, then newly registers the data in the context tree, and the branch position search means 310 searches the leaf having the longest code length on the code tree. , Code registration means 311 encodes the escape code, and then branch position search means 3
The leaf as the data storage point retrieved in 10 is branched and new data is registered.

【0054】さらに、文脈変更手段305が、入力デー
タと文脈との組み合わせが文脈木に保持されていないと
き文脈を変更し、符号化手段306が、符号木の頂点か
ら入力データあるいはエスケープコードが登録してある
リーフまでの分岐に従って符号を出力し、符号更新手段
307が、符号化したデータ及びエスケープコードが登
録してあるリーフと他のリーフあるいはノードとを取り
替える(以上、請求項8)。
Further, the context changing means 305 changes the context when the combination of the input data and the context is not held in the context tree, and the encoding means 306 registers the input data or the escape code from the vertex of the code tree. The code is output in accordance with the branch to the existing leaf, and the code updating means 307 replaces the leaf in which the encoded data and the escape code are registered with another leaf or node (above, claim 8).

【0055】また、図11を用いて説明した構成をも
つ、本発明のデータ圧縮方法を実施するための装置、す
なわち入力データを過去に出現した履歴に応じて符号化
するデータ圧縮装置においては、符号木保持手段301
が予めデータ未登録を示すデータとして定義されるエス
ケープコードを登録した符号木を保持し、文脈木保持手
段302が入力データと文脈との組み合わせを登録した
文脈木を保持する。
Further, in the device for carrying out the data compression method of the present invention, which has the configuration described with reference to FIG. 11, that is, in the data compression device for coding the input data according to the history that has appeared in the past, Code tree holding means 301
Holds a code tree in which an escape code defined as data indicating unregistered data is registered in advance, and the context tree holding unit 302 holds a context tree in which a combination of input data and a context is registered.

【0056】そして、文脈登録手段303がエスケープ
コードを符号化したのち、文脈木にデータを新規に登録
し、分岐位置保持手段308が符号木に新規に登録され
たデータ格納点としてのリーフの位置を保持し、符号登
録手段309がエスケープコードを符号化したのち、分
岐位置保持手段308に保持されている位置にあるリー
フを分岐してデータを新規に登録する。
Then, after the context registration means 303 encodes the escape code, the data is newly registered in the context tree, and the branch position holding means 308 is the position of the leaf as the data storage point newly registered in the code tree. And the code registration means 309 encodes the escape code, and then branches the leaf at the position held by the branch position holding means 308 to newly register the data.

【0057】さらに、文脈変更手段305が入力データ
と文脈との組み合わせが文脈木に保持されていないとき
分脈を変更し、符号化手段306が符号木の頂点から入
力データあるいはエスケープコードが登録してあるリー
フまでの分岐に従って符号を出力し、符号更新手段30
7が符号化したデータ及びエスケープコードが登録して
あるリーフと他のリーフあるいは分岐点としてのノード
とを取り替える(以上、請求項9)。
Further, the context changing means 305 changes the branch when the combination of the input data and the context is not held in the context tree, and the encoding means 306 registers the input data or the escape code from the vertex of the code tree. The code is output according to the branch to a certain leaf, and the code updating means 30
The leaf in which the data encoded by 7 and the escape code are registered is replaced with another leaf or a node as a branch point (the above is the ninth aspect).

【0058】一方、図12を用いて説明した構成をも
つ、本発明のデータ復元方法を実施するための装置、す
なわち入力データを過去の入力データの履歴に応じて符
号化した符号を復号するデータ復元装置においては、符
号木保持手段401が予めデータ未登録を示すデータと
して定義されるエスケープコードを登録した符号木を保
持し、文脈保持手段402が復号したデータと文脈との
組み合わせを登録した文脈木を保持し、符号木決定手段
403が直前までに復号したデータから符号の符号木を
決定する。
On the other hand, a device for implementing the data restoration method of the present invention having the structure described with reference to FIG. 12, that is, data for decoding a code obtained by coding input data according to the history of past input data. In the restoration device, the code tree holding unit 401 holds a code tree in which an escape code defined as data indicating unregistered data is held in advance, and the context holding unit 402 registers a combination of the decoded data and the context. The tree is held, and the code tree determining means 403 determines the code tree of the code from the data decoded up to immediately before.

【0059】そして、復号手段404が符号に従って符
号木の頂点を意味するルートからデータ格納点としての
リーフへと走査して符号を復号し、文脈変更手段405
が到達したリーフがエスケープコードであった場合、文
脈を変更する。さらに、符号更新手段406が、復号し
たデータ及びエスケープコードのリーフを他のリーフあ
るいは分岐点としてのノードと組み替え、符号登録手段
407がエスケープコードを復号したとき、エスケープ
コードのリーフを分岐して復号したデータを新規に登録
し、文脈木登録手段408が符号登録手段407で登録
したデータを文脈保持手段402の文脈木に登録する
(請求項10)。
Then, the decoding means 404 decodes the code by scanning from the root meaning the apex of the code tree to the leaf as the data storage point according to the code, and the context changing means 405.
If the leaf reached by is an escape code, change the context. Further, the code updating unit 406 rearranges the decoded data and the escape code leaf with another leaf or a node serving as a branch point, and when the code registration unit 407 decodes the escape code, the escape code leaf is branched and decoded. The newly registered data is newly registered, and the context tree registration unit 408 registers the data registered by the code registration unit 407 in the context tree of the context holding unit 402 (claim 10).

【0060】さらに、図13を用いて説明した構成をも
つ、記載の本発明のデータ復元方法を実施するための装
置、すなわち入力データを過去の入力データの履歴に応
じて符号化した符号を復号するデータ復元装置において
は、符号木保持手段401が予めデータ未登録を示すデ
ータとして定義されるエスケープコードを登録した符号
木を保持し、文脈保持手段402が復号したデータと文
脈との組み合わせを登録した文脈木を保持し、符号木決
定手段403が直前までに復号したデータから符号の符
号木を決定する。
Further, a device for implementing the described data restoration method of the present invention having the structure described with reference to FIG. 13, that is, a code obtained by coding input data according to the history of past input data is decoded. In the data restoration device, the code tree holding unit 401 holds a code tree in which an escape code defined as data indicating unregistered data is registered in advance, and the context holding unit 402 registers a combination of the decoded data and context. The above-mentioned context tree is held, and the code tree determining means 403 determines the code tree of the code from the data decoded up to immediately before.

【0061】そして、復号手段404が符号に従って符
号木の頂点を意味するルートからデータ格納点としての
リーフへと走査して符号を復号し、文脈変更手段405
が、到達したリーフがエスケープコードであった場合、
文脈を変更する。さらに、符号更新手段406が復号し
たデータ及びエスケープコードのリーフを他のリーフあ
るいは分岐点としてのノードと組み替え、分岐位置検索
手段411が符号木内の最長の符号長を持つリーフの位
置を検索し、符号登録手段412が、エスケープコード
を符号化したのち分岐位置検索手段411で検索された
リーフを分岐してデータを新規に登録し、文脈木登録手
段408が符号登録手段412で登録したデータを文脈
保持手段402の文脈木に登録する(以上、請求項1
1)。
Then, the decoding means 404 decodes the code by scanning from the root meaning the apex of the code tree to the leaf as the data storage point according to the code, and the context changing means 405.
But if the leaf reached is an escape code,
Change context. Further, the leaf of the data and escape code decoded by the code updating means 406 is recombined with another leaf or a node as a branch point, and the branch position searching means 411 searches for the position of the leaf having the longest code length in the code tree, The code registration unit 412 branches the leaf searched by the branch position search unit 411 after encoding the escape code and newly registers the data, and the context tree registration unit 408 context-registers the data registered by the code registration unit 412. It is registered in the context tree of the holding means 402 (above, claim 1
1).

【0062】また、図14を用いて説明した構成をも
つ、本発明のデータ復元方法を実施するための装置、す
なわち入力データを過去の入力データの履歴に応じて符
号化した符号を復号するデータ復元装置においては、符
号木保持手段401が予めデータ未登録を示すデータと
して定義されるエスケープコードを登録した符号木を保
持し、文脈保持手段402が、復号したデータと文脈と
の組み合わせを登録した文脈木を保持し、符号木決定手
段403が直前までに復号したデータから符号の符号木
を決定する。
An apparatus for implementing the data restoration method of the present invention having the structure described with reference to FIG. 14, that is, data for decoding a code obtained by coding input data according to the history of past input data. In the decompression device, the code tree holding unit 401 holds a code tree in which an escape code defined as data indicating unregistered data is registered in advance, and the context holding unit 402 registers a combination of decoded data and context. The context tree is held, and the code tree determining unit 403 determines the code tree of the code from the data decoded up to immediately before.

【0063】そして、復号手段404が、符号に従って
符号木の頂点を意味するルートからデータ格納点として
のリーフへと走査して符号を復号し、文脈変更手段40
5が、到達したリーフがエスケープコードであった場
合、文脈を変更し、符号更新手段406が復号したデー
タ及びエスケープコードのリーフを他のリーフあるいは
分岐点としてのノードと組み替え、分岐位置保持手段4
09が符号木に新規に登録されたリーフの位置を保持す
る。
Then, the decoding means 404 scans from the root, which means the vertices of the code tree, to the leaf as the data storage point according to the code, decodes the code, and the context changing means 40.
In the case where the leaf that reached 5 is an escape code, the context is changed, the leaf of the data and escape code decoded by the code updating means 406 is recombined with another leaf or a node as a branch point, and the branch position holding means 4
09 holds the position of the leaf newly registered in the code tree.

【0064】さらに、符号登録手段410がエスケープ
コードを符号化したのち、分岐位置保持手段409に保
持されている位置にあるリーフを分岐してデータを新規
に登録し、文脈木登録手段408が符号登録手段410
で登録したデータを文脈保持手段402の文脈木に登録
する(請求項12)。
Further, after the code registration means 410 encodes the escape code, the leaf at the position held by the branch position holding means 409 is branched to newly register the data, and the context tree registration means 408 makes the code. Registration means 410
The data registered in (4) is registered in the context tree of the context holding unit 402 (claim 12).

【0065】[0065]

【発明の実施の形態】(a)本発明に関連する技術1の
説明 図15は本発明に関連する技術1としてのデータ圧縮装
置とデータ復元装置の構成例を示すブロック図であり、
この図15において、1は入力された文字を過去に出現
した履歴に応じて符号化して圧縮するデータ圧縮装置で
あり、2はデータ圧縮装置1で符号化された文字を復元
するデータ復元装置である。
DESCRIPTION OF THE PREFERRED EMBODIMENTS (a) Description of Technology 1 Related to the Present Invention FIG. 15 is a block diagram showing a configuration example of a data compression apparatus and a data decompression apparatus as Technology 1 related to the present invention.
In FIG. 15, reference numeral 1 is a data compression device that encodes and compresses an input character according to the history of past appearances, and 2 is a data decompression device that decompresses the character encoded by the data compression device 1. is there.

【0066】さらに、データ圧縮装置1は、入力された
文字列データの文脈を収集して文脈木を作成する文脈収
集過程11と、この文脈収集過程11で得られた文脈
(文脈木)に対応してスプレイ符号を対応させた符号木
を、入力データの文字列に応じてスプレイ符号化しなが
ら作成・更新するスプレイ符号化過程12をとるように
なっている。一方、データ復元装置2は、このデータ圧
縮装置1で符号化された復元データの文脈に対応してス
プレイ符号を対応させた符号木を、復元データの文字列
に応じてスプレイ符号化しながら作成・更新するスプレ
イ符号化過程21と、復元データとしての文字列につい
ての文脈を収集(文脈木を作成)する文脈収集過程22
をとるようになっている。
Further, the data compressing apparatus 1 corresponds to the context collecting step 11 for collecting the context of the input character string data to create the context tree, and the context (context tree) obtained in the context collecting step 11. Then, the splay coding process 12 for creating / updating the code tree corresponding to the splay code while performing the splay coding in accordance with the character string of the input data is performed. On the other hand, the data decompression device 2 creates a code tree in which the spray code is associated with the context of the decompressed data encoded by the data compression device 1 while performing the splay coding according to the character string of the decompressed data. A splay coding process 21 for updating and a context collecting process 22 for collecting the context (creating a context tree) about the character string as the restored data.
It is designed to take

【0067】なお、以下では、データ圧縮装置1を符号
化側、データ復元装置2を復元側として説明する。 (1)符号化側の説明 図16(a),(b)は、文脈収集過程11において作
成される文脈木の一例を示す図であり、図16(a)は
文脈木がハッシュ法を用いて短時間で探索できるように
文字列をリスト構造の格納形式でメモリに格納した例を
示す図、図16(b)は文字列を格納した木構造の辞書
(リスト)を親子関係の繋がりで示した図である。
In the following description, the data compression apparatus 1 will be described as the encoding side and the data decompression apparatus 2 will be described as the decompression side. (1) Description of Encoding Side FIGS. 16 (a) and 16 (b) are diagrams showing an example of the context tree created in the context collection process 11. In FIG. 16 (a), the context tree uses the hash method. 16B is a diagram showing an example in which a character string is stored in a memory in a storage structure of a list structure so that it can be searched in a short time. FIG. 16B shows a tree structure dictionary (list) storing the character string in a parent-child relationship. It is the figure shown.

【0068】ここで、図16(a)中のアドレスは16
進表示であり、この図16(a)の例では、文脈木の最
大サイズは4Kノード(4KW)である。このように、
全ての文字を予め登録しておけば、ルートに繋がる第1
階層の兄弟ノードの位置は予め分かるので、探索時にリ
ストを操作する必要はなく、直接アクセスすることがで
きる。
Here, the address in FIG. 16A is 16
In the example of FIG. 16A, the maximum size of the context tree is 4K nodes (4KW). in this way,
If you register all the characters in advance, the first connection to the route
Since the position of the sibling node of the hierarchy is known in advance, it is not necessary to operate the list at the time of searching, and direct access is possible.

【0069】一方、第2階層以降は、子ノードと右兄弟
ノードのアドレスを格納しておき、探索時にリスト形式
で格納文字を照合しながら一致するまで、リストを操作
してアクセスする。また、文脈の木は初期化されたと
き、アドレス100まで設定されるが、このとき第1階
層のアドレス100には、End Of File (EOF)符号
を登録しておき、アドレス101以降のメモリを新規登
録に使用する。
On the other hand, in the second and subsequent hierarchies, the addresses of the child node and the right sibling node are stored, and the list is manipulated and accessed until the stored characters are matched in the list format while matching. Further, when the context tree is initialized, addresses up to 100 are set. At this time, an End Of File (EOF) code is registered in the address 100 of the first layer, and the memory at addresses 101 and later is stored. Used for new registration.

【0070】次に、図17は、上述のスプレイ符号化過
程12において作成される符号木の一例を示す図であ
る。符号木は、基本的に従来のSplay-Tree符号化と同様
に、初期化時に図17のように設定される。そして、図
16(b)に対応して、最大サイズが4Kノード(4K
W)までの場合、符号の木のノードは、内部節点(子ノ
ードが付いている)と外部節点(リーフ、子ノードがな
い各符号の終端)の2つに分類される。
Next, FIG. 17 is a diagram showing an example of a code tree created in the above-mentioned spray coding process 12. The code tree is basically set at the time of initialization as shown in FIG. 17, similarly to the conventional Splay-Tree coding. Then, corresponding to FIG. 16B, the maximum size is 4K nodes (4K
Up to W), the nodes of the code tree are classified into two: internal nodes (with child nodes) and external nodes (leaf, the end of each code without child nodes).

【0071】また、スプレイ符号化では、符号の木をア
クセスするために、図18に示すようなUp,Lef
t,Rightという3つの配列を用いる。ここで、U
p配列は、各ノードから親ノードへのアドレスを格納
し、Left配列は、各ノードから左の子ノードへのア
ドレスを格納し、Right配列は、各ノードから右の
子ノードへのアドレスを格納するものである。
Further, in the splay coding, in order to access the code tree, Up and Lef as shown in FIG. 18 are used.
Three arrays of t and Right are used. Where U
The p array stores the address from each node to the parent node, the Left array stores the address from each node to the left child node, and the Right array stores the address from each node to the right child node. To do.

【0072】また、Up配列では、内部節点を最初の4
KW(アドレス(16進)000〜FFF)に格納し、
外部節点を残りの4KW(アドレス(16進)1000
〜1FFF)に格納するようになっている。このように
することで、文脈木の各ノードに対する符号を、符号木
のアドレス=文脈木のノードポインタ(番号)+4K、
で対応付けることができるようになる。
Further, in the Up array, the internal node is first 4
Store in KW (address (hexadecimal) 000-FFF),
The remaining 4KW of external node (address (hexadecimal) 1000)
~ 1FFF). By doing so, the code for each node of the context tree can be calculated as follows: address of code tree = context tree node pointer (number) + 4K,
You can associate with.

【0073】なお、各配列のビット幅は、Up配列が1
3ビット、Left,Right配列が12ビットとな
る。次に、上述のような構成をもつ符号木の木の更新の
基本操作について、図19(a),(b)を用いて説明
する。図19(a)はスプレイ符号更新の基本操作を示
す図であるが、この図19(a)に示すように、文字A
がアクセスされたとき、ノードAと2段上のノードAが
付いている枝と反対方向の枝のノードCとを入れ換え
る。
The bit width of each array is 1 for Up array.
3 bits, Left, Right array becomes 12 bits. Next, the basic operation for updating the tree of the code tree having the above configuration will be described with reference to FIGS. 19 (a) and 19 (b). FIG. 19A is a diagram showing a basic operation for updating the splay code. As shown in FIG.
When is accessed, the node A and the branch with the node A two steps above are replaced with the node C of the branch in the opposite direction.

【0074】そして、文字A〜Eまでの符号に対して、
文字Cがアクセスされた場合には、例えば図19(b)
に示すように、符号の木を組み換えるようになってい
る。すなわち、上述した基本操作を2回繰り返すことに
よって符号木の木の更新を行なう。この場合、2回目の
基本操作は1回目に更新したノードの親ノードの長さを
更新する。
Then, for the codes of the characters A to E,
When the character C is accessed, for example, FIG.
As shown in, the code tree is adapted to be recombined. That is, the code tree is updated by repeating the above-described basic operation twice. In this case, the second basic operation updates the length of the parent node of the node updated first time.

【0075】これにより、符号の木の深さが深くなって
も、この基本操作を繰り返すことによって、ルートから
アクセスされたノードC(符号0110)までの長さを
1/2(符号10)にすることができるので、ルートか
らアクセスされたノードまでの符号木を動的に組み換え
て、符号表を入力データに適応させることができる。す
なわち、スプレイ符号の符号更新は線型リストの Move-
To-Front操作を Binary-Treeで行なったようなものであ
る。
As a result, even if the depth of the code tree becomes deep, by repeating this basic operation, the length from the root to the accessed node C (reference number 0110) is reduced to 1/2 (reference number 10). Therefore, the code tree from the root to the accessed node can be dynamically recombined to adapt the code table to the input data. In other words, the code update of the splay code is the Move-
It's like doing a To-Front operation on a Binary-Tree.

【0076】さらに、上述のような文脈収集過程11に
おける文脈木の作成およびスプレイ符号化過程12の符
号木の更新・作成の処理を、図20のフローチャートに
おける処理ステップE1〜E31を参照しながら詳述す
る。なお、入力文字をK(Kは任意の文字)とし、文字
Kが入力される直前に入力された文字をP(Pは任意の
文字)とする。
Further, the process of creating the context tree in the context collecting process 11 and updating / creating the code tree in the spray coding process 12 as described above will be described in detail with reference to process steps E1 to E31 in the flowchart of FIG. I will describe. The input character is K (K is an arbitrary character), and the character input immediately before the character K is input is P (P is an arbitrary character).

【0077】まず、文脈木と符号木および直前文字Pを
初期化する(ステップE1)。そして、既に入力された
全文字が入力符号化されているかをチェックし(ステッ
プE2)、入力文字が残っている場合、文字Kの入力
と、文字列の長さLの0へのセットとを行なう(ステッ
プE3)。さらに、文脈木の直前文字Pの下に子ノード
があるかをチェックし(ステップE5)、直前文字Pの
下に子ノードがなければ、入力文字Kの0次符号を出力
し(ステップE6)、文脈木の直前文字Pの下に入力文
字Kを子ノードとして登録する(ステップE7)。
First, the context tree, the code tree and the preceding character P are initialized (step E1). Then, it is checked whether all the characters that have already been input have been input and encoded (step E2). If there are any input characters, the input of the character K and the setting of the length L of the character string to 0 are performed. Perform (step E3). Further, it is checked whether or not there is a child node under the preceding character P in the context tree (step E5), and if there is no child node under the preceding character P, the 0th order code of the input character K is output (step E6). , The input character K is registered as a child node under the character P immediately before the context tree (step E7).

【0078】一方、符号木の方では、直前文字Pの下
に、文字Kとエスケープコードを登録するノードを作成
して文字Kを登録する(ステップE8)。なお、このノ
ード作成のアルゴリズムの一例を図30(a),(b)
に示す。さらに、直前文字を入力文字Kに変更し(ステ
ップE16)、直前文字列の長さL’が最大文字列長L
maxに等しいかをチェックする(ステップE24)。
On the other hand, in the code tree, a node for registering the character K and the escape code is created under the immediately preceding character P and the character K is registered (step E8). An example of the algorithm for creating this node is shown in FIGS.
Shown in. Further, the previous character is changed to the input character K (step E16), and the length L'of the previous character string is the maximum character string length L.
It is checked whether it is equal to max (step E24).

【0079】そして、直前文字列長L’が最大文字列長
Lmaxに等しくなければ、直前文字列が1次符号で符
号化され出力されているかをチェックする(ステップE
25)。ここで、直前文字列が1次符号で符号化されて
いなければ、直前文字列長L’に注目文字列長Lを移し
(ステップE28)、文字Kが符号化済かをチェックし
(ステップE9)、符号化済であれば、上述のステップ
E2からの処理を繰り返し(ステップE9のYESルー
ト)、符号化済でなければ、上述のステップE3からの
処理を繰り返す(ステップE9のNOルート)。
Then, if the immediately preceding character string length L'is not equal to the maximum character string length Lmax, it is checked whether the immediately preceding character string is encoded by the primary code and output (step E).
25). Here, if the immediately preceding character string is not encoded by the primary code, the target character string length L is moved to the immediately preceding character string length L '(step E28), and it is checked whether or not the character K is already encoded (step E9). ), If encoded, the process from step E2 described above is repeated (YES route of step E9), and if not encoded, the process from step E3 described above is repeated (NO route of step E9).

【0080】ところで、上述のステップE10におい
て、子ノードに登録されている文字が入力文字Kと一致
した場合は、文字列の長さLを1増やし(ステップE1
7)、この文字列長Lが、予め設定した最大符号長Lm
axと等しいかをチェックする(ステップE18)。等
しくない場合は、入力データの全文字が符号化されたか
をチェックし(ステップE19)、まだ符号化されてい
ない文字があれば、今までの入力文字を直前文字Pに移
し(ステップE20)、さらに1文字Kを入力して(ス
テップE21)上述のステップE10の処理へ戻り、再
び子ノードに登録されている文字が文字Kと一致するか
をチェックする。
If the character registered in the child node matches the input character K in step E10, the length L of the character string is increased by 1 (step E1).
7), this character string length L is the preset maximum code length Lm
It is checked whether it is equal to ax (step E18). If they are not equal, it is checked whether all the characters of the input data have been encoded (step E19), and if there is a character that has not been encoded yet, the input character so far is moved to the immediately preceding character P (step E20), Further, one character K is input (step E21), the process returns to step E10, and it is again checked whether the character registered in the child node matches the character K.

【0081】一致しなければ、今度は文字列の長さLが
0かどうかをチェックし(ステップE11)、YES、
すなわち、直前文字Pの下に子ノードはあるが、該当す
る文字Kがまだ付いていないなら、直前文字Pの下のエ
スケープコードを出力した後、文字Kの0次符号を出力
する(ステップE12)。さらに、文字Kを、文脈木の
直前文字Pの下の子ノードの兄弟ノードとして登録し
(ステップE13)、符号木の直前文字Pの下のエスケ
ープコードをエスケープコードと文字Kの符号とに分割
して、文字Kの符号を追加し(ステップE14)、符号
木のエスケープコードと0次符号Kの符号長をスプレイ
符号として更新する(ステップE15)。
If they do not match, it is checked whether or not the length L of the character string is 0 (step E11), YES,
That is, if there is a child node under the preceding character P but the corresponding character K is not yet attached, the escape code under the preceding character P is output, and then the 0th order code of the character K is output (step E12). ). Further, the character K is registered as a sibling node of the child node under the character P immediately before the context tree (step E13), and the escape code under the character P immediately before the code tree is divided into the escape code and the code of the character K. Then, the code of the character K is added (step E14), and the escape code of the code tree and the code length of the 0th-order code K are updated as the spray code (step E15).

【0082】以上のようにして、所定の最大文字列長に
達するまで符号化文字列の伸長文字列を登録することが
できるようになっている。その後、上述したステップE
16,ステップE24を経て、再び直前文字列を1次符
号で出力したかをチェックする(ステップE25)。即
ち、直前文字列が1次符号で符号化され、出力されてい
れば、文脈木に直前文字列に符号化文字(列)の先頭文
字を付加した延長文字列を登録し(ステップE26)、
符号木に、符号化した延長文字列の符号を登録し(ステ
ップE27)、上述のステップE28からの処理を繰り
返す。
As described above, the decompressed character string of the encoded character string can be registered until the predetermined maximum character string length is reached. Then, step E described above
After step 16 and step E24, it is checked again whether or not the immediately preceding character string is output by the primary code (step E25). That is, if the preceding character string is encoded by the primary code and is output, the extension character string in which the leading character of the encoded character (string) is added to the preceding character string is registered in the context tree (step E26).
The code of the encoded extended character string is registered in the code tree (step E27), and the processing from step E28 described above is repeated.

【0083】なお、この登録は、直前文字の符号を分岐
させ、文字Kを付加した文字列の1次符号を追加するよ
うに行なう。文字列の分岐は、エスケープコードを符号
化した文字列の符号とみて分岐させ、元の文字列と文字
Kを付加した文字列の符号とを作る。このようにして、
辞書登録文字列として、符号化済の直前文字から登録
し、この直前文字から続く文字列を符号化している。
Note that this registration is performed by branching the code of the immediately preceding character and adding the primary code of the character string to which the character K is added. The branch of the character string is regarded as the code of the character string obtained by encoding the escape code, and is branched to create the original character string and the code of the character string to which the character K is added. In this way
As the dictionary registration character string, the character just before the coded character is registered, and the character string following the character just before is coded.

【0084】さらに、上述のステップE18において、
文字列長Lが、予め設定した最大符号長Lmaxと等し
い場合、または、ステップE11において、文字列長L
が0に等しくない場合は、文脈木の文字(列)の参照番
号に対応する1次符号を出力し(ステップE22)、符
号木が出力した1次符号の符号長をスプレイ符号として
更新(ステップE23)した後、上述のステップE24
からの処理を行なう。
Further, in the above step E18,
When the character string length L is equal to the preset maximum code length Lmax, or in step E11, the character string length L
Is not equal to 0, the primary code corresponding to the reference number of the character (string) of the context tree is output (step E22), and the code length of the primary code output by the code tree is updated as the spray code (step E22). E23) and then the above step E24
Process from.

【0085】ここで、以上の閉ループ処理は、直前文字
Pと入力文字Kとの組み合わせが、既に文脈木に登録さ
れている時に、登録文字数(文字列長)を伸長して、文
字列単位に登録を行なう処理を示している。また、上述
のステップE2において、入力された全ての文字が符号
化されている場合は、文脈木の直前文字Pの下に子ノー
ドがあるかチェックし(ステップE29)、子ノードが
あれば直前文字Pの下のエスケープコードを出力し(ス
テップE29のNOルートからステップE30)、En
d Of Fileを表すEOFの0次符号を出力して
(ステップE31)処理を終了する(ステップE29の
NOルートからステップE31)。
Here, in the closed loop processing described above, when the combination of the immediately preceding character P and the input character K is already registered in the context tree, the number of registered characters (character string length) is expanded and the character string is incremented. The process for performing registration is shown. If all the input characters have been encoded in the above step E2, it is checked whether there is a child node below the preceding character P of the context tree (step E29). Output the escape code under the letter P (from NO route of step E29 to step E30), and
The 0th-order code of EOF representing d Of File is output (step E31), and the process ends (from NO route of step E29 to step E31).

【0086】子ノードがなければ、そのままEOFの0
次符号を出力して処理を終了する。以上のような処理を
行なうことで、入力データとしての文字列を過去に出現
した履歴に応じて符号化して圧縮するデータ圧縮方法に
おいて、辞書に入力データの文字列を収集し番号を付け
て登録するとともに、各文字列に対応してスプレイ符号
の符号化及び更新を施している。
If there is no child node, 0 of EOF
The next code is output and the process ends. By performing the above processing, in the data compression method that encodes and compresses the character string as the input data according to the history that has appeared in the past, the character string of the input data is collected in the dictionary and registered with a number. In addition, the splay code is encoded and updated corresponding to each character string.

【0087】ここで、上述の入力文字Kをアルファベッ
トa,b,cのいずれかに限り、文字「abc abc
ab b」が入力された場合を例にとり、文脈木と符
号木の更新・作成について、図21〜図28を用いてさ
らに詳述する。まず、図21(a),(b)に示すよう
に、文脈木と符号木に、予め文字a,b,cと入力デー
タを全て符号化した後に出力する終端符号EOFとを、
番号を付することによりa1,b2,c3,EOF4として
登録しておく。
Here, if the input character K is limited to one of the alphabets a, b, and c, the character "abc abc
Taking the case where "ab b" is input as an example, the update / creation of the context tree and the code tree will be described in more detail with reference to FIGS. First, as shown in FIGS. 21 (a) and 21 (b), the characters a, b, and c and the terminal code EOF that is output after all input data are encoded in the context tree and the code tree are
It is registered as a 1 , b 2 , c 3 and EOF 4 by adding numbers.

【0088】このように文脈木を初期化することで、最
初に登録してある文字a,b,cのいずれかが直前文字
となり、直前文字から続く文脈がないとき独立の単独の
参照番号も兼ねることになる。以下の説明では、文字c
を最初の直前文字と仮定しておく。一方、図21(b)
に示すように、符号木は、ルート(root)からノー
ドを左下に下がるときには、登録した文字に符号“0”
を割り当て、ノードを右下に下がるときには、登録した
文字に符号“1”を割り当てる2進木であり、これによ
り符号化時は、対応する文字の参照番号のノードからル
ートまでの辿る経路をスタックして、その経路を逆転さ
せ、左下か右下かによって符号“0”,“1”を割り振
ることによって、その文字の参照番号に対応する符号語
が得られるようになっている。
By initializing the context tree in this way, any of the first registered characters a, b, and c becomes the previous character, and when there is no context following the previous character, an independent single reference number is also obtained. I will also serve. In the following description, the letter c
Let be the first previous character. On the other hand, FIG. 21 (b)
As shown in, when the node goes down from the root to the lower left, the code tree has a code "0" for the registered character.
Is a binary tree that assigns the code “1” to the registered character when allocating a node and moving the node down to the lower right, so that when encoding, the path traced from the node with the reference number of the corresponding character to the root is stacked. Then, by reversing the path and assigning the codes "0" and "1" depending on whether it is lower left or lower right, the code word corresponding to the reference number of the character can be obtained.

【0089】すなわち、「a1,b2,c3」の3文字の
0次符号は、それぞれ「00 0110 11」とな
る。そして、上述の図21(a),(b)に示す状態か
ら、まず文字列「abc」が入力されると、予め登録し
ておいた「c」(c3)を直前文字と仮定するので、図
22(a)に示すように、文脈木の「c」(c3)の下
位に新たにノードを作成し、文字列「abc」の内、最
初の1文字「a5」と未登録を表すエスケープコード
(ESC6)とを登録する。
That is, the three-character zero-order code of "a 1 , b 2 , c 3 " is "00 0110 11". Then, the above-described FIG. 21 (a), the from the state shown in (b), when the first character string "abc" is entered, so assuming a previously registered "c" (c 3) the immediately preceding character As shown in FIG. 22A, a new node is created under the context tree “c” (c 3 ) and the first character “a 5 ” in the character string “abc” is not registered. And an escape code (ESC 6 ) that represents

【0090】一方、符号木では、図22(b)に示すよ
うに、「a」が、既に登録されているので、「a」が登
録されているノードと直前文字である「c」の上位ノー
ドとを組み替え、この「c」を新たにルートとおいて
(1次符号化)、「a」とエスケープコード(ESC)
を登録する。さらに、文字列「abc」の内、次のb,
cについても上述の処理を行なうことにより、bが入力
されたときの文脈木と符号木は、それぞれ図23
(a),(b)に示すようになり、cが入力されたとき
の文脈木と符号木は図24(a),(b)に示すように
なる。
On the other hand, in the code tree, as shown in FIG. 22 (b), since "a" has already been registered, the node in which "a" is registered and the upper character of "c" which is the immediately preceding character. Replace the node and set this "c" as a new route (primary coding), and then "a" and escape code (ESC).
To register. Furthermore, in the character string "abc", the next b,
By performing the above-described processing for c as well, the context tree and the code tree when b is input are shown in FIG.
As shown in FIGS. 24A and 24B, the context tree and the code tree when c is input are as shown in FIGS.

【0091】この処理は、図20にて上述した処理ステ
ップにおいて、ステップE5のNOルート,ステップE
24のYESルート,ステップE25のNOルートを経
由する閉ループ処理に相当するものである。すなわち、
文脈木では、直前文字の下位に子ノードが存在しない場
合に、この直前文字の下位に入力文字とエスケープコー
ドを登録するノードを新たに作成して登録を行なう。
This process corresponds to the NO route of step E5 in the process step described above with reference to FIG.
This corresponds to the closed loop processing that goes through the YES route of 24 and the NO route of step E25. That is,
In the context tree, when a child node does not exist under the previous character, a node for registering the input character and the escape code is newly created under the previous character and registered.

【0092】一方、符号木では、過去に登録されている
文字と同じ文字が再び入力された場合は、過去に登録さ
れている文字のノードを、入力された文字の直前文字が
登録されているノードの上位ノードと組み替えて、過去
に登録されている文字のノードを上位に移動し、ルート
からの距離を1/2にして符号長を短くするのである。
On the other hand, in the code tree, when the same character as the character registered in the past is input again, the node of the character registered in the past is registered as the character immediately before the input character. By replacing the node with the upper node of the node and moving the node of the character registered in the past to the upper node, the distance from the root is halved to shorten the code length.

【0093】さらに、続いて文字列「abc」が入力さ
れると、最初に入力された文字列「abc」の最後の
「c」を直前文字として文脈木の「c9」の下位に、文
字列「abc」の内の1文字「a」のみを登録しようと
するが、図24(a)に示すように、文脈木には、既に
「c3」の下位に「a5」が登録されているので、図25
(a)に示すように、登録する文字を1文字「a」から
2文字「ab」へ1文字伸長して「a5」の下位に「b
11」を登録する。
[0093] In addition, followed and by the character string "abc" is input, the lower of the "c 9" in the context tree as just before character last of the "c" of the first input string "abc", character tries to register only one character "a" of the string "abc", as shown in FIG. 24 (a), the context tree, "a 5" is registered already lower "c 3" As shown in FIG.
(A), the "b and 1 letter extended character to be registered from one character" a "2 to the character" ab "to the lower" a 5 "
11 ”is registered.

【0094】この時、符号木では、図25(b)に示す
ように、「c」の下位に「a」とともに登録されている
エスケープコード(ESC)のノードを分岐して新たに
ノードを作成し、文脈木で1文字伸長して登録した「a
b」の登録を行なう。続いて、文字列「abc」の内、
「b」を文脈木に登録しようとした場合も、図25
(a)に示すように、既に「a1」の下位に「b7」が登
録されているので、図26(a)に示すように、登録す
る文字を1文字「b」から2文字「bc」へ1文字伸長
して「b7」の下位に「c12」を登録する。
At this time, in the code tree, as shown in FIG. 25B, a node of the escape code (ESC) registered with "a" under "c" is branched to create a new node. Then, decompress one character in the context tree and register "a
b ”is registered. Then, in the character string "abc",
Even when "b" is registered in the context tree, FIG.
As shown in FIG. 26A, since “b 7 ” is already registered under “a 1 ”, as shown in FIG. 26A, the characters to be registered are from 1 character “b” to 2 characters “ and one character extension to bc "registers" c 12 "in the lower of the" b 7 ".

【0095】この時、符号木では、図26(b)に示す
ように、「a」の下位に「b」とともに登録されていた
エスケープコード(ESC)のノードを分岐して新たに
ノードを作成し、文脈木で1文字伸長して登録した「b
c」の登録を行なう。そして、次の文字列「abc」の
内、最後の「c」を登録する場合も、上述の処理を行な
うと、文脈木及び符号木は、それぞれ図27(a),
(b)に示す状態となる(ここまでで、「abc ab
c」が入力済となる)。
At this time, in the code tree, as shown in FIG. 26B, a node of the escape code (ESC) registered with "b" under "a" is branched to create a new node. Then, "b" registered by decompressing one character in the context tree
"c" is registered. Then, even when the last "c" of the next character string "abc" is registered, when the above process is performed, the context tree and the code tree are respectively shown in FIG.
The state shown in (b) is reached (up to this point, "abc ab
c "is already entered).

【0096】そして、さらに文字列「ab」が入力され
ると文脈木では、まず、直前文字の「c」の下位に1文
字「a」を登録しようとするが、上述したように、「c
3」の下位に既に「a5」が登録されているので、登録文
字数を1文字伸長して「ab」として、「a5」の下位
に「b」を登録しようとする。しかし、図27(a)に
示すように、「a5」の下位にも既に「b11」が登録さ
れているので、図28(a)に示すように、さらに、登
録文字数を1文字伸長して「abb」として、「b11
の下位に「b」を登録する。
When the character string "ab" is further input, the context tree first attempts to register one character "a" below the immediately preceding character "c".
Since the lower of 3 "already" a 5 "is registered, as" ab "by one character extension of the registration number of characters, it tries to register the" b "to the lower of" a 5 ". However, as shown in FIG. 27A, since “b 11 ” is already registered under “a 5 ”, as shown in FIG. 28A, the number of registered characters is further expanded by one character. and as "abb", "b 11"
"B" is registered in the lower order of.

【0097】この時、符号木では、図28(b)に示す
ように、「ab」が登録されているノードを分岐して
「abb」を登録する。この処理は、図20にて上述し
た処理ステップのステップE5のYESルート,ステッ
プE10のYESルート,ステップE25のYESルー
トを経由する閉ループ処理に相当する。
At this time, in the code tree, as shown in FIG. 28B, the node in which "ab" is registered is branched to register "abb". This process corresponds to the closed loop process that goes through the YES route of step E5, the YES route of step E10, and the YES route of step E25 of the process steps described above with reference to FIG.

【0098】すなわち、文字列が入力されたとき、直前
文字と入力された文字列中の1文字との組み合わせが、
既に文脈木に登録されている場合、登録する文字数を1
文字伸長して登録されていない1文字のみ登録する。そ
して、この時、符号木では、直前文字とともに登録され
ているエスケープコード(ESC)のノードを分岐させ
て新たにノードを作成し、この文字列を登録する。
That is, when a character string is input, the combination of the immediately preceding character and one character in the input character string is
If already registered in the context tree, the number of characters to register is 1
Register only one character that has not been registered after decompressing. At this time, in the code tree, the node of the escape code (ESC) registered together with the immediately preceding character is branched to create a new node, and this character string is registered.

【0099】以上のように、文字「abc abc a
b b」の入力が終了すると、各文字に割り当てられる
符号は図29に示すようになる。この図29に示すよう
に、最初に入力された文字「abc」は、それぞれ1文
字単独で符号化され、対応する符号は、それぞれ00,
01,10の2ビットとなる。
As described above, the characters "abc abc a
When the input of "bb" is completed, the codes assigned to the respective characters are as shown in FIG. As shown in FIG. 29, the first input character “abc” is encoded by one character each, and the corresponding codes are 00,
There are 2 bits of 01 and 10.

【0100】そして、次に入力された文字列「abc」
に対応する符号語は、直前文字との関係からそれぞれ
0,0,0の1ビットとなる。さらに、次に入力された
「ab」2文字の文字列に符号が割り当てられるが、こ
の図29に示すように、2文字の文字列が2ビットのみ
の符号語で表されている。
Then, the next input character string "abc"
The code word corresponding to is 1 bit of 0, 0, 0 respectively due to the relationship with the immediately preceding character. Further, a code is assigned to the next input character string of "ab" of 2 characters, but as shown in FIG. 29, the character string of 2 characters is represented by a code word of only 2 bits.

【0101】そして最後に入力された文字「b」は、今
までの直前文字の繋がりに該当する文字がない場合で、
ESCと1文字単独の符号語の組み合わせの3ビットで
表されている。以上のように、関連技術1のデータ圧縮
方法によれば、圧縮する文字(列)を、木構造の文脈木
に番号を付けて登録し、この文脈木に対応した符号木を
スプレイ符号化を施しながら作成・更新することによ
り、出現する文字の出現頻度を求めて確率モデルを構築
し、各文字に符号を割り当てるという2段階の処理を同
時に行なうので、データの圧縮処理の速度が大幅に向上
するという効果がある。
The character "b" input last is the case where there is no character corresponding to the connection of the immediately preceding characters,
It is represented by 3 bits of a combination of ESC and a code word of one character alone. As described above, according to the data compression method of the related technique 1, the characters (strings) to be compressed are registered by assigning numbers to the context tree of the tree structure, and the code tree corresponding to this context tree is spray-encoded. By creating and updating while performing, the probability model is constructed by finding the appearance frequency of the appearing characters, and the two-step process of assigning a code to each character is performed at the same time, so the speed of data compression processing is greatly improved. There is an effect of doing.

【0102】また、上述の確率モデルは、文字の入力毎
に符号木のノードが作成・更新(スプレイ処理)される
ことによって構築されるので、文字の入力毎に既に構築
されている確率モデルを再構築するという膨大な演算処
理を行なう必要が無く、これにより圧縮処理の速度がさ
らに向上する効果がある。さらに、関連技術1のデータ
圧縮方法によれば、過去に圧縮(符号化)した文字と同
じ文字が出現する毎に、過去に登録してあった同じ文字
の符号木のノードを上位のノードと組み替えて(スプレ
イ処理)符号長を1/2にすることにより、同じ文字
(列)が繰り返し出現するほど、その文字(列)の符号
は少ないビット数で表せるので、圧縮効果が大幅に向上
する効果がある。
Since the above-mentioned probability model is constructed by creating / updating (spraying) the node of the code tree for each character input, the probability model already constructed for each character input is used. There is no need to perform a huge amount of arithmetic processing such as reconstruction, which has the effect of further improving the speed of compression processing. Further, according to the data compression method of the related technique 1, every time the same character as the previously compressed (encoded) character appears, the node of the code tree of the same character registered in the past is set as the upper node. By rearranging (spray processing) to reduce the code length to 1/2, as the same character (string) appears repeatedly, the code of that character (string) can be represented with a smaller number of bits, so the compression effect is significantly improved. effective.

【0103】また、関連技術1のデータ圧縮方法によれ
ば、上述の文字列「ab」を符号化した場合のように、
文字を1文字単位に符号化するのではなく、複数文字単
位の文字列として符号化することにより、可変長符号化
処理が高速化できるとともに、符号化単位を文字列とす
るので、情報源が拡大し、スプレイ符号化の符号化効率
が大幅に向上するという効果もある。
Further, according to the data compression method of the related technique 1, as in the case where the above-mentioned character string "ab" is encoded,
By encoding a character as a character string of a plurality of characters instead of encoding it as a character unit, the variable-length encoding process can be speeded up, and the encoding unit is a character string. There is also an effect that the coding efficiency is increased and the coding efficiency of the spray coding is significantly improved.

【0104】(2)復元側の説明 次に、上述のように、符号化(圧縮)されたデータを入
力符号として、図17にて上述したデータ復元装置2内
の文脈収集過程21とスプレイ符号化過程22が、デー
タを復元する処理について、図31のフローチャートに
おける処理ステップD1〜D24を参照しながら説明す
る。
(2) Description of decompression side Next, as described above, using the coded (compressed) data as an input code, the context collection process 21 and the spray code in the data decompression apparatus 2 described in FIG. 17 are described. The conversion process 22 for restoring data will be described with reference to process steps D1 to D24 in the flowchart of FIG.

【0105】なお、このデータを復元する処理は、基本
的に符号化側の説明にて上述した符号化の処理と逆の処
理を行なうようにすればよい。すなわち、まず、文脈木
と符号木とを初期化し、直前文字Pを0に初期化する
(ステップD1)。列長Lを0とし(ステップD2)、
文脈木の直前文字の下位に子ノードがあるかをチェック
する(ステップD3)。
The process of restoring this data may be basically the reverse of the encoding process described in the description of the encoding side. That is, first, the context tree and the code tree are initialized, and the preceding character P is initialized to 0 (step D1). The column length L is set to 0 (step D2),
It is checked whether or not there is a child node below the character just before the context tree (step D3).

【0106】ここで、子ノードがない場合においては、
入力符号を0次符号として文字Kを復号し(ステップD
3のNOルートからステップD4)、この復号した文字
KがEOF符号であるかをチェックする(ステップD
5)。もし、この復号した文字Kが、EOF符号でなけ
れば、NOルートをとり、復号した文字Kを出力し(ス
テップD6)、文脈木に文字Kを登録する(ステップD
7)。なお、これは図17にて上述した符号化時の処理
ステップE7と同様にして行なう。
Here, when there is no child node,
The character K is decoded using the input code as the 0th order code (step D
From the NO route of No. 3, step D4), it is checked whether the decoded character K is an EOF code (step D).
5). If the decoded character K is not an EOF code, the NO route is taken, the decoded character K is output (step D6), and the character K is registered in the context tree (step D).
7). This is performed in the same manner as the processing step E7 at the time of encoding described above with reference to FIG.

【0107】さらに、符号化時のステップE8と同様に
して、符号木の直前文字Pの下に文字Kとエスケープコ
ードのノードを作り(ステップD8)、直前文字Pを文
字Kとおく(ステップD17)。そして、以降の処理ス
テップD20〜D23は、符号化時の処理ステップE2
0〜E23と同様の処理ステップをとり、直前文字列長
L’を注目文字列長Lで置き換えて(ステップD2
4)、上述の処理ステップD2に戻る。
Further, similarly to step E8 at the time of encoding, a node of the character K and the escape code is created under the immediately preceding character P of the code tree (step D8), and the immediately preceding character P is set to the character K (step D17). ). Then, the subsequent processing steps D20 to D23 are processing steps E2 at the time of encoding.
The same processing steps as 0 to E23 are taken, and the immediately preceding character string length L ′ is replaced with the target character string length L (step D2
4) and returns to the above-mentioned processing step D2.

【0108】ところで、上述の処理ステップD3におい
て、文脈木の直前文字Pの下位に子ノードが存在する場
合は、入力された符号を符号木より1次符号とみなして
復号して、文脈木の文字(列)の参照番号を得る(ステ
ップD3のYESルートからステップD9)。さらに、
復号した参照番号がエスケープコードであるかをチェッ
クし(ステップD10)、エスケープコードであれば、
YESルートをとり、入力文字を0次符号として次の符
号を復号して、文字Kを得る(ステップD11)。
By the way, in the above-mentioned processing step D3, when a child node exists immediately below the character P immediately before the context tree, the input code is regarded as a primary code from the code tree, is decoded, and is decoded. The reference number of the character (string) is obtained (from the YES route of step D3 to step D9). further,
It is checked whether the decoded reference number is an escape code (step D10). If it is an escape code,
The YES route is taken, the next character is decoded using the input character as the 0th order code, and the character K is obtained (step D11).

【0109】そして、上述のステップD5と同様に、復
号した文字KがEOF符号であるかをチェックし(ステ
ップD12)、復号した文字KがEOF符号でなけれ
ば、NOルートをとり、文字Kを出力する(ステップD
13)。さらに、符号化時の処理ステップE13〜15
と同様にして、文脈木に文字Kを登録し(ステップD1
4)、直前文字Pの下に文字Kを追加し(ステップD1
5)、符号木のエスケープコードと0次符号Kの符号長
をスプレイ符号として更新する(ステップD16)。
Then, as in step D5 described above, it is checked whether the decoded character K is the EOF code (step D12). If the decoded character K is not the EOF code, the NO route is taken and the character K is set. Output (Step D
13). Furthermore, processing steps E13 to E15 at the time of encoding
Similarly, register the letter K in the context tree (step D1
4) Add the letter K below the immediately preceding letter P (step D1
5) Update the escape length of the code tree and the code length of the 0th-order code K as a splay code (step D16).

【0110】そして、以降は上述のステップD17から
の処理を行なう。このようにして、全ての一文字にスプ
レイ符号を割り当てておき、直前文字から繋がる文字列
が既に収集した辞書中の文字列中にない一文字のスプレ
イ符号を復号したときに、符号を更新し、上述の直前文
字からの繋がる復号した文字を文脈木に登録することが
できる。
Then, the processes from step D17 described above are performed thereafter. In this way, a splay code is assigned to all one character, and when the splay code of one character that is not in the character string in the dictionary in which the character string connected from the preceding character is already collected is decoded, the code is updated. The connected decoded characters from the character immediately before can be registered in the context tree.

【0111】また、上述の処理ステップD10におい
て、復号した参照番号がエスケープコードでなければ、
NOルートをとり、文脈木の参照番号に対応する文字列
を復元して出力し(ステップD18)、文字(列)の最
終文字を直前文字Pに置き換える(ステップD19)。
そして、以降は、上述のステップD20からの処理を行
なう。
If the decoded reference number is not the escape code in the above processing step D10,
Taking the NO route, the character string corresponding to the reference number of the context tree is restored and output (step D18), and the last character of the character (string) is replaced with the immediately preceding character P (step D19).
Then, the processes from step D20 described above are performed thereafter.

【0112】このようにして、辞書登録文字列として、
復号化済の直前文字から登録し、この直前文字から続く
文字列を復号することができる。また、上述の処理ステ
ップD4またはステップD12において、復号した文字
KがEOF符号であれば、YESルートをとり、復元処
理を終了する。以上のようにして、辞書としての文脈木
に復元したデータの文字列を収集し番号を付けて登録す
るとともに、復元各文字列に対応してスプレイ符号を対
応させておき、辞書番号に対応する文字列をスプレイ符
号で復号化及び更新を行ない、また、所定の最大文字列
長に達するまで符号化文字列の伸長文字列を登録し、こ
の伸長文字列に対応するスプレイ符号を登録する。
In this way, as a dictionary registration character string,
It is possible to register from the immediately preceding character that has been decoded and to decode the character string that continues from this immediately preceding character. If the decoded character K is the EOF code in the processing step D4 or step D12 described above, the YES route is taken and the restoration processing is ended. As described above, the character strings of the restored data are collected in the context tree as the dictionary, numbered and registered, and the splay code is made to correspond to each restored character string to correspond to the dictionary number. The character string is decoded and updated with the spray code, and the decompressed character string of the encoded character string is registered until the predetermined maximum character string length is reached, and the spray code corresponding to this decompressed character string is registered.

【0113】これにより、データ圧縮装置1の文脈収集
過程11およびスプレイ符号化過程12により圧縮・符
号化された文字Kを復元している。このように、関連技
術1のデータ復元方法によれば、文脈木に復元した文字
(列)に番号を付けて登録するとともに、この文脈木に
対応した符号表としての符号木を構築することにより、
符号化された文字の符号と一致する符号を符号表におい
て検索し、一致した符号に対応する文字を復号文字とし
て出力するという2段階の処理を同時に行なうので、デ
ータの復元処理の速度が大幅に向上するという効果があ
る。
As a result, the character K compressed and encoded by the context collection process 11 and the spray encoding process 12 of the data compression device 1 is restored. As described above, according to the data restoration method of the related technique 1, the restored characters (strings) are numbered and registered in the context tree, and a code tree as a code table corresponding to the context tree is constructed. ,
Since a code that matches the code of the coded character is searched in the code table and the character corresponding to the code that matches is output as a decoded character at the same time, the speed of data restoration processing is greatly increased. It has the effect of improving.

【0114】また、上述の確率モデルは、文字の復元毎
に符号木のノードが作成・更新(スプレイ処理)される
ことによって構築されるので、文字の復元毎に、既に構
築されている符号表(確率モデル)を再構築するという
膨大な演算処理を行なう必要がなくなり、これにより復
元処理の速度がさらに向上する効果がある。さらに、関
連技術1のデータ復元方法によれば、過去に復号した符
号と同じ符号が出現する毎に、過去に登録してあった同
じ符号の符号木上のノードを上位のノードと組み替えて
(スプレイ処理)符号長を1/2にすることにより、同
じ符号が繰り返し出現するほどその符号は少ないビット
数で表せるので、同じ符号を繰り返し復号する場合、復
元処理の速度が大幅に向上する効果がある。
Further, since the above-mentioned probabilistic model is constructed by creating / updating (spraying) the node of the code tree for each character restoration, the code table already constructed is constructed for each character restoration. There is no need to perform a huge amount of arithmetic processing of reconstructing the (stochastic model), which has the effect of further improving the speed of the restoration processing. Furthermore, according to the data restoration method of Related Technique 1, every time the same code as the code decoded in the past appears, the node in the code tree of the same code registered in the past is recombined with the upper node ( (Spray processing) By reducing the code length to ½, the code can be represented by a smaller number of bits as the same code repeatedly appears. Therefore, when the same code is repeatedly decoded, the speed of the restoration process is significantly improved. is there.

【0115】また、関連技術1のデータ復元方法によれ
ば、文字を1文字単位に復号するのではなく、複数文字
単位の文字列として復号することにより、スプレイ処理
が高速化できるとともに、復号単位を文字列とするの
で、復元できる情報源が拡大し、復元効率が大幅に向上
するという効果もある。なお、上述した例では、直前文
字から繋がる文字列を文脈として収集して符号化・復号
する方法について述べたが、必ずしも直前文字にこだわ
ることはなく2文字以上以前からの文脈を収集して符号
化・復号化してもよい。
Further, according to the data restoration method of the related art 1, by decoding characters as a character string in units of a plurality of characters instead of decoding them in character units, the spray processing can be speeded up and the decoding unit can be improved. Since "" is a character string, there is also an effect that the information source that can be restored is expanded and the restoration efficiency is greatly improved. In the above example, the method of collecting and encoding / decoding a character string connected from the immediately preceding character as a context has been described, but it is not always necessary to focus on the immediately preceding character and the context from two or more characters before is collected and encoded. It may be decrypted.

【0116】また、上述した例では、動的に文脈を収集
してスプレイ処理する例を示したが、必ずしも動的であ
る必要はなく、予め代表的なサンプルから収集した静的
な文脈を用いてスプレイ処理してもよい。さらに、上述
した例では、入力された全てのデータを動的可変長符号
化(スプレイ符号化)する場合について述べたが、相当
程度のデータを符号化した後に、スプレイ符号化の更新
操作を止めて、静的な可変長符号化をしてもよい。この
場合、符号化と復号化とで予め取決めをしておき同期が
取れればよい。
Further, in the above-mentioned example, an example in which the context is dynamically collected and the spray processing is performed is shown. However, the context need not always be dynamic, and a static context previously collected from a representative sample is used. Spray processing may be performed. Further, in the above-described example, the case where all the input data is dynamically variable-length coded (spray coded) has been described. However, after a considerable amount of data is coded, the update operation of the spray coding is stopped. Alternatively, static variable length coding may be performed. In this case, it suffices that an agreement be made in advance for encoding and decoding and synchronization be achieved.

【0117】また、上述した例では、圧縮するデータを
文字あるいは文字列として説明したが、関連技術1のデ
ータ圧縮方法及びデータ復元方法は、他の画像データや
音声データなどあらゆるデータに対して適用できる。 (b)本発明に関連する技術2の説明 次に、本発明に関連する技術2(以下、関連技術2とい
う)について説明するが、まず、その原理について説明
する。
Further, in the above-mentioned example, the data to be compressed is described as a character or a character string, but the data compression method and the data decompression method of the related technique 1 are applied to all data such as other image data and audio data. it can. (B) Description of Technology 2 Related to the Present Invention Next, technology 2 related to the present invention (hereinafter referred to as related technology 2) will be described. First, its principle will be described.

【0118】関連技術2に係るデータ圧縮方法を実施す
るための装置の構成を、図1に示す。この図1に示すデ
ータ圧縮装置は、入力データを過去に出現した履歴に応
じて符号化して圧縮するものである。ここで、100は
前置データ保持手段、101は履歴保持手段、102は
符号木保持手段、103は符号木決定手段、104は符
号出力手段、105は符号長変更手段、106は前置デ
ータ更新手段である。
FIG. 1 shows the configuration of an apparatus for carrying out the data compression method according to Related Technique 2. The data compression apparatus shown in FIG. 1 encodes and compresses input data according to the history of past appearances. Here, 100 is prefix data holding means, 101 is history holding means, 102 is code tree holding means, 103 is code tree determining means, 104 is code output means, 105 is code length changing means, and 106 is prefix data updating. It is a means.

【0119】前置データ保持手段100は、入力データ
の直前までに入力されたn個の入力データからなる文脈
を保持するものであり、履歴保持手段101は、入力デ
ータと文脈との組み合わせを保持するものであり、符号
木保持手段102は、文脈毎に独立した符号木を保持す
るものである。また、符号木決定手段103は、前置デ
ータ保持手段100に保持されている直前までの入力デ
ータからデータの符号木を決定するものであり、符号出
力手段104は、符号木決定手段103で選択した符号
木の頂点を意味するルートからデータが格納されている
リーフに沿って途中に位置する分岐点としてのノードか
らの分岐に従って固有のデータを出力するものである。
The prefix data holding means 100 holds a context consisting of n pieces of input data input up to immediately before the input data, and the history holding means 101 holds a combination of the input data and the context. The code tree holding unit 102 holds an independent code tree for each context. Further, the code tree determining means 103 determines a code tree of data from the input data up to immediately before held in the prefix data holding means 100, and the code output means 104 is selected by the code tree determining means 103. The unique data is output according to a branch from a node as a branch point located midway along the leaf in which the data is stored, from the root meaning the apex of the code tree.

【0120】さらに、符号長変更手段105は、符号化
したリーフと他のリーフあるいはノードとを組み替える
ものであり、前置データ更新手段106は、データを前
置データ保持手段100に登録するものである。また、
関連技術2に係る他のデータ圧縮方法を実施するための
装置の構成を、図2に示す。この図2に示すデータ圧縮
装置も、入力データを過去に出現した履歴に応じて符号
化して圧縮するものである。
Further, the code length changing means 105 is for recombining the encoded leaf with another leaf or node, and the prefix data updating means 106 is for registering the data in the prefix data holding means 100. is there. Also,
FIG. 2 shows the configuration of an apparatus for carrying out another data compression method according to Related Technique 2. The data compression apparatus shown in FIG. 2 also encodes and compresses input data according to the history of past appearances.

【0121】ここで、100は前置データ保持手段、1
01は履歴保持手段、103は符号木決定手段、107
は符号木決定手段である。さらに、108は文脈判別手
段、109はエスケープコード出力手段、110は文脈
変更手段、111は符号出力手段、116は制御手段で
ある。前置データ保持手段100は、入力データの直前
までに入力されたn個の入力データからなる文脈を保持
するものであり、履歴保持手段101は、入力データと
文脈との組み合わせを保持するものであり、符号木保持
手段107は、データ未登録を示すデータとして定義さ
れるエスケープコードをあらかじめ登録した文脈毎に独
立した符号木を保持するものである。
Here, 100 is a front data holding means, 1
01 is history holding means, 103 is code tree determining means, 107
Is a code tree determining means. Further, 108 is a context discrimination means, 109 is an escape code output means, 110 is a context change means, 111 is a code output means, and 116 is a control means. The pre-data holding means 100 holds the context consisting of n pieces of input data input just before the input data, and the history holding means 101 holds the combination of the input data and the context. The code tree holding unit 107 holds an independent code tree for each context in which an escape code defined as data indicating unregistered data is registered in advance.

【0122】また、符号木決定手段103は、文脈と入
力データからデータの符号木を決定するものであり、文
脈判別手段108は、符号木決定手段103で決定した
符号木にデータが登録されているか否かを判別するもの
であり、エスケープコード出力手段109は、符号木に
データが登録されていないときは符号木の頂点を意味す
るルートからエスケープコードのデータ格納点としての
リーフまでの途中に位置する分岐点としてのノードから
の分岐に従ってエスケープコードを出力するものであ
る。
The code tree determining means 103 determines a code tree of data from the context and the input data. The context determining means 108 registers the data in the code tree determined by the code tree determining means 103. The escape code output means 109 determines whether or not there is any data registered in the code tree from the root, which means the top of the code tree, to the leaf as the data storage point of the escape code. The escape code is output according to the branch from the node serving as the branch point.

【0123】さらに、文脈変更手段110は、符号木に
データが登録されていないときは文脈の長さnを短くす
るものであり、符号出力手段111は、符号木にデータ
が登録されているときは符号木のルートからデータのリ
ーフまでの途中に位置するノードからの分岐に従ってデ
ータの符号を出力するものである。また、符号長変更手
段105は、符号化したリーフと他のリーフあるいはノ
ードとを組み換えるものであり、前置データ更新手段1
06は、データを前置データ保持手段100に登録する
ものであり、制御手段116は、エスケープコードを符
号化したときはデータの符号化を行なうまで処理を繰り
返すものである。
Further, the context changing means 110 shortens the length n of the context when no data is registered in the code tree, and the code output means 111 when the data is registered in the code tree. Is to output the code of the data according to the branch from the node located on the way from the root of the code tree to the leaf of the data. The code length changing means 105 is a means for recombining the coded leaf and another leaf or node, and the prefix data updating means 1 is used.
Reference numeral 06 is for registering the data in the front data holding means 100, and when the control means 116 encodes the escape code, it repeats the processing until the data is encoded.

【0124】また、関連技術2に係るさらに他のデータ
圧縮方法を実施するための装置の構成を、図3に示す。
この図3に示すデータ圧縮装置も、入力データを過去に
出現した履歴に応じて符号化して圧縮するものである。
ここで、100は前置データ保持手段、101は履歴保
持手段、103は符号木決定手段、105は符号長変更
手段、106は前置データ更新手段、107は符号木保
持手段、108は文脈判別手段、109はエスケープコ
ード出力手段、110は文脈変更手段、111は符号出
力手段、112は履歴登録手段、113は符号登録手
段、116は制御手段である。
FIG. 3 shows the configuration of an apparatus for implementing still another data compression method according to Related Technique 2.
The data compression apparatus shown in FIG. 3 also encodes and compresses input data according to the history of past appearances.
Here, 100 is a prefix data holding unit, 101 is a history holding unit, 103 is a code tree determining unit, 105 is a code length changing unit, 106 is a prefix data updating unit, 107 is a code tree holding unit, and 108 is context discrimination. Means, 109 is an escape code output means, 110 is a context changing means, 111 is a code output means, 112 is a history registration means, 113 is a code registration means, and 116 is a control means.

【0125】前置データ保持手段100は、入力データ
の直前までに入力されたn個の入力データからなる文脈
を保持するものであり、履歴保持手段101は、入力デ
ータと文脈との組み合わせを保持するものであり、符号
木保持手段107は、データ未登録を示すデータとして
定義されるエスケープコードを予め登録した文脈毎に独
立した符号木を保持するものである。
The prefix data holding means 100 holds the context consisting of n pieces of input data input up to immediately before the input data, and the history holding means 101 holds the combination of the input data and the context. The code tree holding means 107 holds an independent code tree for each context in which an escape code defined as data indicating unregistered data is registered in advance.

【0126】また、符号木決定手段103は、文脈と入
力データからデータの符号木を決定するものであり、文
脈判別手段108は、符号木決定手段103で決定した
符号木にデータが登録されているか否かを判別するもの
である。さらに、エスケープコード出力手段109は、
符号木にデータが登録されていないときは符号木の頂点
を意味するルートからエスケープコードのデータ格納点
としてのリーフまでの中に位置する分岐点としてのノー
ドからの分岐に従ってエスケープコードを出力するもの
である。
Further, the code tree determining means 103 determines the code tree of data from the context and the input data, and the context determining means 108 registers the data in the code tree determined by the code tree determining means 103. It is to determine whether or not there is. Further, the escape code output means 109
When data is not registered in the code tree, the escape code is output according to the branch from the node as the branch point located between the root that means the vertex of the code tree and the leaf as the data storage point of the escape code. Is.

【0127】また、履歴登録手段112は、符号木にデ
ータが登録されていないときは履歴保持手段101にデ
ータと文脈の組み合わせを登録するものであり、符号登
録手段113は、符号木にデータが登録されていないと
きは符号木にデータを新規に登録するものであり、文脈
変更手段110は、符号木にデータが登録されていない
ときは文脈の長さnを短くするものである。
Further, the history registration means 112 registers the combination of the data and the context in the history holding means 101 when the data is not registered in the code tree, and the code registration means 113 stores the data in the code tree. When the data is not registered, the data is newly registered in the code tree, and the context changing unit 110 shortens the context length n when the data is not registered in the code tree.

【0128】さらに、符号出力手段111は、符号木に
データが登録されているときは符号木のルートからデー
タのリーフまでの途中に位置するノードからの分岐に従
ってデータの符号を出力するものであり、符号長変更手
段105は、符号化したリーフと他のリーフあるいはノ
ードとを組み換えるものである。また、前置データ更新
手段106は、データを前置データ保持手段100に登
録するものであり、制御手段116は、エスケープコー
ドを符号化したときはデータの符号化を行なうまで処理
を繰り返すものである。
Further, the code output means 111 outputs the code of the data according to the branch from the node located on the way from the root of the code tree to the leaf of the data when the data is registered in the code tree. The code length changing unit 105 recombines the encoded leaf and another leaf or node. Further, the prefix data update means 106 registers the data in the prefix data holding means 100, and the control means 116 repeats the process until the data is coded when the escape code is coded. is there.

【0129】さらに、関連技術2に係るさらに他のデー
タ圧縮方法を実施するための装置の構成を、図4に示
す。この図4に示すデータ圧縮装置も、入力データを過
去に出現した履歴に応じて符号化して圧縮するものであ
る。ここで、100は前置データ保持手段、101は履
歴保持手段、103は符号木決定手段、105は符号長
変更手段、106は前置データ更新手段、107は符号
木保持手段、108は文脈判別手段、109および11
1はエスケープコード出力手段、110は文脈変更手
段、114は履歴登録手段、115は符号登録手段、1
17は制御手段である。
Further, FIG. 4 shows the configuration of an apparatus for implementing still another data compression method according to Related Technique 2. The data compression apparatus shown in FIG. 4 also encodes and compresses the input data according to the history of past appearances. Here, 100 is a prefix data holding unit, 101 is a history holding unit, 103 is a code tree determining unit, 105 is a code length changing unit, 106 is a prefix data updating unit, 107 is a code tree holding unit, and 108 is context discrimination. Means, 109 and 11
1 is an escape code output means, 110 is a context changing means, 114 is a history registration means, 115 is a code registration means, 1
Reference numeral 17 is a control means.

【0130】前置データ保持手段100は、入力データ
の直前までに入力されたn個の入力データからなる文脈
を保持するものであり、履歴保持手段101は、入力デ
ータと文脈との組み合わせを保持するものであり、符号
木保持手段107は、データ未登録を示すデータとして
定義されるエスケープコードをあらかじめ登録した文脈
毎に独立した符号木を保持するものである。
The prefix data holding means 100 holds the context consisting of n pieces of input data input up to immediately before the input data, and the history holding means 101 holds the combination of the input data and the context. The code tree holding unit 107 holds an independent code tree for each context in which an escape code defined as data indicating unregistered data is registered in advance.

【0131】また、符号木決定手段103は、文脈と入
力データからデータの符号木を決定するものであり、文
脈判別手段108は、符号木決定手段103で決定した
符号木にデータが登録されているか否かを判別するもの
である。さらに、エスケープコード出力手段109は、
符号木にデータが登録されていないときは符号木の頂点
を意味するルートからエスケープコードのデータ格納点
としてのリーフまでの途中に位置する分岐点としてのノ
ードからの分岐に従ってエスケープコードを出力するも
のである。
The code tree determining means 103 determines a code tree of data from the context and the input data. The context determining means 108 registers the data in the code tree determined by the code tree determining means 103. It is to determine whether or not there is. Further, the escape code output means 109
When data is not registered in the code tree, the escape code is output according to the branch from the node that is located on the way from the root that means the vertex of the code tree to the leaf that is the data storage point of the escape code. Is.

【0132】また、文脈変更手段110は、符号木にデ
ータが登録されていないときは文脈の長さnを短くする
ものであり、エスケープコード出力手段111は、符号
木にデータが登録されているときは符号木のルートから
データのリーフまでの途中に位置するノードからの分岐
にしたがってデータの符号を出力するものである。さら
に、履歴登録手段114は、履歴保持手段101にデー
タと文脈の組み合わせを登録するものであり、符号登録
手段115は、符号木にデータを新規に登録するもので
あり、符号長変更手段105は、符号化したリーフと他
のリーフあるいはノードとを組み換えるものであり、前
置データ更新手段106は、データを前置データ保持手
段100に登録するものである。
The context changing means 110 shortens the context length n when no data is registered in the code tree, and the escape code output means 111 registers data in the code tree. In this case, the code of the data is output according to the branch from the node located on the way from the root of the code tree to the leaf of the data. Further, the history registration means 114 is for registering a combination of data and context in the history holding means 101, the code registration means 115 is for newly registering data in the code tree, and the code length changing means 105 is for , The encoded leaf and another leaf or node are recombined, and the prefix data updating means 106 registers the data in the prefix data holding means 100.

【0133】また、制御手段117は、データの符号化
時に一度でもエスケープコードを符号化したときは、デ
ータの符号化の直前の文脈とデータとの組み合わせを履
歴登録手段114で履歴保持手段101に登録し、デー
タの符号化の直前に符号化したエスケープコードを持つ
符号木に符号登録手段115でデータを新規に登録する
ものである。
Further, when the escape code is encoded even once at the time of encoding the data, the control means 117 causes the history registration means 114 to store the combination of the context and the data immediately before the data encoding to the history holding means 101. The data is newly registered in the code tree having the escape code that is registered and encoded immediately before the data is encoded.

【0134】一方、関連技術2に係るデータ復元方法を
実施するための装置の構成を、図5に示す。この図5に
示すデータ復元装置は、過去に出現した履歴に応じて符
号化した符号を復号するものである。ここで、200は
前置データ保持手段、201は履歴保持手段、202は
符号木保持手段、203は符号木決定手段、204は復
号手段、205は符号長変更手段、206は前置データ
更新手段である。
On the other hand, FIG. 5 shows the configuration of an apparatus for carrying out the data restoration method according to Related Technique 2. The data restoration device shown in FIG. 5 decodes a code that has been encoded according to a history that has appeared in the past. Here, 200 is a prefix data holding means, 201 is a history holding means, 202 is a code tree holding means, 203 is a code tree determining means, 204 is a decoding means, 205 is a code length changing means, and 206 is a prefix data updating means. Is.

【0135】前置データ保持手段200は、過去に復号
したn個のデータを保持するものであり、履歴保持手段
201は、復号したデータと文脈との組み合わせを保持
するものであり、符号木保持手段202は、文脈毎に独
立した符号木を保持するものである。また、符号木決定
手段203は、前置データ保持手段200に保持されて
いる文脈からデータを復号するための符号木を決定する
ものであり、復号手段204は、符号に従って符号木決
定手段203で選択した符号木の頂点を意味するルート
から分岐点としてのノードを走査して到達したデータ格
納点としてのリーフに格納されているデータを出力する
ものである。
The prefix data holding means 200 holds n pieces of data decoded in the past, and the history holding means 201 holds a combination of the decoded data and the context, and holds the code tree. The means 202 holds an independent code tree for each context. Further, the code tree determining means 203 determines a code tree for decoding data from the context held in the prefix data holding means 200, and the decoding means 204 uses the code tree determining means 203 according to the code. The data stored in the leaf as the data storage point reached by scanning the node as the branch point from the root meaning the apex of the selected code tree is output.

【0136】さらに、符号長変更手段205は、復号し
たリーフと他のリーフあるいはノードとを組み替えるも
のであり、前置データ更新手段206は、復号したデー
タを前置データ保持手段200に登録するものである。
また、関連技術2に係る他のデータ復元方法を実施する
ための装置の構成を、図6に示す。この図6に示すデー
タ復元装置も、過去に出現した履歴に応じて符号化した
符号を復号するものである。
Further, the code length changing means 205 recombines the decoded leaf with another leaf or node, and the prefix data updating means 206 registers the decoded data in the prefix data holding means 200. Is.
Further, FIG. 6 shows a configuration of an apparatus for implementing another data restoration method according to Related Technique 2. The data restoration device shown in FIG. 6 also decodes a code that has been encoded according to a history that has appeared in the past.

【0137】ここで、200は前置データ保持手段、2
01は履歴保持手段、203は符号木決定手段、204
は復号手段、205は符号長変更手段、206は前置デ
ータ更新手段、207は符号木保持手段、208は文脈
変更手段、213は制御手段である。前置データ保持手
段200は、過去に復号したn個のデータを保持するも
のであり、履歴保持手段201は、復号したデータと文
脈との組み合わせを保持するものであり、符号木保持手
段207は、データ未登録を示すデータとして定義され
るエスケープコードをあらかじめ登録した符号木を保持
するものである。
Here, 200 is the front data holding means, 2
01 is history holding means, 203 is code tree determining means, and 204
Is a decoding unit, 205 is a code length changing unit, 206 is a prefix data updating unit, 207 is a code tree holding unit, 208 is a context changing unit, and 213 is a control unit. The prefix data holding unit 200 holds n pieces of data decoded in the past, the history holding unit 201 holds a combination of the decoded data and the context, and the code tree holding unit 207. , Holds a code tree in which escape codes defined as data indicating unregistered data are registered in advance.

【0138】また、符号木決定手段203は、前置デー
タ保持手段200に保持されている文脈からデータを復
号するための符号木を決定するものであり、復号手段2
04は、符号に従って符号木決定手段203で選択した
符号木の頂点を意味するルートから分岐点としてのノー
ドを走査して到達したデータ格納点としてのリーフに格
納されているデータを出力するものである。
The code tree determining means 203 determines a code tree for decoding data from the context held in the prefix data holding means 200, and the decoding means 2
Reference numeral 04 is for outputting the data stored in the leaf as the data storage point reached by scanning the node as the branch point from the root that means the vertex of the code tree selected by the code tree determination means 203 according to the code. is there.

【0139】さらに、符号長変更手段205は、復号し
たリーフと他のリーフあるいはノードとを組み替えるも
のであり、文脈変更手段208は−出力したデータがエ
スケープコードであったときデータを棄却し文脈を短く
するものであり、前置データ更新手段206は、復号し
たデータを前置データ保持手段200に登録するもので
ある。
Further, the code length changing means 205 is for recombining the decoded leaf with another leaf or node, and the context changing means 208 is-when the output data is an escape code, discards the data and sets the context. The prefix data updating unit 206 registers the decrypted data in the prefix data holding unit 200.

【0140】制御手段213は、エスケープコードを復
号した時は文脈変更手段208で文脈を再設定し、エス
ケープコード以外が復号されるまで処理を繰り返すもの
である。さらに、関連技術2に係るさらに他のデータ復
元方法を実施するための装置の構成を、図7に示す。こ
の図7に示すデータ復元装置も、過去に出現した履歴に
応じて符号化した符号を復号するものである。
When the escape code is decoded, the control means 213 resets the context by the context changing means 208, and repeats the process until a code other than the escape code is decoded. Further, FIG. 7 shows the configuration of an apparatus for implementing still another data restoration method according to Related Technique 2. The data restoration device shown in FIG. 7 also decodes a code that has been encoded according to a history that has appeared in the past.

【0141】ここで、200は前置データ保持手段、2
01は履歴保持手段、203は符号木決定手段、204
は復号手段、205は符号長変更手段、206は前置デ
ータ更新手段、207は符号木保持手段、208は文脈
変更手段、209は履歴登録手段、210は符号登録手
段、213は制御手段である。前置データ保持手段20
0は、過去に復号したn個のデータを保持するものであ
り、履歴保持手段201は、復号したデータと文脈との
組み合わせを保持するものであり、符号木保持手段20
7は、エスケープコードをあらかじめ登録した符号木を
保持するものである。
Here, 200 is the front data holding means, 2
01 is history holding means, 203 is code tree determining means, and 204
Is decoding means, 205 is code length changing means, 206 is prefix data updating means, 207 is code tree holding means, 208 is context changing means, 209 is history registration means, 210 is code registration means, and 213 is control means. . Prefix data holding means 20
0 holds n pieces of data decoded in the past, history holding means 201 holds a combination of decoded data and context, and code tree holding means 20
Reference numeral 7 holds a code tree in which escape codes are registered in advance.

【0142】また、符号木決定手段203は、前置デー
タ保持手段200に保持されている文脈からデータを復
号するための符号木を決定するものであり、復号手段2
04は、符号に従って符号木決定手段203で選択した
符号木の頂点を意味するルートから分岐点としてのノー
ドを走査して到達したデータ格納点としてのリーフに格
納されているデータを出力するものである。
The code tree determining means 203 is for determining a code tree for decoding data from the context held in the prefix data holding means 200, and the decoding means 2
Reference numeral 04 is for outputting the data stored in the leaf as the data storage point reached by scanning the node as the branch point from the root that means the vertex of the code tree selected by the code tree determination means 203 according to the code. is there.

【0143】さらに、符号長変更手段205は、復号し
たリーフと他のリーフあるいはノードとを組み替えるも
のであり、文脈変更手段208は、出力したデータが上
記エスケープコードであったとき、上記データを棄却し
文脈を短くするものである。また、前置データ更新手段
206は、復号したデータを前置データ保持手段200
に登録するものであり、履歴登録手段209は、データ
の復号処理でエスケープコードを復号したときの全ての
文脈と復号したデータとを履歴保持手段201に登録す
るものである。
Further, the code length changing means 205 recombines the decoded leaf with another leaf or node, and the context changing means 208 discards the above data when the output data is the above escape code. It shortens the context. Further, the prefix data updating unit 206 stores the decoded data in the prefix data holding unit 200.
The history registration means 209 registers in the history holding means 201 all the contexts when the escape code is decoded in the data decoding process and the decoded data.

【0144】また、符号登録手段210は、データの復
号処理でエスケープコードを復号した時の文脈に対応し
た全ての符号木にデータの符号を登録するものであり、
制御手段213は、エスケープコードを復号した時は文
脈変更手段208で文脈を再設定し、エスケープコード
以外が復号されるまで処理を繰り返すものである。
Further, the code registration means 210 registers the code of the data in all code trees corresponding to the context when the escape code is decoded in the data decoding process,
When the escape code is decoded, the control means 213 resets the context by the context changing means 208, and repeats the process until a code other than the escape code is decoded.

【0145】また、関連技術2に係るさらに他のデータ
復元方法を実施するための装置の構成を、図8に示す。
この図8に示すデータ復元装置も、過去に出現した履歴
に応じて符号化した符号を復号するものである。ここ
で、200は前置データ保持手段、201は履歴保持手
段、203は符号木決定手段、204は復号手段、20
5は符号長変更手段、206は前置データ更新手段、2
07は符号木保持手段、208は文脈変更手段、212
は符号登録手段、213は制御手段である。
FIG. 8 shows the configuration of an apparatus for carrying out still another data restoration method according to Related Technique 2.
The data restoration device shown in FIG. 8 also decodes a code that has been encoded according to a history that has appeared in the past. Here, 200 is prefix data holding means, 201 is history holding means, 203 is code tree determining means, 204 is decoding means, 20
5 is a code length changing means, 206 is a prefix data updating means, 2
Reference numeral 07 is a code tree holding means, 208 is a context changing means, 212
Is a code registration means, and 213 is a control means.

【0146】前置データ保持手段200は、過去に復号
したn個のデータを保持するものであり、履歴保持手段
201は、復号したデータと文脈との組み合わせを保持
するものであり、符号木保持手段207は、データ未登
録を示すデータとして定義されるエスケープコードをあ
らかじめ登録した符号木を保持するものである。また、
符号木決定手段203は、前置データ保持手段200に
保持されている文脈からデータを復号するための符号木
を決定するものであり、復号手段204は、符号に従っ
て符号木決定手段203で選択した符号木の頂点を意味
するルートから分岐点としてのノードを走査して到達し
たデータ格納点としてのリーフに格納されているデータ
を出力するものである。
The prefix data holding means 200 holds n pieces of data decoded in the past, and the history holding means 201 holds a combination of the decoded data and the context, and holds the code tree. The means 207 holds a code tree in which an escape code defined as data indicating unregistered data is registered in advance. Also,
The code tree determining means 203 determines a code tree for decoding data from the context held in the prefix data holding means 200, and the decoding means 204 is selected by the code tree determining means 203 according to the code. The data stored in the leaf as the data storage point reached by scanning the node as the branch point from the root meaning the apex of the code tree is output.

【0147】さらに、符号長変更手段205は、復号し
たリーフと他のリーフあるいはノードとを組み替えるも
のであり、文脈変更手段208は、出力したデータがエ
スケープコードであったときデータを棄却し文脈を短く
するものであり、前置データ更新手段206は、復号し
たデータを前置データ保持手段200に登録するもので
ある。
Further, the code length changing means 205 is for recombining the decoded leaf with another leaf or node, and the context changing means 208 rejects the data when the output data is an escape code and sets the context. The prefix data updating unit 206 registers the decrypted data in the prefix data holding unit 200.

【0148】また、履歴登録手段211は、データの復
号処理でエスケープコードを最後に復号した時の文脈と
復号したデータとを履歴保持手段201に登録するもの
であり、符号登録手段212は、データの復号処理で最
後にエスケープコードを復号した時の文脈に対応した符
号木にデータの符号を登録するものであり、制御手段2
13は、エスケープコードを復号した時は文脈変更手段
208で文脈を再設定し、エスケープコード以外が復号
されるまで処理を繰り返すものである。
The history registration means 211 registers the context when the escape code was last decoded in the data decoding process and the decoded data in the history holding means 201, and the code registration means 212 stores the data. The code of the data is registered in the code tree corresponding to the context when the escape code is finally decoded in the decoding process of 1.
When the escape code is decoded, 13 resets the context by the context changing means 208, and repeats the process until a code other than the escape code is decoded.

【0149】そして、図1を用いて説明した構成をもつ
装置、すなわち入力データを過去に出現した履歴に応じ
て符号化して圧縮するデータ圧縮装置においては、前置
データ保持手段100が、入力データの直前までに入力
されたn個の入力データからなる文脈を保持し、履歴保
持手段101が、入力データと文脈との組み合わせを保
持し、符号木保持手段102が、文脈毎に独立した符号
木を保持する。
In the apparatus having the configuration described with reference to FIG. 1, that is, in the data compression apparatus that encodes and compresses the input data according to the history that has appeared in the past, the prefix data holding means 100 is used. , The history holding unit 101 holds the combination of the input data and the context, and the code tree holding unit 102 holds the code tree independent for each context. Hold.

【0150】そして、符号木決定手段103が、前置デ
ータ保持手段100に保持されている直前までの入力デ
ータからデータの符号木を決定し、符号出力手段104
が、符号木決定手段103で選択した符号木の頂点を意
味するルートからデータが格納されているリーフに沿っ
て途中に位置する分岐点としてのノードからの分岐に従
って固有のデータを出力する。
Then, the code tree determining means 103 determines the code tree of the data from the input data up to immediately before being held in the prefix data holding means 100, and the code output means 104.
Outputs unique data according to a branch from a node as a branch point located midway along a leaf in which data is stored from a root that means a vertex of the code tree selected by the code tree determining unit 103.

【0151】さらに、符号長変更手段105が、符号化
したリーフと他のリーフあるいはノードとを組み替え、
前置データ更新手段106が、データを前置データ保持
手段100に登録することができる。次に、図2を用い
て説明した構成をもつ装置、すなわち入力データを過去
に出現した履歴に応じて符号化して圧縮するデータ圧縮
装置においては、前置データ保持手段100が、入力デ
ータの直前までに入力されたn個の入力データからなる
文脈を保持し、履歴保持手段101が、入力データと文
脈との組み合わせを保持し、符号木保持手段107が、
データ未登録を示すデータとして定義されるエスケープ
コードをあらかじめ登録した文脈毎に独立した符号木を
保持する。
Further, the code length changing means 105 rearranges the coded leaf and another leaf or node,
The pre-data updating means 106 can register the data in the pre-data holding means 100. Next, in the device having the configuration described with reference to FIG. 2, that is, in the data compression device that encodes and compresses the input data according to the history that has appeared in the past, the pre-data holding unit 100 immediately before the input data. Holds a context consisting of n pieces of input data inputted up to, history holding means 101 holds a combination of input data and context, and code tree holding means 107 holds
It holds an independent code tree for each context in which an escape code defined as data indicating unregistered data is registered in advance.

【0152】そして、符号木決定手段103が、文脈と
入力データからデータの符号木を決定し、文脈判別手段
108が、符号木決定手段103で決定した符号木にデ
ータが登録されているか否かを判別し、エスケープコー
ド出力手段109が、符号木にデータが登録されていな
いときは符号木の頂点を意味するルートからエスケープ
コードのデータ格納点としてのリーフまでの途中に位置
する分岐点としてのノードからの分岐に従ってエスケー
プコードを出力する。
Then, the code tree determining means 103 determines the code tree of the data from the context and the input data, and the context determining means 108 determines whether or not the data is registered in the code tree determined by the code tree determining means 103. And the escape code output means 109 determines that a branch point located on the way from the root meaning the vertex of the code tree to the leaf as the data storage point of the escape code when no data is registered in the code tree. Output an escape code according to the branch from the node.

【0153】さらに、文脈変更手段110が、符号木に
データが登録されていないときは文脈の長さnを短く
し、符号出力手段111が、符号木にデータが登録され
ているときは符号木のルートからデータのリーフまでの
途中に位置するノードからの分岐に従ってデータの符号
を出力し、符号長変更手段105が、符号化したリーフ
と他のリーフあるいはノードとを組み換える。
Further, the context changing means 110 shortens the length n of the context when the data is not registered in the code tree, and the code output means 111 when the data is registered in the code tree. The code of the data is output according to the branch from the node located on the way from the root to the leaf of the data, and the code length changing unit 105 recombines the coded leaf with another leaf or node.

【0154】そして、前置データ更新手段106が、デ
ータを前置データ保持手段100に登録し、制御手段1
16が、エスケープコードを符号化したときはデータの
符号化を行なうまで処理を繰り返す。次に、図3を用い
て説明した構成をもつ装置、すなわち入力データを過去
に出現した履歴に応じて符号化して圧縮するデータ圧縮
装置においては、前置データ保持手段100が、入力デ
ータの直前までに入力されたn個の入力データからなる
文脈を保持し、履歴保持手段101が、入力データと文
脈との組み合わせを保持し、符号木保持手段107が、
データ未登録を示すデータとして定義されるエスケープ
コードを予め登録した文脈毎に独立した符号木を保持す
る。
Then, the prefix data updating means 106 registers the data in the prefix data holding means 100, and the control means 1
When 16 encodes the escape code, the process is repeated until the data is encoded. Next, in the device having the configuration described with reference to FIG. 3, that is, in the data compression device that encodes and compresses the input data according to the history that has appeared in the past, the pre-data holding unit 100 immediately before the input data. Holds a context consisting of n pieces of input data inputted up to, history holding means 101 holds a combination of input data and context, and code tree holding means 107 holds
It holds an independent code tree for each context in which an escape code defined as data indicating unregistered data is registered in advance.

【0155】そして、符号木決定手段103が、文脈と
入力データからデータの符号木を決定し、文脈判別手段
108が、符号木決定手段103で決定した符号木にデ
ータが登録されているか否かを判別し、エスケープ出力
手段109が、符号木にデータが登録されていないとき
は符号木の頂点を意味するルートからエスケープコード
のデータ格納点としてのリーフまでの中に位置する分岐
点としてのノードからの分岐に従ってエスケープコード
を出力する。さらに、履歴登録手段112が、符号木に
データが登録されていないときは履歴保持手段101に
データと文脈の組み合わせを登録し、符号登録手段11
3が、符号木にデータが登録されていないときは符号木
にデータを新規に登録し、文脈変更手段110が、符号
木にデータが登録されていないときは文脈の長さnを短
くし、符号出力手段111が、符号木にデータが登録さ
れているときは符号木のルートからデータのリーフまで
の途中に位置するノードからの分岐に従ってデータの符
号を出力する。
Then, the code tree determining means 103 determines the code tree of the data from the context and the input data, and the context determining means 108 determines whether or not the data is registered in the code tree determined by the code tree determining means 103. When the data is not registered in the code tree, the escape output means 109 is a node as a branch point located between the root that means the vertex of the code tree and the leaf as the data storage point of the escape code. The escape code is output according to the branch from. Further, the history registration means 112 registers the combination of the data and the context in the history holding means 101 when the data is not registered in the code tree, and the code registration means 11
3 newly registers the data in the code tree when the data is not registered in the code tree, and the context changing unit 110 shortens the context length n when the data is not registered in the code tree, When the data is registered in the code tree, the code output means 111 outputs the code of the data according to the branch from the node located on the way from the root of the code tree to the leaf of the data.

【0156】そして、符号長変更手段105が、符号化
したリーフと他のリーフあるいはノードとを組み換え、
前置データ更新手段106が、データを前置データ保持
手段100に登録し、制御手段116が、エスケープコ
ードを符号化したときはデータの符号化を行なうまで処
理を繰り返す。次に、図4を用いて説明した構成をもつ
装置、すなわち入力データを過去に出現した履歴に応じ
て符号化して圧縮するデータ圧縮装置においては、前置
データ保持手段100が、入力データの直前までに入力
されたn個の入力データからなる文脈を保持し、履歴保
持手段101が、入力データと文脈との組み合わせを保
持し、符号木保持手段107が、データ未登録を示すデ
ータとして定義されるエスケープコードをあらかじめ登
録した文脈毎に独立した符号木を保持する。
Then, the code length changing means 105 recombines the coded leaf with another leaf or node,
The prefix data updating unit 106 registers the data in the prefix data holding unit 100, and when the control unit 116 codes the escape code, the process is repeated until the data is coded. Next, in the device having the configuration described with reference to FIG. 4, that is, in the data compression device that encodes and compresses the input data according to the history that has appeared in the past, the pre-data holding unit 100 immediately before the input data. The history holding unit 101 holds the combination of the input data and the context, and the code tree holding unit 107 is defined as data indicating that the data has not been registered. It holds an independent code tree for each context in which escape codes are registered in advance.

【0157】そして、符号木決定手段103が、文脈と
入力データからデータの符号木を決定し、文脈判別手段
108が、符号木決定手段103で決定した符号木にデ
ータが登録されているか否かを判別し、エスケープコー
ド出力手段109と符号木にデータが登録されていない
ときは符号木の頂点を意味するルートからエスケープコ
ードのデータ格納点としてのリーフまでの途中に位置す
る分岐点としてのノードからの分岐に従ってエスケープ
コードを出力する。
Then, the code tree determining means 103 determines the code tree of the data from the context and the input data, and the context determining means 108 determines whether or not the data is registered in the code tree determined by the code tree determining means 103. And a node as a branch point located on the way from the root that means the vertex of the code tree to the leaf as the data storage point of the escape code when the data is not registered in the escape code output means 109 and the code tree. The escape code is output according to the branch from.

【0158】さらに、文脈変更手段110が、符号木に
データが登録されていないときは文脈の長さnを短く
し、エスケープ符号出力手段111が、符号木にデータ
が登録されているときは符号木のルートからデータのリ
ーフまでの途中に位置するノードからの分岐にしたがっ
てデータの符号を出力する。そして、履歴登録手段11
4が、履歴保持手段101にデータと文脈の組み合わせ
を登録し、符号登録手段115が、符号木にデータを新
規に登録し、符号長変更手段105が、符号化したリー
フと他のリーフあるいはノードとを組み換え、前置デー
タ更新手段106が、データを前置データ保持手段10
0に登録する。
Further, the context changing means 110 shortens the length n of the context when the data is not registered in the code tree, and the escape code output means 111 outputs the code when the data is registered in the code tree. The code of the data is output according to the branch from the node located on the way from the root of the tree to the leaf of the data. And history registration means 11
4 registers a combination of data and context in the history holding unit 101, the code registration unit 115 newly registers the data in the code tree, and the code length changing unit 105 codes the encoded leaf and another leaf or node. And the prefix data updating means 106 stores the data in the prefix data holding means 10
Register to 0.

【0159】さらに、制御手段116が、データの符号
化時に一度でもエスケープコードを符号化したときは、
データの符号化の直前の文脈とデータとの組み合わせを
履歴登録手段114で履歴保持手段101に登録し、デ
ータの符号化の直前に符号化したエスケープコードを持
つ符号木に符号登録手段115でデータを新規に登録す
る。
Further, when the control means 116 encodes the escape code even once when encoding the data,
The history registration unit 114 registers the combination of the context and the data immediately before the data encoding in the history holding unit 101, and the code registration unit 115 stores the data in the code tree having the escape code encoded immediately before the data encoding. Is newly registered.

【0160】一方、図5を用いて説明した構成をもつ装
置、すなわち過去に出現した履歴に応じて符号化した符
号を復号するデータ復元装置においては、前置データ保
持手段200が、過去に復号したn個のデータを保持
し、履歴保持手段201が、復号したデータと文脈との
組み合わせを保持し、符号木保持手段202が、文脈毎
に独立した符号木を保持する。
On the other hand, in the device having the configuration described with reference to FIG. 5, that is, in the data restoration device that decodes the code coded according to the history that has appeared in the past, the prefix data holding means 200 decodes the data in the past. The history holding unit 201 holds a combination of the decoded data and the context, and the code tree holding unit 202 holds an independent code tree for each context.

【0161】そして、符号木決定手段203が、前置デ
ータ保持手段200に保持されている文脈からデータを
復号するための符号木を決定し、復号手段204が、符
号に従って符号木決定手段203で選択した符号木の頂
点を意味するルートから分岐点としてのノードを走査し
て到達したデータ格納点としてのリーフに格納されてい
るデータを出力する。
Then, the code tree determining means 203 determines the code tree for decoding the data from the context held in the prefix data holding means 200, and the decoding means 204 causes the code tree determining means 203 to follow the code. The node stored as a branch point is scanned from the root representing the apex of the selected code tree, and the data stored in the leaf as the data storage point reached is output.

【0162】さらに、符号長変更手段205が、復号し
たリーフと他のリーフあるいはノードとを組み替え、前
置データ更新手段206が、復号したデータを前置デー
タ保持手段200に登録する。次に、図6を用いて説明
した構成をもつ装置、すなわち過去に出現した履歴に応
じて符号化した符号を復号するデータ復元装置において
は、前置データ保持手段200が、過去に復号したn個
のデータを保持し、履歴保持手段201が、復号したデ
ータと文脈との組み合わせを保持し、符号木保持手段2
07が、データ未登録を示すデータとして定義されるエ
スケープコードをあらかじめ登録した符号木を保持す
る。
Further, the code length changing means 205 rearranges the decoded leaf and another leaf or node, and the prefix data updating means 206 registers the decoded data in the prefix data holding means 200. Next, in the device having the configuration described with reference to FIG. 6, that is, in the data decompression device that decodes the code that has been encoded according to the history that has appeared in the past, the pre-data holding unit 200 has n decoded in the past. Data, the history holding means 201 holds the combination of the decoded data and the context, and the code tree holding means 2
Reference numeral 07 holds a code tree in which an escape code defined as data indicating unregistered data is registered in advance.

【0163】そして、符号木決定手段203が、前置デ
ータ保持手段200に保持されている文脈からデータを
復号するための符号木を決定し、復号手段204が、符
号に従って符号木決定手段203で選択した符号木の頂
点を意味するルートから分岐点としてのノードを走査し
て到達したデータ格納点としてのリーフに格納されてい
るデータを出力する。
Then, the code tree determining means 203 determines a code tree for decoding the data from the context held in the prefix data holding means 200, and the decoding means 204 causes the code tree determining means 203 to follow the code. The node stored as a branch point is scanned from the root representing the apex of the selected code tree, and the data stored in the leaf as the data storage point reached is output.

【0164】さらに、符号長変更手段205が、復号し
たリーフと他のリーフあるいはノードとを組み替え、文
脈変更手段208が、出力したデータがエスケープコー
ドであったときデータを棄却し文脈を短くし、前置デー
タ更新手段206が、復号したデータを前置データ保持
手段200に登録する。そして、制御手段213が、エ
スケープコードを復号した時は文脈変更手段208で文
脈を再設定し、エスケープコード以外が復号されるまで
処理を繰り返す。
Further, the code length changing means 205 rearranges the decoded leaf and another leaf or node, and the context changing means 208 rejects the data when the output data is an escape code to shorten the context, The prefix data updating unit 206 registers the decrypted data in the prefix data holding unit 200. Then, when the control means 213 decodes the escape code, the context changing means 208 resets the context, and repeats the process until a code other than the escape code is decoded.

【0165】次に、図7を用いて説明した構成をもつ装
置、すなわち過去に出現した履歴に応じて符号化した符
号を復号するデータ復元装置においては、前置データ保
持手段200が、過去に復号したn個のデータを保持
し、履歴保持手段201が、復号したデータと文脈との
組み合わせを保持し、符号木保持手段207が、エスケ
ープコードをあらかじめ登録した符号木を保持する。
Next, in the device having the configuration described with reference to FIG. 7, that is, in the data decompression device that decodes the code coded according to the history that has appeared in the past, the prefix data holding means 200 The decoded n data is held, the history holding unit 201 holds the combination of the decoded data and the context, and the code tree holding unit 207 holds the code tree in which the escape code is registered in advance.

【0166】そして、符号木決定手段203が、前置デ
ータ保持手段200に保持されている文脈からデータを
復号するための符号木を決定し、復号手段204が、符
号に従って符号木決定手段203で選択した符号木の頂
点を意味するルートから分岐点としてのノードを走査し
て到達したデータ格納点としてのリーフに格納されてい
るデータを出力する。
Then, the code tree determining means 203 determines a code tree for decoding the data from the context held in the prefix data holding means 200, and the decoding means 204 causes the code tree determining means 203 to follow the code. The node stored as a branch point is scanned from the root representing the apex of the selected code tree, and the data stored in the leaf as the data storage point reached is output.

【0167】さらに、符号長変更手段205が、復号し
たリーフと他のリーフあるいはノードとを組み替え、文
脈変更手段208が、出力したデータがエスケープコー
ドであったとき、データを棄却し文脈を短くし、前置デ
ータ更新手段206が、復号したデータを前置データ保
持手段200に登録する。そして、履歴登録手段209
が、データの復号処理でエスケープコードを復号したと
きの全ての文脈と復号したデータとを履歴保持手段20
1に登録し、符号登録手段210が、データの復号処理
でエスケープコードを復号した時の文脈に対応した全て
の符号木にデータの符号を登録し、制御手段213が、
エスケープコードを復号した時は文脈変更手段208で
文脈を再設定し、エスケープコード以外が復号されるま
で処理を繰り返す。
Furthermore, the code length changing means 205 rearranges the decoded leaf and another leaf or node, and the context changing means 208 rejects the data and shortens the context when the output data is an escape code. The prefix data updating unit 206 registers the decrypted data in the prefix data holding unit 200. Then, the history registration means 209
However, the history holding unit 20 stores all the contexts when the escape code is decoded in the data decoding process and the decoded data.
1, the code registration unit 210 registers the code of the data in all the code trees corresponding to the context when the escape code is decoded in the data decoding process, and the control unit 213
When the escape code is decoded, the context changing means 208 resets the context, and the process is repeated until a code other than the escape code is decoded.

【0168】次に、図8を用いて説明した構成をもつ装
置、すなわち過去に出現した履歴に応じて符号化した符
号を復号するデータ復元装置においては、前置データ保
持手段200が、過去に復号したn個のデータを保持
し、履歴保持手段201が、復号したデータと文脈との
組み合わせを保持し、符号木保持手段207が、データ
未登録を示すデータとして定義されるエスケープコード
をあらかじめ登録した符号木を保持する。
Next, in the device having the configuration described with reference to FIG. 8, that is, in the data decompression device that decodes the code coded according to the history that has appeared in the past, the prefix data holding means 200 Holds the decoded n pieces of data, the history holding means 201 holds the combination of the decoded data and the context, and the code tree holding means 207 registers in advance an escape code defined as data indicating that the data has not been registered. Holds the code tree that was created.

【0169】そして、符号木決定手段203が、前置デ
ータ保持手段200に保持されている文脈からデータを
復号するための符号木を決定し、復号手段204が、符
号に従って符号木決定手段203で選択した符号木の頂
点を意味するルートから分岐点としてのノードを走査し
て到達したデータ格納点としてのリーフに格納されてい
るデータを出力する。
Then, the code tree determining means 203 determines the code tree for decoding the data from the context held in the prefix data holding means 200, and the decoding means 204 causes the code tree determining means 203 to follow the code. The node stored as a branch point is scanned from the root representing the apex of the selected code tree, and the data stored in the leaf as the data storage point reached is output.

【0170】さらに、符号長変更手段205が、復号し
たリーフと他のリーフあるいはノードとを組み替え、文
脈変更手段208が、出力したデータがエスケープコー
ドであったときデータを棄却し文脈を短くする。そし
て、前置データ更新手段206が、復号したデータを前
置データ保持手段200に登録し、履歴登録手段211
が、データの復号処理でエスケープコードを最後に復号
した時の文脈と復号したデータとを履歴保持手段201
に登録し、符号登録手段212が、データの復号処理で
最後にエスケープコードを復号した時の文脈に対応した
符号木にデータの符号を登録する。
Further, the code length changing unit 205 rearranges the decoded leaf and another leaf or node, and the context changing unit 208 rejects the data when the output data is an escape code and shortens the context. Then, the prefix data updating unit 206 registers the decrypted data in the prefix data holding unit 200, and the history registration unit 211.
However, the history holding means 201 indicates the context when the escape code was last decoded in the data decoding process and the decoded data.
The code registration means 212 registers the code of the data in the code tree corresponding to the context when the escape code was finally decoded in the data decoding process.

【0171】さらに、制御手段213が、エスケープコ
ードを復号した時は文脈変更手段208で文脈を再設定
し、エスケープコード以外が復号されるまで処理を繰り
返す。
Further, when the control means 213 decodes the escape code, the context changing means 208 resets the context, and repeats the process until a code other than the escape code is decoded.

【0172】従って、上述した関連技術2に係るデータ
圧縮方法によれば、入力データの出現頻度を求めて確率
モデルを構築して各入力データに符号を割り当て符号表
を作成し、この符号表から符号化する文字の符号を出力
するという2段階の処理を同時に行なうことができ、こ
れにより圧縮処理の速度が大幅に向上するという効果が
ある。また、データが入力されるごとに既に構築されて
いる確率モデルを再構築するという膨大な演算処理を省
くことができ、これにより圧縮処理の速度がさらに向上
する効果もある。さらに、過去に出現した入力データと
同じデータが繰り返し出現するほど、そのデータの符号
を少ないビット数で表すことができ、これによりデータ
圧縮における圧縮効果が大幅に向上する効果もある。
Therefore, according to the data compression method according to the related technique 2 described above, the probability model is obtained by calculating the appearance frequency of the input data, a code is assigned to each input data, a code table is created, and from this code table The two-stage processing of outputting the code of the character to be encoded can be performed at the same time, which has the effect of significantly improving the speed of the compression processing. Further, it is possible to omit an enormous amount of arithmetic processing of reconstructing a stochastic model that has already been constructed each time data is input, which has the effect of further increasing the speed of compression processing. Furthermore, as the same data as the input data that has appeared in the past appears repeatedly, the code of the data can be represented by a smaller number of bits, which also has the effect of significantly improving the compression effect in data compression.

【0173】また、入力データと文脈との組み合わせが
文脈収集過程の履歴に保持されていない組み合わせであ
ったとき、エスケープコードを出力し、文脈収集過程に
保持されている組み合わせが得られるまで、データの文
脈を短くする処理を繰り返すので、上述した効果に加え
て、入力データと文脈との組み合わせの履歴の全てを予
め登録しておかなくてもよく、これによりデータ圧縮の
処理速度が大幅に向上する効果がある。さらに、入力デ
ータと文脈との組み合わせが得られるまでの時間を短縮
することができ、これによりデータ圧縮の処理速度が大
幅に向上する効果もある。
When the combination of the input data and the context is a combination which is not held in the history of the context collecting process, the escape code is output, and the data held until the combination held in the context collecting process is obtained. Since the process of shortening the context of is repeated, in addition to the effects described above, it is not necessary to register all the history of combinations of input data and context in advance, which significantly improves the processing speed of data compression. Has the effect of Furthermore, it is possible to shorten the time until the combination of the input data and the context is obtained, which has the effect of significantly improving the processing speed of data compression.

【0174】また、過去に予め登録されていなかった入
力データを新規に登録してゆくことができるとともにこ
の新規に登録したデータも次の符号化処理においては早
い段階で符号化することができ、これにより符号化処理
が進むほどデータの圧縮効果が大幅に向上する効果があ
る。
Further, it is possible to newly register input data that has not been previously registered in the past, and to code this newly registered data at an early stage in the next encoding process. As a result, the data compression effect is significantly improved as the encoding process progresses.

【0175】さらに、文脈新規登録過程及び符号木新規
登録過程においては、履歴にあると判断された直前の文
脈とデータとの組み合わせのみを登録するので、過去の
入力データの履歴にないと判断された文脈とデータとの
組み合わせを全て登録する必要がなく、これによりデー
タの圧縮処理がさらに大幅に向上する効果がある。さら
に、実際に出現頻度が高いデータについてのみ符号をも
たせる(登録する)ことができ、これによりデータの圧
縮効率が大幅に向上する効果もある。
Further, in the context new registration process and the code tree new registration process, since only the combination of the context and the data immediately before judged to be in the history is registered, it is judged that it is not in the history of past input data. It is not necessary to register all the combinations of contexts and data, which has the effect of significantly improving data compression processing. Further, it is possible to give (register) a code only to the data having a high appearance frequency, which has the effect of significantly improving the data compression efficiency.

【0176】一方、上述した関連技術2に係るデータ復
元方法によれば、入力データの出現頻度を求めて確率モ
デルを構築して各入力データに符号を割り当て符号表を
作成し、この符号表から復号する文字を出力するという
2段階の処理を同時に行なうことができ、これによりデ
ータの復元処理の速度が大幅に向上するという効果があ
る。また、データが入力されるごとに既に構築されてい
る確率モデルを再構築するという膨大な演算処理を省く
ことができ、これにより復元処理の速度がさらに向上す
る効果もある。さらに、過去に出現した入力データの符
号と同じデータの符号が繰り返し出現するほど、そのデ
ータの符号を少ないビット数で表すことができ、これに
よりデータ復元における復元効果が大幅に向上する効果
もある。
On the other hand, according to the data restoration method according to the related technique 2 described above, the probability model is obtained by calculating the appearance frequency of the input data, a code is assigned to each input data, a code table is created, and from this code table It is possible to perform the two-step processing of outputting the characters to be decoded at the same time, which has the effect of significantly improving the speed of the data restoration processing. In addition, it is possible to omit an enormous amount of arithmetic processing of reconstructing a stochastic model that has already been constructed each time data is input, and this also has the effect of further increasing the speed of restoration processing. Further, as the code of the same data as the code of the input data that has appeared in the past repeatedly appears, the code of the data can be represented by a smaller number of bits, which also has the effect of significantly improving the restoration effect in the data restoration. .

【0177】さらに、符号木にはそれぞれの文脈に応じ
た符号木毎に予めデータ未登録を示すデータとして定義
されるエスケープコードを登録し、復号時にエスケープ
コードを復号した場合、エスケープコード以外が復号さ
れるまで、文脈の長さを短くする処理を繰り返すので、
復号データと文脈との組み合わせの履歴の全てを予め登
録しておかなくてもよく、これによりデータ復元の処理
速度が大幅に向上する効果がある。さらに、復号データ
と文脈との組み合わせが得られるまでの時間を短縮する
ことができ、これによりデータ復元の処理速度が大幅に
向上する効果もある。
Further, in the code tree, an escape code defined as data indicating that data has not been registered is registered in advance for each code tree according to each context, and when the escape code is decoded at the time of decoding, the code other than the escape code is decoded. Until it is done, the process of shortening the length of the context is repeated, so
It is not necessary to register all the history of the combination of the decrypted data and the context in advance, which has the effect of significantly improving the processing speed of data restoration. Furthermore, it is possible to shorten the time until the combination of the decoded data and the context is obtained, and this also has the effect of significantly improving the processing speed of data restoration.

【0178】また、データ未登録を示すデータとして定
義されるエスケープコードを復号したとき、文脈新規登
録過程及び符号木新規登録過程を実行して、エスケープ
コード以外が復号されるまで、文脈の長さを短くする処
理を繰り返すので、過去に予め登録されていなかった復
号データを新規に登録してゆくことができるとともにこ
の新規に登録した復号データも次の復号処理においては
早い段階で復号することができ、これにより復号処理が
進むほどデータの復元効果が大幅に向上する効果があ
る。
When an escape code defined as data indicating unregistered data is decoded, the context new registration process and the code tree new registration process are executed, and the length of the context is increased until a part other than the escape code is decoded. By repeating the process of shortening the time, it is possible to newly register the decoded data that was not registered in advance in the past, and this newly registered decoded data can be decoded at an early stage in the next decoding process. As a result, as the decoding process progresses, the data restoration effect is significantly improved.

【0179】さらに、データ未登録を示すデータとして
定義されるエスケープコード以外が復号されるまでの処
理において、エスケープコードを一つでも復号した時、
エスケープコード以外を復号した直前の文脈においての
み、文脈新規登録過程および符号木新規登録過程での各
新規登録処理を行なうので、過去の入力データの履歴に
ないと判断された文脈とデータとの組み合わせを全て登
録する必要がなく、これによりデータ復元の処理速度が
さらに大幅に向上する効果がある。さらに、実際に出現
頻度が高いデータについてのみ符号をもたせる(登録す
る)ことができ、これによりデータの復元効率が大幅に
向上する効果もある。
Furthermore, when even one escape code is decoded in the process until the escape code other than the escape code defined as the data indicating unregistered data is decoded,
Since each new registration process in the context new registration process and the code tree new registration process is performed only in the context immediately before decoding the code other than the escape code, the combination of the context and the data determined not to be in the history of past input data It is not necessary to register all of them, and this has the effect of significantly improving the processing speed of data restoration. Further, it is possible to give (register) a code only to the data having a high appearance frequency, which has the effect of significantly improving the data restoration efficiency.

【0180】また、関連技術2に係る他のデータ圧縮装
置によれば、入力データの出現頻度を求めて確率モデル
を構築して各入力データに符号を割り当て符号表を作成
し、この符号表から符号化するデータの符号を出力する
という2段階の処理を同時に行なうことができ、これに
よりデータ圧縮の処理速度が大幅に向上するという効果
がある。また、データが入力されるごとに既に構築され
ている確率モデルを再構築するという膨大な演算処理を
省くことができ、これによりデータ圧縮の処理速度がさ
らに向上する効果もある。また、過去に符号化したデー
タと同じデータが出現する毎に、符号化したリーフと他
のリーフあるいはノードとを組み替えて符号長を変更す
ることができるので、同じデータが繰り返し出現するほ
ど、そのデータの符号を少ないビット数で表すことがで
き、これによりデータの圧縮効果が大幅に向上する効果
もある。
Further, according to another data compression apparatus of Related Technique 2, the probability model is obtained by calculating the appearance frequency of input data, a code is assigned to each input data, a code table is created, and from this code table It is possible to perform the two-stage processing of outputting the code of the data to be encoded at the same time, which has the effect of significantly improving the processing speed of data compression. Further, it is possible to omit an enormous amount of arithmetic processing of reconstructing a stochastic model that has already been constructed each time data is input, which also has the effect of further improving the processing speed of data compression. Also, every time the same data as the coded data in the past appears, the coded leaf and another leaf or node can be recombined to change the code length. The code of data can be represented by a small number of bits, which also has the effect of significantly improving the data compression effect.

【0181】さらに、入力データと文脈との組み合わせ
の履歴の全てを予め登録しておかなくてもよいので、デ
ータ圧縮の処理速度が大幅に向上するとともに、文脈の
登録に使用するメモリを大幅に削減できるのでデータ圧
縮装置の処理負荷も大幅に軽減できる効果がある。
Further, since it is not necessary to previously register all the history of combinations of input data and contexts, the processing speed of data compression is significantly improved, and the memory used for registration of contexts is significantly increased. Since this can be reduced, the processing load of the data compression device can be significantly reduced.

【0182】また、過去に予め登録されていなかった入
力データを新規に登録してゆくことができるとともに、
この新規に登録したデータも次の符号化処理においては
早い段階で符号化することができ、これにより符号化処
理が進むほどデータの圧縮効果が大幅に向上するととも
にデータ圧縮装置の処理負荷も大幅に軽減できる効果が
ある。
Further, it is possible to newly register input data which has not been previously registered,
This newly registered data can also be encoded at an early stage in the next encoding process, and as the encoding process progresses, the data compression effect is significantly improved and the processing load on the data compression device is also significantly increased. There is an effect that can be reduced.

【0183】さらに、過去の入力データの履歴にないと
判断された文脈とデータとの組み合わせを全て登録する
必要がなく、これによりデータの圧縮処理がさらに大幅
に向上する効果がある。さらに、実際に出現頻度が高い
データについてのみ符号をもたせる(登録する)ことが
でき、これによりデータの圧縮効率が大幅に向上する効
果もある。そして、以上のような効果により、データ圧
縮装置の性能が飛躍的に向上する効果がある。
Furthermore, it is not necessary to register all the combinations of contexts and data that have been determined not to be in the history of input data in the past, which has the effect of significantly improving the data compression processing. Further, it is possible to give (register) a code only to the data having a high appearance frequency, which has the effect of significantly improving the data compression efficiency. The above-described effects have the effect of dramatically improving the performance of the data compression apparatus.

【0184】また、関連技術2に係るデータ復元装置に
よれば、入力データの出現頻度を求めて確率モデルを構
築して各入力データに符号を割り当て符号表を作成し、
この符号表から復号する文字を出力するという2段階の
処理を同時に行なうことができ、これによりデータの復
元処理の速度が大幅に向上するという効果がある。ま
た、データが入力されるごとに既に構築されている確率
モデルを再構築するという膨大な演算処理を省くことが
でき、これにより復元処理の速度がさらに向上する効果
もある。さらに、過去に出現した入力データの符号と同
じデータの符号が繰り返し出現するほど、そのデータの
符号を少ないビット数で表すことができ、これによりデ
ータ復元における復元効果が大幅に向上する効果もあ
る。そして、以上のような効果により、データ復元装置
の性能が飛躍的に向上する効果がある。
Further, according to the data restoration device of the related technique 2, the appearance frequency of the input data is obtained, the stochastic model is constructed, the codes are assigned to the respective input data, and the code table is created.
The two-step process of outputting the character to be decoded from this code table can be performed at the same time, which has the effect of significantly improving the speed of the data restoration process. In addition, it is possible to omit an enormous amount of arithmetic processing of reconstructing a stochastic model that has already been constructed each time data is input, and this also has the effect of further increasing the speed of restoration processing. Further, as the code of the same data as the code of the input data that has appeared in the past repeatedly appears, the code of the data can be represented by a smaller number of bits, which also has the effect of significantly improving the restoration effect in the data restoration. . The above-described effects have the effect of dramatically improving the performance of the data restoration device.

【0185】さらに、復号データと文脈との組み合わせ
の履歴の全てを予め登録しておかなくてもよく、これに
よりデータ復元の処理速度が大幅に向上する効果があ
る。さらに、復号データと文脈との組み合わせが得られ
るまでの時間を短縮することができ、これによりデータ
復元の処理速度が大幅に向上するとともにデータ復元装
置の性能も大幅に向上する効果もある。
Further, it is not necessary to register all the history of the combination of the decrypted data and the context in advance, which has the effect of significantly improving the processing speed of data restoration. Furthermore, it is possible to shorten the time until the combination of the decoded data and the context is obtained, which has the effect of significantly improving the processing speed of data recovery and also the performance of the data recovery device.

【0186】また、過去に予め登録されていなかった復
号データを新規に登録してゆくことができるとともにこ
の新規に登録した復号データも次の復号処理においては
早い段階で復号することができ、これにより復号処理が
進むほどデータの復元効果が大幅に向上するとともに、
データ復元装置の性能も大幅に向上する効果がある。
Further, it is possible to newly register the decoded data which has not been registered in advance in the past, and also the newly registered decoded data can be decoded at an early stage in the next decoding process. As the decoding process progresses, the data restoration effect improves significantly, and
This also has the effect of significantly improving the performance of the data restoration device.

【0187】さらに、過去の入力データの履歴にないと
判断された文脈とデータとの組み合わせを全て登録する
必要がなく、これによりデータ復元の処理がさらに大幅
に向上する効果がある。さらに、実際に出現頻度が高い
データについてのみ符号をもたせる(登録する)ことが
でき、これによりデータの復元効率が大幅に向上すると
ともにデータ復元装置の性能も大幅に向上する効果があ
る。次に、関連技術2について、より具体的に説明す
る。図32は、関連技術2のデータ圧縮方法及びデータ
復元方法を実施するためのデータ圧縮装置及びデータ復
元装置の構成例を示すブロック図であるが、この図32
において、データ圧縮装置3は、入力されたデータを過
去に出現した履歴に応じて符号化して圧縮するものであ
り、データ復元装置4は、データ圧縮装置3が符号化し
た符号を復号するものである。
Furthermore, it is not necessary to register all the combinations of contexts and data that have been determined not to be in the history of input data in the past, and this has the effect of greatly improving the data restoration processing. Furthermore, it is possible to give (register) a code only to the data that actually appears frequently, which has the effect of greatly improving the data recovery efficiency and also the performance of the data recovery device. Next, the related technique 2 will be described more specifically. 32 is a block diagram showing a configuration example of a data compression apparatus and a data decompression apparatus for implementing the data compression method and the data decompression method of Related Technique 2.
In the data compression device 3, the data compression device 3 encodes and compresses the input data according to the history of past appearances, and the data decompression device 4 decodes the code encoded by the data compression device 3. is there.

【0188】以後、データ圧縮装置3を符号化側、デー
タ復元装置4を復元側として、以下に説明する。なお、
以下の説明中、文脈木および符号木は、関連技術1にて
前述した構成をもつものである。 (1)符号化側の説明 図33は、上述のデータ圧縮装置3の内部の構成例を示
すブロック図であり、この図33に示すように、100
A−1〜100A−n(nは自然数)は前置データ保持
部、101Aは文脈履歴保持部、102Aは符号木保持
部、103Aは符号木決定部、104Aは符号化部、1
05Aは符号木更新部、106Aは文脈更新部である。
Hereinafter, description will be given below with the data compression device 3 as the encoding side and the data decompression device 4 as the decompression side. In addition,
In the following description, the context tree and the code tree have the configurations described in Related Art 1. (1) Description of Encoding Side FIG. 33 is a block diagram showing an example of the internal configuration of the data compression device 3 described above. As shown in FIG.
A-1 to 100A-n (n is a natural number) is a prefix data holding unit, 101A is a context history holding unit, 102A is a code tree holding unit, 103A is a code tree determining unit, 104A is a coding unit, 1
Reference numeral 05A is a code tree updating unit, and 106A is a context updating unit.

【0189】ここで、前置データ保持部(前置データ保
持手段)100A−1〜100A−nは、入力されたデ
ータK(以下、事象Kということがある)の直前までに
入力されたn個のデータからなる文脈を保持するもので
ある。また、文脈履歴保持部(履歴保持手段)101A
は、入力されたデータKと文脈との組み合わせを保持す
るものであり、符号木保持部(符号木保持手段)102
Aは、文脈毎に独立した符号木を保持するものであり、
符号木決定部(符号木決定手段)103Aは、前置デー
タ保持部100A−1〜100A−nに保持されている
直前までのデータから符号木を決定するものである。
Here, the prefix data holding units (prefix data holding means) 100A-1 to 100A-n are input n just before the input data K (hereinafter sometimes referred to as event K). It holds the context of individual data. A context history holding unit (history holding means) 101A
Holds a combination of the input data K and the context, and is a code tree holding unit (code tree holding means) 102.
A holds an independent code tree for each context,
The code tree determination unit (code tree determination unit) 103A determines a code tree from the data held immediately before held in the prefix data holding units 100A-1 to 100A-n.

【0190】さらに、符号化部(符号出力手段)104
Aは、データKを符号化して、符号木決定部103Aで
選択した符号木のルート(符号木の頂点)からデータK
が格納されているリーフに沿って途中に位置するノード
(分岐点)からの分岐に従って符号化したデータKを出
力するものである。また、符号木更新部(符号長変更手
段)105Aは、符号化したリーフと他のリーフあるい
はノードとを組み替えるものであり、文脈更新部(前置
データ更新手段)106Aは、データKを前置データ保
持部100A−1〜100A−nに登録するものであ
る。
Further, the coding section (code output means) 104
A encodes the data K and outputs the data K from the root of the code tree (the vertex of the code tree) selected by the code tree determination unit 103A.
Is output according to a branch from a node (branch point) located midway along the leaf in which is stored. The code tree updating unit (code length changing unit) 105A rearranges the coded leaf and another leaf or node, and the context updating unit (prefix data updating unit) 106A prefixes the data K. The data is stored in the data holding units 100A-1 to 100A-n.

【0191】さらに、図34は上述の符号化部104A
の内部の構成例を示すブロック図であり、この図34に
示すように、上述のようにノードからの分岐に従って符
号化したデータKを出力するために、符号化部104A
には、上位ノード判別部41,ノード番号管理部(メモ
リ)42,位置判別部43,ラッチ44,スタック45
が設けられている。
Further, FIG. 34 shows the above-mentioned encoding unit 104A.
FIG. 35 is a block diagram showing an example of the internal configuration of the encoding unit 104A for outputting the data K encoded according to the branch from the node as described above, as shown in FIG.
Includes an upper node discriminating unit 41, a node number managing unit (memory) 42, a position discriminating unit 43, a latch 44, and a stack 45.
Is provided.

【0192】ここで、上位ノード判別部41は、符号木
のルートのノード番号と文脈木のリーフのノード番号と
から上位ノードのノード番号を得るものであり、ノード
番号管理部(メモリ)42は、文脈木と符号木のノード
番号を管理するものであり、位置判別部43は、ノード
の分岐状態を判別するものである。さらに、ラッチ44
は、リーフのノード番号を一旦保持するものであり、ス
タック45は、位置判別部43から出力されるデータK
の符号を一旦保持して、終了信号を受信すると保持して
おいた符号を順次出力するものである。
Here, the upper node discriminating unit 41 obtains the node number of the upper node from the node number of the root of the code tree and the node number of the leaf of the context tree, and the node number managing unit (memory) 42 The node number of the context tree and the code tree is managed, and the position discriminating unit 43 discriminates the branching state of the node. In addition, the latch 44
Temporarily holds the node number of the leaf, and the stack 45 uses the data K output from the position determination unit 43.
The code is held once, and when the end signal is received, the held code is sequentially output.

【0193】上述の構成により、図33に示すデータ圧
縮装置では、前置データ保持部100A−1〜100A
−nが、入力データKの直前までに入力されたn個の入
力データからなる文脈を保持し、文脈履歴保持部101
Aが、入力データと文脈との組み合わせを保持し、符号
木保持部102Aが、文脈毎に独立した符号木を保持す
る。
With the configuration described above, in the data compression apparatus shown in FIG. 33, the pre-data holding units 100A-1 to 100A are provided.
-N holds the context consisting of n pieces of input data input up to immediately before the input data K, and the context history holding unit 101
A holds a combination of the input data and the context, and the code tree holding unit 102A holds an independent code tree for each context.

【0194】さらに、符号木決定部103Aが、前置デ
ータ保持部100A−1〜100A−nに保持されてい
る直前までの入力データからデータの符号木を決定し、
符号化部104Aが、符号木決定部103Aで選択した
符号木のルート(頂点)からデータKが格納されている
リーフに沿って途中に位置するノードからの分岐に従っ
て“0”か“1”で表される符号(固有のデータ)を出
力する。
Further, the code tree determination unit 103A determines the code tree of the data from the input data up to immediately before held in the prefix data holding units 100A-1 to 100A-n,
The encoding unit 104A selects "0" or "1" according to a branch from a node located along the leaf in which the data K is stored from the root (vertex) of the code tree selected by the code tree determination unit 103A. The code (unique data) represented is output.

【0195】また、符号長変更手段としての符号木更新
部105Aが、符号化したリーフと他のリーフあるいは
ノードとを組み替え、前置データ更新部106Aが、デ
ータKを前置データ保持手段100A−1に登録する。
ここで、上述の動作について、図35に示すフローチャ
ートの処理ステップA1〜A6を参照しながら、さらに
詳述する。
Further, the code tree updating unit 105A as the code length changing unit rearranges the coded leaf and another leaf or node, and the prefix data updating unit 106A stores the data K in the prefix data holding unit 100A-. Register to 1.
Here, the above operation will be described in more detail with reference to the processing steps A1 to A6 of the flowchart shown in FIG.

【0196】まず、前置データ保持部100A−1〜1
00A−nに保持されている文脈文字列Pを初期化し
(ステップA1)、符号化するデータKを入力する(ス
テップA2)。符号木決定部103Aは前置データ保持
部100A−1〜100A−nに保持されている文脈の
履歴を保持している文脈履歴保持部101Aから文脈P
に対応した符号木を決定し、決定した符号木と文脈履歴
保持部101Aの情報から、データKが保持されている
リーフのノード番号(ID)と文脈Pのルートのノード
番号(ID)を符号化部104Aに送り、符号化部10
4Aは、文脈Pに対応した符号木内において、事象K
(データK)のリーフからルートへのノードの分岐に対
応した符号を出力する(ステップA3)。なお、この符
号化部104Aが行なう処理については、図36を用い
て後に詳述する。
First, the front-end data holding units 100A-1 to 100-1
The context character string P held in 00A-n is initialized (step A1), and the data K to be encoded is input (step A2). The code tree determination unit 103A receives the context P from the context history holding unit 101A that holds the history of contexts held in the prefix data holding units 100A-1 to 100A-n.
Determines the code tree corresponding to, and from the information of the determined code tree and the context history holding unit 101A, codes the leaf node number (ID) holding the data K and the root node number (ID) of the context P. And sends it to the encoding unit 104A.
4A is the event K in the code tree corresponding to the context P.
The code corresponding to the branch of the node from the leaf of (data K) to the root is output (step A3). The processing performed by the encoding unit 104A will be described later in detail with reference to FIG.

【0197】そして、符号化部104Aにおいての符号
化後、符号木更新部105Aは、符号木の事象Kのリー
フを他のリーフあるいはノードと組み替え(ステップA
4)、元の符号木保持部102Aに格納することで符号
木の更新を行なう。なお、この符号木更新部105Aが
行なう処理については、図37を用いて後に詳述する。
After the coding in the coding unit 104A, the coding tree updating unit 105A rearranges the leaf of the event K of the coding tree with another leaf or node (step A
4) The code tree is updated by storing it in the original code tree holding unit 102A. The process performed by the code tree updating unit 105A will be described later in detail with reference to FIG.

【0198】さらに、文脈更新部106Aは、最も古い
データ(前置データ保持部100−nに保持されている
データ)を棄却し、入力データKを文脈として前置デー
タ保持部100A−1に登録することで、文脈文字列P
を更新する(ステップA5)。そして、全てのデータに
ついて符号化が終了したかをチェックし(ステップA
6)、終了していなければステップA2からの処理を繰
り返し、終了していれば符号化処理を終了する(ステッ
プA6のYESルート)。
Further, the context updating unit 106A rejects the oldest data (data held in the prefix data holding unit 100-n) and registers the input data K as the context in the prefix data holding unit 100A-1. The context string P
Is updated (step A5). Then, it is checked whether all the data have been encoded (step A
6) If not completed, the process from step A2 is repeated, and if completed, the encoding process is completed (YES route of step A6).

【0199】なお、上述のノードの組み変え(ステップ
A4)と文脈更新(ステップA5)の処理は、どちらを
先にしてもよく、また、並列に処理してもよい。次に、
処理ステップA3で述べたように、図34にて上述した
構成をもつ符号化部104Aが行なう符号化処理につい
て、図36の処理ステップB1〜B8を参照しながら説
明する。
[0199] It should be noted that the processing of changing the combination of nodes (step A4) and the processing of updating context (step A5) may be performed first, or may be performed in parallel. next,
As described in the processing step A3, the coding processing performed by the coding unit 104A having the configuration described above with reference to FIG. 34 will be described with reference to processing steps B1 to B8 in FIG.

【0200】まず、スタック45(push−down
stack)を初期化し(ステップB1)、カレント
ノードLのアドレスポインタを、データKが格納されて
いる文脈Pの符号木内のリーフにセットする(ステップ
B2)。そして、上述のステップA3で送られてきた、
データKが保持されているリーフのノード番号(ID)
を、ラッチ44から位置判別部43に送り、位置判別部
43は、この受け取ったノード番号のノードが上位ノー
ドのどちらに位置するかの情報をノード番号管理部42
から手得し、この情報から受け取ったノードが上位ノー
ドの右手に位置するかを判別する(ステップB3)。
First, the stack 45 (push-down
stack) is initialized (step B1), and the address pointer of the current node L is set to the leaf in the code tree of the context P in which the data K is stored (step B2). And, it was sent in the above step A3,
Node number (ID) of the leaf that holds data K
Is transmitted from the latch 44 to the position discriminating unit 43, and the position discriminating unit 43 provides the node number management unit 42 with information on which of the upper nodes the node having the received node number is located.
Then, it is determined whether the node received from this information is located on the right hand side of the upper node (step B3).

【0201】右手に位置する場合は“1”をスタック4
5にPush(出力)し(ステップB3のYESルート
からステップB4)、左手に位置する場合は、“0”を
スタック45にPush(出力)する(ステップB3の
NOルートからステップB5)。さらに、上述のステッ
プA3で送られてきた、もう1つのノード番号である文
脈Pのルートのノード番号(ID)を、上位ノード判別
部41に送り、上位ノード判別部41は、受け取ったノ
ード(あるいはリーフ)がルートであるか否かを判別す
る(ステップB6)。
If it is on the right side, stack "1" 4
Push (output) to 5 (from YES route of step B3 to step B4), and push (output) “0” to the stack 45 when located on the left hand (from NO route of step B3 to step B5). Further, the node number (ID) of the root of the context P that is the other node number sent in step A3 described above is sent to the upper node discriminating unit 41, and the upper node discriminating unit 41 receives the received node ( Alternatively, it is determined whether or not the leaf is the root (step B6).

【0202】そして、ルートであった場合、終了信号を
出力し(ステップB6のYESルート)、ルートではな
かった場合、ノード番号(ID)管理部42にアクセス
し、このノード(あるいはリーフ)の上位のノード
(U)の番号を手得し、このノード(U)を新たにカレ
ントノードLとしてアドレスポインタを上位ノードに移
動させ、ステップB3からの処理を繰り返す(ステップ
B6のNOルートからステップB7)。
If it is the root, an end signal is output (YES route of step B6), and if it is not the root, the node number (ID) management unit 42 is accessed and the upper node of this node (or leaf) is accessed. Of the node (U) of the above, the address pointer is moved to the upper node as a new current node L, and the process from step B3 is repeated (from NO route of step B6 to step B7). .

【0203】このようにして、アドレスポインタがルー
トに達するまで処理を繰り返すことで、スタック45に
は、リーフからルートへの“1”か“0”の数値で表さ
れる「道筋」が記憶される。そして、この「道筋」を、
逆に下位ビットから1ビットづつ出力(pop−up出
力)することで、ルートからリーフへの「道筋」が符号
として出力される(ステップB8)。
In this way, by repeating the processing until the address pointer reaches the root, the stack 45 stores the "path" represented by the numerical value "1" or "0" from the leaf to the root. It And this "route"
On the contrary, by outputting one bit at a time from the lower bit (pop-up output), the "route" from the root to the leaf is output as a code (step B8).

【0204】次に、処理ステップA4で前述したよう
に、符号木更新部105Aが、事象Kのリーフを他のリ
ーフあるいはノードと組み替える処理について、図37
の処理ステップC1〜C9を参照しながら詳述する。ま
ず、組み替えの対象となるノードZのアドレスポインタ
をリーフKにセットし(ステップC1)、ノードU0に
ノードZの上位ノードをセットする(ステップC2)。
Next, as described above in the processing step A4, the processing for the code tree updating unit 105A to rearrange the leaf of the event K with another leaf or node will be described with reference to FIG.
The processing steps C1 to C9 will be described in detail. First, the address pointer of the node Z to be rearranged is set in the leaf K (step C1), and the upper node of the node Z is set in the node U0 (step C2).

【0205】そして、Kの上位ノードU0が符号木のル
ートかどうかを判別し(ステップC3)、ルートであれ
ば組み替えを終了するが(ステップC3のYESルート
からステップC9)、ルートでなければノードU1にノ
ードU0の上位ノードをセットし(ステップC3のNO
ルートからステップC4)、ノードU0がノードU0の
上位ノードU1に対してどちらかに位置しているかを判
別する(ステップC5)。
Then, it is judged whether or not the upper node U0 of K is the root of the code tree (step C3), and if it is the root, the rearrangement is ended (YES route from step C3 to step C9). Set the upper node of node U0 to U1 (NO in step C3
From the root, step C4), it is determined whether the node U0 is located in one of the upper nodes U1 of the node U0 (step C5).

【0206】U0がU1の右手にある場合は、ノードX
にノードU1の左手に位置するノードをセットし(ステ
ップC5のYESルートからステップC6)、ノードZ
とノードXとを取り替える(ステップC8)。すなわ
ち、ノードU1の左手のノードとリーフKとを組み換え
る。一方、ノードU0がU1の左手にある場合は、ノー
ドXにノードU1の右手に位置するノードをセットし
(ステップC5のNOルートからステップC7)、ノー
ドZとノードXとを取り替える(ステップC8)。すな
わち、ノードU1の右手のノードとリーフKとを組み換
える。
If U0 is to the right of U1, node X
Set the node located on the left hand side of the node U1 to the node (from the YES route of step C5 to step C6), and set the node Z
And node X are replaced (step C8). That is, the left-hand node of the node U1 and the leaf K are recombined. On the other hand, when the node U0 is on the left side of U1, the node located on the right side of the node U1 is set to the node X (from NO route of step C5 to step C7), and the node Z and the node X are replaced (step C8). . That is, the right-hand node of the node U1 and the leaf K are recombined.

【0207】さらに、ノードZのアドレスポインタをノ
ードU1にセットすると(ステップC9)、上述のステ
ップC2に戻り、ステップC3において、セットしたア
ドレスポインタの上位ノードがルート,すなわち、アド
レスポインタがルートの直下のノードと判別されるまで
処理を繰り返す。この処理を行なうことで、アクセスさ
れたリーフのルートからの距離(符号長)は1/2にな
る。
Further, when the address pointer of the node Z is set in the node U1 (step C9), the process returns to the above step C2, and in step C3, the upper node of the set address pointer is the root, that is, the address pointer is directly under the root. The process is repeated until the node is determined to be a node. By performing this processing, the distance (code length) from the root of the accessed leaf is halved.

【0208】以上の処理を全ての入力文字について繰り
返すことにより、文字列を符号化することができる。こ
のように、関連技術2にかかるデータ圧縮方法を実施す
るためのデータ圧縮装置によれば、符号化する文字を、
木構造の文脈木に番号を付けて登録し、この文脈木に対
応した符号木をスプレイ符号化を施しながら作成・更新
することにより、出現する文字の出現頻度を求めて確率
モデルを構築して各文字に符号を割り当て符号表を作成
し、この符号表から符号化する文字の符号を出力すると
いう2段階の処理を同時に行なうことができるので、圧
縮処理の速度が大幅に向上するという効果がある。
A character string can be encoded by repeating the above processing for all input characters. As described above, according to the data compression apparatus for implementing the data compression method according to the related technique 2, the characters to be encoded are
The context tree of the tree structure is numbered and registered, and the code tree corresponding to this context tree is created and updated while performing the spray coding, and the probability model is constructed by obtaining the appearance frequency of the appearing characters. Since a code table is created by assigning a code to each character and the code of the character to be coded is output from this code table, it is possible to perform the two-stage processing at the same time, which has the effect of significantly improving the compression processing speed. is there.

【0209】また、上述のように、文字が入力されるご
とに符号木のノードの作成・更新(スプレイ処理)によ
り確率モデルを構築するので、文字が入力されるごとに
既に構築されている確率モデルを再構築するという膨大
な演算処理を省くことができるので、圧縮処理の速度が
さらに向上する効果がある。さらに、過去に圧縮(符号
化)した文字と同じ文字が出現する毎に、過去に登録し
てあった同じ文字の符号木のノードを上位のノードと組
み替えて符号長を1/2にする(スプレイ処理)ことに
より、同じ文字(列)が繰り返し出現するほど、その文
字(列)の符号は少ないビット数で表すことができるの
で、圧縮効果が大幅に向上する効果もある。
Further, as described above, since the probability model is constructed by creating / updating the nodes of the code tree (spray processing) each time a character is input, the probability that the character has already been constructed each time a character is input. Since a huge amount of calculation processing of reconstructing the model can be omitted, there is an effect that the compression processing speed is further improved. Further, every time the same character that has been compressed (encoded) appears in the past, the node of the code tree of the same character registered in the past is recombined with the upper node to reduce the code length to ½ ( By the spraying process), as the same character (string) appears repeatedly, the code of the character (string) can be represented by a smaller number of bits, so that the compression effect is significantly improved.

【0210】(2)復元側の説明 図38は、前述のデータ復元装置4の内部の構成例を示
すブロック図であり、この図38に示すように、200
A−1〜200A−n(nは自然数)は前置データ保持
部、201Aは文脈履歴保持部、202Aは符号木保持
部、203Aは符号木決定部、204Aは符号化部、2
05Aは符号木更新部、206Aは文脈更新部である。
(2) Description of Restoration Side FIG. 38 is a block diagram showing an example of the internal configuration of the data restoration device 4 described above. As shown in FIG.
A-1 to 200A-n (n is a natural number) is a prefix data holding unit, 201A is a context history holding unit, 202A is a code tree holding unit, 203A is a code tree determining unit, 204A is a coding unit, and 2A is a coding tree holding unit.
Reference numeral 05A is a code tree updating unit, and 206A is a context updating unit.

【0211】ここで、前置データ保持部(前置データ保
持手段)200A−1〜200A−nは、過去に復号し
たn個のデータを保持するものであり、文脈履歴保持部
(履歴保持手段)201Aは、復号したシンボルと文脈
との組み合わせを保持するものであり、符号木保持部
(符号木保持手段)202Aは、文脈毎に独立した符号
木を保持するものである。
Here, the prefix data holding units (prefix data holding means) 200A-1 to 200A-n hold n pieces of data decoded in the past, and the context history holding unit (history holding means). ) 201A holds a combination of the decoded symbol and context, and the code tree holding unit (code tree holding means) 202A holds an independent code tree for each context.

【0212】また、符号木決定部(符号木決定手段)2
03Aは、前置データ保持部200A−1〜200A−
nに保持されている文脈からシンボルを復号するための
符号木を決定するものであり、復号部(復号手段)20
4Aは、符号に従って符号木決定部203Aで選択した
符号木のルート(符号木の頂点)からノード(分岐点)
を走査して到達したリーフに格納されているシンボルを
出力するものである。
Also, the code tree determining unit (code tree determining means) 2
03A is a front data holding unit 200A-1 to 200A-
A code tree for decoding a symbol is determined from the context held in n, and the decoding unit (decoding means) 20
4A is a node (branch point) from the root (code tree vertex) of the code tree selected by the code tree determination unit 203A according to the code.
Is output by scanning the symbols stored in the leaf that has arrived.

【0213】さらに、符号木更新部(符号長変更手段)
205Aは、復号したリーフと他のリーフあるいはノー
ドとを組み替えるものであり、文脈更新部(前置データ
更新手段)206Aは、復号したシンボルを前置データ
保持部200A−1〜200A−nに登録するものであ
る。また、図39は、上述の復号部204Aの内部の構
成例を示すブロック図であり、この図39に示すよう
に、符号に従って符号木決定部203Aで選択した符号
木のルートからノードを走査して到達したリーフに格納
されているシンボルを出力するために、復号部204A
には、ノード番号管理部(メモリ)42と,ラッチ44
と,下位ノード判別部46と,葉/節判別部47とが設
けられている。
Further, the code tree updating unit (code length changing means)
205A is a combination of the decoded leaf and another leaf or node, and the context updating unit (prefix data updating unit) 206A registers the decoded symbol in the prefix data holding units 200A-1 to 200A-n. To do. 39 is a block diagram showing an example of the internal configuration of the decoding unit 204A described above. As shown in FIG. 39, the node is scanned from the root of the code tree selected by the code tree determination unit 203A according to the code. To output the symbols stored in the leaf that has reached
Includes a node number management unit (memory) 42 and a latch 44.
A lower node discriminating unit 46 and a leaf / node discriminating unit 47 are provided.

【0214】ここで、ノード番号管理部(メモリ)42
は、符号化側の説明中、図34にて前述したものと同様
のものであり、文脈木と符号木のノード番号を管理する
ものである。また、下位ノード判別部46は、符号と符
号木のルートのノード番号およびノード番号管理部42
の情報から下位ノードのノード番号を得るものであり、
葉/節判別部47は、下位ノード判別部46からの情報
とノード番号管理部42とから下位ノードがリーフかノ
ードかを判別するものであり、ラッチ48は、ルートの
ノード番号を一旦保持するものである。
Here, the node number management unit (memory) 42
Is the same as that described above with reference to FIG. 34 in the description on the encoding side, and manages the node numbers of the context tree and the code tree. The lower node discriminating unit 46 also includes a node number management unit 42 for the node number of the code and the root of the code tree.
The node number of the lower node is obtained from the information of
The leaf / node discriminating unit 47 discriminates whether the lower node is a leaf or a node from the information from the lower node discriminating unit 46 and the node number managing unit 42, and the latch 48 temporarily holds the node number of the root. It is a thing.

【0215】そして、上述の構成により、前置データ保
持部200A−1〜200A−nが、過去に復号したn
個の文脈(データ)を保持し、文脈履歴保持部201A
が復号したデータKと文脈との組み合わせを保持し、符
号木保持部202Aが、文脈毎に独立した符号木を保持
する。さらに、符号木決定部203Aが、前置データ保
持部200A−1〜200A−nに保持されている文脈
からデータKを復号するための符号木を決定し、復号部
204Aが、符号化されたデータKの符号に従って符号
木決定部203Aで選択した符号木のルート(頂点)か
らノード(分岐点)を走査して到達したリーフに格納さ
れているデータKを出力する。
With the above-described structure, the front data holding units 200A-1 to 200A-n decode n in the past.
The context history holding unit 201A holds each context (data).
Holds a combination of the data K decoded by and the context, and the code tree holding unit 202A holds an independent code tree for each context. Further, the code tree determination unit 203A determines a code tree for decoding the data K from the context held in the prefix data holding units 200A-1 to 200A-n, and the decoding unit 204A has performed coding. Data K stored in a leaf that has arrived by scanning a node (branch point) from the root (vertex) of the code tree selected by the code tree determination unit 203A according to the code of the data K is output.

【0216】また、符号長変更手段としての符号木更新
部205Aが、復号したリーフと他のリーフあるいはノ
ードとを組み替え、前置データ更新部206Aが、復号
したデータKを最新の文脈として前置データ保持部20
0A−1に登録する。以下、上述の処理について、図4
0に示すフローチャートの処理ステップF1〜F6を参
照しながら、さらに詳述する。
Further, the code tree updating unit 205A as a code length changing unit rearranges the decoded leaf and another leaf or node, and the prefix data updating unit 206A prefixes the decoded data K with the latest context. Data holding unit 20
Register with 0A-1. Hereinafter, regarding the above-mentioned processing, FIG.
Further details will be described with reference to process steps F1 to F6 of the flowchart shown in FIG.

【0217】まず、前置データ保持部200A−1〜2
00A−nに保持されているn個の文脈文字列Pを初期
化し(ステップF1)、復号する事象(データ)Kを入
力する(ステップF2)。符号木決定部203Aは前置
データ保持部200A−1〜200A−nに保持されて
いる文脈の履歴を保持している文脈履歴保持部201A
から文脈Pに対応した符号木を決定し、決定した符号木
のルートのノード番号(ID)と、復号する事象Kの符
号とを復号部204Aに送り、復号部204Aは、決定
した符号木内において、送られてきた符号に応じて、ル
ートから事象Kが格納されているリーフへ走査して符号
を復号する(ステップF3)。なお、この復号部204
Aが行なう処理については、図41を用いて後に詳述す
る。
First, the front data holding sections 200A-1 and 200A-2
The n context character strings P held in 00A-n are initialized (step F1), and the event (data) K to be decoded is input (step F2). The code tree determination unit 203A holds a context history holding unit 201A holding the history of contexts held in the prefix data holding units 200A-1 to 200A-n.
To determine a code tree corresponding to the context P, and send the node number (ID) of the root of the determined code tree and the code of the event K to be decoded to the decoding unit 204A, and the decoding unit 204A in the determined code tree. , And decodes the code by scanning from the root to the leaf in which the event K is stored, according to the code sent (step F3). Note that this decoding unit 204
The process performed by A will be described in detail later with reference to FIG.

【0218】そして、復号後、符号木更新部205A
は、符号木の復号した事象Kのリーフを他のリーフある
いはノードと組み替え(ステップF4)、元の符号木保
持部202Aに格納することで符号木の更新を行なう。
なお、この符号木更新部205Aが行なうノードの組み
替え処理は、図37のフローチャートにて前述した符号
木更新部105Aが行なう処理ステップC1〜C9と同
様にして行なう。
Then, after decoding, the code tree updating unit 205A
Updates the code tree by recombining the leaf of the decoded event K with another leaf or node (step F4) and storing it in the original code tree holding unit 202A.
The node rearrangement process performed by the code tree updating unit 205A is performed in the same manner as the processing steps C1 to C9 performed by the code tree updating unit 105A described above with reference to the flowchart of FIG.

【0219】さらに、文脈更新部206Aは、最も古い
データ(前置データ保持部200−nに保持されている
データ)を棄却し、復号した事象(データ)Kを文脈と
して前置データ保持部200−1に登録することで、文
脈文字列Pを更新する(ステップF5)。そして、全て
のデータについて復号が終了したかをチェックし(ステ
ップF6)、終了していなければステップF2からの処
理を繰り返し(ステップF6のNOルート)、そうでな
ければ復号処理を終了する(ステップF6のYESルー
ト)。
Further, the context updating unit 206A rejects the oldest data (data held in the prefix data holding unit 200-n), and uses the decoded event (data) K as the context to prefix data holding unit 200. The context character string P is updated by registering it in -1 (step F5). Then, it is checked whether the decoding is completed for all the data (step F6). If not completed, the processing from step F2 is repeated (NO route of step F6), and if not, the decoding processing is completed (step F6). F6 YES route).

【0220】なお、この場合も符号化側と同様に、上述
のノードの組み変え(ステップF4)と文脈更新(ステ
ップF5)の処理は、どちらを先にしてもよく、また、
並列に処理してもよい。次に、処理ステップF3で述べ
たように、図39にて上述した構成をもつ復号部204
Aが行なう符号化処理について、図41に示すフローチ
ャートの処理ステップG1〜G7を参照しながら説明す
る。
In this case as well, as in the case of the encoding side, either of the processing of changing the nodes (step F4) and the processing of updating the context (step F5) may be performed first.
You may process in parallel. Next, as described in the processing step F3, the decoding unit 204 having the configuration described above with reference to FIG.
The encoding process performed by A will be described with reference to process steps G1 to G7 in the flowchart shown in FIG.

【0221】まず、下位ノード判別部46は、符号木決
定部203Aから送られてきたルートのノード番号(I
D)をノードZにセットし(ステップG1)、ラッチ4
8を介して同じく符号木決定部203Aから送られてき
た、復号する事象Kの符号(1bit)をCにセットす
る(ステップG2)。そして、Cにセットした復号する
事象Kの符号が“1”に一致するかをチェックし(ステ
ップG3)、“1”である(Yesの)場合はノードZ
の右手にあるノードをノードZにセットし(ステップG
3のYESルートからステップG4)、“1”でない場
合(すなわち“0”の場合)はノードZの左手にあるノ
ードをノードZにセットする(ステップG3のNOルー
トからステップG5)。さらに、下位ノード判別部46
は、ノードZにセットしたノードのノード番号をもと
に、ノード番号管理部42からノードZのノード番号を
取得し、このノード番号を葉/節判別部47に送り、こ
の葉/節判別部47では、送られてきたノード番号をも
つノードZの位置情報をノード番号管理部42から手得
し、このノードZがノードであるかリーフであるかをチ
ェックする(ステップG6)。
First, the lower node discriminating section 46 determines the node number (I) of the root sent from the code tree determining section 203A.
D) is set to the node Z (step G1), and the latch 4
The code (1 bit) of the event K to be decoded, which is also sent from the code tree determination unit 203A via 8 is set to C (step G2). Then, it is checked whether the code of the event K to be decoded set in C matches "1" (step G3), and if it is "1" (Yes), the node Z is detected.
Set the node on the right hand side of node to node Z (step G
From the YES route of 3 to step G4), if it is not "1" (that is, "0"), the node on the left side of the node Z is set to the node Z (from NO route of step G3 to step G5). Further, the lower node discriminating unit 46
Acquires the node number of the node Z from the node number management unit 42 based on the node number of the node set in the node Z, sends this node number to the leaf / node discrimination unit 47, and this leaf / node discrimination unit At 47, the position information of the node Z having the sent node number is acquired from the node number management unit 42, and it is checked whether this node Z is a node or a leaf (step G6).

【0222】ノードZがリーフでない場合(ステップG
6のNOルート)、処理はステップG2に戻り、復号す
る事象Kが格納されているリーフに到達するまで処理を
繰り返す。一方、ノードZがリーフである場合(ステッ
プG6のYESルート)、復号する事象Kが見つかった
ことになるので、葉/節判別部47は、ノード番号管理
部42にシンボル(事象)出力信号を送信し、この信号
を受信したノード番号管理部42が、このリーフに格納
されている事象K(シンボル)を出力するとともに(ス
テップG7)、復号処理の終了信号を出力する。
If node Z is not a leaf (step G
No. 6), the process returns to step G2, and the process is repeated until the leaf in which the event K to be decoded is stored is reached. On the other hand, when the node Z is a leaf (YES route in step G6), it means that the event K to be decoded has been found, so the leaf / node determination unit 47 sends the symbol (event) output signal to the node number management unit 42. The node number management unit 42 that has transmitted and received this signal outputs the event K (symbol) stored in this leaf (step G7) and outputs the end signal of the decoding process.

【0223】これにより、符号化側で作成された符号木
の“1”か“0”の数値で表される「道筋」を、事象K
が格納されているリーフまで辿ることにより符号化され
た事象Kを復号することができる。このように、関連技
術2にかかるデータ復元方法を実施するためのデータ復
元装置によれば、復号した文字を木構造の文脈木に番号
を付けて登録し、この文脈木に対応した符号木をスプレ
イ処理を施しながら作成・更新することにより、復号す
る文字の符号と一致する符号を符号表から検索し、その
一致した符号に対応して登録されている文字を復号文字
として出力するという2段階の処理を同時に行なうこと
ができるので、データの復元処理の速度が大幅に向上す
るという効果がある。
As a result, the "path" represented by the numerical value "1" or "0" of the code tree created on the encoding side is converted into the event K.
The encoded event K can be decoded by tracing to the leaf in which is stored. As described above, according to the data restoration device for carrying out the data restoration method according to the related technique 2, the decoded characters are registered by numbering the context tree of the tree structure, and the code tree corresponding to the context tree is registered. A two-step process in which a code that matches the code of the character to be decoded is searched from the code table by creating and updating while performing the spray process, and the character registered corresponding to the matched code is output as the decoded character. Since the processing can be performed simultaneously, there is an effect that the speed of the data restoration processing is significantly improved.

【0224】また、符号化側と同様に、文字が入力され
るごとに符号木のノードの作成・更新(スプレイ処理)
により構築するので、文字が入力されるごとに既に構築
されている確率モデルを再構築するという膨大な演算処
理を行なう必要がなくなり、これによりデータの復元処
理の速度がさらに向上する効果がある。さらに、これも
符号化側と同様に、過去に復号した符号と同じ符号が出
現する毎に、過去に登録してあった同じ符号の符号木の
ノードを上位のノードと組み替えて(スプレイ処理)符
号長を1/2にすることにより、同じ符号を繰り返し復
元するほど、その符号は少ないビット数で表すことがで
きるので、復元効果が大幅に向上する効果もある。 (b−1)関連技術2の第1の変形例の説明 (1)符号化側の説明 図42は、関連技術2の変形例としてのデータ圧縮装置
3の内部の構成を示すものであり、この図42に示すよ
うに、本データ圧縮装置3の内部には、図33にて前述
した構成に加えて、文脈判別部108A,文脈変更部1
10Aとが設けられており、また、図33にて前述した
符号化部104A,符号木保持部105Aの代わりに、
それぞれ符号化部104A′,符号木保持部107Aが
設けられている。
As with the encoding side, every time a character is input, a node in the code tree is created / updated (spray processing).
Since it is constructed by, it is not necessary to perform a huge calculation process of reconstructing the already constructed probabilistic model each time a character is input, which has the effect of further improving the speed of the data restoration process. Further, like the encoding side, each time the same code as the code decoded in the past appears, the node of the code tree of the same code registered in the past is recombined with the upper node (spray processing). By reducing the code length to ½, as the same code is repeatedly restored, the code can be represented by a smaller number of bits, which also has the effect of significantly improving the restoration effect. (B-1) Description of First Modification of Related Technology 2 (1) Description of Encoding Side FIG. 42 shows an internal configuration of a data compression device 3 as a modification of Related Technology 2. As shown in FIG. 42, in addition to the configuration described above with reference to FIG. 33, the inside of the data compression apparatus 3 includes a context discriminating unit 108A and a context changing unit 1.
10A is provided, and instead of the encoding unit 104A and the code tree holding unit 105A described above with reference to FIG. 33,
An encoding unit 104A 'and a code tree holding unit 107A are provided respectively.

【0225】このため、この図42中、図33にて既述
の符号と同じ符号の構成部分の説明は省略し、図33と
は異なる構成部分についてのみ、以下に説明する。即
ち、符号化部104A′は符号出力手段およびエスケー
プコード出力手段として、符号木にシンボルが登録され
ていないときは符号木のルートからエスケープコードが
格納されているリーフまでの途中に位置するノードから
の分岐に従ってエスケープコードを出力し、符号木にシ
ンボルが登録されているときは符号木のルートからシン
ボルのリーフまでの途中に位置するノードからの分岐に
従ってシンボルの符号を出力するものである。
Therefore, in FIG. 42, description of components having the same reference numerals as those already described in FIG. 33 is omitted, and only components different from those in FIG. 33 will be described below. That is, the encoding unit 104A 'serves as a code output means and an escape code output means from a node located on the way from the root of the code tree to the leaf where the escape code is stored when the symbol is not registered in the code tree. When the symbol is registered in the code tree, the escape code is output according to the branch of, and the code of the symbol is output according to the branch from the node located midway from the root of the code tree to the leaf of the symbol.

【0226】さらに、この符号化部104A′は制御手
段として、エスケープコードを符号化したときはデータ
の符号化を行なうまで処理を繰り返すようになってい
る。また、符号木保持部(符号木保持手段)107A
は、シンボルが未登録であることを示すエスケープコー
ド(ESC)をあらかじめ登録した文脈毎に独立した符
号木を保持するものであり、文脈判別部(文脈判別手
段)108Aは、符号木決定部103で決定した符号木
にシンボルが登録されているか否かを判別するものであ
り、文脈変更部(文脈変更手段)110Aは、符号木に
シンボルが登録されていないときに文脈の長さを短くす
るものである。
Further, the encoding unit 104A 'serves as a control means, and when the escape code is encoded, the processing is repeated until the data is encoded. A code tree holding unit (code tree holding means) 107A
Holds an independent code tree for each context in which an escape code (ESC) indicating that a symbol has not been registered is registered in advance. The context discriminator (context discriminator) 108A includes a code tree determiner 103. It is for determining whether or not a symbol is registered in the code tree determined in step S1, and the context changing unit (context changing means) 110A shortens the length of the context when no symbol is registered in the code tree. It is a thing.

【0227】そして、このような図33とは異なる構成
により、図42に示すデータ圧縮装置3では、符号化部
104A′が、符号木にシンボルKが登録されていない
ときは符号木のルートからESCが格納されているリー
フまでの途中に位置するノードからの分岐に従ってES
Cの符号を出力し、符号木にシンボルKが登録されてい
るときは符号木のルートからシンボルKのリーフまでの
途中に位置するノードからの分岐に従ってシンボルKの
符号を出力する。
With such a configuration different from that of FIG. 33, in the data compression apparatus 3 shown in FIG. 42, the coding unit 104A 'starts from the root of the code tree when the symbol K is not registered in the code tree. ES according to the branch from the node located on the way to the leaf where the ESC is stored
The code of C is output, and when the symbol K is registered in the code tree, the code of the symbol K is output according to the branch from the node located on the way from the root of the code tree to the leaf of the symbol K.

【0228】また、ESCを符号化したときはデータK
の符号化を行なうまで処理を繰り返す。さらに、符号木
保持部107Aが、シンボルが未登録であることを示す
エスケープコード(ESC)をあらかじめ登録した文脈
毎に独立した符号木を保持する。
When the ESC is encoded, the data K
The process is repeated until the encoding is performed. Further, the code tree holding unit 107A holds an independent code tree for each context in which an escape code (ESC) indicating that a symbol has not been registered is registered in advance.

【0229】以下、上述の処理について、図43に示す
フローチャートの処理ステップH1〜H11を参照しな
がら、さらに詳述する。まず、文脈変更部110Aが、
前置データ保持部200A−1〜200A−nに保持さ
れている全ての文脈から文脈文字列P0を初期化し(ス
テップH1)、この文脈文字列P0を文脈Pにセットし
ておき(ステップH2)、そして、符号化するデータ
(シンボル)Kを入力する(ステップH3)。
The above process will be described in more detail below with reference to process steps H1 to H11 of the flowchart shown in FIG. First, the context changing unit 110A
The context character string P 0 is initialized from all the contexts stored in the prefix data storage units 200A-1 to 200A-n (step H1), and this context character string P 0 is set in the context P (step S1). H2), and the data (symbol) K to be encoded is input (step H3).

【0230】さらに、文脈変更部110Aは、文脈Pと
データKの情報を文脈履歴保持部101A及び符号木決
定手段103Aへ送り、文脈履歴保持部101Aでは、
文脈変更部110Aから送られてきた文脈Pの情報を、
文脈判別部108Aに送る。そして、文脈判別部108
Aは、受信した文脈Pの情報からこの文脈Pに事象Kが
登録されているか否かを判別する(ステップH4)。
Further, the context changing unit 110A sends the information of the context P and the data K to the context history holding unit 101A and the code tree determining unit 103A, and the context history holding unit 101A
Information of the context P sent from the context changing unit 110A is
It is sent to the context discrimination unit 108A. Then, the context discrimination unit 108
Based on the received information on the context P, A determines whether or not the event K is registered in this context P (step H4).

【0231】ここで、文脈Pに事象Kが登録されている
場合は、文脈履歴保持部101Aが、符号化部104
A′にエスケープコード(ESC)の符号化を指示し、
符号化部104A′では、文脈Pに対応した符号木内に
おいて、エスケープコード(ESC)のリーフからルー
トへのノードの分岐に対応した符号を出力してエスケー
プコードの符号化を行なう(ステップH4のNOルート
からステップH5)。
Here, if the event K is registered in the context P, the context history holding unit 101A causes the encoding unit 104 to operate.
Instruct A'to encode the escape code (ESC),
The encoding unit 104A 'outputs the code corresponding to the branch of the node from the leaf of the escape code (ESC) to the root in the code tree corresponding to the context P to encode the escape code (NO in step H4). From root to step H5).

【0232】さらに、符号化部104A′は、符号木決
定部103Aを通じて符号木更新部105Aに、符号木
の更新を指示し、符号木更新部105Aは、符号木のE
SCのリーフを他のリーフあるいはノードと取り替える
(ステップH6)。そして、文脈Pの次数(符号木の初
期状態が0次である)を1つ低次に移し(ステップH
7)、ステップH4に戻り、文脈Pに事象Kが登録され
ている(Yes)と判断されるまで処理を繰り返す。
Further, the coding unit 104A 'instructs the code tree updating unit 105A through the code tree determining unit 103A to update the code tree, and the code tree updating unit 105A causes the code tree E to be updated.
The leaf of SC is replaced with another leaf or node (step H6). Then, the order of the context P (the initial state of the code tree is 0th order) is moved to the next lower level (step H
7) Return to step H4, and repeat the process until it is determined that the event K is registered in the context P (Yes).

【0233】一方、上述のステップH4で、文脈Pに事
象Kが登録されている(Yesの)場合は、文脈履歴保
持部101Aが、符号化部104A′に事象Kの符号化
を指示し、符号化部104A′では、文脈Pに対応した
符号木内において、事象Kのリーフからルートへのノー
ドの分岐に対応した符号を出力して符号化を行なう(ス
テップH4のYESルートからステップH8)。
On the other hand, when the event K is registered in the context P (Yes in step H4), the context history holding unit 101A instructs the encoding unit 104A 'to encode the event K, The coding unit 104A 'outputs the code corresponding to the branch of the node from the leaf of the event K to the root in the code tree corresponding to the context P, and performs coding (from YES root of step H4 to step H8).

【0234】そして、符号化部104A′は、符号木決
定部103Aを通じて符号木更新部105Aに、符号木
の更新を指示し、符号木更新部105Aは、符号木の事
象Kのリーフと他のリーフあるいはノードとを組み替え
る(ステップH9)。さらに、文脈更新部106Aが最
も古いデータ(前置データ保持部100−nに保持され
ているデータ)を棄却して入力データKの文脈を前置デ
ータ保持部100A−1に登録し、この情報から文脈変
更部110Aが文脈文字列P0の更新を行なう(ステッ
プH10)。
Then, the coding unit 104A 'instructs the code tree updating unit 105A through the code tree determining unit 103A to update the code tree, and the code tree updating unit 105A and the leaf of the event K of the code tree and other The leaf or node is recombined (step H9). Furthermore, the context updating unit 106A rejects the oldest data (data held in the prefix data holding unit 100-n) and registers the context of the input data K in the prefix data holding unit 100A-1. Then, the context changing unit 110A updates the context character string P 0 (step H10).

【0235】そして、全てのデータについて符号化が終
了したかをチェックし(ステップH11)、終了してい
ない場合は(ステップH11のNOルート)、ステップ
H2に戻り、全てのデータを符号化するまでステップH
2以降の処理を繰り返し、終了している場合は(ステッ
プH11のYESルート)、符号化の全ての処理を終了
する。
Then, it is checked whether the coding is completed for all the data (step H11), and if not completed (NO route of step H11), the process returns to step H2 until all the data is coded. Step H
If the process after 2 is repeated and the process is completed (YES route of step H11), all the processes for encoding are completed.

【0236】なお、上述のステップH5およびステップ
H8における符号出力処理の詳細については、図36に
て前述した処理ステップB1〜B8を参照されたく、ス
テップH6およびステップH9におけるリーフあるいは
ノードの組み替え処理の詳細については、同じく第2実
施形態中、図37にて上述した処理ステップC1〜C9
を参照されたい。
For details of the code output processing in steps H5 and H8, refer to the processing steps B1 to B8 described above with reference to FIG. 36, and the leaf or node rearrangement processing in steps H6 and H9. For details, also in the second embodiment, the processing steps C1 to C9 described above with reference to FIG. 37.
Please refer to.

【0237】このように、関連技術2の第1変形例にか
かるデータ圧縮装置によれば、シンボルが登録されてい
ないことを表すエスケープコード(ESC)を予め符号
木に登録しておき、符号化するシンボルが予め登録され
ている文脈に含まれない間(シンボルが含まれる文脈を
発見して符号化するまでの間)はこのエスケープコード
の符号を出力することにより、入力データとして現れる
シンボルの組み合わせ(文脈)全てを予め登録しておか
なくてもよいので、文脈の登録に使用するメモリを大幅
に削減できる利点がある。
As described above, according to the data compression apparatus in the first modification of the related technique 2, the escape code (ESC) indicating that the symbol is not registered is registered in the code tree in advance and the encoding is performed. The combination of symbols that appear as input data is output by outputting the code of this escape code while the symbol to be used is not included in the pre-registered context (until the context in which the symbol is included is detected and encoded). Since it is not necessary to register all (contexts) in advance, there is an advantage that the memory used for registering contexts can be significantly reduced.

【0238】そして、上述のように予め登録されている
文脈に符号化するシンボルが含まれない間に出力するエ
スケープコードの符号長を、スプレイ処理により短く
(1/2)してゆくことにより、シンボルが含まれる文
脈を発見して符号化するまでの時間を短縮することがで
きるので、データ圧縮の処理速度が大幅に向上するとと
もにデータ圧縮装置の処理負荷も大幅に軽減できる効果
がある。
Then, as described above, by shortening (1/2) the code length of the escape code output while the symbol to be encoded is not included in the context registered in advance by the spray process, Since it is possible to shorten the time until the context in which the symbol is included is detected and encoded, the processing speed of data compression is significantly improved, and the processing load of the data compression device can be significantly reduced.

【0239】(2)復元側の説明 図44は、関連技術2の第1の変形例としてのデータ復
元装置4の内部の構成を示すものであり、この図44に
示すように、本データ復元装置4の内部には、図38に
て前述した構成に加えて、文脈変更部210Aが設けら
れており、また、復号部204A,符号木保持部205
Aの代わりに、それぞれ復号部204A′,符号木保持
部207Aが設けられている。
(2) Description of Restoration Side FIG. 44 shows the internal structure of the data restoration device 4 as a first modification of the related technique 2. As shown in FIG. Inside the device 4, a context changing unit 210A is provided in addition to the configuration described above with reference to FIG. 38, and a decoding unit 204A and a code tree holding unit 205 are provided.
Instead of A, a decoding unit 204A 'and a code tree holding unit 207A are provided respectively.

【0240】このため、この図44中、図38にて既述
の符号と同じ符号の構成部分の説明は省略し、図38に
示す構成とは異なる構成部分について、以下に説明す
る。即ち、符号木保持部(符号木保持手段)207A
は、エスケープコードをあらかじめ登録した符号木を保
持するものであり、文脈変更部(文脈変更手段)210
Aは、出力したデータがエスケープコードであったとき
入力されたデータを棄却し文脈を短くするものである。
Therefore, in FIG. 44, description of the components having the same reference numerals as those already described in FIG. 38 is omitted, and the components different from the configuration shown in FIG. 38 will be described below. That is, the code tree holding unit (code tree holding means) 207A
Holds a code tree in which escape codes are registered in advance, and a context changing unit (context changing means) 210
A is to reject the input data and shorten the context when the output data is an escape code.

【0241】また、復号部204A′は復号手段とし
て、上述の符号化側で符号化された符号に従って、符号
木決定部203Aで選択した符号木のルート(頂点)か
らノード(分岐点)を走査して到達したリーフに格納さ
れているデータを出力するものである。さらに、復号部
204A′は制御手段として、エスケープコードを復号
した時は、文脈変更部210Aで上述のように文脈を再
設定し、エスケープコード以外のデータが復号されるま
で処理を繰り返す制御を行なうようになっている。
Further, the decoding unit 204A ', as a decoding means, scans a node (branch point) from the root (vertex) of the code tree selected by the code tree determination unit 203A according to the code encoded on the encoding side. Then, the data stored in the leaf that has arrived is output. Further, when the escape code is decoded, the decoding unit 204A 'resets the context as described above when the escape code is decoded, and performs control to repeat the process until data other than the escape code is decoded. It is like this.

【0242】そして、上述のような図38に示す構成と
は異なる構成により、図44に示すデータ復元装置で
は、符号木保持部207AがESCをあらかじめ登録し
た符号木を保持し、文脈変更部210Aが出力したデー
タKがESCであったとき入力されたデータKを棄却し
文脈を短くする。また、復号部204A′が、符号化さ
れたデータKの符号に従って、符号木決定部203Aで
選択した符号木のルートからノードを走査して到達した
リーフに格納されているデータKを出力し、ESCを復
号した時は、文脈変更部210Aで文脈の次数を変更
し、ESC以外のデータKが復号されるまで処理を繰り
返す。
With the configuration different from the configuration shown in FIG. 38 as described above, in the data restoration device shown in FIG. 44, the code tree holding unit 207A holds the code tree in which ESC is registered in advance, and the context changing unit 210A When the data K output by is ESC, the input data K is rejected and the context is shortened. In addition, the decoding unit 204A ′ outputs the data K stored in the leaf reached by scanning the node from the root of the code tree selected by the code tree determining unit 203A according to the code of the encoded data K, When the ESC is decoded, the context changing unit 210A changes the order of the context and repeats the process until the data K other than the ESC is decoded.

【0243】ここで、上述のような動作について、図4
5に示すフローチャートの処理ステップJ1〜J9を参
照しながら、さらに詳述する。まず、文脈変更部210
Aが、前置データ保持部200A−1〜200A−nに
保持されている全ての文脈から文脈文字列P0を初期化
し(ステップJ1)、この文脈文字列P0を文脈Pにセ
ットしておく(ステップJ2)。
Here, the operation as described above will be described with reference to FIG.
Further details will be described with reference to process steps J1 to J9 of the flowchart shown in FIG. First, the context changing unit 210
A initializes the context character string P 0 from all the contexts stored in the prefix data storage units 200A-1 to 200A-n (step J1) and sets this context character string P 0 in the context P. (Step J2).

【0244】そして、文脈変更部110Aは、この文脈
Pを文脈履歴保持部201Aおよび符号木決定部203
Aに送り、符号木決定部203Aでは、受け取った文脈
Pから符号木を選択(決定)し(ステップJ3)、決定
した符号木を復号部204A′に送る。復号部204
A′では、決定した符号木内において、符号化側で符号
化された符号に応じてルートからリーフへ走査して符号
を復号する(ステップJ4)。なお、この復号部204
A′が行なう処理の詳細については、図41にて前述し
た処理ステップG1〜G7を参照されたい。
Then, the context changing unit 110A sets the context P to the context history holding unit 201A and the code tree determining unit 203.
The code tree determining unit 203A selects (determines) a code tree from the received context P (step J3), and sends the determined code tree to the decoding unit 204A '. Decoding unit 204
In A ', the code is decoded by scanning from the root to the leaves in the determined code tree according to the code encoded on the encoding side (step J4). Note that this decoding unit 204
For details of the processing performed by A ', refer to the processing steps G1 to G7 described above with reference to FIG.

【0245】そして、復号部204A′は、復号した事
象KがESC(エスケープコード)であるか否かをチェ
ックし(ステップJ5)、復号した事象KがESCであ
る場合は、ESC信号を文脈変更部210Aに送信する
(ステップJ5のYESルート)。さらに、このESC
信号を受信した文脈変更部210Aでは、文脈Pの次数
を1つ低次に移して変更し(例えば、前置データ保持部
200−nに保持されている最も古いデータを無視して
n−1次の文脈Pを作る)(ステップJ6)、この文脈
Pを文脈履歴保持部201及び符号木決定手段203へ
送り、処理はステップJ3に戻る。
Then, the decoding section 204A 'checks whether or not the decoded event K is ESC (escape code) (step J5), and if the decoded event K is ESC, changes the context of the ESC signal. It is transmitted to the section 210A (YES route of step J5). Furthermore, this ESC
Upon receiving the signal, the context changing unit 210A changes the order of the context P by moving it to the next lower order (for example, ignoring the oldest data held in the pre-data holding unit 200-n, n-1). The next context P is created) (step J6), this context P is sent to the context history holding unit 201 and the code tree determination means 203, and the process returns to step J3.

【0246】すなわち、復号化部204A′が、ESC
以外の事象Kを復号するまでステップJ2からの処理を
繰り返す。一方、復号した事象KがESCでない場合
は、復号した事象Kのリーフを他のリーフあるいはノー
ドと組み替える(ステップJ5のNOルートからステッ
プJ7)。なお、このリーフあるいはノードの組み替え
処理の詳細については、図37にて前述したフローチャ
ートにおける処理ステップC1〜C9を参照されたい。
That is, the decoding section 204A 'determines that the ESC
The processing from step J2 is repeated until the event K other than is decoded. On the other hand, when the decrypted event K is not ESC, the leaf of the decrypted event K is recombined with another leaf or node (from NO route of step J5 to step J7). For details of this leaf or node rearrangement processing, refer to the processing steps C1 to C9 in the flowchart described above with reference to FIG.

【0247】さらに、文脈更新部206Aは、最も古い
データ(前置データ保持部200−nに保持されている
データ)を棄却し、復号した事象Kを文脈として前置デ
ータ保持部200−1に挿入して登録し、文脈文字列P
0を更新する(ステップJ8)。そして、全てのデータ
について復号が終了したかをチェックし(ステップJ
9)、終了していなければ、ステップJ2からの処理を
繰り返し(ステップJ9のNOルートからステップJ
2)、そうでなければ復号処理を終了する(ステップJ
9のYESルート)。
Further, the context updating unit 206A rejects the oldest data (data held in the prefix data holding unit 200-n), and sets the decoded event K as the context in the prefix data holding unit 200-1. Insert and register, context string P
0 is updated (step J8). Then, it is checked whether the decoding is completed for all the data (step J
9) If not completed, the processes from step J2 are repeated (from NO route of step J9 to step J).
2) If not, the decryption process ends (step J).
9 YES route).

【0248】なお、この場合も符号化側と同様に、上述
のノードの組み変え(ステップJ7)と文脈更新(ステ
ップJ8)の処理は、どちらを先にしてもよく、また、
並列に処理してもよい。このように、関連技術2の第1
変形例にかかるデータ復元装置によれば、シンボルが登
録されていないことを表すエスケープコード(ESC)
を予め符号木に登録しておき、復号したシンボルがこの
エスケープコードであった場合に、エスケープコード以
外の符号(すなわち、復号するシンボルの符号)を復号
するまで文脈を短く(変更)して復号するシンボルの符
号を検索することにより、入力データとして現れるシン
ボルの組み合わせ(文脈)全てを予め符号木に登録して
おかなくてもよいので、文脈の登録に使用するメモリを
大幅に削減できる利点がある。
In this case as well, as in the case of the encoding side, either of the processing of changing the nodes (step J7) and the processing of updating the context (step J8) may be performed first.
You may process in parallel. In this way, the first of Related Technology 2
According to the data restoration device according to the modification, the escape code (ESC) indicating that the symbol is not registered
If the decoded symbol is this escape code, the context is shortened (changed) and decoded until the code other than the escape code (that is, the code of the symbol to be decoded) is decoded. By searching for the code of the symbol to be used, it is not necessary to register all the combinations (contexts) of the symbols that appear as the input data in the code tree in advance, which has the advantage of significantly reducing the memory used for registering the context. is there.

【0249】そして、上述のように復号したシンボルが
エスケープコードである間、このエスケープコードの符
号長をスプレイ処理により短く(1/2)してゆくこと
により、復号するシンボルが含まれる文脈を発見して復
号するまでの時間を短縮することができるので、データ
復元処理の速度が大幅に向上するとともにデータ復元装
置の処理負荷も大幅に軽減できる効果がある。 (b−2)関連技術2の第2の変形例の説明 (1)符号化側の説明 図46は、関連技術2の第2の変形例としてのデータ圧
縮装置3の内部の構成例を示すものであり、この図46
に示すように、本データ圧縮装置3の内部には、関連技
術2の第1の変形例の説明中、図38にて前述した構成
に加えて、さらに符号登録部112Aが設けられてい
る。
While the decoded symbol is the escape code as described above, the code length of the escape code is shortened (1/2) by the spray process to find the context including the symbol to be decoded. Since it is possible to shorten the time until decoding is performed, there is an effect that the speed of the data restoration processing is significantly improved and the processing load of the data restoration device is also greatly reduced. (B-2) Description of Second Modification of Related Technology 2 (1) Description of Encoding Side FIG. 46 shows an internal configuration example of a data compression device 3 as a second modification of Related Technology 2. This Figure 46
As shown in FIG. 38, a code registration unit 112A is further provided inside the data compression device 3 in addition to the configuration described above with reference to FIG. 38 in the description of the first modified example of the related technique 2.

【0250】このため、この図42中、図33にて既述
の符号と同じ符号の構成部分の説明は省略する。また、
符号登録部112Aは、入力されたデータKが符号木に
登録されていないときに、このデータKを符号木に登録
するものである。このような構成により、入力されたデ
ータKが符号木に登録されていないときに、符号登録部
112Aが符号木にデータKを登録するようにすること
ができる。
Therefore, in FIG. 42, description of the components having the same reference numerals as those already described in FIG. 33 will be omitted. Also,
The code registration unit 112A registers the input data K in the code tree when the data K is not registered in the code tree. With such a configuration, when the input data K is not registered in the code tree, the code registration unit 112A can register the data K in the code tree.

【0251】ここで、上述のような動作について、図4
7の処理ステップK1〜K12を参照しながら説明する
が、ここで、この図47に示すように、ステップK8以
外の処理は、図43のフローチャートにて前述した処理
ステップH1〜H11と同様の処理である。すなわち、
本例ではステップK1〜K7において、図43中のステ
ップH1〜H7と同様の処理が行なわれ、そのあとにス
テップK8にかかる処理が行われる。
Here, the operation as described above will be described with reference to FIG.
The processing will be described with reference to the processing steps K1 to K12 of step 7. Here, as shown in FIG. 47, the processing other than step K8 is the same as the processing steps H1 to H11 described above in the flowchart of FIG. Is. That is,
In this example, in steps K1 to K7, the same processing as steps H1 to H7 in FIG. 43 is performed, and then the processing in step K8 is performed.

【0252】すなわち、文脈判別部108Aが、文脈木
に事象Kが登録されていないと判別した場合(ステップ
K4のNOルート)、符号木更新部105Aが、符号木
のESCのリーフを他のリーフあるいはノードと組み替
えてESCの符号を変更し(ステップK6)、文脈履歴
保持部101Aが現在の文脈Pを符号登録手段112A
に送り、文脈変更部110Aが文脈Pの次数を1つ低次
に移して変更した(ステップK7)後、符号登録部11
2Aが符号木に事象Kを登録する(ステップK8)。
That is, when the context discriminating unit 108A discriminates that the event K is not registered in the context tree (NO route in step K4), the code tree updating unit 105A sets the ESC leaf of the code tree to another leaf. Alternatively, the code of the ESC is changed by recombining with the node (step K6), and the context history holding unit 101A stores the current context P in the code registration means 112A.
Then, the context changing unit 110A moves the order of the context P to the next lower order and changes it (step K7), and then the code registration unit 11
2A registers the event K in the code tree (step K8).

【0253】なお、ステップK4において、文脈木に事
象Kが登録されていると判別された場合においても、ス
テップK9〜K12において、前述の図43におけるス
テップH8〜H11と同様の処理が行なわれている。こ
のように、関連技術2の第2の変形例にかかるデータ圧
縮装置によれば、上述のように、ステップK8以外は、
関連技術2の第1の変形例の符号化側におけるにおける
図43の処理ステップと同様であるので、関連技術2の
第1の変形例の符号化側の効果と同様の効果がある。
Even when it is determined in step K4 that the event K is registered in the context tree, the same processing as steps H8 to H11 in FIG. 43 described above is performed in steps K9 to K12. There is. As described above, according to the data compression device of the second modification of the related technique 2, as described above, except for step K8,
Since it is the same as the processing step of the encoding side of the 1st modification of the related technology 2 of FIG. 43, there exists an effect similar to the encoding side of the 1st modification of the related technology 2.

【0254】さらに、上述のように、ステップ8をとる
ことで、エスケープコードを符号化した間シンボルを符
号木上に登録してゆき、符号木に予め登録されていなか
ったシンボルについても次の符号化では早い段階(高次
の次数)で符号化することができるので、符号化が進む
ほど圧縮効果が大幅に向上する効果がある。 (2)復元側の説明 図48は、関連技術2の第2の変形例としてのデータ復
元装置4の内部の構成例を示すものであり、この図48
に示すように、本データ復元装置4の内部には、関連技
術2の第1の変形例の復元側の説明中、図44にて前述
した構成に加えて、さらに符号登録部212Aが設けら
れている。なお、この符号登録部212Aは、符号化側
の構成(図46参照)に対応して、設けられているもの
である。
Further, as described above, by taking step 8, the symbols are registered in the code tree while the escape code is being coded, and the symbols not previously registered in the code tree are also subjected to the next code. Since the encoding can be performed at an early stage (higher order), the compression effect is significantly improved as the encoding progresses. (2) Explanation of Restoration Side FIG. 48 shows an example of the internal configuration of the data restoration device 4 as the second modification of the related technique 2.
As shown in FIG. 44, in the inside of the data restoration device 4, a code registration unit 212A is further provided in addition to the configuration described above with reference to FIG. 44 in the explanation of the restoration side of the first modified example of the related technique 2. ing. The code registration unit 212A is provided corresponding to the configuration on the encoding side (see FIG. 46).

【0255】このため、この図48中、図44にて既述
の符号と同じ符号の構成部分の説明は省略する。符号登
録部212Aは、圧縮側で符号化されたデータの復号処
理でESC(エスケープコード)を復号したときに、文
脈に対応した全ての符号木に、この復号したデータの符
号を登録するものである。
Therefore, in FIG. 48, description of the components having the same reference numerals as those already described in FIG. 44 will be omitted. The code registration unit 212A registers the code of the decoded data in all the code trees corresponding to the context when the ESC (escape code) is decoded in the decoding process of the data encoded on the compression side. is there.

【0256】これにより、図44にて前述した構成がと
る動作に加えて、符号登録部212Aが、符号化された
データKの復号処理において、ESCを復号したとき
に、文脈に対応した全ての符号木に、この復号したデー
タKの符号を登録することができる。上述の動作につい
て、図49の処理ステップL1〜L10を参照しなが
ら、さらに詳述する。
As a result, in addition to the operation performed by the configuration described above with reference to FIG. 44, when the code registration unit 212A decodes the ESC in the decoding process of the coded data K, all the codes corresponding to the context are obtained. The code of this decoded data K can be registered in the code tree. The above operation will be described in more detail with reference to the processing steps L1 to L10 of FIG.

【0257】ここで、この図49に示すように、処理ス
テップL1〜L4においては、関連技術2の第1の変形
例の復元側における、図45にて前述した処理ステップ
J1〜J4と同様の処理が行なわれる。そして、ステッ
プL4で、復号部204Aが符号を復号した後、符号木
更新部205Aが、復号した事象Kのリーフを他のリー
フあるいはノードと組み替え(ステップL5)。
As shown in FIG. 49, the processing steps L1 to L4 are the same as the processing steps J1 to J4 described above with reference to FIG. 45 on the restoration side of the first modification of the related technique 2. Processing is performed. Then, in step L4, after the decoding unit 204A decodes the code, the code tree updating unit 205A rearranges the decoded leaf of the event K with another leaf or node (step L5).

【0258】さらに、符号木更新部205Aは、この時
点で、以前にESC(エスケープコード)が復号されて
おり、復号部204AからのESC信号を受信している
と、このESCを復号した全ての符号木に事象Kを登録
する(ステップL6)。さらに、復号した事象KがES
Cであるかを判別し(ステップL7)、復号した事象K
がESCである場合は、復号した事象KがESCである
ことを示すESC信号を、文脈変更部210Aおよび符
号登録部212Aに送信し、このESC信号を受信した
文脈変更部210Aは、文脈Pの次数を1つ低次に移し
て変更し(ステップL7のYESルートからステップL
8)、処理はステップL3に戻って、ESC以外の事象
Kを復号するまで処理を繰り返す。
Furthermore, if the ESC (escape code) has been previously decoded at this point and the ESC signal from the decoding unit 204A is received, the code tree updating unit 205A determines that all the ESCs have been decoded. The event K is registered in the code tree (step L6). Furthermore, the decrypted event K is ES
It is determined whether it is C (step L7) and the decoded event K
Is an ESC, the ESC signal indicating that the decoded event K is an ESC is transmitted to the context changing unit 210A and the code registering unit 212A, and the context changing unit 210A receiving this ESC signal changes the context P Change the order by moving it to the next lower level (from the YES route of step L7 to step L
8) The process returns to step L3 and is repeated until the event K other than ESC is decoded.

【0259】このようにして、復号部204Aで復号し
た事象KがESCである場合は、符号登録部212Aが
符号木に新規のリーフを作成し、復号部204がESC
以外の事象をKを復号したとき、この事象Kを新規に作
成した全てのリーフに格納することにより、ESCを復
元した全ての符号木に該シンボルを登録することができ
る。
In this way, when the event K decoded by the decoding unit 204A is ESC, the code registration unit 212A creates a new leaf in the code tree and the decoding unit 204 ESC.
When K is decoded for events other than, by storing this event K in all newly created leaves, the symbol can be registered in all code trees in which ESC has been restored.

【0260】一方、上述のステップL7で、復号した事
象KがESCでない場合は、文脈更新部206Aが、最
も古いデータ(前置データ保持部200−nに保持され
ているデータ)を棄却し、復号した事象Kを文脈として
前置データ保持部200−1に挿入して登録し、文脈文
字列P0を更新する(ステップL9)。そして、全ての
データについて復号が終了したかをチェックし(ステッ
プL10)、終了していなければステップL2からの処
理を繰り返し(ステップL10のNOルート)、終了し
ていれば復号処理を終了する(ステップL10のYES
ルート)。
On the other hand, when the decoded event K is not ESC in the above step L7, the context updating unit 206A rejects the oldest data (data held in the prefix data holding unit 200-n), The decrypted event K is inserted as a context into the pre-data holding unit 200-1 and registered, and the context character string P 0 is updated (step L9). Then, it is checked whether the decoding is completed for all the data (step L10), and if not completed, the processes from step L2 are repeated (NO route of step L10), and if completed, the decoding process is completed (step L10). YES in step L10
root).

【0261】以上のように、復号側でも符号化側と同様
に、復号部204AがESCを復号したときは、符号木
登録部212Aが符号木に事象Kを新規に登録する。こ
のように、関連技術2の第2の変形例にかかるデータ復
元装置によれば、符号化側と同様に、第1の変形例にお
ける復元側にて前述した効果に加えて、エスケープコー
ドの符号を復号した場合の間、復号するシンボルの符号
を符号木上に登録してゆくことで、符号木に登録されて
いないシンボルについても次の復号では早い段階で復号
することができるので、文字などのデータの復号処理が
進むほど復元効果が大幅に向上するとともにデータ復元
装置の処理負荷も大幅に軽減できる効果がある。 (b−3)関連技術2の第3の変形例の説明 (1)符号化側の説明 本第3の変形例において、上述のデータ圧縮装置3は、
前述の第2の変形例に比して、データKを符号化する
際、一度でもESCを符号化したときは、履歴登録手段
としての文脈変更部110Aが、このデータの符号化の
直前の文脈とこのデータとの組み合わせを文脈履歴保持
部101Aに登録し、符号登録部112Aが、このデー
タを符号化する直前に符号化したエスケープコードを持
つ符号木にデータを新規に登録するようにすることがで
きる点が異なる。
As described above, on the decoding side as well as on the encoding side, when the decoding unit 204A decodes the ESC, the code tree registration unit 212A newly registers the event K in the code tree. As described above, according to the data decompression device according to the second modified example of the related technique 2, in addition to the effect described above on the decompression side in the first modified example, the code of the escape code is provided, as in the encoding side. By registering the code of the symbol to be decoded on the code tree during the decoding of, the symbols not registered in the code tree can be decoded at the early stage in the next decoding. As the decryption processing of the data proceeds, the restoration effect is significantly improved, and the processing load of the data restoration device can be greatly reduced. (B-3) Description of Third Modification of Related Technique 2 (1) Description of Encoding Side In the third modification, the data compression device 3 described above is
Compared to the second modification described above, when the data K is encoded, even if the ESC is encoded even once, the context changing unit 110A as the history registration means causes the context immediately before the encoding of the data. And a combination of this data with the context history holding unit 101A, and the code registration unit 112A newly registers the data in the code tree having the escape code encoded immediately before the data is encoded. The difference is that you can do it.

【0262】以下、上述の処理について、図50に示す
処理ステップM1〜M13を参照しながら、さらに詳述
する。ここで、この図50に示すように、ステップM1
〜M9は、図43の処理ステップH1〜H9とそれぞれ
同様の処理が行なわれる。
The above process will be described in more detail below with reference to process steps M1 to M13 shown in FIG. Here, as shown in FIG. 50, step M1
.. to M9 are processed in the same manner as the processing steps H1 to H9 in FIG.

【0263】そして、文脈Pに入力データの事象Kが登
録されている場合は(ステップM4のYESルート)、
ステップM8を経由して、ステップM9で符号木の組み
替えを行なった後は、復号部104がステップM8で符
号化した事象KがESCであるかをチェックする(ステ
ップM10)。符号化した事象KがESCである場合
は、符号登録部112Aがこの事象Kを符号化する直前
の文脈P’に対応する符号木に事象Kを登録し(ステッ
プM10のYESルートからステップM11)、文脈更
新部106Aが事象Kを含む文脈Pを、最も新しい文脈
として前置データ保持部100A−1に登録する。
If the event K of the input data is registered in the context P (YES route of step M4),
After the code tree is rearranged in step M9 via step M8, the decoding unit 104 checks whether the event K encoded in step M8 is ESC (step M10). When the encoded event K is ESC, the code registration unit 112A registers the event K in the code tree corresponding to the context P ′ immediately before encoding the event K (from the YES route of step M10 to step M11). The context updating unit 106A registers the context P including the event K in the predata holding unit 100A-1 as the newest context.

【0264】さらに、この情報から文脈変更部110A
が、文脈文字列P0にデータKを挿入して更新し(ステ
ップM12)、文脈履歴保持部101Aに登録する。つ
まり、ステップM11でデータKを符号化する直前の文
脈P’(すなわち最後に符号化された文脈)の符号木に
データKが登録されているので、データKとこのデータ
Kを符号化する直前の文脈P’との組み合わせが文脈変
更部106Aにより文脈履歴保持部101Aに登録され
ることになる。
Furthermore, from this information, the context changing unit 110A
Inserts the data K into the context character string P 0 , updates it (step M12), and registers it in the context history holding unit 101A. That is, since the data K is registered in the code tree of the context P '(that is, the last encoded context) immediately before the data K is encoded in step M11, the data K and the data K immediately before the data K are encoded. The context changing unit 106A registers the combination with the context P ′ in the context history holding unit 101A.

【0265】一方、符号化した事象KがESCでない場
合は(ステップM10のNOルート)、ステップM11
をスキップして、上述のステップM12を行なう。さら
に、全てのデータの符号化が終了したかをチェックし
(ステップM13)、終了していない場合は(ステップ
M13のNOルート)、処理はステップM2に戻り、全
てのデータの符号化が終了するまで処理を繰り返し、終
了している場合は、符号化の処理を終了する(ステップ
M13のYESルート)。
On the other hand, when the coded event K is not ESC (NO route of step M10), step M11
Is skipped and step M12 described above is performed. Furthermore, it is checked whether the encoding of all the data is completed (step M13), and if not completed (NO route of step M13), the process returns to step M2, and the encoding of all the data is completed. The processing is repeated up to, and if the processing is completed, the encoding processing is completed (YES route of step M13).

【0266】このように、関連技術2の第3の変形例に
かかるデータ圧縮装置によれば、第2の変形例の符号化
側にて前述した効果に加えて、予め登録された文脈にシ
ンボルが含まれない場合、最後に符号化したエスケープ
コードの符号木にのみこのシンボルを登録してゆくこと
により、新たな文脈を登録するために使用するメモリの
量を大幅に削減することができるので、データ圧縮装置
の性能が大幅に向上する効果がある。
As described above, according to the data compression apparatus of the third modified example of the related art 2, in addition to the effects described above on the encoding side of the second modified example, the symbol is added to the context registered in advance. If is not included, the amount of memory used to register a new context can be significantly reduced by registering this symbol only in the code tree of the last encoded escape code. There is an effect that the performance of the data compression device is significantly improved.

【0267】さらに、上述のようにして新たに登録され
たシンボルと、同じシンボルが後に入力される毎にこの
シンボルの符号木のノードを組み替えて符号長を短くす
る(スプレイ処理する)ことにより、実際に出現頻度が
高いシンボルについてのみ、その符号の符号長を短くす
ることができるので、データ圧縮装置の圧縮効果が大幅
に向上する効果がある。
Furthermore, each time the same symbol newly registered as described above is input later, the node of the code tree of this symbol is recombined to shorten the code length (spray processing). Since the code length of the code can be shortened only for the symbol having a high appearance frequency, the compression effect of the data compression device is significantly improved.

【0268】(2)復元側の説明 関連技術2の第3の変形例にかかるデータ復元装置4
は、図48に示したデータ復元装置4に比して、履歴登
録手段としての文脈変更部210Aが、符号化側で符号
化されたデータKの復号処理で、最後にESC(エスケ
ープコード)を復号した時の文脈と復号したデータKと
を文脈履歴保持部201Aに登録し、符号登録部212
Aが、データKの復号処理で最後にESCを復号した時
の文脈に対応した符号木にデータKの符号を登録するよ
うにすることができる点が異なる。
(2) Description of Restoration Side Data Restoration Device 4 According to Third Modification of Related Technique 2
Compared to the data restoration device 4 shown in FIG. 48, the context changing unit 210A as the history registration means is a decoding process of the data K encoded on the encoding side, and finally ESC (escape code) is added. The decoded context and the decoded data K are registered in the context history holding unit 201A, and the code registration unit 212
The difference is that A can register the code of the data K in the code tree corresponding to the context when the ESC is finally decoded in the decoding process of the data K.

【0269】上述のような処理について、図51の処理
ステップN1〜N10を参照しながら、さらに詳述す
る。ここで、この図51に示すように、ステップN1〜
N5において、図49のステップK1〜K5とそれぞれ
同様の処理が行なわれる。
The above-mentioned processing will be described in more detail with reference to the processing steps N1 to N10 in FIG. Here, as shown in this FIG.
At N5, processes similar to those at steps K1 to K5 of FIG. 49 are performed.

【0270】そして、本復元側では、ステップN5で復
号した事象Kのリーフを他のリーフあるいはノードと組
み替えた後に、復号した事象KがESCであるかをチェ
ックする(ステップN6)。復号した事象KがESCで
ある場合は、文脈Pの次数を変更し(ステップN6のY
ESルートからステップN7)、処理はステップN3に
戻って、ESC以外の事象Kを復号するまで処理を繰り
返す。
Then, on the restoration side, after recombining the leaf of the event K decrypted in step N5 with another leaf or node, it is checked whether or not the decrypted event K is ESC (step N6). If the decoded event K is ESC, the order of the context P is changed (Y in step N6).
From the ES route to step N7), the process returns to step N3 to repeat the process until the event K other than ESC is decoded.

【0271】一方、復号した事象KがESCでない場合
は、符号木更新部205Aは、直前のESCを復号した
符号木のみに新規リーフを作成し、符号登録部212A
がこの符号木の新規リーフに事象Kを登録する(ステッ
プN6のNOルートからステップN8)。さらに、文脈
更新部206Aが、最も古いデータ(前置データ保持部
200−nに保持されているデータ)を棄却し、復号し
た事象Kを文脈として前置データ保持部200−1に挿
入して登録し、文脈文字列P0を更新する(ステップN
9)。
On the other hand, when the decoded event K is not the ESC, the code tree updating unit 205A creates a new leaf only in the code tree obtained by decoding the immediately previous ESC, and the code registration unit 212A.
Registers event K in a new leaf of this code tree (from NO route of step N6 to step N8). Further, the context updating unit 206A discards the oldest data (data held in the prefix data holding unit 200-n), inserts the decoded event K into the prefix data holding unit 200-1 as the context, and Register and update the context string P 0 (step N
9).

【0272】そして、全てのデータについて復号が終了
したかをチェックし(ステップN10)、終了していな
ければ、ステップN2からの処理を繰り返し(ステップ
N10のNOルートからステップN2)、終了していな
ければ復号処理を終了する。このように、関連技術2の
第3の変形例にかかるデータ復元装置によれば、第2の
変形例の復元側にて前述した効果に加えて、予め登録さ
れた文脈にシンボルが含まれない場合、最後に復号した
エスケープコードの符号木にのみこのシンボルの符号を
新規に登録してゆくことにより、1つのシンボルに対し
て常に1つ以下の登録で済み、新たなシンボルの符号を
登録するために使用するノードID管理用のメモリを大
幅に削減することがきるので、データ復元装置の性能が
大幅に向上する効果がある。
Then, it is checked whether the decoding is completed for all the data (step N10). If not completed, the processing from step N2 is repeated (from NO route of step N10 to step N2), and the processing must be completed. If so, the decoding process ends. As described above, according to the data decompression device of the third modified example of the related art 2, in addition to the effect described above on the decompression side of the second modified example, a symbol is not included in the pre-registered context. In this case, by newly registering the code of this symbol only in the code tree of the finally decoded escape code, one or less registration is always required for one symbol, and the code of the new symbol is registered. Since the memory for managing the node ID used for that purpose can be significantly reduced, there is an effect that the performance of the data restoration device is greatly improved.

【0273】さらに、上述のようにして新たに登録され
たシンボルと、同じシンボルが後に入力される毎にこの
シンボルの符号木のノードを組み替えて符号長を短くす
る(スプレイ処理する)ことにより、実際に出現頻度が
高いシンボルについてのみ、符号長の短い符号をもつこ
とになるので、データ復元装置の復元効果が大幅に向上
する効果がある。 (c)本発明の一実施形態の説明 本発明の一実施形態にかかるデータ圧縮装置及びデータ
復元装置も、関連技術2と同様に、図32に示したよう
な本発明のデータ圧縮方法及びデータ復元方法を実施す
るためのものである。
Furthermore, each time the same symbol newly registered as described above is input later, the node of the code tree of this symbol is rearranged to shorten the code length (spray processing). Only a symbol having a high appearance frequency actually has a code with a short code length, so that the restoration effect of the data restoration device is significantly improved. (C) Description of an Embodiment of the Present Invention A data compression apparatus and a data decompression apparatus according to an embodiment of the present invention, like the related technique 2, also include the data compression method and data of the present invention as shown in FIG. This is for implementing the restoration method.

【0274】また、本実施形態においても、関連技術2
と同様に、データ圧縮装置を符号化側、データ復元装置
を復元側として説明を進める。なお、以下の説明中にお
いても、文脈木および符号木は、関連技術1にて前述し
た構成をもつものである。 (1)符号化側の説明 図52は、本発明の一実施形態にかかるデータ圧縮方法
を実施するためのデータ圧縮装置3(図32参照)の内
部の構成例を示す図であり、この図52において、30
1Bは符号木保持部、302Bは文脈木保持部、303
Bは文脈登録部、305Bは文脈変更部、306Bは符
号化部、307Bは符号変更部、321Bは文脈保持
部、322Bは符号登録部である。
Also in this embodiment, the related technique 2
Similarly, the description will proceed with the data compression device as the encoding side and the data decompression device as the decompression side. Note that, also in the following description, the context tree and the code tree have the configurations described in Related Art 1. (1) Description of Encoding Side FIG. 52 is a diagram showing an internal configuration example of the data compression apparatus 3 (see FIG. 32) for implementing the data compression method according to the embodiment of the present invention. At 52, 30
1B is a code tree holding unit, 302B is a context tree holding unit, 303
B is a context registration unit, 305B is a context change unit, 306B is an encoding unit, 307B is a code change unit, 321B is a context holding unit, and 322B is a code registration unit.

【0275】ここで、符号木保持部(符号木保持手段)
301Bは、予めエスケープコード(ESC)(データ
未登録を示すデータ)を登録した符号木を保持するもの
であり、文脈木保持部(文脈木保持手段)302Bは、
シンボルK(入力データ)と文脈との組み合わせを登録
した文脈木を保持するものである。また、文脈登録部
(文脈登録手段)303Bは、エスケープコードを符号
化したのち、文脈木にシンボルKを新規に登録するもの
であり、文脈保持部321Bは、入力されたシンボルK
を一旦保持するものである。
Here, the code tree holding unit (code tree holding means)
Reference numeral 301B holds a code tree in which an escape code (ESC) (data indicating that data has not been registered) is registered in advance. The context tree holding unit (context tree holding means) 302B is
It holds a context tree in which a combination of a symbol K (input data) and a context is registered. Further, the context registration unit (context registration means) 303B newly registers the symbol K in the context tree after encoding the escape code, and the context holding unit 321B receives the input symbol K.
Is held once.

【0276】符号登録部(符号登録手段)322Bは、
エスケープコードを符号化したのち符号木保持部(符号
木保持手段)301B内の符号木のエスケープコードの
リーフ(データ格納点)を分岐してシンボルKを新規に
登録するものである。このため、符号登録部322Bに
は、図53にて後述する、新規ノードID発生部61,
ラッチ62,親子情報更新部63が設けられており、符
号木保持部301Bの内部には、外部節点(リーフI
D)保持部64,内部節点(ノードID)保持部65,
ESC−ID保持部66,及び符号木管理部67が設け
られている。
The code registration unit (code registration means) 322B is
After the escape code is encoded, the leaf (data storage point) of the escape code of the code tree in the code tree holding unit (code tree holding means) 301B is branched to newly register the symbol K. Therefore, the code registration unit 322B has a new node ID generation unit 61, which will be described later with reference to FIG.
A latch 62 and a parent-child information updating unit 63 are provided, and an external node (leaf I) is provided inside the code tree holding unit 301B.
D) holding unit 64, internal node (node ID) holding unit 65,
An ESC-ID holding unit 66 and a code tree management unit 67 are provided.

【0277】また、文脈変更部305Bは、シンボルK
と文脈との組み合わせが文脈木に保持されていないと
き、文脈を変更するものである。符号化部306Bは、
符号木の頂点からのシンボルKあるいはエスケープコー
ドが登録してあるリーフまでの分岐に従って“1”か
“0”で表される符号を出力するものである。
Also, the context changing unit 305B uses the symbol K
When the combination of and context is not stored in the context tree, it changes the context. The encoding unit 306B is
The code represented by "1" or "0" is output according to the branch from the vertex of the code tree to the leaf in which the escape code is registered.

【0278】符号更新部307Bは、符号化したシンボ
ルK及びエスケープコードが登録してあるリーフと他の
リーフあるいはノードとを取り替えるものである。そし
て、図53に示すように、符号登録部322Bの内部に
おいて、新規ノードID発生部61は、文脈木保持部3
02Bから更新信号を受けて2つの新規ノードID(I
D−1,ID−2を発生するものであり、ラッチ62は
エスケープコードのID(ESC−ID)を一旦保持す
るものである。
The code updating unit 307B replaces the leaf in which the coded symbol K and escape code are registered with another leaf or node. Then, as shown in FIG. 53, in the code registration unit 322B, the new node ID generation unit 61 uses the context tree holding unit 3
02B receives an update signal and two new node IDs (I
D-1 and ID-2 are generated, and the latch 62 temporarily holds the escape code ID (ESC-ID).

【0279】また、親子情報更新部63は、処理対象の
ノードの上位のノードIDと右下に位置する下位ノード
のノードIDおよび左下に位置する下位ノードのノード
IDの3つの情報(ESC−ID,ID−1,ID−
2)からなる親子情報を受けてこの親子情報を変更し、
符号木保持部301Bに送るものである。さらに、符号
木保持部301Bの内部において、外部節点(リーフI
D)保持部64は符号木のデータの格納点であるリーフ
のリーフIDを保持するものであり、内部節点(ノード
ID)保持部65は符号木のノードのノードIDを保持
するものであり、ESC−ID保持部66は符号木のエ
スケープコードとこのエスケープコードのIDを保持す
るものである。
Further, the parent-child information updating unit 63 has three pieces of information (ESC-ID) of the upper node ID of the node to be processed, the node ID of the lower node located at the lower right and the node ID of the lower node located at the lower left. , ID-1, ID-
Change the parent-child information by receiving the parent-child information consisting of 2),
It is sent to the code tree holding unit 301B. Furthermore, inside the code tree holding unit 301B, external nodes (leaf I
D) The holding unit 64 holds the leaf ID of the leaf that is the storage point of the code tree data, and the internal node (node ID) holding unit 65 holds the node ID of the node of the code tree. The ESC-ID holding unit 66 holds the escape code of the code tree and the ID of this escape code.

【0280】また、符号木管理部67は、文脈木保持部
302Bから文脈IDを受けて、この文脈IDを外部節
点(リーフID)保持部64,内部節点(ノードID)
保持部65およびESC−ID保持部66に送るもので
ある。上述の構成により、本発明の一実施形態にかかる
データ圧縮装置3では、符号木保持部301Bが予めエ
スケープコードを登録した符号木を保持し、文脈木保持
部302BがシンボルKと文脈Pとの組み合わせを登録
した文脈木を保持し、文脈登録部303Bがエスケープ
コードを符号化したのち、文脈木にシンボルKを新規に
登録することができる。
Further, the code tree management unit 67 receives the context ID from the context tree holding unit 302B, and uses this context ID as the external node (leaf ID) holding unit 64 and the internal node (node ID).
It is sent to the holding unit 65 and the ESC-ID holding unit 66. With the above configuration, in the data compression device 3 according to the embodiment of the present invention, the code tree holding unit 301B holds the code tree in which the escape code is registered in advance, and the context tree holding unit 302B stores the symbol K and the context P. The context tree in which the combination is registered is held, and after the context registration unit 303B encodes the escape code, the symbol K can be newly registered in the context tree.

【0281】さらに、文脈保持部321Bが文脈Pを一
旦保持し、符号登録部322Bがエスケープコードを符
号化したのち、符号木のエスケープコードのリーフを分
岐してシンボルKを新規に登録することができる。ま
た、文脈変更部305Bが、入力されたシンボルKと文
脈Pとの組み合わせが文脈木に保持されていないとき、
文脈Pを変更することができる。
Further, after the context holding unit 321B once holds the context P and the code registration unit 322B encodes the escape code, the leaf of the escape code of the code tree may be branched to newly register the symbol K. it can. Further, when the context changing unit 305B does not hold the combination of the input symbol K and the context P in the context tree,
The context P can be changed.

【0282】さらに、符号化部306Bが符号木の頂点
からの入力データあるいはエスケープコードが登録して
あるリーフまでの分岐に従って符号を出力し、符号更新
部307Bが符号化したデータ及びエスケープコードが
登録してあるリーフと他のリーフあるいはノードとを取
り替えることができる。なお、図57(a)は符号木の
例を示す図であり、同図(b)は文脈木の例を示す図で
ある。ところで、この図57(a)に示すように、符号
木は内部節点としてのルートとノード、外部節点として
のリーフにそれぞれID番号(0〜10)を持ってい
る。
Further, the encoding unit 306B outputs a code according to the branch to the input data from the vertex of the code tree or the leaf in which the escape code is registered, and the data and the escape code encoded by the code updating unit 307B are registered. One leaf can be replaced with another leaf or node. 57 (a) is a diagram showing an example of the code tree, and FIG. 57 (b) is a diagram showing an example of the context tree. By the way, as shown in FIG. 57 (a), the code tree has ID numbers (0 to 10) at the root and node as internal nodes and at the leaf as external nodes, respectively.

【0283】一方、図57(b)に示すように、文脈木
は、文脈のIDとその文脈に登録されているシンボルの
ID番号を持っており、文脈のID番号は符号木のルー
トのID番号、シンボルのID番号は符号木のリーフの
ID番号と同一である。ここで、上述の動作について、
図54〜図56に示す本発明の符号化側の動作を示す処
理ステップP1〜P16を参照しながら、さらに詳述す
る。
On the other hand, as shown in FIG. 57 (b), the context tree has the ID of the context and the ID number of the symbol registered in the context, and the ID number of the context is the ID of the root of the code tree. The numbers and the ID numbers of the symbols are the same as the leaf ID numbers of the code tree. Here, regarding the above operation,
This will be described in more detail with reference to process steps P1 to P16 showing the operation of the encoding side of the present invention shown in FIGS.

【0284】また、以下の動作の説明中、符号木および
文脈木は、上述のような構成を有しているものとする。
まず、図54に示すように、シンボルKが入力されると
(ステップP1)、文脈保持部321Bに保持されてい
る文脈Pが文脈変更部305Bに出力される(ステップ
P2)。
In the following description of the operation, it is assumed that the code tree and the context tree have the above-mentioned configurations.
First, as shown in FIG. 54, when the symbol K is input (step P1), the context P held in the context holding unit 321B is output to the context changing unit 305B (step P2).

【0285】そして、文脈変更部305Bでは、文脈P
とシンボルKとを受けて、文脈Pの中にシンボルKが登
録されているかを判断するが、シンボルKが文脈Pに登
録されていない場合、文脈木保持部302Bは文脈変更
信号を文脈変更部305Bに出力する(ステップP
3)。文脈変更信号を受けた文脈変更部305Bは、最
高次(文脈木のルートから1番距離が長いリーフ)の文
字を棄却して次数を1つ下げた文脈Pを文脈木保持部3
02Bに送る(ステップP4)。
Then, in the context changing unit 305B, the context P
When the symbol K is not registered in the context P, the context tree holding unit 302B sends the context change signal to the context changing unit. Output to 305B (step P
3). Upon receiving the context change signal, the context change unit 305B rejects the highest-order character (the leaf having the longest distance from the root of the context tree) and lowers the degree by one to obtain the context P.
02B (step P4).

【0286】そして、シンボルKが登録されている文脈
Pを決定するまで、この処理を繰り返す。次に、図55
に示すように、文脈保持部302Bは、文脈PのID
(番号)とシンボルK(シンボルKが登録されていない
ときはESC)のIDを符号化部306Bに送り(ステ
ップP5)、符号化部306Bは、送られてきたIDを
符号木保持部301Bにそのまま転送する(ステップP
6)。
Then, this process is repeated until the context P in which the symbol K is registered is determined. Next, FIG.
As shown in FIG.
The (number) and the ID of the symbol K (ESC when the symbol K is not registered) are sent to the coding unit 306B (step P5), and the coding unit 306B sends the sent ID to the code tree holding unit 301B. Transfer as it is (Step P
6).

【0287】そして、符号木保持部301Bは、送られ
てきたIDの上位ノードのID番号と、符号化部306
Bが送ってきたIDが上位ノードに対して右左のどちら
かに位置しているかを示す情報とを符号化部306Bに
送る(ステップP7)。さらに、符号化部306Bは、
上位ノードに対する、符号化部306Bが送ってきたI
Dをもつノードの位置情報に従って、例えば右に位置し
ていた場合は“1”、左なら“0”を符号として出力す
る(ステップP8)。
Then, the code tree holding unit 301B stores the ID number of the upper node of the sent ID and the coding unit 306.
Information indicating whether the ID sent by B is located on the right or the left with respect to the upper node is sent to the encoding unit 306B (step P7). Further, the encoding unit 306B is
I sent from the encoding unit 306B to the upper node
According to the position information of the node having D, for example, "1" is output if it is located on the right, and "0" is output if it is on the left (step P8).

【0288】また、上述の位置情報とともに送られてき
た上位ノードのIDが、文脈保持部302Bから送られ
てきた文脈PのID(ルートID)と一致したとき、符
号化処理を終了する。一方、一致しなかったときは、そ
の文脈PのIDをさらに符号変更部307Bに出力し
(ステップP6と同じ経路)、さらに符号木保持部30
1Bから上位のノードIDと位置情報とを得る。
When the ID of the upper node sent together with the above-mentioned position information matches the ID (root ID) of the context P sent from the context holding unit 302B, the coding process is ended. On the other hand, when they do not match, the ID of the context P is further output to the code changing unit 307B (the same route as in step P6), and the code tree holding unit 30 is further added.
The upper node ID and the position information are obtained from 1B.

【0289】そして、符号木保持部301Bからの上位
ノードのID番号が、文脈PのIDに一致するまで処理
を繰り返す。この処理が終了した後、符号変更部307
Bは、符号化部306Bから文脈PのID(=符号木の
ルートID)及び符号化したシンボルKのリーフIDを
受け(ステップP9)、ノードの組み換え処理(スプレ
イ処理)を行ない、符号長を更新する。なお、このノー
ドの組み換え処理については、関連技術1および関連技
術2にて前述したように行なう。
Then, the process is repeated until the ID number of the upper node from the code tree holding unit 301B matches the ID of the context P. After this processing is completed, the code changing unit 307
B receives the ID of the context P (= root ID of the code tree) and the leaf ID of the encoded symbol K from the encoding unit 306B (step P9), performs node recombination processing (spray processing), and determines the code length. Update. Note that this node recombination processing is performed as described above in Related Technology 1 and Related Technology 2.

【0290】これにより、シンボルKが以前に入力され
文脈Pに登録されている場合に、さらにシンボルKが入
力されると、既に登録してあるシンボルKのノードを上
位のノードと組み替えて、符号長を短く(1/2に)す
ることができる。ところで、上述の文脈PにシンボルK
が登録されていない場合は、図56に示すように、文脈
登録部310Bは、文脈変更部305Bから登録する文
脈Pを受ける(ステップP10)とともにシンボルKと
を受けて(ステップP11)、文脈木保持部302Bに
登録シンボルのIDを出力し(ステップP12)、文脈
木保持部302Bは、文脈Pの下にシンボルKを新規に
登録する。
Accordingly, when the symbol K is previously input and registered in the context P, when the symbol K is further input, the node of the already registered symbol K is recombined with the upper node and the code is changed. The length can be shortened (1/2). By the way, in the above context P, the symbol K
56 is not registered, the context registration unit 310B receives the context P to be registered from the context changing unit 305B (step P10) and the symbol K (step P11), as shown in FIG. The ID of the registered symbol is output to the holding unit 302B (step P12), and the context tree holding unit 302B newly registers the symbol K under the context P.

【0291】一方、符号登録部322Bは、符号を登録
する符号木を符号木保持部301Bより受け(ステップ
P13)、登録するシンボルKと、文脈木保持部302
Bからの登録シンボルのIDとを受けて(ステップP1
4,15)、シンボルKを符号木に新規登録して符号木
保持部301Bに再格納する(ステップP16)。これ
により、文脈Pに登録されていないシンボルKの登録
(符号化)が行なわれる。
On the other hand, the code registration unit 322B receives the code tree for registering the code from the code tree holding unit 301B (step P13), and registers the symbol K to be registered and the context tree holding unit 302.
In response to the registered symbol ID from B (step P1
4, 15), the symbol K is newly registered in the code tree and stored again in the code tree holding unit 301B (step P16). Thereby, the symbol K not registered in the context P is registered (encoded).

【0292】ここで、符号登録部322Bが、エスケー
プコードを符号化したのち符号木保持部301B内の符
号木のエスケープコードのリーフを分岐してシンボルK
を新規に登録する動作(上述のステップP13〜P1
6)について、前述したように、図53を用いてさらに
詳述する。まず、符号木保持部301Bの内部に設けら
れた符号木管理部67は文脈IDを受けて符号木保持部
内のESC−ID保持部に文脈のESCアドレスを送
る。
Here, the code registration unit 322B codes the escape code and then branches the leaf of the escape code of the code tree in the code tree holding unit 301B to branch to the symbol K.
To newly register (the above-mentioned steps P13 to P1
6) will be described in more detail with reference to FIG. 53, as described above. First, the code tree management unit 67 provided inside the code tree holding unit 301B receives the context ID and sends the context ESC address to the ESC-ID holding unit in the code tree holding unit.

【0293】そして、ESC−ID保持部66は、ES
Cアドレスを受けて、ESCのIDとこのIDに登録し
てあるシンボル(この場合はESC)を出力する一方、
符号登録部322Bでは、ESC−IDとESCをラッ
チ62でラッチする。さらに、新規ID発生器61は、
更新信号を受けて2つのID番号(ID−1,ID−
2)を発信し、ID−1は、新規のESC−IDとして
ラッチしてあったESCとともに符号木保持部301B
のESC−ID保持部66に格納される。
Then, the ESC-ID holding unit 66 uses the ES
While receiving the C address and outputting the ID of the ESC and the symbol (ESC in this case) registered in this ID,
In the code registration unit 322B, the latch 62 latches the ESC-ID and ESC. Further, the new ID generator 61 is
Upon receiving the update signal, two ID numbers (ID-1, ID-
2) is transmitted, and ID-1 stores the code tree holding unit 301B together with the ESC latched as a new ESC-ID.
Stored in the ESC-ID holding unit 66.

【0294】また、符号木には、IDとシンボルの他に
IDの位置情報を表した親子情報が保持されているが、
この親子情報には、自分の上位のノードID,自分の右
下に位置するノードID,及び自分の左下に位置するノ
ードIDの3つの情報がある。親子情報更新部63は、
3つのID(変更前のESC−ID,ID−1,ID−
2)を受けて、親子情報を変更する。すなわち、ID−
1,ID−2の上位IDにはESC−IDが登録され、
またESC−IDの右下にはID−1,左下にはID−
2が位置するという情報が登録される。
[0294] Further, in the code tree, in addition to the ID and the symbol, parent-child information representing the position information of the ID is held.
The parent-child information includes three pieces of information, that is, a higher-level node ID of itself, a node ID located at the lower right of the own, and a node ID located at the lower left of the own. The parent-child information updating unit 63
Three IDs (ESC-ID, ID-1, ID-before change)
In response to 2), change the parent-child information. That is, ID-
1, ESC-ID is registered as the higher ID of ID-2,
Also, ESC-ID has ID-1 at the lower right and ID- at the lower left.
Information that 2 is located is registered.

【0295】親子情報は、各IDとともに符号木保持部
301BのノードID保持部65に保持される。一方、
符号木保持部301BのリーフID保持部64には、登
録シンボルと新規ID(ID−2)が登録される。以上
のような処理を行なうことにより、ESCには新規ES
C−ID(ID−1)が登録され、旧ESC−IDはノ
ードIDとして親子情報とともにノードID保持部に保
持され、新規ID(ID−2)とシンボルKは新規リー
フとしてリーフID保持部に保持され、シンボルKを符
号木保持部301Bの符号木のエスケープコードが登録
されているリーフを分岐して新規登録する処理が終了す
る。
The parent-child information is held in the node ID holding unit 65 of the code tree holding unit 301B together with each ID. on the other hand,
A registration symbol and a new ID (ID-2) are registered in the leaf ID holding unit 64 of the code tree holding unit 301B. By performing the above processing, a new ES is added to the ESC.
The C-ID (ID-1) is registered, the old ESC-ID is stored as a node ID in the node ID holding unit together with parent-child information, and the new ID (ID-2) and the symbol K are stored in the leaf ID holding unit as a new leaf. The processing of holding the symbol K and newly registering the branch of the leaf of the code tree holding unit 301B in which the escape code of the code tree is registered ends.

【0296】以上、図53〜56にて説明した動作をま
とめると、図58に示すフローチャートで表すことがで
きる。すなわち、まず、文脈P0に0を入力して初期化
し(ステップQ1)、文脈P0を変数としての文脈Pに
入力する(ステップQ2)。なお、この文脈P0は、直
前までに入力・符号化された文字(シンボル)であり、
例えば、本実施形態における符号化が、n次の文脈を用
いるモデルであったとき、文脈P0は直前までに入力・
符号化された(n−1)文字が格納されていることにな
る。
The operations described with reference to FIGS. 53 to 56 can be summarized as the flow chart shown in FIG. That is, first, 0 is input to the context P 0 for initialization (step Q1), and the context P 0 is input to the context P as a variable (step Q2). The context P 0 is a character (symbol) that has been input / encoded until immediately before,
For example, when the encoding in the present embodiment is a model that uses an nth-order context, the context P 0 is input by just before.
This means that the encoded (n-1) characters are stored.

【0297】そして、シンボルKが入力されたとき、文
脈Pの文脈木にシンボルKが登録されているか否かを検
索する(ステップQ3)。そして、文脈Pの文脈木にシ
ンボルKが登録されていない場合、ESC(エスケープ
コード)の符号を出力し(ステップQ3のNOルートか
らステップQ4)、文脈Pに対応する符号木のESCが
登録されているリーフをスプレイ処理する(ステップQ
5)。
Then, when the symbol K is input, it is searched whether or not the symbol K is registered in the context tree of the context P (step Q3). When the symbol K is not registered in the context tree of the context P, the code of ESC (escape code) is output (from NO route of step Q3 to step Q4), and the ESC of the code tree corresponding to the context P is registered. Spraying the existing leaf (step Q
5).

【0298】そして、上述のESCのリーフを分岐し
(ステップQ6)、これにより得た2つの新規リーフに
ESCとシンボルKを登録し(ステップQ7)、文脈P
の文脈木にもシンボルKを登録しておく。さらに、上述
のようにしてシンボルKの新規登録した後、文脈P内の
最も古い文字を棄却し、文脈の次数を1つ減じた文脈を
新たに文脈Pとして文脈Pを変更する(ステップQ
8)。
Then, the leaf of the above ESC is branched (step Q6), the ESC and the symbol K are registered in the two new leaves thus obtained (step Q7), and the context P
The symbol K is also registered in the context tree of. Furthermore, after newly registering the symbol K as described above, the oldest character in the context P is rejected, and the context P is changed to a new context P by changing the context P by one (step Q
8).

【0299】そして、ステップQ3に戻り、シンボルK
が文脈Pに登録されていることを検出するまで、文脈P
を順次変更して処理を繰り返す。一方、文脈Pの文脈木
にシンボルKが登録されている場合、シンボルKの符号
を出力し(ステップQ3のYESルートからステップQ
9)、この文脈Pに対応する符号木のシンボルKが登録
されているリーフをスプレイ(SPLAY)処理する
(ステップQ10)。
Then, returning to step Q3, the symbol K
Until it finds that is registered in context P.
Are sequentially changed and the process is repeated. On the other hand, if the symbol K is registered in the context tree of the context P, the code of the symbol K is output (from the YES route of step Q3 to step Q3).
9) The leaf in which the symbol K of the code tree corresponding to this context P is registered is subjected to the spray processing (SPLAY) (step Q10).

【0300】さらに、シンボルKの符号化後、文脈P0
にシンボルKを追加登録して文脈P0を更新する(ステ
ップQ11)。(例えば文脈P0にシンボルKを追加
し、文脈P0内の最も古い文字を棄却する)。そして、
全ての文字(シンボル)の符号化が終了したかをチェッ
クし(ステップQ12)、終了していない場合は(ステ
ップQ12のNOルート)、処理はステップQ2に戻っ
て、全ての文字の符号化が終了するまで処理を繰り返
す。
Furthermore, after encoding the symbol K, the context P 0
The symbol K is additionally registered to update the context P 0 (step Q11). (E.g. by adding the symbol K in the context P 0, rejects the oldest character in the context P 0). And
It is checked whether or not all the characters (symbols) have been encoded (step Q12). If not (NO route of step Q12), the process returns to step Q2 to encode all the characters. The process is repeated until the end.

【0301】また、上述の図58における処理におい
て、ESCのリーフのスプレイ処理を、ESCとシンボ
ルKを登録した後に行なっているが、この処理順は逆に
してもよく、この場合の処理ステップは図59に示すよ
うになる。ここで、この図59に示すように、ステップ
R1〜R3およびステップR9〜R12においては、そ
れぞれ図58の処理ステップQ1〜Q3およびステップ
Q9〜Q12と同様の処理が行なわれる。
Further, in the above-mentioned processing in FIG. 58, the ESC leaf spray processing is performed after the ESC and the symbol K are registered, but the processing order may be reversed, and the processing steps in this case are As shown in FIG. 59. Here, as shown in FIG. 59, in steps R1 to R3 and steps R9 to R12, the same processing as the processing steps Q1 to Q3 and steps Q9 to Q12 of FIG. 58 is performed, respectively.

【0302】そして、ステップR3で文脈Pにシンボル
Kが登録されていない場合に、ESCの符号を出力し
(ステップR4)、ESCのリーフを分岐し(ステップ
R5)、新規リーフにESCとシンボルKを登録する
(ステップR6)。そして、上述のように登録を行なっ
た後に、ESCのリーフをスプレイ処理する(ステップ
R7)。
When the symbol K is not registered in the context P in step R3, the ESC code is output (step R4), the ESC leaf is branched (step R5), and the ESC and the symbol K are added to the new leaf. Is registered (step R6). Then, after performing the registration as described above, the leaf of the ESC is sprayed (step R7).

【0303】さらに、図58の処理ステップQ8と同様
に、文脈Pを変更し(ステップR12)、ステップR3
でシンボルKを検出するまで処理を繰り返す。例えば、
符号木が、図60(a)に示すように、文字(シンボ
ル)A〜Eがすでに符号化され登録されている状態にあ
る場合に、上述の処理ステップR1〜R12(または図
58中の処理ステップQ1〜Q12)において、シンボ
ルKを文字Fとして処理を実行すると、リーフ番号6の
ESCのリーフが分岐され、図60(b)に示すよう
に、新たに作成されたリーフ番号11,12のリーフに
それぞれESCと文字Fが登録される。
Further, as in the processing step Q8 of FIG. 58, the context P is changed (step R12), and the step R3 is executed.
The process is repeated until the symbol K is detected at. For example,
When the code tree is in a state where characters (symbols) A to E have already been coded and registered as shown in FIG. 60A, the above-described processing steps R1 to R12 (or the processing in FIG. 58) are performed. In steps Q1 to Q12), when the process is executed with the symbol K as the character F, the leaf of the ESC with the leaf number 6 is branched, and as shown in FIG. The ESC and the letter F are registered in each leaf.

【0304】例えば、以上の処理において用いる文脈が
3次文脈であった場合、シンボルKが0次(初期状態)
で符号化されたときには、1次,2次,3次の文脈にそ
れぞれ登録される(以下、この全ての次数に登録を行な
う方法を全登録型という)。また、図58および図59
に示したステップQ1〜Q12およびステップR1〜R
12は、上述したように、ESCを符号化する毎にシン
ボルKを全ての次数の文脈に登録する処理のステップを
示すが、シンボルKが符号化される直前に符号化(登
録)された次数の1つの文脈にのみ、シンボルKを登録
するように処理を行なってもよく、この場合の処理のフ
ローチャートは、図61に示すようになる。
For example, when the context used in the above processing is the third-order context, the symbol K is the 0th-order (initial state).
When encoded with, the information is registered in each of the first-order, second-order, and third-order contexts (hereinafter, the method of registering in all the orders is referred to as the full registration type). 58 and 59.
Steps Q1 to Q12 and steps R1 to R shown in
As described above, reference numeral 12 denotes a step of the process of registering the symbol K in the context of all the orders each time the ESC is coded. However, the coded (registered) order immediately before the symbol K is coded. The processing may be performed so that the symbol K is registered only in one context of the above, and the processing flowchart in this case is as shown in FIG. 61.

【0305】即ち、この図61に示す処理では、まず、
文脈P0を0に初期化し(ステップT1)、文脈(変
数)Pには文脈P0を入力し、文脈(変数)Xには0を
入力する(ステップT2)。さらに、文脈Pにシンボル
Kが登録されているか検索し(ステップT3)、文脈P
にシンボルKが登録されていない場合は、前述のステッ
プQ4,Q5(図58参照)と同様の処理を行う(ステ
ップT3のNOルートからステップT4,T5)。
That is, in the processing shown in FIG. 61, first,
The context P 0 is initialized to 0 (step T1), the context P 0 is input to the context (variable) P, and the context P is input to 0 (step T2). Furthermore, it is searched whether the symbol K is registered in the context P (step T3), and the context P
If the symbol K is not registered in, the processing similar to the above-mentioned steps Q4 and Q5 (see FIG. 58) is performed (from NO route of step T3 to steps T4 and T5).

【0306】その後、文脈Xに文脈Pを入力し(ステッ
プT6)、文脈Pを変更して(ステップT7)、文脈P
にシンボルKが登録されていることを検出するまで処理
を繰り返す。一方、上述のステップT3において、文脈
PにシンボルKが登録されている場合は、前述のステッ
プQ9〜Q11(図58参照)、またはステップR9〜
R11(図59参照)と同様の処理を行なう(ステップ
T8〜T10)。
Then, the context P is input to the context X (step T6), the context P is changed (step T7), and the context P is changed.
The process is repeated until it is detected that the symbol K is registered in. On the other hand, when the symbol K is registered in the context P in the above step T3, the above-mentioned steps Q9 to Q11 (see FIG. 58) or step R9 to.
Processing similar to that of R11 (see FIG. 59) is performed (steps T8 to T10).

【0307】その後、文脈XのESCのリーフを分岐し
(ステップT11)、この分岐された新規の2つのリー
フにそれぞれESCとシンボルKを登録する(ステップ
T12)。さらに、全ての文字(シンボル)の符号化が
終了したか否かをチェックし(ステップT13)、終了
していなければステップT2以降の処理を繰り返し(ス
テップT13のNOルート)、終了していれば符号化処
理を終了する(ステップT13のYESルート9)。
After that, the leaf of the ESC of the context X is branched (step T11), and the ESC and the symbol K are respectively registered in the two branched new leaves (step T12). Further, it is checked whether or not all characters (symbols) have been encoded (step T13). If not completed, the processes after step T2 are repeated (NO route of step T13), and if completed. The encoding process ends (YES route 9 in step T13).

【0308】このように処理を行なうことにより、すべ
ての次数の文脈PにシンボルKを登録するのではなく、
シンボルKを符号化した直前の次数の文脈(文脈X)に
のみ登録を行なうことができる(以下、この直前の次数
の文脈にのみシンボルの登録を行なう方法を逐次登録型
という)。このように、本発明の一実施形態にかかるデ
ータ圧縮装置によれば、文脈PにシンボルKが登録され
ていないとき、エスケープコード(ESC)の分岐・登
録の符号長を(分割前のリーフの符号長+1)ビット、
新規登録した符号及びエスケープコードの符号長を最小
で2ビットにすることにより、エスケープコードを比較
的多く出力するようなデータである場合、または辞書登
録(符号木へのシンボルの登録)が十分でない初期の段
階などにおいて高い符号化率が得られる効果がある。
By performing the processing in this way, the symbol K is not registered in the contexts P of all orders, but
Registration can be performed only in the context (context X) of the immediately preceding order in which the symbol K is encoded (hereinafter, the method of registering a symbol only in the context of the immediately preceding order is referred to as a sequential registration type). As described above, according to the data compression apparatus according to the embodiment of the present invention, when the symbol K is not registered in the context P, the code length of branch / registration of the escape code (ESC) is set to Code length + 1) bits,
By setting the code length of the newly registered code and escape code to a minimum of 2 bits, if the data is such that a relatively large number of escape codes are output, or dictionary registration (symbol registration in the code tree) is not sufficient. There is an effect that a high coding rate can be obtained in the initial stage.

【0309】また、上述のようなシンボルの新規登録の
前にスプレイ処理を行なえば、符号及びエスケープコー
ドの符号長を最小で2ビット、新規登録後にスプレイ処
理を行なえば、エスケープコードの符号を最小で1ビッ
トにすることができるので、さらに符号化効率が大幅に
向上する効果がある。さらに、上述の逐次登録型の場
合、符号木へのシンボルの新規登録は、常に1つずつ行
なわれ、同じシンボルが2度3度と出現することによっ
て2次3次の登録が行なわれるので、常に符号木の高次
には再現性を持ったシンボルのみが登録されることにな
り、符号木に登録はしたが実際には使われていないシン
ボルが存在するために生じる符号木の符号化効率の低下
を防止し、十分に辞書登録がなされた後の符号化効率が
大幅に向上する効果もある。
If the spray process is performed before the new registration of the symbol as described above, the code length of the code and the escape code is at least 2 bits, and if the spray process is performed after the new registration, the code of the escape code is minimized. Since it can be set to 1 bit, there is an effect that the coding efficiency is further improved. Furthermore, in the case of the above-described sequential registration type, new registration of symbols in the code tree is always performed one by one, and the same symbol appears twice and three times, so that secondary and tertiary registration is performed. Only the symbols with reproducibility are always registered in the higher order of the code tree, and the coding efficiency of the code tree that occurs because there are symbols that are registered in the code tree but are not actually used Is also prevented, and the coding efficiency after the dictionary is sufficiently registered is greatly improved.

【0310】また、逐次登録型は全登録型よりも使用す
るメモリ容量(辞書容量)が少ないという利点もある。 (2)復元側の説明 図62は、本発明の一実施形態にかかるデータ復元方法
を実施するためのデータ復元装置4(図32参照)の内
部の構成例を示す図であり、この図62において、40
1Bは符号木保持部、402Bは文脈木保持部、403
Bは文脈変更部、404Bは復号部、407Bは符号登
録部、408Bは文脈登録部、409Bはラッチ、42
1Bは文脈保持部である。
Further, the sequential registration type has an advantage in that it uses less memory capacity (dictionary capacity) than all registration types. (2) Explanation of Restoration Side FIG. 62 is a diagram showing an internal configuration example of the data restoration device 4 (see FIG. 32) for carrying out the data restoration method according to the embodiment of the present invention. At 40
1B is a code tree holding unit, 402B is a context tree holding unit, 403
B is a context changing unit, 404B is a decoding unit, 407B is a code registration unit, 408B is a context registration unit, 409B is a latch, and 42
1B is a context holding unit.

【0311】ここで、符号木保持部(符号木保持手段)
401Bは、予めエスケープコード(ESC)(データ
未登録を示すデータ)を登録した符号木を保持するもの
であり、文脈木保持部(文脈木保持手段)402Bは、
復号したシンボル(データ)と文脈との組み合わせを登
録した文脈木を保持するものである。また、文脈変更部
403Bは、文脈木保持部402Bに保持されている文
脈木を検索し、到達したリーフがエスケープコードであ
った場合、文脈を変更するものであり、復号部404B
は、符号化側で符号化されたシンボルKが入力されたと
き、このシンボルKの符号に従って、符号木保持部40
1Bに保持されている符号木のルート(頂点)からリー
フ(データ格納点)へと走査してシンボルKの符号を復
号するものである。
Here, a code tree holding unit (code tree holding means)
401B holds a code tree in which an escape code (ESC) (data indicating that data has not been registered) is registered in advance. The context tree holding unit (context tree holding means) 402B is
It holds a context tree in which a combination of a decoded symbol (data) and a context is registered. Further, the context changing unit 403B searches the context tree held in the context tree holding unit 402B, and changes the context when the leaf that arrived is an escape code, and the decoding unit 404B.
When the symbol K coded on the coding side is input, the code tree holding unit 40 follows the code of the symbol K.
The code of the symbol K is decoded by scanning from the root (vertex) of the code tree held in 1B to the leaf (data storage point).

【0312】さらに、符号変更部406Bは、復号した
シンボルK及びエスケープコードのリーフを他のリーフ
あるいは分岐点としてのノードと組み替えるものであ
る。また、符号登録部(符号登録手段)407Bは、符
号木決定手段としての機能を兼ねており、シンボルKを
復号する直前までに復号したシンボルから、シンボルK
の符号が登録されている符号木保持部401B内の符号
木を決定するとともに、エスケープコードを復号したと
き、この符号木に登録さているエスケープコードのリー
フを分岐して新たにリーフを作成し、復号したシンボル
Kをこのリーフに新規に登録するものである。
Further, the code changing unit 406B replaces the leaf of the decoded symbol K and escape code with another leaf or a node as a branch point. Further, the code registration unit (code registration means) 407B also has a function as a code tree determination means, and the symbols K are decoded from the symbols decoded up to immediately before decoding the symbol K.
The code tree in the code tree holding unit 401B in which the code is registered is determined, and when the escape code is decoded, the leaf of the escape code registered in this code tree is branched to create a new leaf, The decoded symbol K is newly registered in this leaf.

【0313】このため、符号登録部407Bおよび上述
の符号木保持部401は、それぞれ符号化側における符
号登録部322Bおよび符号木保持部301B(図52
参照)の内部構成(図53参照)と同様の構成を有して
いる。また、文脈登録部408Bは、符号登録部407
Bで登録したシンボルKを文脈木保持部402Bに保持
されている文脈木に登録するものであり、ラッチ409
Bは、復号部404Bで復号されたシンボルKを一旦保
持しておくものであり、文脈保持部421Bは、復号さ
れたシンボルKを保持するものである。
Therefore, the code registration unit 407B and the above-described code tree holding unit 401 respectively include the code registration unit 322B and the code tree holding unit 301B (see FIG. 52) on the coding side.
(See FIG. 53). In addition, the context registration unit 408B is the code registration unit 407.
The symbol K registered in B is registered in the context tree held in the context tree holding unit 402B.
B temporarily holds the symbol K decoded by the decoding unit 404B, and the context holding unit 421B holds the decoded symbol K.

【0314】また、上述の符号木保持部401Bによ
り、予めエスケープコードを登録した符号木を保持する
ことができ、文脈木保持部402Bにより、復号したシ
ンボルKと文脈Pとの組み合わせを登録した文脈木を保
持できるようになっている。さらに、文脈変更部403
Bにより、到達したリーフがエスケープコードであった
場合、文脈を変更することができ、復号部404Bによ
り、符号化されたシンボルKの符号に従って符号木のル
ートからリーフへと走査してシンボルKの符号を復号で
きるようになっている。
The code tree holding unit 401B described above can hold a code tree in which escape codes are registered in advance, and the context tree holding unit 402B registers a context in which a combination of the decoded symbol K and context P is registered. It can hold trees. Furthermore, the context changing unit 403
When the leaf that has arrived is an escape code by B, the context can be changed, and the decoding unit 404B scans from the root of the code tree to the leaf according to the code of the encoded symbol K to determine the symbol K. The code can be decoded.

【0315】また、符号木決定手段を兼ねる符号変更部
406により、直前までに復号したシンボルからシンボ
ルKの符号が保持されている符号木を決定することがで
き、復号したシンボルK及びエスケープコードのリーフ
を他のリーフあるいはノードと組み替えることができ
る。さらに、符号登録部407Bにより、エスケープコ
ードを復号したとき、エスケープコードのリーフを分岐
して新たにリーフを作成し、復号したシンボルKをこの
リーフに新規に登録することができる。
Further, the code changing unit 406, which also functions as code tree determining means, can determine the code tree in which the code of the symbol K is held from the symbols decoded up to immediately before, and the code tree of the decoded symbol K and the escape code can be determined. A leaf can be recombined with other leaves or nodes. Further, when the escape code is decoded by the code registration unit 407B, a leaf of the escape code can be branched to create a new leaf, and the decoded symbol K can be newly registered in this leaf.

【0316】また、文脈登録部408Bにより、符号登
録部407Bで登録したシンボルKを文脈木保持部40
2Bの文脈木に登録することができ、ラッチ409Bに
より、復号部204Bで復号したシンボルKを一旦保持
することができ、文脈変保持部421により、復号部2
04Bで復号したシンボルKを保持することができる。
Further, the context registration unit 408B converts the symbol K registered by the code registration unit 407B into the context tree holding unit 40.
2B context tree, the latch 409B can temporarily hold the symbol K decoded by the decoding unit 204B, and the context change holding unit 421 can hold the decoding unit 2B.
It is possible to hold the symbol K decoded in 04B.

【0317】そして、上述の動作について、符号化側の
説明と同様に、図63および図64に示す復元側の動作
を示す処理ステップU1〜U14を参照しながら、さら
に詳述する。まず、図63に示すように、文脈保持部4
21Bはそれまでに復号したシンボル(文脈)を保持
し、文脈変更部403Bに出力し(ステップU1)、文
脈変更部403Bは、最初は送られてきた文脈をそのま
ま文脈木保持部402Bに出力する(ステップU2)。
Then, the above-mentioned operation will be described in more detail with reference to the processing steps U1 to U14 showing the operation on the restoration side shown in FIGS. 63 and 64, similarly to the description on the encoding side. First, as shown in FIG. 63, the context holding unit 4
21B holds the symbol (context) decoded up to that point and outputs it to the context changing unit 403B (step U1), and the context changing unit 403B outputs the initially sent context as it is to the context tree holding unit 402B. (Step U2).

【0318】また、文脈木保持部402は、文脈変更部
403Bから送られてきた文脈のID、すなわちルート
IDを復号部404Bに出力する(ステップU3)。こ
こで、復号部404Bでは、送られてきたルートIDに
対して符号(1ビット)が、例えば“1”ならば右下、
“0”ならば左下に位置するノード(あるいはリーフ)
IDを、符号木保持部401Bに要求する(ステップU
4)。
The context tree holding unit 402 also outputs the context ID sent from the context changing unit 403B, that is, the root ID, to the decoding unit 404B (step U3). Here, in the decoding unit 404B, if the code (1 bit) for the route ID sent is, for example, "1", the lower right corner,
If it is "0", the node (or leaf) located at the lower left
Request the ID to the code tree holding unit 401B (step U
4).

【0319】また、符号木保持部401Bは、要求され
たノード(あるいはリーフ)のノードIDを復号部40
4Bに返信する(ステップU5)。そして、復号部40
4B及び符号木保持部401Bは、符号木の終端である
リーフのリーフIDを得るまで上述の処理を繰り返す。
すなわち、復号部404Bは、符号化側で符号化された
符号に従って、復号するシンボルKが登録されているリ
ーフに到達するまで、符号木保持部401Bの符号木を
辿ってゆく。
Also, the code tree holding unit 401B decodes the node ID of the requested node (or leaf) into the decoding unit 40.
4B (step U5). Then, the decryption unit 40
4B and the code tree holding unit 401B repeat the above processing until the leaf ID of the leaf that is the end of the code tree is obtained.
That is, the decoding unit 404B follows the code tree of the code tree holding unit 401B according to the code encoded on the encoding side until the symbol K to be decoded reaches the registered leaf.

【0320】そして、目的のリーフが発見されると、復
号部404Bは、このリーフを復号し、符号変更部40
6Bが、この復号したリーフを符号化側と同様にスプレ
イ処理を行なって符号長を更新する。ここで、この処理
で復号されたシンボルがESCであった場合、復号部4
04Bは、このシンボル(ESC)をラッチに送り(ス
テップU6)、ラッチはこのシンボルを一旦保持して、
文脈変更部403Bに送る(ステップU7)。文脈変更
部403Bは符号化側と同様の文脈変更処理を行なっ
て、再度復号を行なう。
When the target leaf is found, the decoding unit 404B decodes this leaf and the code changing unit 40
6B performs a spray process on the decoded leaf in the same manner as the encoding side to update the code length. Here, when the symbol decoded by this processing is ESC, the decoding unit 4
04B sends this symbol (ESC) to the latch (step U6), and the latch temporarily holds this symbol,
It is sent to the context changing unit 403B (step U7). The context changing unit 403B performs the same context changing process as on the encoding side and performs decoding again.

【0321】そして、上述の処理で復号部404Bが復
号したシンボルが、ESC以外、すなわちシンボルKで
あるときは、図64に示すように、復号部404Bは、
ラッチ409B,文脈保持部421Bを介して、この復
号したシンボルKを文脈登録部408Bに送り(ステッ
プU8〜U11)、文脈登録部408Bは文脈木保持部
402BにこのシンボルKを新規に登録する。
When the symbol decoded by the decoding unit 404B in the above processing is other than ESC, that is, the symbol K, the decoding unit 404B, as shown in FIG.
The decoded symbol K is sent to the context registration unit 408B via the latch 409B and the context holding unit 421B (steps U8 to U11), and the context registration unit 408B newly registers this symbol K in the context tree holding unit 402B.

【0322】また、符号登録部407Bは、文脈木保持
部407BからシンボルKが登録された文脈Pのルート
IDを受けて(ステップU12)、このルートIDを符
号木保持部401Bに送る(ステップU13)。符号木
保持部401Bでは、送られてきた文脈PのルートID
と同じルートIDをもつ符号木のルートIDを、符号登
録部407Bに返信し(ステップU14)、符号登録部
407Bは、このルートIDをもつ符号木に、シンボル
Kの新規符号を登録する(ステップU13と同じ経
路)。
Further, the code registration unit 407B receives the root ID of the context P in which the symbol K is registered from the context tree holding unit 407B (step U12), and sends this root ID to the code tree holding unit 401B (step U13). ). In the code tree holding unit 401B, the root ID of the sent context P
The root ID of the code tree having the same root ID as the above is returned to the code registration unit 407B (step U14), and the code registration unit 407B registers the new code of the symbol K in the code tree having this root ID (step U14). Same route as U13).

【0323】なお、上述の復元側の符号登録部407B
が符号木保持部401BにシンボルKを登録する処理
は、符号化側における符号登録部322Bが符号木保持
部301BにシンボルKを登録する処理と同様である。
このため、符号化側の登録処理が、符号化側の説明にお
いて図58および図59にて示したような全登録型の場
合は、復元側においてもESCを復号した全ての文脈に
登録する全登録型となり、図61にて示したような逐次
登録型の場合は、復元側においても最後に復号されたE
SCの文脈にそれぞれシンボルKの登録を行なう逐次登
録型となる。
The code registration unit 407B on the restoration side described above.
The process of registering the symbol K in the code tree holding unit 401B is similar to the process of registering the symbol K in the code tree holding unit 301B by the code registration unit 322B on the encoding side.
Therefore, when the registration process on the encoding side is the full registration type as shown in FIGS. 58 and 59 in the description of the encoding side, the restoration side also registers all the ESCs in all the decoded contexts. In the case of the registration type, and in the case of the sequential registration type as shown in FIG.
It is a sequential registration type in which the symbol K is registered in the context of SC respectively.

【0324】そして、符号化側の説明と同様に、上述の
復元側の処理は、図65に示すようなフローチャートで
表すことができる。即ち、文脈(変数)P0に最大次数
の数値を入力して初期化し(ステップV1)、この文脈
0を文脈Pに入力する(ステップV2)。つまり、符
号を復号する場合は、まず最大次数の文脈を用いて処理
を行なう。
Then, similar to the description on the encoding side, the above-mentioned processing on the restoration side can be represented by the flowchart shown in FIG. That is, the numerical value of the maximum degree is input to the context (variable) P 0 for initialization (step V1), and this context P 0 is input to the context P (step V2). That is, when decoding the code, first, the processing is performed using the context of the maximum degree.

【0325】そして、この最大次数の文脈Pに対応する
符号木において、リーフに登録されている符号を復号す
る(ステップV3)。さらに、この復号した符号がシン
ボルであるかをチェックし(ステップV4)、復号した
符号がシンボルでない、すなわちESCであった場合
は、符号化側と同様に、復号したESCのリーフをスプ
レイ処理し(ステップV4のNOルートからステップV
5)、文脈P内の最も高次のシンボル(最も古いシンボ
ル)を棄却して、文脈を1つ低次に移して変更し(ステ
ップV6)、ステップ2に戻る。すなわち、ESC以外
のシンボル(シンボルK)を復号するまで、文脈Pを最
高次数から1ずつ減じた文脈に変更してシンボルKが登
録されている文脈Pを検索する。
Then, in the code tree corresponding to the context P of the maximum degree, the code registered in the leaf is decoded (step V3). Furthermore, it is checked whether the decoded code is a symbol (step V4), and if the decoded code is not a symbol, that is, ESC, the leaf of the decoded ESC is spray-processed as in the encoding side. (From NO route of step V4 to step V
5) The highest-order symbol (oldest symbol) in the context P is rejected, the context is moved to the next lower order to be changed (step V6), and the process returns to step 2. That is, until the symbol (symbol K) other than the ESC is decoded, the context P is changed to the context obtained by subtracting 1 from the highest order, and the context P in which the symbol K is registered is searched.

【0326】一方、復号した符号がシンボルであった場
合は、シンボルKが復号されたことになるので、このシ
ンボルKを出力し(ステップV4のYESルートからス
テップV7)、このシンボルKリーフを符号化側と同様
にしてスプレイ処理してシンボルKの符号長を短く(更
新)する(ステップV8)。さらに、文脈P0にシンボ
ルKを追加登録し(ステップV9)、ESCは棄却す
る。なお、この文脈P0の変更も符号化側と同一の処理
を行なう。
On the other hand, if the decoded code is a symbol, it means that the symbol K has been decoded, so this symbol K is output (YES route from step V4 to step V7), and this symbol K leaf is coded. The code length of the symbol K is shortened (updated) by performing the spray process in the same manner as the digitization side (step V8). Further, the symbol K is additionally registered in the context P 0 (step V9), and the ESC is rejected. It should be noted that the process of changing the context P 0 is the same as that on the encoding side.

【0327】さらに、復号したシンボルKについて、符
号化側と同一の登録方法、例えば、符号化側のシンボル
Kの登録方法が全登録型なら全登録型により、ESCの
リーフを分岐して、新規シンボルKの登録を行なう(ス
テップV10)。そして、入力された全ての符号の復号
が終了したかチェックし(ステップV11)、終了して
いない場合は(ステップV11のNOルート)、処理は
ステップV2に戻って、全ての符号の復号が終了するま
で処理を繰り返す。
Further, regarding the decoded symbol K, the same registration method as that on the encoding side, for example, if the registration method of the symbol K on the encoding side is the full registration type, the leaf of the ESC is branched according to the full registration type, and The symbol K is registered (step V10). Then, it is checked whether the decoding of all the inputted codes has been completed (step V11), and if not completed (NO route of step V11), the process returns to step V2 and the decoding of all the codes is completed. The process is repeated until

【0328】以上のように、本発明の一実施形態にかか
るデータ復元装置によれば、符号化側と同様に、シンボ
ルの新規登録処理において、既に符号木上に存在するリ
ーフを2つに分割してこのリーフの符号長を(分割前の
リーフの符号長+1)ビットにすることにより、新規登
録したシンボルKの符号及びエスケープコードの符号長
を最小で2ビットにすることができるので、エスケープ
コードを比較的多く復号するようなデータである場合、
または辞書登録(符号木へのシンボルの登録)が十分で
ない初期の段階などにおいて、データの復号効率が大幅
に向上する効果がある。
As described above, according to the data decompression apparatus according to the embodiment of the present invention, similarly to the encoding side, in the symbol new registration processing, the leaf already existing on the code tree is divided into two. Then, by setting the code length of this leaf to (the code length of the leaf before division + 1) bits, the code length of the newly registered symbol K and the escape code can be set to a minimum of 2 bits. If the data is such that a relatively large number of codes are decoded,
Alternatively, there is an effect that the data decoding efficiency is significantly improved in the initial stage where the dictionary registration (the registration of the symbol in the code tree) is not sufficient.

【0329】また、上述のようなシンボルの新規登録の
前にスプレイ処理を行なえば、復号したシンボルの符号
及びエスケープコードの符号長を最小で2ビット、新規
登録後にスプレイ処理を行なえば、エスケープコードの
符号を最小で1ビットにすることができるので、さらに
データの復号効率が大幅に向上する効果がある。さら
に、上述のように、復元側が符号化側と同一の登録処理
を行なうことで、符号を正確に復号することができる利
点がある。 (c−1)本実施形態の第1の変形例の説明 本実施形態の第1の変形例にかかるデータ圧縮装置及び
データ復元装置においても、上述の実施形態と同様に、
図32に示すデータ圧縮方法及びデータ復元方法を実施
するためのものである。
If the spray process is performed before the new registration of the symbol as described above, the code length of the decoded symbol and the escape code is at least 2 bits, and if the spray process is performed after the new registration, the escape code is generated. Since the code of can be set to 1 bit at the minimum, there is an effect that the decoding efficiency of data is significantly improved. Furthermore, as described above, there is an advantage that the decoding side can perform the correct decoding by performing the same registration processing as the encoding side. (C-1) Description of First Modified Example of Present Embodiment Also in the data compression apparatus and the data decompression apparatus according to the first modified example of the present embodiment, as in the above-described embodiment,
This is for implementing the data compression method and the data decompression method shown in FIG.

【0330】また、上述した実施形態と同様に、データ
圧縮装置3を符号化側、データ復元装置4を復元側とし
て以下に説明する。 (1)符号化側の説明 符号化側の構成は、図52にて前述したものの構成と同
様である。
Similar to the above-described embodiment, the data compression device 3 will be described on the encoding side and the data decompression device 4 will be described on the decompression side. (1) Description of Encoding Side The configuration on the encoding side is the same as that described above with reference to FIG.

【0331】また、本実施形態における図52に示す符
号登録部322Bには、符号木保持手段301Bに保持
されている符号木上の最長の符号長のリーフにシンボル
を登録するために、図66に示すように、新規ノードI
D発生部61,ラッチ62,親子情報更新部63及び最
長符号検出部(分岐位置検索手段)69が設けられてお
り、これに対応して、符号木保持部301Bには、内部
節点(ノードID)保持部65,符号木管理部67及び
外部節点/ESC−ID(リーフID)保持部68が設
けられている。
Further, in the code registration unit 322B shown in FIG. 52 in this embodiment, in order to register a symbol in the leaf of the longest code length on the code tree held in the code tree holding means 301B, FIG. , The new node I
A D generation unit 61, a latch 62, a parent-child information update unit 63, and a longest code detection unit (branch position search means) 69 are provided. Correspondingly, the code tree holding unit 301B has internal nodes (node IDs). ) A holding unit 65, a code tree managing unit 67, and an external node / ESC-ID (leaf ID) holding unit 68 are provided.

【0332】ここで、符号登録部322Bの内部におい
て、新規ノードID発生部61は、文脈木保持部302
Bから更新信号を受けて2つの新規ノードID(ID−
1,ID−2)を発生するものであり、ラッチ62は、
最長符号検出部69が検出したリーフIDをラッチする
ものである。また、親子情報更新部63は、処理対象の
ノードの上位のノードIDと右下に位置する下位ノード
のノードIDおよび左下に位置する下位ノードのノード
IDの3つ情報(ESC−ID,ID−1,ID−2)
からなる親子情報を受けてこの親子情報を変更し、符号
木保持部301Bに送るものである。
Inside the code registration unit 322B, the new node ID generation unit 61 has the context tree holding unit 302.
Upon receiving the update signal from B, two new node IDs (ID-
1, ID-2) is generated, and the latch 62 is
The leaf ID detected by the longest code detector 69 is latched. Further, the parent-child information updating unit 63 has three pieces of information (ESC-ID, ID-) of the upper node ID of the processing target node, the node ID of the lower node located at the lower right, and the node ID of the lower node located at the lower left. 1, ID-2)
It receives the parent-child information consisting of, changes the parent-child information, and sends it to the code tree holding unit 301B.

【0333】最長符号検出部(分岐位置検索手段)69
は、符号木保持部301Bから符号木のノードIDを得
て、その符号木の中で最長の符号長をもつリーフのID
(ID−0)を検出するものである。また、符号木保持
部301Bの内部において、内部節点(ノードID)保
持部65は、符号木のノードIDを保持するものであ
り、外部節点/ESC−ID(リーフID)保持部68
は、符号木のリーフIDを保持するものである。
Longest code detection unit (branch position search means) 69
Is a leaf ID having the longest code length in the code tree obtained from the code tree holding unit 301B.
(ID-0) is detected. In addition, inside the code tree holding unit 301B, the internal node (node ID) holding unit 65 holds the node ID of the code tree, and the external node / ESC-ID (leaf ID) holding unit 68.
Holds the leaf ID of the code tree.

【0334】符号木管理部67は、文脈木保持部302
Bから文脈IDを受けて、この文脈IDを、内部節点
(ノードID)保持部65および外部節点/ESC−I
D(リーフID)保持部68に送るものである。符号登
録部322Bおよび符号木保持部301Bが上述の構成
を有することにより、符号登録部322Bが符号木保持
部301Bに保持されている符号木上の最長の符号長を
もつリーフを検索し、エスケープコードを符号化した
後、検索した最長の符号長をもつリーフを分岐してシン
ボルKを新規に登録する。
The code tree management unit 67 has a context tree holding unit 302.
Upon receiving the context ID from B, the context ID is stored in the internal node (node ID) holding unit 65 and the external node / ESC-I.
It is sent to the D (leaf ID) holding unit 68. Since the code registration unit 322B and the code tree holding unit 301B have the above-described configurations, the code registration unit 322B searches for the leaf having the longest code length on the code tree held in the code tree holding unit 301B and escapes. After encoding the code, the leaf having the longest code length searched is branched and a symbol K is newly registered.

【0335】さらに、上述の処理について、図67に示
すフローチャートの処理ステップW1〜W13を参照し
ながら詳述する。まず、シンボルKが含まれている文脈
を検索するために、文脈木保持部302Bに保持されて
いる文脈(文脈P)を選択し(ステップW1〜W2)、
この文脈PにシンボルKが登録されているかをチェック
し(ステップW3)、登録されている場合は、図58に
て前述したステップQ9〜Q12と同様の処理を行なう
(ステップW9〜W12)。
Further, the above-mentioned processing will be described in detail with reference to the processing steps W1 to W13 of the flowchart shown in FIG. First, in order to search the context including the symbol K, the context (context P) held in the context tree holding unit 302B is selected (steps W1 and W2),
It is checked whether or not the symbol K is registered in this context P (step W3), and if it is registered, the same processing as steps Q9 to Q12 described above with reference to FIG. 58 is performed (steps W9 to W12).

【0336】一方、文脈PにシンボルKが登録されてい
ない場合は、同じく図58のステップQ4〜Q5と同様
に、符号化部306BがESCの符号を出力し(ステッ
プW4)、符号変更部307Bが、符号木保持部301
Bに保持されている符号木のESCのリーフをスプレイ
処理する(ステップW5)。その後、符号木保持部30
1Bは、文脈PのID(ルートID)を文脈木保持部3
02Bから受けて、この文脈PのノードIDと親子情報
とを最長符号検出部69に送る。
On the other hand, when the symbol K is not registered in the context P, the encoding unit 306B outputs the ESC code (step W4) and the code changing unit 307B as in steps Q4 to Q5 of FIG. Is the code tree holding unit 301
The leaf of the ESC of the code tree held in B is sprayed (step W5). After that, the code tree holding unit 30
1B uses the ID (root ID) of the context P as the context tree holding unit 3
02B, the node ID of this context P and the parent-child information are sent to the longest code detection unit 69.

【0337】最長符号検出部69では、親子情報から最
長の符号長を持つリーフX(p)のID(ID−0)を
検出する(ステップW6)。そして、検出したリーフX
(p)のID、ID−0をリーフID保持部68に送
り、このID−0とID−0に格納してあるシンボルを
ラッチ70でラッチする。
The longest code detecting section 69 detects the ID (ID-0) of the leaf X (p) having the longest code length from the parent-child information (step W6). And the detected leaf X
The ID of (p), ID-0, is sent to the leaf ID holding unit 68, and the symbols stored in the ID-0 and ID-0 are latched by the latch 70.

【0338】また、新規ノードID発生部71は、2つ
の新規ノードID(ID−1,ID−2)を発生し、親
子情報更新部63は、3つのID(ID−0,ID−
1,ID−2)を受けて親子情報を更新し、符号木保持
部301BのノードID保持部65に登録する。一方、
符号木保持部301BのリーフID保持部68には登録
シンボルKと新規ID(ID−2),ID−0に登録し
てあったシンボルとID−1を新規リーフとしてそれぞ
れ登録する(ステップW7)。
Further, the new node ID generating section 71 generates two new node IDs (ID-1, ID-2), and the parent-child information updating section 63 has three IDs (ID-0, ID-).
1, ID-2), the parent-child information is updated and registered in the node ID holding unit 65 of the code tree holding unit 301B. on the other hand,
In the leaf ID holding unit 68 of the code tree holding unit 301B, the registered symbol K and the new ID (ID-2), and the symbol registered in ID-0 and the ID-1 are respectively registered as new leaves (step W7). .

【0339】上述の処理を行なうことにより、最長の符
号長であったリーフはノードとなり、このノードの下に
2つの新規リーフが登録される。そして、文脈Pを変更
して(ステップW8)、文脈PにシンボルKが登録され
ていることを検出するまで上述の処理を繰り返す。この
ように、本発明の一実施形態の第1の変形例にかかるデ
ータ圧縮装置によれば、前述した実施形態の符号化側に
て前述した効果に加えて、文脈Pの符号木において、最
長の符号長をもつ(ルートからの距離が最も遠い)リー
フX(p)を検出し、このリーフX(p)を分岐してシ
ンボルKとX(p)に登録されていたシンボルの符号木
への新規登録を行なう。これにより、「最長の符号長」
=「出現頻度の最も低いシンボル」であるため、符号長
が1ビット伸びたことによる符号化効率の低下を最小限
に抑えることができ、データ圧縮の処理速度が大幅に向
上するとともにデータ圧縮装置の処理負荷も大幅に軽減
できる。
By performing the above processing, the leaf having the longest code length becomes a node, and two new leaves are registered under this node. Then, the context P is changed (step W8), and the above processing is repeated until it is detected that the symbol K is registered in the context P. As described above, according to the data compression apparatus of the first modification of the embodiment of the present invention, in addition to the effect described above on the encoding side of the above-described embodiment, in the code tree of the context P, the longest The leaf X (p) having the code length of (the farthest distance from the root) is detected, and this leaf X (p) is branched to the code tree of the symbols registered in the symbols K and X (p). Register new. This gives the "longest code length"
= Since it is the "symbol with the lowest frequency of appearance", it is possible to minimize the decrease in coding efficiency due to the extension of the code length by 1 bit, and the processing speed of data compression is greatly improved and the data compression apparatus is also provided. The processing load of can be greatly reduced.

【0340】(2)復元側の説明 本実施形態の第1の変形例にかかるデータ復元装置4で
は、図62にて前述したものの構成と同様の構成を有し
ており、さらに、この復元側における符号登録部407
Bおよび符号木保持部401Bは、それぞれ符号化側の
符号登録部322Bおよび符号木保持部301Bと同様
の内部構成を有している(図66参照)。従って、符号
登録部407Bおよび符号木保持部401Bは、符号化
側の符号登録部322Bおよび符号木保持部301Bと
同様の構成を有しているので、符号登録部407Bが、
復号したシンボルの符号を符号木保持部401Bに新規
に登録する処理は、符号化側と同様の処理を行なうこと
になる。このため、符号化側で符号化されたシンボルK
を復号する処理は、図65にて前述した処理(ステップ
V1〜V11)と同様にして行なえばよく、図65中の
ステップV10においては、符号化側の処理ステップW
7,W8(図67参照)を行なえばよい。
(2) Explanation of Restoration Side The data restoration device 4 according to the first modification of this embodiment has the same configuration as that described above with reference to FIG. Code registration unit 407
B and the code tree holding unit 401B have the same internal configurations as the code registration unit 322B and the code tree holding unit 301B on the coding side, respectively (see FIG. 66). Therefore, the code registration unit 407B and the code tree holding unit 401B have the same configurations as the code registration unit 322B and the code tree holding unit 301B on the encoding side.
The process of newly registering the code of the decoded symbol in the code tree holding unit 401B is the same as the process on the encoding side. Therefore, the symbol K coded on the coding side
65 may be performed in the same manner as the processing (steps V1 to V11) described above with reference to FIG. 65. In step V10 in FIG. 65, the processing step W on the encoding side is performed.
7, W8 (see FIG. 67) may be performed.

【0341】このように、本発明の一実施形態の第1の
変形例にかかるデータ復元装置によれば、符号化側と同
様に、文脈Pの符号木において最長の符号長をもつ(ル
ートからの距離が最も遠い)リーフX(p)を検出し、
このリーフX(p)を分岐してシンボルKとX(p)に
登録されていたシンボルの符号木への新規登録を行なう
ことにより、「最長の符号長」=「出現頻度の最も低い
シンボル」であることから、前述の実施形態の復元側に
おける効果に加えて、符号長が1ビット伸びたことによ
るデータの復号効率の低下を最小限に抑えることがで
き、データ復号の処理速度が大幅に向上するとともにデ
ータ復元装置の処理負荷も大幅に軽減できる効果があ
る。
As described above, according to the data decompression apparatus of the first modified example of the embodiment of the present invention, the code tree of the context P has the longest code length (from the root) as in the coding side. The leaf X (p), which is the farthest distance of
By branching this leaf X (p) and newly registering the symbols registered in symbols K and X (p) in the code tree, “longest code length” = “symbol with the lowest occurrence frequency” Therefore, in addition to the effect on the restoration side of the above-described embodiment, it is possible to minimize the decrease in the data decoding efficiency due to the extension of the code length by 1 bit, and to significantly increase the data decoding processing speed. There is an effect that the processing load of the data restoration device can be significantly reduced while being improved.

【0342】さらに、上述のように、シンボルの復元側
の登録処理を符号化側の登録処理と同一の処理とするこ
とで、符号化側で符号化されたシンボルの符号を正確に
復号することができる効果がある。 (c−2)一実施形態の第2の変形例の説明 (1)符号化側の説明 本実施形態においても、符号化側の構成は、図52にて
前述したものの構成と同様である。
Further, as described above, by making the symbol decompression side registration processing the same as the encoding side registration processing, it is possible to accurately decode the code of the symbol encoded on the encoding side. There is an effect that can be. (C-2) Description of Second Modification of Embodiment (1) Description of Encoding Side In the present embodiment, the configuration on the encoding side is the same as that described above with reference to FIG. 52.

【0343】そして、本実施形態における図52に示す
符号登録部322Bには、符号木保持手段301Bに保
持されている符号木上に新規に登録されたリーフを分岐
してシンボルを登録するために、新規ノードID発生部
61,ラッチ62,親子情報更新部63及び最新登録I
D保持部70が設けられており、符号木保持部301B
には、外部節点(リーフID)保持部64、内部節点
(ノードID)保持部65,ESC−ID保持部66及
び符号木管理部67が設けられている。
Then, in the code registration unit 322B shown in FIG. 52 in this embodiment, in order to register a symbol by branching a leaf newly registered on the code tree held in the code tree holding means 301B. , New node ID generation unit 61, latch 62, parent-child information update unit 63 and latest registration I
The D holding unit 70 is provided, and the code tree holding unit 301B is provided.
Is provided with an external node (leaf ID) holding unit 64, an internal node (node ID) holding unit 65, an ESC-ID holding unit 66, and a code tree management unit 67.

【0344】ここで、上述の構成の内、図53または図
66にて既述の符号と同じ符号は同じ部分を示すので、
その説明は省略する。本実施形態で新たに設けられてい
る、最新登録ID保持部(分岐位置保持手段)70は、
符号木保持部301Bに保持されている符号木に最後に
(新規に)登録されたリーフのIDを保持するものであ
る。
Here, in the above-mentioned configuration, the same reference numerals as those already described in FIG. 53 or FIG.
The description is omitted. The latest registration ID holding unit (branch position holding means) 70 newly provided in this embodiment is
This is to hold the ID of the leaf that was last (newly) registered in the code tree held in the code tree holding unit 301B.

【0345】符号登録部322Bおよび符号木保持部3
01Bが上述の構成を有していることにより、符号登録
部322Bが、符号木保持部301Bに保持されている
符号木にシンボルが最後に登録された最新のリーフを分
岐して、この新たに作成されたリーフにシンボルKを新
規に登録することができる。以下に、上述の処理につい
て、図69の処理ステップX1〜X13を参照しなが
ら、さらに詳述する。
Code registration unit 322B and code tree holding unit 3
Since 01B has the above-mentioned configuration, the code registration unit 322B branches the latest leaf in which the symbol is last registered in the code tree held in the code tree holding unit 301B, and this new The symbol K can be newly registered in the created leaf. The above process will be described in more detail below with reference to process steps X1 to X13 in FIG.

【0346】上述の処理は、最後に登録された、最新登
録のリーフのIDを最新登録ID保持部70に保持し、
そのIDを分岐することで新規登録を行なう。まず、シ
ンボルKが含まれている文脈を検索するために、文脈木
保持部302Bに保持されている文脈(文脈P)を選択
し(ステップX1〜X2)、この文脈PにシンボルKが
登録されているかをチェックし(ステップX3)、登録
されている場合は、図67にて前述したステップW10
〜W13と同様の処理を行なう(ステップX3のYES
ルートからステップX10〜X13)。
In the above process, the latest registered leaf ID registered last is held in the latest registration ID holding unit 70,
New registration is performed by branching the ID. First, in order to search the context including the symbol K, the context (context P) held in the context tree holding unit 302B is selected (steps X1 and X2), and the symbol K is registered in this context P. It is checked (step X3), and if registered, step W10 described above with reference to FIG. 67.
~ Perform the same processing as W13 (YES in step X3)
From the root, steps X10 to X13).

【0347】一方、文脈PにシンボルKが登録されてい
ない場合は、同じく図67のステップW4〜W5と同様
に、符号化部306BがESCの符号を出力し(ステッ
プX4)、符号変更部307Bが、符号木保持部301
Bに保持されている符号木のESCのリーフをスプレイ
処理する(ステップX5)。その後、符号木保持部30
1Bは、文脈PのID(ルートID)を、そのまま最新
登録ID保持部70に出力する。
On the other hand, when the symbol K is not registered in the context P, the encoding unit 306B outputs the ESC code (step X4) and the code changing unit 307B, similarly to steps W4 to W5 of FIG. Is the code tree holding unit 301
The leaf of the ESC of the code tree held in B is sprayed (step X5). After that, the code tree holding unit 30
1B outputs the ID (root ID) of context P to the latest registration ID holding unit 70 as it is.

【0348】最新登録ID保持部70では、この文脈P
に対応する符号木の最新登録のリーフX(p)のリーフ
ID(ID−0)を符号木保持部301BのリーフID
保持部64に送り、ID−0とID−0に格納してある
シンボルをラッチ62でラッチする。新規ID発生部6
1は、2つの新規ID(ID−1,ID−2)を発生
し、親子情報更新部63が、3つのID(ID−0,I
D−1,ID−2)を受けて親子情報を更新することに
よりリーフX(p)を分岐し(ステップX6)、この情
報を符号木保持部301BのノードID保持部65に登
録する。
In the latest registration ID holding unit 70, this context P
The leaf ID (ID-0) of the latest registered leaf X (p) corresponding to the code tree is the leaf ID of the code tree holding unit 301B.
The data is sent to the holding unit 64, and the ID-0 and the symbol stored in the ID-0 are latched by the latch 62. New ID generator 6
1 generates two new IDs (ID-1, ID-2), and the parent-child information updating unit 63 generates three IDs (ID-0, I
D-1 and ID-2) are received to update the parent-child information to branch the leaf X (p) (step X6), and this information is registered in the node ID holding unit 65 of the code tree holding unit 301B.

【0349】一方、符号木保持部301BのリーフID
保持部64には、登録シンボルKと、リーフX(p)に
登録してあったシンボルとを新規リーフとしてそれぞれ
登録し(ステップX7,X8)、さらに最新登録ID保
持部70には新規IDであるID−2を登録する。そし
て、文脈Pを変更し(ステップX9)、文脈Pにシンボ
ルKが登録されていることを検出するまで上述の処理を
繰り返す。
On the other hand, the leaf ID of the code tree holding unit 301B
The registered symbol K and the symbol registered in the leaf X (p) are respectively registered in the holding unit 64 as new leaves (steps X7 and X8), and the new registration ID holding unit 70 stores the new ID. Register a certain ID-2. Then, the context P is changed (step X9), and the above processing is repeated until it is detected that the symbol K is registered in the context P.

【0350】以上の処理を行なうことにより、新たなシ
ンボルKが入力されたときは、常に、シンボルKが入力
される直前に登録された最新の登録リーフを分割してこ
のリーフにシンボルKを登録する。このように、本発明
の一実施形態の第2の変形例にかかるデータ圧縮装置に
よれば、シンボルの符号木への新規登録を、直前に登録
したシンボルのリーフを分岐してこのリーフに登録する
ことにより、「直前に登録したリーフのシンボル」=
「比較的符号長の長いシンボル」に近似できることか
ら、本実施形態の第1の変形例にて前述したように最長
の符号長をもつリーフを検出する処理を省略することが
でき、さらにデータ圧縮の処理速度が大幅に向上する効
果がある。
By performing the above processing, whenever a new symbol K is input, the latest registered leaf registered immediately before the symbol K is input is divided and the symbol K is registered in this leaf. To do. As described above, according to the data compression apparatus of the second modified example of the embodiment of the present invention, when a symbol is newly registered in the code tree, the leaf of the symbol registered immediately before is branched and registered in this leaf. By doing so, "the symbol of the leaf just registered" =
Since it can be approximated to “a symbol having a relatively long code length”, the process of detecting the leaf having the longest code length can be omitted as described above in the first modification of the present embodiment, and further data compression can be performed. This has the effect of significantly improving the processing speed of.

【0351】(2)復元側の説明 復元側の構成は、符号化側と同様に、図62にて前述し
た構成と同様であり、さらに、この復元側における符号
登録部407Bおよび符号木保持部401Bは、それぞ
れ符号化側の符号登録部322Bおよび符号木保持部3
01Bと同様の内部構成をもつものである(図68参
照)。
(2) Description of Decompression Side The configuration of the decompression side is the same as the configuration described above with reference to FIG. 62, as is the case with the coding side. Furthermore, the code registration unit 407B and the code tree holding unit on the decompression side. Reference numeral 401B denotes a code registration section 322B and a code tree holding section 3 on the encoding side.
It has the same internal configuration as 01B (see FIG. 68).

【0352】従って、符号登録部407Bおよび符号木
保持部401Bが、符号化側の符号登録部322Bおよ
び符号木保持部301Bと同様の構成を有しているの
で、本実施形態の第1の変形例における復元側と同様
に、符号登録部407Bが復号したシンボルの符号を符
号木保持部401Bに新規に登録する処理は、符号化側
の処理と同様に行なわれる。
Therefore, since the code registration unit 407B and the code tree holding unit 401B have the same configurations as the coding side code registration unit 322B and the code tree holding unit 301B, the first modification of the present embodiment. Similar to the restoration side in the example, the process of newly registering the code of the symbol decoded by the code registration unit 407B in the code tree holding unit 401B is performed in the same manner as the process on the coding side.

【0353】このため、本実施形態の復元側でも、符号
化側で符号化されたシンボルKを復号する処理は、図6
5にて前述した処理(ステップV1〜V11)と同様に
して行なわれる。即ち、図65中の処理ステップV11
においても、符号化側の登録処理である図69のステッ
プX6〜X8と同様の処理が行なわれている。
For this reason, the process of decoding the symbol K coded on the coding side is also performed by the decoding side of this embodiment as shown in FIG.
5 is performed in the same manner as the processing (steps V1 to V11) described above. That is, the processing step V11 in FIG.
Also in this case, the same processing as steps X6 to X8 of FIG. 69 which is the registration processing on the encoding side is performed.

【0354】このように、本発明の一実施形態の第2の
変形例にかかるデータ復元装置によれば、シンボルの符
号木への新規登録を、符号化側と同様に、直前に登録し
たシンボルのリーフを分岐してこのリーフに登録するこ
とにより、「直前に登録したリーフのシンボル」=「比
較的符号長の長いシンボル」に近似できることから、本
実施形態の第1の変形例にて前述したように最長の符号
長をもつリーフを検出する処理を省略することができ、
さらにデータ復号の処理速度が大幅に向上する効果があ
る。
As described above, according to the data decompression apparatus of the second modification of the embodiment of the present invention, the new registration of the symbol in the code tree is performed similarly to the encoding side, and the symbol registered immediately before is newly registered. By branching and registering this leaf into this leaf, it is possible to approximate to “symbol of the leaf registered immediately before” = “symbol with a relatively long code length”. Therefore, in the first modified example of this embodiment, As described above, the process of detecting the leaf with the longest code length can be omitted,
Further, there is an effect that the processing speed of data decoding is significantly improved.

【0355】そして、このようにシンボルの符号木への
新規登録の処理を符号化側の登録処理と同一にすること
で、符号化側で符号化されたシンボルの復号処理を正確
に行うことができる効果もある。
By thus making the new registration process of the symbol in the code tree the same as the registration process on the encoding side, the decoding process of the symbol encoded on the encoding side can be performed accurately. There is an effect that can be done.

【0356】なお、以上の実施形態および各変形例にお
いて、符号化側で述べた方法を、符号化するデータある
いはシステムによって切り替えるために、符号データの
伝送に先立って、ヘッダ部にどの方式を用いているかの
ID番号を付加し、復元側ではそのID番号から符号化
側で用いた登録方式を選択するようにしてもよい。
In the above-described embodiment and each modified example, in order to switch the method described on the encoding side depending on the data to be encoded or the system, which method is used for the header portion prior to the transmission of the encoded data. Alternatively, the ID number may be added, and the restoration side may select the registration method used on the encoding side from the ID number.

【0357】[0357]

【発明の効果】以上詳述したように、請求項1記載の本
発明のデータ圧縮方法によれば、入力データを過去に出
現した履歴に応じて符号化して圧縮するデータ圧縮方法
において、入力データとそれまでに連続したn個のデー
タからなる文脈との組み合わせを登録した文脈木を保持
する文脈木保持過程と、文脈毎に独立した符号木を保持
する符号木保持過程と、入力データと文脈との組み合わ
せが文脈木保持過程に保持されていないとき、文脈木保
持過程の文脈木にデータを新規に登録する文脈木新規登
録過程と、入力データと文脈との組み合わせが文脈木保
持過程に保持されていないとき、符号木保持過程の符号
木のデータ格納点としてのリーフを分岐して得た新規リ
ーフにデータを格納する符号木新規登録過程と、入力デ
ータと文脈との組み合わせが文脈木保持過程に保持され
ていないとき文脈を変更する文脈変更過程と符号木の頂
点からの入力データあるいは符号木中の特定コードが登
録してあるリーフまでの分岐に従って符号を出力する符
号出力過程と、入力データあるいは符号木中の特定コー
ドが登録してあるリーフと他のリーフあるいは符号木の
頂点以外の分岐点として定義されるノードとを取り替え
る符号長変更過程とを有し、符号木新規登録過程では、
特定コードを登録してあるリーフを分岐し、得た2つの
新規リーフにの特定コードと新規データとを登録するこ
とを特徴としているので、上述の特定コードを比較的多
く出力するようなデータである場合、または文脈木保持
過程に保持されている文脈の登録が十分でない初期の段
階などにおいて高い符号化率が得られる効果がある。ま
た、上述の符号木新規登録過程の前に符号長変更過程を
行なえば、符号及び特定コードの符号長を最小で2ビッ
ト、符号木新規登録後に符号長変更過程を行なえば、特
定コードの符号を最小で1ビットにすることができるの
で、さらに符号化効率が大幅に向上する効果がある。さ
らに、符号木新規登録では、データの新規登録は常に1
つずつ行なわれるので、常に符号木の高次には再現性を
持ったシンボルのみが登録されることになり、符号木に
登録はしたが実際には使われていないデータが存在する
ために生じる符号化効率の低下を防止でき、これにより
十分にデータの登録がなされた後の符号化効率が大幅に
向上する効果がある。
As described above in detail, according to the data compression method of the present invention as set forth in claim 1, in the data compression method for encoding and compressing the input data according to the history that has appeared in the past, the input data And a context tree holding process that holds a context tree in which a combination of contexts consisting of n pieces of continuous data is registered, a code tree holding process that holds an independent code tree for each context, input data and context When the combination of and is not held in the context tree holding process, the data is newly registered in the context tree of the context tree holding process, and the combination of the input data and the context is held in the context tree holding process. If not, a code tree new registration process of storing data in a new leaf obtained by branching a leaf as a data storage point of the code tree in the code tree holding process, and a set of input data and context A code that outputs a code according to a context change process that changes the context when the match is not held in the context tree holding process, and input data from the vertices of the code tree or a branch to a leaf in which a specific code in the code tree is registered An output process and a code length changing process for replacing a leaf in which a specific code in the input data or the code tree is registered with another leaf or a node defined as a branch point other than the vertex of the code tree, In the tree new registration process,
It is characterized in that the leaf in which the specific code is registered is branched, and the specific code and new data for the two new leaves obtained are registered, so that data that outputs a relatively large number of the above specific codes is used. In some cases, or in the initial stage where the context held in the context tree holding process is not sufficiently registered, a high coding rate can be obtained. Further, if the code length changing process is performed before the above-mentioned code tree new registration process, the code length of the code and the specific code is at least 2 bits, and if the code length changing process is performed after the code tree new registration, the code of the specific code is generated. Can be set to a minimum of 1 bit, which has the effect of significantly improving the coding efficiency. Furthermore, in the new registration of the code tree, the new registration of data is always 1
Since it is done one by one, only reproducible symbols are always registered in the higher order of the code tree, and it occurs because there is data that is registered in the code tree but is not actually used. There is an effect that it is possible to prevent a decrease in the coding efficiency, and thereby the coding efficiency after the data is sufficiently registered is significantly improved.

【0358】また、請求項2記載の本発明のデータ圧縮
方法によれば、上述の請求項1記載の本発明のデータ圧
縮方法における特定コードを、予め未登録を示すデータ
として定義されるエスケープコードとすることにより、
上述の請求項1記載の本発明のデータ圧縮方法における
効果と同様の効果が得られる。さらに、本発明のデータ
圧縮方法によれば、符号木新規登録過程では、同じ文脈
の下にあるリーフのうち、符号木の頂点として定義され
るルートからの距離が最も長いリーフを分岐し、得た2
つの新規リーフに、分岐したリーフに格納していたデー
タと、新規データとを登録したり(請求項3)、また同
じ文脈の下にあるリーフのうち、最後に登録したリーフ
を分岐し、得た2つの新規リーフに、分岐したリーフに
格納していたデータと、新規データとを登録するように
することもできるので(請求項4)、上述の請求項2記
載の本発明のデータ圧縮方法における効果に加えて、あ
まり使われない出現頻度の最も低いデータの符号長を長
くすることができ、これにより符号長が1ビット伸びた
ことによる符号化効率の低下を最小限に抑えてデータ圧
縮の処理速度を大幅に向上させることができる効果があ
る。また、最後に登録したリーフに格納した新規データ
は、比較的符号長の長いデータとして近似できることか
ら、さらにデータ圧縮の処理速度が大幅に向上する効果
もある。
According to the data compression method of the present invention as set forth in claim 2, the specific code in the data compression method of the present invention as set forth in claim 1 is an escape code defined in advance as data indicating unregistered. By
The same effects as the effects of the data compression method of the present invention described in claim 1 are obtained. Further, according to the data compression method of the present invention, among the leaves under the same context, the leaf having the longest distance from the root defined as the vertex of the code tree is branched and obtained in the process of newly registering the code tree. 2
The data stored in the branched leaf and the new data can be registered in one new leaf (claim 3), or the last registered leaf among the leaves under the same context can be branched and obtained. Since the data stored in the branched leaf and the new data can be registered in the two new leaves (claim 4), the data compression method of the present invention according to claim 2 described above. In addition to the effect of the above, it is possible to lengthen the code length of the data which is rarely used and which has the lowest appearance frequency, thereby minimizing the deterioration of the coding efficiency due to the extension of the code length by 1 bit and compressing the data. There is an effect that the processing speed of can be greatly improved. In addition, since the new data stored in the last registered leaf can be approximated as data having a relatively long code length, there is an effect that the processing speed of data compression is significantly improved.

【0359】また、請求項5記載の本発明のデータ復元
方法によれば、入力データを過去の入力データの履歴に
応じて符号化した符号を復号するデータ復元方法におい
て、復号したデータと文脈との組み合わせを登録した文
脈木を保持する文脈木保持過程と文脈に応じておのおの
独立した符号木を保持する符号木保持過程と、直前まで
に復号したデータから符号の符号木を決定する符号木決
定過程と、符号に従って符号木の頂点を意味するルート
からデータ格納点としてのリーフへと走査して符号を復
号する復号過程と、到達したリーフが符号木中の特定コ
ードであった場合、文脈を変更する文脈変更過程と復号
したデータ及び特定コードのリーフを他のリーフあるい
は分岐点としてのノードと組み替える符号長変更過程
と、特定コードを復号したとき符号木に復号したデータ
を新規に登録する新規登録過程と新規登録過程で登録し
たデータを文脈木保持過程の文脈木に登録する文脈木登
録過程とを有し、新規登録過程では符号化側で分岐に選
択したリーフと同じリーフを分岐して新規データを登録
することを特徴としているので、符号化側と同様に、デ
ータの新規登録過程において、2つに分割したリーフの
符号長を(分割前のリーフの符号長+1)ビットにする
ことができるとともに、新規登録したデータの符号及び
特定コードの符号長を最小で2ビットにすることがで
き、これによりエスケープコードを比較的多く復号する
ようなデータである場合に、または辞書登録(符号木へ
のシンボルの登録)が十分でない初期の段階の場合など
において、データの復号効率が大幅に向上する効果があ
る。
Further, according to the data restoration method of the present invention as defined in claim 5, in the data restoration method for decoding the code obtained by coding the input data according to the history of the past input data, the decoded data and the context are Context tree holding process that holds the context tree in which the combinations of the two are registered, the code tree holding process that holds each independent code tree according to the context, and the code tree determination that determines the code tree of the code from the data decoded up to immediately before The process, the decoding process of decoding the code by scanning from the root that means the vertices of the code tree to the leaf as the data storage point according to the code, and when the arrived leaf is a specific code in the code tree, the context is The process of changing the context, the process of changing the code length and the process of changing the decoded data and the leaf of the specific code with another leaf or a node as a branch point, and restoring the specific code. Then, there is a new registration process for newly registering the decoded data in the code tree and a context tree registration process for registering the data registered in the new registration process in the context tree of the context tree holding process. It is characterized by branching the same leaf as the branch selected on the side and registering new data. Therefore, in the same way as the encoding side, in the process of new registration of data, the code length of the leaf divided into two is set. The code length of the leaf before division + 1 bit can be set, and the code length of the newly registered data and the code length of the specific code can be set to a minimum of 2 bits, whereby a relatively large number of escape codes can be decoded. The data decoding efficiency is significantly improved when the data is such that it is in the initial stage when the dictionary registration (the registration of symbols in the code tree) is not sufficient. There is an effect to be.

【0360】また、データの新規登録過程の前に符号長
変更過程を行なえば、復号したデータ符号及びエスケー
プコードの符号長を最小で2ビット、新規登録過程の後
に符号長変更過程を行なえば、エスケープコードの符号
を最小で1ビットにすることができ、これにより、さら
にデータの復号効率が大幅に向上する効果がある。さら
に、復元側が符号化側と同一の新規登録過程が行なうこ
とができ、これにより符号化側で符号化されたデータを
正確に復号することができる利点がある。
If the code length changing process is performed before the new data registration process, the code lengths of the decoded data code and the escape code are at least 2 bits, and if the code length changing process is performed after the new registration process, The code of the escape code can be set to a minimum of 1 bit, which has the effect of significantly improving the data decoding efficiency. Further, the restoration side can perform the same new registration process as the encoding side, and thus there is an advantage that the data encoded by the encoding side can be accurately decoded.

【0361】また、請求項6記載の本発明のデータ復元
方法によれば、特定コードを、予め未登録を示すデータ
として定義されるエスケープコードとしているので、上
述の請求項5記載の本発明のデータ復元方法における効
果と同様の効果が得られる。さらに、請求項7記載の本
発明のデータ圧縮装置によれば、入力データを過去に出
現した履歴に応じて符号化するデータ圧縮装置におい
て、予めデータ未登録を示すデータとして定義されるエ
スケープコードを登録した符号木を保持する符号木保持
手段と、入力データと文脈との組み合わせを登録した文
脈木を保持する文脈木保持手段と、エスケープコードを
符号化したのち、文脈木にデータを新規に登録する文脈
登録手段とエスケープコードを符号化したのち符号木の
エスケープコードのデータ格納点としてのリーフを分岐
してデータを新規に登録する符号登録手段と、入力デー
タと文脈との組み合わせが文脈木に保持されていないと
き、文脈を変更する文脈変更手段と符号木の頂点からの
入力データあるいはエスケープコードが登録してあるリ
ーフまでの分岐に従って符号を出力する符号化手段と、
符号化したデータ及びエスケープコードが登録してある
リーフと他のリーフあるいはノードとを取り替える符号
更新手段とをそなえて構成されたことを特徴としている
ので、エスケープコードを比較的多く出力するようなデ
ータである場合、または文脈木保持手段に保持されてい
る文脈の登録が十分でない初期の段階などにおいて高い
符号化率が得られる効果がある。また、符号登録手段に
よる符号の登録の前に符号更新手段による符号更新を行
なえば、符号及び特定コードの符号長を最小で2ビッ
ト、符号登録手段による符号の登録の後に符号更新手段
による符号更新を行なえば、エスケープコードの符号を
最小で1ビットにすることができ、これにより、さらに
符号化効率が大幅に向上する効果がある。さらに、符号
登録手段による符号の新規登録は、常に1つずつ行なわ
れるので、常に符号木の高次には再現性を持ったデータ
のみが登録されることになり、符号木に登録はしたが実
際には使われていないデータが存在するために生じる符
号化効率の低下を防止でき、これにより十分にデータの
登録がなされた後の符号化効率が大幅に向上する効果が
ある。そして、このような効果によりデータ圧縮装置の
性能が飛躍的に向上する効果がある。
Further, according to the data restoration method of the present invention as defined in claim 6, the specific code is an escape code defined in advance as data indicating non-registration. The same effect as that of the data restoration method can be obtained. Further, according to the data compression apparatus of the present invention as set forth in claim 7, in the data compression apparatus that encodes the input data according to the history that has appeared in the past, an escape code defined as data indicating data unregistered in advance is used. Code tree holding means for holding the registered code tree, context tree holding means for holding the context tree in which the combination of input data and context is registered, and after the escape code is encoded, the data is newly registered in the context tree. The combination of the input data and the context is stored in the context tree after the context registration means and the escape code have been encoded, and then the leaf as the data storage point of the escape code of the code tree is branched and the data is newly registered. When it is not held, the context changing means to change the context and the input data or escape code from the top of the code tree are registered. Encoding means for outputting a code according to branch to the leaf that,
It is characterized by comprising a code updating means for replacing the leaf in which the encoded data and the escape code are registered with another leaf or node, so that data that outputs a relatively large number of escape codes Or there is an effect that a high coding rate can be obtained in the initial stage where the registration of the context held in the context tree holding means is not sufficient. Further, if the code updating means performs the code updating before the code registering means registers the code, the code length of the code and the specific code is at least 2 bits, and the code updating means performs the code updating after the code registering means registers the code. By doing so, the code of the escape code can be set to a minimum of 1 bit, which has the effect of significantly improving the coding efficiency. Further, since the new code registration is always performed one by one by the code registration means, only the data having reproducibility is registered in the higher order of the code tree at all times. It is possible to prevent a decrease in coding efficiency that occurs due to the presence of data that is not actually used, and this has the effect of significantly improving the coding efficiency after sufficient data registration. Then, such an effect has the effect of dramatically improving the performance of the data compression apparatus.

【0362】また、請求項8記載の本発明のデータ圧縮
装置によれば、入力データを過去に出現した履歴に応じ
て符号化するデータ圧縮装置において、予めデータ未登
録を示すデータとして定義されるエスケープコードを登
録した符号木を保持する符号木保持手段と、入力データ
と文脈との組み合わせを登録した文脈木を保持する文脈
木保持手段と、エスケープコードを符号化したのち、文
脈木にデータを新規に登録する文脈登録手段と符号木上
の最長の符号長を持つリーフを検索する分岐位置検索手
段と、エスケープコードを符号化したのち、分岐位置検
索手段に検索されたデータ格納点としてのリーフを分岐
してデータを新規に登録する符号登録手段と、入力デー
タと文脈との組み合わせが文脈木に保持されていないと
き文脈を変更する文脈変更手段と符号木の頂点から入力
データあるいはエスケープコードが登録してあるリーフ
までの分岐に従って符号を出力する符号化手段と、符号
化したデータ及びエスケープコードが登録してあるリー
フと他のリーフあるいはノードとを取り替える符号更新
手段とをそなえて構成されたことを特徴としているの
で、上述の請求項7記載の本発明のデータ圧縮装置にお
ける効果に加えて、あまり使われない出現頻度の最も低
いデータの符号長を長くすることができ、これにより符
号長が1ビット伸びたことによる符号化効率の低下を最
小限に抑えてデータ圧縮の処理速度を大幅に向上させる
ことができる効果があるるとともにデータ圧縮装置の性
能が飛躍的に向上する効果がある。
Further, according to the data compression apparatus of the present invention as defined in claim 8, in the data compression apparatus which encodes the input data according to the history that has appeared in the past, it is defined in advance as data indicating unregistered data. A code tree holding means for holding a code tree in which an escape code is registered, a context tree holding means for holding a context tree in which a combination of input data and a context is registered, and after encoding an escape code, data is stored in the context tree. A newly registered context registration means, a branch position search means for searching a leaf having the longest code length on the code tree, and a leaf as a data storage point searched by the branch position search means after encoding an escape code. And a code registration means for branching the data to newly register the data, and changing the context when the combination of the input data and the context is not held in the context tree. Pulse changing means, encoding means for outputting a code in accordance with a branch from the top of the code tree to a leaf in which input data or escape code is registered, a leaf in which encoded data and escape code are registered, and another leaf Alternatively, since it is characterized in that it is configured with a code updating means for replacing a node, in addition to the effect of the data compression apparatus of the present invention according to claim 7 described above, the frequency of occurrence of the least frequently used occurrence is lowest. It is possible to increase the code length of the data, which has the effect that the reduction of the coding efficiency due to the increase of the code length by 1 bit can be minimized and the processing speed of the data compression can be significantly improved. At the same time, there is an effect that the performance of the data compression device is dramatically improved.

【0363】さらに、請求項9記載の本発明のデータ圧
縮装置によれば、入力データを過去に出現した履歴に応
じて符号化するデータ圧縮装置において、予めデータ未
登録を示すデータとして定義されるエスケープコードを
登録した符号木を保持する符号木保持手段と、入力デー
タと文脈との組み合わせを登録した文脈木を保持する文
脈木保持手段と、エスケープコードを符号化したのち、
文脈木にデータを新規に登録する文脈登録手段と符号木
に新規に登録されたデータ格納点としてのリーフの位置
を保持する分岐位置保持手段と、エスケープコードを符
号化したのち、分岐位置保持手段に保持されている位置
にあるリーフを分岐してデータを新規に登録する符号登
録手段と、入力データと文脈との組み合わせが文脈木に
保持されていないとき分脈を変更する文脈変更手段と、
符号木の頂点から入力データあるいはエスケープコード
が登録してあるリーフまでの分岐に従って符号を出力す
る符号化手段と、符号化したデータ及びエスケープコー
ドが登録してあるリーフと他のリーフあるいは分岐点と
してのノードとを取り替える符号更新手段とをそなえて
構成されているので、請求項7記載の本発明のデータ圧
縮装置における効果に加えて、最後に登録したリーフに
格納した新規データは、比較的符号長の長いデータとし
て近似できることから、さらにデータ圧縮の処理速度が
大幅に向上するとともにデータ圧縮装置の処理負荷も大
幅に軽減される効果がある。
Further, according to the data compression apparatus of the present invention as defined in claim 9, in the data compression apparatus which encodes the input data according to the history that has appeared in the past, it is defined in advance as data indicating data unregistered. A code tree holding means for holding a code tree in which an escape code is registered, a context tree holding means for holding a context tree in which a combination of input data and a context is registered, and after encoding an escape code,
Context registration means for newly registering data in the context tree, branch position holding means for holding the position of a leaf as a data storage point newly registered in the code tree, and branch position holding means after encoding an escape code Code registration means for branching the leaf at the position held in to newly register the data, and context changing means for changing the branch when the combination of the input data and the context is not held in the context tree,
Encoding means for outputting a code in accordance with a branch from a vertex of a code tree to a leaf in which input data or escape code is registered, and a leaf in which encoded data and escape code are registered and another leaf or branch point In addition to the effect of the data compressing apparatus of the present invention according to claim 7, the new data stored in the last registered leaf has a relatively code. Since the data can be approximated as a long data, the processing speed of data compression is significantly improved, and the processing load of the data compression device is significantly reduced.

【0364】また、請求項10記載の本発明のデータ復
元装置によれば、入力データを過去の入力データの履歴
に応じて符号化した符号を復号するデータ復元装置にお
いて、予めデータ未登録を示すデータとして定義される
エスケープコードを登録した符号木を保持する符号木保
持手段と復号したデータと文脈との組み合わせを登録し
た文脈木を保持する文脈保持手段と、直前までに復号し
たデータから符号の符号木を決定する符号木決定手段
と、符号に従って符号木の頂点を意味するルートからデ
ータ格納点としてのリーフへと走査して符号を復号する
復号手段と、到達したリーフがエスケープコードであっ
た場合、文脈を変更する文脈変更手段と復号したデータ
及びエスケープコードのリーフを他のリーフあるいは分
岐点としてのノードと組み替える符号更新手段と、エス
ケープコードを復号したとき、エスケープコードのリー
フを分岐して復号したデータを新規に登録する符号登録
手段と、符号登録手段で登録したデータを文脈保持手段
の文脈木に登録する文脈木登録手段とをそなえて構成さ
れているので、エスケープコードを比較的多く復号する
ようなデータである場合、または文脈木保持手段に保持
されている文脈の登録が十分でない初期の段階などにお
いて高い復号率が得られる効果がある。また、符号登録
手段による符号の登録の前に符号更新手段による符号更
新を行なえば、符号及び特定コードの符号長を最小で2
ビット、符号登録手段による符号の登録の後に符号更新
手段による符号更新を行なえば、エスケープコードの符
号を最小で1ビットにすることができ、これにより、さ
らに復号効率が大幅に向上する効果がある。さらに、符
号登録手段による復号する符号の新規登録は、常に1つ
ずつ行なわれるので、常に符号木の高次には再現性を持
ったデータのみが登録されることになり、符号木に登録
はしたが実際には使われていないデータが存在するため
に生じる復号効率の低下を防止でき、これにより十分に
データの登録がなされた後の復号効率が大幅に向上する
効果がある。そして、このような効果によりデータ復元
装置の性能が飛躍的に向上する効果がある。
According to the data restoration apparatus of the present invention as set forth in claim 10, the data restoration apparatus which decodes the code obtained by coding the input data according to the history of the past input data indicates the data unregistered in advance. A code tree holding means for holding a code tree in which an escape code defined as data is held, a context holding means for holding a context tree in which a combination of decoded data and context is registered, and a code from the data decoded up to immediately before The code tree determining means for determining the code tree, the decoding means for decoding the code by scanning from the root that means the vertices of the code tree to the leaf as the data storage point according to the code, and the leaf that arrived was the escape code In this case, the context change means for changing the context and the leaf of the decrypted data and escape code are used as other leaves or nodes as branch points. Code updating means for rearranging, code registration means for newly registering the decoded data by branching the escape code leaf when the escape code is decoded, and data registered by the code registration means are registered in the context tree of the context holding means. Since it is configured with the context tree registration means for performing the above, if the data is such that an escape code is decoded in a relatively large amount, or the context held in the context tree holding means is insufficient in the initial stage, etc. In, there is an effect that a high decoding rate can be obtained. If the code updating means performs the code updating before the code registering means registers the code, the code length of the code and the specific code is at least 2.
If the code is updated by the code updating means after registering the bit and the code by the code registering means, the code of the escape code can be reduced to 1 bit at the minimum, thereby further improving the decoding efficiency. . Further, since the new code to be decoded by the code registration means is always registered one by one, only the data having reproducibility is registered in the higher order of the code tree, and the code tree is not registered. However, it is possible to prevent a decrease in the decoding efficiency caused by the existence of data that is not actually used, and this has the effect of significantly improving the decoding efficiency after the data is sufficiently registered. Then, such an effect has the effect of dramatically improving the performance of the data restoration device.

【0365】さらに、請求項11記載の本発明のデータ
復元装置によれば、入力データを過去の入力データの履
歴に応じて符号化した符号を復号するデータ復元装置に
おいて、予めデータ未登録を示すデータとして定義され
るエスケープコードを登録した符号木を保持する符号木
保持手段と復号したデータと文脈との組み合わせを登録
した文脈木を保持する文脈保持手段と、直前までに復号
したデータから符号の符号木を決定する符号木決定手段
と、符号に従って符号木の頂点を意味するルートからデ
ータ格納点としてのリーフへと走査して符号を復号する
復号手段と、到達したリーフがエスケープコードであっ
た場合、文脈を変更する文脈変更手段と復号したデータ
及びエスケープコードのリーフを他のリーフあるいは分
岐点としてのノードと組み替える符号更新手段と、符号
木内の最長の符号長を持つリーフの位置を検索する分岐
位置検索手段と、エスケープコードを符号化したのち分
岐位置検索手段で検索されたリーフを分岐してデータを
新規に登録する符号登録手段と、符号登録手段で登録し
たデータを文脈保持手段の文脈木に登録する文脈木登録
手段とをそなえて構成されているので、請求項10記載
の本発明のデータ復元装置における効果に加えて、あま
り使われない出現頻度の最も低いデータの符号長を長く
することができ、これにより符号長が1ビット伸びるこ
とによる符号化効率の低下を最小限に抑えてデータ復元
の処理速度を大幅に向上させることができる効果があ
り、さらにデータ復元装置の性能が飛躍的に向上する効
果もある。
Further, according to the data restoration apparatus of the present invention as set forth in claim 11, in the data restoration apparatus which decodes the code obtained by coding the input data in accordance with the history of the past input data, the data non-registration is shown in advance. A code tree holding means for holding a code tree in which an escape code defined as data is held, a context holding means for holding a context tree in which a combination of decoded data and context is registered, and a code from the data decoded up to immediately before The code tree determining means for determining the code tree, the decoding means for decoding the code by scanning from the root that means the vertices of the code tree to the leaf as the data storage point according to the code, and the leaf that arrived was the escape code In this case, the context changing means for changing the context and the leaf of the decrypted data and escape code are used as other leaf or branch points. Code updating means for recombination with, branch position searching means for searching the position of the leaf having the longest code length in the code tree, and encoding the escape code and then branching the leaves searched by the branch position searching means to obtain data. The data restoration of the present invention according to claim 10, which comprises a code registration means for newly registering and a context tree registration means for registering the data registered by the code registration means in the context tree of the context holding means. In addition to the effect in the device, the code length of the data that is rarely used and has the lowest appearance frequency can be lengthened, thereby minimizing the decrease in coding efficiency due to the extension of the code length by 1 bit and restoring the data. There is an effect that the processing speed of (1) can be significantly improved, and further, there is an effect that the performance of the data restoration device is dramatically improved.

【0366】また、請求項12記載の本発明のデータ復
元装置によれば、入力データを過去の入力データの履歴
に応じて符号化した符号を復号するデータ復元装置にお
いて、予めデータ未登録を示すデータとして定義される
エスケープコードを登録した符号木を保持する符号木保
持手段と復号したデータと文脈との組み合わせを登録し
た文脈木を保持する文脈保持手段と、直前までに復号し
たデータから符号の符号木を決定する符号木決定手段
と、符号に従って符号木の頂点を意味するルートからデ
ータ格納点としてのリーフへと走査して符号を復号する
復号手段と、到達したリーフがエスケープコードであっ
た場合、文脈を変更する文脈変更手段と復号したデータ
及びエスケープコードのリーフを他のリーフあるいは分
岐点としてのノードと組み替える符号更新手段と、符号
木に新規に登録されたリーフの位置を保持する分岐位置
保持手段と、エスケープコードを符号化したのち、分岐
位置保持手段に保持されている位置にあるリーフを分岐
してデータを新規に登録する符号登録手段と、符号登録
手段で登録したデータを文脈保持手段の文脈木に登録す
る文脈木登録手段とをそなえて構成されているので、上
述の請求項34記載の本発明のデータ復元装置による効
果に加えて、データの新規登録を最後に登録したデータ
が格納されているリーフに行なうことができ、この最後
に登録したリーフに格納されているデータは比較的符号
長の長いデータとして近似できることから、符号長が1
ビット伸びることによる復号化効率の低下を最小限に抑
えてデータ復元の処理速度を大幅に向上させることがで
きる効果があり、さらにデータ復元装置の性能が飛躍的
に向上する効果もある。
Further, according to the data restoration apparatus of the present invention as set forth in claim 12, the data restoration apparatus which decodes the code obtained by coding the input data according to the history of the past input data indicates the data unregistered in advance. A code tree holding means for holding a code tree in which an escape code defined as data is held, a context holding means for holding a context tree in which a combination of decoded data and context is registered, and a code from the data decoded up to immediately before The code tree determining means for determining the code tree, the decoding means for decoding the code by scanning from the root that means the vertices of the code tree to the leaf as the data storage point according to the code, and the leaf that arrived was the escape code In this case, the context change means for changing the context and the leaf of the decrypted data and escape code are used as other leaves or nodes as branch points. The code updating means for rearrangement, the branch position holding means for holding the position of the leaf newly registered in the code tree, the escape code are encoded, and then the leaf at the position held by the branch position holding means is branched. 35. The code registration means for newly registering data by means of the code registration means, and the context tree registration means for registering the data registered by the code registration means in the context tree of the context holding means. In addition to the effect of the data restoration device of the present invention, new registration of data can be performed in the leaf in which the last registered data is stored, and the data stored in this last registered leaf is relatively coded. Since it can be approximated as long data, the code length is 1
There is an effect that the reduction of the decoding efficiency due to the bit expansion can be suppressed to the minimum and the processing speed of the data recovery can be significantly improved, and further the performance of the data recovery device can be dramatically improved.

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

【図1】本発明に関連する技術を説明するためのブロッ
ク図である。
FIG. 1 is a block diagram illustrating a technique related to the present invention.

【図2】本発明に関連する技術を説明するためのブロッ
ク図である。
FIG. 2 is a block diagram illustrating a technique related to the present invention.

【図3】本発明に関連する技術を説明するためのブロッ
ク図である。
FIG. 3 is a block diagram illustrating a technique related to the present invention.

【図4】本発明に関連する技術を説明するためのブロッ
ク図である。
FIG. 4 is a block diagram illustrating a technique related to the present invention.

【図5】本発明に関連する技術を説明するためのブロッ
ク図である。
FIG. 5 is a block diagram illustrating a technique related to the present invention.

【図6】本発明に関連する技術を説明するためのブロッ
ク図である。
FIG. 6 is a block diagram illustrating a technique related to the present invention.

【図7】本発明に関連する技術を説明するためのブロッ
ク図である。
FIG. 7 is a block diagram illustrating a technique related to the present invention.

【図8】本発明に関連する技術を説明するためのブロッ
ク図である。
FIG. 8 is a block diagram illustrating a technique related to the present invention.

【図9】本発明の原理ブロック図である。FIG. 9 is a principle block diagram of the present invention.

【図10】本発明の原理ブロック図である。FIG. 10 is a principle block diagram of the present invention.

【図11】本発明の原理ブロック図である。FIG. 11 is a principle block diagram of the present invention.

【図12】本発明の原理ブロック図である。FIG. 12 is a principle block diagram of the present invention.

【図13】本発明の原理ブロック図である。FIG. 13 is a principle block diagram of the present invention.

【図14】本発明の原理ブロック図である。FIG. 14 is a principle block diagram of the present invention.

【図15】本発明に関連する技術1としてのデータ圧縮
装置及びデータ復元装置の構成を示すブロック図であ
る。
FIG. 15 is a block diagram showing a configuration of a data compression apparatus and a data decompression apparatus as technology 1 related to the present invention.

【図16】(a)は文脈木の格納形式の一例を示す図で
ある。(b)は辞書の親子関係を示す図である。
FIG. 16A is a diagram showing an example of a storage format of a context tree. (B) is a figure which shows the parent-child relationship of a dictionary.

【図17】符号木の初期状態を説明するための図であ
る。
FIG. 17 is a diagram for explaining an initial state of a code tree.

【図18】符号木を格納する配列の一例を示す図であ
る。
FIG. 18 is a diagram showing an example of an array that stores a code tree.

【図19】(a),(b)はそれぞれスプレイ符号の符
号更新の基本操作およびスプレイ符号の符号更新の一例
を説明するための図である。
19A and 19B are diagrams for explaining an example of a basic operation for updating the code of the splay code and an example of updating the code of the splay code, respectively.

【図20】関連技術1にかかる符号化の手順を説明する
ためのフローチャートである。
FIG. 20 is a flowchart for explaining a coding procedure according to Related Technique 1.

【図21】(a),(b)は、関連技術1にかかる文脈
木と符号木の更新手順を説明するための図である。
21A and 21B are diagrams for explaining a procedure for updating a context tree and a code tree according to Related Technique 1.

【図22】(a),(b)は、関連技術1にかかる文脈
木と符号木の更新手順を説明するための図である。
22 (a) and 22 (b) are diagrams for explaining a procedure for updating a context tree and a code tree according to Related Technique 1.

【図23】(a),(b)は、関連技術1にかかる文脈
木と符号木の更新手順を説明するための図である。
23 (a) and 23 (b) are diagrams for explaining a procedure for updating a context tree and a code tree according to Related Technique 1. FIG.

【図24】(a),(b)は、関連技術1にかかる文脈
木と符号木の更新手順を説明するための図である。
24 (a) and 24 (b) are diagrams for explaining a procedure for updating a context tree and a code tree according to Related Technique 1.

【図25】(a),(b)は、関連技術1にかかる文脈
木と符号木の更新手順を説明するための図である。
25 (a) and 25 (b) are diagrams for explaining a procedure for updating a context tree and a code tree according to Related Technique 1.

【図26】(a),(b)は、関連技術1にかかる文脈
木と符号木の更新手順を説明するための図である。
26 (a) and 26 (b) are diagrams for explaining a procedure for updating a context tree and a code tree according to Related Technique 1.

【図27】(a),(b)は、関連技術1にかかる文脈
木と符号木の更新手順を説明するための図である。
27A and 27B are diagrams for explaining a procedure for updating a context tree and a code tree according to Related Technique 1.

【図28】(a),(b)は、関連技術1にかかる文脈
木と符号木の更新手順を説明するための図である。
28 (a) and 28 (b) are diagrams for explaining a procedure for updating a context tree and a code tree according to Related Technique 1.

【図29】関連技術1にかかる文字列の符号化後の例を
説明するための図である。
[Fig. 29] Fig. 29 is a diagram for describing an example after encoding of a character string according to Related Technique 1.

【図30】(a),(b)は文脈木の作成手順のアルゴ
リズムを示す図である。
30 (a) and 30 (b) are diagrams showing an algorithm of a procedure for creating a context tree.

【図31】関連技術1にかかる復号化の手順を説明する
ためのフローチャートである。
FIG. 31 is a flowchart for explaining a decoding procedure according to Related Technique 1.

【図32】本発明に関連する技術2にかかるデータ圧縮
装置およびデータ復元装置の構成を示すブロック図であ
る。
FIG. 32 is a block diagram showing a configuration of a data compression device and a data decompression device according to Technology 2 related to the present invention.

【図33】関連技術2にかかるデータ圧縮装置の構成を
示すブロック図である。
FIG. 33 is a block diagram showing a configuration of a data compression device according to Related Technique 2.

【図34】関連技術2にかかる符号化部の構成を示すブ
ロック図である。
FIG. 34 is a block diagram showing a configuration of an encoding unit according to Related Technique 2.

【図35】関連技術2にかかる符号化の手順を説明する
ためのフローチャートである。
[Fig. 35] Fig. 35 is a flowchart for describing an encoding procedure according to Related Technique 2.

【図36】関連技術2にかかる符号の出力手順を説明す
るためのフローチャートである。
FIG. 36 is a flowchart for explaining a code output procedure according to Related Technique 2;

【図37】関連技術2にかかる符号木の組み替え手順を
説明するためのフローチャートである。
FIG. 37 is a flowchart for explaining a code tree rearrangement procedure according to Related Technique 2;

【図38】関連技術2にかかるデータ復元装置の構成を
説明するためのブロック図である。
FIG. 38 is a block diagram for explaining the configuration of a data restoration device according to Related Technique 2;

【図39】関連技術2にかかる復号部の構成を説明する
ためのブロック図である。
FIG. 39 is a block diagram for explaining a configuration of a decoding unit according to Related Technique 2.

【図40】関連技術2にかかる復号化の手順を説明する
ためのフローチャートである。
[Fig. 40] Fig. 40 is a flowchart for describing a decoding procedure according to Related Technique 2.

【図41】関連技術2にかかる復号化の手順を説明する
ためのフローチャートである。
FIG. 41 is a flowchart for explaining a decoding procedure according to Related Technique 2.

【図42】関連技術2の第1の変形例にかかるデータ圧
縮装置の構成を説明するためのブロック図である。
FIG. 42 is a block diagram for explaining a configuration of a data compression device according to a first modification of Related Technique 2.

【図43】関連技術2の第1の変形例にかかる符号化の
手順を説明するためのフローチャートである。
[Fig. 43] Fig. 43 is a flowchart for describing an encoding procedure according to a first modified example of related art 2.

【図44】関連技術2の第1の変形例にかかるデータ復
元装置の構成を説明するためのブロック図である。
FIG. 44 is a block diagram for explaining a configuration of a data restoration device according to a first modification of related art 2.

【図45】関連技術2の第1の変形例にかかる復号化の
手順を説明するためのフローチャートである。
[Fig. 45] Fig. 45 is a flowchart for describing a decoding procedure according to a first modified example of related art 2.

【図46】関連技術2の第2の変形例にかかるデータ圧
縮装置の構成を説明するためのブロック図である。
FIG. 46 is a block diagram for explaining a configuration of a data compression device according to a second modification of related art 2.

【図47】関連技術2の第2の変形例にかかる符号化の
手順を説明するためのフローチャートである。
[Fig. 47] Fig. 47 is a flowchart for describing an encoding procedure according to a second modified example of related art 2.

【図48】関連技術2の第2の変形例にかかるデータ復
元装置の構成を説明するためのブロック図である。
FIG. 48 is a block diagram for explaining a configuration of a data restoration device according to a second modified example of the related art 2.

【図49】関連技術2の第2の変形例にかかる復号化の
手順を説明するためのフローチャートである。
[Fig. 49] Fig. 49 is a flowchart for describing a decoding procedure according to a second modified example of the related art 2.

【図50】関連技術2の第3の変形例にかかる符号化の
手順を説明するためのフローチャートである。
[Fig. 50] Fig. 50 is a flowchart for describing an encoding procedure according to a third modified example of related art 2.

【図51】関連技術2の第3の変形例にかかる復号化の
手順を説明するためのフローチャートである。
[Fig. 51] Fig. 51 is a flowchart for describing a decoding procedure according to a third modified example of related art 2.

【図52】本発明の一実施形態にかかるデータ圧縮装置
の構成を説明するためのブロック図である。
FIG. 52 is a block diagram illustrating a configuration of a data compression device according to an embodiment of the present invention.

【図53】本実施形態にかかる符号登録部及び符号木保
持部の構成を説明するためのブロック図である。
[Fig. 53] Fig. 53 is a block diagram for describing configurations of a code registration unit and a code tree holding unit according to the present embodiment.

【図54】本実施形態にかかるデータ圧縮装置の動作を
説明するための図である。
FIG. 54 is a diagram for explaining the operation of the data compression apparatus according to the present embodiment.

【図55】本実施形態にかかるデータ圧縮装置の動作を
説明するための図である。
FIG. 55 is a diagram for explaining the operation of the data compression apparatus according to the present embodiment.

【図56】本実施形態にかかるデータ圧縮装置の動作を
説明するための図である。
FIG. 56 is a diagram for explaining the operation of the data compression apparatus according to the present embodiment.

【図57】(a),(b)はそれぞれ符号木および文脈
木の一例を示す図である。
57 (a) and (b) are diagrams showing an example of a code tree and a context tree, respectively.

【図58】本実施形態にかかる符号化の手順を説明する
ためのフローチャートである。
[Fig. 58] Fig. 58 is a flowchart for describing an encoding procedure according to the present embodiment.

【図59】本実施形態にかかる符号化の手順を説明する
ためのフローチャートである。
[Fig. 59] Fig. 59 is a flowchart for explaining a coding procedure according to the present embodiment.

【図60】(a),(b)は本実施形態にかかる符号の
新規登録の状態を示す図である。
FIGS. 60 (a) and 60 (b) are diagrams showing a state of newly registering a code according to the present embodiment.

【図61】本実施形態にかかる符号化の他の手順を説明
するためのフローチャートである。
FIG. 61 is a flowchart for explaining another encoding procedure according to the present embodiment.

【図62】本実施形態にかかるデータ復元装置の構成を
説明するためのブロック図である。
FIG. 62 is a block diagram for explaining the configuration of the data restoration device according to the present embodiment.

【図63】本実施形態にかかるデータ復元装置の動作を
説明するための図である。
FIG. 63 is a diagram for explaining the operation of the data restoration device according to the present embodiment.

【図64】本実施形態にかかるデータ復元装置の動作を
説明するための図である。
FIG. 64 is a diagram for explaining the operation of the data restoration device according to the present embodiment.

【図65】本実施形態にかかる復号化の手順を説明する
ためのフローチャートである。
FIG. 65 is a flowchart for explaining a decoding procedure according to the present embodiment.

【図66】本実施形態の第1の変形例にかかる符号登録
部及び符号木保持部の構成を説明するためのブロック図
である。
[Fig. 66] Fig. 66 is a block diagram for describing configurations of a code registration unit and a code tree holding unit according to a first modification of the present embodiment.

【図67】本実施形態の第1の変形例にかかる符号化の
手順を説明するためのフローチャートである。
[Fig. 67] Fig. 67 is a flowchart for explaining an encoding procedure according to the first modification of the present embodiment.

【図68】本実施形態の第2の変形例にかかる符号登録
部及び符号木保持部の構成例を説明するためのブロック
図である。
[Fig. 68] Fig. 68 is a block diagram for describing a configuration example of a code registration unit and a code tree holding unit according to a second modification of the present embodiment.

【図69】本実施形態の第2の変形例にかかる符号化の
手順を説明するためのフローチャートである。
[Fig. 69] Fig. 69 is a flowchart for describing an encoding procedure according to a second modification of the present embodiment.

【図70】(a),(b)は多値算術符号化の原理を説
明するための図である。
FIGS. 70 (a) and 70 (b) are diagrams for explaining the principle of multilevel arithmetic encoding.

【図71】(a),(b)は従来の文字単位に圧縮する
多値算術符号化の手順を示すフローチャートである。
71 (a) and 71 (b) are flowcharts showing a procedure of conventional multi-valued arithmetic coding for compressing in character units.

【図72】多値算術符号化のアルゴリズムの一例を示す
図である。
[Fig. 72] Fig. 72 is a diagram illustrating an example of an algorithm for multilevel arithmetic encoding.

【図73】(a),(b)はスプレイ符号化の原理を説
明するための図である。
73 (a) and 73 (b) are diagrams for explaining the principle of spray encoding.

【図74】確率統計型符号化の原理を説明するための図
である。
[Fig. 74] Fig. 74 is a diagram for describing the principle of probability statistical coding.

【図75】(a),(b)は文脈の木の登録例を示す図
である。
75 (a) and (b) are diagrams showing an example of registration of a context tree.

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

1,3 データ圧縮装置 2,4 データ復元装置 11,22 文脈収集過程 12,21 スプレイ符号化過程 41 上位ノード判別部 42 ノード番号管理部(メモリ) 43 位置判別部 44,48 ラッチ 45 スタック 46 下位ノード判別部 47 葉/節判別部 61 新規ノードID発生部 62 ラッチ 63 親子情報更新部 64 外部節点(リーフID)保持部 65 内部節点(ノードID)保持部 66 ESC−ID保持部 67 符号木管理部 68 外部節点/ESC−ID(リーフID)保持部 69 最長符号検出部(分岐位置検索手段) 70 最新登録ID保持部(分岐位置保持手段) 100,200 前置データ保持手段 100A−1〜100A−n,200A−1〜200A
−n 前置データ保持部 101,201 履歴保持手段 101A,201A 文脈履歴保持部 102,202,107,207,301,401 符
号木保持手段 102A,202A,107A,207A,301B,
401B 符号木保持部 103,203,403 符号木決定手段 103A,203A 符号木決定部 104 符号出力手段 104A,104A′,306B 符号化部 105,205 符号長変更手段 105A,205A 符号木更新部 106,206 前置データ更新手段 106A,206A 文脈更新部 108 文脈判別手段 108A 文脈判別部 109 エスケープコード出力手段 110,208,305,405 文脈変更手段 110A,210A,305B,403B 文脈変更部 111 符号出力手段 112,209 履歴登録手段 113,114,115,212,304,309,3
11,407,410,412 符号登録手段 112A,212A,322B,407B 符号登録部 116,117,213 制御手段 204,404 復号手段 204A,204A′,404B 復号部 303 文脈登録手段 303B,408B 文脈登録部 302,402 文脈木保持手段 302B,402B 文脈木保持部 306 符号化手段 307,406 符号更新手段 406B 符号変更部 308,409 分岐位置保持手段 310,411 分岐位置検索手段 321B,421B 文脈保持部 408,413,414 文脈木登録手段 409B ラッチ 511 文脈収集 512 動的可変長符号化
1, 3 Data compression device 2, 4 Data decompression device 11, 22 Context collection process 12, 21 Spray coding process 41 Upper node discriminating unit 42 Node number management unit (memory) 43 Position discriminating unit 44, 48 Latch 45 Stack 46 Lower Node discriminating unit 47 Leaf / node discriminating unit 61 New node ID generating unit 62 Latch 63 Parent-child information updating unit 64 External node (leaf ID) holding unit 65 Internal node (node ID) holding unit 66 ESC-ID holding unit 67 Code tree management Unit 68 External node / ESC-ID (leaf ID) storage unit 69 Longest code detection unit (branch position search unit) 70 Latest registered ID storage unit (branch position storage unit) 100, 200 Prefix data storage unit 100A-1 to 100A -N, 200A-1 to 200A
-N prefix data holding unit 101, 201 history holding unit 101A, 201A context history holding unit 102, 202, 107, 207, 301, 401 code tree holding unit 102A, 202A, 107A, 207A, 301B,
401B code tree holding unit 103, 203, 403 code tree determining unit 103A, 203A code tree determining unit 104 code output unit 104A, 104A ', 306B coding unit 105, 205 code length changing unit 105A, 205A code tree updating unit 106, 206 Prefix Data Updating Means 106A, 206A Context Updating Unit 108 Context Discriminating Unit 108A Context Discriminating Unit 109 Escape Code Outputting Units 110, 208, 305, 405 Context Changing Units 110A, 210A, 305B, 403B Context Changing Unit 111 Code Outputting Unit 112 , 209 History registration means 113, 114, 115, 212, 304, 309, 3
11, 407, 410, 412 Code registration means 112A, 212A, 322B, 407B Code registration section 116, 117, 213 Control means 204, 404 Decoding means 204A, 204A ', 404B Decoding section 303 Context registration means 303B, 408B Context registration section 302, 402 Context tree holding means 302B, 402B Context tree holding section 306 Encoding means 307, 406 Code updating means 406B Code changing sections 308, 409 Branch position holding means 310, 411 Branch position searching means 321B, 421B Context holding section 408, 413, 414 Context tree registration means 409B Latch 511 Context collection 512 Dynamic variable length coding

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 平5−218881(JP,A) 特開 平6−149537(JP,A) 特開 平6−315089(JP,A) 特開 平7−336237(JP,A) (58)調査した分野(Int.Cl.7,DB名) H03M 7/40 G06F 5/00 ─────────────────────────────────────────────────── ─── Continuation of the front page (56) Reference JP-A-5-218881 (JP, A) JP-A-6-149537 (JP, A) JP-A-6-315089 (JP, A) JP-A-7- 336237 (JP, A) (58) Fields investigated (Int.Cl. 7 , DB name) H03M 7/40 G06F 5/00

Claims (12)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 入力データを過去に出現した履歴に応じ
て符号化して圧縮するデータ圧縮方法において、 入力データとそれまでに連続したn個のデータからなる
文脈との組み合わせを登録した文脈木を保持する文脈木
保持過程と、 上記文脈毎に独立した符号木を保持する符号木保持過程
と、 上記の入力データと文脈との組み合わせが上記文脈木保
持過程に保持されていないとき、上記文脈木保持過程の
文脈木に上記データを新規に登録する文脈木新規登録過
程と、 上記の入力データと文脈との組み合わせが上記文脈木保
持過程に保持されていないとき、上記符号木保持過程の
符号木のデータ格納点としてのリーフを分岐して得た新
規リーフに上記データを格納する符号木新規登録過程
と、 上記の入力データと文脈との組み合わせが上記文脈木保
持過程に保持されていないとき文脈を変更する文脈変更
過程と、 上記符号木の頂点から上記の入力データあるいは上記符
号木中の特定コードが登録してあるリーフまでの分岐に
従って符号を出力する符号出力過程と上記の入力データ
あるいは符号木中の特定コードが登録してあるリーフと
他のリーフあるいは上記符号木の頂点以外の分岐点とし
て定義されるノードとを取り替える符号長変更過程とを
有し、 上記符号木新規登録過程では、上記特定コードを登録し
てあるリーフを分岐し、得た2つの新規リーフに上記の
特定コードと新規データとを登録することを特徴とす
る、データ圧縮方法。
1. A data compression method for encoding and compressing input data according to a history that has appeared in the past, wherein a context tree in which a combination of the input data and a context consisting of n continuous data is registered is created. The context tree holding process to hold, the code tree holding process to hold an independent code tree for each context, and the combination of the input data and the context is not held in the context tree holding process, the context tree When the context tree new registration process of newly registering the above data in the context tree of the holding process and the combination of the above input data and context is not held in the context tree holding process, the code tree of the above code tree holding process The code tree new registration process of storing the above data in the new leaf obtained by branching the leaf as the data storage point of A code that outputs a code according to a context changing process that changes the context when not held in the holding process, and a branch from the vertex of the code tree to the leaf in which the input data or the specific code in the code tree is registered It has an output process and a code length changing process for replacing a leaf in which a specific code in the input data or the code tree is registered with another leaf or a node defined as a branch point other than the vertex of the code tree. In the code tree new registration process, a leaf in which the specific code is registered is branched, and the specific code and new data are registered in the obtained two new leaves.
【請求項2】 入力データを過去に出現した履歴に応じ
て符号化して圧縮するデータ圧縮方法において、 予め未登録を示すデータとして定義されるエスケープコ
ードを登録した符号木を保持する符号木保持過程と、 入力データとそれまでに連続したn個のデータからなる
文脈との組み合わせを登録した文脈木を保持する文脈木
保持過程と、 上記の入力データと文脈との組み合わせが上記文脈木保
持過程に保持されていないとき、上記文脈木保持過程の
文脈木に上記データを新規に登録する文脈木新規登録過
程と、 上記の入力データと文脈との組み合わせが上記文脈木保
持過程に保持されていないとき、上記符号木保持過程の
符号木のデータ格納点としてのリーフを分岐して得た新
規リーフに上記データを格納する符号木新規登録過程
と、 上記の入力データと文脈との組み合わせが上記文脈木保
持過程に保持されていないとき文脈を変更する文脈変更
過程と、 上記符号木の頂点から上記の入力データあるいはエスケ
ープコードが登録してあるリーフまでの分岐に従って符
号を出力する符号出力過程と、 上記の入力データあるいはエスケープコードが登録して
あるリーフと他のリーフあるいは上記符号木の頂点以外
の分岐点として定義されるノードとを取り替える符号長
変更過程とを有し、 上記符号木新規登録過程では、上記エスケープコードを
登録してあるリーフを分岐し、得た2つの新規リーフに
上記のエスケープコードと新規データとを登録すること
を特徴とする、データ圧縮方法。
2. A data compression method for encoding and compressing input data according to a history that has appeared in the past, and a code tree holding process for holding a code tree in which an escape code defined as data indicating unregistered is registered in advance. And a context tree holding process for holding a context tree in which a combination of input data and a context made up of consecutive n data is registered, and a combination of the above input data and context becomes the above context tree holding process. When not held, when the context tree new registration process of newly registering the above data in the context tree of the above context tree holding process and the combination of the above input data and context is not held in the above context tree holding process A code tree new registration process of storing the data in a new leaf obtained by branching a leaf as a data storage point of the code tree in the code tree holding process, From the vertex of the code tree to the leaf in which the input data or escape code is registered, when the combination of the input data and the context of is not held in the context tree holding process, the context changing process. A code output process for outputting a code according to a branch, and a code length changing process for replacing a leaf in which the above input data or escape code is registered with another leaf or a node defined as a branch point other than the vertex of the above code tree In the code tree new registration process, the leaf in which the escape code is registered is branched, and the escape code and the new data are registered in the obtained two new leaves. Data compression method.
【請求項3】 上記符号木新規登録過程では、同じ文脈
の下にあるリーフのうち、符号木の頂点として定義され
るルートからの距離が最も長いリーフを分岐し、得た2
つの新規リーフに、分岐したリーフに格納していたデー
タと、新規データとを登録することを特徴とする、請求
項2記載のデータ圧縮方法。
3. In the code tree new registration process, among leaves under the same context, a leaf having the longest distance from a root defined as a vertex of the code tree is branched to obtain 2
The data compression method according to claim 2, wherein the data stored in the branched leaf and the new data are registered in one new leaf.
【請求項4】 上記符号木新規登録過程では、同じ文脈
の下にあるリーフのうち、最後に登録したリーフを分岐
し、得た2つの新規リーフに、分岐したリーフに格納し
ていたデータと、新規データとを登録することを特徴と
する請求項2記載のデータ圧縮方法。
4. In the code tree new registration process, among the leaves under the same context, the leaf registered last is branched, and the two new leaves obtained are stored with the data stored in the branched leaf. 3. The data compression method according to claim 2, wherein the new data is registered.
【請求項5】 入力データを過去の入力データの履歴に
応じて符号化した符号を復号するデータ復元方法におい
て、 復号したデータと文脈との組み合わせを登録した文脈木
を保持する文脈木保持過程と文脈に応じておのおの独立
した符号木を保持する符号木保持過程と、 直前までに復号したデータから上記符号の符号木を決定
する符号木決定過程と、 上記符号に従って上記符号木の頂点を意味するルートか
らデータ格納点としてのリーフへと走査して符号を復号
する復号過程と、 到達したリーフが符号木中の特定コードであった場合、
文脈を変更する文脈変更過程と、 復号したデータ及び上記特定コードのリーフを他のリー
フあるいは分岐点としてのノードと組み替える符号長変
更過程と、 上記特定コードを復号したとき符号木に復号したデータ
を新規に登録する新規登録過程と、 上記新規登録過程で登録したデータを上記文脈木保持過
程の文脈木に登録する文脈木登録過程とを有し、 上記新規登録過程では符号化側で分岐に選択したリーフ
と同じリーフを分岐して新規データを登録することを特
徴とする、データ復元方法。
5. A data restoration method for decoding a code obtained by coding input data according to the history of past input data, and a context tree holding process for holding a context tree in which a combination of decoded data and context is registered. It means a code tree holding process for holding each independent code tree according to the context, a code tree determining process for determining the code tree of the above code from the data decoded up to immediately before, and a vertex of the above code tree according to the above code. The decoding process of scanning the code from the root to the leaf as the data storage point and decoding the code, and if the leaf that arrived is a specific code in the code tree,
The context changing process of changing the context, the decoded data and the code length changing process of recombining the leaf of the specific code with another leaf or a node as a branch point, and the data decoded into the code tree when the specific code is decoded There is a new registration process of newly registering, and a context tree registration process of registering the data registered in the new registration process in the context tree of the context tree holding process. In the new registration process, the encoding side selects a branch. A data restoration method, characterized by branching the same leaf as the created leaf and registering new data.
【請求項6】 入力データを過去の入力データの履歴に
応じて符号化した符号を復号するデータ復元方法におい
て、 予めデータ未登録を示すデータとして定義されるエスケ
ープコードを登録した符号木を保持する符号木保持過程
と、 復号したデータと文脈との組み合わせを登録した文脈木
を保持する文脈木保持過程と、 直前までに復号したデータから上記符号の符号木を決定
する符号木決定過程と、 上記符号に従って上記符号木の頂点を意味するルートか
らデータ格納点としてのリーフへと走査して符号を復号
する復号過程と、 到達したリーフが上記エスケープコードであった場合、
文脈を変更する文脈変更過程と、 復号したデータ及び上記エスケープコードのリーフを他
のリーフあるいは分岐点としてのノードと組み替える符
号長変更過程と、 上記エスケープコードを復号したとき符号木に復号した
データを新規に登録する新規登録過程と、 上記新規登録過程で登録したデータを上記文脈木保持過
程の文脈木に登録する文脈木登録過程とを有し、 上記新規登録過程では符号化側で分岐に選択したリーフ
と同じリーフを分岐して新規データを登録することを特
徴とする、データ復元方法。
6. A data restoration method for decoding a code obtained by encoding input data according to a history of past input data, and holding a code tree in which an escape code defined as data indicating unregistered data is registered in advance. A code tree holding process, a context tree holding process for holding a context tree in which a combination of decoded data and a context is registered, a code tree determining process for determining a code tree of the above code from the data decoded up to immediately before, According to the code, the decoding process of scanning the path from the root meaning the vertex of the code tree to the leaf as the data storage point and decoding the code, and when the reached leaf is the escape code,
The context changing process of changing the context, the decoded data and the code length changing process of recombining the leaf of the escape code with another leaf or a node as a branch point, and the data decoded into the code tree when the escape code is decoded There is a new registration process of newly registering, and a context tree registration process of registering the data registered in the new registration process in the context tree of the context tree holding process. In the new registration process, the encoding side selects a branch. A data restoration method, characterized by branching the same leaf as the created leaf and registering new data.
【請求項7】 入力データを過去に出現した履歴に応じ
て符号化するデータ圧縮装置において、 予めデータ未登録を示すデータとして定義されるエスケ
ープコードを登録した符号木を保持する符号木保持手段
と、 入力データと文脈との組み合わせを登録した文脈木を保
持する文脈木保持手段と、 上記エスケープコードを符号化したのち、上記文脈木に
上記データを新規に登録する文脈登録手段と、 上記エスケープコードを符号化したのち符号木の上記エ
スケープコードのデータ格納点としてのリーフを分岐し
て上記データを新規に登録する符号登録手段と、 上記の入力データと文脈との組み合わせが文脈木に保持
されていないとき、文脈を変更する文脈変更手段と、 符号木の頂点から上記の入力データあるいはエスケープ
コードが登録してあるリーフまでの分岐に従って符号を
出力する符号化手段と、 符号化したデータ及び上記エスケープコードが登録して
あるリーフと他のリーフあるいはノードとを取り替える
符号更新手段とをそなえて構成されたことを特徴とす
る、データ圧縮装置。
7. A data compression apparatus for encoding input data in accordance with a history of past appearances, and a code tree holding means for holding a code tree in which an escape code defined as data indicating unregistered data is registered in advance. , A context tree holding means for holding a context tree in which a combination of input data and a context is registered, a context registration means for newly registering the data in the context tree after encoding the escape code, and the escape code Code is stored in the context tree, and a code registration means for branching a leaf as a data storage point of the escape code of the code tree and newly registering the data is stored in the context tree. If there is not, register the above input data or escape code from the top of the code tree and the context changing means to change the context. It comprises a coding means for outputting a code according to a branch to a certain leaf, and a code updating means for replacing a leaf in which the coded data and the escape code are registered with another leaf or node. A data compression device characterized.
【請求項8】 入力データを過去に出現した履歴に応じ
て符号化するデータ圧縮装置において、 予めデータ未登録を示すデータとして定義されるエスケ
ープコードを登録した符号木を保持する符号木保持手段
と、 入力データと文脈との組み合わせを登録した文脈木を保
持する文脈木保持手段と、 上記エスケープコードを符号化したのち、文脈木に上記
データを新規に登録する文脈登録手段と、 上記符号木上の最長の符号長を持つリーフを検索する分
岐位置検索手段と、 上記エスケープコードを符号化したのち、上記分岐位置
検索手段に検索されたデータ格納点としてのリーフを分
岐して上記データを新規に登録する符号登録手段と、 上記の入力データと文脈との組み合わせが文脈木に保持
されていないとき文脈を変更する文脈変更手段と、 符号木の頂点から入力データあるいは上記エスケープコ
ードが登録してあるリーフまでの分岐に従って符号を出
力する符号化手段と、 符号化したデータ及び上記エスケープコードが登録して
あるリーフと他のリーフあるいはノードとを取り替える
符号更新手段とをそなえて構成されたことを特徴とす
る、データ圧縮装置。
8. A data compression device for encoding input data according to a history of past appearances, and a code tree holding means for holding a code tree in which an escape code defined as data indicating unregistered data is registered in advance. , Context tree holding means for holding a context tree in which a combination of input data and context is registered; context registration means for newly registering the above data in the context tree after encoding the escape code; The branch position searching means for searching the leaf having the longest code length and the escape code are encoded, and the leaf as the data storage point searched by the branch position searching means is branched and the above data is newly added. Code registration means for registering, context changing means for changing the context when the combination of the input data and the context is not held in the context tree, Encoding means for outputting a code in accordance with a branch from a vertex of the code tree to input data or a leaf in which the escape code is registered, a leaf in which the encoded data and the escape code are registered, and another leaf or node And a code updating means for replacing the above.
【請求項9】 入力データを過去に出現した履歴に応じ
て符号化するデータ圧縮装置において、 予めデータ未登録を示すデータとして定義されるエスケ
ープコードを登録した符号木を保持する符号木保持手段
と、 入力データと文脈との組み合わせを登録した文脈木を保
持する文脈木保持手段と、 上記エスケープコードを符号化したのち、文脈木に上記
データを新規に登録する文脈登録手段と、 上記符号木に新規に登録されたデータ格納点としてのリ
ーフの位置を保持する分岐位置保持手段と、 上記エスケープコードを符号化したのち、上記分岐位置
保持手段に保持されている位置にあるリーフを分岐して
上記データを新規に登録する符号登録手段と、 上記の入力データと文脈との組み合わせが文脈木に保持
されていないとき分脈を変更する文脈変更手段と、 符号木の頂点から入力データあるいは上記エスケープコ
ードが登録してあるリーフまでの分岐に従って符号を出
力する符号化手段と、 符号化したデータ及び上記エスケープコードが登録して
あるリーフと他のリーフあるいは分岐点としてのノード
とを取り替える符号更新手段とをそなえて構成されたこ
とを特徴とする、データ圧縮装置。
9. A data compression device for encoding input data according to a history of past appearances, and a code tree holding means for holding a code tree in which an escape code defined as data indicating unregistered data is registered in advance. , Context tree holding means for holding a context tree in which a combination of input data and context is registered, context registration means for newly registering the above data in the context tree after encoding the above escape code, and in the above code tree Branch position holding means for holding the position of a leaf as a newly registered data storage point, and after encoding the escape code, branching the leaf at the position held by the branch position holding means Code registration means for newly registering data, and changing the branch when the combination of the above input data and context is not held in the context tree Context changing means, encoding means for outputting a code according to a branch from the top of the code tree to the input data or the leaf in which the escape code is registered, and the encoded data and the leaf in which the escape code is registered A data compression apparatus, comprising a code updating means for replacing another leaf or a node as a branch point.
【請求項10】 入力データを過去の入力データの履歴
に応じて符号化した符号を復号するデータ復元装置にお
いて、 予めデータ未登録を示すデータとして定義されるエスケ
ープコードを登録した符号木を保持する符号木保持手段
と、 復号したデータと文脈との組み合わせを登録した文脈木
を保持する文脈木保持手段と、 直前までに復号したデータから上記符号の符号木を決定
する符号木決定手段と、 上記符号に従って上記符号木の頂点を意味するルートか
らデータ格納点としてのリーフへと走査して符号を復号
する復号手段と、 到達したリーフが上記エスケープコードであった場合、
文脈を変更する文脈変更手段と、 復号したデータ及び上記エスケープコードのリーフを他
のリーフあるいは分岐点としてのノードと組み替える符
号更新手段と、 上記エスケープコードを復号したとき、上記エスケープ
コードのリーフを分岐して復号したデータを新規に登録
する符号登録手段と、 上記符号登録手段で登録したデータを文脈木保持手段の
文脈木に登録する文脈木登録手段とをそなえて構成され
たことを特徴とする、データ復元装置。
10. A data restoration device that decodes a code obtained by encoding input data according to a history of past input data, and holds a code tree in which an escape code defined as data indicating unregistered data is registered in advance. Code tree holding means, context tree holding means for holding a context tree in which a combination of decoded data and context is registered, code tree determining means for determining the code tree of the above code from the data decoded up to immediately before, Decoding means for decoding the code by scanning from the root meaning the apex of the code tree to the leaf as the data storage point according to the code, and when the arrived leaf is the escape code,
Context changing means for changing the context, code updating means for recombining the decoded data and the leaf of the escape code with another leaf or a node as a branch point, and when the escape code is decoded, the leaf of the escape code is branched Code registration means for newly registering the decoded data and a context tree registration means for registering the data registered by the code registration means in the context tree of the context tree holding means. , Data recovery device.
【請求項11】 入力データを過去の入力データの履歴
に応じて符号化した符号を復号するデータ復元装置にお
いて、 予めデータ未登録を示すデータとして定義されるエスケ
ープコードを登録した符号木を保持する符号木保持手段
と、 復号したデータと文脈との組み合わせを登録した文脈木
を保持する文脈木保持手段と、 直前までに復号したデータから上記符号の符号木を決定
する符号木決定手段と、 上記符号に従って上記符号木の頂点を意味するルートか
らデータ格納点としてのリーフへと走査して符号を復号
する復号手段と、 到達したリーフが上記エスケープコードであった場合、
文脈を変更する文脈変更手段と、 復号したデータ及び上記エスケープコードのリーフを他
のリーフあるいは分岐点としてのノードと組み替える符
号更新手段と、 上記符号木内の最長の符号長を持つリーフの位置を検索
する分岐位置検索手段と、 上記エスケープコードを符号化したのち上記分岐位置検
索手段で検索されたリーフを分岐して上記データを新規
に登録する符号登録手段と、 上記符号登録手段で登録したデータを文脈木保持手段の
文脈木に登録する文脈木登録手段とをそなえて構成され
たことを特徴とする、データ復元装置。
11. A data restoration apparatus for decoding a code obtained by encoding input data according to a history of past input data, and holding a code tree in which an escape code defined as data indicating unregistered data is registered in advance. Code tree holding means, context tree holding means for holding a context tree in which a combination of decoded data and context is registered, code tree determining means for determining the code tree of the above code from the data decoded up to immediately before, Decoding means for decoding the code by scanning from the root meaning the apex of the code tree to the leaf as the data storage point according to the code, and when the arrived leaf is the escape code,
Context changing means for changing the context, code updating means for recombining the decoded data and the leaf of the escape code with another leaf or a node as a branch point, and searching the position of the leaf with the longest code length in the code tree Branch position searching means for coding the escape code, branching the leaf searched by the branch position searching means and newly registering the data, and data registered by the code registering means. A data restoration device comprising a context tree registration means for registering in a context tree of a context tree holding means.
【請求項12】 入力データを過去の入力データの履歴
に応じて符号化した符号を復号するデータ復元装置にお
いて、 予めデータ未登録を示すデータとして定義されるエスケ
ープコードを登録した符号木を保持する符号木保持手段
と、 復号したデータと文脈との組み合わせを登録した文脈木
を保持する文脈木保持手段と、 直前までに復号したデータから上記符号の符号木を決定
する符号木決定手段と、 上記符号に従って上記符号木の頂点を意味するルートか
らデータ格納点としてのリーフへと走査して符号を復号
する復号手段と、 到達したリーフが上記エスケープコードであった場合、
文脈を変更する文脈変更手段と、 復号したデータ及び上記エスケープコードのリーフを他
のリーフあるいは分岐点としてのノードと組み替える符
号更新手段と、 上記符号木に新規に登録されたリーフの位置を保持する
分岐位置保持手段と、 上記エスケープコードを符号化したのち、上記分岐位置
保持手段に保持されている位置にあるリーフを分岐して
上記データを新規に登録する符号登録手段と、 上記符号登録手段で登録したデータを文脈木保持手段の
文脈木に登録する文脈木登録手段とをそなえて構成され
たことを特徴とする、データ復元装置。
12. A data restoration device for decoding a code obtained by coding input data according to a history of past input data, and holding a code tree in which an escape code defined as data indicating unregistered data is registered in advance. Code tree holding means, context tree holding means for holding a context tree in which a combination of decoded data and context is registered, code tree determining means for determining the code tree of the above code from the data decoded up to immediately before, Decoding means for decoding the code by scanning from the root meaning the apex of the code tree to the leaf as the data storage point according to the code, and when the arrived leaf is the escape code,
Context changing means for changing the context, code updating means for changing the decoded data and the leaf of the escape code with another leaf or a node as a branch point, and holding the position of the leaf newly registered in the code tree A branch position holding means, a code registration means for branching a leaf at a position held by the branch position holding means after coding the escape code, and newly registering the data; and the code registration means. A data restoration device comprising: a context tree registration means for registering registered data in a context tree of a context tree holding means.
JP2001402031A 2001-12-28 2001-12-28 Data compression method, data decompression method, data compression device, and data decompression device Expired - Fee Related JP3425143B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001402031A JP3425143B2 (en) 2001-12-28 2001-12-28 Data compression method, data decompression method, data compression device, and data decompression device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001402031A JP3425143B2 (en) 2001-12-28 2001-12-28 Data compression method, data decompression method, data compression device, and data decompression device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP16850294A Division JP3278297B2 (en) 1994-07-20 1994-07-20 Data compression method, data decompression method, data compression device, and data decompression device

Publications (2)

Publication Number Publication Date
JP2002232298A JP2002232298A (en) 2002-08-16
JP3425143B2 true JP3425143B2 (en) 2003-07-07

Family

ID=19189914

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001402031A Expired - Fee Related JP3425143B2 (en) 2001-12-28 2001-12-28 Data compression method, data decompression method, data compression device, and data decompression device

Country Status (1)

Country Link
JP (1) JP3425143B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5062131B2 (en) * 2008-10-06 2012-10-31 富士通株式会社 Information processing program, information processing apparatus, and information processing method
JP6296044B2 (en) * 2015-12-07 2018-03-20 富士通株式会社 Code processing program and data structure
CN113127637A (en) 2019-12-31 2021-07-16 中兴通讯股份有限公司 Character restoration method and device, storage medium and electronic device

Also Published As

Publication number Publication date
JP2002232298A (en) 2002-08-16

Similar Documents

Publication Publication Date Title
JPH0830432A (en) Data compressing method and data restoring method, and data compressing device and data restoring device
JP4559631B2 (en) Codebook structure for variable length to variable length entropy coding
Manzini An analysis of the Burrows—Wheeler transform
US7190287B2 (en) Method of generating Huffman code length information
US6982661B2 (en) Method of performing huffman decoding
JP2004511928A (en) System and method for progressive and continuous data compression
JPH07160473A (en) Method and apparatus for compression of byte-aligned data
JP3425143B2 (en) Data compression method, data decompression method, data compression device, and data decompression device
JP3425142B2 (en) Data compression method, data decompression method, data compression device, and data decompression device
Rueda et al. A fast and efficient nearly-optimal adaptive Fano coding scheme
Niemi et al. Burrows‐Wheeler post‐transformation with effective clustering and interpolative coding
JP2005521324A (en) Method and apparatus for lossless data compression and decompression
JPH0628149A (en) Method for compressing plural kinds of data
KR100598341B1 (en) Method of IP subnet information management on database using binary string
JPH1155125A (en) Method for compressing and restoring character data
Mukherjee et al. Text compression
中村博文 Data Compression by Replacement of Symbol Pairs and Its Implementation
Pannirselvam et al. A Comparative Analysis on Different Techniques in Text Compression
JPH06274311A (en) Data compression device and data restoration device
Islam et al. Thesis report
太田隆博 et al. Antidictionary data compression using dynamic suffix trees
Bell Data compression
Lu et al. Parallel implementations of Huffman coding using associative memory
Aziz et al. A Comparision between Coding Methods in Data Compression with A Proposed Method
Tanaka et al. Interchangeability of Magneto Optical Disk for Medical Image and Information Filing Use

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20030415

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

Free format text: PAYMENT UNTIL: 20080502

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20090502

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20090502

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20100502

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20100502

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20110502

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20120502

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20130502

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20140502

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees