JP2002232298A - Method and device for compressing and restoring data - Google Patents

Method and device for compressing and restoring data

Info

Publication number
JP2002232298A
JP2002232298A JP2001402031A JP2001402031A JP2002232298A JP 2002232298 A JP2002232298 A JP 2002232298A JP 2001402031 A JP2001402031 A JP 2001402031A JP 2001402031 A JP2001402031 A JP 2001402031A JP 2002232298 A JP2002232298 A JP 2002232298A
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.)
Granted
Application number
JP2001402031A
Other languages
Japanese (ja)
Other versions
JP3425143B2 (en
Inventor
Kimitaka Murashita
君孝 村下
Yoshiyuki Okada
佳之 岡田
Shigeru Yoshida
茂 吉田
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

Abstract

PROBLEM TO BE SOLVED: To accelerate data compressing/restoring processing by enabling high speed code registering by applying spray encoding in place of the block calculation of arithmetic codes and registering novel data in a code tree in such spray encoding. SOLUTION: A code tree independent for each context is held and when the combination of input data and the context is not held in a context tree, a code is outputted according to a branch from the apex of the code tree to a leaf, where such input data or specified code is registered (step Q4). Then, the leaf, where such input data or specified code is registered, is exchanged with the other leaf or code defined as a branching point except for the apex (step Q5), the leaf of the code tree, where the specified code is registered, is branched (step Q6) and the specified code and novel data are registered in provided two novel leaves (step Q7).

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、データ圧縮方法及
びデータ復元方法並びにデータ圧縮装置及びデータ復元
装置に関する。近年、文字コード、ベクトル情報,画像
など様々な種類のデータがコンピュータで扱われるよう
になっており、扱われるデータ量も急速に増加してきて
いる。これに伴い、大量のデータを扱うときは、データ
の中の冗長な部分を省いてデータ量を圧縮することで、
記憶容量を減らしたり速く伝送したりすることが行なわ
れている。また、様々なデータを一つの方式でデータ圧
縮できる方法としてユニバーサル符号化が提案されてい
る。
The present invention relates to a data compression method and 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 rapidly increased. Along with this, when dealing with large amounts of data, compressing the amount of data by eliminating redundant parts in the data,
Reduction of storage capacity and faster transmission have been performed. Also, universal encoding has been proposed as a method capable of compressing various data by one method.

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

【0003】[0003]

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

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

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

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

【0007】ここで、図70(a)はシンボルと出現頻
度の一例を示す図、同図70(b)はシンボルの区間分
割の例を示す図である。そして、文字列“abe”の区
間を分割する場合を例にとり、説明を進める。まず、数
直線〔0,1)を、図70(a)で示すような文字a,
b,c,d,eの5つの区間に分割する。
FIG. 70A shows an example of a symbol and an appearance frequency, and FIG. 70B shows an example of symbol segmentation. The description will be given taking a case where the section of the character string “ab” is divided as an example. First, a number line [0, 1) is drawn using characters a, 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 symbol “a” that first appears is selected, and the selected section [0, 0.2] is selected.
0.2) is further divided into five sections of all symbols a to e. Next, a section [0.04, 0.06) of the symbol “b” that appears second is selected, and this section [0.0
, 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” is selected.
Is obtained [0.05, 0.06).

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

【0010】また、上述のような出現頻度に応じた区間
の分割方法には、文字列の実際の出現頻度によらず、予
め設定した出現頻度に従って区間を分割する静的符号化
方式(static)、最初に全文字列を走査することにより得
られた出現頻度で区間を分割する準適応型符号化方式(s
emi-adaptive) 、又は文字が出現する毎に頻度を再計算
して1文字毎に区間を再設定する適応型符号化方式(ada
ptive)とがある。
In the method of dividing a section according to the appearance frequency as described above, a static coding method (static) that divides a section according to a preset appearance frequency without depending on the actual appearance frequency of a character string. , A semi-adaptive coding scheme (s) that divides a section with the appearance frequency obtained by scanning all character strings first.
emi-adaptive), or an adaptive coding method (ada) that recalculates the frequency each time a character appears and resets the section 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)のフローチャー
トに示すような処理が行なわれる。
A method of compressing data in units of bytes (characters) using the above-described multi-level 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.
Here, the document discloses a specific algorithm of multi-level arithmetic coding. Also, the multi-level arithmetic coding in this document is one of the methods called entropy coding, which encodes and compresses one character at a time. Is updated successively each time the character appears, and is dynamically adapted to various data for encoding. In addition, in this multi-level arithmetic coding, processing as shown in the flowchart of FIG. 71A is performed in detail.

【0012】一方、文献の方法は、注目文字を直前文
字を用いた条件付確率で表し、その条件付確率を多値算
術符号化することで高圧縮率を得る方法を与え、各条件
付確率を逐次更新し、種々のデータに動的に適応して符
号化を行なうものである。この多値算術符号化において
も、図71(b)のフローチャートに示すような処理が
行なわれる。
On the other hand, the method of the literature provides a method of obtaining a high compression rate by expressing a target character by a conditional probability using the immediately preceding character, and encoding the conditional probability by multi-value arithmetic coding. Are sequentially updated, and encoding is performed by dynamically adapting to various data. Also in this multi-level arithmetic coding, 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-level arithmetic coding, dynamic Huffman coding (“Variation a Theme by Huffman”, IEEE Trans. Info
rm.Theory, Vol.24, No.6 1978, or "Design and
Analysis of Dynamic Huffman Codes ", Journal of AC
M, Vol. 34, No. 4 1987) is also conceivable, but dynamic Huffman coding is inferior to multi-valued arithmetic coding in coding efficiency and takes more time to process. No dynamic Huffman coding of probabilities is 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 the algorithm of the multi-level arithmetic coding / decoding. In addition, there is a method called a splay (Splay-Tree) encoding method other than the arithmetic encoding (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 spray coding method, FIG.
A symbol is registered at the end of the code tree (generally called a leaf or leaf) using a tree-structured code table (hereinafter referred to as a code tree) as shown in FIG. The distance from a root or a root) to a leaf storing input data is output as a codeword.

【0016】具体的に述べると、符号語には、ルートか
らリーフへ下るとき、右へ分岐したときは“1”、左へ
分岐したときは“0”を割り当てるのである。つまり、
図73(a)の例では、シンボルAの符号は〔1011
0〕となり、シンボルBの符号は〔001〕となる。そ
して、符号長を変更する(符号更新する)場合は、符号
化したリーフと他のリーフ、あるいは符号木上の接点
(節、あるいはノードと呼ばれる)とを組み替えること
により行なう。
More specifically, a code word is assigned "1" when branching to the right when descending from the root to the leaf, and "0" when branching to the left. That is,
In the example of FIG. 73A, the symbol of the symbol A is [1011
0], and the code of the symbol B is [001]. When the code length is changed (the code is updated), it is performed by rearranging the coded leaf with another leaf or a contact point (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. 73 (b) shows an example of the above-mentioned code update. As shown in FIG. 73 (b), in the input data, the codes of the symbols A, B, C and D are initially stored in the leaves of the code tree. Then, first, the node of the symbol A and the symbol C are rearranged, and further, the node of the upper node D of the symbol A and the node of the symbol E are rearranged. As a result, as shown in FIG. ] To [110], and the code is updated.

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

【0019】そして、図75(a)に示すように、文脈
収集により入力データから文字列の前後関係の文脈を収
集し、図75(b)に示すような文脈の木構造を作成
し、条件付き確率を求めて動的可変長符号化する。ここ
で、上述の条件付き確率は、図75(b)に示すような
木構造の文脈木上において、各ノードの文字を通る文字
列が出現する毎に出現回数を計数しておくことによって
求められる。
Then, as shown in FIG. 75 (a), the context of the context of the character string is collected from the input data by context collection, and a tree structure of the context as shown in FIG. 75 (b) is created. Dynamic variable length coding is performed to find the attached probability. Here, the above-mentioned conditional probability is obtained by counting the number of appearances each time a character string passing through the character of each node appears on a context tree having a tree structure as shown in FIG. 75 (b). Can 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. Hereinafter, the number of characters of a condition (context) is referred to as an order (see "Data Compression Using Adaptive Coding and Part").
ial String Matching "JOHN G.CLEARY and others IEEE Vol.COM
-32, No. 4 APRIL 1984 P396-402). (1) Context collection method of fixed order This method is a method of setting the condition of the 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 a secondary context, the contexts of the characters connected to the two immediately preceding characters are collected, and the conditional probability p (y | x1,
x2) is encoded. Here, y is the coded character of interest, x
1 and x2 are the immediately preceding first and second characters, respectively. (2) Blending context collection method In the above-described fixed-order context collection method, when the immediately preceding conditional string is difficult to appear, the estimation of the conditional probability becomes inaccurate,
Conversely, when the immediately preceding conditional character string is likely to appear, the estimation of the conditional probability becomes accurate, leaving the possibility that the degree can be further increased.

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

【0023】[0023]

【発明が解決しようとする課題】しかしながら、算術符
号化を動的可変長符号に用いた確率統計型符号化方式に
は、データが入力されてくる度にそれまで入力された全
てのデータの累積頻度を再計算し、〔0,1)の数直線
を再分割するので、複雑で大量な演算処理を必要であ
り、処理の高速化が行なえないという課題がある。
However, the stochastic coding method using arithmetic coding as a dynamic variable length code has the problem that every time data is input, the accumulated data is accumulated. Since the frequency is recalculated and the number line of [0, 1) is re-divided, 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 has been made in view of the above problems, and applies spray coding instead of arithmetic code interval calculation, and registers new data in a code tree in this spray coding. High-speed code registration processing has been enabled to speed up data compression / decompression processing.
An object of the present invention is to provide a data compression method and a data decompression method, and a data compression device and a data decompression device.

【0025】[0025]

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

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

【0027】さらに、上述の符号木新規登録過程(4)
は、同じ文脈の下にあるリーフのうち、符号木の頂点と
して定義されるルートからの距離が最も長いリーフを分
岐し、得た2つの新規リーフに、分岐したリーフに格納
していたデータと、新規データとを登録するようにとっ
てもよく(請求項3)、同じ文脈の下にあるリーフのう
ち、最後に登録したリーフを分岐し、得た2つの新規リ
ーフに、分岐したリーフに格納していたデータと、新規
データとを登録するようにとってもよい(請求項4)。
Further, the above-described code tree new registration process (4)
Divides the leaf with the longest distance from the root defined as the vertex of the code tree among the leaves under the same context, and obtains two new leaves and the data stored in the diverged leaf. The new data may be registered (claim 3), and among the leaves under the same context, the last registered leaf is branched and stored in the obtained two new leaves in the branched leaf. The registered data and 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 in that the following steps are taken in a data restoration method for decoding a code obtained by encoding input data in accordance with the history of past input data ( Claim 5). (1) A context tree holding step of holding a context tree in which a combination of decrypted data and a context is registered. (2) A code tree holding process for holding independent code trees according to contexts. (3) A code tree determining step of determining a code tree of a code from data decoded immediately before. (4) A decoding process in which the code is decoded by scanning from the root meaning the vertex of the code tree to the leaf as the data storage point according to the code. (5) A context changing step of changing the context when the reached leaf 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 step 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 step, the same leaf as the branch selected 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 a data restoration method for decoding a code obtained by encoding input data according to the history of past input data ( Claim 6). (1) A code tree holding step of holding a code tree in which an escape code defined in advance as data indicating data not registered is stored. (2) A context tree holding step of holding a context tree in which a combination of the decrypted data and the context is registered. (3) A code tree determining step of determining a code tree of a code from data decoded immediately before. (4) A decoding process in which the code is decoded by scanning from the root meaning the vertex of the code tree to the leaf as the data storage point according to the code. (5) A context change process for changing the context when the reached leaf is an escape code. (6) A code length changing step of recombining the leaf of the decoded data and the escape code with another leaf or a node as a branch point. (7) A new registration step 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 step, the same leaf as the branch selected on the encoding side is branched and new data is registered.

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

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

【0032】さらに、符号登録手段304は、エスケー
プコードを符号化したのち符号木のエスケープコードの
データ格納点としてのリーフを分岐してデータを新規に
登録するものであり、文脈変更手段305は、入力デー
タと文脈との組み合わせが文脈木に保持されていないと
き、文脈を変更するものである。また、符号化手段30
6は、符号木の頂点からの入力データあるいはエスケー
プコードが登録してあるリーフまでの分岐に従って符号
を出力するものであり、符号更新手段307は、符号化
したデータ及びエスケープコードが登録してあるリーフ
と他のリーフあるいはノードとを取り替えるものである
(以上、請求項7)。
Further, the code registering means 304 encodes the escape code, branches the leaf as the data storage point of the escape code in the code tree, and newly registers the data. 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 denotes a code that outputs a code according to a branch from the top of the code tree to input data or a leaf in which an escape code is registered, and the code updating unit 307 registers the encoded data and the escape code. A leaf is replaced with another leaf or node (claim 7).

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

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

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

【0036】308は分岐位置保持手段であり、この分
岐位置保持手段308は、符号木に新規に登録されたデ
ータ格納点としてのリーフの位置を保持するものであ
る。さらに、309は符号登録手段であり、この符号登
録手段309は、エスケープコードを符号化したのち、
分岐位置保持手段308に保持されている位置にあるリ
ーフを分岐してデータを新規に登録するものである(以
上、請求項9)。
Reference numeral 308 denotes a branch position holding unit. The branch position holding unit 308 holds a leaf position as a data storage point newly registered in the code tree. Further, reference numeral 309 denotes a code registration unit. After the code registration unit 309 encodes the escape code,
The leaf at the position held by the branch position holding means 308 is branched and data is newly registered (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 implementing 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 decodes a code obtained by encoding input data according to the history of past input data. Here, 401 is a code tree holding unit, 402 is a context tree holding unit, 403 is a code tree determining unit, 404 is a decoding unit, 405 is a context changing unit,
Reference numeral 06 denotes a code updating unit, 407 denotes a code registration unit, and 408 denotes 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 in advance as data indicating that data has not been registered is registered.
2 stores a context tree in which a combination of the decoded data and the context is registered.
Determines the code tree of the code from the data decoded immediately before.

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

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

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

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

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

【0044】ここで、この図14に示すデータ復元装置
においても、前述の図12に示すものと同様の符号木保
持手段401,文脈木保持手段402,符号木決定手段
403,復号手段404,文脈変更手段405,符号更
新手段406をそなえており、これらの説明は省略す
る。また、409は分岐位置保持手段であり、この分岐
位置保持手段409は、符号木に新規に登録されたリー
フの位置を保持するものである。
Here, in the data restoration apparatus shown in FIG. 14, the same code tree holding means 401, context tree holding means 402, code tree determining means 403, decoding means 404, and context tree as those shown in FIG. A change unit 405 and a sign update unit 406 are provided, and a description thereof will be omitted. Reference numeral 409 denotes a branch position holding unit. The branch position holding unit 409 holds a position of a 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つの新規リーフに特定コー
ドと新規データとを登録することができる。
Reference numeral 410 denotes a code registration unit. The code registration unit 410 encodes an escape code, branches a leaf at a position held in the branch position holding unit 409, and newly stores data. It is to register. Reference numeral 414 denotes a context tree registration unit. The context tree registration unit 414 registers the data registered by the code registration unit 410 in the context tree of the context holding unit 402 (the claim 12). The data compression method of the present invention has the following operation (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 a code tree holding process, an independent code tree can be held 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, data can be newly registered in the context tree of the context tree holding process. (4) When a combination of input data and context is not held in the context tree holding process by the code tree new registration process, a new leaf obtained by branching a leaf as a code tree data storage point in the code tree holding process. Data can be stored on leaves. (5) By the context change process, the context can 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, a code can be output according to the input data from the vertex of the code tree or the branch to the leaf where the specific code in the code tree is registered. (7) By the code length changing process, the leaf in which the input data or the specific code in the code tree is registered can be replaced 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, a leaf in which a specific code is registered can be branched, and a specific code and new data can be registered in the obtained two new leaves.

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

【0047】また、上述の(4)の符号木新規登録過程
では、同じ文脈の下にあるリーフのうち、符号木の頂点
として定義されるルートからの距離が最も長いリーフを
分岐し、得た2つの新規リーフに、分岐したリーフに格
納していたデータと、新規データとを登録することもで
き(請求項3)、同じ文脈の下にあるリーフのうち、最
後に登録したリーフを分岐し、得た2つの新規リーフ
に、分岐したリーフに格納していたデータと、新規デー
タとを登録することもできる(請求項4)。
Also, in the above-described code tree new registration process of (4), 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. The data stored in the branched leaf and the new data can also 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 operation (claim 5). (1) The context tree in which the combination of the decrypted data and the context is registered can be held by the context tree holding process. (2) By the code tree holding process, each independent code tree can be held according to the context. (3) The code tree of the code can be determined from the data decoded immediately before by the code tree determination process. (4) Through the decoding process, the code can be decoded by scanning from the root meaning the vertex of the code tree to the leaf as the data storage point according to the code. (5) If the reached leaf is a specific code in the code tree by the context change process, the context can be changed. (6) Through the code length changing process, the leaf of the decoded data and the specific code can be combined with another leaf or a node as a branch point. (7) By the new registration process, when the specific code is decoded, the decoded data can be newly registered in the code tree. (8) By the context tree registration process, 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 branch selected on the encoding side can be branched to register new data.

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

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

【0051】そして、文脈登録手段303が、エスケー
プコードを符号化したのち、文脈木にデータを新規に登
録し、符号登録手段304が、エスケープコードを符号
化したのち符号木のエスケープコードのデータ格納点と
してのリーフを分岐してデータを新規に登録し、文脈変
更手段305が、入力データと文脈との組み合わせが文
脈木に保持されていないとき、文脈を変更する。
After the context registering means 303 encodes the escape code, the data is newly registered in the context tree, and the code registering means 304 encodes the escape code and stores the escape code data of the code tree. The leaf as a point is branched and data is newly registered, and the context change 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 encoding means 306 outputs a code according to a branch from the top of the code tree to the input data or the leaf where the escape code is registered, and the code updating means 307 outputs the encoded data and the escape code. Replaces a registered leaf with another leaf or node (claim 7). Further, in an apparatus for implementing the data compression method of the present invention having the configuration described with reference to FIG. 10, that is, a data compression apparatus that encodes input data according to a history that has appeared in the past,
The code tree holding unit 301 holds a code tree in which an escape code defined in advance as data indicating that data is not registered is registered, and the context tree holding unit 302 holds a context tree in which a combination of input data and a context is registered. I do.

【0053】そして、文脈登録手段303が、エスケー
プコードを符号化したのち、文脈木にデータを新規に登
録し、分岐位置検索手段310が、符号木上の最長の符
号長を持つリーフを検索し、符号登録手段311が、エ
スケープコードを符号化したのち、分岐位置検索手段3
10に検索されたデータ格納点としてのリーフを分岐し
てデータを新規に登録する。
Then, after the context registration means 303 encodes the escape code, newly registers data in the context tree, and the branch position search means 310 searches for a leaf having the longest code length on the code tree. , The code registration means 311 encodes the escape code, and then the branch position search means 3
Then, a leaf as a data storage point searched at 10 is branched and data is newly 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 coding means 306 registers the input data or the escape code from the top of the code tree. The code is output in accordance with the branch to the leaf that has been set, and the code updating unit 307 replaces the leaf in which the encoded data and the escape code are registered with another leaf or node (the above-described claim 8).

【0055】また、図11を用いて説明した構成をも
つ、本発明のデータ圧縮方法を実施するための装置、す
なわち入力データを過去に出現した履歴に応じて符号化
するデータ圧縮装置においては、符号木保持手段301
が予めデータ未登録を示すデータとして定義されるエス
ケープコードを登録した符号木を保持し、文脈木保持手
段302が入力データと文脈との組み合わせを登録した
文脈木を保持する。
An apparatus having the configuration described with reference to FIG. 11 for implementing the data compression method of the present invention, that is, a data compression apparatus that encodes input data in accordance with the history of past occurrences, Code tree holding means 301
Holds a code tree in which an escape code defined in advance as data indicating unregistered data is registered, and a 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に保持されている位置にあるリー
フを分岐してデータを新規に登録する。
After the context registering means 303 encodes the escape code, the data is newly registered in the context tree, and the branch position holding means 308 stores the position of the leaf as the data storage point newly registered in the code tree. After the code registration unit 309 encodes the escape code, the leaf at the position held by the branch position holding unit 308 is branched and data is newly registered.

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

【0058】一方、図12を用いて説明した構成をも
つ、本発明のデータ復元方法を実施するための装置、す
なわち入力データを過去の入力データの履歴に応じて符
号化した符号を復号するデータ復元装置においては、符
号木保持手段401が予めデータ未登録を示すデータと
して定義されるエスケープコードを登録した符号木を保
持し、文脈保持手段402が復号したデータと文脈との
組み合わせを登録した文脈木を保持し、符号木決定手段
403が直前までに復号したデータから符号の符号木を
決定する。
On the other hand, an apparatus for implementing the data restoration method of the present invention having the configuration described with reference to FIG. 12, that is, data for decoding a code obtained by encoding input data according to the history of past input data. In the restoration apparatus, the code tree holding unit 401 holds a code tree in which an escape code defined in advance as data indicating data not registered is registered, 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 unit 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 vertex of the code tree to the leaf as the data storage point in accordance with the code, and decodes the code.
If the leaf reached is an escape code, change the context. Further, the code updating unit 406 recombines the decoded data and the escape code leaf with another leaf or a node as a branch point. When the code registration unit 407 decodes the escape code, the escape code leaf is branched and decoded. The 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, an apparatus for implementing the described data restoration method of the present invention having the configuration described with reference to FIG. 13, that is, decoding a code obtained by encoding input data in accordance with the history of past input data. In the data restoration apparatus, the code tree holding unit 401 holds a code tree in which an escape code defined in advance as data indicating that data is not registered is registered, and the context holding unit 402 registers a combination of the decoded data and the context. 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)。
The decoding means 404 decodes the code by scanning from the root meaning the vertex of the code tree to the leaf as the data storage point in accordance with the code, and decodes the code.
But if the leaf reached is an escape code,
Change context. Further, the leaf of the data and the escape code decoded by the code updating unit 406 are recombined with another leaf or a node as a branch point, and the branch position searching unit 411 searches for the position of the leaf having the longest code length in the code tree, The code registration unit 412 encodes the escape code, branches the leaf searched by the branch position search unit 411, and newly registers data. The context tree registration unit 408 stores the data registered by the code registration unit 412 in the context. Register in the context tree of the holding means 402
1).

【0062】また、図14を用いて説明した構成をも
つ、本発明のデータ復元方法を実施するための装置、す
なわち入力データを過去の入力データの履歴に応じて符
号化した符号を復号するデータ復元装置においては、符
号木保持手段401が予めデータ未登録を示すデータと
して定義されるエスケープコードを登録した符号木を保
持し、文脈保持手段402が、復号したデータと文脈と
の組み合わせを登録した文脈木を保持し、符号木決定手
段403が直前までに復号したデータから符号の符号木
を決定する。
An apparatus for implementing the data restoration method of the present invention having the configuration described with reference to FIG. 14, that is, data for decoding a code obtained by encoding input data in accordance with 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 in advance as data indicating data not registered is registered, and the context holding unit 402 registers a combination of the decoded data and the context. The context tree is retained, 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 decodes the code by scanning from the root meaning the vertex of the code tree to the leaf as the data storage point according to the code, and decodes the code.
5, when the reached leaf is an escape code, the context is changed, the data decoded by the code updating means 406 and the leaf of the escape code are rearranged with another leaf or a node as a branch point, and the branch position holding means 4 is changed.
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 unit 410 encodes the escape code, the leaf at the position held in the branch position holding unit 409 is branched to newly register data, and the context tree registration unit 408 codes the escape code. Registration means 410
Is registered in the context tree of the context holding means 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 device and a data decompression device as technology 1 related to the present invention.
In FIG. 15, reference numeral 1 denotes a data compression device that encodes and compresses input characters according to a history of past appearances, and 2 denotes a data restoration device that restores characters encoded by the data compression device 1. is there.

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

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

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

【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 characters are matched while matching the stored characters in a list format during search. When the context tree is initialized, up to the address 100 is set. At this time, an End Of File (EOF) code is registered in the address 100 of the first hierarchy, and the memory after the address 101 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-described splay encoding step 12. The code tree is basically set as shown in FIG. 17 at the time of initialization, similarly to the conventional Splay-Tree coding. Then, corresponding to FIG. 16B, the maximum size is 4K nodes (4K nodes).
In the case up to W), the tree nodes of the code are classified into two nodes: an internal node (with a child node) and an external node (the end of each code without a leaf or child node).

【0071】また、スプレイ符号化では、符号の木をア
クセスするために、図18に示すようなUp,Lef
t,Rightという3つの配列を用いる。ここで、U
p配列は、各ノードから親ノードへのアドレスを格納
し、Left配列は、各ノードから左の子ノードへのア
ドレスを格納し、Right配列は、各ノードから右の
子ノードへのアドレスを格納するものである。
In the splay coding, the Up, Lef as shown in FIG.
Three sequences, 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. Is what you do.

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

【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 the Up array.
3 bits, Left and Right arrays are 12 bits. Next, a basic operation of updating the tree of the code tree having the above-described configuration will be described with reference to FIGS. FIG. 19A is a diagram showing a basic operation of updating the spray code. As shown in FIG.
Is accessed, the node A and the branch with the node A two stages above and the branch C in the opposite direction are exchanged.

【0074】そして、文字A〜Eまでの符号に対して、
文字Cがアクセスされた場合には、例えば図19(b)
に示すように、符号の木を組み換えるようになってい
る。すなわち、上述した基本操作を2回繰り返すことに
よって符号木の木の更新を行なう。この場合、2回目の
基本操作は1回目に更新したノードの親ノードの長さを
更新する。
Then, for the characters A to E,
When the character C is accessed, for example, as shown in FIG.
As shown in (1), the code tree is rearranged. In other words, the tree of 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 first updated node.

【0075】これにより、符号の木の深さが深くなって
も、この基本操作を繰り返すことによって、ルートから
アクセスされたノードC(符号0110)までの長さを
1/2(符号10)にすることができるので、ルートか
らアクセスされたノードまでの符号木を動的に組み換え
て、符号表を入力データに適応させることができる。す
なわち、スプレイ符号の符号更新は線型リストの Move-
To-Front操作を Binary-Treeで行なったようなものであ
る。
As a result, even if the depth of the code tree is increased, the basic operation is repeated to reduce the length from the root to the accessed node C (reference numeral 0110) to ((reference numeral 10). Therefore, the code table from the root to the accessed node can be dynamically rearranged to adapt the code table to the input data. That is, the sign update of the spray code is performed by Move-
It is like performing 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 collection process 11 and the process of updating and creating the code tree in the spray encoding process 12 will be described in detail with reference to the processing steps E1 to E31 in the flowchart of FIG. Will be described. 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 or not all the characters already input have been input-encoded (step E2). If any input characters remain, 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 there is a child node under the character P immediately before the context tree (step E5). If there is no child node under the character P immediately before, the 0th order code of the input character K is output (step E6). Then, 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 below the immediately preceding character P, and the character K is registered (step E8). 30A and 30B show an example of this node creation algorithm.
Shown in Further, the immediately preceding character is changed to the input character K (step E16), and the length L 'of the immediately preceding character string is changed to 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ルート)。
If the preceding character string length L 'is not equal to the maximum character string length Lmax, it is checked whether the preceding character string is encoded and output by the primary code (step E).
25). Here, if the preceding character string is not encoded by the primary code, the target character string length L is shifted to the preceding character string length L '(step E28), and it is checked whether the character K has been encoded (step E9). If the encoding has been completed, the processing from step E2 is repeated (YES route of step E9), and if the encoding has not been completed, the processing from step E3 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), the character string length L is the maximum code length Lm set in advance.
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). If there is any 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), and the process returns to the above-described step E10, where 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 the length L of the character string is 0 (step E11).
That is, if there is a child node below the preceding character P, but the corresponding character K has not yet been attached, the escape code under the preceding character P is output, and then the zero-order code of the character K is output (step E12). ). Further, the character K is registered as a sibling node of a 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 an escape code and a 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 zero-order code K are updated as the spray code (step E15).

【0082】以上のようにして、所定の最大文字列長に
達するまで符号化文字列の伸長文字列を登録することが
できるようになっている。その後、上述したステップE
16,ステップE24を経て、再び直前文字列を1次符
号で出力したかをチェックする(ステップE25)。即
ち、直前文字列が1次符号で符号化され、出力されてい
れば、文脈木に直前文字列に符号化文字(列)の先頭文
字を付加した延長文字列を登録し(ステップE26)、
符号木に、符号化した延長文字列の符号を登録し(ステ
ップE27)、上述のステップE28からの処理を繰り
返す。
As described above, it is possible to register the decompressed character string of the encoded character string until a predetermined maximum character string length is reached. Then, step E described above
16. After step E24, it is checked again whether the immediately preceding character string has been output with the primary code (step E25). That is, if the immediately preceding character string is encoded by the primary code and output, the extended character string obtained by adding the leading character of the encoded character (string) to the immediately 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を付加した文字列の符号とを作る。このようにして、
辞書登録文字列として、符号化済の直前文字から登録
し、この直前文字から続く文字列を符号化している。
This registration is performed such that the code of the immediately preceding character is branched and the primary code of the character string to which the character K is added is added. The branching of the character string is performed by considering the escape code as the code of the character string obtained by encoding the character string and forming the original character string and the code of the character string to which the character K is added. In this way,
As a dictionary registration character string, the character string is registered from the encoded immediately preceding character, and the character string following the immediately preceding character is encoded.

【0084】さらに、上述のステップE18において、
文字列長Lが、予め設定した最大符号長Lmaxと等し
い場合、または、ステップE11において、文字列長L
が0に等しくない場合は、文脈木の文字(列)の参照番
号に対応する1次符号を出力し(ステップE22)、符
号木が出力した1次符号の符号長をスプレイ符号として
更新(ステップE23)した後、上述のステップE24
からの処理を行なう。
Further, in the above-mentioned 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
The processing from is performed.

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

【0086】子ノードがなければ、そのままEOFの0
次符号を出力して処理を終了する。以上のような処理を
行なうことで、入力データとしての文字列を過去に出現
した履歴に応じて符号化して圧縮するデータ圧縮方法に
おいて、辞書に入力データの文字列を収集し番号を付け
て登録するとともに、各文字列に対応してスプレイ符号
の符号化及び更新を施している。
If there is no child node, EOF 0
The next code is output, and the process ends. In the data compression method that encodes and compresses a character string as input data according to the history that appeared in the past by performing the above processing, the character string of the input data is collected in a dictionary, registered with a number At the same time, 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, the above-mentioned input character K is limited to any one of the alphabets a, b and c, and the characters "abc abc
Taking the case where "ab b" is input as an example, the update and creation of the context tree and the code tree will be described in further detail with reference to FIGS. First, as shown in FIGS. 21 (a) and 21 (b), characters a, b, and c and a terminal code EOF that is output after encoding all input data are previously written in a context tree and a code tree.
Are registered as a 1, b 2, c 3 , EOF 4 by referring to 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 characters a, b, and c registered first becomes the immediately preceding character, and when there is no context following the immediately preceding character, an independent single reference number is also used. Will also serve. In the following description, the character c
Is assumed to be the first preceding character. On the other hand, FIG.
As shown in the figure, when the node descends from the root to the lower left, the code “0” is added to the registered character.
Is a binary tree that assigns the code “1” to the registered character when the node goes down to the lower right, so that at the time of encoding, the path from the node of the reference number of the corresponding character to the root is stacked. Then, by reversing the path and allocating the codes “0” and “1” according to whether it is the lower left or the 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 zero-order code of the three characters “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 below the context tree “c” (c 3 ), and the first character “a 5 ” of the character string “abc” is unregistered. And an escape code (ESC 6 ) representing the same.

【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. 22B, since "a" has already been registered, the node in which "a" is registered and the upper-order character of "c" which is the immediately preceding character The node is rearranged, this “c” is newly set as a root (primary encoding), and “a” and an escape code (ESC)
Register Further, in the character string "abc", the next b,
By performing the above-described processing for c, the context tree and the code tree when b is input are respectively shown in FIG.
(A) and (b), and the context tree and code tree when c is input are as shown in FIGS. 24 (a) and (b).

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

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

【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 Although only one character “a” in the column “abc” is to be registered, “a 5 ” is already registered under “c 3 ” in the context tree, as shown in FIG. FIG. 25
As shown in (a), the character to be registered is expanded by one character from one character “a” to two characters “ab”, and “b” is added below “a 5 ”.
11 Register.

【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. 25 (b), a node of an escape code (ESC) registered together with "a" below "c" is branched and a new node is created. Then, "a" registered by expanding one character in the context tree
b ”is registered. Then, in the character string "abc",
When “b” is to be registered in the context tree, FIG.
As shown in FIG. 26A, since “b 7 ” is already registered below “a 1 ”, as shown in FIG. 26A, the character to be registered is changed from one character “b” to two characters “b 1”. One character is expanded to “bc” and “c 12 ” is registered below “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. 26 (b), the node of the escape code (ESC) registered with "b" below "a" is branched and a new node is created. Then, "b" registered by extending one character in the context tree
c "is registered. Also, when the last "c" of the next character string "abc" is registered, the above processing is performed to obtain the context tree and the code tree as shown in FIG.
The state shown in (b) is reached (the “abc ab
c "is already input).

【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 “a 5 ” is already registered under “ 3 ”, the number of registered characters is extended by one character to “ab”, and “b” is registered under “a 5 ”. However, as shown in FIG. 27A, since “b 11 ” is already registered below “a 5 ”, the number of registered characters is further extended by one character as shown in FIG. 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 and “abb” is registered. This processing corresponds to the closed loop processing via the YES route of step E5, the YES route of step E10, and the YES route of step E25 of the processing 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 be registered is set to 1
Register only one unregistered character by expanding the character. 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 characters are as shown in FIG. As shown in FIG. 29, the first input character "abc" is coded by one character alone, and the corresponding codes are 00,
It becomes 2 bits of 01 and 10.

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

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

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

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

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

【0105】なお、このデータを復元する処理は、基本
的に符号化側の説明にて上述した符号化の処理と逆の処
理を行なうようにすればよい。すなわち、まず、文脈木
と符号木とを初期化し、直前文字Pを0に初期化する
(ステップD1)。列長Lを0とし(ステップD2)、
文脈木の直前文字の下位に子ノードがあるかをチェック
する(ステップD3)。
The process of restoring this data may basically be the reverse of the above-described coding process in the description of the coding side. That is, first, the context tree and the code tree are initialized, and the immediately preceding character P is initialized to 0 (step D1). The column length L is set to 0 (step D2),
It is checked whether there is a child node below the character immediately 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 0-order code (step D).
From the NO route of No. 3 to step D4), it is checked whether or not the decoded character K is an EOF code (step D).
5). If the decoded character K is not an EOF code, a 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 in the encoding processing step E7 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 a character K and an escape code is created below the character P immediately before the code tree (step D8), and the character P is set as the character K (step D17). ). Then, the subsequent processing steps D20 to D23 are the processing step E2 at the time of encoding.
The same processing steps as in steps 0 to E23 are performed, and the immediately preceding character string length L ′ is replaced with the noticed character string length L (step D2).
4), and return to the processing step D2 described above.

【0108】ところで、上述の処理ステップD3におい
て、文脈木の直前文字Pの下位に子ノードが存在する場
合は、入力された符号を符号木より1次符号とみなして
復号して、文脈木の文字(列)の参照番号を得る(ステ
ップD3のYESルートからステップD9)。さらに、
復号した参照番号がエスケープコードであるかをチェッ
クし(ステップD10)、エスケープコードであれば、
YESルートをとり、入力文字を0次符号として次の符
号を復号して、文字Kを得る(ステップD11)。
In the above-mentioned processing step D3, if a child node exists below the character P immediately before the context tree, the input code is decoded as a primary code from the code tree, and is decoded. The reference number of the character (string) is obtained (step D9 from the YES route of step D3). further,
It is checked whether the decrypted reference number is an escape code (step D10).
A YES route is taken, and the next code is decoded using the input character as the 0th order code to obtain a character K (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, similarly to the above-mentioned step D5, it is checked whether or not the decoded character K is an EOF code (step D12). Output (Step D
13). Furthermore, processing steps E13 to E15 at the time of encoding
In the same manner as described above, the character K is registered in the context tree (step D1).
4) Add a character K below the previous character P (step D1)
5) Update the escape code of the code tree and the code length of the zero-order code K as a spray code (step D16).

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

【0111】また、上述の処理ステップD10におい
て、復号した参照番号がエスケープコードでなければ、
NOルートをとり、文脈木の参照番号に対応する文字列
を復元して出力し(ステップD18)、文字(列)の最
終文字を直前文字Pに置き換える(ステップD19)。
そして、以降は、上述のステップD20からの処理を行
なう。
In the processing step D10, if the decoded reference number is not an escape code,
By 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).
Thereafter, the processing from step D20 described above is performed.

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

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

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

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

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

【0117】また、上述した例では、圧縮するデータを
文字あるいは文字列として説明したが、関連技術1のデ
ータ圧縮方法及びデータ復元方法は、他の画像データや
音声データなどあらゆるデータに対して適用できる。 (b)本発明に関連する技術2の説明 次に、本発明に関連する技術2(以下、関連技術2とい
う)について説明するが、まず、その原理について説明
する。
In the above-described example, the data to be compressed is described as a character or a character string. However, the data compression method and the data decompression method of Related Art 1 can be applied to any 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, the principle will be described.

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

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

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

【0121】ここで、100は前置データ保持手段、1
01は履歴保持手段、103は符号木決定手段、107
は符号木決定手段である。さらに、108は文脈判別手
段、109はエスケープコード出力手段、110は文脈
変更手段、111は符号出力手段、116は制御手段で
ある。前置データ保持手段100は、入力データの直前
までに入力されたn個の入力データからなる文脈を保持
するものであり、履歴保持手段101は、入力データと
文脈との組み合わせを保持するものであり、符号木保持
手段107は、データ未登録を示すデータとして定義さ
れるエスケープコードをあらかじめ登録した文脈毎に独
立した符号木を保持するものである。
Here, 100 is a prefix data holding means, 1
01 is a history holding unit, 103 is a code tree determining unit, 107
Is a code tree determining means. Further, reference numeral 108 denotes a context determination unit, 109 denotes an escape code output unit, 110 denotes a context change unit, 111 denotes a code output unit, and 116 denotes a control unit. The prefix data holding means 100 holds a context consisting of n pieces of input data input immediately before the input data, and the history holding means 101 holds a combination of the input data and the context. In addition, 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 the code tree of the data from the context and the input data. The context determining means 108 stores the data in the code tree determined by the code tree determining means 103. When no data is registered in the code tree, the escape code output means 109 determines whether or not the data is registered in the code tree from the root meaning the vertex 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 as the branch point located.

【0123】さらに、文脈変更手段110は、符号木に
データが登録されていないときは文脈の長さnを短くす
るものであり、符号出力手段111は、符号木にデータ
が登録されているときは符号木のルートからデータのリ
ーフまでの途中に位置するノードからの分岐に従ってデ
ータの符号を出力するものである。また、符号長変更手
段105は、符号化したリーフと他のリーフあるいはノ
ードとを組み換えるものであり、前置データ更新手段1
06は、データを前置データ保持手段100に登録する
ものであり、制御手段116は、エスケープコードを符
号化したときはデータの符号化を行なうまで処理を繰り
返すものである。
Further, the context changing means 110 shortens the length n of the context when data is not registered in the code tree, and the code output means 111 outputs the data when the data is registered in the code tree. Outputs a code of data according to a branch from a node located halfway from the root of the code tree to the leaf of the data. The code length changing means 105 is for changing the coded leaf and another leaf or node.
Reference numeral 06 is for registering data in the prefix data holding means 100. When the escape code is encoded, the control means 116 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 another data compression method according to Related Art 2.
The data compression apparatus shown in FIG. 3 also encodes and compresses input data according to a history that has appeared in the past.
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 a context determination. Means, 109 is an escape code output means, 110 is a context change 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 a context consisting of n pieces of input data input 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 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は、
符号木にデータが登録されていないときは符号木の頂点
を意味するルートからエスケープコードのデータ格納点
としてのリーフまでの中に位置する分岐点としてのノー
ドからの分岐に従ってエスケープコードを出力するもの
である。
The code tree determining means 103 determines the code tree of the 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. Furthermore, the escape code output means 109
When the data is not registered in the code tree, the escape code is output according to the branch from the node as a branch point located from the root meaning the top of the code tree to the leaf as the data storage point of the escape code. It is.

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

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

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

【0131】また、符号木決定手段103は、文脈と入
力データからデータの符号木を決定するものであり、文
脈判別手段108は、符号木決定手段103で決定した
符号木にデータが登録されているか否かを判別するもの
である。さらに、エスケープコード出力手段109は、
符号木にデータが登録されていないときは符号木の頂点
を意味するルートからエスケープコードのデータ格納点
としてのリーフまでの途中に位置する分岐点としてのノ
ードからの分岐に従ってエスケープコードを出力するも
のである。
The code tree determining means 103 determines the code tree of the 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. Furthermore, the escape code output means 109
When the data is not registered in the code tree, the escape code is output according to the branch from the node as a branch point located halfway from the root meaning the top of the code tree to the leaf as the data storage point of the escape code. It is.

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

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

【0134】一方、関連技術2に係るデータ復元方法を
実施するための装置の構成を、図5に示す。この図5に
示すデータ復元装置は、過去に出現した履歴に応じて符
号化した符号を復号するものである。ここで、200は
前置データ保持手段、201は履歴保持手段、202は
符号木保持手段、203は符号木決定手段、204は復
号手段、205は符号長変更手段、206は前置データ
更新手段である。
On the other hand, FIG. 5 shows the configuration of an apparatus for implementing the data restoration method according to Related Art 2. The data restoration apparatus shown in FIG. 5 decodes a code coded according to a history that has appeared in the past. Here, 200 is a prefix data holding unit, 201 is a history holding unit, 202 is a code tree holding unit, 203 is a code tree determining unit, 204 is a decoding unit, 205 is a code length changing unit, and 206 is a prefix data updating unit. It 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. The means 202 holds an independent code tree for each context. 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 determines the code tree according to the code. It scans a node as a branch point from the root meaning the selected code tree vertex and outputs data stored in a leaf as a data storage point reached.

【0136】さらに、符号長変更手段205は、復号し
たリーフと他のリーフあるいはノードとを組み替えるも
のであり、前置データ更新手段206は、復号したデー
タを前置データ保持手段200に登録するものである。
また、関連技術2に係る他のデータ復元方法を実施する
ための装置の構成を、図6に示す。この図6に示すデー
タ復元装置も、過去に出現した履歴に応じて符号化した
符号を復号するものである。
Further, the code length changing means 205 is for rearranging the decoded leaf with another leaf or node, and the prefix data updating means 206 is for registering the decoded data in the prefix data holding means 200. It is.
FIG. 6 shows a configuration of an apparatus for performing another data restoration method according to Related Art 2. The data restoration apparatus shown in FIG. 6 also decodes a code coded 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 a prefix data holding means, 2
01 is a history holding unit, 203 is a code tree determining unit, 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 means 200 holds n data decoded in the past, the history holding means 201 holds a combination of decoded data and context, and the code tree holding means 207 , Which holds a code tree in which an escape code defined as data indicating data not registered is 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.
Reference numeral 04 denotes a node which scans a node as a branch point from a root meaning a vertex of the code tree selected by the code tree determining means 203 according to a code and outputs data stored in a leaf as a data storage point reached. 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. When the output data is an escape code, the data is rejected and the context is changed. The prefix data updating means 206 registers the decrypted data in the prefix data holding means 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 processing until a code other than the escape code is decoded. FIG. 7 shows a configuration of an apparatus for performing still another data restoration method according to Related Art 2. The data restoration device shown in FIG. 7 also decodes a code coded 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 a prefix data holding means, 2
01 is a history holding unit, 203 is a code tree determining unit, 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, 209 is a history registering unit, 210 is a code registering unit, and 213 is a control unit. . Prefix data holding means 20
0 holds n pieces of data decoded in the past, the history holding means 201 holds a combination of the decoded data and the context, and the code tree holding means 20
Reference numeral 7 stores a code tree in which escape codes are registered in advance.

【0142】また、符号木決定手段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.
Reference numeral 04 denotes a node which scans a node as a branch point from a root meaning a vertex of the code tree selected by the code tree determining means 203 according to a code and outputs data stored in a leaf as a data storage point reached. is there.

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

【0144】また、符号登録手段210は、データの復
号処理でエスケープコードを復号した時の文脈に対応し
た全ての符号木にデータの符号を登録するものであり、
制御手段213は、エスケープコードを復号した時は文
脈変更手段208で文脈を再設定し、エスケープコード
以外が復号されるまで処理を繰り返すものである。
The code registering means 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.
When the escape code is decoded, the control means 213 resets the context by the context change means 208, and repeats the processing 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 implementing another data restoration method according to Related Art 2.
The data restoration device shown in FIG. 8 also decodes a code encoded according to a history that has appeared in the past. Here, 200 is a prefix data holding unit, 201 is a history holding unit, 203 is a code tree determining unit, 204 is a decoding unit, 20
5 is code length changing means, 206 is prefix data updating means, 2
07 is a code tree holding unit, 208 is a context change unit, 212
Denotes a code registration unit, and 213 denotes a control unit.

【0146】前置データ保持手段200は、過去に復号
したn個のデータを保持するものであり、履歴保持手段
201は、復号したデータと文脈との組み合わせを保持
するものであり、符号木保持手段207は、データ未登
録を示すデータとして定義されるエスケープコードをあ
らかじめ登録した符号木を保持するものである。また、
符号木決定手段203は、前置データ保持手段200に
保持されている文脈からデータを復号するための符号木
を決定するものであり、復号手段204は、符号に従っ
て符号木決定手段203で選択した符号木の頂点を意味
するルートから分岐点としてのノードを走査して到達し
たデータ格納点としてのリーフに格納されているデータ
を出力するものである。
The prefix data holding means 200 holds n data decoded in the past, and the history holding means 201 holds a combination of the decoded data and the context. The means 207 holds a code tree in which an escape code defined as data indicating data not registered 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 selects the code tree in accordance with the code. It scans a node as a branch point from a root meaning a vertex of a code tree and outputs data stored in a leaf as a data storage point reached.

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

【0148】また、履歴登録手段211は、データの復
号処理でエスケープコードを最後に復号した時の文脈と
復号したデータとを履歴保持手段201に登録するもの
であり、符号登録手段212は、データの復号処理で最
後にエスケープコードを復号した時の文脈に対応した符
号木にデータの符号を登録するものであり、制御手段2
13は、エスケープコードを復号した時は文脈変更手段
208で文脈を再設定し、エスケープコード以外が復号
されるまで処理を繰り返すものである。
The history registering 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. Registering the code of the data in the code tree corresponding to the context when the escape code was decoded last in the decoding process of
Reference numeral 13 indicates that when the escape code is decoded, the context is reset by the context changing means 208, and the process is repeated until a code other than the escape code is decoded.

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

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

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

【0153】さらに、文脈変更手段110が、符号木に
データが登録されていないときは文脈の長さnを短く
し、符号出力手段111が、符号木にデータが登録され
ているときは符号木のルートからデータのリーフまでの
途中に位置するノードからの分岐に従ってデータの符号
を出力し、符号長変更手段105が、符号化したリーフ
と他のリーフあるいはノードとを組み換える。
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 sets the code tree when data is registered in the code tree. A code of data is output in accordance with a branch from a node located halfway from the root of the data to a leaf of the data, and the code length changing means 105 rearranges the encoded 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
16 encodes the escape code, and repeats the process until the data is encoded. Next, in an apparatus having the configuration described with reference to FIG. 3, that is, in a data compression apparatus that encodes and compresses input data according to a history that has appeared in the past, the pre-data holding unit 100 is configured The history holding unit 101 holds a combination of the input data and the context, and the code tree holding unit 107
An independent code tree is stored for each context in which an escape code defined as data indicating data not registered 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 determines whether the node as a branch point located from the root indicating the vertex of the code tree to the leaf as the data storage point of the escape code. Output escape code according to branch from. Further, when data is not registered in the code tree, the history registration unit 112 registers a combination of data and context in the history holding unit 101, and the code registration unit 11
3 newly registers data in the code tree when no data is registered in the code tree, and the context changing means 110 shortens the length n of the context when no data is registered in the code tree; When data is registered in the code tree, the code output unit 111 outputs the code of the data according to a branch from a node located halfway 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 rearranges 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 encodes the escape code, the process is repeated until the data is encoded. Next, in a device having the configuration described with reference to FIG. 4, that is, in a data compression device that encodes and compresses input data according to a history that has appeared in the past, the pre-data holding unit 100 determines whether the input data The history holding means 101 holds a combination of the input data and the context, and the code tree holding means 107 is defined as data indicating that data has not been registered. An independent code tree is stored 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. If no data is registered in the escape code output means 109 and the code tree, a node as a branch point located halfway from the root meaning the vertex of the code tree to a leaf as a data storage point of the escape code Output escape code according to 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 data is not registered in the code tree, and the escape code output means 111 sets the code length when data is registered in the code tree. The code of the data is output according to a branch from a node located halfway from the root of the tree to the leaf of the data. And the history registration means 11
4 registers the combination of the data and the 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 stores the coded 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 at the time of encoding the data,
The combination of the context and the data immediately before the encoding of the data is registered in the history holding unit 101 by the history registering unit 114, and the data is stored in the code tree having the escape code encoded immediately before the encoding of the data by the code registering unit 115. Is newly registered.

【0160】一方、図5を用いて説明した構成をもつ装
置、すなわち過去に出現した履歴に応じて符号化した符
号を復号するデータ復元装置においては、前置データ保
持手段200が、過去に復号したn個のデータを保持
し、履歴保持手段201が、復号したデータと文脈との
組み合わせを保持し、符号木保持手段202が、文脈毎
に独立した符号木を保持する。
On the other hand, in an apparatus having the configuration described with reference to FIG. 5, that is, in a data restoration apparatus that decodes a code coded according to a history that has appeared in the past, the pre-data holding unit 200 uses the previously decoded data. The history holding unit 201 holds the 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 a code tree for decoding 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. A node serving as a branch point is scanned from a root meaning a vertex of the selected code tree, and data stored in a leaf serving as a data storage point reached is output.

【0162】さらに、符号長変更手段205が、復号し
たリーフと他のリーフあるいはノードとを組み替え、前
置データ更新手段206が、復号したデータを前置デー
タ保持手段200に登録する。次に、図6を用いて説明
した構成をもつ装置、すなわち過去に出現した履歴に応
じて符号化した符号を復号するデータ復元装置において
は、前置データ保持手段200が、過去に復号したn個
のデータを保持し、履歴保持手段201が、復号したデ
ータと文脈との組み合わせを保持し、符号木保持手段2
07が、データ未登録を示すデータとして定義されるエ
スケープコードをあらかじめ登録した符号木を保持す
る。
Further, code length changing means 205 rearranges the decoded leaf with another leaf or node, and prefix data updating means 206 registers the decoded data in prefix data holding means 200. Next, in an apparatus having the configuration described with reference to FIG. 6, that is, in a data restoration apparatus that decodes a code coded according to a history that has appeared in the past, the pre-data holding unit 200 uses the previously decoded n And the history holding means 201 holds the combination of the decoded data and the context, and the code tree holding means 2
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 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. A node serving as a branch point is scanned from a root meaning a vertex of the selected code tree, and data stored in a leaf serving as a data storage point reached is output.

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

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

【0166】そして、符号木決定手段203が、前置デ
ータ保持手段200に保持されている文脈からデータを
復号するための符号木を決定し、復号手段204が、符
号に従って符号木決定手段203で選択した符号木の頂
点を意味するルートから分岐点としてのノードを走査し
て到達したデータ格納点としてのリーフに格納されてい
るデータを出力する。
Then, 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 determines the code tree in accordance with the code. A node serving as a branch point is scanned from a root meaning a vertex of the selected code tree, and data stored in a leaf serving as a data storage point reached is output.

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

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

【0169】そして、符号木決定手段203が、前置デ
ータ保持手段200に保持されている文脈からデータを
復号するための符号木を決定し、復号手段204が、符
号に従って符号木決定手段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 204 determines the code tree according to the code. A node serving as a branch point is scanned from a root meaning a vertex of the selected code tree, and data stored in a leaf serving as a data storage point reached is output.

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

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

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

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

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

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

【0176】一方、上述した関連技術2に係るデータ復
元方法によれば、入力データの出現頻度を求めて確率モ
デルを構築して各入力データに符号を割り当て符号表を
作成し、この符号表から復号する文字を出力するという
2段階の処理を同時に行なうことができ、これによりデ
ータの復元処理の速度が大幅に向上するという効果があ
る。また、データが入力されるごとに既に構築されてい
る確率モデルを再構築するという膨大な演算処理を省く
ことができ、これにより復元処理の速度がさらに向上す
る効果もある。さらに、過去に出現した入力データの符
号と同じデータの符号が繰り返し出現するほど、そのデ
ータの符号を少ないビット数で表すことができ、これに
よりデータ復元における復元効果が大幅に向上する効果
もある。
On the other hand, according to the data restoration method according to Related Art 2 described above, a probability model is constructed by determining the appearance frequency of input data, a code is assigned to each input data, and a code table is created. The two-stage process of outputting the character to be decoded can be performed simultaneously, which has the effect of greatly improving the speed of the data restoration process. Further, it is possible to omit an enormous amount of arithmetic processing of reconstructing a probability model that has already been constructed each time data is input, thereby further improving 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 greatly improving the restoration effect in data restoration. .

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

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

【0179】さらに、データ未登録を示すデータとして
定義されるエスケープコード以外が復号されるまでの処
理において、エスケープコードを一つでも復号した時、
エスケープコード以外を復号した直前の文脈においての
み、文脈新規登録過程および符号木新規登録過程での各
新規登録処理を行なうので、過去の入力データの履歴に
ないと判断された文脈とデータとの組み合わせを全て登
録する必要がなく、これによりデータ復元の処理速度が
さらに大幅に向上する効果がある。さらに、実際に出現
頻度が高いデータについてのみ符号をもたせる(登録す
る)ことができ、これによりデータの復元効率が大幅に
向上する効果もある。
Further, in the processing until the escape code other than the escape code defined as the data indicating that the data has not been registered is decoded, when at least one escape code is decoded,
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 other than the escape code, so the combination of the context and the data determined not to be in the past input data history Does not need to be registered, and this has the effect of greatly improving the processing speed of data restoration. Furthermore, a code can be assigned (registered) only to data that actually has a high frequency of appearance, which has the effect of greatly improving data restoration efficiency.

【0180】また、関連技術2に係る他のデータ圧縮装
置によれば、入力データの出現頻度を求めて確率モデル
を構築して各入力データに符号を割り当て符号表を作成
し、この符号表から符号化するデータの符号を出力する
という2段階の処理を同時に行なうことができ、これに
よりデータ圧縮の処理速度が大幅に向上するという効果
がある。また、データが入力されるごとに既に構築され
ている確率モデルを再構築するという膨大な演算処理を
省くことができ、これによりデータ圧縮の処理速度がさ
らに向上する効果もある。また、過去に符号化したデー
タと同じデータが出現する毎に、符号化したリーフと他
のリーフあるいはノードとを組み替えて符号長を変更す
ることができるので、同じデータが繰り返し出現するほ
ど、そのデータの符号を少ないビット数で表すことがで
き、これによりデータの圧縮効果が大幅に向上する効果
もある。
Further, according to another data compression apparatus according to Related Technique 2, a probability model is constructed by determining the appearance frequency of input data, a code is assigned to each input data, and a code table is created. The two-stage process of outputting the code of the data to be encoded can be performed simultaneously, which has the effect of greatly improving the data compression processing speed. Further, it is possible to omit an enormous amount of arithmetic processing for reconstructing a probability model that has already been constructed each time data is input, thereby further improving the processing speed of data compression. Also, the code length can be changed by rearranging the coded leaf and another leaf or node every time the same data as the previously coded data appears. The sign of the 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 register all the histories of the combination of the input data and the context in advance, the processing speed of the data compression is greatly improved, and the memory used for the registration of the context is greatly increased. Since the processing load can be reduced, the processing load of the data compression apparatus can be significantly reduced.

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

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

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

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

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

【0187】さらに、過去の入力データの履歴にないと
判断された文脈とデータとの組み合わせを全て登録する
必要がなく、これによりデータ復元の処理がさらに大幅
に向上する効果がある。さらに、実際に出現頻度が高い
データについてのみ符号をもたせる(登録する)ことが
でき、これによりデータの復元効率が大幅に向上すると
ともにデータ復元装置の性能も大幅に向上する効果があ
る。次に、関連技術2について、より具体的に説明す
る。図32は、関連技術2のデータ圧縮方法及びデータ
復元方法を実施するためのデータ圧縮装置及びデータ復
元装置の構成例を示すブロック図であるが、この図32
において、データ圧縮装置3は、入力されたデータを過
去に出現した履歴に応じて符号化して圧縮するものであ
り、データ復元装置4は、データ圧縮装置3が符号化し
た符号を復号するものである。
Furthermore, it is not necessary to register all combinations of contexts and data determined not to be in the history of past input data, which has the effect of greatly improving data restoration processing. Furthermore, a code can be assigned (registered) only to data that actually has a high frequency of appearance, which has the effect of greatly improving the data recovery efficiency and greatly improving the performance of the data recovery device. Next, the related art 2 will be described more specifically. FIG. 32 is a block diagram illustrating a configuration example of a data compression device and a data decompression device for performing the data compression method and the data decompression method according to the related art 2.
, The data compression device 3 encodes and compresses the input data according to the history that has appeared in the past, 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, the data compression device 3 will be described as an encoding side, and the data decompression device 4 will be described as a decompression side. In addition,
In the following description, the context tree and the code tree have the configuration described in Related Art 1. (1) Description on the 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) are 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 an encoding unit,
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 provided with n input immediately before the input data K (hereinafter, sometimes referred to as event K). It holds the context consisting of data. Also, a context history holding unit (history holding unit) 101A
Holds a combination of input data K and a context, and includes a code tree holding unit (code tree holding unit) 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 data immediately before stored in the prefix data storage units 100A-1 to 100A-n.

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

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

【0192】ここで、上位ノード判別部41は、符号木
のルートのノード番号と文脈木のリーフのノード番号と
から上位ノードのノード番号を得るものであり、ノード
番号管理部(メモリ)42は、文脈木と符号木のノード
番号を管理するものであり、位置判別部43は、ノード
の分岐状態を判別するものである。さらに、ラッチ44
は、リーフのノード番号を一旦保持するものであり、ス
タック45は、位置判別部43から出力されるデータK
の符号を一旦保持して、終了信号を受信すると保持して
おいた符号を順次出力するものである。
Here, the upper node discriminating section 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. The node number management section (memory) 42 , And manages the node numbers of the context tree and the code tree, and the position determining unit 43 determines the branch state of the node. Further, the latch 44
Holds the node number of the leaf once, and the stack 45 stores the data K output from the position determination unit 43.
Are temporarily stored, and when the end signal is received, the stored codes are sequentially output.

【0193】上述の構成により、図33に示すデータ圧
縮装置では、前置データ保持部100A−1〜100A
−nが、入力データKの直前までに入力されたn個の入
力データからなる文脈を保持し、文脈履歴保持部101
Aが、入力データと文脈との組み合わせを保持し、符号
木保持部102Aが、文脈毎に独立した符号木を保持す
る。
With the above configuration, in the data compression apparatus shown in FIG. 33, the prefix data holding units 100A-1 to 100A
−n holds a context composed of n pieces of input data input immediately before the input data K, and a context history holding unit 101
A holds a combination of input data and a 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 determining unit 103A determines a code tree of the data from the input data up to just before being held in the prefix data holding units 100A-1 to 100A-n.
The coding unit 104A outputs “0” or “1” according to a branch from a node located halfway along the leaf storing the data K 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 a code length changing unit rearranges the encoded leaf with 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 processing steps A1 to A6 in 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 prefix data holding units 100A-1 to 100A-1
The context character string P held in 00A-n is initialized (step A1), and data K to be encoded is input (step A2). The code tree determining unit 103A sends the context P from the context history holding unit 101A holding the history of the context held in the prefix data holding units 100A-1 to 100A-n.
Is determined, and the node number (ID) of the leaf holding the data K and the node number (ID) of the root of the context P are determined from the determined code tree and the information of the context history holding unit 101A. To the encoding unit 104A,
4A is the event K in the code tree corresponding to the context P.
A 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 encoding section 104A will be described later in detail with reference to FIG.

【0197】そして、符号化部104Aにおいての符号
化後、符号木更新部105Aは、符号木の事象Kのリー
フを他のリーフあるいはノードと組み替え(ステップA
4)、元の符号木保持部102Aに格納することで符号
木の更新を行なう。なお、この符号木更新部105Aが
行なう処理については、図37を用いて後に詳述する。
After the encoding in encoding section 104A, code tree updating section 105A rearranges the leaf of event K in the code tree with another leaf or node (step A).
4) Update the code tree 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, context update section 106A rejects the oldest data (data held in prefix data holding section 100-n) and registers input data K as a context in prefix data holding section 100A-1. By doing, the context string P
Is updated (step A5). Then, it is checked whether encoding is completed for all data (step A).
6) If not completed, the processing from step A2 is repeated, and if completed, the encoding processing ends (YES route of step A6).

【0199】なお、上述のノードの組み変え(ステップ
A4)と文脈更新(ステップA5)の処理は、どちらを
先にしてもよく、また、並列に処理してもよい。次に、
処理ステップA3で述べたように、図34にて上述した
構成をもつ符号化部104Aが行なう符号化処理につい
て、図36の処理ステップB1〜B8を参照しながら説
明する。
The above-described processing for changing the nodes (step A4) and the processing for updating the context (step A5) may be performed first, or may be performed in parallel. next,
As described in the processing step A3, the encoding processing performed by the encoding 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 a 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-mentioned step A3,
Node number (ID) of leaf holding data K
Is sent from the latch 44 to the position determining unit 43, and the position determining unit 43 sends information on which of the upper nodes the node of the received node number is located to the node number managing unit 42.
It is determined whether the node received from this information is located on the right hand 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 the right hand is located, “1” is set to stack 4
Push (output) to No. 5 (step B4 from the YES route of step B3), and if it is located on the left hand, push (output) "0" to the stack 45 (step B5 from the NO route of step B3). Further, the node number (ID) of the root of the context P, which is another node number, sent in step A3 described above is sent to the upper node determining unit 41, and the upper node determining unit 41 transmits the received node ( 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 the route is a route, an end signal is output (YES route in step B6). If the route is not a route, the node number (ID) management unit 42 is accessed, and the upper level of this node (or leaf) is accessed. , The node (U) is newly obtained as the current node L, the address pointer is moved to the upper node, and the processing from step B3 is repeated (from the NO route of step B6 to step B7). .

【0203】このようにして、アドレスポインタがルー
トに達するまで処理を繰り返すことで、スタック45に
は、リーフからルートへの“1”か“0”の数値で表さ
れる「道筋」が記憶される。そして、この「道筋」を、
逆に下位ビットから1ビットづつ出力(pop−up出
力)することで、ルートからリーフへの「道筋」が符号
として出力される(ステップB8)。
By repeating the processing until the address pointer reaches the root in this way, the "path" represented by the numerical value of "1" or "0" from the leaf to the root is stored in the stack 45. You. And this "path",
Conversely, by outputting one bit at a time from the lower bits (pop-up output), the "path" 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 code tree updating unit 105A performs the process of rearranging the leaf of the event K with another leaf or node as shown in FIG.
This will be described in detail with reference to the processing steps C1 to C9. 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 determined whether or not the upper node U0 of K is the root of the code tree (step C3). If it is the root, the rearrangement is terminated (YES from step C3 to step C9). The upper node of the node U0 is set to U1 (NO in step C3)
From the root, step C4), it is determined whether the node U0 is located with respect to the upper node 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
Is set to the node located to the left of node U1 (from the YES route of step C5 to step C6), and the node Z
And node X (step C8). That is, the node on the left of the node U1 and the leaf K are rearranged. On the other hand, when the node U0 is on the left hand side of U1, a node located on the right hand side of the node U1 is set to the node X (step C7 from the NO route of step C5), and the node Z is replaced with the node X (step C8). . That is, the node on the right side of the node U1 and the leaf K are rearranged.

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

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

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

【0210】(2)復元側の説明 図38は、前述のデータ復元装置4の内部の構成例を示
すブロック図であり、この図38に示すように、200
A−1〜200A−n(nは自然数)は前置データ保持
部、201Aは文脈履歴保持部、202Aは符号木保持
部、203Aは符号木決定部、204Aは符号化部、2
05Aは符号木更新部、206Aは文脈更新部である。
(2) Description on the Restoration Side FIG. 38 is a block diagram showing an example of the internal configuration of the data restoration apparatus 4 described above. As shown in FIG.
A-1 to 200A-n (n is a natural number) are 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,
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 sections (prefix data holding means) 200A-1 to 200A-n hold n pieces of data decoded in the past, and are stored in the context history holding section (history holding means). ) 201A holds a combination of a decoded symbol and a context, and a 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で選択した
符号木のルート(符号木の頂点)からノード(分岐点)
を走査して到達したリーフに格納されているシンボルを
出力するものである。
A code tree determining unit (code tree determining means) 2
03A is a prefix data holding unit 200A-1 to 200A-
n to determine a code tree for decoding a symbol from the context held in the decoding unit (decoding means) 20
4A is a node (branch point) from the root (the top of the code tree) of the code tree selected by the code tree determination unit 203A according to the code.
To output the symbols stored in the reached leaf.

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

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

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

【0216】また、符号長変更手段としての符号木更新
部205Aが、復号したリーフと他のリーフあるいはノ
ードとを組み替え、前置データ更新部206Aが、復号
したデータKを最新の文脈として前置データ保持部20
0A−1に登録する。以下、上述の処理について、図4
0に示すフローチャートの処理ステップF1〜F6を参
照しながら、さらに詳述する。
Further, the code tree updating unit 205A as code length changing means rearranges the decoded leaf with another leaf or node, and the prefix data updating unit 206A uses the decoded data K as the prefix in the latest context. Data holding unit 20
Register at 0A-1. Hereinafter, the above processing will be described with reference to FIG.
0 will be described in more detail with reference to processing steps F1 to F6 in 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 prefix data holding units 200A-1 and 200A-2
Initialize n context character strings P held in 00A-n (step F1), and input an event (data) K to be decoded (step F2). The code tree determining unit 203A is a context history holding unit 201A that holds the history of the context held in the prefix data holding units 200A-1 to 200A-n.
, And sends 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 accordance with the transmitted code, the root is scanned to the leaf storing the event K to decode the code (step F3). Note that this decoding unit 204
The processing performed by A will be described later in detail 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 assembling the leaf of the event K decoded by the code tree 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 update unit 206A rejects the oldest data (data held in the prefix data holding unit 200-n), and uses the decoded event (data) K as a context and adds the event (data) K to the prefix data holding unit 200A. By registering it as -1, the context character string P is updated (step F5). Then, it is checked whether the decoding has been completed for all 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 ended (step F6). F6 YES route).

【0220】なお、この場合も符号化側と同様に、上述
のノードの組み変え(ステップF4)と文脈更新(ステ
ップF5)の処理は、どちらを先にしてもよく、また、
並列に処理してもよい。次に、処理ステップF3で述べ
たように、図39にて上述した構成をもつ復号部204
Aが行なう符号化処理について、図41に示すフローチ
ャートの処理ステップG1〜G7を参照しながら説明す
る。
In this case, as in the case of the encoding side, either of the above-described processing of changing the node (step F4) and updating of the context (step F5) may be performed first.
Processing may be performed 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 processing 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 unit 46 determines the node number (I
D) is set to node Z (step G1), and 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 the code No. 8, is set to C (step G2). Then, it is checked whether the sign of the event K to be decoded set in C matches "1" (step G3). If it is "1" (Yes), the node Z
Is set to node Z (step G).
If it is not "1" (that is, if it is "0") from the YES route of step 3 to step G4, the node on the left side of node Z is set to node Z (from the NO route of step G3 to step G5). Further, the lower node determining 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 the node number to the leaf / node discriminating unit 47, and At 47, the position information of the node Z having the node number sent is obtained 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 route of No. 6), the process returns to step G2, and the process is repeated until the event K to be decoded reaches the leaf storing the event K. On the other hand, if 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 discriminating unit 47 sends the symbol (event) output signal to the node number managing 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 a decoding processing end signal.

【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 changed to the event K
Can be decoded by tracing to the leaf where is stored. As described above, according to the data restoring apparatus for implementing the data restoring method according to Related Technique 2, a decoded character is registered with a number in a tree-structured context tree, and a code tree corresponding to the context tree is registered. A two-stage process in which a code that matches the code of a character to be decoded is searched from a code table by creating / updating while performing a spraying process, and a character registered corresponding to the matched code is output as a decoded character. Can be performed at the same time, and there is an effect that the speed of the data restoration processing is greatly improved.

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

【0225】このため、この図42中、図33にて既述
の符号と同じ符号の構成部分の説明は省略し、図33と
は異なる構成部分についてのみ、以下に説明する。即
ち、符号化部104A′は符号出力手段およびエスケー
プコード出力手段として、符号木にシンボルが登録され
ていないときは符号木のルートからエスケープコードが
格納されているリーフまでの途中に位置するノードから
の分岐に従ってエスケープコードを出力し、符号木にシ
ンボルが登録されているときは符号木のルートからシン
ボルのリーフまでの途中に位置するノードからの分岐に
従ってシンボルの符号を出力するものである。
Therefore, in FIG. 42, description of components having the same reference numerals as those already described in FIG. 33 will be omitted, and only components different from those in FIG. 33 will be described below. That is, the encoding unit 104A 'operates as a code output unit and an escape code output unit, when a symbol is not registered in the code tree, from a node located halfway from the root of the code tree to the leaf where the escape code is stored. When the symbol is registered in the code tree, the escape code is output according to the branch from the node located halfway 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 ', as a control means, repeats the processing when encoding the escape code until data encoding is performed. Also, 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 stored in advance. The context discriminating unit (context discriminating unit) 108A includes a code tree determining unit 103 The context change unit (context change means) 110A determines whether or not a symbol is registered in the code tree determined in (1), and reduces the length of the context when no symbol is registered in the code tree. Things.

【0227】そして、このような図33とは異なる構成
により、図42に示すデータ圧縮装置3では、符号化部
104A′が、符号木にシンボルKが登録されていない
ときは符号木のルートからESCが格納されているリー
フまでの途中に位置するノードからの分岐に従ってES
Cの符号を出力し、符号木にシンボルKが登録されてい
るときは符号木のルートからシンボルKのリーフまでの
途中に位置するノードからの分岐に従ってシンボルKの
符号を出力する。
With a configuration different from that of FIG. 33, in the data compression device 3 shown in FIG. 42, the encoding unit 104A ′ determines that the symbol K is not registered in the code tree from the root of the code tree. The ES according to the branch from the node located halfway 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 a branch from a node located halfway 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 of 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)。
Hereinafter, the above-mentioned processing will be described in more detail with reference to processing steps H1 to H11 in the flowchart shown in FIG. First, the context change unit 110A
A context character string P 0 is initialized from all the contexts held in the prefix data holding units 200A-1 to 200A-n (step H1), and this context character string P 0 is set in the context P (step H1). H2) Then, 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 means 103A.
The information of the context P sent from the context change unit 110A is
This is sent to the context determination unit 108A. Then, the context determining unit 108
A determines whether the event K is registered in the context P from the received information on the context P (step H4).

【0231】ここで、文脈Pに事象Kが登録されている
場合は、文脈履歴保持部101Aが、符号化部104
A′にエスケープコード(ESC)の符号化を指示し、
符号化部104A′では、文脈Pに対応した符号木内に
おいて、エスケープコード(ESC)のリーフからルー
トへのノードの分岐に対応した符号を出力してエスケー
プコードの符号化を行なう(ステップH4のNOルート
からステップH5)。
Here, when the event K is registered in the context P, the context history holding unit 101A makes the encoding unit 104
Instruct A 'to encode an escape code (ESC),
The encoding unit 104A 'encodes the escape code by outputting 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 (NO in step H4). Step H5 from the route).

【0232】さらに、符号化部104A′は、符号木決
定部103Aを通じて符号木更新部105Aに、符号木
の更新を指示し、符号木更新部105Aは、符号木のE
SCのリーフを他のリーフあるいはノードと取り替える
(ステップH6)。そして、文脈Pの次数(符号木の初
期状態が0次である)を1つ低次に移し(ステップH
7)、ステップH4に戻り、文脈Pに事象Kが登録され
ている(Yes)と判断されるまで処理を繰り返す。
Further, encoding section 104A 'instructs code tree updating section 105A to update the code tree through code tree determining section 103A, and code tree updating section 105A
The SC leaf is replaced with another leaf or node (step H6). Then, the order of the context P (the initial state of the code tree is the 0th order) is shifted by one (step H).
7) Returning to step H4, the process is repeated 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, if 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 encoding unit 104A 'performs encoding by outputting a 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 (YES route of step H4 to step H8).

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

【0235】そして、全てのデータについて符号化が終
了したかをチェックし(ステップH11)、終了してい
ない場合は(ステップH11のNOルート)、ステップ
H2に戻り、全てのデータを符号化するまでステップH
2以降の処理を繰り返し、終了している場合は(ステッ
プH11のYESルート)、符号化の全ての処理を終了
する。
Then, it is checked whether or not encoding of all data has been completed (step H11). If not completed (NO route of step H11), the process returns to step H2 until all data is encoded. Step H
Steps 2 and subsequent steps are repeated, and if the processing has been completed (YES route in step H11), all the encoding processing is 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, see the processing steps B1 to B8 described above with reference to FIG. 36. For details, see the processing steps C1 to C9 described in FIG.
Please refer to.

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

【0238】そして、上述のように予め登録されている
文脈に符号化するシンボルが含まれない間に出力するエ
スケープコードの符号長を、スプレイ処理により短く
(1/2)してゆくことにより、シンボルが含まれる文
脈を発見して符号化するまでの時間を短縮することがで
きるので、データ圧縮の処理速度が大幅に向上するとと
もにデータ圧縮装置の処理負荷も大幅に軽減できる効果
がある。
As described above, the code length of the escape code to be output while the symbol to be coded is not included in the pre-registered context is shortened ()) by the spraying process. Since it is possible to shorten the time required for finding and encoding a context including a symbol, the processing speed of data compression is greatly improved, and the processing load of the data compression apparatus can be greatly 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 art 2, and as shown in FIG. In addition to the configuration described above with reference to FIG. 38, a context changing unit 210A is provided inside the device 4, and a decoding unit 204A, a code tree holding unit 205
A decoding unit 204A 'and a code tree holding unit 207A are provided instead of A.

【0240】このため、この図44中、図38にて既述
の符号と同じ符号の構成部分の説明は省略し、図38に
示す構成とは異なる構成部分について、以下に説明す
る。即ち、符号木保持部(符号木保持手段)207A
は、エスケープコードをあらかじめ登録した符号木を保
持するものであり、文脈変更部(文脈変更手段)210
Aは、出力したデータがエスケープコードであったとき
入力されたデータを棄却し文脈を短くするものである。
Therefore, in FIG. 44, the description of the components having the same reference numerals as those already described in FIG. 38 will be omitted, and 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 includes a context change unit (context change means) 210
A is for rejecting the input data when the output data is an escape code and shortening the context.

【0241】また、復号部204A′は復号手段とし
て、上述の符号化側で符号化された符号に従って、符号
木決定部203Aで選択した符号木のルート(頂点)か
らノード(分岐点)を走査して到達したリーフに格納さ
れているデータを出力するものである。さらに、復号部
204A′は制御手段として、エスケープコードを復号
した時は、文脈変更部210Aで上述のように文脈を再
設定し、エスケープコード以外のデータが復号されるま
で処理を繰り返す制御を行なうようになっている。
The decoding unit 204A '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 coded on the coding side as a decoding means. Then, the data stored in the leaf that has arrived is output. Furthermore, when the escape code is decoded, the context change unit 210A resets the context as described above and controls the process to repeat the process until data other than the escape code is decoded. It has become.

【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 apparatus shown in FIG. 44, the code tree holding unit 207A holds the code tree in which the ESC is registered in advance, and the context change unit 210A When the data K output by E. is ESC, the input data K is rejected to shorten the context. Further, the decoding unit 204A ′ scans a node from the root of the code tree selected by the code tree determination unit 203A according to the code of the encoded data K, and outputs data K stored in a leaf reached, When the ESC is decoded, the order of the context is changed by the context changing unit 210A, and the process is repeated until 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.
This will be described in further detail with reference to processing steps J1 to J9 in the flowchart shown in FIG. First, the context change unit 210
A is preceded by the context string P 0 from all context held in the data holding unit 200A-1~200A-n is initialized (step J1), and sets this context string P 0 on the context P (Step J2).

【0244】そして、文脈変更部110Aは、この文脈
Pを文脈履歴保持部201Aおよび符号木決定部203
Aに送り、符号木決定部203Aでは、受け取った文脈
Pから符号木を選択(決定)し(ステップJ3)、決定
した符号木を復号部204A′に送る。復号部204
A′では、決定した符号木内において、符号化側で符号
化された符号に応じてルートからリーフへ走査して符号
を復号する(ステップJ4)。なお、この復号部204
A′が行なう処理の詳細については、図41にて前述し
た処理ステップG1〜G7を参照されたい。
The context changing unit 110A stores the context P in the context history holding unit 201A and the code tree determining unit 203.
A, 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 section 204
In A ', the code is decoded by scanning from the root to the leaf in the determined code tree according to the code coded on the coding side (step J4). Note that this decoding unit 204
For details of the processing performed by A ', refer to 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, decoding section 204A 'checks whether or not the decoded event K is an ESC (escape code) (step J5). If the decoded event K is an ESC, the ESC signal is context-changed. Transmitted to the unit 210A (YES route of step J5). Furthermore, this ESC
Upon receiving the signal, the context change unit 210A changes the order of the context P by one, and changes the order (for example, n-1 ignoring the oldest data held in the prefix data holding unit 200-n). (The next context P is created) (step J6), this context P is sent to the context history holding unit 201 and the code tree determining 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 '
The processing from step J2 is repeated until the other event K is decoded. On the other hand, if the decrypted event K is not ESC, the leaf of the decrypted event K is recombined with another leaf or node (NO route from step J5 to step J7). For details of the leaf or node rearrangement processing, see 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 (the data held in the prefix data holding unit 200-n) and uses the decoded event K as a context and sends it to the prefix data holding unit 200-1. Insert and register the context string P
0 is updated (step J8). Then, it is checked whether or not decoding has been completed for all data (step J).
9) If not completed, the processing from step J2 is repeated (from the NO route of step J9 to step J2).
2) If not, the decryption process ends (step J).
9 YES route).

【0248】なお、この場合も符号化側と同様に、上述
のノードの組み変え(ステップJ7)と文脈更新(ステ
ップJ8)の処理は、どちらを先にしてもよく、また、
並列に処理してもよい。このように、関連技術2の第1
変形例にかかるデータ復元装置によれば、シンボルが登
録されていないことを表すエスケープコード(ESC)
を予め符号木に登録しておき、復号したシンボルがこの
エスケープコードであった場合に、エスケープコード以
外の符号(すなわち、復号するシンボルの符号)を復号
するまで文脈を短く(変更)して復号するシンボルの符
号を検索することにより、入力データとして現れるシン
ボルの組み合わせ(文脈)全てを予め符号木に登録して
おかなくてもよいので、文脈の登録に使用するメモリを
大幅に削減できる利点がある。
In this case, as in the case of the encoding side, either of the above-described processing of changing the node (step J7) and updating of the context (step J8) may be performed first.
Processing may be performed in parallel. Thus, the first of the related technologies 2
According to the data restoration device of the modified example, an escape code (ESC) indicating that a symbol is not registered
Is registered in the code tree in advance, and if the decoded symbol is this escape code, the context is shortened (changed) 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, all combinations (contexts) of symbols appearing as input data do not need to be registered in the code tree in advance. is there.

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

【0250】このため、この図42中、図33にて既述
の符号と同じ符号の構成部分の説明は省略する。また、
符号登録部112Aは、入力されたデータKが符号木に
登録されていないときに、このデータKを符号木に登録
するものである。このような構成により、入力されたデ
ータKが符号木に登録されていないときに、符号登録部
112Aが符号木にデータKを登録するようにすること
ができる。
Therefore, in FIG. 42, the 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 data K in the code tree when the input 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 processing steps K1 to K12 of FIG. 7, but 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. It 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 thereafter, processing related to 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 determines that the event K is not registered in the context tree (NO route in step K4), the code tree updating unit 105A replaces the ESC leaf of the code tree with another leaf. Alternatively, the sign of the ESC is changed in combination with the node (step K6), and the context history holding unit 101A stores the current context P in the code registration unit 112A.
And the context change unit 110A changes the order of the context P by one (step K7), and then changes the order of the context P.
2A registers 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 if it is determined in step K4 that event K is registered in the context tree, the same processing as steps H8 to H11 in FIG. 43 is performed in steps K9 to K12. I have. As described above, according to the data compression device according to the second modification of the related technique 2, as described above, except for step K8,
Since this is the same as the processing step in FIG. 43 on the encoding side of the first modification of Related Art 2, it has the same effect as the encoding side of the first modification of Related Art 2.

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

【0255】このため、この図48中、図44にて既述
の符号と同じ符号の構成部分の説明は省略する。符号登
録部212Aは、圧縮側で符号化されたデータの復号処
理でESC(エスケープコード)を復号したときに、文
脈に対応した全ての符号木に、この復号したデータの符
号を登録するものである。
Therefore, in FIG. 48, the 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 decoding the ESC (escape code) in the decoding process of the data encoded on the compression side. is there.

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

【0257】ここで、この図49に示すように、処理ス
テップL1〜L4においては、関連技術2の第1の変形
例の復元側における、図45にて前述した処理ステップ
J1〜J4と同様の処理が行なわれる。そして、ステッ
プL4で、復号部204Aが符号を復号した後、符号木
更新部205Aが、復号した事象Kのリーフを他のリー
フあるいはノードと組み替え(ステップL5)。
Here, as shown in FIG. 49, processing steps L1 to L4 are the same as 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, after the decoding unit 204A decodes the code in Step L4, the code tree updating unit 205A rearranges the leaf of the decoded 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を復号するまで処理を繰り返す。
At this point, if the ESC (escape code) has been decoded before and the ESC signal from decoding section 204A has been received at this time, all The event K is registered in the code tree (step L6). Furthermore, the decrypted event K is ES
C (step L7), and the decrypted event K
Is an ESC, the ESC signal indicating that the decoded event K is the ESC is transmitted to the context change unit 210A and the code registration unit 212A, and the context change unit 210A that has received the ESC signal The order is shifted to one lower order and changed (from the YES route of step L7 to step L
8) The process returns to step L3 to repeat the process until the event K other than ESC is decoded.

【0259】このようにして、復号部204Aで復号し
た事象KがESCである場合は、符号登録部212Aが
符号木に新規のリーフを作成し、復号部204がESC
以外の事象をKを復号したとき、この事象Kを新規に作
成した全てのリーフに格納することにより、ESCを復
元した全ての符号木に該シンボルを登録することができ
る。
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
When the event K other than the above is decoded, the symbol can be registered in all the code trees in which the ESC is restored by storing the event K in all the newly created leaves.

【0260】一方、上述のステップL7で、復号した事
象KがESCでない場合は、文脈更新部206Aが、最
も古いデータ(前置データ保持部200−nに保持され
ているデータ)を棄却し、復号した事象Kを文脈として
前置データ保持部200−1に挿入して登録し、文脈文
字列P0を更新する(ステップL9)。そして、全ての
データについて復号が終了したかをチェックし(ステッ
プL10)、終了していなければステップL2からの処
理を繰り返し(ステップL10のNOルート)、終了し
ていれば復号処理を終了する(ステップL10のYES
ルート)。
On the other hand, if the decrypted event K is not ESC in step L7, the context updating unit 206A rejects the oldest data (data held in the prefix data holding unit 200-n), the decoded event K registers inserted into the pre-data retaining unit 200-1 as a context, to update the context character string P 0 (step L9). Then, it is checked whether decoding has been completed for all data (step L10). If not completed, the processing from step L2 is repeated (NO route of step L10), and if completed, the decoding processing is ended (step L10). YES at 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, similarly to 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 modification of the related art 2, in addition to the effects described above on the decompression side in the first modification, the escape code By decoding the symbols of the symbols to be decoded in the code tree during the decoding of symbols, symbols that are not registered in the code tree can be decoded at an early stage in the next decoding. As the data decoding process proceeds, the effect of restoring is greatly improved and the processing load on the data restoring device can be greatly reduced. (B-3) Description of Third Modified Example of Related Technology 2 (1) Description of Encoding Side In the third modified example, the above-described data compression device 3
Compared with the second modification, when encoding the data K, if the ESC has been encoded at least once, the context change unit 110A as the history registration unit sets the context immediately before the encoding of the data. Is registered in the context history holding unit 101A, and the code registration unit 112A newly registers data in a code tree having an escape code encoded immediately before encoding the data. Is different.

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

【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 in 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 an ESC (step M10). If 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 prefix data holding unit 100A-1 as the newest context.

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

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

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

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

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

【0269】上述のような処理について、図51の処理
ステップN1〜N10を参照しながら、さらに詳述す
る。ここで、この図51に示すように、ステップN1〜
N5において、図49のステップK1〜K5とそれぞれ
同様の処理が行なわれる。
The above processing will be described in further detail with reference to processing steps N1 to N10 in FIG. Here, as shown in FIG.
In N5, the same processing as in steps K1 to K5 in FIG. 49 is 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 decoded in step N5 with another leaf or node, it is checked whether the decoded event K is an ESC (step N6). If the decoded event K is an ESC, the order of the context P is changed (Y in step N6).
From the ES route, step N7), the process returns to step N3, and repeats 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, if the decoded event K is not an ESC, the code tree updating unit 205A creates a new leaf only in the code tree obtained by decoding the immediately preceding ESC, and sets the code registration unit 212A
Registers the event K in the new leaf of this code tree (from the NO route of step N6 to step N8). Further, the context updating unit 206A rejects the oldest data (data held in the prefix data holding unit 200-n) and inserts the decrypted event K into the prefix data holding unit 200-1 as a context. And updates the context character string P 0 (step N
9).

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

【0273】さらに、上述のようにして新たに登録され
たシンボルと、同じシンボルが後に入力される毎にこの
シンボルの符号木のノードを組み替えて符号長を短くす
る(スプレイ処理する)ことにより、実際に出現頻度が
高いシンボルについてのみ、符号長の短い符号をもつこ
とになるので、データ復元装置の復元効果が大幅に向上
する効果がある。 (c)本発明の一実施形態の説明 本発明の一実施形態にかかるデータ圧縮装置及びデータ
復元装置も、関連技術2と同様に、図32に示したよう
な本発明のデータ圧縮方法及びデータ復元方法を実施す
るためのものである。
Further, each time the same symbol as the symbol newly registered as described above is inputted 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 frequency of occurrence actually has a code with a short code length, so that there is an effect that the restoration effect of the data restoration device is greatly 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 also include a data compression method and a data compression method 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 art 2
In the same manner as described above, 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 configuration described in Related Art 1. (1) Description on the Encoding Side FIG. 52 is a diagram showing an example of the internal configuration of a data compression device 3 (see FIG. 32) for implementing a data compression method according to an 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 sign 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 section (code tree holding means)
301B holds a code tree in which an escape code (ESC) (data indicating data not registered) is registered in advance, and a context tree holding unit (context tree holding unit) 302B
It stores a context tree in which a combination of a symbol K (input data) and a context is registered. The context registration unit (context registration unit) 303B newly registers the symbol K in the context tree after encoding the escape code. The context holding unit 321B stores the input symbol K
Is once held.

【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
After encoding the escape code, the symbol K is newly registered by branching the escape code leaf (data storage point) of the code tree in the code tree holding unit (code tree holding unit) 301B. Therefore, the code registration unit 322B includes 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 inside the code tree holding unit 301B, external nodes (leaf I
D) Holder 64, Internal Node (Node ID) Holder 65,
An ESC-ID holding unit 66 and a code tree management unit 67 are provided.

【0277】また、文脈変更部305Bは、シンボルK
と文脈との組み合わせが文脈木に保持されていないと
き、文脈を変更するものである。符号化部306Bは、
符号木の頂点からのシンボルKあるいはエスケープコー
ドが登録してあるリーフまでの分岐に従って“1”か
“0”で表される符号を出力するものである。
The context changing unit 305B outputs the symbol K
When the combination of and is not held in the context tree, the context is changed. The encoding unit 306B
It outputs a code represented by "1" or "0" according to the branch from the top of the code tree to the symbol K or 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 a leaf in which the encoded symbol K and escape code are registered with another leaf or node. Then, as shown in FIG. 53, inside the code registration unit 322B, the new node ID generation unit 61
02B, the two new node IDs (I
D-1 and ID-2 are generated, and the latch 62 temporarily holds an 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を保持す
るものである。
The parent-child information updating section 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-
Receiving the parent-child information consisting of 2), changing this parent-child information,
This is sent to the code tree holding unit 301B. Further, 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 section 67 receives the context ID from the context tree holding section 302B, and stores the context ID in the external node (leaf ID) holding section 64 and the internal node (node ID).
This is sent to the holding unit 65 and the ESC-ID holding unit 66. With the above-described configuration, in the data compression device 3 according to the embodiment of the present invention, the code tree holding unit 301B holds a code tree in which an escape code is registered in advance, and the context tree holding unit 302B stores the symbol K and the context P After holding the context tree in which the combination is registered and the context registration unit 303B encodes the escape code, it is possible to newly register the symbol K in the context tree.

【0281】さらに、文脈保持部321Bが文脈Pを一
旦保持し、符号登録部322Bがエスケープコードを符
号化したのち、符号木のエスケープコードのリーフを分
岐してシンボルKを新規に登録することができる。ま
た、文脈変更部305Bが、入力されたシンボルKと文
脈Pとの組み合わせが文脈木に保持されていないとき、
文脈Pを変更することができる。
Furthermore, after the context holding unit 321B once holds the context P, and the code registration unit 322B encodes the escape code, the symbol K is newly registered by branching the escape code leaf of the code tree. it can. Further, when the combination of the input symbol K and the context P is not stored 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 input data from the top of the code tree or the branch to the leaf where the escape code is registered, and the encoded data and the escape code are registered by the code update unit 307B. One leaf can be replaced with another leaf or node. FIG. 57 (a) is a diagram showing an example of a code tree, and FIG. 57 (b) is a diagram showing an example of a context tree. By the way, as shown in FIG. 57 (a), the code tree has ID numbers (0 to 10) in the root and the node as the internal nodes and in the leaves as the 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 a context ID and an ID number of a symbol registered in the context, and the context ID number is the ID of the root of the code tree. The ID numbers of the numbers and symbols are the same as the ID numbers of the leaves of the code tree. Here, regarding the above operation,
This will be described in further detail with reference to processing steps P1 to P16 showing the operation on 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-described configuration.
First, as shown in FIG. 54, when the symbol K is input (step P1), the context P stored in the context storage unit 321B is output to the context change unit 305B (step P2).

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

【0286】そして、シンボルKが登録されている文脈
Pを決定するまで、この処理を繰り返す。次に、図55
に示すように、文脈保持部302Bは、文脈PのID
(番号)とシンボルK(シンボルKが登録されていない
ときはESC)のIDを符号化部306Bに送り(ステ
ップP5)、符号化部306Bは、送られてきたIDを
符号木保持部301Bにそのまま転送する(ステップP
6)。
This process is repeated until the context P in which the symbol K is registered is determined. Next, FIG.
, The context holding unit 302B stores the ID of the context P
(No.) and the ID of the symbol K (ESC when the symbol K is not registered) is sent to the encoding unit 306B (step P5), and the encoding unit 306B sends the transmitted 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)。
The code tree holding unit 301B stores the ID number of the upper node of the transmitted ID and the coding unit 306.
Information indicating whether the ID sent by B is located on the right or left of the upper node is sent to encoding section 306B (step P7). Further, the encoding unit 306B
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 as a code if it is located on the right, and "0" is output as a code 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 encoding process ends. On the other hand, when they do not match, the ID of the context P is further output to the sign changing unit 307B (the same path as in step P6), and the code tree holding unit 30
The upper node ID and position information are obtained from 1B.

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

【0290】これにより、シンボルKが以前に入力され
文脈Pに登録されている場合に、さらにシンボルKが入
力されると、既に登録してあるシンボルKのノードを上
位のノードと組み替えて、符号長を短く(1/2に)す
ることができる。ところで、上述の文脈PにシンボルK
が登録されていない場合は、図56に示すように、文脈
登録部310Bは、文脈変更部305Bから登録する文
脈Pを受ける(ステップP10)とともにシンボルKと
を受けて(ステップP11)、文脈木保持部302Bに
登録シンボルのIDを出力し(ステップP12)、文脈
木保持部302Bは、文脈Pの下にシンボルKを新規に
登録する。
Thus, if the symbol K is previously input and registered in the context P, and the symbol K is further input, the already registered node of the symbol K is rearranged with the upper node, and The length can be shortened (1 /). By the way, in the context P described above, the symbol K
Is not registered, the context registration unit 310B receives the context P to be registered from the context change 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, code registration section 322B receives a code tree for registering a code from code tree holding section 301B (step P13), and stores symbol K to be registered and context tree holding section 302
B in response to the ID of the registered symbol (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). As a result, registration (encoding) of the symbol K not registered in the context P is performed.

【0292】ここで、符号登録部322Bが、エスケー
プコードを符号化したのち符号木保持部301B内の符
号木のエスケープコードのリーフを分岐してシンボルK
を新規に登録する動作(上述のステップP13〜P1
6)について、前述したように、図53を用いてさらに
詳述する。まず、符号木保持部301Bの内部に設けら
れた符号木管理部67は文脈IDを受けて符号木保持部
内のESC−ID保持部に文脈のESCアドレスを送
る。
[0292] Here, the code registration section 322B encodes the escape code, and then branches the escape code leaf of the code tree in the code tree holding section 301B to obtain the symbol K
For newly registering (the above-described steps P13 to P1)
As described above, 6) will be described in more detail with reference to FIG. First, the code tree management unit 67 provided inside the code tree holding unit 301B receives the context ID and sends the ESC address of the context 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 stores the ES
While receiving the C address, it outputs the ID of the ESC and the symbol registered in this ID (ESC in this case),
In the code registration unit 322B, the ESC-ID and the ESC are latched by the latch 62. Further, the new ID generator 61
Upon receiving the update signal, two ID numbers (ID-1, ID-
2), and the ID-1 is stored in the code tree holding unit 301B together with the ESC latched as the new ESC-ID.
Is 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] In addition to the ID and the symbol, the code tree holds parent-child information indicating the position information of the ID.
This parent-child information includes three pieces of information: a node ID of a higher order of the user, a node ID located at the lower right of the user, and a node ID located at the lower left of the user. The parent-child information updating unit 63
Three IDs (ESC-ID before change, ID-1, ID-
In response to 2), the parent / child information is changed. That is, ID-
ESC-ID is registered in the upper ID of 1, ID-2,
Also, ID-1 is at the lower right of the ESC-ID, and ID- is at the lower left.
The 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,
The registered symbol and the 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, the new ES
The C-ID (ID-1) is registered, the old ESC-ID is held as a node ID in the node ID holding unit together with the parent-child information, and the new ID (ID-2) and the symbol K are stored as new leaves in the leaf ID holding unit. The process of branching the leaf, in which the escape code is stored in the code tree holding unit 301B in which the escape code of the code tree is registered, and newly registering the symbol K, ends.

【0296】以上、図53〜56にて説明した動作をま
とめると、図58に示すフローチャートで表すことがで
きる。すなわち、まず、文脈P0に0を入力して初期化
し(ステップQ1)、文脈P0を変数としての文脈Pに
入力する(ステップQ2)。なお、この文脈P0は、直
前までに入力・符号化された文字(シンボル)であり、
例えば、本実施形態における符号化が、n次の文脈を用
いるモデルであったとき、文脈P0は直前までに入力・
符号化された(n−1)文字が格納されていることにな
る。
The operations described in FIGS. 53 to 56 can be summarized as a flowchart shown in FIG. That is, first, the context P 0 is initialized by inputting 0 (step Q1), and the context P 0 is input to the context P as a variable (step Q2). Note that the context P 0 is a character (symbol) input and encoded up to immediately before,
For example, when the encoding in the present embodiment is a model using an n-th order context, the context P 0 is input / output immediately before.
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). If the symbol K is not registered in the context tree of the context P, the code of the ESC (escape code) is output (from the NO route of step Q3 to step Q4), and the ESC of the code tree corresponding to the context P is registered. Spray processing is performed on the leaves (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), and 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. Further, after the symbol K is newly registered as described above, the oldest character in the context P is rejected, and the context P with the degree of the context reduced by 1 is newly changed to the context P (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 the context P is detected as being registered in the context P.
Are sequentially changed and the process is repeated. On the other hand, when 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 the context P is registered is subjected to spray processing (step Q10).

【0300】さらに、シンボルKの符号化後、文脈P0
にシンボルKを追加登録して文脈P0を更新する(ステ
ップQ11)。(例えば文脈P0にシンボルKを追加
し、文脈P0内の最も古い文字を棄却する)。そして、
全ての文字(シンボル)の符号化が終了したかをチェッ
クし(ステップQ12)、終了していない場合は(ステ
ップQ12のNOルート)、処理はステップQ2に戻っ
て、全ての文字の符号化が終了するまで処理を繰り返
す。
Further, after encoding the symbol K, the context P 0
Updating the context P 0 and additionally registers the symbol K (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 encoding of all characters (symbols) is completed (step Q12). If encoding is not completed (NO route of step Q12), the process returns to step Q2, and encoding of all characters is performed. The process is repeated until the process ends.

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

【0302】そして、ステップR3で文脈Pにシンボル
Kが登録されていない場合に、ESCの符号を出力し
(ステップR4)、ESCのリーフを分岐し(ステップ
R5)、新規リーフにESCとシンボルKを登録する
(ステップR6)。そして、上述のように登録を行なっ
た後に、ESCのリーフをスプレイ処理する(ステップ
R7)。
If the symbol K is not registered in the context P at step R3, the code of the ESC is output (step R4), the leaf of the ESC is branched (step R5), and the ESC and the symbol K are added to the new leaf. Is registered (step R6). Then, after the registration is performed as described above, the spray processing is performed on the leaves of the ESC (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, similarly to the processing step Q8 in FIG. 58, the context P is changed (step R12), and the process proceeds to step R3.
Is repeated until symbol K is detected. For example,
When the code tree is in a state where characters (symbols) A to E are already encoded and registered as shown in FIG. 60A, the above-described processing steps R1 to R12 (or the processing in FIG. 58) In steps Q1 to Q12), when the processing is executed with the symbol K as the character F, the leaf of the ESC having the leaf number 6 is branched, and as shown in FIG. ESC and letter F are registered in the leaves, respectively.

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

【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,
Context P 0 is initialized to 0 (step T1), context P 0 is input to context (variable) P, and 0 is input to context (variable) X (step T2). Further, it is searched whether the symbol K is registered in the context P (step T3).
If the symbol K is not registered in step S4, the same processing as in steps Q4 and Q5 (see FIG. 58) is performed (steps T4 and T5 from the NO route in step T3).

【0306】その後、文脈Xに文脈Pを入力し(ステッ
プT6)、文脈Pを変更して(ステップT7)、文脈P
にシンボルKが登録されていることを検出するまで処理
を繰り返す。一方、上述のステップT3において、文脈
PにシンボルKが登録されている場合は、前述のステッ
プQ9〜Q11(図58参照)、またはステップR9〜
R11(図59参照)と同様の処理を行なう(ステップ
T8〜T10)。
Thereafter, the context P is input to the context X (step T6), and the context P is changed (step T7).
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-described step T3, if the above-described steps Q9 to Q11 (see FIG. 58) or steps R9 to
The same processing as 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 registered in the two new leaves thus branched (step T12). Further, it is checked whether or not encoding of all characters (symbols) has been completed (step T13). If not completed, the processing from step T2 is repeated (NO route of step T13). The encoding process ends (YES route 9 in step T13).

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

【0309】また、上述のようなシンボルの新規登録の
前にスプレイ処理を行なえば、符号及びエスケープコー
ドの符号長を最小で2ビット、新規登録後にスプレイ処
理を行なえば、エスケープコードの符号を最小で1ビッ
トにすることができるので、さらに符号化効率が大幅に
向上する効果がある。さらに、上述の逐次登録型の場
合、符号木へのシンボルの新規登録は、常に1つずつ行
なわれ、同じシンボルが2度3度と出現することによっ
て2次3次の登録が行なわれるので、常に符号木の高次
には再現性を持ったシンボルのみが登録されることにな
り、符号木に登録はしたが実際には使われていないシン
ボルが存在するために生じる符号木の符号化効率の低下
を防止し、十分に辞書登録がなされた後の符号化効率が
大幅に向上する効果もある。
If the spray processing 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. If the spray processing is performed after the new registration, the code of the escape code is minimized. Thus, the coding efficiency can be greatly improved. Further, in the case of the above-described sequential registration type, new registration of a symbol in the code tree is always performed one by one, and secondary and tertiary registration is performed when the same symbol appears twice and three times. Only symbols with reproducibility are always registered in the higher order of the code tree, and the coding efficiency of the code tree caused by the presence of symbols that have been registered in the code tree but are not actually used. Also, there is an effect that the encoding 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は文脈保持部である。
[0310] The sequential registration type also has the advantage of using less memory capacity (dictionary capacity) than the full registration type. (2) Description of Restoration Side FIG. 62 is a diagram showing an example of the internal configuration of the data restoration device 4 (see FIG. 32) for performing the data restoration method according to an 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 change unit, 404B is a decoding unit, 407B is a code registration unit, 408B is a context registration unit, 409B is a latch, 42
1B is a context holding unit.

【0311】ここで、符号木保持部(符号木保持手段)
401Bは、予めエスケープコード(ESC)(データ
未登録を示すデータ)を登録した符号木を保持するもの
であり、文脈木保持部(文脈木保持手段)402Bは、
復号したシンボル(データ)と文脈との組み合わせを登
録した文脈木を保持するものである。また、文脈変更部
403Bは、文脈木保持部402Bに保持されている文
脈木を検索し、到達したリーフがエスケープコードであ
った場合、文脈を変更するものであり、復号部404B
は、符号化側で符号化されたシンボルKが入力されたと
き、このシンボルKの符号に従って、符号木保持部40
1Bに保持されている符号木のルート(頂点)からリー
フ(データ格納点)へと走査してシンボルKの符号を復
号するものである。
Here, the code tree holding unit (code tree holding means)
401B holds a code tree in which an escape code (ESC) (data indicating data not registered) is registered in advance, and a context tree holding unit (context tree holding unit) 402B
It holds a context tree in which a combination of a decoded symbol (data) and a context is registered. The context change unit 403B searches the context tree stored in the context tree storage unit 402B, and changes the context if the reached leaf is an escape code.
When the symbol K encoded on the encoding side is input, the code tree holding unit 40
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をこのリーフに新規に登録するものである。
[0312] Further, the code changing section 406B recombines the leaf of the decoded symbol K and the escape code with another leaf or a node as a branch point. The code registration unit (code registration means) 407B also has a function as a code tree determination means, and converts a symbol decoded immediately before decoding the symbol K into a symbol K
Is determined in the code tree holding unit 401B in which the code is registered, and when the escape code is decoded, the leaf of the escape code registered in this code tree is branched to newly create a 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を保持するものである。
For this reason, the code registration section 407B and the above-described code tree holding section 401 provide a code registration section 322B and a code tree holding section 301B (FIG. 52) on the encoding side, respectively.
(See FIG. 53). Further, the context registration unit 408B includes a 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の符号を復号で
きるようになっている。
Further, the above-described code tree holding unit 401B can hold a code tree in which an escape code has been registered in advance, and the context tree holding unit 402B can store a combination of the decoded symbol K and the context P in a context. It can hold trees. Further, the context change unit 403
B, when the reached leaf is an escape code, 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, and The code can be decoded.

【0315】また、符号木決定手段を兼ねる符号変更部
406により、直前までに復号したシンボルからシンボ
ルKの符号が保持されている符号木を決定することがで
き、復号したシンボルK及びエスケープコードのリーフ
を他のリーフあるいはノードと組み替えることができ
る。さらに、符号登録部407Bにより、エスケープコ
ードを復号したとき、エスケープコードのリーフを分岐
して新たにリーフを作成し、復号したシンボルKをこの
リーフに新規に登録することができる。
The code changing section 406 also serving as a code tree determining means can determine the code tree holding the code of the symbol K from the symbols decoded up to immediately before. Leafs can be recombined with other leaves or nodes. Further, when the escape code is decoded by the code registration unit 407B, the leaf of the escape code can be branched to newly create a 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を保持することができる。
The context registration unit 408B stores the symbol K registered by the code registration unit 407B in the context tree holding unit 40.
2B, the symbol K decoded by the decoding unit 204B can be temporarily stored by the latch 409B, and the context change holding unit 421 can store the symbol K.
The symbol K decoded in 04B can be held.

【0317】そして、上述の動作について、符号化側の
説明と同様に、図63および図64に示す復元側の動作
を示す処理ステップU1〜U14を参照しながら、さら
に詳述する。まず、図63に示すように、文脈保持部4
21Bはそれまでに復号したシンボル(文脈)を保持
し、文脈変更部403Bに出力し(ステップU1)、文
脈変更部403Bは、最初は送られてきた文脈をそのま
ま文脈木保持部402Bに出力する(ステップU2)。
The above-mentioned operation will be described in further detail with reference to 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.
21B holds the symbol (context) decoded so far and outputs it to the context change unit 403B (step U1), and the context change unit 403B outputs the initially sent context to the context tree holding unit 402B as it is. (Step U2).

【0318】また、文脈木保持部402は、文脈変更部
403Bから送られてきた文脈のID、すなわちルート
IDを復号部404Bに出力する(ステップU3)。こ
こで、復号部404Bでは、送られてきたルートIDに
対して符号(1ビット)が、例えば“1”ならば右下、
“0”ならば左下に位置するノード(あるいはリーフ)
IDを、符号木保持部401Bに要求する(ステップU
4)。
The context tree holding unit 402 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 transmitted route ID is “1”, for example,
If "0", the node (or leaf) located at the lower left
ID is requested from the code tree holding unit 401B (step U
4).

【0319】また、符号木保持部401Bは、要求され
たノード(あるいはリーフ)のノードIDを復号部40
4Bに返信する(ステップU5)。そして、復号部40
4B及び符号木保持部401Bは、符号木の終端である
リーフのリーフIDを得るまで上述の処理を繰り返す。
すなわち、復号部404Bは、符号化側で符号化された
符号に従って、復号するシンボルKが登録されているリ
ーフに到達するまで、符号木保持部401Bの符号木を
辿ってゆく。
[0319] The code tree holding unit 401B also stores the node ID of the requested node (or leaf) in the decoding unit 40B.
4B is returned (step U5). Then, the decoding unit 40
The 4B and code tree holding unit 401B repeats the above processing until the leaf ID of the leaf at 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 coded on the coding side until reaching the leaf where the symbol K to be decoded is registered.

【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 sets the sign change unit 40
6B updates the code length by performing spray processing on the decoded leaf in the same manner as the encoding side. Here, if the symbol decoded in this process is ESC, the decoding unit 4
04B sends this symbol (ESC) to the latch (step U6), and the latch once holds this symbol,
This is sent to the context changing unit 403B (step U7). Context change section 403B performs the same context change processing as that 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, 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 the 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と同じ経
路)。
The code registration unit 407B receives the root ID of the context P in which the symbol K has been 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 route ID of the sent context P
The code registration unit 407B returns the root ID of the code tree having the same root ID 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 the root ID (step U14). U13).

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

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

【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). Further, it is checked whether the decoded code is a symbol (step V4). If the decoded code is not a symbol, that is, if it is an ESC, the leaf of the decoded ESC is spray-processed similarly to the encoding side. (From the NO route of step V4 to step V
5) Reject the highest-order symbol (oldest symbol) in the context P, shift the context to one lower order and change it (step V6), and return to step 2. That is, until the symbol other than the ESC (symbol K) is decoded, the context P is changed to the context obtained by subtracting one 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 that the symbol K is output (from the YES route of step V4 to step V7), and the symbol K leaf is encoded. The code length of the symbol K is shortened (updated) by performing spray processing in the same manner as the conversion side (step V8). Furthermore, additionally registers the symbol K in the context P 0 (step V9), ESC is rejected. The change of the context P 0 is performed in the same manner as that on the encoding side.

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

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

【0329】また、上述のようなシンボルの新規登録の
前にスプレイ処理を行なえば、復号したシンボルの符号
及びエスケープコードの符号長を最小で2ビット、新規
登録後にスプレイ処理を行なえば、エスケープコードの
符号を最小で1ビットにすることができるので、さらに
データの復号効率が大幅に向上する効果がある。さら
に、上述のように、復元側が符号化側と同一の登録処理
を行なうことで、符号を正確に復号することができる利
点がある。 (c−1)本実施形態の第1の変形例の説明 本実施形態の第1の変形例にかかるデータ圧縮装置及び
データ復元装置においても、上述の実施形態と同様に、
図32に示すデータ圧縮方法及びデータ復元方法を実施
するためのものである。
If the spray processing 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. If the spray processing is performed after the new registration, the escape code is obtained. Can be reduced to one bit at a minimum, so that the decoding efficiency of data is further improved. Further, as described above, there is an advantage that the code can be accurately decoded by performing the same registration processing on the restoration side as on the encoding side. (C-1) Description of First Modification of this Embodiment In a data compression device and a data decompression device according to a first modification of this embodiment, as in the above embodiment,
This is for implementing the data compression method and the data decompression method shown in FIG.

【0330】また、上述した実施形態と同様に、データ
圧縮装置3を符号化側、データ復元装置4を復元側とし
て以下に説明する。 (1)符号化側の説明 符号化側の構成は、図52にて前述したものの構成と同
様である。
Also, as in the above-described embodiment, the data compression device 3 will be described below on the encoding side, and the data decompression device 4 will be described on the decompression side. (1) Description on Encoding Side The configuration on the encoding side is the same as the configuration 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が設
けられている。
The code registering unit 322B shown in FIG. 52 of this embodiment stores symbols in the leaf of the longest code length on the code tree held by the code tree holding means 301B as shown in FIG. As shown in FIG.
A D generating unit 61, a latch 62, a parent-child information updating unit 63, and a longest code detecting unit (branch position searching means) 69 are provided. Correspondingly, an internal node (node ID) is stored in the code tree holding unit 301B. ) A holding unit 65, a code tree management 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に送るものである。
Here, inside the code registration unit 322B, the new node ID generation unit 61
B receives the update signal and receives two new node IDs (ID-
1, ID-2), and the latch 62
This latches the leaf ID detected by the longest code detection unit 69. The parent-child information updating unit 63 also has three pieces of information (ESC-ID, 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)
In response to the parent-child information consisting of, the parent-child information is changed and sent 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 detecting section (branch position searching means) 69
Obtains the node ID of the code tree from the code tree holding unit 301B and obtains the ID of the leaf having the longest code length in the code tree.
(ID-0) is detected. Further, 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 includes a context tree holding unit 302
B, the context ID is stored in the internal node (node ID) holding unit 65 and the external node / ESC-I.
This 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 configuration, 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 processing steps W1 to W13 in the flowchart shown in FIG. First, in order to search for a context containing the symbol K, a context (context P) held in the context tree holding unit 302B is selected (steps W1 to W2),
It is checked whether the symbol K has been registered in the context P (step W3). If the symbol K has been 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, if 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 similarly to steps Q4 to Q5 in FIG. Is the code tree holding unit 301
A spray process is performed on the ESC leaf of the code tree stored in B (step W5). Thereafter, the code tree holding unit 30
1B stores the ID of the context P (root ID) in the context tree holding unit 3
02B, the node ID of the 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). Then, the detected leaf X
The ID and ID-0 of (p) are sent to the leaf ID holding unit 68, and the ID-0 and the symbol stored in the 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)。
The new node ID generating section 71 generates two new node IDs (ID-1, ID-2), and the parent / child information updating section 63 generates three IDs (ID-0, ID-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,
The registered symbol K, the new ID (ID-2), and the symbol registered as ID-0 and ID-1 are registered as new leaves in the leaf ID holding unit 68 of the code tree holding unit 301B (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 device according to the first modification of the embodiment of the present invention, in addition to the above-described effects on the encoding side of the above-described embodiment, the longest code (The distance from the root is the longest), and branches off the leaf X (p) to the symbol tree of symbols K and X (p). Make a new registration. This gives the "longest code length"
= "Least-occurring symbol", it is possible to minimize a decrease in coding efficiency due to an extension of the code length by 1 bit, thereby greatly improving the data compression processing speed and the data compression apparatus. Processing load 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) Description of the Decompression Side The data decompression device 4 according to the first modification of the present embodiment has the same configuration as that described above with reference to FIG. Code registration unit 407 in
B and the code tree holding unit 401B have the same internal configuration as the code registering unit 322B and the code tree holding unit 301B on the encoding side, respectively (see FIG. 66). Accordingly, the code registration unit 407B and the code tree holding unit 401B have the same configuration 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 similar to the process on the encoding side. Therefore, the symbol K encoded on the encoding 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 restoring apparatus according to the first modification of the embodiment of the present invention, like the encoding side, the data tree having the longest code length in the code tree of the context P (from the root) Is the longest) leaf X (p) is detected,
By branching this leaf X (p) and newly registering the symbols registered in the symbols K and X (p) in the code tree, “the longest code length” = “the symbol with the lowest appearance frequency” Therefore, in addition to the effect on the restoration side of the above-described embodiment, a decrease in data decoding efficiency due to the extension of the code length by 1 bit can be minimized, and the processing speed of data decoding can be significantly increased. As a result, the processing load on the data restoration device can be significantly reduced.

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

【0343】そして、本実施形態における図52に示す
符号登録部322Bには、符号木保持手段301Bに保
持されている符号木上に新規に登録されたリーフを分岐
してシンボルを登録するために、新規ノードID発生部
61,ラッチ62,親子情報更新部63及び最新登録I
D保持部70が設けられており、符号木保持部301B
には、外部節点(リーフID)保持部64、内部節点
(ノードID)保持部65,ESC−ID保持部66及
び符号木管理部67が設けられている。
The code registration unit 322B shown in FIG. 52 according to the present embodiment is used to branch a leaf newly registered on the code tree held by the code tree holding unit 301B and register a symbol. , New node ID generating section 61, latch 62, parent-child information updating section 63, and latest registration I
D holding unit 70 is provided, and a 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 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 unit) 70 newly provided in the present embodiment includes:
This is to hold the ID of the leaf newly (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 section 322B and code tree holding section 3
Since 01B has the above-described 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 newly registers the new leaf. The symbol K can be newly registered in the created leaf. Hereinafter, the above processing will be described in more detail with reference to processing 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-described processing, the latest registered leaf ID is stored in the latest registered ID storage unit 70,
New registration is performed by branching the ID. First, in order to search for a context including the symbol K, a context (context P) held in the context tree holding unit 302B is selected (steps X1 to X2), and the symbol K is registered in the context P. Is checked (step X3), and if registered, step W10 described above with reference to FIG.
-W13 (YES in step X3)
Steps X10 to X13 from the route).

【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 in FIG. Is the code tree holding unit 301
A spray process is performed on the ESC leaf of the code tree stored in B (step X5). Thereafter, the code tree holding unit 30
1B outputs the ID (root ID) of the 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, the context P
The leaf ID (ID-0) of the latest registered leaf X (p) corresponding to the code tree corresponding to the leaf ID of the code tree holding unit 301B
The symbols are sent to the holding unit 64 and the symbols stored in ID-0 and 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, ID-2).
D-1 and ID-2), the leaf X (p) is branched by updating the parent-child information (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 registration symbol K and the symbol registered in the leaf X (p) are registered as new leaves in the holding unit 64 (steps X7 and X8). A certain ID-2 is registered. 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 input of the symbol K is divided and the symbol K is registered in this leaf. I do. As described above, according to the data compression apparatus according to the second modification of the embodiment of the present invention, new registration of a symbol in the code tree is performed by branching the leaf of the symbol registered immediately before and registering the new symbol in this leaf. By doing, "symbol of leaf registered just before" =
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 this embodiment, and furthermore, data compression This has the effect of greatly improving the processing speed of.

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

【0352】従って、符号登録部407Bおよび符号木
保持部401Bが、符号化側の符号登録部322Bおよ
び符号木保持部301Bと同様の構成を有しているの
で、本実施形態の第1の変形例における復元側と同様
に、符号登録部407Bが復号したシンボルの符号を符
号木保持部401Bに新規に登録する処理は、符号化側
の処理と同様に行なわれる。
Therefore, since the code registration section 407B and the code tree holding section 401B have the same configuration as the code registration section 322B and the code tree holding section 301B on the encoding side, a first modification of the present embodiment is provided. Similarly to the decoding 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 encoding side.

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

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

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

【0356】なお、以上の実施形態および各変形例にお
いて、符号化側で述べた方法を、符号化するデータある
いはシステムによって切り替えるために、符号データの
伝送に先立って、ヘッダ部にどの方式を用いているかの
ID番号を付加し、復元側ではそのID番号から符号化
側で用いた登録方式を選択するようにしてもよい。
In the above embodiment and each of the modifications, in order to switch the method described on the encoding side depending on the data or system to be encoded, which method is used for the header section prior to the transmission of the encoded data. 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, in the data compression method of encoding and compressing input data according to a history that has appeared in the past, And a context tree holding process for storing a context tree in which a combination of a context consisting of n consecutive data and a code tree for each context are stored. When the combination of the context tree is not held in the context tree holding process, the context tree new registration process of newly registering data in the context tree of the context tree holding process, and the combination of input data and context is held in the context tree holding process If not, a new code tree 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 context change process that changes the context when the matching is not held in the context tree holding process, and a code that outputs a code according to the input data from the vertex of the code tree or a branch to a leaf where a specific code in the code tree is registered An output step, and a code length changing step of replacing a leaf in which a specific code in the input data or the code tree is registered with a node defined as a branch point other than the vertex of another leaf or the code tree. In the tree new registration process,
It is characterized by branching a leaf in which a specific code is registered, and registering the specific code and new data in the two new leaves obtained. In some cases, or at an early stage when the registration of the context held in the context tree holding process is not sufficient, a high coding rate can be obtained. If the code length changing step is performed before the above-described code tree new registration step, the code length of the code and the specific code is at least 2 bits. If the code length change step is performed after the new code tree registration step, the code of the specific code is changed. Can be reduced to 1 bit at a minimum, so that the coding efficiency is further improved. Furthermore, in the code tree new registration, new data registration is always 1
This is performed one by one, so that only symbols with reproducibility are always registered in the higher order of the code tree. This occurs because there is data that has been registered in the code tree but is not actually used. It is possible to prevent a decrease in coding efficiency, and thereby, there is an effect that coding efficiency after data registration is sufficiently performed is greatly improved.

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

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

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

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

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

【0364】また、請求項10記載の本発明のデータ復
元装置によれば、入力データを過去の入力データの履歴
に応じて符号化した符号を復号するデータ復元装置にお
いて、予めデータ未登録を示すデータとして定義される
エスケープコードを登録した符号木を保持する符号木保
持手段と復号したデータと文脈との組み合わせを登録し
た文脈木を保持する文脈保持手段と、直前までに復号し
たデータから符号の符号木を決定する符号木決定手段
と、符号に従って符号木の頂点を意味するルートからデ
ータ格納点としてのリーフへと走査して符号を復号する
復号手段と、到達したリーフがエスケープコードであっ
た場合、文脈を変更する文脈変更手段と復号したデータ
及びエスケープコードのリーフを他のリーフあるいは分
岐点としてのノードと組み替える符号更新手段と、エス
ケープコードを復号したとき、エスケープコードのリー
フを分岐して復号したデータを新規に登録する符号登録
手段と、符号登録手段で登録したデータを文脈保持手段
の文脈木に登録する文脈木登録手段とをそなえて構成さ
れているので、エスケープコードを比較的多く復号する
ようなデータである場合、または文脈木保持手段に保持
されている文脈の登録が十分でない初期の段階などにお
いて高い復号率が得られる効果がある。また、符号登録
手段による符号の登録の前に符号更新手段による符号更
新を行なえば、符号及び特定コードの符号長を最小で2
ビット、符号登録手段による符号の登録の後に符号更新
手段による符号更新を行なえば、エスケープコードの符
号を最小で1ビットにすることができ、これにより、さ
らに復号効率が大幅に向上する効果がある。さらに、符
号登録手段による復号する符号の新規登録は、常に1つ
ずつ行なわれるので、常に符号木の高次には再現性を持
ったデータのみが登録されることになり、符号木に登録
はしたが実際には使われていないデータが存在するため
に生じる復号効率の低下を防止でき、これにより十分に
データの登録がなされた後の復号効率が大幅に向上する
効果がある。そして、このような効果によりデータ復元
装置の性能が飛躍的に向上する効果がある。
[0364] According to the data restoration apparatus of the present invention, in a data restoration apparatus for decoding a code obtained by encoding input data in accordance with a history of past input data, data unregistration is indicated in advance. Code tree holding means for holding a code tree in which escape codes defined as data are registered; context 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, decoding means for scanning from the root meaning the vertex of the code tree to the leaf as the data storage point according to the code, and decoding the code, and the arrived leaf was an escape code. In the case, the context change means for changing the context and the leaf of the decoded data and escape code are used as another leaf or a node as a branch point Code updating means for rearrangement, code decoding means for branching the escape code leaf when the escape code is decoded and newly registering the decoded data, and data registered by the code registration means to be registered in the context tree of the context holding means If the data is such that the escape code is decoded in a relatively large amount, or if the registration of the context held in the context tree holding means is not sufficient, etc. Has the effect of obtaining a high decoding rate. Further, if code updating is performed by the code updating means before code registration by the code registering means, the code length of the code and the specific code can be reduced to a minimum of two.
If the code is updated by the code updating means after the registration of the code by the bit and code registering means, the code of the escape code can be reduced to one bit at a minimum, which has the effect of further improving the decoding efficiency significantly. . Further, new registration of codes to be decoded by the code registration means is always performed one by one, so that only data having reproducibility is always registered in the higher order of the code tree. However, it is possible to prevent a decrease in decoding efficiency caused by the presence of data that is not actually used, and this has the effect of greatly improving the decoding efficiency after data has been sufficiently registered. Such an effect has an 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, in a data restoration apparatus for decoding a code obtained by encoding input data in accordance with a history of past input data, data unregistered in advance is indicated. Code tree holding means for holding a code tree in which escape codes defined as data are registered; context holding means for holding a context tree in which a combination of decoded data and context is registered; A code tree determining means for determining a code tree, a decoding means for scanning from a root meaning a vertex of the code tree according to the code to a leaf as a data storage point to decode the code, and the leaf that has arrived is an escape code. In this case, the context change means for changing the context and the leaf of the decrypted data and escape code may be used as another leaf or as a branch point. Code updating means, a branch position searching means for searching for a position of a leaf having the longest code length in a code tree, and a leaf searched by the branch position searching means after encoding an escape code to obtain data. 11. The data restoration method according to claim 10, comprising a code registration means for newly registering and a context tree registration means for registering data registered by the code registration means in a context tree of the context holding means. In addition to the effect of the device, the code length of the least frequently used data that is rarely used can be lengthened, thereby minimizing the decrease in coding efficiency due to the code length being extended by one bit and restoring the data. Has the effect that the processing speed of the data restoration device can be greatly improved, and also has the effect that the performance of the data restoration device can be dramatically improved.

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

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

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

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

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

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

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

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

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

【図8】本発明に関連する技術を説明するためのブロッ
ク図である。
FIG. 8 is a block diagram for explaining 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 device and a data decompression device as technology 1 related to the present invention.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

【図30】(a),(b)は文脈木の作成手順のアルゴ
リズムを示す図である。
FIGS. 30A and 30B 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 illustrating a configuration of a data compression device and a data decompression device according to a technique 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 Art 2;

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

【図35】関連技術2にかかる符号化の手順を説明する
ためのフローチャートである。
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 Art 2;

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

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

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

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

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

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

【図43】関連技術2の第1の変形例にかかる符号化の
手順を説明するためのフローチャートである。
FIG. 43 is a flowchart for describing an encoding procedure according to a first modification 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 is a flowchart for describing a decoding procedure according to a first modification of Related Art 2;

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

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

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

【図49】関連技術2の第2の変形例にかかる復号化の
手順を説明するためのフローチャートである。
FIG. 49 is a flowchart for describing a decoding procedure according to a second modification of Related Art 2;

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

【図51】関連技術2の第3の変形例にかかる復号化の
手順を説明するためのフローチャートである。
FIG. 51 is a flowchart for describing a decoding procedure according to a third modification 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 is a block diagram illustrating a configuration of a code registration unit and a code tree holding unit according to the embodiment;

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

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

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

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

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

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

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

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

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

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

【図64】本実施形態にかかるデータ復元装置の動作を
説明するための図である。
FIG. 64 is a view 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 embodiment;

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

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

【図68】本実施形態の第2の変形例にかかる符号登録
部及び符号木保持部の構成例を説明するためのブロック
図である。
FIG. 68 is a block diagram illustrating 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 is a flowchart for describing an encoding procedure according to a second modified example of the present embodiment.

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

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

【図72】多値算術符号化のアルゴリズムの一例を示す
図である。
FIG. 72 is a diagram illustrating an example of an algorithm of multi-level arithmetic coding.

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

【図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 determination unit 42 Node number management unit (memory) 43 Position determination 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) holding unit 69 longest code detecting unit (branch position searching unit) 70 latest registration ID holding unit (branch position holding unit) 100, 200 prefix data holding 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 units 103, 203, 403 Code tree determining means 103A, 203A Code tree determining unit 104 Code output means 104A, 104A ', 306B Coding units 105, 205 Code length changing means 105A, 205A Code tree updating unit 106, 206 Prefix data update unit 106A, 206A Context update unit 108 Context determination unit 108A Context determination unit 109 Escape code output unit 110, 208, 305, 405 Context change unit 110A, 210A, 305B, 403B Context change unit 111 Code output unit 112 , 209 history registration means 113, 114, 115, 212, 304, 309, 3
11, 407, 410, 412 Code registration unit 112A, 212A, 322B, 407B Code registration unit 116, 117, 213 Control unit 204, 404 Decoding unit 204A, 204A ', 404B Decoding unit 303 Context registration unit 303B, 408B Context registration unit 302, 402 Context tree holding unit 302B, 402B Context tree holding unit 306 Encoding unit 307, 406 Code updating unit 406B Code changing unit 308, 409 Branch position holding unit 310, 411 Branch position searching unit 321B, 421B Context holding unit 408, 413, 414 Context tree registration means 409B Latch 511 Context collection 512 Dynamic variable length coding

───────────────────────────────────────────────────── フロントページの続き (72)発明者 吉田 茂 神奈川県川崎市中原区上小田中4丁目1番 1号 富士通株式会社内 Fターム(参考) 5J064 AA03 BA00 BA09 BA10 BA11 BB05 BB06 BC02 BC27 BC28 BC29 BD04  ────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Shigeru Yoshida 4-1-1, Kamiodanaka, Nakahara-ku, Kawasaki-shi, Kanagawa F-term within Fujitsu Limited (reference) 5J064 AA03 BA00 BA09 BA10 BA11 BB05 BB06 BC02 BC27 BC28 BC29 BD04

Claims (12)

【特許請求の範囲】[Claims] 【請求項1】 入力データを過去に出現した履歴に応じ
て符号化して圧縮するデータ圧縮方法において、 入力データとそれまでに連続したn個のデータからなる
文脈との組み合わせを登録した文脈木を保持する文脈木
保持過程と、 上記文脈毎に独立した符号木を保持する符号木保持過程
と、 上記の入力データと文脈との組み合わせが上記文脈木保
持過程に保持されていないとき、上記文脈木保持過程の
文脈木に上記データを新規に登録する文脈木新規登録過
程と、 上記の入力データと文脈との組み合わせが上記文脈木保
持過程に保持されていないとき、上記符号木保持過程の
符号木のデータ格納点としてのリーフを分岐して得た新
規リーフに上記データを格納する符号木新規登録過程
と、 上記の入力データと文脈との組み合わせが上記文脈木保
持過程に保持されていないとき文脈を変更する文脈変更
過程と、 上記符号木の頂点から上記の入力データあるいは上記符
号木中の特定コードが登録してあるリーフまでの分岐に
従って符号を出力する符号出力過程と上記の入力データ
あるいは符号木中の特定コードが登録してあるリーフと
他のリーフあるいは上記符号木の頂点以外の分岐点とし
て定義されるノードとを取り替える符号長変更過程とを
有し、 上記符号木新規登録過程では、上記特定コードを登録し
てあるリーフを分岐し、得た2つの新規リーフに上記の
特定コードと新規データとを登録することを特徴とす
る、データ圧縮方法。
1. A data compression method for encoding and compressing input data in accordance with a history that has appeared in the past, wherein a context tree in which a combination of input data and a context consisting of n consecutive data is registered. A context tree holding process for holding; a code tree holding process for holding a code tree independent for each context; and a case where the combination of the input data and the context is not held in the context tree holding process. A context tree new registration step of newly registering the data in the context tree of the holding step; and a code tree of the code tree holding step when the combination of the input data and the context is not held in the context tree holding step. A code tree new registration step of storing the above data in a new leaf obtained by branching a leaf as a data storage point of the above; A context changing step of changing a context when not held in a holding step; and a code for outputting a code according to a branch from a vertex of the code tree to a leaf in which the input data or a specific code in the code tree is registered. An output step and a code length changing step of replacing a leaf in which a specific code in the input data or the code tree is registered with a node defined as a branch point other than the vertex of another leaf or the code tree. In the code tree new registration step, 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, comprising: a code tree holding step of holding a code tree in which an escape code defined in advance as data indicating unregistration is registered And a context tree holding process for holding a context tree in which a combination of input data and a context consisting of n consecutive data items is registered. The combination of the input data and the context is a context tree holding process. When not held, when a context tree new registration process of newly registering the data in the context tree of the context tree holding process, and when the combination of the input data and the context is not held in the context tree holding process A code tree new registration step of storing the data in a new leaf obtained by branching a leaf as a code tree data storage point in the code tree holding step; A context change process for changing the context when the combination of the input data and the context is not held in the context tree holding process; and a process from the top of the code tree to the leaf where the input data or the escape code is registered. A code output process of outputting a code according to a branch, and a code length changing process of replacing a leaf in which the input data or the escape code is registered with a node defined as a branch point other than a vertex of another leaf or the code tree. In the code tree new registration step, 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 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.
3. 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 step, among the leaves under the same context, the last registered leaf is branched, and the two new leaves obtained include the data stored in the branched leaf. 3. The data compression method according to claim 2, wherein new data and new data are registered.
【請求項5】 入力データを過去の入力データの履歴に
応じて符号化した符号を復号するデータ復元方法におい
て、 復号したデータと文脈との組み合わせを登録した文脈木
を保持する文脈木保持過程と文脈に応じておのおの独立
した符号木を保持する符号木保持過程と、 直前までに復号したデータから上記符号の符号木を決定
する符号木決定過程と、 上記符号に従って上記符号木の頂点を意味するルートか
らデータ格納点としてのリーフへと走査して符号を復号
する復号過程と、 到達したリーフが符号木中の特定コードであった場合、
文脈を変更する文脈変更過程と、 復号したデータ及び上記特定コードのリーフを他のリー
フあるいは分岐点としてのノードと組み替える符号長変
更過程と、 上記特定コードを復号したとき符号木に復号したデータ
を新規に登録する新規登録過程と、 上記新規登録過程で登録したデータを上記文脈木保持過
程の文脈木に登録する文脈木登録過程とを有し、 上記新規登録過程では符号化側で分岐に選択したリーフ
と同じリーフを分岐して新規データを登録することを特
徴とする、データ復元方法。
5. A data restoration method for decoding a code obtained by encoding input data according to a history of past input data, comprising: a context tree holding step of holding a context tree in which a combination of the decoded data and a context is registered; A code tree holding step of holding an independent code tree according to a context; a code tree determining step of determining a code tree of the code from data decoded immediately before; and a vertex of the code tree according to the code A decoding process in which a code is decoded by scanning from the root to a leaf as a data storage point, and when the reached leaf is a specific code in a code tree,
A context change step of changing a context; a code length change step of rearranging the decoded data and the leaf of the specific code with another leaf or a node as a branch point; and decoding the data decoded into a code tree when the specific code is decoded. A new registration step of newly registering, and a context tree registration step of registering data registered in the new registration step in a context tree of the context tree holding step, wherein the encoding side selects a branch in the new registration step. A data restoring method, characterized in that the same leaf as the extracted leaf is branched and new data is registered.
【請求項6】 入力データを過去の入力データの履歴に
応じて符号化した符号を復号するデータ復元方法におい
て、 予めデータ未登録を示すデータとして定義されるエスケ
ープコードを登録した符号木を保持する符号木保持過程
と、 復号したデータと文脈との組み合わせを登録した文脈木
を保持する文脈木保持過程と、 直前までに復号したデータから上記符号の符号木を決定
する符号木決定過程と、 上記符号に従って上記符号木の頂点を意味するルートか
らデータ格納点としてのリーフへと走査して符号を復号
する復号過程と、 到達したリーフが上記エスケープコードであった場合、
文脈を変更する文脈変更過程と、 復号したデータ及び上記エスケープコードのリーフを他
のリーフあるいは分岐点としてのノードと組み替える符
号長変更過程と、 上記エスケープコードを復号したとき符号木に復号した
データを新規に登録する新規登録過程と、 上記新規登録過程で登録したデータを上記文脈木保持過
程の文脈木に登録する文脈木登録過程とを有し、 上記新規登録過程では符号化側で分岐に選択したリーフ
と同じリーフを分岐して新規データを登録することを特
徴とする、データ復元方法。
6. A data restoration method for decoding a code obtained by encoding input data according to a history of past input data, wherein a code tree in which an escape code defined in advance as data indicating that data has not been registered is stored. A code tree holding step, a context tree holding step of holding a context tree in which a combination of decoded data and a context is registered, a code tree determining step of determining a code tree of the code from data decoded immediately before, A decoding process of scanning the root of the code tree according to the code from the root meaning the vertex to the leaf as the data storage point to decode the code, and when the reached leaf is the escape code,
A context change step of changing a context, a code length change step of rearranging the decoded data and the escape code leaf with another leaf or a node as a branch point, and a data tree decoded when the escape code is decoded. A new registration step of newly registering, and a context tree registration step of registering data registered in the new registration step in a context tree of the context tree holding step, wherein the encoding side selects a branch in the new registration step. A data restoring method, characterized in that the same leaf as the extracted leaf is branched and new data is registered.
【請求項7】 入力データを過去に出現した履歴に応じ
て符号化するデータ圧縮装置において、 予めデータ未登録を示すデータとして定義されるエスケ
ープコードを登録した符号木を保持する符号木保持手段
と、 入力データと文脈との組み合わせを登録した文脈木を保
持する文脈木保持手段と、 上記エスケープコードを符号化したのち、上記文脈木に
上記データを新規に登録する文脈登録手段と、 上記エスケープコードを符号化したのち符号木の上記エ
スケープコードのデータ格納点としてのリーフを分岐し
て上記データを新規に登録する符号登録手段と、 上記の入力データと文脈との組み合わせが文脈木に保持
されていないとき、文脈を変更する文脈変更手段と、 符号木の頂点から上記の入力データあるいはエスケープ
コードが登録してあるリーフまでの分岐に従って符号を
出力する符号化手段と、 符号化したデータ及び上記エスケープコードが登録して
あるリーフと他のリーフあるいはノードとを取り替える
符号更新手段とをそなえて構成されたことを特徴とす
る、データ圧縮装置。
7. A data compression apparatus for encoding input data in accordance with a history of past occurrences, comprising: a code tree holding means for holding a code tree in which an escape code defined in advance as data indicating unregistered data is registered. 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; Code registration means for branching a leaf as a data storage point of the escape code and then registering the new data, and a combination of the input data and the context is stored in a context tree. When there is no context change means for changing the context, the above input data or escape code is registered from the top of the code tree. Encoding means for outputting a code according to a branch to a certain leaf, and code updating means for replacing the leaf in which the encoded data and the escape code are registered with another leaf or node. Characteristic data compression device.
【請求項8】 入力データを過去に出現した履歴に応じ
て符号化するデータ圧縮装置において、 予めデータ未登録を示すデータとして定義されるエスケ
ープコードを登録した符号木を保持する符号木保持手段
と、 入力データと文脈との組み合わせを登録した文脈木を保
持する文脈木保持手段と、 上記エスケープコードを符号化したのち、文脈木に上記
データを新規に登録する文脈登録手段と、 上記符号木上の最長の符号長を持つリーフを検索する分
岐位置検索手段と、 上記エスケープコードを符号化したのち、上記分岐位置
検索手段に検索されたデータ格納点としてのリーフを分
岐して上記データを新規に登録する符号登録手段と、 上記の入力データと文脈との組み合わせが文脈木に保持
されていないとき文脈を変更する文脈変更手段と、 符号木の頂点から入力データあるいは上記エスケープコ
ードが登録してあるリーフまでの分岐に従って符号を出
力する符号化手段と、 符号化したデータ及び上記エスケープコードが登録して
あるリーフと他のリーフあるいはノードとを取り替える
符号更新手段とをそなえて構成されたことを特徴とす
る、データ圧縮装置。
8. A data compression apparatus for encoding input data in accordance with a history of past appearances, comprising: a code tree holding means for holding a code tree in which an escape code defined in advance as data indicating data not registered is registered. A context tree holding unit that holds a context tree in which a combination of input data and a context is registered; a context registration unit that newly registers the data in the context tree after encoding the escape code; Branch position searching means for searching for a leaf having the longest code length of the above, and after encoding the escape code, the branch as a data storage point searched by the branch position searching means is branched to newly store the data. Code registering 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 the top of the code tree to the input data or the 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 data.
【請求項9】 入力データを過去に出現した履歴に応じ
て符号化するデータ圧縮装置において、 予めデータ未登録を示すデータとして定義されるエスケ
ープコードを登録した符号木を保持する符号木保持手段
と、 入力データと文脈との組み合わせを登録した文脈木を保
持する文脈木保持手段と、 上記エスケープコードを符号化したのち、文脈木に上記
データを新規に登録する文脈登録手段と、 上記符号木に新規に登録されたデータ格納点としてのリ
ーフの位置を保持する分岐位置保持手段と、 上記エスケープコードを符号化したのち、上記分岐位置
保持手段に保持されている位置にあるリーフを分岐して
上記データを新規に登録する符号登録手段と、 上記の入力データと文脈との組み合わせが文脈木に保持
されていないとき分脈を変更する文脈変更手段と、 符号木の頂点から入力データあるいは上記エスケープコ
ードが登録してあるリーフまでの分岐に従って符号を出
力する符号化手段と、 符号化したデータ及び上記エスケープコードが登録して
あるリーフと他のリーフあるいは分岐点としてのノード
とを取り替える符号更新手段とをそなえて構成されたこ
とを特徴とする、データ圧縮装置。
9. A data compression apparatus for encoding input data according to a history of past appearances, comprising: a code tree holding means for holding a code tree in which an escape code defined in advance as data indicating data not registered is registered. 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; 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 to Code registering means for newly registering data, and changing the context when the combination of the input data and the context is not stored in the context tree A context changing unit; an encoding unit that outputs a code according to a branch from a vertex of the code tree to the input data or the leaf in which the escape code is registered; and a leaf in which the encoded data and the escape code are registered. A data compression device comprising code updating means for replacing a node as another leaf or a node as a branch point.
【請求項10】 入力データを過去の入力データの履歴
に応じて符号化した符号を復号するデータ復元装置にお
いて、 予めデータ未登録を示すデータとして定義されるエスケ
ープコードを登録した符号木を保持する符号木保持手段
と、 復号したデータと文脈との組み合わせを登録した文脈木
を保持する文脈木保持手段と、 直前までに復号したデータから上記符号の符号木を決定
する符号木決定手段と、 上記符号に従って上記符号木の頂点を意味するルートか
らデータ格納点としてのリーフへと走査して符号を復号
する復号手段と、 到達したリーフが上記エスケープコードであった場合、
文脈を変更する文脈変更手段と、 復号したデータ及び上記エスケープコードのリーフを他
のリーフあるいは分岐点としてのノードと組み替える符
号更新手段と、 上記エスケープコードを復号したとき、上記エスケープ
コードのリーフを分岐して復号したデータを新規に登録
する符号登録手段と、 上記符号登録手段で登録したデータを文脈木保持手段の
文脈木に登録する文脈木登録手段とをそなえて構成され
たことを特徴とする、データ復元装置。
10. A data restoration device for decoding a code obtained by encoding input data according to a history of past input data, wherein a code tree in which an escape code defined in advance as data indicating data not registered is stored. 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 a code tree of the code from data decoded immediately before; Decoding means for scanning from the root meaning the vertex of the code tree to the leaf as the data storage point according to the code to decode the code, and when the reached leaf is the escape code,
Context changing means for changing the context; code updating means for changing the decoded data and the escape code leaf to another leaf or a node as a branch point; branching the escape code leaf when decoding the escape code Code registration means for newly registering the decoded data, and 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 restoration device.
【請求項11】 入力データを過去の入力データの履歴
に応じて符号化した符号を復号するデータ復元装置にお
いて、 予めデータ未登録を示すデータとして定義されるエスケ
ープコードを登録した符号木を保持する符号木保持手段
と、 復号したデータと文脈との組み合わせを登録した文脈木
を保持する文脈木保持手段と、 直前までに復号したデータから上記符号の符号木を決定
する符号木決定手段と、 上記符号に従って上記符号木の頂点を意味するルートか
らデータ格納点としてのリーフへと走査して符号を復号
する復号手段と、 到達したリーフが上記エスケープコードであった場合、
文脈を変更する文脈変更手段と、 復号したデータ及び上記エスケープコードのリーフを他
のリーフあるいは分岐点としてのノードと組み替える符
号更新手段と、 上記符号木内の最長の符号長を持つリーフの位置を検索
する分岐位置検索手段と、 上記エスケープコードを符号化したのち上記分岐位置検
索手段で検索されたリーフを分岐して上記データを新規
に登録する符号登録手段と、 上記符号登録手段で登録したデータを文脈木保持手段の
文脈木に登録する文脈木登録手段とをそなえて構成され
たことを特徴とする、データ復元装置。
11. A data restoration apparatus for decoding a code obtained by encoding input data in accordance with a history of past input data, wherein a code tree in which an escape code defined in advance as data indicating data not registered is stored. 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 a code tree of the code from data decoded immediately before; Decoding means for scanning from the root meaning the vertex of the code tree to the leaf as the data storage point according to the code to decode the code, and when the reached leaf is the escape code,
Context changing means for changing the context; code updating means for changing the decoded data and the escape code leaf to another leaf or a node as a branch point; searching for the position of the leaf having the longest code length in the code tree Branch position searching means, a code registering means for encoding the escape code, branching the leaf searched by the branch position searching means and newly registering the data, A data restoration apparatus characterized by comprising context tree registration means for registering in a context tree of a context tree holding means.
【請求項12】 入力データを過去の入力データの履歴
に応じて符号化した符号を復号するデータ復元装置にお
いて、 予めデータ未登録を示すデータとして定義されるエスケ
ープコードを登録した符号木を保持する符号木保持手段
と、 復号したデータと文脈との組み合わせを登録した文脈木
を保持する文脈木保持手段と、 直前までに復号したデータから上記符号の符号木を決定
する符号木決定手段と、 上記符号に従って上記符号木の頂点を意味するルートか
らデータ格納点としてのリーフへと走査して符号を復号
する復号手段と、 到達したリーフが上記エスケープコードであった場合、
文脈を変更する文脈変更手段と、 復号したデータ及び上記エスケープコードのリーフを他
のリーフあるいは分岐点としてのノードと組み替える符
号更新手段と、 上記符号木に新規に登録されたリーフの位置を保持する
分岐位置保持手段と、 上記エスケープコードを符号化したのち、上記分岐位置
保持手段に保持されている位置にあるリーフを分岐して
上記データを新規に登録する符号登録手段と、 上記符号登録手段で登録したデータを文脈木保持手段の
文脈木に登録する文脈木登録手段とをそなえて構成され
たことを特徴とする、データ復元装置。
12. A data restoration apparatus for decoding a code obtained by encoding input data in accordance with a history of past input data, wherein a code tree in which an escape code defined in advance as data indicating that data has not been registered is stored. 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 a code tree of the code from data decoded immediately before; Decoding means for scanning from the root meaning the vertex of the code tree to the leaf as the data storage point according to the code to decode the code, and when the reached leaf is the escape code,
Context changing means for changing the context; code updating means for assembling the decoded data and the escape code leaf with another leaf or a node as a branch point; holding the position of a leaf newly registered in the code tree Branch position holding means, code encoding means for encoding the escape code, branching a leaf at a position held in the branch position holding means, and registering the data newly, and the code registration means A data restoration device comprising a context tree registration unit for registering registered data in a context tree of a context tree holding unit.
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 true JP2002232298A (en) 2002-08-16
JP3425143B2 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010093414A (en) * 2008-10-06 2010-04-22 Fujitsu Ltd Program, apparatus and method for processing information
JP2016034158A (en) * 2015-12-07 2016-03-10 富士通株式会社 Program for code processing, and data structure
EP4087249A4 (en) * 2019-12-31 2023-06-28 ZTE Corporation Character restoration method and apparatus, storage medium, and electronic device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010093414A (en) * 2008-10-06 2010-04-22 Fujitsu Ltd Program, apparatus and method for processing information
JP2016034158A (en) * 2015-12-07 2016-03-10 富士通株式会社 Program for code processing, and data structure
EP4087249A4 (en) * 2019-12-31 2023-06-28 ZTE Corporation Character restoration method and apparatus, storage medium, and electronic device
US11902522B2 (en) 2019-12-31 2024-02-13 Zte Corporation Character restoration method and apparatus, storage medium, and electronic device

Also Published As

Publication number Publication date
JP3425143B2 (en) 2003-07-07

Similar Documents

Publication Publication Date Title
JP3278297B2 (en) Data compression method, data decompression method, data compression device, and data decompression device
US4814746A (en) Data compression method
US7190287B2 (en) Method of generating Huffman code length information
US7071853B2 (en) Method of compressing data packets
US7064489B2 (en) Huffman data compression method
JP3258552B2 (en) Data compression device and data decompression device
US6982661B2 (en) Method of performing huffman decoding
JPH07160473A (en) Method and apparatus for compression of byte-aligned data
JPH09162748A (en) Data encoding method, data decoding method, data compressor, data restoring device and data compression/ restoration system
US5353024A (en) Method for data compression having an improved encoding algorithm which utilizes a token stacking technique
US5585793A (en) Order preserving data translation
EP0127815B1 (en) Data compression method
Arnavut Inversion coding
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
Mitzenmacher On the hardness of finding optimal multiple preset dictionaries
JPH0628149A (en) Method for compressing plural kinds of data
JPH1155125A (en) Method for compressing and restoring character data
JPH06274311A (en) Data compression device and data restoration device
中村博文 Data Compression by Replacement of Symbol Pairs and Its Implementation
Mukherjee et al. Text compression
Pannirselvam et al. A Comparative Analysis on Different Techniques in Text Compression
Choi Comparison of Methods for Text Compression
Bell Data compression
Aziz et al. A Comparision between Coding Methods in Data Compression with A Proposed Method

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