JPH04280517A - Data compression and restoring system - Google Patents

Data compression and restoring system

Info

Publication number
JPH04280517A
JPH04280517A JP4360491A JP4360491A JPH04280517A JP H04280517 A JPH04280517 A JP H04280517A JP 4360491 A JP4360491 A JP 4360491A JP 4360491 A JP4360491 A JP 4360491A JP H04280517 A JPH04280517 A JP H04280517A
Authority
JP
Japan
Prior art keywords
code
dictionary
character
character string
arithmetic
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
JP4360491A
Other languages
Japanese (ja)
Inventor
Shigeru Yoshida
茂 吉田
Yoshiyuki Okada
佳之 岡田
Yasuhiko Nakano
泰彦 中野
Hirotaka Chiba
広隆 千葉
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 JP4360491A priority Critical patent/JPH04280517A/en
Publication of JPH04280517A publication Critical patent/JPH04280517A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/005Statistical coding, e.g. Huffman, run length coding

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

PURPOSE:To attain efficient data compression and restoration by an arithmetic coding system to multi-value data in a data compression system applying arithmetic coding to a data such as a character code or a picture data. CONSTITUTION:The data compression and restoring system in which the inputted character string is coded by an arithmetic code and data compression and restoration are implemented is provided with an SOR coding section (1) rearranges a character string with a higher frequency of occurrence to have a smaller registration number in a dictionary every time a character string is entered and coding the character string according to the registration number in the character string and an arithmetic coding section (2) receiving a code outputted from the SOR coding section (1) and applying the arithmetic coding to the character string and is featured to encode the input character string with the SOR code and encode the code with the arithmetic code.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明は,文字コード,画像デー
タ等のデータを算術符号化するデータ圧縮方式に関する
。文字コード,画像データ等の様々な種類のデータがコ
ンピュータで扱われるようになるのにともない,取り扱
われるデータ量も増大している。そのような大量のデー
タの処理においては,記憶容量を減らしたり,遠隔地へ
の伝送を可能とするためには,データ中の冗長な部分を
省いて圧縮して記憶するもしくはデータ転送等を行うよ
うにすることが望まれる。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data compression method for arithmetic encoding data such as character codes and image data. As computers begin to handle various types of data such as character codes and image data, the amount of data handled is also increasing. When processing such large amounts of data, in order to reduce storage capacity or enable transmission to remote locations, it is necessary to omit redundant parts of the data and compress it for storage or data transfer. It is desirable to do so.

【0002】様々な種類のデータ(文字コード,画像デ
ータ等)に適用できるデータ圧縮方式として,ユニバー
サル符号による方式がある。ユニバーサル符号化方式に
は様々な方法があるが,代表的な方法として算術符号化
方式がある。本発明は,多値データを算術符号化方式に
より,効率的にデータ圧縮および復元する方式を提供す
ることを目的とする。
[0002] As a data compression method that can be applied to various types of data (character codes, image data, etc.), there is a method using universal codes. There are various universal encoding methods, but a typical one is the arithmetic encoding method. An object of the present invention is to provide a method for efficiently compressing and restoring multivalued data using an arithmetic coding method.

【0003】0003

【従来の技術】算術符号化方式は,情報源の文字の出現
頻度が分かっている場合に,最大の効率で圧縮できるも
のである。ユニバーサル符号においては,文書データに
おける文字コードのみならず画像データ等のデータの圧
縮にも適用でき,以下の説明においては,データの1ワ
ード単位を文字とよび,データの任意ワードがつながっ
たものを文字列と呼ぶ。
BACKGROUND OF THE INVENTION Arithmetic encoding systems can achieve maximum compression when the frequency of appearance of characters in an information source is known. Universal codes can be applied not only to character codes in document data, but also to compression of data such as image data.In the following explanation, one word of data is referred to as a character, and a string of arbitrary words of data is referred to as a character. It's called a string.

【0004】多値算術符号について,図7により説明す
る。図7(A)は入力文字がa,b,c,dの4文字よ
りなる場合の各シンボル(文字)の出現頻度を示す。図
(B)はシンボルと出現頻度の累積を示す。図(C)は
,算術符号化を示す。多値算術化は,入力データの文字
列を数直線〔0,1〕の一点に対応付けて,一個の符号
で表す符号化法である。符号化の例として,簡単のため
,a,b,c,dの4個の文字だけよりなる情報源を考
える。
Multivalued arithmetic codes will be explained with reference to FIG. FIG. 7(A) shows the appearance frequency of each symbol (character) when the input characters consist of four characters a, b, c, and d. Figure (B) shows the symbols and the cumulative appearance frequency. Figure (C) shows arithmetic encoding. Multi-value arithmetic is an encoding method that associates a character string of input data with one point on a number line [0, 1] and represents it with one code. As an example of encoding, for the sake of simplicity, consider an information source consisting of only four characters, a, b, c, and d.

【0005】図(A)に示されるように,各シンボルの
出現頻度(全出現回数を各シンボル毎に出現回数で割っ
て,確率としてある)が図示のようであったとする。次
に,頻度順にシンボルの並び替えを行い,図(B)に示
すように,頻度の高い方から順に累積確率を算出する(
頻度の一番高いcはb,d,aの出現頻度(確率)を累
積しbはd,aの出現頻度を累積し,dはaの出現頻度
を累積する)。
Assume that the appearance frequency of each symbol (probability is calculated by dividing the total number of appearances by the number of appearances for each symbol) is as shown in FIG. Next, the symbols are rearranged in order of frequency, and the cumulative probabilities are calculated in descending order of frequency, as shown in Figure (B).
c, which has the highest frequency, accumulates the appearance frequency (probability) of b, d, and a, b accumulates the appearance frequency of d and a, and d accumulates the appearance frequency of a).

【0006】そこで,シンボル(文字)cが入力される
と,図(C)に示されるように,区間〔0,1〕をcの
累積頻度により分割した区間50が選択される。次にシ
ンボルaが入力されると,区間50を各シンボルaの累
積出現頻度(累積出現頻度の最大値は1に規格化する)
により求めたシンボルaに対応する区間51を選択する
。次に,シンボルdが入力されると,区間51よりシン
ボルdの累積頻度で分割した区間52が選択され,区間
52の任意値(区間52の上端と下端の間の任意の値)
を符号として出力する。
[0006] Therefore, when symbol (character) c is input, as shown in Figure (C), an interval 50 obtained by dividing the interval [0, 1] according to the cumulative frequency of c is selected. Next, when symbol a is input, interval 50 is the cumulative appearance frequency of each symbol a (the maximum value of cumulative appearance frequency is normalized to 1)
The section 51 corresponding to the symbol a obtained by is selected. Next, when symbol d is input, an interval 52 divided by the cumulative frequency of symbol d is selected from interval 51, and an arbitrary value of interval 52 (any value between the upper and lower ends of interval 52) is selected.
Outputs as a sign.

【0007】区間の下端は次の式により求める。新たな
部分区間の下端=現部分区間の下端+現部分区間幅×出
現文字の累積確率新たな部分区間幅=現部分区間幅×出
現文字の確率また,符号語の復元は,符号語が各文字の
確率に分けたどの区間に含まれるか,逐次再分割しなが
ら調べることによって,元の文字(シンボル)列を復元
することができる。
The lower end of the interval is determined by the following equation. Lower end of new subinterval = Lower end of current subinterval + Current subinterval width × Cumulative probability of appearing characters New subinterval width = Current subinterval width × Probability of appearing characters Also, in codeword restoration, each codeword is The original string of characters (symbols) can be restored by sequentially re-dividing and checking which interval the characters are included in based on their probabilities.

【0008】多値算術符号化によれば,出現頻度が高い
文字列程,最終区間の幅が大きくなり,短い符号により
表せるため,データ量が圧縮される。また,この方法は
,符号語のビット表現に最小単位の制約がなく,最小単
位を1ビット以下に取ることができるため,効率の高い
圧縮ができる。
According to multilevel arithmetic coding, the more frequently a character string appears, the larger the width of the final section becomes, and it can be represented by a shorter code, thereby compressing the amount of data. Furthermore, in this method, there is no restriction on the minimum unit for the bit representation of the code word, and the minimum unit can be set to one bit or less, so highly efficient compression can be achieved.

【0009】図8は算術符号化の装置構成を示す。図に
おいて,60は頻度順並び替え部,61は頻度をカウン
トするカウンタ,62は頻度順に並び替えられたシンボ
ルと識別番号よりなる辞書,63はカウンタから出力さ
れる累積出現頻度と頻度並び替え部から出力される識別
番号とにより算術符号化する算術符号部である。
FIG. 8 shows the configuration of an arithmetic encoding device. In the figure, 60 is a frequency sorting unit, 61 is a counter that counts frequencies, 62 is a dictionary consisting of symbols and identification numbers sorted in frequency order, and 63 is a cumulative appearance frequency output from the counter and a frequency sorting unit. This is an arithmetic code section that performs arithmetic coding using the identification number output from the .

【0010】図の構成の動作を説明する。入力文字列よ
り,1文字入力する毎に,カウンタ61は出現頻度をカ
ンウトする。頻度並び替え部60は出現頻度順にシンボ
ルの並び替えを行い,辞書62を書き替える。そして,
算術符号部63は,入力された文字の累積頻度に区間幅
と累積出現確率に基づいて,区間の上端と下端を求め,
区間の任意の値を符号として出力する。
The operation of the configuration shown in the figure will be explained. Each time one character is input from the input character string, the counter 61 counts the frequency of appearance. The frequency sorting unit 60 sorts the symbols in order of appearance frequency and rewrites the dictionary 62. and,
The arithmetic code unit 63 calculates the upper and lower ends of the interval based on the cumulative frequency of the input characters, the interval width and the cumulative appearance probability, and calculates the upper and lower ends of the interval.
Outputs any value in the interval as a sign.

【0011】図9および図10に算術符号化のフローを
示す。初期値は,上端=1,下端=0,区間幅=1.0
とする。cum〔i〕は識別番号i(出現頻度を大きさ
の順に並べ替えたi番目)の出現頻度を表す。cum 
 freq〔i〕はi番目の累積頻度であり,cum 
 freq〔i〕はcum〔i〕からcum〔N〕まで
の累積出現頻度を表す。cum  freq〔1〕=1
,cum  freq〔N〕=0に正規化する。
FIGS. 9 and 10 show the flow of arithmetic encoding. Initial values are upper end = 1, lower end = 0, section width = 1.0
shall be. cum[i] represents the appearance frequency of identification number i (the i-th appearance frequency sorted in order of magnitude). cum
freq[i] is the i-th cumulative frequency, cum
freq[i] represents the cumulative appearance frequency from cum[i] to cum[N]. cum freq[1]=1
, cum freq[N]=0.

【0012】図9は出現文字についての履歴を考慮しな
い場合(一重履歴)の多値算術符号化のフローを示す。 S1  (1)辞書Dの各スロットに全ての単一文字を
割りつける。D(i)=i(i=1,2,・・・A),
但し,Aはアルファベットの大きさ(アルファベットお
よび記号等の数)で,最大256をとる。 (2)  各文字に番号を割りつける。I(i)=i(
i=1,2,・・・,A)。 (3)  出現頻度を初期化する。freq(i)=1
(i=1,2,・・・,A)。 (4)  累積出現頻度を初期化する。cum  fr
eq(i)=A−1(i=1,2,・・・,A,累積出
現頻度は,全ての値を異ならしめておく必要があるため
このように初期化する。) S2  一文字kを入力する。 S3  j=I(k),i=D(j)により入力した文
字のスロット(区間)を求め,番号jを算術符号化する
FIG. 9 shows the flow of multilevel arithmetic encoding when the history of appearing characters is not considered (single history). S1 (1) Assign all single characters to each slot of dictionary D. D(i)=i(i=1,2,...A),
However, A is the size of the alphabet (the number of alphabets and symbols, etc.), which can be up to 256. (2) Assign a number to each character. I(i)=i(
i=1, 2, ..., A). (3) Initialize the appearance frequency. freq(i)=1
(i=1, 2,...,A). (4) Initialize the cumulative appearance frequency. cum fr
eq(i) = A-1 (i = 1, 2, ..., A, the cumulative frequency of appearance is initialized like this because all values must be different.) S2 Input one character k do. S3 Find the slot (section) of the input character using j=I(k) and i=D(j), and arithmetic encode the number j.

【0013】S4  出現頻度順にスロットに対応する
文字を入れ替える。番号がjより小さいシンボルのうち
で,j番目のシンボルと出現頻度が異なるシンボルを求
める。即ち,freq(r)!=freq(j)となる
最大のr(<j)を見つける(!は異なることを意味す
る)。さらに,出現頻度のr番目のスロットの文字の識
別番号がI(r)=s,累積出現頻度のスロットのr番
目に対応する文字の識別番号がtであるとする((D(
r))=t)。そこで,r番目とj番目を入れ替える。 即ち,I(j)=S(識別番号sの文字),D(j)=
t,I(r)=j,D(r)=i(=D(j))。 S5    出現頻度,累積出現頻度を1インクリメン
トする。但し,累積出現頻度はr以下の全てのスロット
について1インクリメントする。S2以下を繰り返す。
S4: Replace the characters corresponding to the slots in order of appearance frequency. Among the symbols whose number is smaller than j, find a symbol whose appearance frequency is different from the j-th symbol. That is, freq(r)! Find the largest r(<j) such that = freq(j) (! means different). Furthermore, suppose that the identification number of the character in the r-th slot of appearance frequency is I(r)=s, and the identification number of the character corresponding to the r-th slot of cumulative appearance frequency is t ((D(
r))=t). Therefore, the r-th and j-th are exchanged. That is, I(j)=S (character of identification number s), D(j)=
t, I(r)=j, D(r)=i(=D(j)). S5 Increment the appearance frequency and cumulative appearance frequency by 1. However, the cumulative appearance frequency is incremented by 1 for all slots below r. Repeat S2 and subsequent steps.

【0014】図10は,出現文字に二重履歴を考慮した
場合のフローを示す。二重履歴を考慮する場合には,連
続する二文字の組合わせを考慮し,各文字毎に辞書を作
成し,さらに各文字毎に続く文字の出現頻度を二番目の
文字毎に記録するようにする。例えば,文字aの辞書に
は,aに続いて出現した文字(abに対するb,acに
対するc等)aに続く文字毎に出現頻度を求め,記録す
るようにする。
FIG. 10 shows a flow when double history is taken into account for characters that appear. When considering double history, consider the combination of two consecutive characters, create a dictionary for each character, and record the frequency of occurrence of the character following each character for each second character. Make it. For example, in a dictionary for the character a, the appearance frequency of each character following a (such as b for ab, c for ac, etc.) is determined and recorded.

【0015】そこで,辞書Dのスロットには,文字pに
対して続く文字i毎に,D(p,i)(p,i=1,2
,・・・,A)(Aはアルファベットの大きさ(数))
を割り付ける。また,各文字に割りつける番号はI(p
,i)(p,i=1,2,・・・,A)とする。上記の
点以外,図9のフローと異ならないので,説明は省略す
る。
Therefore, in the slot of dictionary D, for each character i following character p, D(p, i) (p, i=1, 2
,...,A) (A is the size of the alphabet (number))
Assign. Also, the number assigned to each character is I(p
, i) (p, i=1, 2, . . . , A). Other than the above points, the flow is no different from the flow in FIG. 9, so the explanation will be omitted.

【0016】[0016]

【発明が解決しようとする課題】上記のように,算術符
号化においては,文字が入力される度に出現頻度の並び
替えを行う必要があり,この処理は長時間を要するもの
であった。そのため,従来の算術符号化は,高い圧縮率
は得られるが,時間的には能率の悪いものであった。本
発明は,算術符号化を高速に行うデータ圧縮および復元
方式を提供することを目的とする。
[Problems to be Solved by the Invention] As mentioned above, in arithmetic encoding, it is necessary to rearrange the frequency of appearance each time a character is input, and this process takes a long time. Therefore, although conventional arithmetic coding can achieve a high compression ratio, it is inefficient in terms of time. An object of the present invention is to provide a data compression and restoration method that performs arithmetic encoding at high speed.

【0017】[0017]

【課題を解決するための手段】本発明は,出現頻度の高
い文字が,常に小さい番号で符号化される自己組織化規
則に基づく符号化方法(以後,SOR符号と称する)に
より,まず入力文字列を符号化し,SOR符号を算術符
号化するようにした。
[Means for Solving the Problems] The present invention first uses an encoding method (hereinafter referred to as SOR code) based on self-organizing rules in which frequently appearing characters are always encoded with a small number to encode input characters. The sequence is encoded, and the SOR code is arithmetic encoded.

【0018】本発明の説明をするのに先立って,SOR
符号について説明する。SOR符号化方法は,入力デー
タ中に出現した文字列単位に辞書に登録し,繰り返し現
れた文字列を辞書における同じ文字列の登録番号により
表して符号化し,登録番号を出現し易い文字列程小さい
番号になるように,文字入力毎に動的に辞書を更新する
ようにしたものである。
[0018] Prior to explaining the present invention, the SOR
The symbols will be explained. In the SOR encoding method, each character string that appears in input data is registered in a dictionary, and repeated character strings are represented and encoded by the registration number of the same character string in the dictionary, and the registration number is assigned to the character strings that appear more frequently. The dictionary is dynamically updated each time a character is input so that the number becomes smaller.

【0019】図11は自己組織化符号化規則に基づく符
号化方法(SOR符号化方法)を示す。図(A)は自己
組織化法のうちMTF(Move To Front 
)法を示す。入力文字はa,b,c,dの4通りであっ
て,図示の入力データ‘abacbc・・・ad’を符
号化する場合を考える。 (1)第1番目の文字aを符号1aで出力し,辞書の番
号1に登録する。 (2)第2番目の文字bを符号2bで出力し,辞書には
,前に登録番号1で文字aを登録番号2に下げ,bを登
録番号1で登録する。 (3)第3番目の文字aを符号2で出力する。そして,
辞書には,aを登録番号1で登録し,bを登録番号2と
する。
FIG. 11 shows an encoding method (SOR encoding method) based on self-organizing encoding rules. Figure (A) shows the MTF (Move To Front) self-assembly method.
) show the law. There are four types of input characters, a, b, c, and d, and a case will be considered in which the illustrated input data 'abacbc...ad' is encoded. (1) Output the first character a as code 1a and register it as number 1 in the dictionary. (2) Output the second character b with the code 2b, lower the character a with the registration number 1 to the registration number 2, and register b with the registration number 1 in the dictionary. (3) Output the third character a with code 2. and,
In the dictionary, a is registered with registration number 1, and b is registered with registration number 2.

【0020】(4)第4番目の入力文字cを符号3cで
出力する。そして,辞書には,cを登録番号1,aを登
録番号2,bを登録番号3で登録する。 (5)第5番目の文字bを3で出力する。そして,辞書
には,bを登録番号1,cを登録番号2,aを登録番号
3で登録する。 以下同様に,出現した文字を辞書の登録番号により符号
化するとともに,辞書を更新し,出現した文字を登録番
号1で登録する。
(4) Output the fourth input character c with the symbol 3c. Then, c is registered with registration number 1, a with registration number 2, and b with registration number 3 in the dictionary. (5) Output the fifth character b as 3. Then, in the dictionary, b is registered with registration number 1, c with registration number 2, and a with registration number 3. Similarly, the characters that appear are encoded using the registration number of the dictionary, the dictionary is updated, and the characters that appear are registered with the registration number 1.

【0021】図11(b) は,自己組織化法のうちの
TR(Transpose)法を示す。入力文字がa,
b,c,dの4通りで,図示のような文字列‘abac
b・・・ad’を符号化する場合について示す。 (1)第1番目の文字aを符号1aで出力し,aを登録
番号1で辞書に登録する。 (2)第2番目の文字bを符号2bで出力し,bを辞書
に登録番号2で登録する。 (3)第3番目の文字aを符号1で出力する。 (4)第4番目の文字cを符号3cで出力し,cを辞書
に登録番号3で登録する。
FIG. 11(b) shows the TR (Transpose) method among the self-assembly methods. The input character is a,
There are four types, b, c, and d, and the character string 'abac' as shown in the diagram
The case where b...ad' is encoded will be described. (1) Output the first character a with the code 1a, and register a with the registration number 1 in the dictionary. (2) Output the second character b with code 2b, and register b in the dictionary with registration number 2. (3) Output the third character a with the code 1. (4) Output the fourth character c with code 3c and register c in the dictionary with registration number 3.

【0022】(5)第5番目の文字bを符号2で出力し
,辞書におけるbの登録番号を1つ繰上げ,そのaの登
録番号1つ繰り下げる。 (6)第6番目の文字cを符号3で出力し,cの辞書に
おける番号を1つ繰上げ,aを1つ繰り下げる。 (7)第7番目の文字aを符号3で出力し,aの辞書に
おける番号を1つ繰り上げ,cを1繰り下げる。
(5) Output the fifth character b with code 2, increment the registration number of b in the dictionary by one, and decrement the registration number of a by one. (6) Output the sixth character c with the code 3, increment the number of c in the dictionary by one, and decrement a by one. (7) Output the seventh character a with code 3, increment a's number in the dictionary by one, and decrement c by one.

【0023】以下同様に,出現した文字を辞書の登録番
号により符号化するとともに,出現した文字の登録番号
を1つ繰り上げて登録する。上記のような,自己組織化
法によれば,並び替えにより頻繁に現れる文字程,登録
番号が小さくなり,小さい登録番号程,短いビット数で
表すようにすれば,出力符号のデータ量を削減すること
ができる。また,SOR符号化方法では,出現頻度の高
い文字程,辞書の先頭に近い位置に置かれているので,
SOR符号を算術符号化する場合には,算術符号化にお
ける出現頻度の並び替え処理の負担を軽減することがで
きる。
[0023] Similarly, the characters that appear are encoded using the registration numbers in the dictionary, and the registration numbers of the characters that appear are incremented by one and registered. According to the above-mentioned self-organization method, the more frequently appearing characters are rearranged, the smaller the registration number will be, and the smaller the registration number, the smaller the number of bits it will represent, which will reduce the amount of data in the output code. can do. In addition, in the SOR encoding method, the more frequently appearing characters are placed closer to the beginning of the dictionary, so
When the SOR code is arithmetic encoded, it is possible to reduce the burden of sorting the appearance frequencies in the arithmetic encoding.

【0024】図1により,本発明の基本構成を示す。図
において,1はSOR符号化部,2は多値算術符号化部
,3は文字列を登録番号に対応付けて登録した辞書,4
は累積頻度をカウントするカウンタである。5は入力文
字列について,辞書を検索することおよび新たに出現し
た文字列について辞書に登録する検索・登録部,6は文
字列の辞書における登録番号を並び替える辞書並び替え
部である。
FIG. 1 shows the basic configuration of the present invention. In the figure, 1 is an SOR encoding unit, 2 is a multi-level arithmetic encoding unit, 3 is a dictionary in which character strings are registered in correspondence with registration numbers, and 4
is a counter that counts cumulative frequency. Reference numeral 5 designates a search/registration unit that searches a dictionary for input character strings and registers newly appearing character strings in the dictionary, and 6 a dictionary rearrangement unit that rearranges the registration numbers of character strings in the dictionary.

【0025】[0025]

【作用】図1の構成の動作を説明する。SOR符号化部
1に入力された,文字列は検索・登録部5で辞書3を参
照される。そして,辞書に同じ文字列があれば,その登
録番号をSOR符号として出力する。また,入力された
文字列が未登録であれば,検索・登録部5はその文字列
を辞書3に登録し,入力文字列を生データとして出力す
る。さらに,辞書並び替え部6は,MTR方もしくはT
R方等の自己組織化の規則に従って,辞書を更新し,辞
書における文字列の登録番号の並び替えを行う。
[Operation] The operation of the configuration shown in FIG. 1 will be explained. The character string input to the SOR encoding unit 1 is referred to the dictionary 3 by the search/registration unit 5. If the same character string exists in the dictionary, its registration number is output as an SOR code. Furthermore, if the input character string is unregistered, the search/registration unit 5 registers the character string in the dictionary 3 and outputs the input character string as raw data. Furthermore, the dictionary sorting unit 6 is configured to use MTR or T
The dictionary is updated according to self-organization rules such as R-way, and the registration numbers of character strings in the dictionary are rearranged.

【0026】SOR符号化部1から出力されるSOR符
号は,多値算術符号化部2に入力される。一方,カウン
タ4は各文字列の出現頻度および累積頻度をカウントし
,多値算術符号化部2に入力する。多値算術符号化部2
は,入力されたSOR符号を文字列の番号および累積出
現頻度等に基づいて,区間幅,入力さた文字列に対応す
る区間の上端,下端の数値を求め,区間の間の任意の数
値を符号として出力する。
The SOR code output from the SOR encoder 1 is input to the multilevel arithmetic encoder 2. On the other hand, the counter 4 counts the appearance frequency and cumulative frequency of each character string, and inputs the count to the multilevel arithmetic encoding unit 2. Multilevel arithmetic encoding unit 2
calculates the interval width, the upper and lower ends of the interval corresponding to the input character string based on the input SOR code, the number of the character string, the cumulative appearance frequency, etc., and calculates any numerical value between the intervals. Output as sign.

【0027】[0027]

【実施例】図2〜図6により本発明の実施例を説明する
。本発明では,SOR符号化において,辞書を参照して
得られた文字列の登録番号を,小さい登録番号程短い符
号長で表す可変長符号とする。図2は,本発明の登録番
号の可変長化符号化方法を示す。図(a) は,可変長
符号の例を示す。シンボルa,b,c,dの出現確率を
0.5,0.25,0.15,0.1であるとすると,
aにたいしては符号「1」,bにたいては符号「01」
,cに対しては「001」,dに対しては「000」の
ように,出現度の高いシンボルに対しては,短い符号,
出現頻度の低いシンボルに対しては,長い符号を割り当
てるように可変長符号により符号化することによりデー
タの圧縮率を向上させることができる。
[Embodiment] An embodiment of the present invention will be explained with reference to FIGS. 2 to 6. In the present invention, in SOR encoding, the registration number of a character string obtained by referring to a dictionary is used as a variable length code in which the smaller the registration number, the shorter the code length. FIG. 2 shows a variable length encoding method for registration numbers according to the present invention. Figure (a) shows an example of a variable length code. Assuming that the appearance probabilities of symbols a, b, c, and d are 0.5, 0.25, 0.15, and 0.1,
Code “1” for a, code “01” for b
, "001" for c and "000" for d, short codes are used for symbols that appear frequently.
The data compression rate can be improved by encoding symbols with a variable length code such that long codes are assigned to symbols that appear less frequently.

【0028】可変長符号の例として,イライアス(El
ias)符号がある。図(b) は,イライアス(El
ias)符号を示す。イライアスのγ符号は,番号を表
す2進数に対して桁数を表すprefix(接頭語)を
つけたもので,接頭語は2進数の桁数より1引いた数の
0を付加するものである。例えば,図示のように,番号
1は符号「1」で接頭語なしとし,番号2に対しては2
の2進数「10」に接頭語として,1桁(桁数2−1=
1)の0を「10」の前に付加する。番号3は2進数「
11」でり,桁数は2であるので,接頭語として1桁だ
け0を付加する。同様に,番号4は2進数「100」で
,3桁であるから,0を2桁だけ接頭語として付加する
As an example of a variable length code, Elias (El
ias) There is a code. Figure (b) shows Elias (El
ias) indicates the code. Elias' gamma code is a binary number that represents a number with a prefix that represents the number of digits, and the prefix adds a zero equal to the number of digits in the binary number minus one. . For example, as shown in the figure, the number 1 is the code "1" without any prefix, and the number 2 is 2
As a prefix to the binary number "10", add one digit (number of digits 2-1 =
1) Add 0 in front of "10". Number 3 is a binary number ``
11'' and the number of digits is 2, so add one digit 0 as a prefix. Similarly, the number 4 is the binary number "100" and has three digits, so two digits of 0 are added as a prefix.

【0029】このようなイライアスの可変長符号によれ
ば,符号語をビット詰めしても,一意に復号することが
可能になる。イライアスのδ符号は,イライアスのγ符
号を用いて,符号化するものである。イライアスのδ符
号においては,γ符号を上位ビットし,ガンマ符号にお
ける番号から1引いた数に等しい下位ビットを付加する
。そして下位ビットの2進数表現により,上位ビットの
番号からの番号を表すようにする。例えば,γ符号の番
号2を示す「010」を用いて,番号2と3を表すよう
にする。それぞれ,上位ビットは「010」とし,番号
2から1引いた数が1であるから,1ビットの「0」を
「010」に付加することにより番号2,1ビットの「
1」を「010」に付加することにより番号3を表すよ
うにする。同様に,番号4,5,6,7は,イライアス
のγ符号における番号3の「011」を上位ビットとし
て用い,付加するビット数は3−1=2ビットとし,「
00」,「01」,「10」,「11」を付加すること
により,番号4は「01100」,番号5は「0110
1」,番号6は「01110」,番号7は「0111」
と表す。以下同様に図示のように可変長符号により表す
According to such an alias variable length code, it is possible to uniquely decode the code word even if the code word is packed with bits. Elias' δ code is encoded using Elias' γ code. In Elias' δ code, the γ code is used as the upper bit, and lower bits equal to the number subtracted by 1 from the number in the gamma code are added. Then, the binary representation of the lower bits represents the number starting from the number of the upper bits. For example, "010" indicating number 2 of the γ code is used to represent numbers 2 and 3. The upper bit of each is "010", and subtracting 1 from number 2 is 1, so by adding 1 bit "0" to "010", number 2 and 1 bit "
The number 3 is represented by adding "1" to "010". Similarly, numbers 4, 5, 6, and 7 use "011" of number 3 in Elias's γ code as the upper bit, and the number of bits to be added is 3 - 1 = 2 bits, and "
By adding "00", "01", "10", and "11", number 4 becomes "01100" and number 5 becomes "0110".
1”, number 6 is “01110”, number 7 is “0111”
Expressed as Similarly, as shown in the figure, the information is represented by variable length codes.

【0030】図3は本発明において,算術符号化の前に
符号化するSOR符号のフローを示す。 S1  (1)辞書を初期化する。 D(i)=0(i=1,2,・・・A)ただし,Aはア
ルファベットの大きさ(アルファベット,記号等の数,
で最大256)。 (2)各文字に番号を割りつける。 I(i)=0(i=1,2,・・・,A)(3)辞書使
用スロット数n=0 S2  一文字k入力する。 S3  文字kの番号jを識別する(j=I(k))。 S4  文字kの番号jで0であるか判定する。 j=0であれば,文字kは辞書に未登録な文字であるの
で,S5に進む。j=0でなければ,S7に進む。 S5  j=0であれば,n=n+1として,nを1イ
ンクリメントし,番号nをイライアス(Elias)符
号で符号化する。生データkを符号化する。 S6  辞書に文字kを番号nで登録する(D(n)=
k,I(k)=n)。 S7  S3でj=0でなければ,文字kは番号jで辞
書に登録済であるので,番号jをイライアス符号で符号
化する。
FIG. 3 shows the flow of the SOR code that is encoded before arithmetic encoding in the present invention. S1 (1) Initialize the dictionary. D(i) = 0 (i = 1, 2, ... A) However, A is the size of the alphabet (number of alphabets, symbols, etc.)
maximum of 256). (2) Assign a number to each character. I(i) = 0 (i = 1, 2, ..., A) (3) Number of dictionary slots used n = 0 S2 Input one character k. S3 Identify number j of character k (j=I(k)). S4 Determine whether number j of character k is 0. If j=0, the character k is not registered in the dictionary, so the process advances to S5. If j=0, the process advances to S7. S5 If j=0, set n=n+1, increment n by 1, and encode number n with Elias code. Encode raw data k. S6 Register character k with number n in the dictionary (D(n)=
k, I(k)=n). S7 If j is not 0 in S3, character k has already been registered in the dictionary with number j, so number j is encoded with an alias code.

【0031】S8  MTFまたはTRにより辞書の更
新をし,S2に戻って,次の文字kを入力する(MTF
はS9に,TRはS10に従う)。 S9  S8におけるMTFの処理である。s=jから
2までの文字の番号I(s)および登録番号D(s)を
一づつ繰り下げる(I(D(s))=I(D(s−1)
)。そして,文字kを番号1で辞書に登録する(I(1
)=k,D(k)=1)。 S10  S8におけるTRの処理である。j=1でな
ければ(j!=1),文字kの番号および辞書の登録番
号を辞書における1つ前の登録番号の文字番号および登
録番号と置き換える(r=D(j−1),D(j−1)
=k,D(j)=r,I(k)=j−1,I(r)=j
)。本発明では、上記のフローで求めた入力文字列のS
OR符号を算術符号化する。
[0031] S8 Update the dictionary using MTF or TR, return to S2, and input the next character k (MTF
follows S9, and TR follows S10). S9 This is the MTF processing in S8. Decrease the number I(s) of the characters from s=j to 2 and the registration number D(s) by one (I(D(s))=I(D(s-1)
). Then, register the character k with the number 1 in the dictionary (I(1
)=k, D(k)=1). S10 This is the TR processing in S8. If j is not 1 (j!=1), replace the number of the character k and the registration number in the dictionary with the character number and registration number of the previous registration number in the dictionary (r = D (j - 1), D (j-1)
=k, D(j)=r, I(k)=j-1, I(r)=j
). In the present invention, S of the input character string obtained in the above flow is
Arithmetic encode the OR code.

【0032】図4〜図6は,本発明の算術符号化のフロ
ーを示す。図4は,出現文字の履歴を考慮しない場合の
フローである。 S1  (1)辞書Dに全ての単一文字を割りつける。 D(i)=i(i=1,2,・・・,A),ただし,A
はアルファベットの大きさ(アルファベットおよび記号
等の数)であり,最大256である。 (2)  各文字に番号を割り付ける。 I(i)=i(i=1,2,・・・,A)。 (3)  各文字の出現頻度(app(i))を初期化
する。 app(i)=0(i=1,2,・・・,A)(4) 
 累積頻度(cum  freq(i))を初期化する
。 cum    freq(i)=A−i(i=1,・・
・,A)。 (5)  辞書使用スロット数n=0とする。
FIGS. 4 to 6 show the flow of arithmetic encoding according to the present invention. FIG. 4 shows a flow when the history of appearing characters is not considered. S1 (1) Allocate all single characters to dictionary D. D(i)=i(i=1,2,...,A), where A
is the size of the alphabet (the number of alphabets and symbols, etc.), which is 256 at maximum. (2) Assign a number to each character. I(i)=i(i=1,2,...,A). (3) Initialize the appearance frequency (app(i)) of each character. app(i)=0(i=1,2,...,A)(4)
Initialize the cumulative frequency (cum freq(i)). cum freq(i)=A−i(i=1,...
・,A). (5) Number of dictionary slots used n=0.

【0033】S2  一文字kを入力する。 S3  文字kの番号を求め,算術符号化する(算術符
号化のフローは図9におけるものと同じであるので,説
明は省略する)。 S4  MTFまたはTRにより辞書を更新する(MT
FはS6,TRはS7に示す)。 S5  jより小さい番号の文字の累積頻度を1インク
リメントする(j>0の範囲でj=j−1,cum  
freq(j)=cum  freq(j)+1)。そ
して,S2以降の処理を繰り返す。 S6  MTFの処理である。図3におけるMTと同じ
であるので説明は省略する。 S7  TRの処理である。j番目の文字の出現頻度が
0であれば((app(j)=0),app(j)=1
とし,n=n+1とする。登録番号D(n)=rとし,
辞書における登録番号の置き替えを行う(D(j−1)
=k,D(j)=r,I(k)=j−1,I(r)=j
)。app(j)=0でなければ,r=D(j−1)と
して辞書における登録番号の置き替えを行う。
S2 Input one character k. S3 Find the number of character k and perform arithmetic encoding (the flow of arithmetic encoding is the same as that in FIG. 9, so the explanation will be omitted). S4 Update dictionary by MTF or TR (MT
F is shown in S6, TR is shown in S7). S5 Increment the cumulative frequency of characters with numbers smaller than j by 1 (j=j-1, cum in the range j>0)
freq(j)=cum freq(j)+1). Then, the processing from S2 onwards is repeated. S6 MTF processing. Since it is the same as MT in FIG. 3, the explanation will be omitted. S7 TR processing. If the appearance frequency of the j-th character is 0 ((app(j)=0), app(j)=1
and n=n+1. Let registration number D(n)=r,
Replace the registration number in the dictionary (D(j-1)
=k, D(j)=r, I(k)=j-1, I(r)=j
). If app(j) is not 0, the registration number in the dictionary is replaced by setting r=D(j-1).

【0034】図5は本発明の算術符号化において,一重
履歴を考慮し,連続する二文字の組合せを考慮して,算
術符号化する場合のフローを示す。図は辞書の構成を,
各文字毎に辞書を作成するとともに,さらに各文字毎に
続く各文字についての辞書を作成するものである。従っ
て,D(p,i)=i(p,i=1,2,・・・A),
i(p,i)=i(p,i=1,2,・・・,A)とす
る。出現頻度,累積頻度については,連続する二文字の
うちの一番目の文字についてのみカウントするものとし
た場合を示す(app(i),cum  freq(i
),(i=1,2,・・・,A)として,出現頻度,累
積頻度を番号iのみで求める)。それ以外のフローは履
歴を考慮しない図4における場合と同じであるので,説
明は省略する。
FIG. 5 shows the flow of arithmetic coding according to the present invention, taking single history into account and considering combinations of two consecutive characters. The diagram shows the structure of the dictionary.
A dictionary is created for each character, and a dictionary is created for each character following each character. Therefore, D(p,i)=i(p,i=1,2,...A),
Let i(p,i)=i(p,i=1,2,...,A). Regarding the appearance frequency and cumulative frequency, the case where only the first character of two consecutive characters is counted is shown (app(i), cum freq(i
), (i = 1, 2, ..., A), the appearance frequency and cumulative frequency are determined using only the number i). The rest of the flow is the same as in the case of FIG. 4 in which the history is not taken into account, so the explanation will be omitted.

【0035】図6は算術符号化において,一重履歴を考
慮し,さらに,出現頻度,累積出現頻度についても,一
重履歴を考慮した場合を示す。図のフローは,出現頻度
をI(p,i),累積出現頻度をcum  freq(
p,i)(i=1,2,・・・,A)として求める点以
外で図4のフローと異ならないので,説明は省略する。
FIG. 6 shows a case in which a single history is taken into consideration in arithmetic coding, and a single history is also taken into consideration for appearance frequency and cumulative appearance frequency. The flow in the figure is as follows: The appearance frequency is I(p, i), and the cumulative appearance frequency is cum freq(
p, i) (i=1, 2, . . . , A) is the same as the flow shown in FIG. 4, so the explanation will be omitted.

【0036】[0036]

【発明の効果】本発明によれば,算術符号化部に入力さ
れるデータは,ほぼ出現頻度順に並び替えられたデータ
が入力されるので,算術符号化における出現頻度の計数
処理が簡単化され,算術符号化の処理速度を向上させる
ことが可能になる。
[Effects of the Invention] According to the present invention, the data input to the arithmetic encoding unit is inputted data that has been sorted approximately in the order of appearance frequency, so the process of counting the appearance frequency in arithmetic encoding is simplified. , it becomes possible to improve the processing speed of arithmetic encoding.

【図面の簡単な説明】[Brief explanation of the drawing]

【図1】本発明の基本構成を示す図である。FIG. 1 is a diagram showing the basic configuration of the present invention.

【図2】登録番号の可変長符号化方法を示す図である。FIG. 2 is a diagram showing a variable length encoding method for registration numbers.

【図3】SOR符号化のフローを示す図である。FIG. 3 is a diagram showing the flow of SOR encoding.

【図4】本発明の符号化方法(1) (履歴のない場合
)を示す図である。
FIG. 4 is a diagram showing the encoding method (1) of the present invention (when there is no history).

【図5】本発明の符号化方法(2) (一重履歴の場合
)を示す図である。
FIG. 5 is a diagram showing the encoding method (2) (in the case of single history) of the present invention.

【図6】本発明の符号化方法(3) (一重履歴の場合
)を示す図である。
FIG. 6 is a diagram showing the encoding method (3) (in the case of single history) of the present invention.

【図7】多値算術符号の原理説明図である。FIG. 7 is a diagram illustrating the principle of a multi-level arithmetic code.

【図8】従来の算術符号化の装置構成を示す図である。FIG. 8 is a diagram showing the configuration of a conventional arithmetic encoding device.

【図9】従来の多値算術符号化のフロー(一重履歴の場
合)を示す図である。
FIG. 9 is a diagram showing a flow of conventional multilevel arithmetic coding (in the case of single history).

【図10】従来の多値算術符号化のフロー(二重履歴の
場合)を示す図である。
FIG. 10 is a diagram showing a flow of conventional multilevel arithmetic coding (in the case of double history).

【図11】自己組織化規則に基づく符号化(SOR符号
化)を示す図である。
FIG. 11 is a diagram showing encoding based on self-organizing rules (SOR encoding).

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

1  :SOR符号化部, 2  :多値算術符号化部, 3  :辞書, 4  :カウンタ, 5  :検索・登録部, 6  :辞書ならび替え部 1: SOR encoding unit, 2: Multi-level arithmetic coding unit, 3: Dictionary, 4: Counter, 5: Search and registration department, 6: Dictionary sorting section

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】  入力文字列を算術符号により符号化し
データ圧縮および復元する方式において,文字列を入力
する毎に,出現頻度の高い文字列ほど辞書における登録
番号が小さくなるように並び替えを行い,文字列を辞書
における登録番号により符号化するSOR符号化部(1
) と,SOR符号化部(1) から出力されるSOR
符号を入力して算術符号化する算術符号化部(2) と
を備え,入力文字列をSOR符号により符号化した後,
該符号を算術符号により符号化することを特徴とするデ
ータ圧縮方式。
[Claim 1] In a method of encoding input character strings using arithmetic codes and compressing and decompressing the data, each time a character string is input, the character strings are rearranged so that the more frequently appearing character strings, the lower the registration number in the dictionary. , an SOR encoding unit (1
) and the SOR output from the SOR encoder (1)
an arithmetic encoding unit (2) that inputs a code and performs arithmetic encoding; and after encoding the input character string with the SOR code,
A data compression method characterized in that the code is encoded using an arithmetic code.
【請求項2】  請求項1に記載の算術符号を,SOR
符号に変換し,さらにSOR符号に基づいて文字列を復
元することを特徴とする圧縮データの復元方式。
[Claim 2] The arithmetic code according to claim 1 is processed by SOR.
A compressed data restoration method characterized by converting into a code and then restoring a character string based on the SOR code.
【請求項3】  請求項1において,入力文字列の辞書
における登録番号を小さい方へ1繰り上げるとともに,
繰り上がる位置にあった文字列の登録番号を1繰り下げ
ることを特徴とするデータ圧縮方式。
[Claim 3] In claim 1, the registration number of the input character string in the dictionary is incremented by 1 toward the smaller value, and
A data compression method that decrements the registration number of the character string that was incremented by one.
【請求項4】  請求項1において,入力文字列の辞書
における登録位置を辞書の先頭に移すとともに,辞書の
先頭から該文字列の登録されていた登録位置の手前まで
に登録されていた文字列の登録番号を各々1ずつ繰り下
げることを特徴とするデータ圧縮方式。
[Claim 4] In claim 1, the registration position of the input character string in the dictionary is moved to the beginning of the dictionary, and the character string registered from the beginning of the dictionary to before the registration position where the character string was registered is A data compression method characterized by decrementing each registration number by 1.
JP4360491A 1991-03-08 1991-03-08 Data compression and restoring system Withdrawn JPH04280517A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4360491A JPH04280517A (en) 1991-03-08 1991-03-08 Data compression and restoring system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4360491A JPH04280517A (en) 1991-03-08 1991-03-08 Data compression and restoring system

Publications (1)

Publication Number Publication Date
JPH04280517A true JPH04280517A (en) 1992-10-06

Family

ID=12668433

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4360491A Withdrawn JPH04280517A (en) 1991-03-08 1991-03-08 Data compression and restoring system

Country Status (1)

Country Link
JP (1) JPH04280517A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5635932A (en) * 1994-10-17 1997-06-03 Fujitsu Limited Lempel-ziv compression with expulsion of dictionary buffer matches
US6320741B1 (en) 1999-09-29 2001-11-20 Nec Corporation Electrical double layer capacitor
JP2011507450A (en) * 2007-12-20 2011-03-03 タンドベルク・テレコム・エイ・エス Variable length coding method and apparatus
US20130290279A1 (en) * 2011-09-19 2013-10-31 International Business Machines Corporation Scalable deduplication system with small blocks

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5635932A (en) * 1994-10-17 1997-06-03 Fujitsu Limited Lempel-ziv compression with expulsion of dictionary buffer matches
US6320741B1 (en) 1999-09-29 2001-11-20 Nec Corporation Electrical double layer capacitor
JP2011507450A (en) * 2007-12-20 2011-03-03 タンドベルク・テレコム・エイ・エス Variable length coding method and apparatus
US8306347B2 (en) 2007-12-20 2012-11-06 Cisco Technology, Inc. Variable length coding (VLC) method and device
US20130290279A1 (en) * 2011-09-19 2013-10-31 International Business Machines Corporation Scalable deduplication system with small blocks
US20130290278A1 (en) * 2011-09-19 2013-10-31 International Business Machines Corporation Scalable deduplication system with small blocks
US9075842B2 (en) * 2011-09-19 2015-07-07 International Business Machines Corporation Scalable deduplication system with small blocks
US9081809B2 (en) * 2011-09-19 2015-07-14 International Business Machines Corporation Scalable deduplication system with small blocks
US9747055B2 (en) 2011-09-19 2017-08-29 International Business Machines Corporation Scalable deduplication system with small blocks

Similar Documents

Publication Publication Date Title
Fenwick The Burrows–Wheeler transform for block sorting text compression: principles and improvements
US5955976A (en) Data compression for use with a communications channel
US4099257A (en) Markov processor for context encoding from given characters and for character decoding from given contexts
JPS6356726B2 (en)
JPH08167852A (en) Method and device for compressing data
JPH04280517A (en) Data compression and restoring system
US6778107B2 (en) Method and apparatus for huffman decoding technique
US6573847B1 (en) Multi-table mapping for huffman code decoding
CN114614832A (en) Test data compression and decompression method based on front and back run length coding
JP2940948B2 (en) Data compression method
Shanmugasundaram et al. Text preprocessing using enhanced intelligent dictionary based encoding (EIDBE)
JP3105598B2 (en) Data compression method using universal code
JP3241787B2 (en) Data compression method
Howard et al. Parallel lossless image compression using Huffman and arithmetic coding
Rani et al. A survey on lossless text data compression techniques
JPH0628149A (en) Method for compressing plural kinds of data
JP2590287B2 (en) Data compression method and data compression apparatus
JP2823917B2 (en) Data compression method
JP3100206B2 (en) Data compression method
JPH0527943A (en) Data compressing system
JPH06168097A (en) Data encoding system and data decoding system
JPH06202844A (en) Data compression/restoration processing device
JPH1155125A (en) Method for compressing and restoring character data
JPH07221652A (en) Data compression method
JPH04265020A (en) Data compressing system

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19980514