JP2001136075A - Data compression/decompression device and storage medium with data compression/decompression program recorded thereon - Google Patents

Data compression/decompression device and storage medium with data compression/decompression program recorded thereon

Info

Publication number
JP2001136075A
JP2001136075A JP31571299A JP31571299A JP2001136075A JP 2001136075 A JP2001136075 A JP 2001136075A JP 31571299 A JP31571299 A JP 31571299A JP 31571299 A JP31571299 A JP 31571299A JP 2001136075 A JP2001136075 A JP 2001136075A
Authority
JP
Japan
Prior art keywords
code
character
data
rank
distribution
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.)
Withdrawn
Application number
JP31571299A
Other languages
Japanese (ja)
Inventor
Nobuko Sato
宣子 佐藤
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 JP31571299A priority Critical patent/JP2001136075A/en
Publication of JP2001136075A publication Critical patent/JP2001136075A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a data compression device that encodes a data sequence while dynamically reassembling a code tree and maintaining advantages through the use of the code tree provided with regularity. SOLUTION: The data compression device that receives data of a compression object as a character string consisting of characters expressed in a bit string of a prescribed length and encodes the data by assigning a variable length code to each character, is provided with a distribution table storage means 111 that stores a code length distribution table denoting a distribution of code lengths of codes included in a code table used for generating a canonical Huffman code, a sequence storage means 112 that stores the sequence on the basis of information corresponding to an appearance probability of each character in the data, a 1st code generating means 113 that encodes each character based on the code length distribution table and the sequence of each character, a sequence update means 114 that updates its sequence in response to the entry of the character string, and a distribution table update means 115 that updates the code length distribution table stored in the distribution table storage means 111.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、確率統計型符号化
方式の一つであるキャノニカルハフマン符号化方式(Ca
nonical Huffman codes:"MANAGING GIGABYTES" 9章、I
an H. Witten et.al,New York. Van Nostrand Reinhol
d)を用いたデータ圧縮/復元装置ならびにデータ圧縮
/復元プログラムを記録した記憶媒体に関するものであ
る。本明細書において、符号化対象としての文字とは、
データ系列を圧縮符号化する際の符号化単位である所定
長のビット列に対応するシンボルとしての文字である。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a canonical Huffman coding method (Ca
nonical Huffman codes: "MANAGING GIGABYTES" Chapter 9, I
an H. Witten et.al, New York. Van Nostrand Reinhol
The present invention relates to a data compression / decompression device using d) and a storage medium storing a data compression / decompression program. In this specification, the character to be encoded is
This is a character as a symbol corresponding to a bit string of a predetermined length, which is a coding unit when a data sequence is compression-coded.

【0002】[0002]

【従来の技術】ハフマン符号は、確率統計方符号化方式
の代表例であり、動的ハフマン符号と静的ハフマン符号
とに大きく分けられる。動的ハフマン符号は、圧縮対象
のデータ系列の入力に応じて符号表を更新することによ
り、各文字の出現頻度の変化を符号表に動的に反映しな
がら符号化する符号化方式である("Dynamic Huffman C
oding" Donald E. Knuth著 Journal ofAlgorithms Vo
l.6 P163-180参照)。
2. Description of the Related Art A Huffman code is a representative example of a probability statistical coding method, and is roughly divided into a dynamic Huffman code and a static Huffman code. The dynamic Huffman code is a coding method for updating a code table according to an input of a data sequence to be compressed, thereby dynamically changing the appearance frequency of each character while reflecting the change in the code table ( "Dynamic Huffman C
oding "by Donald E. Knuth Journal of Algorithms Vo
l.6 See pages 163-180).

【0003】動的ハフマン符号化方式で用いられる符号
木では、符号木の各葉に各文字が割り当てられ、根から
葉までの経路が符号となっており、最も出現頻度の高い
文字にもっとも短い符号が割り当てられるように、後述
する更新処理が行われる。図18(a)に示すように、
この符号木は、各葉ごとに割り当てられた文字(図にお
いて、符号a〜符号hで示す)の出現頻度に相当する情
報(例えば出現度数)を保持しており、また、各節点に
対応してそれぞれの子供の節点の出現度数の合計を保持
し、符号木の左上に行くにしたがってこの合計値が大き
くなっている。
In the code tree used in the dynamic Huffman coding method, each character is assigned to each leaf of the code tree, and the path from the root to the leaf is a code. Update processing described later is performed so that codes are assigned. As shown in FIG.
This code tree holds information (for example, frequency of appearance) corresponding to the frequency of appearance of characters (indicated by the symbols a to h in the figure) assigned to each leaf, and also corresponds to each node. Thus, the total number of occurrences of the nodes of each child is held, and the total value increases toward the upper left of the code tree.

【0004】例えば、図18(a)に示した左側の符号
木が得られているときに、文字dが出現すると、この文
字dに対応する葉について保持された出現度数が数値
「6」となることから、文字aおよび文字bに対応する
葉を子供として持つ節点と上述した文字dに対応する葉
との入れ替えが起きる。また、これに伴って、文字dに
対応する葉から遡って、根に到達するまでの経路にあた
る各節点に対応して保持された合計値にそれぞれ数値
「1」ずつが加算され、結果として、図18(a)の右
側に示す符号木が得られる。
For example, when a character d appears when the code tree on the left side shown in FIG. 18A is obtained, the appearance frequency held for the leaf corresponding to the character d becomes a numerical value "6". Therefore, the node having the leaves corresponding to the characters a and b as children is replaced with the leaves corresponding to the character d described above. Accordingly, the numerical value “1” is added to each of the total values held corresponding to the nodes that correspond to the route from the leaf corresponding to the character d to the root, and as a result, The code tree shown on the right side of FIG. 18A is obtained.

【0005】動的ハフマン符号における符号木の組換え
処理を簡略化する技法として、情報検索の分野で用いら
れるスプレイ技術を利用するスプレイ符号が提案されて
いる。
[0005] As a technique for simplifying the recombining process of the code tree in the dynamic Huffman code, a spray code using a spray technique used in the field of information retrieval has been proposed.

【0006】スプレイ符号化方式は、文字の出現に応じ
て、その符号の符号長を半分にする操作を行うことによ
り、文字の出現頻度分布を符号長分布に反映している。
例えば、図18(b)の左側に示すように、各葉に、文
字A〜文字Hが割り当てられた符号木が得られていると
きに、文字Eが出現すると、まず、文字Eおよび文字F
を子供とする節点と文字Gに対応する葉との入れ替えが
起こる。更に、これらの文字を含む枝に連なる節点と文
字A、B、Cを含む枝に連なる節点との入れ替えが起こ
って、結果として、図18(b)の右側に示すような符
号木が得られる。
In the splay coding method, the character frequency distribution is reflected in the code length distribution by performing an operation of halving the code length of the code according to the appearance of the character.
For example, as shown on the left side of FIG. 18B, when a character E appears when a code tree in which characters A to H are assigned to each leaf is obtained, first, the characters E and F
Is replaced with the leaf corresponding to the letter G. Further, the nodes connected to the branch including these characters and the nodes connected to the branches including the characters A, B, and C are interchanged, and as a result, a code tree as shown on the right side of FIG. 18B is obtained. .

【0007】このように、動的ハフマン符号化方式は、
データ系列の統計的な性質に基づいて、最適な符号表を
用いて符号化することが可能であり、また、復元側に符
号表を送付する必要もないので、非常に高い圧縮率が期
待できる。一方、静的ハフマン符号は、データ系列の最
初から最後まで同一の符号表を用いて符号化する方式で
ある。
As described above, the dynamic Huffman coding method is
Based on the statistical properties of the data series, it is possible to perform encoding using the optimal code table, and there is no need to send the code table to the decompression side, so a very high compression rate can be expected. . On the other hand, the static Huffman code is a method of encoding from the beginning to the end of a data sequence using the same code table.

【0008】キャノニカルハフマン符号化方式は、静的
ハフマン符号化方式の一つであり、図19(a)に示す
ように、符号木の右側に行くほど符号長が長くなるよう
に整形された符号木を用いて、符号化を行う方式であ
る。上述した規則に従って符号木を整形することによ
り、図19(b)に示すような各符号長が割り当てられ
た文字数の分布(以下、符号長分布と称する)によっ
て、図19(a)に示した木構造を一意に特定可能と
し、また、各文字に割り当てられた順位から一意に符号
を表すビットパターンを求めることが可能となる。
The canonical Huffman coding method is one of the static Huffman coding methods, and as shown in FIG. 19 (a), is shaped such that the code length becomes longer toward the right side of the code tree. In this method, encoding is performed using a code tree. By shaping the code tree in accordance with the rules described above, the distribution of the number of characters to which each code length is assigned as shown in FIG. 19B (hereinafter referred to as a code length distribution) is shown in FIG. 19A. The tree structure can be uniquely specified, and a bit pattern uniquely representing a code can be obtained from the order assigned to each character.

【0009】例えば、図19(a)に示すように、文字
a〜文字hが符号木の各葉に割り当てられている場合
に、これらの文字a〜文字hに対応する符号のビットパ
ターンは、それぞれの文字に与えられた順位に基づい
て、対応する符号の符号長およびその符号長における順
位を求め、該当する符号長について決められた第1コー
ド(first code)を表すビットパターンに上述した符号長
における順位を示すビットパターンを加算することによ
って得ることができる(図19(c)参照)。
For example, as shown in FIG. 19A, when characters a to h are assigned to each leaf of the code tree, the bit patterns of the codes corresponding to these characters a to h are: Based on the order given to each character, the code length of the corresponding code and the order in the code length are obtained, and the above-described code is added to the bit pattern representing the first code determined for the corresponding code length. It can be obtained by adding a bit pattern indicating the order in the length (see FIG. 19C).

【0010】[0010]

【発明が解決しようとする課題】動的ハフマン符号化方
式は、上述したように、非常に高い圧縮率が期待できる
反面、符号木の組換え処理が必要であり、また、符号化
および復号化を行うためには、逐次に変化する木構造を
順次にたどる必要があるので、符号化処理および復元処
理に時間がかかる。
As described above, the dynamic Huffman coding system can expect a very high compression ratio, but requires a code tree recombining process, and also requires encoding and decoding. , It is necessary to sequentially follow a sequentially changing tree structure, so that the encoding process and the restoration process take time.

【0011】一方、キャノニカルハフマン符号化方式
は、符号化処理および復元処理が簡略であり、また、符
号表として保持しておくべき情報量も少ないので、性能
に制限のあるパーソナルコンピュータなどにおいても容
易に実装可能である。その反面、データ系列の統計的な
性質の変化に追従することは原理的に不可能であり、ま
た、符号表に相当する情報を符号化データに付加する必
要があるため、動的ハフマン符号化方式で得られるよう
な高い圧縮率を期待することはできない。
On the other hand, in the canonical Huffman coding method, the coding process and the restoration process are simple, and the amount of information to be stored as a code table is small. It can be easily implemented. On the other hand, it is theoretically impossible to follow changes in the statistical properties of the data series, and it is necessary to add information equivalent to a code table to the encoded data. One cannot expect a high compression ratio as can be obtained with the scheme.

【0012】本発明は、規則性を備えた符号木を用いる
ことによる利点を維持しつつ、動的に符号木を組み替え
ながらデータ系列を符号化し、また得られた符号列を復
元するためのデータ圧縮装置およびデータ復元装置およ
びデータ圧縮/復元プログラムを記録した記憶媒体を提
供することを目的とする。
The present invention maintains the advantages of using a code tree having regularity, encodes a data sequence while dynamically rearranging the code tree, and restores a data sequence obtained from the data sequence. An object of the present invention is to provide a compression device, a data decompression device, and a storage medium on which a data compression / decompression program is recorded.

【0013】[0013]

【課題を解決するための手段】図1に、請求項1乃至請
求項5に記載の発明の原理ブロック図を示す。
FIG. 1 is a block diagram showing the principle of the first to fifth aspects of the present invention.

【0014】請求項1の発明は、圧縮対象のデータを所
定長のビット列で表される文字からなる文字列として受
け取り、各文字に可変長符号を割り当てることによって
符号化するデータ圧縮装置において、キャノニカルハフ
マン符号を生成するための符号表に含まれる符号の符号
長の分布を示す符号長分布表を保持する分布表保持手段
111と、データにおける各文字の出現確率に相当する
情報に基づく順位を保持する順位保持手段112と、文
字列を構成する各文字を符号長分布表と順位保持手段1
12に保持された各文字の順位とに基づいて符号化し、
各文字に対応する符号からなる符号列を出力する第1符
号生成手段113と、文字列の入力に応じて、文字列を
構成する各文字について順位保持手段112に保持され
た順位を更新する順位更新手段114と、文字列を構成
する各文字の入力に応じて、分布表保持手段111に保
持された符号長分布表を更新する分布表更新手段115
とを備えたことを特徴とする。
According to a first aspect of the present invention, there is provided a data compression apparatus for receiving data to be compressed as a character string composed of characters represented by a bit string of a predetermined length and encoding the characters by assigning a variable length code to each character. A distribution table holding unit 111 for holding a code length distribution table indicating a distribution of code lengths of codes included in a code table for generating a Nikal Huffman code; and a rank based on information corresponding to an appearance probability of each character in data. The order holding means 112 for holding, and the code length distribution table and the order holding means 1 for each character constituting the character string.
12 based on the order of each character held in
First code generating means 113 for outputting a code string composed of codes corresponding to the characters, and a rank for updating the rank held in the rank holding means 112 for each character constituting the character string according to the input of the character string Update means 114 and distribution table updating means 115 for updating the code length distribution table held in distribution table holding means 111 in response to the input of each character constituting the character string.
And characterized in that:

【0015】請求項1の発明は、入力文字に応じて順位
更新手段114と分布表更新手段115とが動作するこ
とにより、データにおける各文字の出現確率に相当する
情報に関する分布の変化を順位保持手段112に保持さ
れた順位リストおよび分布表保持手段111に保持され
た符号長分布表に反映し、第1符号生成手段113によ
る以降の符号化処理に供することができる。
According to the first aspect of the present invention, the order updating means 114 and the distribution table updating means 115 operate in accordance with the input character, so that a change in distribution related to information corresponding to the appearance probability of each character in the data is held in order. The data can be reflected in the ranking list held by the means 112 and the code length distribution table held by the distribution table holding means 111 and can be used for the subsequent encoding processing by the first code generation means 113.

【0016】これにより、キャノニカルハフマン符号の
規則性を維持しつつ、符号化処理に用いる符号表を動的
に組替えることが可能となる。請求項2の発明は、所定
長のビット列で表される文字ごとに可変長符号を割り当
てることによって符号化された符号列から元のデータを
復元するデータ復元装置において、キャノニカルハフマ
ン符号を生成するための符号表に含まれる各符号の符号
長の分布を示す符号長分布表を保持する分布表保持手段
111と、データにおける各文字の出現確率に相当する
情報に基づく順位を保持する順位保持手段112と、符
号列の入力に応じて、符号長分布表によって特定される
符号表と順位保持手段112に保持された各文字の順位
とに基づいて、符号列を構成する各符号に対応する文字
を復元し、これらの文字からなる文字列を出力する第1
データ復元手段116と、文字列の入力に応じて、文字
列を構成する各文字について順位保持手段112に保持
された順位を更新する順位更新手段114と、文字列を
構成する各文字の入力に応じて、分布表保持手段111
に保持された符号長分布表を更新する分布表更新手段1
15とを備えたことを特徴とする。
This makes it possible to dynamically rearrange the code table used for the encoding process while maintaining the regularity of the canonical Huffman code. According to a second aspect of the present invention, in a data restoration apparatus for restoring original data from an encoded code string by assigning a variable length code to each character represented by a bit string of a predetermined length, a canonical Huffman code is generated. Table holding means 111 for holding a code length distribution table showing the code length distribution of each code included in the code table for ordering, and rank holding means for holding a rank based on information corresponding to the appearance probability of each character in the data Based on the code table 112 and the code table specified by the code length distribution table in accordance with the input of the code string and the rank of each character held in the rank holding unit 112, the character corresponding to each code constituting the code string To output a string consisting of these characters
A data restoring unit 116, a rank updating unit 114 for updating the rank held in the rank holding unit 112 for each character forming the character string in response to the input of the character string, and a Accordingly, distribution table holding means 111
Table updating means 1 for updating the code length distribution table held in
15 is provided.

【0017】請求項2の発明は、第1データ復元手段1
16によって復元された文字に応じて、順位更新手段1
14と分布表更新手段115とが動作することにより、
データにおける各文字の出現確率に相当する情報に関す
る分布の変化を順位保持手段112に保持された順位リ
ストおよび分布表保持手段111に保持された符号長分
布表に反映し、第1データ復元手段116による以降の
データ復元処理に供することができる。
According to a second aspect of the present invention, the first data restoration means 1
16 according to the character restored by
14 and the distribution table updating means 115 operate,
The change in distribution of information corresponding to the appearance probability of each character in the data is reflected in the rank list held in the rank holding means 112 and the code length distribution table held in the distribution table holding means 111, and the first data restoration means 116 For subsequent data restoration processing.

【0018】これにより、キャノニカルハフマン符号の
規則性を維持しつつ、データ復元処理に用いる符号表を
動的に組替えることが可能となる。請求項3の発明は、
請求項1に記載のデータ圧縮装置または請求項2に記載
のデータ復元装置において、分布表更新手段115は、
符号表に相当する符号木において、出現確率の総和が1
/2であって注目文字に対応する符号に連なる枝を含ま
ない部分についての符号長分布を示す第1分布と、符号
木の他の部分において、出現確率の総和が1/4であっ
て注目文字に対応する符号を含まない部分についての符
号長分布を示す第2分布と、出現確率の総和が1/4で
あって注目文字に対応する符号を含む部分についての符
号長分布を示す第3分布とに、符号表に対応する符号長
分布表を分割する分割手段121と、第1分布に含まれ
る各符号の符号長を所定値だけ伸長し、第3分布に含ま
れる各符号の符号長を所定値だけ短縮する変更手段12
2と、変更手段122によって変更された第1分布およ
び第3分布と第2分布とを合成し、新しい符号長分布表
として分布表保持手段111に保持する合成手段123
とを備えた構成であることを特徴とする。
Thus, it is possible to dynamically rearrange the code table used for the data restoration processing while maintaining the regularity of the canonical Huffman code. The invention of claim 3 is
In the data compression device according to claim 1 or the data restoration device according to claim 2, the distribution table updating unit 115 includes:
In the code tree corresponding to the code table, the sum of the appearance probabilities is 1
/ 2, where the sum of the appearance probabilities is 1 / in the first distribution indicating the code length distribution of the portion that does not include a branch connected to the code corresponding to the character of interest, and in the other portion of the code tree. A second distribution indicating a code length distribution for a portion not including a code corresponding to a character, and a third distribution indicating a code length distribution for a portion including a code corresponding to a character of interest with a total appearance probability of 1/4. A dividing means 121 for dividing a code length distribution table corresponding to the code table into a distribution, a code length of each code included in the first distribution, and a code length of each code included in the third distribution. Changing means 12 for shortening by a predetermined value
2 and the combination of the first distribution, the third distribution, and the second distribution changed by the changing unit 122, and storing the new distribution in the distribution table holding unit 111 as a new code length distribution table.
And a configuration comprising:

【0019】請求項3の発明は、分割手段121による
分割処理によって得られた第1分布、第2分布および第
3分布について、変更手段122によりそれぞれ符号長
を変更し、合成手段123によって一つの符号長分布表
に合成することにより、圧縮対象のデータにおける各文
字の出現確率に相当する情報に関する偏差を反映した符
号木に対応する符号長分布表を作成し、元の符号長分布
表に代えて分布表保持手段111に保持することができ
る。
According to a third aspect of the present invention, the code length of each of the first distribution, the second distribution, and the third distribution obtained by the dividing process by the dividing unit 121 is changed by the changing unit 122, and one combining unit 123 changes the code length. By combining with the code length distribution table, a code length distribution table corresponding to a code tree reflecting a deviation regarding information corresponding to the appearance probability of each character in the data to be compressed is created, and the original code length distribution table is replaced. Can be held in the distribution table holding means 111.

【0020】請求項4の発明は、請求項3に記載のデー
タ圧縮装置またはデータ復元装置において、分布表更新
手段115は、変更手段122によって符号長を変更さ
れた第3分布に対応する符号木の一部が更に分割可能で
ある場合に、この第3分布を分割対象の符号木を示す符
号長分布表として分割手段121に入力する繰り返し制
御手段124を備えた構成であることを特徴とする。
According to a fourth aspect of the present invention, in the data compression apparatus or the data decompression apparatus according to the third aspect, the distribution table updating means 115 includes a code tree corresponding to the third distribution whose code length has been changed by the changing means 122. Is further provided with a repetition control means 124 for inputting the third distribution to the dividing means 121 as a code length distribution table indicating a code tree to be divided, when the part can be further divided. .

【0021】請求項4の発明は、繰り返し制御手段12
4の動作に応じて、分割手段121および変更手段12
2が繰り返し動作することにより、圧縮対象のデータに
おける文字の出現に応じて、符号長分布表を大幅に変更
することができる。請求項5の発明は、請求項3に記載
のデータ圧縮装置またはデータ復元装置において、分布
表更新手段115は、変更手段122に入力された第1
分布に所定の符号長についての分布が含まれているとき
に、変更手段122による符号長の変更動作を制限する
変更制限手段125を備えた構成であることを特徴とす
る。
According to a fourth aspect of the present invention, the repetition control means
4, the dividing means 121 and the changing means 12
2 repeatedly operates, the code length distribution table can be significantly changed according to the appearance of characters in the data to be compressed. According to a fifth aspect of the present invention, in the data compression apparatus or the data decompression apparatus according to the third aspect, the distribution table updating means 115 receives the first
When the distribution includes a distribution of a predetermined code length, the configuration is provided with a change restricting unit 125 that restricts the changing operation of the code length by the changing unit 122.

【0022】請求項5の発明は、変更制限手段125に
より変更手段122の動作を制限することにより、符号
長分布表の更新処理によって、極端に長い符号が発生す
ることを防ぐことができる。図2に、請求項6のデータ
圧縮装置及び請求項7のデータ復元装置の原理ブロック
図を示す。
According to the fifth aspect of the present invention, by restricting the operation of the changing means 122 by the change restricting means 125, it is possible to prevent an extremely long code from being generated by the update processing of the code length distribution table. FIG. 2 is a block diagram showing the principle of the data compression apparatus according to the sixth aspect and the data decompression apparatus according to the seventh aspect.

【0023】請求項6の発明は、圧縮対象のデータを所
定長のビット列で表される文字からなる文字列として受
け取り、各文字に可変長符号を割り当てることによって
符号化するデータ圧縮装置において、それぞれ相異なる
統計的性質を持つ入力文字列に適合してキャノニカルハ
フマン符号を生成する複数の符号表を符号表候補として
保持する候補保持手段131と、符号表候補のいずれか
を保持している符号表保持手段132と、文字列を構成
する各文字を符号表保持手段132に保持された符号表
に基づいて符号化し、各文字に対応する符号からなる符
号列として出力する第2符号生成手段133と、データ
における各文字の出現確率に相当する情報に基づく順位
を保持する順位保持手段112と、文字列を構成する各
文字の入力に応じて順位保持手段112を参照し、各文
字の順位に基づいて、符号表候補のいずれかを選択して
符号表保持手段132に入力する符号表選択手段134
と、文字列の入力に応じて、文字列を構成する各文字に
ついて順位保持手段112に保持された順位を更新する
順位更新手段114とを備えたことを特徴とする。
According to a sixth aspect of the present invention, there is provided a data compression apparatus which receives data to be compressed as a character string composed of a character represented by a bit string of a predetermined length, and encodes the character by assigning a variable length code to each character. Candidate holding means 131 for holding a plurality of code tables for generating canonical Huffman codes in conformity with input character strings having different statistical properties as code table candidates, and a code for holding any of the code table candidates A table holding unit 132 and a second code generation unit 133 that encodes each of the characters forming the character string based on the code table held in the code table holding unit 132 and outputs the code as a code string including codes corresponding to the characters. And a rank holding unit 112 for holding a rank based on information corresponding to the appearance probability of each character in the data, and a response to input of each character constituting the character string. Referring to rank holding means 112, based on the ranking of each character, code table selection unit 134 to be input to the code-table storage unit 132 by selecting one of the code table candidate
And a rank updating means 114 for updating the rank held in the rank holding means 112 for each character constituting the character string in response to the input of the character string.

【0024】請求項6の発明は、入力文字に応じて符号
表選択手段134および順位更新手段114が動作し、
候補保持手段131に保持された複数の候補の中から適
切な符号表候補を選択的するとともに、順位保持手段1
12を更新することにより、データにおける各文字の出
現確率に相当する情報に関する分布の変化を順位保持手
段112に保持された順位リストおよび符号表保持手段
132に保持された符号表に反映し、第2符号生成手段
133による以降の符号化処理に供することができる。
According to a sixth aspect of the present invention, the code table selecting means 134 and the order updating means 114 operate according to the input character.
An appropriate code table candidate is selected from a plurality of candidates held by the candidate holding unit 131, and the rank holding unit 1
12 is updated, the change in the distribution related to information corresponding to the appearance probability of each character in the data is reflected in the order list held in the order holding means 112 and the code table held in the code table holding means 132, It can be used for the subsequent encoding process by the two-code generation unit 133.

【0025】これにより、キャノニカルハフマン符号の
規則性を維持しつつ、符号化処理に用いる符号表を動的
に組替えることが可能となる。請求項7の発明は、所定
長のビット列で表される文字ごとに可変長符号を割り当
てることによって符号化された符号列から元のデータを
復元するデータ復元装置において、それぞれ相異なる統
計的性質を持つ入力文字列に適合してキャノニカルハフ
マン符号を生成する複数の符号表を符号表候補として保
持する候補保持手段131と、符号表候補のいずれかを
保持している符号表保持手段132と、データ圧縮によ
って得られた符号からなる符号列を受け取り、符号表保
持手段132に保持された符号表に基づいて、符号列を
構成する各符号から元の各文字を復元し、各文字からな
る文字列として出力する第2データ復元手段135と、
データにおける各文字の出現確率に相当する情報に基づ
く順位を保持する順位保持手段112と、文字列を構成
する各文字の入力に応じて順位保持手段112を参照
し、各文字の順位に基づいて、符号表候補のいずれかを
選択して符号表保持手段132に入力する符号表選択手
段134と、文字列の入力に応じて、文字列を構成する
各文字について順位保持手段112に保持された順位を
更新する順位更新手段114とを備えたことを特徴とす
る。
Thus, it is possible to dynamically rearrange the code table used for the encoding process while maintaining the regularity of the canonical Huffman code. According to a seventh aspect of the present invention, there is provided a data restoration apparatus for restoring original data from an encoded code string by assigning a variable length code to each character represented by a bit string of a predetermined length. Candidate holding means 131 for holding a plurality of code tables for generating a canonical Huffman code in conformity with the input character string having the code table candidates, a code table holding means 132 for holding any of the code table candidates, A code string composed of codes obtained by data compression is received, and based on the code table held in the code table holding means 132, the original characters are restored from the codes constituting the code string, and the characters formed of the characters are restored. Second data restoration means 135 for outputting as a column;
The order holding means 112 for holding the order based on the information corresponding to the appearance probability of each character in the data, and the order holding means 112 according to the input of each character constituting the character string, and based on the order of each character, , A code table selecting means 134 for selecting one of the code table candidates and inputting it to the code table holding means 132, and for each character constituting the character string being held in the rank holding means 112 in response to the input of the character string. And a ranking updating means 114 for updating the ranking.

【0026】請求項7の発明は、第2データ復元手段1
35によって復元された文字に応じて、符号表選択手段
134および順位更新手段114が動作し、候補保持手
段131に保持された複数の候補の中から適切な符号表
候補を選択するとともに、順位保持手段112を更新す
ることにより、データにおける各文字の出現確率に相当
する情報に関する分布の変化を順位保持手段112に保
持された順位リストおよび符号表保持手段132に保持
された符号表に反映し、第2データ復元手段135によ
る以降のデータ復元処理に供することができる。
According to a seventh aspect of the present invention, the second data restoring means 1
The code table selecting means 134 and the rank updating means 114 operate in accordance with the character restored by 35, and select an appropriate code table candidate from a plurality of candidates held in the candidate holding means 131, and By updating the means 112, a change in distribution related to information corresponding to the appearance probability of each character in the data is reflected on the order list held by the order holding means 112 and the code table held by the code table holding means 132, The second data restoration unit 135 can provide the subsequent data restoration processing.

【0027】これにより、キャノニカルハフマン符号の
規則性を維持しつつ、データ復元処理に用いる符号表を
動的に組替えることが可能となる。請求項8の発明は、
圧縮対象のデータを所定長のビット列で表される文字か
らなる文字列として受け取り、各文字に可変長符号を割
り当てることによって符号化するデータ圧縮プログラム
において、キャノニカルハフマン符号を生成するための
符号表に含まれる各符号の符号長の分布を示す符号長分
布表と、データにおける各文字の出現確率に相当する情
報に基づく順位を示す順位リストと、圧縮対象のデータ
を所定長のビットパターンで表される文字からなる文字
列として受け取り、文字列を構成する各文字を符号長分
布表と順位リストで示される各文字の順位とに基づいて
符号化し、各文字に対応する符号からなる符号列を出力
する第1符号生成手順と、文字列を構成する各文字の入
力に応じて、順位リストにおいて各文字に対応する順位
を更新する順位更新手順と、文字列を構成する各文字の
入力に応じて、符号長分布表を更新する分布表更新手順
とをコンピュータに実行させることを特徴とする。
This makes it possible to dynamically rearrange the code table used for the data restoration processing while maintaining the regularity of the canonical Huffman code. The invention of claim 8 is
A code table for generating a canonical Huffman code in a data compression program that receives data to be compressed as a character string composed of characters represented by a bit string of a predetermined length and encodes the characters by assigning a variable length code to each character. A code length distribution table showing the distribution of the code length of each code included in the code, a rank list showing a rank based on information corresponding to the appearance probability of each character in the data, and a data pattern to be compressed in a bit pattern of a predetermined length. Received as a character string consisting of characters to be encoded, each character constituting the character string is encoded based on the order of each character shown in the code length distribution table and the order list, and the code string consisting of the code corresponding to each character A first code generation procedure to be output, and a rank update for updating a rank corresponding to each character in a rank list in accordance with an input of each character constituting a character string. And instructions, in response to an input of each character of a string, characterized in that to execute a distribution table update procedure for updating the code length distribution table to the computer.

【0028】請求項8の発明は、入力文字に応じて順位
更新手順と分布表更新手順とを実行することにより、デ
ータにおける各文字の出現確率に相当する情報に関する
分布の変化を順位リストおよび符号長分布表に反映し、
第1符号生成手順における以降の符号化処理に供するこ
とができる。これにより、キャノニカルハフマン符号の
規則性を維持しつつ、符号化処理に用いる符号表を動的
に組替えることが可能となる。
According to an eighth aspect of the present invention, by executing the order update procedure and the distribution table update procedure in accordance with the input character, a change in distribution related to information corresponding to the appearance probability of each character in the data is determined by an order list and a code. Reflected in the length distribution table,
This can be used for the subsequent encoding process in the first code generation procedure. This makes it possible to dynamically rearrange the code table used for the encoding process while maintaining the regularity of the canonical Huffman code.

【0029】請求項9の発明は、所定長のビット列で表
される文字ごとに可変長符号を割り当てることによって
符号化された符号列から元のデータを復元するデータ復
元プログラムにおいて、キャノニカルハフマン符号を生
成するための符号表に含まれる各符号の符号長の分布を
示す符号長分布表と、データにおける各文字の出現確率
に相当する情報に基づくの順位を示す順位リストと、デ
ータ圧縮によって得られた符号列の入力に応じて、符号
長分布表と順位リストで示された各文字の順位とに基づ
いて、符号列を構成する各符号に対応する文字を復元
し、これらの文字からなる文字列を出力する第1データ
復元手順と、文字列を構成する各文字の入力に応じて、
順位リストにおいて各文字に対応する順位を更新する順
位更新手順と、文字列を構成する各文字の入力に応じ
て、符号長分布表を更新する分布表更新手順とをコンピ
ュータに実行させることを特徴とする。
According to a ninth aspect of the present invention, there is provided a data restoration program for restoring original data from an encoded code string by assigning a variable length code to each character represented by a bit string of a predetermined length. A code length distribution table showing the distribution of the code lengths of the respective codes included in the code table for generating the code table, a rank list indicating the rank based on information corresponding to the appearance probability of each character in the data, and a rank list obtained by data compression. In accordance with the input of the given code string, the character corresponding to each code constituting the code string is restored based on the code length distribution table and the rank of each character indicated in the rank list, and the According to a first data restoration procedure for outputting a character string and input of each character constituting the character string,
The computer is configured to execute a rank update procedure for updating a rank corresponding to each character in the rank list and a distribution table update procedure for updating a code length distribution table in response to input of each character constituting a character string. And

【0030】請求項9の発明は、第1データ復元手順に
おいて復元された文字に応じて、順位更新手順と分布表
更新手順とを実行することにより、データにおける各文
字の出現確率に相当する情報に関する分布の変化を順位
リストおよび符号長分布表に反映し、第1データ復元手
順における以降のデータ復元処理に供することができ
る。
[0030] According to a ninth aspect of the present invention, information corresponding to the appearance probability of each character in the data is obtained by executing the order update procedure and the distribution table update procedure in accordance with the character restored in the first data restoration procedure. The change in the distribution related to the data can be reflected in the rank list and the code length distribution table, and can be used for subsequent data restoration processing in the first data restoration procedure.

【0031】これにより、キャノニカルハフマン符号の
規則性を維持しつつ、データ復元処理に用いる符号表を
動的に組替えることが可能となる。請求項10の発明
は、圧縮対象のデータを所定長のビット列で表される文
字からなる文字列として受け取り、各文字に可変長符号
を割り当てることによって符号化するデータ圧縮プログ
ラムにおいて、それぞれ相異なる統計的性質を持つ入力
文字列に適合してキャノニカルハフマン符号を生成する
符号表として利用可能な複数の符号表候補と、符号表候
補のいずれかを符号表として保持する符号表保持手順
と、圧縮対象のデータを所定長のビットパターンで表さ
れる文字からなる文字列として受け取り、文字列を構成
する各文字を符号表保持手順において保持した符号表に
基づいて符号化し、各文字に対応する符号からなる符号
列として出力する第2符号生成手順と、データにおける
各文字の出現確率に相当する情報に基づく順位を示す順
位リストと、文字列を構成する各文字の入力に応じて順
位リストを参照し、各文字の順位に基づいて、符号表候
補のいずれかを選択して符号表保持手順に渡す符号表選
択手順と、文字列を構成する各文字の入力に応じて、順
位リストにおいて各文字に対応する順位を更新する順位
更新手順とをコンピュータに実行させることを特徴とす
る。
This makes it possible to dynamically rearrange the code table used for the data restoration processing while maintaining the regularity of the canonical Huffman code. According to a tenth aspect of the present invention, there is provided a data compression program which receives data to be compressed as a character string composed of characters represented by a bit string of a predetermined length, and encodes the characters by assigning a variable length code to each character. Code table candidates that can be used as a code table for generating a canonical Huffman code in conformity with an input character string having a characteristic property, a code table holding procedure for holding any of the code table candidates as a code table, and compression. Receives the target data as a character string composed of characters represented by a bit pattern of a predetermined length, encodes each character constituting the character string based on the code table held in the code table holding procedure, and codes corresponding to each character A second code generation procedure for outputting as a code string consisting of: and a rank indicating a rank based on information corresponding to the appearance probability of each character in the data And a code table selecting step of referring to the rank list according to the input of each character constituting the character string, selecting one of the code table candidates based on the rank of each character, and passing the code table candidate to the code table holding procedure. And a sequence update procedure for updating the rank corresponding to each character in the rank list in response to the input of each character constituting the character string.

【0032】請求項10の発明は、入力文字に応じて符
号表選択手順および順位更新手順が動作し、複数の符号
表候補の中から適切な符号表候補を選択的するととも
に、順位リストを更新することにより、データにおける
各文字の出現確率に相当する情報に関する分布の変化を
順位リストおよび符号表保持手順において保持される符
号表に反映し、第2符号生成手順における以降の符号化
処理に供することができる。
According to a tenth aspect of the present invention, a code table selecting procedure and a rank updating procedure operate in accordance with an input character to select an appropriate code table candidate from a plurality of code table candidates and update a rank list. By doing so, the change in distribution related to information corresponding to the appearance probability of each character in the data is reflected in the rank list and the code table held in the code table holding procedure, and is provided for subsequent encoding processing in the second code generation procedure. be able to.

【0033】請求項11の発明は、所定長のビット列で
表される文字ごとに可変長符号を割り当てることによっ
て符号化された符号列から元のデータを復元するデータ
復元プログラムにおいて、それぞれ相異なる統計的性質
を持つ入力文字列に適合してキャノニカルハフマン符号
を生成する符号表として利用可能な複数の符号表候補
と、符号表候補のいずれかを符号表として保持する符号
表保持手順と、データ圧縮によって得られた符号からな
る符号列を受け取り、符号表保持手順において保持され
た符号表に基づいて、符号列を構成する各符号から元の
各文字を復元し、各文字からなる文字列として出力する
第2データ復元手順と、文字列における各文字の出現確
率に相当する情報に基づく順位を示す順位リストと、文
字列を構成する各文字の入力に応じて順位リストを参照
し、各文字の順位に基づいて、符号表候補のいずれかを
選択して符号表保持手順に渡す符号表選択手順と、文字
列を構成する各文字の入力に応じて、順位リストにおい
て各文字に対応する順位を更新する順位更新手順とをコ
ンピュータに実行させることを特徴とする。
According to an eleventh aspect of the present invention, there is provided a data restoration program for restoring original data from an encoded code string by assigning a variable length code to each character represented by a bit string of a predetermined length. Code table candidates that can be used as a code table that generates a canonical Huffman code in conformity with an input character string having a characteristic property, a code table holding procedure that holds any of the code table candidates as a code table, and data Receiving a code string consisting of codes obtained by compression, based on the code table held in the code table holding procedure, and restoring each original character from each code constituting the code string, as a character string consisting of each character A second data restoration procedure to be output, a rank list indicating a rank based on information corresponding to the occurrence probability of each character in the character string, and each sentence constituting the character string A code table selecting step of selecting one of the code table candidates based on the rank of each character and passing it to the code table holding procedure based on the rank of each character, and inputting each character constituting the character string And updating the order corresponding to each character in the order list in accordance with the order.

【0034】請求項11の発明は、第2データ復元手順
において復元された文字に応じて、符号表選択手順およ
び順位更新手順が動作し、複数の符号表候補の中から適
切な符号表候補を選択的するとともに、順位リストを更
新することにより、データにおける各文字の出現確率に
相当する情報に関する分布の変化を順位リストおよび符
号表保持手順において保持される符号表に反映し、第2
データ復元手順における以降のデータ復元処理に供する
ことができる。
According to the eleventh aspect of the present invention, the code table selecting procedure and the order updating procedure operate according to the character restored in the second data restoring procedure, and an appropriate code table candidate is selected from a plurality of code table candidates. By selecting and updating the ranking list, the change in distribution of information corresponding to the appearance probability of each character in the data is reflected in the ranking list and the code table held in the code table holding procedure,
This can be used for the subsequent data restoration processing in the data restoration procedure.

【0035】[0035]

【発明の実施の形態】以下、図面に基づいて、本発明の
実施形態について詳細に説明する。図3に、請求項1の
データ圧縮装置の実施形態を示す。図3に示すデータ圧
縮装置において、符号化部211は、請求項1で述べた
第1符号生成手段113に相当するものであり、分布表
保持部212に保持された符号長分布表と順位リスト2
13とに基づいて、入力文字列をキャノニカルハフマン
符号化方式に従って符号化する構成となっている。
Embodiments of the present invention will be described below in detail with reference to the drawings. FIG. 3 shows an embodiment of the data compression device according to claim 1. In the data compression apparatus shown in FIG. 3, the encoding unit 211 corresponds to the first code generation unit 113 described in claim 1, and includes a code length distribution table and a rank list held in the distribution table holding unit 212. 2
13, the input character string is encoded according to the canonical Huffman encoding method.

【0036】図3に示した分布表保持部212は、請求
項1で述べた分布表保持手段111に相当するものであ
り、符号木の構造を示す符号長分布表を保持している。
また、順位リスト213は、請求項1で述べた順位保持
手段112に相当するものであり、各文字の出現度数に
基づく順位を示している。また、図3において、度数計
数部214は、文字列の入力に応じて、各文字の出現度
数を計数する機能を持っており、リスト更新部215
は、この計数結果に基づいて、順位リスト213を更新
する機能を持っている。
The distribution table holding unit 212 shown in FIG. 3 corresponds to the distribution table holding means 111 described in claim 1, and holds a code length distribution table indicating a structure of a code tree.
The rank list 213 corresponds to the rank holding means 112 described in claim 1, and indicates a rank based on the frequency of appearance of each character. In FIG. 3, the frequency counting unit 214 has a function of counting the frequency of appearance of each character according to the input of a character string.
Has a function of updating the ranking list 213 based on the counting result.

【0037】このように、文字列の入力に応じて、この
度数計数部214およびリスト更新部215が後述する
ように動作することにより、請求項1で述べた順位更新
手段114の機能が果たされている。一方、図3に示し
た分布表更新部216は、請求項1で述べた分布表更新
手段115に相当するものであり、更新制御部221か
らの指示に応じて、分布表抽出部222、符号長変更部
223、分割表保持部224および分布表合成部225
が後述するように動作することにより、入力文字列に応
じて、符号長分布表を変更する機能を果たしている。
In this way, the frequency counting unit 214 and the list updating unit 215 operate as described later in response to the input of the character string, thereby fulfilling the function of the order updating unit 114 described in claim 1. Have been. On the other hand, the distribution table updating unit 216 shown in FIG. 3 corresponds to the distribution table updating unit 115 described in claim 1, and in response to an instruction from the update control unit 221, the distribution table extracting unit 222 and the code Length changing unit 223, division table holding unit 224, and distribution table combining unit 225
Performs the function of changing the code length distribution table according to the input character string by operating as described later.

【0038】図4に、データ圧縮動作を表す流れ図を示
す。また、図5および図6に、符号長分布表更新動作を
説明する図を示す。圧縮対象の文字列を形成する各文字
の入力に応じて、符号化部211は、順位リスト213
と分布表保持部212を参照して、入力文字に割り当て
られた符号長およびその符号長における順位を求め、こ
の順位を表すビットパターンと適切な第1コードとに基
づいて符号を生成し(ステップ301)、出力する。
FIG. 4 is a flowchart showing the data compression operation. FIGS. 5 and 6 are diagrams illustrating the code length distribution table updating operation. In accordance with the input of each character forming the character string to be compressed, the encoding unit 211
With reference to the distribution table holding unit 212 and the code length assigned to the input character and the order in the code length, a code is generated based on the bit pattern representing this order and the appropriate first code (step 301), and output.

【0039】例えば、図5に示すような符号木におい
て、順位リスト213に第6位として保持された文字
(図5に示した符号木において、黒く塗りつぶした丸で
示す)が入力されたときに、符号化部211は、符号長
4における順位3と第1コード「0000」とに基づい
て、符号「0011」を生成して出力すればよい。この
とき、更新制御部221からの指示に応じて、分布表抽
出部222は、分布表保持部212に保持された符号長
分布表から、後述する第1分布、第2分布および第3分
布を抽出し、分割表保持部224に保持する(ステップ
302)。
For example, in a code tree as shown in FIG. 5, when a character held as the sixth place in the ranking list 213 (indicated by a black circle in the code tree shown in FIG. 5) is input. The encoding unit 211 may generate and output the code “0011” based on the order 3 in the code length 4 and the first code “0000”. At this time, in response to an instruction from the update control unit 221, the distribution table extraction unit 222 extracts a first distribution, a second distribution, and a third distribution described later from the code length distribution table held in the distribution table holding unit 212. It is extracted and held in the split table holding unit 224 (step 302).

【0040】このとき、更新制御部221は、符号長分
布表によって特定される符号木の根にあたる節点におい
て、符号木を等確率の二つの部分に分け、ステップ30
1において符号化された文字を含まない方の部分木に対
応する符号長分布を第1分布として抽出する旨を指示
し、更に、他方の部分木を等確率の二つの部分に分け、
上述した文字を含む方の部分木に対応する符号長分布を
第3分布、他方の部分木に対応する符号長分布を第2分
布として抽出する旨を指示すればよい。
At this time, the update control unit 221 divides the code tree into two parts of equal probability at the node corresponding to the root of the code tree specified by the code length distribution table, and
Instruct to extract the code length distribution corresponding to the subtree that does not include the character encoded in 1 as the first distribution, further divide the other subtree into two parts with equal probability,
What is necessary is just to indicate that the code length distribution corresponding to the partial tree containing the above-mentioned character is extracted as the third distribution, and the code length distribution corresponding to the other partial tree is extracted as the second distribution.

【0041】これにより、上述した文字の入力に応じ
て、符号長分布表は、符号木の根から左側に伸びた枝に
相当する部分木に対応する第1分布と、上述した根から
右側の最初の節点から左側に伸びた枝に相当する部分木
に対応する第2分布と、この節点から右側に伸びた枝に
相当する部分木に対応する第3分布とに分割される(図
5参照)。
Accordingly, in response to the above-mentioned character input, the code length distribution table includes a first distribution corresponding to a subtree corresponding to a branch extending to the left from the root of the code tree, and a first distribution corresponding to the above-described first right from the root. It is divided into a second distribution corresponding to a subtree corresponding to a branch extending to the left from the node and a third distribution corresponding to a subtree corresponding to a branch extending to the right from the node (see FIG. 5).

【0042】このように、文字の入力に応じて、更新制
御部221、分布表抽出部222が動作することによ
り、請求項3で述べた分割手段121の機能を実現し、
符号木において入力文字が割り当てられた葉との位置関
係に応じて、符号長分布表を3つの部分分布表に分割
し、変更手段122に相当する符号長変更部223の処
理に供することができる。
As described above, by operating the update control unit 221 and the distribution table extracting unit 222 in response to the input of characters, the function of the dividing unit 121 described in claim 3 is realized.
The code length distribution table can be divided into three partial distribution tables according to the positional relationship with the leaves to which the input characters are assigned in the code tree, and can be provided to the processing of the code length changing unit 223 corresponding to the changing unit 122. .

【0043】この符号長変更部223は、分布表抽出部
222から受け取った各部分分布表について、それぞれ
符号長の変更処理を行う(ステップ303)。このと
き、符号長変更部223は、第1分布に属する符号の符
号長をそれぞれ1ずつ長くして分割表保持部224に保
持する一方、第3分布に属する符号の符号長をそれぞれ
1ずつ短くして分割表保持部224に保持し、第2分布
に属する各符号の符号長をそのまま分割表保持部224
に保持すればよい(図5参照)。
The code length changing unit 223 changes the code length of each partial distribution table received from the distribution table extracting unit 222 (step 303). At this time, the code length changing unit 223 increases the code lengths of the codes belonging to the first distribution by one and holds them in the divided table holding unit 224, while shortening the code lengths of the codes belonging to the third distribution by one. Is stored in the partition table holding unit 224, and the code length of each code belonging to the second distribution is directly stored in the partition table holding unit 224.
(See FIG. 5).

【0044】次いで、更新制御部221は、第3分布と
して抽出された符号長分布表に対応する部分木が更に分
割可能であるか否かを判定し(ステップ304)、肯定
判定の場合は、ステップ302に戻って、この第3分布
を元の符号木に対応する符号長分布表として、更に符号
長分布表の分割処理および符号長変更処理を繰り返す。
Next, the update control section 221 determines whether or not the subtree corresponding to the code length distribution table extracted as the third distribution can be further divided (step 304). Returning to step 302, this third distribution is used as a code length distribution table corresponding to the original code tree, and the code length distribution table division processing and code length change processing are further repeated.

【0045】例えば、図5に示した第3分布は、更に分
割可能であるので、上述したステップ304の肯定判定
となり、更新制御部221は、分割表保持部224に保
持された第3分布を分割する旨を分布表抽出部222に
指示する。これに応じて、分布表抽出部222により、
図6に示すように、符号aで示した節点から右側に伸び
る枝に相当する第1分布と、この節点から左側に伸びる
枝を符号bで示す節点において分けた部分木に相当する
第2分布および第3分布とが抽出され、符号長変更部2
23による符号長の変更処理に供される(図6参照)。
For example, since the third distribution shown in FIG. 5 can be further divided, an affirmative determination is made in step 304 described above, and the update control unit 221 updates the third distribution held in the divided table holding unit 224. The distribution table extracting unit 222 is instructed to perform the division. In response, the distribution table extraction unit 222
As shown in FIG. 6, a first distribution corresponding to a branch extending to the right from a node indicated by reference numeral a, and a second distribution corresponding to a subtree obtained by dividing a branch extending to the left from this node at a node indicated by reference b And the third distribution are extracted, and the code length changing unit 2
It is provided to the code length changing process by the H.23 (see FIG. 6).

【0046】このように、更新制御部221からの指示
に応じて、分布表抽出部222および符号長変更部22
3が動作することにより、請求項4で述べた繰り返し制
御手段124の機能を実現し、文字の出現に応じて、該
当する符号の符号長を大きく変更することができる。図
5および図6に示した例の場合は、第3分布を更に分割
することはできないので、ステップ304の否定判定と
なり、このとき、分布表合成部225は、更新制御部2
21からの指示に応じて、上述したようにして得られた
各部分木に対応する符号長分布を合成し、新しい符号長
分布表を生成して分布表保持部212に保持すればよい
(ステップ305)。
As described above, in response to an instruction from the update control unit 221, the distribution table extracting unit 222 and the code length changing unit 22
By the operation of No. 3, the function of the repetition control means 124 described in claim 4 is realized, and the code length of the corresponding code can be largely changed according to the appearance of the character. In the case of the examples shown in FIGS. 5 and 6, since the third distribution cannot be further divided, a negative determination is made in step 304, and at this time, the distribution table synthesizing unit 225
The code length distributions corresponding to the respective subtrees obtained as described above are combined in accordance with the instruction from 21 to generate a new code length distribution table, and the new code length distribution table may be stored in the distribution table holding unit 212 (step S21). 305).

【0047】なお、図5、図6に示した例においては、
説明の簡明性のため、図5に示した第3分布を更に分割
して得られた各分布について、符号長を変更した結果を
合成した符号長分布表を図6に示し、この符号長分布表
と、元の第1分布および第2分布とを合成して、新しい
符号長分布表を生成する手順として示している。このよ
うにして符号長分布表を更新した後、リスト更新部21
5は、度数計数部214による計数結果に基づいて、例
えば、出現度数の多い順に順位リスト213を更新し
(ステップ306)、入力文字についての処理を終了す
ればよい。
In the examples shown in FIGS. 5 and 6,
For the sake of simplicity of explanation, FIG. 6 shows a code length distribution table in which the results obtained by changing the code length are combined for each distribution obtained by further dividing the third distribution shown in FIG. The table is shown as a procedure for generating a new code length distribution table by combining the original first distribution and the second distribution. After updating the code length distribution table in this way, the list updating unit 21
In step 5, the order list 213 may be updated in descending order of appearance frequency based on the counting result of the frequency counting unit 214 (step 306), and the process for the input character may be ended.

【0048】したがって、次に入力される文字は、上述
したようにして組替えられた符号木に従って符号化され
る。すなわち、上述したデータ圧縮装置により、データ
系列に含まれる各文字の出現頻度の変化に追従しつつ、
キャノニカルハフマン符号の規則に従ってデータ系列を
符号化することが可能である。
Therefore, the next input character is encoded according to the code tree rearranged as described above. That is, while following the change in the appearance frequency of each character included in the data series,
It is possible to encode the data sequence according to the rules of the canonical Huffman code.

【0049】また、図4に示したステップ302におい
て得られた第3分布が更に分割可能か否かにかかわら
ず、符号長分布表の分割処理、符号長変更処理および順
位リストの更新処理からなる符号表の組換え処理を1度
だけ行って、次の文字についての処理を行うように、デ
ータ圧縮装置を構成することも可能である。
Further, regardless of whether or not the third distribution obtained in step 302 shown in FIG. 4 can be further divided, the processing comprises a code length distribution table dividing process, a code length changing process, and a ranking list updating process. It is also possible to configure the data compression apparatus so that the code table recombination processing is performed only once and the processing for the next character is performed.

【0050】この場合は、更新制御部221は、図4に
示したステップ303の処理の終了後、即座に、ステッ
プ305に進んで、分布表合成部225に部分分布表の
合成処理を指示すればよい。次に、上述したデータ圧縮
装置によって得られた符号列からもとのデータを復元す
るデータ復元装置について説明する。
In this case, the update control unit 221 immediately proceeds to step 305 after the end of the processing of step 303 shown in FIG. 4, and instructs the distribution table synthesizing unit 225 to perform the processing of synthesizing the partial distribution table. I just need. Next, a data restoration device for restoring original data from a code string obtained by the above-described data compression device will be described.

【0051】図7に、請求項2のデータ復元装置の実施
形態を示す。また、図8に、データ復元動作を表す流れ
図を示す。図7に示したデータ復元装置において、復元
部231は、請求項2で述べた第1データ復元手段11
5に相当するものであり、分布表保持部212に保持さ
れた符号長分布表と順位リスト213とに基づいて、キ
ャノニカルハフマン符号化方式に従って符号列から元の
データを構成する各文字を復元する機能を備えている。
FIG. 7 shows an embodiment of the data restoration apparatus according to the second aspect. FIG. 8 is a flowchart showing the data restoration operation. In the data restoring device shown in FIG. 7, the restoring unit 231 is provided with the first data restoring unit 11 described in claim 2.
5 based on the code length distribution table held in the distribution table holding unit 212 and the rank list 213, and restores each character constituting the original data from the code string according to the canonical Huffman coding method. It has the function to do.

【0052】この復元部231によって復元された各文
字は、度数計数部214に入力されており、この度数計
数部214による計数結果に基づいて、リスト更新部2
15により順位リスト213が更新される。また、復元
部231によって復元された各文字の入力に応じて、分
布表更新部216が動作し、分布表保持部212に保持
された符号長分布表が更新される。
Each character restored by the restoring unit 231 is input to the frequency counting unit 214, and based on the counting result by the frequency counting unit 214, the list updating unit 2
15, the ranking list 213 is updated. The distribution table updating unit 216 operates according to the input of each character restored by the restoring unit 231, and updates the code length distribution table held in the distribution table holding unit 212.

【0053】上述した復元部231は、図4に示したス
テップ301とは逆に、入力された符号の長さとその符
号長における第1コードとに基づいて、該当する符号が
その符号長において占める順位を求め、この順位と符号
長分布表とに基づいて、順位リスト213を参照して、
入力符号に割り当てられた文字を得ることにより、デー
タを復元すればよい(図8に示したステップ311)。
The above-described restoring unit 231, in contrast to step 301 shown in FIG. 4, occupies the relevant code in the code length based on the input code length and the first code in the code length. The order is obtained, and based on the order and the code length distribution table, the order list 213 is referred to,
The data may be restored by obtaining the character assigned to the input code (step 311 shown in FIG. 8).

【0054】また、このとき、度数計数部214によ
り、該当する文字についての出現度数がインクリメント
される。一方、分布表更新部216は、ステップ311
で得られた文字の入力に応じて、図4に示したステップ
302〜ステップ305において述べた処理を行って、
分布表保持部212に保持された符号長分布表を更新す
る(ステップ312)。
At this time, the frequency counting section 214 increments the frequency of appearance of the corresponding character. On the other hand, the distribution table updating unit 216 determines in step 311
In accordance with the input of the character obtained in the above, the processing described in steps 302 to 305 shown in FIG.
The code length distribution table held in the distribution table holding unit 212 is updated (step 312).

【0055】次いで、リスト更新部215により、ステ
ップ306において述べた処理を行うことによって順位
リスト213を更新し(ステップ313)、その後、こ
の復元文字についての処理を終了すればよい。このよう
にして、復元された文字に応じて、キャノニカルハフマ
ン符号化方式の規則性を維持しつつ符号木を組替えて、
次の符号についての復元処理に供することができる。
Then, the list updating unit 215 updates the ranking list 213 by performing the processing described in step 306 (step 313), and then terminates the processing for the restored characters. In this way, according to the restored character, rearrange the code tree while maintaining the regularity of the canonical Huffman coding method,
The next code can be subjected to restoration processing.

【0056】すなわち、上述したデータ復元装置によ
り、図3に示した請求項1のデータ圧縮装置によって符
号化されたキャノニカルハフマン符号からなる符号列を
復号化し、元のデータ系列を復元することが可能であ
る。本発明のデータ圧縮装置およびデータ復元装置は、
符号長分布表および順位リストの組換え処理を行うた
め、既存のキャノニカルハフマン符号化方式にのっとっ
たデータ圧縮装置およびデータ復元装置に比べて、確か
に処理量は増大する。
That is, the data restoration apparatus described above decodes a code string composed of canonical Huffman codes encoded by the data compression apparatus of claim 1 shown in FIG. 3 to restore the original data sequence. It is possible. The data compression device and the data decompression device of the present invention
Since the code length distribution table and the rank list are recombined, the processing amount surely increases as compared with a data compression device and a data decompression device based on the existing canonical Huffman coding method.

【0057】その代わりに、データ系列の統計的な性質
の変化に追従して符号木を組替えながら符号化すること
が可能であり、また、動的な符号表の組換えを取り入れ
たことにより、復元側に渡すべき符号表が不要となるの
で、動的ハフマン符号化方式に匹敵する高い圧縮率が期
待できる。また、上述した符号木の組換え処理にかかわ
らず、キャノニカルハフマン符号が持つ規則性は維持さ
れているので、各文字の符号化動作および復元動作にお
いて符号木をたどる必要はない。
Instead, it is possible to perform coding while rearranging the code tree in accordance with a change in the statistical property of the data series, and by incorporating a dynamic code table rearrangement, Since a code table to be passed to the restoration side is not required, a high compression ratio comparable to the dynamic Huffman coding method can be expected. Further, regardless of the above-described code tree recombining process, the regularity of the canonical Huffman code is maintained, so that it is not necessary to follow the code tree in the encoding operation and the restoring operation of each character.

【0058】したがって、既存の動的ハフマン符号化方
式に比べて、符号化処理および復元処理を高速に実行可
能である。また、上述したデータ圧縮装置を構成する各
部は、請求項8で述べたデータ圧縮プログラム、すなわ
ち、符号長分布表および順位リストを提供するための情
報を用いて、第1符号生成手順と、順位更新手順と、分
布表更新手順とをコンピュータに実行させるデータ圧縮
プログラムによって実現可能である。
Therefore, the encoding process and the restoration process can be executed at a higher speed than the existing dynamic Huffman encoding method. In addition, the respective units constituting the data compression apparatus described above use the data compression program described in claim 8, that is, the first code generation procedure and the rank order using the information for providing the code length distribution table and the rank list. The update procedure and the distribution table update procedure can be realized by a data compression program that causes a computer to execute the procedure.

【0059】同様に、上述したデータ復元装置を構成す
る各部は、請求項9で述べたデータ復元プログラム、す
なわち、符号長分布表および順位リストを提供するため
の情報を用いて、第1データ復元手順と、順位更新手順
と、分布表更新手順とをコンピュータに実行させるデー
タ復元プログラムによって実現可能である。このような
データ圧縮プログラムおよびデータ復元プログラムを記
録した記憶媒体を頒布することにより、様々な利用者
に、キャノニカルハフマン符号化方式の高速性と動的ハ
フマン符号化方式の高い圧縮率とを兼ね備えたデータ圧
縮技術を提供することができる。
Similarly, each unit constituting the data restoration apparatus described above uses the data restoration program described in claim 9, that is, the first data restoration program using the information for providing the code length distribution table and the order list. It can be realized by a data restoration program that causes a computer to execute the procedure, the order updating procedure, and the distribution table updating procedure. By distributing a storage medium on which such a data compression program and a data decompression program are recorded, various users are provided with both the high speed of the canonical Huffman coding method and the high compression rate of the dynamic Huffman coding method. Data compression technology can be provided.

【0060】ところで、文字の出現確率に大きな隔たり
があるデータ系列について、上述した符号表の組換え処
理を無制限に実行すると、出現確率の低い文字に不必要
に長い符号が割り当てられてしまう可能性がある。次
に、符号長を制限しつつ、符号表の組換えを行う方法に
ついて説明する。図9に、請求項1のデータ圧縮装置の
別実施形態を示す。
By the way, if the above-described code table recombining process is performed without restriction on a data sequence having a large difference in the appearance probability of characters, there is a possibility that an unnecessarily long code is assigned to a character having a low appearance probability. There is. Next, a description will be given of a method of performing code table recombination while limiting the code length. FIG. 9 shows another embodiment of the data compression apparatus according to claim 1.

【0061】図9に示したデータ圧縮装置において、分
布表更新部217は、図3に示した分布表更新部216
の各部に加えて、符号長比較部226を備えている。こ
の符号長比較部226は、分布表抽出部222によって
第1分布として抽出された部分分布に含まれる最大の符
号長CLと所定の閾値Thとを比較し、この比較結果を
符号長変更部223と更新制御部221とに送出する機
能を備えている。
In the data compression apparatus shown in FIG. 9, the distribution table updating section 217 includes the distribution table updating section 216 shown in FIG.
And a code length comparing unit 226. The code length comparing unit 226 compares the maximum code length CL included in the partial distribution extracted as the first distribution by the distribution table extracting unit 222 with a predetermined threshold Th, and compares the comparison result with the code length changing unit 223. And an update control unit 221.

【0062】図10に、データ圧縮動作を表す流れ図を
示す。また、図11に、符号長分布表更新動作を説明す
る図を示す。例えば、図11に示すような符号木におい
て黒丸で示した葉に割り当てられた文字が出現した場合
に、符号化部211によって該当する符号が出力された
後に(ステップ301)、分布表抽出部222が、更新
制御部221からの指示に応じて動作し、部分分布表が
抽出される(ステップ302)。
FIG. 10 is a flowchart showing the data compression operation. FIG. 11 is a diagram illustrating a code length distribution table updating operation. For example, when a character assigned to a leaf indicated by a black circle appears in a code tree as shown in FIG. 11, after the corresponding code is output by the coding unit 211 (step 301), the distribution table extraction unit 222 Operate in response to an instruction from the update control unit 221 to extract a partial distribution table (step 302).

【0063】このとき、図11に示すように、符号木の
根から右側に伸びる枝に相当する部分木に対応する部分
分布表が第1分布として抽出され、この第3分布には、
符号長5の符号が二つ含まれている。例えば、符号長比
較部226において最大符号長CLと比較する閾値Th
の値として数値「5」が設定されている場合は、この符
号長比較部226による比較結果により、図10に示す
ステップ321の否定判定となり、これに応じて、更新
制御部221は、符号長分布表を更新する処理を終了す
ればよい。
At this time, as shown in FIG. 11, a partial distribution table corresponding to a subtree corresponding to a branch extending to the right from the root of the code tree is extracted as a first distribution.
Two codes of code length 5 are included. For example, the threshold Th compared with the maximum code length CL in the code length comparing unit 226.
Is set to a numerical value “5” as the value of “”, a negative determination is made in step 321 shown in FIG. 10 based on the comparison result by the code length comparing unit 226, and accordingly, the update control unit 221 What is necessary is just to end the process of updating the distribution table.

【0064】また、このとき、符号長変更部223は、
符号長比較部226による比較結果に応じて、分布表抽
出部222から受け取った部分分布表についての符号長
変更処理を中止すればよい。したがって、この場合は、
ステップ303からステップ305がスキップされて、
ステップ306において、リスト更新部215による順
位リスト213の更新処理が行われた後、入力文字につ
いての符号化処理が終了する。
At this time, the code length changing unit 223
The code length changing process for the partial distribution table received from the distribution table extracting unit 222 may be stopped according to the comparison result by the code length comparing unit 226. So, in this case,
Steps 303 to 305 are skipped,
In step 306, after the list updating unit 215 updates the ranking list 213, the encoding process for the input characters ends.

【0065】このように、符号長比較部226による比
較結果に応じて、更新制御部221および符号長変更部
223が動作することにより、請求項5で述べた変更制
限手段125の機能を実現し、符号表の組換え処理によ
る符号長の変化を制限し、符号長に上限を持たせること
ができる。これにより、データ系列の統計的な特徴にか
かわらず、出現確率の低い文字に対応する符号の長さを
抑制しつつ、符号木の組換えを行うことができるので、
全体として高い圧縮率を維持することができる。
As described above, the update control unit 221 and the code length changing unit 223 operate according to the comparison result by the code length comparing unit 226, thereby realizing the function of the change limiting unit 125 described in claim 5. In addition, it is possible to limit a change in the code length due to the code table recombining process and provide an upper limit to the code length. Thereby, regardless of the statistical characteristics of the data series, the code tree can be recombined while suppressing the length of the code corresponding to the character having a low occurrence probability.
A high compression ratio can be maintained as a whole.

【0066】次に、文字の出現に伴って符号表を更新す
る処理を簡略化する方法について説明する。図12に、
請求項6のデータ圧縮装置の実施形態を示す。
Next, a method for simplifying the process of updating the code table with the appearance of a character will be described. In FIG.
An embodiment of the data compression device according to claim 6 is shown.

【0067】図12に示したデータ圧縮装置において、
分布表保持部212および順位リスト213に基づい
て、符号化部211が入力文字を符号化することによ
り、請求項6で述べた第2符号生成手段133および符
号表保持手段132と同等の機能が果たされている。ま
た、図12において、候補保持部232は、請求項6で
述べた候補保持手段131と同等の機能を果たすもので
あり、様々な統計的な特徴を持つデータ系列に適合した
複数の符号長分布表候補を保持している。
In the data compression device shown in FIG.
The encoding unit 211 encodes the input characters based on the distribution table holding unit 212 and the ranking list 213, so that the functions equivalent to those of the second code generation unit 133 and the code table holding unit 132 described in claim 6 are realized. Has been fulfilled. In FIG. 12, a candidate holding unit 232 performs the same function as the candidate holding unit 131 described in claim 6, and includes a plurality of code length distributions adapted to data sequences having various statistical characteristics. Holds table candidates.

【0068】この候補保持部232は、例えば、図13
に示すような符号長分布表候補を保持しておけばよい。
ここで、図13(a)に示した符号長分布表候補は、各
文字の出現確率が均衡している場合に適合しており、こ
れに対して、図13(d)に示した符号長分布表候補
は、各文字の出現確率に大きな偏りがある場合に適合
し、残る二つの符号長分布表候補は、中間的な偏りがあ
る場合に適合している。
The candidate holding unit 232 is provided, for example, in FIG.
The code length distribution table candidates shown in FIG.
Here, the code length distribution table candidate shown in FIG. 13A is suitable when the appearance probabilities of the characters are balanced, whereas the code length distribution table candidate shown in FIG. The distribution table candidate is suitable when there is a large deviation in the appearance probability of each character, and the remaining two code length distribution table candidates are suitable when there is an intermediate deviation.

【0069】一方、図12に示したセレクタ233は、
符号表決定部234からの指示に応じて、上述した符号
長分布表候補のいずれかを選択的に分布表保持部212
に入力する機能を備えている。また、図12に示したリ
スト参照部235は、文字の入力に応じて順位リスト2
13を参照し、該当する順位を符号表決定部234に通
知する機能を備えており、この符号表決定部234は、
リスト参照部235から通知された順位と条件保持部2
36に保持された遷移条件(後述する)とに基づいて、
選択すべき符号表を決定し、セレクタ233による選択
動作を制御する機能を備えている。
On the other hand, the selector 233 shown in FIG.
In response to an instruction from the code table determining unit 234, one of the above code length distribution table candidates is selectively selected from the distribution table holding unit 212.
It has a function to input to. In addition, the list reference unit 235 shown in FIG.
13 and has a function of notifying the code table determining unit 234 of the corresponding rank. This code table determining unit 234
Order and condition storage unit 2 notified from list reference unit 235
Based on the transition condition (described later) held in 36,
It has a function of determining a code table to be selected and controlling the selection operation by the selector 233.

【0070】すなわち、リスト参照部235から受け取
った順位に基づいて、符号表決定部234およびセレク
タ233が動作することにより、請求項6で述べた符号
表選択手段134と同等の機能が果たされている。
That is, by operating the code table determining section 234 and the selector 233 based on the order received from the list reference section 235, a function equivalent to that of the code table selecting means 134 described in claim 6 is achieved. ing.

【0071】また、条件保持部236は、遷移条件とし
て、符号長分布表ごとに、出現確率の変化に与える影響
に基づいて分類された順位の範囲それぞれについて、適
切な遷移先を示す情報を保持すればよい。例えば、図1
4(a)に示すように、符号長分布表ごとに、偏差を拡
大する方向に出現確率分布が変化すると判断すべき順位
の範囲と、偏差を縮小する方向に出現確率分布が変化す
ると判断すべき順位の範囲と、出現確率分布に大きな変
化がない判断すべき順位の範囲とをそれぞれ示す情報
と、図14(b)に示すように、各符号長分布表につい
て、それぞれの範囲に含まれる順位を受け取ったときに
遷移すべき符号長分布表を示す情報とから遷移条件を形
成し、条件保持部236に保持しておけばよい。
The condition holding unit 236 holds, as a transition condition, information indicating an appropriate transition destination for each range of order classified based on the influence on the change of the appearance probability for each code length distribution table. do it. For example, FIG.
As shown in FIG. 4 (a), for each code length distribution table, it is determined that the range of the order in which the occurrence probability distribution is determined to change in the direction of increasing the deviation and the occurrence probability distribution changes in the direction of reducing the deviation. The information indicating the range of the power order and the range of the order to be determined in which there is no significant change in the appearance probability distribution, and, as shown in FIG. 14B, each code length distribution table is included in each range. A transition condition may be formed from the information indicating the code length distribution table to be transitioned when the order is received, and stored in the condition storage unit 236.

【0072】一方、図12に示したリスト更新部237
は、符号化部211に入力された文字を受け取り、その
順位を順位リスト213の先頭へ移動する機能を備えて
いる。図15に、データ圧縮動作を表す流れ図を示す。
例えば、符号長分布表1が分布表保持部212に保持さ
れているときに、順位リスト213に順位1として保持
された文字が入力された場合に、符号化部211によっ
てこの文字が符号化された後に(ステップ301)、符
号表決定部234は、リスト参照部235から受け取っ
た順位に応じて、条件保持部236に保持された遷移条
件を参照する(ステップ331)。
On the other hand, the list update unit 237 shown in FIG.
Has a function of receiving characters input to the encoding unit 211 and moving the order to the top of the order list 213. FIG. 15 is a flowchart showing the data compression operation.
For example, when a character held as rank 1 in the rank list 213 is input while the code length distribution table 1 is held in the distribution table holding unit 212, the character is coded by the coding unit 211. After that (step 301), the code table determination unit 234 refers to the transition condition stored in the condition storage unit 236 according to the order received from the list reference unit 235 (step 331).

【0073】この場合は、図14(a)に示したよう
に、符号長分布表1に対応する順位1は、偏差が拡大す
る方向への遷移が必要な順位の範囲に含まれているの
で、符号表決定部234は、ステップ332において、
別の符号表への遷移が必要であると判断し(ステップ3
32の肯定判定)、ステップ333に進んで、セレクタ
233を介して、該当する符号表(符号表2)に対応す
る符号長分布表を分布表保持部212に保持すればよ
い。
In this case, as shown in FIG. 14A, the order 1 corresponding to the code length distribution table 1 is included in the range of the order requiring a transition in the direction in which the deviation increases. , The code table determination unit 234 determines in step 332
It is determined that a transition to another code table is necessary (step 3
32, the process proceeds to step 333, and the code length distribution table corresponding to the corresponding code table (code table 2) may be held in the distribution table holding unit 212 via the selector 233.

【0074】その後、リスト更新部237によって順位
リスト213の更新を行った後に(ステップ306)、
入力文字についての符号化処理を終了すればよい。一
方、ステップ301において入力された文字が、図13
(a)に示した符号表において順位2の文字である場合
は、ステップ331において参照された条件に基づい
て、符号表決定部234は、別の符号表への遷移は不要
であると判断し(ステップ332の否定判定)、ステッ
プ306において順位リスト213の更新を行った後
に、この入力文字についての符号化処理を終了すればよ
い。
Then, after the ranking list 213 is updated by the list updating unit 237 (step 306),
What is necessary is just to end the encoding process for the input character. On the other hand, the character input in step 301 is
If the character is the character of the second rank in the code table shown in (a), the code table determination unit 234 determines that the transition to another code table is unnecessary based on the condition referred to in step 331. (Negative determination in step 332) After updating the ranking list 213 in step 306, the encoding process for this input character may be terminated.

【0075】このように、リスト参照部235から受け
取った順位および条件保持部236に保持された遷移条
件に基づいて、符号表決定部234およびセレクタ23
3が動作することにより、文字の出現がデータ系列の出
現確率分布に与えた変化の方向に適合する符号長分布表
を分布表保持部212に入力することができ、また、文
字の入力に応じてリスト更新部237が動作することに
より、順位リスト213にデータ系列における各文字の
出現確率の変化を反映することができる。
As described above, based on the order received from the list reference unit 235 and the transition condition held in the condition holding unit 236, the code table determination unit 234 and the selector 23
3 operates, the code length distribution table adapted to the change direction in which the appearance of the character has given to the appearance probability distribution of the data series can be input to the distribution table holding unit 212, and in response to the input of the character, By operating the list update unit 237, the change in the appearance probability of each character in the data sequence can be reflected in the rank list 213.

【0076】したがって、上述したように、入力文字に
応じて符号表を切り替えながら符号化するデータ圧縮装
置により、文字の入力に応じて符号木の組換え操作を行
うデータ圧縮装置と同等の効果を得ることが可能であ
る。次に、上述したデータ圧縮装置に対応するデータ復
元装置について説明する。図16に、請求項7のデータ
復元装置の実施形態を示す。図17に、データ復元動作
を表す流れ図を示す。
Therefore, as described above, the data compression apparatus that encodes while switching the code table according to the input character has the same effect as the data compression apparatus that performs the code tree recombining operation according to the input of the character. It is possible to get. Next, a data decompression device corresponding to the above-described data compression device will be described. FIG. 16 shows an embodiment of the data restoration apparatus according to claim 7. FIG. 17 is a flowchart showing the data restoration operation.

【0077】図16に示したデータ復元装置において、
分布表保持部212および順位リスト213に基づい
て、復元部231が入力符号から元の文字を復元するこ
とにより(図17に示したステップ311)、請求項7
で述べた第2データ復元手段135および符号表保持手
段132と同等の機能が果たされている。この復元部2
31によって復元された各文字は、リスト参照部235
およびリスト更新部237に入力されており、各文字の
入力に応じて、リスト参照部235、リスト更新部23
7、符号表決定部234およびセレクタ233により、
上述したステップ331からステップ334の処理を行
うことにより、復元された文字に応じて、適切な符号長
分布表候補を分布表保持部212に入力し、次の符号に
ついての復元処理に供することができる。
In the data restoration device shown in FIG.
The restoration unit 231 restores the original character from the input code based on the distribution table holding unit 212 and the ranking list 213 (step 311 shown in FIG. 17).
The functions equivalent to those of the second data restoration unit 135 and the code table holding unit 132 described above are performed. This restoration unit 2
Each character restored by 31 is a list reference unit 235
And the list updating unit 237, and according to the input of each character, the list reference unit 235 and the list updating unit 23
7, by the code table determining unit 234 and the selector 233,
By performing the processing from step 331 to step 334 described above, an appropriate code length distribution table candidate is input to the distribution table holding unit 212 according to the restored character, and is used for the restoration processing for the next code. it can.

【0078】このようにして、上述したデータ復元装置
により、図12に示した請求項6のデータ圧縮装置によ
って符号化されたキャノニカルハフマン符号からなる符
号列を復号化し、元のデータ系列を復元することが可能
となる。ここで、上述したように、符号表を切り替える
処理は簡単な照合処理であるから、符号木を組替える処
理に比べて、データ圧縮装置およびデータ復元装置の双
方の処理速度を格段に高速化することが可能である。
In this way, the above-described data decompression device decodes the code string composed of the canonical Huffman codes coded by the data compression device of claim 6 shown in FIG. It is possible to do. Here, as described above, since the process of switching the code table is a simple collation process, the processing speed of both the data compression device and the data decompression device is significantly increased as compared with the process of rearranging the code tree. It is possible.

【0079】ところで、可変長符号化方式において、よ
り一層の圧縮効果を得るための技法として、出現文字X
tとその直前文字Xt-1との依存関係として現れる文脈を
考慮し、出現文字Xtに割り当てる符号を直前文字Xt-1
が現れた場合における出現確率を示す条件付き出現確率
P〔Xt|Xt-1〕に基づいて決定する方法が提案されて
いる("Unbounded Length Contexts for PPM" John G.
Cleary他著 1995 IEEEData Compression Conference ,p
p52-61参照)。
Incidentally, in the variable-length coding method, as a technique for obtaining a further compression effect, an appearance character X is used.
Considering the context appearing as a dependency between t and the preceding character Xt-1 , the code assigned to the appearing character Xt is changed to the preceding character Xt-1.
Has been proposed based on a conditional occurrence probability P [ Xt | Xt-1 ] indicating an appearance probability in the case where a character appears ("Unbounded Length Contexts for PPM") John G.
Cleary et al. 1995 IEEEData Compression Conference, p
See p52-61).

【0080】上述した条件付出現確率は、請求項1、2
および請求項6、7において述べた出現確率に相当する
情報として捉えることができる。したがって、請求項1
および請求項6において述べたデータ圧縮装置におい
て、この条件付出現確率に関する順位を示した順位リス
トに基づいて各文字に符号を割り当てることにより、文
脈を考慮してデータを圧縮することができ、また、請求
項2および請求項7で述べたデータ復元装置復元におい
て、同様に、条件付出現確率に関する順位を示した順位
リストに基づいて各文字に符号を割り当てることによ
り、文脈を考慮して圧縮された符号列から元のデータを
復元することができ、一層の圧縮率の向上を図ることが
できる。
The above-mentioned conditional occurrence probability is defined as
And information corresponding to the appearance probabilities described in claims 6 and 7. Therefore, claim 1
In the data compression device described in claim 6, by assigning a code to each character based on a rank list indicating the rank regarding the conditional occurrence probability, data can be compressed in consideration of context, In the data restoration device restoration described in claims 2 and 7, similarly, by assigning a code to each character based on a ranking list indicating the ranking regarding the conditional occurrence probability, the data is compressed in consideration of the context. The original data can be restored from the decoded code string, and the compression ratio can be further improved.

【0081】また一方、データ系列の類似性を利用した
辞書型符号化方式において、圧縮率を向上するための一
手法として、可変長符号化方式を採用する場合に、本発
明を適用することも可能である。また、上述したデータ
圧縮装置を構成する各部の機能は、請求項10において
述べたデータ圧縮プログラム、すなわち、複数の符号表
候補および順位リストを提供するための情報を用いて、
符号表保持手順と、第2符号生成手順と、符号表選択手
順と、順位更新手順とをコンピュータに実行させるデー
タ圧縮プログラムによって実現可能である。
On the other hand, in a dictionary type encoding system utilizing similarity of data series, the present invention can be applied to a case where a variable length encoding system is employed as one method for improving the compression ratio. It is possible. Further, the function of each unit constituting the data compression apparatus described above uses the data compression program described in claim 10, that is, using information for providing a plurality of code table candidates and a rank list,
This can be realized by a data compression program that causes a computer to execute a code table holding procedure, a second code generation procedure, a code table selecting procedure, and a rank updating procedure.

【0082】同様に、上述したデータ復元装置を構成す
る各部の機能は、請求項11において述べたデータ復元
プログラム、すなわち、複数の符号表候補および順位リ
ストを提供するための情報を用いて、符号表保持手順
と、第2データ復元手順と、符号表選択手順と、順位更
新手順とをコンピュータに実行させるデータ復元プログ
ラムによって実現可能である。
Similarly, the function of each unit constituting the above-described data restoration apparatus is performed by using the data restoration program described in claim 11, that is, by using information for providing a plurality of code table candidates and a rank list. This can be realized by a data restoration program that causes a computer to execute a table holding procedure, a second data restoration procedure, a code table selection procedure, and a rank update procedure.

【0083】このようなデータ圧縮プログラムおよびデ
ータ復元プログラムを記録した記憶媒体を頒布すること
により、様々な利用者に、キャノニカルハフマン符号化
方式の高速性と動的ハフマン符号化方式の高い圧縮率と
を兼ね備えたデータ圧縮技術を提供することができる。
By distributing a storage medium on which such a data compression program and a data decompression program are recorded, it is possible to provide various users with the high speed of the canonical Huffman coding system and the high compression ratio of the dynamic Huffman coding system. It is possible to provide a data compression technique that combines the above.

【0084】[0084]

【発明の効果】以上に説明したように、請求項1のデー
タ圧縮装置および請求項2のデータ復元装置によれば、
入力文字あるいは復元文字に応じて、符号長分布表およ
び順位リストを更新することにより、キャノニカルハフ
マン符号の規則性を維持しつつ、データの圧縮あるいは
復元に用いる符号表を動的に組替えることができるの
で、規則的な符号表を用いることによって得られる処理
の高速性と、符号表の動的組換えによって得られる圧縮
率の高さとの双方を追及することができる。
As described above, according to the data compression apparatus of claim 1 and the data decompression apparatus of claim 2,
Updating the code length distribution table and rank list according to input characters or decompressed characters to dynamically rearrange code tables used for data compression or decompression while maintaining regularity of canonical Huffman codes Therefore, it is possible to pursue both the high-speed processing obtained by using a regular code table and the high compression ratio obtained by dynamically rearranging the code table.

【0085】特に、請求項3の発明を適用することによ
り、文字の出現確率に相当する情報に関する分布の変化
を、確実に、且つ、簡単な処理で符号長分布表に反映す
ることができる。
In particular, by applying the invention of claim 3, a change in distribution related to information corresponding to the appearance probability of a character can be reliably and simply reflected in the code length distribution table.

【0086】更に、請求項4の発明を適用することによ
り、文字の出現に応じて符号長分布表を大幅に変更する
ことが可能となり、一方、請求項5の発明を適用するこ
とにより、符号表に組換えによる符号長の変化を制限
し、極端に長い符合の発生を阻止することができる。一
方、請求項6のデータ圧縮装置および請求項2のデータ
復元装置によれば、入力文字あるいは復元文字に応じて
符号表を切り替えるとともに順位リストを更新すること
により、キャノニカルハフマン符号の規則性を維持しつ
つ、データの圧縮あるいは復元に用いる符号表を動的に
組替えた場合と同等の効果を得ることができるので、規
則的な符号表を用いることによって得られる処理の高速
性と、符号表の動的組換えによって得られる圧縮率の高
さとの双方を追及することができる。
Further, by applying the invention of claim 4, it becomes possible to greatly change the code length distribution table in accordance with the appearance of characters. On the other hand, by applying the invention of claim 5, the code length distribution table can be changed. It is possible to limit the change in code length due to recombination in the table, and prevent the occurrence of extremely long codes. On the other hand, according to the data compression device of claim 6 and the data decompression device of claim 2, the regularity of the canonical Huffman code is improved by switching the code table according to the input character or the decompressed character and updating the ranking list. It is possible to obtain the same effect as the case where the code table used for data compression or decompression is dynamically rearranged while maintaining the same, so that the processing speed obtained by using the regular code table and the code table can be improved. And the high compression ratio obtained by dynamic recombination of

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

【図1】請求項1乃至請求項5に記載の発明の原理ブロ
ック図である。
FIG. 1 is a block diagram showing the principle of the invention described in claims 1 to 5;

【図2】請求項6のデータ圧縮装置および請求項7のデ
ータ復元装置の原理ブロック図である。
FIG. 2 is a principle block diagram of a data compression device according to claim 6 and a data decompression device according to claim 7;

【図3】請求項1のデータ圧縮装置の実施形態を示す図
である。
FIG. 3 is a diagram showing an embodiment of the data compression device of claim 1;

【図4】データ圧縮動作を表す流れ図である。FIG. 4 is a flowchart illustrating a data compression operation.

【図5】符号長分布表更新動作を説明する図である。FIG. 5 is a diagram illustrating a code length distribution table updating operation.

【図6】符号長分布表更新動作を説明する図である。FIG. 6 is a diagram illustrating a code length distribution table updating operation.

【図7】請求項2のデータ復元装置の実施形態を示す図
である。
FIG. 7 is a diagram showing an embodiment of a data restoration device according to claim 2;

【図8】データ復元動作を表す流れ図である。FIG. 8 is a flowchart illustrating a data restoration operation.

【図9】請求項1のデータ圧縮装置の別実施形態を示す
図である。
FIG. 9 is a diagram showing another embodiment of the data compression device of claim 1;

【図10】データ圧縮動作を表す流れ図である。FIG. 10 is a flowchart showing a data compression operation.

【図11】符号長分布表更新動作を説明する図である。FIG. 11 is a diagram illustrating a code length distribution table updating operation.

【図12】請求項6のデータ圧縮装置の実施形態を示す
図である。
FIG. 12 is a diagram showing an embodiment of a data compression device according to claim 6;

【図13】符号長分布表候補の例を示す図である。FIG. 13 is a diagram illustrating an example of a code length distribution table candidate.

【図14】遷移条件を説明する図である。FIG. 14 is a diagram illustrating transition conditions.

【図15】データ圧縮動作を表す流れ図である。FIG. 15 is a flowchart showing a data compression operation.

【図16】請求項7のデータ復元装置の実施形態を示す
図である。
FIG. 16 is a diagram showing an embodiment of a data restoration device according to claim 7;

【図17】データ復元動作を表す流れ図である。FIG. 17 is a flowchart illustrating a data restoration operation.

【図18】従来の確率統計型符号化方式の例を説明する
図である。
FIG. 18 is a diagram illustrating an example of a conventional probability statistical coding method.

【図19】キャノニカルハフマン符号を説明する図であ
る。
FIG. 19 is a diagram illustrating canonical Huffman codes.

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

111 分布表保持手段 112 順位保持手段 113 第1符号生成手段 114 順位更新手段 115 分布表更新手段 116 第1データ復元手段 121 分割手段 122 変更手段 123 合成手段 124 繰り返し制御手段 125 変更制限手段 131 候補保持手段 132 符号表保持手段 133 第2符号生成手段 134 符号表選択手段 135 第2データ復元手段 211 符号化部 212 分布表保持部 213 順位リスト 214 度数計数部 215、237 リスト更新部 216、217 分布表更新部 221 更新制御部 222 分布表抽出部 223 符号長変更部 224 分割表保持部 225 分布表合成部 226 符号長比較部 231 復元部 232 候補保持部 233 セレクタ 234 符号表決定部 235 リスト参照部 236 条件保持部 111 distribution table holding means 112 rank holding means 113 first code generation means 114 rank updating means 115 distribution table updating means 116 first data restoring means 121 dividing means 122 changing means 123 synthesizing means 124 repetition control means 125 change limiting means 131 candidate holding Means 132 Code table holding means 133 Second code generating means 134 Code table selecting means 135 Second data restoring means 211 Encoding section 212 Distribution table holding section 213 Rank list 214 Frequency counting section 215, 237 List updating section 216, 217 Distribution table Update unit 221 Update control unit 222 Distribution table extraction unit 223 Code length change unit 224 Partition table storage unit 225 Distribution table synthesis unit 226 Code length comparison unit 231 Restoration unit 232 Candidate storage unit 233 Selector 234 Code table determination unit 235 List reference unit 236 Condition hold Department

Claims (11)

【特許請求の範囲】[Claims] 【請求項1】 圧縮対象のデータを所定長のビット列で
表される文字からなる文字列として受け取り、各文字に
可変長符号を割り当てることによって符号化するデータ
圧縮装置において、 キャノニカルハフマン符号を生成するための符号表に含
まれる符号の符号長の分布を示す符号長分布表を保持す
る分布表保持手段と、 前記データにおける各文字の出現確率に相当する情報に
基づく順位を保持する順位保持手段と、 前記文字列を構成する各文字を前記符号長分布表と前記
順位保持手段に保持された各文字の順位とに基づいて符
号化し、前記各文字に対応する符号からなる符号列を出
力する第1符号生成手段と、 前記文字列の入力に応じて、前記文字列を構成する各文
字について前記順位保持手段に保持された順位を更新す
る順位更新手段と、 前記文字列を構成する各文字の入力に応じて、前記分布
表保持手段に保持された符号長分布表を更新する分布表
更新手段とを備えたことを特徴とするデータ圧縮装置。
1. A data compression apparatus that receives data to be compressed as a character string composed of characters represented by a bit string of a predetermined length, and encodes the characters by assigning a variable length code to each character, wherein a canonical Huffman code is generated. Distribution table holding means for holding a code length distribution table indicating the distribution of code lengths of the codes included in the code table, and rank holding means for holding a rank based on information corresponding to the appearance probability of each character in the data And encoding each character constituting the character string based on the code length distribution table and the rank of each character held in the rank holding unit, and outputs a code string including codes corresponding to the respective characters. First code generating means, and a rank updating means for updating the rank held in the rank holding means for each character constituting the character string in response to the input of the character string , In response to an input of each character constituting the character string, the data compression apparatus is characterized in that a distribution table updating means for updating the code length distribution table held in the distribution table holding means.
【請求項2】 所定長のビット列で表される文字ごとに
可変長符号を割り当てることによって符号化された符号
列から元のデータを復元するデータ復元装置において、 キャノニカルハフマン符号を生成するための符号表に含
まれる各符号の符号長の分布を示す符号長分布表を保持
する分布表保持手段と、 前記データにおける各文字の出現確率に相当する情報に
基づく順位を保持する順位保持手段と、 前記符号列の入力に応じて、前記符号長分布表によって
特定される符号表と前記順位保持手段に保持された各文
字の順位とに基づいて、前記符号列を構成する各符号に
対応する文字を復元し、これらの文字からなる文字列を
出力する第1データ復元手段と、 前記文字列の入力に応じて、前記文字列を構成する各文
字について前記順位保持手段に保持された順位を更新す
る順位更新手段と、 前記文字列を構成する各文字の入力に応じて、前記分布
表保持手段に保持された符号長分布表を更新する分布表
更新手段とを備えたことを特徴とするデータ復元装置。
2. A data restoration apparatus for restoring original data from an encoded code string by assigning a variable length code to each character represented by a bit string of a predetermined length, wherein the data restoration apparatus generates a canonical Huffman code. A distribution table holding unit that holds a code length distribution table indicating a distribution of code lengths of the respective codes included in the code table, a rank holding unit that holds a rank based on information corresponding to an appearance probability of each character in the data, In response to the input of the code string, a character corresponding to each code constituting the code string based on the code table specified by the code length distribution table and the rank of each character held in the rank holding unit. First data restoring means for restoring a character string and outputting a character string composed of these characters; and in accordance with the input of the character string, the rank holding means for each character constituting the character string Rank updating means for updating the held rank; and distribution table updating means for updating a code length distribution table held in the distribution table holding means in response to input of each character constituting the character string. A data restoration device characterized by the above-mentioned.
【請求項3】 請求項1に記載のデータ圧縮装置または
請求項2に記載のデータ復元装置において、 分布表更新手段は、 符号表に相当する符号木において、出現確率の総和が1
/2であって注目文字に対応する符号に連なる枝を含ま
ない部分についての符号長分布を示す第1分布と、前記
符号木の他の部分において、出現確率の総和が1/4で
あって注目文字に対応する符号を含まない部分について
の符号長分布を示す第2分布と、出現確率の総和が1/
4であって前記注目文字に対応する符号を含む部分につ
いての符号長分布を示す第3分布とに、前記符号表に対
応する符号長分布表を分割する分割手段と、 前記第1分布に含まれる各符号の符号長を所定値だけ伸
長し、前記第3分布に含まれる各符号の符号長を所定値
だけ短縮する変更手段と、 前記変更手段によって変更された第1分布および第3分
布と前記第2分布とを合成し、新しい符号長分布表とし
て分布表保持手段に保持する合成手段とを備えた構成で
あることを特徴とするデータ圧縮装置またはデータ復元
装置。
3. The data compression device according to claim 1, or the data restoration device according to claim 2, wherein the distribution table updating means has a sum of appearance probabilities of 1 in a code tree corresponding to a code table.
/ 2, a first distribution indicating a code length distribution for a portion that does not include a branch connected to a code corresponding to a target character, and a sum of appearance probabilities in other portions of the code tree is 1/4. The second distribution indicating the code length distribution for the portion not including the code corresponding to the target character and the sum of the appearance probabilities are 1 /
Dividing means for dividing the code length distribution table corresponding to the code table into a third distribution indicating a code length distribution for a portion including a code corresponding to the target character; Changing means for expanding the code length of each code to be used by a predetermined value and shortening the code length of each code included in the third distribution by a predetermined value; and the first distribution and the third distribution changed by the changing means. A data compression device or a data decompression device, comprising: a synthesis unit that synthesizes the second distribution and holds the new code length distribution table in a distribution table holding unit.
【請求項4】 請求項3に記載のデータ圧縮装置または
データ復元装置において、 分布表更新手段は、変更手段によって符号長を変更され
た第3分布に対応する符号木の一部が更に分割可能であ
る場合に、この第3分布を分割対象の符号木を示す符号
長分布表として分割手段に入力する繰り返し制御手段を
備えた構成であることを特徴とするデータ圧縮装置また
はデータ復元装置。
4. The data compression device or data decompression device according to claim 3, wherein the distribution table updating unit is capable of further dividing a part of the code tree corresponding to the third distribution whose code length has been changed by the changing unit. A data compression device or a data decompression device characterized by comprising a repetition control means for inputting the third distribution to the dividing means as a code length distribution table indicating a code tree to be divided.
【請求項5】 請求項3に記載のデータ圧縮装置または
データ復元装置において、 分布表更新手段は、変更手段に入力された第1分布に所
定の符号長についての分布が含まれているときに、前記
変更手段による符号長の変更動作を制限する変更制限手
段を備えた構成であることを特徴とするデータ圧縮装置
またはデータ復元装置。
5. The data compression device or the data decompression device according to claim 3, wherein the distribution table updating unit is configured to execute a process when the first distribution input to the changing unit includes a distribution for a predetermined code length. A data compression device or a data decompression device, characterized in that the data compression device or the data decompression device is provided with a change restricting device for restricting a code length changing operation by the changing device.
【請求項6】 圧縮対象のデータを所定長のビット列で
表される文字からなる文字列として受け取り、各文字に
可変長符号を割り当てることによって符号化するデータ
圧縮装置において、 それぞれ相異なる統計的性質を持つ入力文字列に適合し
てキャノニカルハフマン符号を生成する複数の符号表を
符号表候補として保持する候補保持手段と、 前記符号表候補のいずれかを保持している符号表保持手
段と、 前記文字列を構成する各文字を前記符号表保持手段に保
持された符号表に基づいて符号化し、前記各文字に対応
する符号からなる符号列として出力する第2符号生成手
段と、 前記データにおける各文字の出現確率に相当する情報に
基づく順位を保持する順位保持手段と、 前記文字列を構成する各文字の入力に応じて前記順位保
持手段を参照し、前記各文字の順位に基づいて、前記符
号表候補のいずれかを選択して前記符号表保持手段に入
力する符号表選択手段と、 前記文字列の入力に応じて、前記文字列を構成する各文
字について前記順位保持手段に保持された順位を更新す
る順位更新手段とを備えたことを特徴とするデータ圧縮
装置。
6. A data compression apparatus that receives data to be compressed as a character string composed of characters represented by a bit string of a predetermined length, and encodes the characters by assigning a variable length code to each character. A candidate holding unit that holds a plurality of code tables that generate a canonical Huffman code in conformity with the input character string having as a code table candidate, and a code table holding unit that holds any of the code table candidates, A second code generation unit that encodes each character constituting the character string based on the code table held by the code table holding unit and outputs the code as a code string including codes corresponding to the characters; Order holding means for holding the order based on information corresponding to the appearance probability of each character; and the order holding means in response to input of each character constituting the character string. Code table selecting means for selecting any one of the code table candidates based on the order of each of the characters and inputting the selected code table to the code table holding means. A data compression device comprising: a rank updating unit for updating the rank held in the rank holding unit for each of the constituent characters.
【請求項7】 所定長のビット列で表される文字ごとに
可変長符号を割り当てることによって符号化された符号
列から元のデータを復元するデータ復元装置において、 それぞれ相異なる統計的性質を持つ入力文字列に適合し
てキャノニカルハフマン符号を生成する複数の符号表を
符号表候補として保持する候補保持手段と、 前記符号表候補のいずれかを保持している符号表保持手
段と、 データ圧縮によって得られた符号からなる符号列を受け
取り、前記符号表保持手段に保持された符号表に基づい
て、前記符号列を構成する各符号から元の各文字を復元
し、前記各文字からなる文字列として出力する第2デー
タ復元手段と、 前記データにおける各文字の出現確率に相当する情報に
基づく順位を保持する順位保持手段と、 前記文字列を構成する各文字の入力に応じて前記順位保
持手段を参照し、前記各文字の順位に基づいて、前記符
号表候補のいずれかを選択して前記符号表保持手段に入
力する符号表選択手段と、 前記文字列の入力に応じて、前記文字列を構成する各文
字について前記順位保持手段に保持された順位を更新す
る順位更新手段とを備えたことを特徴とするデータ復元
装置。
7. A data restoration apparatus for restoring original data from a coded code string by assigning a variable length code to each character represented by a bit string of a predetermined length. A candidate holding unit that holds a plurality of code tables that generate a canonical Huffman code in conformity with the character string as code table candidates; a code table holding unit that holds any of the code table candidates; A code string comprising the obtained codes is received, and based on the code table held by the code table holding means, the original characters are restored from the codes constituting the code string, and the character strings formed by the respective characters are restored. A second data restoring unit that outputs a character string; a rank holding unit that holds a rank based on information corresponding to an appearance probability of each character in the data; A code table selecting unit that refers to the rank holding unit in response to the input of each character, selects one of the code table candidates based on the rank of each character, and inputs the code table candidate to the code table holding unit; A data restoration device comprising: a rank updating unit that updates a rank held in the rank holding unit for each character constituting the character string in response to a character string input.
【請求項8】 圧縮対象のデータを所定長のビット列で
表される文字からなる文字列として受け取り、各文字に
可変長符号を割り当てることによって符号化するデータ
圧縮プログラムにおいて、 キャノニカルハフマン符号を生成するための符号表に含
まれる各符号の符号長の分布を示す符号長分布表と、 前記データにおける各文字の出現確率に相当する情報に
基づく順位を示す順位リストと、 圧縮対象のデータを所定長のビットパターンで表される
文字からなる文字列として受け取り、前記文字列を構成
する各文字を前記符号長分布表と前記順位リストで示さ
れる各文字の順位とに基づいて符号化し、前記各文字に
対応する符号からなる符号列を出力する第1符号生成手
順と、 前記文字列を構成する各文字の入力に応じて、前記順位
リストにおいて前記各文字に対応する順位を更新する順
位更新手順と、 前記文字列を構成する各文字の入力に応じて、前記符号
長分布表を更新する分布表更新手順とをコンピュータに
実行させるデータ圧縮プログラムを記録した記憶媒体。
8. A data compression program that receives data to be compressed as a character string composed of characters represented by a bit string of a predetermined length, and encodes the characters by assigning a variable length code to each character, generating a canonical Huffman code. A code length distribution table showing the distribution of the code lengths of the respective codes included in the code table, a rank list indicating a rank based on information corresponding to the appearance probability of each character in the data, Received as a character string consisting of characters represented by a long bit pattern, and encodes each character constituting the character string based on the code length distribution table and the order of each character shown in the order list. A first code generation step of outputting a code string consisting of codes corresponding to characters, and the order list according to input of each character constituting the character string Data for causing a computer to execute a rank update procedure for updating a rank corresponding to each character, and a distribution table update procedure for updating the code length distribution table in response to input of each character constituting the character string. A storage medium that stores a compression program.
【請求項9】 所定長のビット列で表される文字ごとに
可変長符号を割り当てることによって符号化された符号
列から元のデータを復元するデータ復元プログラムにお
いて、 キャノニカルハフマン符号を生成するための符号表に含
まれる各符号の符号長の分布を示す符号長分布表と、 前記データにおける各文字の出現確率に相当する情報に
基づくの順位を示す順位リストと、 データ圧縮によって得られた符号列の入力に応じて、前
記符号長分布表と前記順位リストで示された各文字の順
位とに基づいて、前記符号列を構成する各符号に対応す
る文字を復元し、これらの文字からなる文字列を出力す
る第1データ復元手順と、 前記文字列を構成する各文字の入力に応じて、前記順位
リストにおいて前記各文字に対応する順位を更新する順
位更新手順と、 前記文字列を構成する各文字の入力に応じて、前記符号
長分布表を更新する分布表更新手順とをコンピュータに
実行させるデータ復元プログラムを記録した記憶媒体。
9. A data restoration program for restoring original data from a coded code string by assigning a variable length code to each character represented by a bit string of a predetermined length, wherein the data recovery program generates a canonical Huffman code. A code length distribution table indicating the distribution of the code lengths of the respective codes included in the code table, a rank list indicating a rank based on information corresponding to an appearance probability of each character in the data, and a code string obtained by data compression In response to the input of, the character corresponding to each code constituting the code string is restored based on the code length distribution table and the order of each character shown in the order list, and the character consisting of these characters A first data restoring procedure for outputting a string, and a rank updating step for updating a rank corresponding to each of the characters in the rank list in response to an input of each character constituting the character string. Procedures and the character string in response to an input of each character constituting a storage medium in which a data recovery program for executing the distribution table update procedure of updating the code length distribution table to the computer.
【請求項10】 圧縮対象のデータを所定長のビット列
で表される文字からなる文字列として受け取り、各文字
に可変長符号を割り当てることによって符号化するデー
タ圧縮プログラムにおいて、 それぞれ相異なる統計的性質を持つ入力文字列に適合し
てキャノニカルハフマン符号を生成する符号表として利
用可能な複数の符号表候補と、 前記符号表候補のいずれかを符号表として保持する符号
表保持手順と、 圧縮対象のデータを所定長のビットパターンで表される
文字からなる文字列として受け取り、前記文字列を構成
する各文字を前記符号表保持手順において保持した符号
表に基づいて符号化し、前記各文字に対応する符号から
なる符号列として出力する第2符号生成手順と、 前記データにおける各文字の出現確率に相当する情報に
基づく順位を示す順位リストと、 前記文字列を構成する各文字の入力に応じて前記順位リ
ストを参照し、前記各文字の順位に基づいて、前記符号
表候補のいずれかを選択して前記符号表保持手順に渡す
符号表選択手順と、 前記文字列を構成する各文字の入力に応じて、前記順位
リストにおいて前記各文字に対応する順位を更新する順
位更新手順と、 をコンピュータに実行させるデータ圧縮プログラムを記
録した記憶媒体。
10. A data compression program that receives data to be compressed as a character string composed of characters represented by a bit string of a predetermined length, and encodes the characters by assigning a variable length code to each character. A plurality of code table candidates that can be used as a code table that generates a canonical Huffman code in conformity with an input character string having, a code table holding procedure that holds any of the code table candidates as a code table, and a compression target. Is received as a character string composed of characters represented by a bit pattern of a predetermined length, and each character constituting the character string is encoded based on the code table held in the code table holding procedure, and corresponding to each character. A second code generation step of outputting as a code string composed of codes to be changed, and information based on information corresponding to the appearance probability of each character in the data A rank list indicating the rank, and referring to the rank list in response to the input of each character constituting the character string, selecting one of the code table candidates based on the rank of each character, and selecting the code. A code table selecting procedure to be passed to a table holding procedure; and a rank updating procedure for updating a rank corresponding to each of the characters in the rank list in response to an input of each character constituting the character string. A storage medium that stores a compression program.
【請求項11】 所定長のビット列で表される文字ごと
に可変長符号を割り当てることによって符号化された符
号列から元のデータを復元するデータ復元プログラムに
おいて、 それぞれ相異なる統計的性質を持つ入力文字列に適合し
てキャノニカルハフマン符号を生成する符号表として利
用可能な複数の符号表候補と、 前記符号表候補のいずれかを符号表として保持する符号
表保持手順と、 データ圧縮によって得られた符号からなる符号列を受け
取り、前記符号表保持手順において保持された符号表に
基づいて、前記符号列を構成する各符号から元の各文字
を復元し、前記各文字からなる文字列として出力する第
2データ復元手順と、 前記文字列における各文字の出現確率に相当する情報に
基づく順位を示す順位リストと、 前記文字列を構成する各文字の入力に応じて前記順位リ
ストを参照し、前記各文字の順位に基づいて、前記符号
表候補のいずれかを選択して前記符号表保持手順に渡す
符号表選択手順と、 前記文字列を構成する各文字の入力に応じて、前記順位
リストにおいて前記各文字に対応する順位を更新する順
位更新手順と、 をコンピュータに実行させるデータ復元プログラムを記
録した記憶媒体。
11. A data restoration program for restoring original data from a coded code string by assigning a variable length code to each character represented by a bit string of a predetermined length, comprising: A plurality of code table candidates that can be used as a code table that generates a canonical Huffman code in conformity with a character string, a code table holding procedure that holds any of the code table candidates as a code table, and a data table obtained by data compression. Receiving the code string composed of the characters, and restoring each original character from each code constituting the code string based on the code table held in the code table holding procedure, and outputting it as a character string composed of each character A second data restoration procedure, a ranking list indicating a ranking based on information corresponding to an appearance probability of each character in the character string, and a character string. A code table selecting step of selecting one of the code table candidates based on the rank of each character and passing the code table candidate to the code table holding procedure, A storage medium which stores a data restoration program for causing a computer to execute: a rank update procedure for updating a rank corresponding to each character in the rank list in response to an input of each character constituting a column.
JP31571299A 1999-11-05 1999-11-05 Data compression/decompression device and storage medium with data compression/decompression program recorded thereon Withdrawn JP2001136075A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP31571299A JP2001136075A (en) 1999-11-05 1999-11-05 Data compression/decompression device and storage medium with data compression/decompression program recorded thereon

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP31571299A JP2001136075A (en) 1999-11-05 1999-11-05 Data compression/decompression device and storage medium with data compression/decompression program recorded thereon

Publications (1)

Publication Number Publication Date
JP2001136075A true JP2001136075A (en) 2001-05-18

Family

ID=18068639

Family Applications (1)

Application Number Title Priority Date Filing Date
JP31571299A Withdrawn JP2001136075A (en) 1999-11-05 1999-11-05 Data compression/decompression device and storage medium with data compression/decompression program recorded thereon

Country Status (1)

Country Link
JP (1) JP2001136075A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003101417A (en) * 2001-09-25 2003-04-04 Ricoh Co Ltd Encoding device, encoding method and decoding device
US7515762B2 (en) 2003-05-27 2009-04-07 Zaxel Systems, Inc. Method and apparatus for lossless data transformation with preprocessing by adaptive compression, multidimensional prediction, multi-symbol decoding enhancement enhancements
JP2010093414A (en) * 2008-10-06 2010-04-22 Fujitsu Ltd Program, apparatus and method for processing information
US9397696B2 (en) 2014-07-22 2016-07-19 Fujitsu Limited Compression method, compression device, and computer-readable recording medium
JP2017528015A (en) * 2014-06-09 2017-09-21 ティダル システムズ, インク.Tidal Systems, Inc. Apparatus and method for efficient Huffman coding in VLSI
JP2019534602A (en) * 2016-09-23 2019-11-28 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation System level testing of entropy encoding
CN110868223A (en) * 2019-12-06 2020-03-06 广东海洋大学 Method and circuit for realizing numerical operation of Huffman coding
CN117060930A (en) * 2023-10-12 2023-11-14 广东至盈科技有限公司 Data intelligent communication system for docking station

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003101417A (en) * 2001-09-25 2003-04-04 Ricoh Co Ltd Encoding device, encoding method and decoding device
JP4570006B2 (en) * 2001-09-25 2010-10-27 株式会社リコー Encoding apparatus, encoding method, and decoding apparatus
US7515762B2 (en) 2003-05-27 2009-04-07 Zaxel Systems, Inc. Method and apparatus for lossless data transformation with preprocessing by adaptive compression, multidimensional prediction, multi-symbol decoding enhancement enhancements
JP2010093414A (en) * 2008-10-06 2010-04-22 Fujitsu Ltd Program, apparatus and method for processing information
US10230393B2 (en) 2014-06-09 2019-03-12 Tidal Systems, Inc. VLSI efficient Huffman encoding apparatus and method
JP2017528015A (en) * 2014-06-09 2017-09-21 ティダル システムズ, インク.Tidal Systems, Inc. Apparatus and method for efficient Huffman coding in VLSI
US9397696B2 (en) 2014-07-22 2016-07-19 Fujitsu Limited Compression method, compression device, and computer-readable recording medium
JP2019534602A (en) * 2016-09-23 2019-11-28 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation System level testing of entropy encoding
JP6990881B2 (en) 2016-09-23 2022-01-12 インターナショナル・ビジネス・マシーンズ・コーポレーション System level test of entropy encoding
CN110868223A (en) * 2019-12-06 2020-03-06 广东海洋大学 Method and circuit for realizing numerical operation of Huffman coding
CN110868223B (en) * 2019-12-06 2023-10-27 广东海洋大学 Numerical operation implementation method and circuit for Huffman coding
CN117060930A (en) * 2023-10-12 2023-11-14 广东至盈科技有限公司 Data intelligent communication system for docking station
CN117060930B (en) * 2023-10-12 2024-02-06 广东至盈科技有限公司 Data intelligent communication system for docking station

Similar Documents

Publication Publication Date Title
JP3278297B2 (en) Data compression method, data decompression method, data compression device, and data decompression device
US5844508A (en) Data coding method, data decoding method, data compression apparatus, and data decompression apparatus
Yang et al. Efficient universal lossless data compression algorithms based on a greedy sequential grammar transform. I. Without context models
Elias Interval and recency rank source coding: Two on-line adaptive variable-length schemes
Horspool et al. Constructing Word-Based Text Compression Algorithms.
JP3238854B2 (en) Data compression method and data compression device, and data decompression method and data decompression device
JP3276860B2 (en) Data compression / decompression method
JP3083730B2 (en) System and method for compressing data information
JP3397431B2 (en) Data compression method and device and data decompression method and device
JP2002319865A (en) Encoding method for using prefix prediction
JP2004515096A (en) How to perform Huffman decoding
US6304676B1 (en) Apparatus and method for successively refined competitive compression with redundant decompression
JPH09505707A (en) Data compression
US6636167B1 (en) Method of generating Huffman code length information
JP2001136075A (en) Data compression/decompression device and storage medium with data compression/decompression program recorded thereon
JP3442217B2 (en) High-speed variable-length code decoding device
US20220368345A1 (en) Hardware Implementable Data Compression/Decompression Algorithm
JP2536422B2 (en) Data compression device and data decompression device
US7193542B2 (en) Digital data compression robust relative to transmission noise
Rueda et al. Stochastic automata-based estimators for adaptively compressing files with nonstationary distributions
Ryabko et al. Fast adaptive arithmetic code for large alphabet sources with asymmetrical distributions
CN114429200A (en) Standardized Huffman coding and decoding method and neural network computing chip
Hoang et al. Dictionary selection using partial matching
Sabuj et al. A Modified Approach to Huffman Algorithm for Unequal Bit Costs
Pathak et al. Data compression scheme of dynamic Huffman code for different languages

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20070109