JPS6276931A - Data compressor - Google Patents
Data compressorInfo
- Publication number
- JPS6276931A JPS6276931A JP21661985A JP21661985A JPS6276931A JP S6276931 A JPS6276931 A JP S6276931A JP 21661985 A JP21661985 A JP 21661985A JP 21661985 A JP21661985 A JP 21661985A JP S6276931 A JPS6276931 A JP S6276931A
- Authority
- JP
- Japan
- Prior art keywords
- data
- decoded
- decoding
- encoding
- tables
- 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.)
- Pending
Links
Landscapes
- Image Processing (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
Description
【発明の詳細な説明】
〔発明の技術分野〕
本発明は、例えばデジタル画像データ等のデータをハフ
マン符号化法によりデータ圧縮するデータ圧縮装置にか
かり、特に、高い圧縮効率を実現したデータ圧縮装置に
関する。[Detailed Description of the Invention] [Technical Field of the Invention] The present invention relates to a data compression device that compresses data such as digital image data using Huffman encoding, and in particular, to a data compression device that achieves high compression efficiency. Regarding.
デジタル画像データ等の2進データの統計的性質例えば
データ出現頻度等を利用してデータを効率良く符号化す
る方法として、ハフマン符号化法が知られている。ハフ
マン符号化法は、出現頻度の高いデータには符号長の短
い符号を割当てて、出現頻度の低いデータには符号長の
長い符号を割当てる可変符号長の符号化方式である。2. Description of the Related Art Huffman encoding is known as a method for efficiently encoding data by utilizing statistical properties of binary data such as digital image data, such as data appearance frequency. The Huffman encoding method is a variable code length encoding method in which a code with a short code length is assigned to data that appears frequently, and a code with a long code length is assigned to data that appears less frequently.
例えば、第5図に示すようにデータO〜15が夫々2−
1〜2−1の出現確率であるデータ系列を、ハフマン符
号化法で符号化すると、第6図に示すように、例えば、
データ0はバイナリ変換符号で“0”であり、データ1
5はバイナリ変換符号で“1111111111111
11’″となる。また、ハフマン符号化法で符号化され
たデータを復号化すると、例えば、第7図に示すように
、符号化データ“ooooooooooooooo”〜
“011111111111111”は原データに変換
すると“O”となり、符号化データ“11111111
1111111”は原データに変換すると“15°とな
る。For example, as shown in FIG. 5, data O to 15 are each 2-
When a data sequence with an appearance probability of 1 to 2-1 is encoded using the Huffman encoding method, as shown in FIG. 6, for example,
Data 0 is “0” in the binary conversion code, and data 1
5 is the binary conversion code “1111111111111
11'''. When data encoded using the Huffman encoding method is decoded, for example, as shown in FIG. 7, the encoded data "ooooooooooooooooo"
“011111111111111” becomes “O” when converted to original data, and encoded data “11111111”
1111111” becomes “15°” when converted to original data.
即ち、データの符号/復号に符号化又は復号化テーブル
を用いるデータ圧縮装置にあっては、m種類の現データ
に対してm個(第5図に示す原データを符号化するにあ
っては16個)の符号化テーブルが必要であり、最大符
号長nビットに対し2rL (第5図の符号化データを
復号化するにあっては21個)の復号化テーブルが必要
である。In other words, in a data compression device that uses an encoding or decoding table for encoding/decoding data, m types of current data (in encoding the original data shown in FIG. 5) 16) encoding tables are required, and 2rL (21 in order to decode the encoded data in FIG. 5) decoding tables are required for the maximum code length of n bits.
上述したようにデータの符号/復号に符号化又は復号化
テーブルを用いるデータ圧縮装置にあっては、符号化テ
ーブルの数量は定まったものであるが、復号化テーブル
の数量は、データ系列の統計的性質でその長さが決まる
最大符号長に左右されるので、符号化データによって変
化するものである。ここで、最大符号長が1ビット増え
ると復号化テーブルは2倍必要となってしまい、最大符
号長が復号化テーブルの数量に大きく依存していること
になり、符号化に際してもデータ系列をそのまま全てを
符号する事は無駄が多いと言える。As mentioned above, in a data compression device that uses encoding or decoding tables for data encoding/decoding, the number of encoding tables is fixed, but the number of decoding tables depends on the statistics of the data series. The length depends on the maximum code length, which is determined by the characteristics of the code, so it changes depending on the encoded data. Here, if the maximum code length increases by 1 bit, the decoding table will be twice as necessary, and the maximum code length will depend greatly on the number of decoding tables. It can be said that coding everything is wasteful.
そこで、従来は、第8図に示すように、限られた数量の
符号化テーブルを用いるこを前提として最大符号長に上
限つまり第8図では上限値4ビツトを設定し、この上限
値4ビツトを超える符号となる現データ4〜15に対し
ては、符号化を行わずにそのデータに識別符号を付加す
るようにしていた。しかし乍、このように限られた数量
の符号化テーブルを用いてデータ圧縮を行おうとすると
、符号長に制限を設けなければならず、このため、圧縮
効率の低下を招いていた。Therefore, as shown in Fig. 8, in the past, an upper limit was set for the maximum code length, that is, an upper limit of 4 bits in Fig. 8, on the premise that a limited number of encoding tables were used; For the current data 4 to 15, which have a code exceeding , an identification code is added to the data without being encoded. However, when attempting to compress data using such a limited number of encoding tables, it is necessary to set a limit on the code length, resulting in a decrease in compression efficiency.
本発明は上記事情に基づいてなされたもので、その目的
は、限られた数量の符号化テーブル及び復号化テーブル
を用いつつ高効率のデータ圧縮を可能としたデータ圧縮
装置を提供することにある。The present invention has been made based on the above circumstances, and its purpose is to provide a data compression device that enables highly efficient data compression while using a limited number of encoding tables and decoding tables. .
かかる目的を達成するために本発明は、デジタルデータ
の発生の統計的性質を利用して所定の符号化法又は復号
化法によりデータを符号化又は復号化するデータ圧縮装
置において、複数の符号化又は復号化テーブルを用い、
出現頻度の高いデータに対しては上記符号化又は復号化
デープルの1つを参照して符号化又は復号化し、出現頻
度の低いデータに対しては上記符号化又は復号化テーブ
ルの複数を参照して符号化又は復号化することを特徴と
するものである。In order to achieve such an object, the present invention provides a data compression device that encodes or decodes data by a predetermined encoding method or decoding method using statistical properties of digital data generation. or using a decoding table,
Data that appears frequently is encoded or decoded by referring to one of the encoding or decoding tables mentioned above, and data that appears less frequently is encoded or decoded by referring to multiple of the encoding or decoding tables mentioned above. It is characterized by encoding or decoding.
以下本発明にかかるデータ圧縮装置の一実施例としてハ
フマン符号化回路を第1図を参照して説明する。A Huffman encoding circuit will be described below as an embodiment of the data compression apparatus according to the present invention with reference to FIG.
第1図において、1はデータレジスタであり、符号化す
べき原データ系列DO〜D3を保持するものである。2
は第1の符号化テーブルであり、4ビツトのデータ系列
DO〜D3をデータレジスタ1より入力し、この入力デ
ータ系列DO〜D3を7ビツトでハフマン符号化を行な
いその出力として最大符号長が7ビツトの符号化データ
CO〜C6,3ビットの符号長データLIO〜LL2と
、符号化できたか否かを1ビツトで示す識別フラグFl
とを出力するものである。In FIG. 1, 1 is a data register, which holds original data sequences DO to D3 to be encoded. 2
is the first encoding table, which inputs the 4-bit data series DO to D3 from the data register 1, performs Huffman encoding on this input data series DO to D3 with 7 bits, and outputs a maximum code length of 7. Bit coded data CO to C6, 3-bit code length data LIO to LL2, and an identification flag Fl that indicates with 1 bit whether or not the code was successfully encoded.
This outputs the following.
3は基本的には第1の符号化テーブル2と同じ動作が行
なわれる第2の符号化テーブルであり、第1の符号化テ
ーブル2の出力の識別フラグF1に基づきつまり第1の
符号化テーブル2で符号化できなかったデータを識別フ
ラグFlで検知し、その未符号化データDO〜D3を入
力し、この入力データ系列DO〜D3を最大符号長が7
ビツトでハフマン符号化を行ないその出力として7ビツ
トの符号化データ07〜C13,3ビツトの符号長デー
タL20〜L22と、符号化できたか否かを1ビツトで
示す識別フラグF2とを出力するものである。3 is a second encoding table in which basically the same operation as the first encoding table 2 is performed, and based on the identification flag F1 of the output of the first encoding table 2, that is, the first encoding table The data that could not be encoded in step 2 is detected using the identification flag Fl, and the unencoded data DO~D3 is input, and this input data series DO~D3 is converted into a code with a maximum code length of 7.
A device that performs Huffman encoding on bits and outputs 7-bit encoded data 07 to C13, 3-bit code length data L20 to L22, and an identification flag F2 that indicates with 1 bit whether or not encoding was successful. It is.
第1.第2の符号化テーブル2,3は、全体を一つの符
号化テーブルとして見た場合、出力符号はCO〜 C1
3であり、符号長は第1.第2の符号化テーブル2,3
より出力される符号長を加算した値が最終的な値になる
ので、符号長データL10〜LL2と符号長データL2
0〜L22とを加算器4により加算し、全体としての符
号長データLO〜L3を出力する。また、識別フラグF
1とF2とはオアデー)ORにより全体の識別フラグF
を得て出力する。1st. When the second encoding tables 2 and 3 are viewed as a single encoding table, the output codes are CO~C1
3, and the code length is 1. Second encoding table 2, 3
The final value is the value obtained by adding the code lengths output from the code length data L10 to LL2 and the code length data L2.
0 to L22 are added by an adder 4, and the total code length data LO to L3 is output. In addition, the identification flag F
1 and F2 are ORD) The overall identification flag F is ORed.
Obtain and output.
上記構成によれば、第2図に示すように原データの内0
〜6は最大符号長が7ビツトでハフマン符号化が行なわ
れるので、第1の符号化テーブル2だけで符号化が可能
である。例えば、原データ6の入力に対しては、符号化
データCO〜C6が1111110と、符号長データL
IO〜L12が1’1l(7)と、識別フラグF1が1
とが出力される。ここで、原データの7〜15は、ハフ
マン符号化を行うと、その最大符号長が7を超えるので
第1の符号化テーブル2での符号化は行わずに、識別フ
ラグF1を0で出力する。According to the above configuration, as shown in FIG.
6 are Huffman encoded with a maximum code length of 7 bits, so encoding can be performed using only the first encoding table 2. For example, for input of original data 6, encoded data CO to C6 are 1111110 and code length data L
IO~L12 is 1'1l (7) and identification flag F1 is 1
is output. Here, if the original data 7 to 15 are Huffman encoded, their maximum code length will exceed 7, so they will not be encoded in the first encoding table 2 and the identification flag F1 will be output as 0. do.
すると、第2の符号化テーブル3は、原データの7〜1
5が識別フラグFlがOであることから、現データの7
〜15は第1の符号化テーブル2で符号化されなかった
事を検知する。これにより、第2の符号化テーブル3は
原データの7〜15を入力し、第2図に示すように例え
ば、原データ13の入力に対しては、符号化データ07
〜C13が1111110と、符号長データL20〜L
22が111(7)と、識別フラグF1が1とが出力さ
れる。ここで、原データの14.15は、ハフマン符号
化を行うと、その最大符号長が7を超えるので第2の符
号化テーブル3での符号化は行わずに、識別フラグF1
を0で出力する。Then, the second encoding table 3 contains 7 to 1 of the original data.
5 is the current data 7 because the identification flag Fl is O.
.about.15 detects that it has not been encoded in the first encoding table 2. As a result, the second encoding table 3 inputs original data 7 to 15, and as shown in FIG.
~C13 is 1111110 and code length data L20~L
22 is output as 111(7), and the identification flag F1 is output as 1. Here, when 14.15 of the original data is Huffman encoded, its maximum code length exceeds 7, so it is not encoded using the second encoding table 3, and the identification flag F1 is
Outputs as 0.
次ぎに本実施例における復号化回路を第3図を参照して
説明する。Next, the decoding circuit in this embodiment will be explained with reference to FIG.
第3図において、5は入力された符号データを保持して
おく符号レジスタであり、符号の先頭ビットが最上位ビ
ットに位置しているものとする。In FIG. 3, it is assumed that 5 is a code register that holds input code data, and the first bit of the code is located at the most significant bit.
符号レジスタ5に保持された符号データは、第1図の第
1.第2の符号化テーブル2,3で作られた上位7ビツ
ト分の符号に分離され、夫々第1゜第2の復号化テーブ
ル6.7に入力される。The code data held in the code register 5 is stored in 1. It is separated into codes for the upper 7 bits created by the second encoding tables 2 and 3, and input to the first and second decoding tables 6 and 7, respectively.
第1.第2の復号化テーブル6.7は、入力された符号
CO〜C13に対して夫々4ビツトの復号データと、4
ビツトの符号長データと、1ビツトの識別フラグFl、
F2を出力するものである。1st. The second decoding table 6.7 contains 4 bits of decoded data and 4 bits of decoded data for input codes CO to C13, respectively.
Bit code length data, 1-bit identification flag Fl,
It outputs F2.
第1.第2の復号化テーブル6.7から出力される復号
データと4ビツトの符号長データとは、夫々データセレ
クタ8と符号長セレクタ9によりいずれか片方のテーブ
ルの出力が選択され、復号化データとして外部に出力さ
れるが、その選択信号は第1の復号化テーブル6の出力
である識別フラグF1による。この場合、データ符号化
時に第1の符号化テーブル2だけで符号化できてるなら
ば、その符号は第1の復号化テーブル6だけで復号化で
きることになり、その時に識別フラグF1は0を出力し
、この識別フラグF1の出力を受けたオアゲートORに
より復号データ及び符号長は第1の復号化テーブル6の
出力が選択される。これとは逆に符号化の際に2つのテ
ーブル2,3を必要としたデータの符号では、オアゲー
トORによって、第1の復号化テーブル6の識別フラグ
F1は1であって、第2の復号化テーブル7の復号デー
タ及び符号長データが選択されるようになっている。1st. The decoded data and 4-bit code length data output from the second decoding table 6.7 are selected by the data selector 8 and the code length selector 9, respectively, and the output of one of the tables is selected as the decoded data. The selection signal, which is output to the outside, is based on the identification flag F1 output from the first decoding table 6. In this case, if data can be encoded using only the first encoding table 2, that code can be decoded only using the first decoding table 6, and at that time, the identification flag F1 outputs 0. However, the output of the first decoding table 6 is selected as the decoded data and code length by the OR gate that receives the output of the identification flag F1. On the contrary, in a data code that requires two tables 2 and 3 during encoding, the identification flag F1 of the first decoding table 6 is 1 and the second decoding table 6 is The decoded data and code length data of conversion table 7 are selected.
上記構成によれば、第4図に示すように、例えば、11
111111000000という符号が入力されると、
第1の復号化テーブル6の識別フラグF1は1となり、
最終的な復号及び符号長出力としては、第2の復号化テ
ーブル7の復号データ及び符号長データが選択されるよ
うになり、復号及び符号長出力として夫々8及び9が出
力される。According to the above configuration, as shown in FIG.
When the code 111111000000 is input,
The identification flag F1 of the first decoding table 6 becomes 1,
The decoded data and code length data of the second decoding table 7 are selected as the final decoding and code length outputs, and 8 and 9 are output as the decoding and code length outputs, respectively.
上記した本実施例によれば、以下に述べるような作用効
果を奉する。即ち、上記実施例における、第1.第2の
テーブル2,3(又は6.7)のテーブル容量は、符号
化で8+8−16であり、復号化では16X16−25
6である。これに対し、原データO〜15を同一圧縮効
率を図るべ〈従来の方式で符号化又は復号化したならば
、符号化データの最大符号長は14となるため、符号化
に際しては16の符号化テーブル容量を必要とし、復号
に際しては16384の復号化テーブル容量を必要とす
る。According to the present embodiment described above, the following effects are provided. That is, in the above embodiment, the first. The table capacity of the second table 2, 3 (or 6.7) is 8+8-16 for encoding and 16X16-25 for decoding.
It is 6. On the other hand, it is necessary to achieve the same compression efficiency for the original data O~15. For decoding, a decoding table capacity of 16384 is required.
つまり、本実施例によれば、同一効率のデータ圧縮を実
現するに際し、定まった容量の符号化テーブルを用い、
従来に比較して256+163841つまり1/64の
復号化テーブル容量で復号化が可能となる。In other words, according to this embodiment, in order to achieve data compression with the same efficiency, an encoding table of a fixed capacity is used,
Compared to the conventional method, decoding is possible with a decoding table capacity of 256+163841, that is, 1/64.
上記実施例では、2つの符号化テーブルを用いた場合に
ついて述べたが、3つ以上の符号化テーブルを用い、且
つこれに対応した復号化テーブルを用いるものであって
もよい。In the above embodiment, a case has been described in which two encoding tables are used, but it is also possible to use three or more encoding tables and a corresponding decoding table.
以上のように本発明によれば、複数の符号化又は復号化
テーブルを用い、出現頻度の高いデータに対しては上記
符号化又は復号化デープルの1つを参照して符号化又は
復号化し、出現頻度の低いデータに対しては上記符号化
又は復号化テーブルの複数を参照して符号化又は復号化
することにより、限られた数量の符号化テーブル及び復
号化テーブルを用いつつ高効率のデータ圧縮を可能とし
たデータ圧縮、装置が提供できるものである。As described above, according to the present invention, a plurality of encoding or decoding tables are used, and frequently appearing data is encoded or decoded by referring to one of the encoding or decoding tables, By encoding or decoding data with low frequency of occurrence by referring to multiple encoding or decoding tables described above, highly efficient data can be generated while using a limited number of encoding tables and decoding tables. A data compression device that enables compression can be provided.
第1図は本発明によるデータ圧縮装置の一実施例を符号
化に適用して示した構成図、第2図は第1図の構成の作
用を説明するための図、第3図は同実施例を復号化に適
用して示した構成図、第4図は第2図の構成の作用を説
明するための図、汲モ1ラリ
・〜 ・ −・ “ ・−第E1ザ
5図は原データ系列を示す図、第6図はハフマン符号化
法を示す図、第7図は符号化データの復号化法を示す図
、第8図は従来例を示す図である。
1・・・データレジスタ、2,3・・・第1.第2の符
号化テーブル、4・・・加算器、5・・・符号レジスタ
、6.7・・・第1.第2の復号化テーブル、8・・・
データセレクタ、9・・・符号長セレクタ。
出願人代理人 弁理士 鈴江武彦
第5図
第6図
第7図
第8図FIG. 1 is a block diagram showing an embodiment of a data compression device according to the present invention applied to encoding, FIG. 2 is a diagram for explaining the operation of the structure of FIG. 1, and FIG. 3 is a diagram showing the same implementation. A configuration diagram showing an example applied to decoding, FIG. 4 is a diagram for explaining the effect of the configuration in FIG. 6 is a diagram showing a Huffman encoding method, FIG. 7 is a diagram showing a decoding method of encoded data, and FIG. 8 is a diagram showing a conventional example. 1... Data register, 2, 3... first and second encoding table, 4... adder, 5... code register, 6.7... first and second decoding table, 8.・・・
Data selector, 9... code length selector. Applicant's representative Patent attorney Takehiko Suzue Figure 5 Figure 6 Figure 7 Figure 8
Claims (1)
号化法又は復号化法によりデータを符号化又は復号化す
るデータ圧縮装置において、複数の符号化又は復号化テ
ーブルを用い、出現頻度の高いデータに対しては上記符
号化又は復号化テーブルの1つを参照して符号化又は復
号化し、出現頻度の低いデータに対しては上記符号化又
は復号化テーブルの複数を参照して符号化又は復号化す
ることを特徴とするデータ圧縮装置。A data compression device that encodes or decodes data using a predetermined encoding or decoding method using the statistical properties of digital data generation, which uses multiple encoding or decoding tables to Data is encoded or decoded with reference to one of the above encoding or decoding tables, and data with low appearance frequency is encoded or decoded with reference to multiple of the above encoding or decoding tables. A data compression device characterized by decoding.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP21661985A JPS6276931A (en) | 1985-09-30 | 1985-09-30 | Data compressor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP21661985A JPS6276931A (en) | 1985-09-30 | 1985-09-30 | Data compressor |
Publications (1)
Publication Number | Publication Date |
---|---|
JPS6276931A true JPS6276931A (en) | 1987-04-09 |
Family
ID=16691270
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP21661985A Pending JPS6276931A (en) | 1985-09-30 | 1985-09-30 | Data compressor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS6276931A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH04192744A (en) * | 1990-11-26 | 1992-07-10 | Matsushita Electric Ind Co Ltd | Decoder |
JPH04504936A (en) * | 1989-04-17 | 1992-08-27 | フラウンホッファー―ゲゼルシャフト ツァ フェルダールング デァ アンゲヴァンテン フォアシュンク エー.ファオ. | Digital encoding method |
JPH05183443A (en) * | 1991-12-27 | 1993-07-23 | Pfu Ltd | Code conversion method |
JP2011114525A (en) * | 2009-11-26 | 2011-06-09 | Dainippon Printing Co Ltd | Method and device for encoding/decoding numerical data string |
-
1985
- 1985-09-30 JP JP21661985A patent/JPS6276931A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH04504936A (en) * | 1989-04-17 | 1992-08-27 | フラウンホッファー―ゲゼルシャフト ツァ フェルダールング デァ アンゲヴァンテン フォアシュンク エー.ファオ. | Digital encoding method |
JPH04192744A (en) * | 1990-11-26 | 1992-07-10 | Matsushita Electric Ind Co Ltd | Decoder |
JPH05183443A (en) * | 1991-12-27 | 1993-07-23 | Pfu Ltd | Code conversion method |
JP2011114525A (en) * | 2009-11-26 | 2011-06-09 | Dainippon Printing Co Ltd | Method and device for encoding/decoding numerical data string |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP0426429B1 (en) | Variable length code demodulating apparatus and address control method thereof | |
KR100349447B1 (en) | Compact Sowcoding Tables for Encoder / Decoder Systems | |
US7378992B2 (en) | Content independent data compression method and system | |
US5374916A (en) | Automatic electronic data type identification process | |
JP3341962B2 (en) | Variable length decoder and method for decoding variable length code value | |
RU2154350C2 (en) | Method and system of coding, method and system for decoding | |
US5594435A (en) | Permutation-based data compression | |
AU695626B2 (en) | Video image colour encoding | |
US6778109B1 (en) | Method for efficient data encoding and decoding | |
CN116016606A (en) | Sewage treatment operation and maintenance data efficient management system based on intelligent cloud | |
CN114614833A (en) | Test data compression and decompression method for self-adaptive run-length coding | |
JPH07295785A (en) | Data compressing method | |
US6748520B1 (en) | System and method for compressing and decompressing a binary code image | |
JPS6276931A (en) | Data compressor | |
JPS6192073A (en) | Image data compression method | |
US5708431A (en) | Method for compression coding of potentially unbounded integers | |
JP2940948B2 (en) | Data compression method | |
JP2812064B2 (en) | Image processing device | |
JPS62108663A (en) | Entropy recording system | |
JPH0311883A (en) | Variable length code decoding method, facsimile machine, and still image transmission system | |
JPH0513435B2 (en) | ||
KR890004316B1 (en) | Convertor to run-length codes | |
US6522270B1 (en) | Method of coding frequently occurring values | |
JPH01302917A (en) | Data compression system | |
JPS62209948A (en) | Data compressing and transmitting method |