JPH0730764A - Method and device for compression - Google Patents
Method and device for compressionInfo
- Publication number
- JPH0730764A JPH0730764A JP5171544A JP17154493A JPH0730764A JP H0730764 A JPH0730764 A JP H0730764A JP 5171544 A JP5171544 A JP 5171544A JP 17154493 A JP17154493 A JP 17154493A JP H0730764 A JPH0730764 A JP H0730764A
- Authority
- JP
- Japan
- Prior art keywords
- data
- compression
- compressed
- block
- blocks
- 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
Links
Landscapes
- Compression Of Band Width Or Redundancy In Fax (AREA)
- Color Television Systems (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明は、圧縮方法及び装置に関
し、より具体的には、例えば点順次RGBイメージ・デ
ータのように、周期的に相関性が強くなるようなデータ
に適した圧縮方法及び装置に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a compression method and apparatus, and more particularly to a compression method suitable for data having strong correlation periodically such as dot sequential RGB image data. And equipment.
【0002】[0002]
【従来の技術】一連のデータを圧縮する場合、そのデー
タ列を最初から1バイト単位で圧縮処理していくのが普
通である。伸長はこの逆の処理になる。これは、通常、
情報が1バイトを単位として形成されているからであ
る。2. Description of the Related Art When compressing a series of data, it is usual to compress the data string in 1-byte units from the beginning. Decompression is the reverse process. This is usually
This is because the information is formed in units of 1 byte.
【0003】しかし、多値イメージ・データ、例えば、
RGBイメージ・データが点順次になっているとき、イ
メージ情報としてはR,G,Bの3つのデータで情報単
位を構成している。例えば、R,G,Bが各8ビット、
即ち、1バイトで表現されるとき、点順次RGBイメー
ジ・データは、3バイトで1つのピクセルを表現してい
る。However, multi-valued image data, for example,
When the RGB image data is dot-sequential, three image data, R, G, and B, form an information unit. For example, R, G, and B are 8 bits each,
That is, when represented by 1 byte, the dot-sequential RGB image data represents 1 pixel by 3 bytes.
【0004】イメージ・データは隣接するピクセル間で
近い値を持つ確率が高が、点順次RGBフォーマットの
場合、バイト単位で圧縮符号化すると、期待した圧縮率
を得られない。即ち、Rデータの隣は、このRデータ値
とは一般に相関の弱いGデータであり、Gデータの隣が
Bデータであるからである。これでは、隣接するピクセ
ル間の相関性を利用していることにならない。Image data has a high probability of having similar values between adjacent pixels, but in the case of the dot-sequential RGB format, if compression coding is performed in byte units, the expected compression ratio cannot be obtained. That is, next to the R data is G data that generally has a weak correlation with this R data value, and next to the G data is B data. This does not mean that the correlation between adjacent pixels is used.
【0005】イメージ・データのカラー表現形式にはR
GB形式の他に輝度/色差形式などがあり、各成分デー
タの伝送(又は記憶)順序には、点順次の他に面順次や
線順次がある。これら種々のイメージ・フォーマットに
対応して高い圧縮率を実現できる圧縮装置が望まれる。The color representation format of image data is R
In addition to the GB format, there are luminance / color difference formats and the like, and the transmission (or storage) order of each component data includes the field order and the line order in addition to the dot order. A compression device that can realize a high compression rate corresponding to these various image formats is desired.
【0006】本発明は、このような要望を満たす圧縮方
法及び装置を提示することを目的とする。It is an object of the present invention to present a compression method and apparatus that meets such needs.
【0007】[0007]
【課題を解決するための手段】本発明に係る圧縮方法
は、圧縮すべきデータ列を所定数のエレメントからなる
複数のブロックに区分し、当該ブロック内の同一エレメ
ント位置のデータをまとめて圧縮することを特徴とす
る。A compression method according to the present invention divides a data string to be compressed into a plurality of blocks each having a predetermined number of elements and collectively compresses data at the same element position in the block. It is characterized by
【0008】本発明に係る圧縮装置は、圧縮すべきデー
タ列を所定数のエレメントからなる複数のブロックに区
分する第1の手段と、当該ブロックの同一エレメント位
置のデータをまとめて圧縮する第2の手段とからなるこ
とを特徴とする。The compressing apparatus according to the present invention comprises first means for dividing a data string to be compressed into a plurality of blocks each having a predetermined number of elements, and second means for collectively compressing data at the same element position of the block. And means of.
【0009】[0009]
【作用】上記手段により、圧縮すべきデータの規則性又
は周期性を利用して圧縮できる。従って、高い圧縮率を
達成できる。By the above means, it is possible to perform compression by utilizing the regularity or periodicity of the data to be compressed. Therefore, a high compression rate can be achieved.
【0010】[0010]
【実施例】以下、図面を参照して本発明の実施例を説明
する。Embodiments of the present invention will be described below with reference to the drawings.
【0011】図1は、本発明の一実施例の概略構成ブロ
ック図を示す。10は本実施例の演算処理装置であり、
ハードウエア又はソフトウエアからなる圧縮手段12、
同じくハードウエア又はソフトウエアからなる伸長手段
14、圧縮前のオリジナル・データを記憶するメモリ1
6及び圧縮データを記憶するメモリ18を具備し、これ
らはアドレス/データ・バス20により接続し、圧縮手
段12及び伸長手段14はメモリ16,18にアクセス
できる。FIG. 1 shows a schematic block diagram of an embodiment of the present invention. Reference numeral 10 denotes the arithmetic processing unit of this embodiment,
Compression means 12 consisting of hardware or software,
A decompression means 14 also made of hardware or software, a memory 1 for storing original data before compression.
6 and a memory 18 for storing compressed data, which are connected by an address / data bus 20 so that the compression means 12 and the decompression means 14 can access the memories 16, 18.
【0012】なお、圧縮前のオリジナル・データは、他
のアプリケーション・ソフトウエア又はイメージ・スキ
ャナなどからメモリ16に転送され、記憶されるが、直
接、圧縮手段12に供給されてもよいことは勿論であ
る。The original data before compression is transferred to and stored in the memory 16 from other application software or an image scanner, but may be directly supplied to the compression means 12. Is.
【0013】本発明では、圧縮すべきデータのデータ列
を、その特質に応じて逐次的な圧縮処理に適した単位
(ブロック)に分割し、ブロック列としてデータ圧縮す
る。各ブロックの中では、各ブロックに属する基本単位
のデータ(エレメント)を、隣接するブロック内の同じ
位置に位置するエレメントを利用して圧縮する。換言す
ると、本発明では、一連のデータ列に対して、先ず関連
性を期待できる周期を決定し、その周期の同じ位相のデ
ータ間で圧縮処理する。In the present invention, the data string of the data to be compressed is divided into units (blocks) suitable for sequential compression processing according to its characteristics, and the data is compressed as a block string. In each block, the data (element) of the basic unit belonging to each block is compressed using the elements located at the same position in the adjacent blocks. In other words, in the present invention, for a series of data strings, first, a cycle in which relevance can be expected is determined, and compression processing is performed between data of the same phase in that cycle.
【0014】本発明では、圧縮のアルゴリズム自体は何
であってもよく、本実施例では、一般的なパックビッツ
方式を用いる。パックビッツ方式の詳細は後述する。In the present invention, the compression algorithm itself may be any, and in the present embodiment, the general Packbits method is used. Details of the Pack Bits method will be described later.
【0015】例えば、オリジナル・データがR,G,B
各8ビットの点順次形式で、図2(1)に示すようにメ
モリ16に順番に記憶されているとする。なお、オリジ
ナル・データがどのようなデータ構造になっているか
は、ヘッダ情報、又はユーザの指示などにより、圧縮手
段12に知らされているものとする。For example, if the original data is R, G, B
It is assumed that they are sequentially stored in the memory 16 in the 8-bit dot-sequential format, as shown in FIG. It should be noted that the data structure of the original data is known to the compression means 12 by the header information or the user's instruction.
【0016】R,G,Bが各8ビットで点順次形式であ
ることから、1ブロックは24ビット、即ち3バイトで
ある。圧縮処理が1バイト単位となっているとき、エレ
メント数は3となる。Since each of R, G and B has a dot sequential format of 8 bits, one block has 24 bits, that is, 3 bytes. When the compression processing is in 1-byte units, the number of elements is 3.
【0017】1ブロックの中で最初のバイト・データ、
即ちRデータをエレメント#1、2つ目のバイト・デー
タ、即ちGデータをエレメント#2、3つ目のバイト・
データ、即ちBデータをエレメント#3と呼ぶこととす
る。First byte data in one block,
That is, R data is element # 1, second byte data, that is, G data is element # 2, third byte data.
Data, that is, B data will be referred to as element # 3.
【0018】具体的には圧縮処理は、各ブロックの同じ
エレメントに対して実施される。即ち、エレメント#1
(即ち、Rデータ)に着目すると、全てが01H(16
進数)であるから、01Hが5回連続することになり、
パックビッツ方式では、図2(2)の第2バイト及び第
3バイトに示すように、04H01Hと表記できる。Specifically, the compression process is performed on the same element of each block. That is, element # 1
Focusing on (that is, R data), all 01H (16
Since it is a decimal number, 01H will be repeated 5 times,
In the Pack Bits method, it can be represented as 04H01H as shown in the second byte and the third byte of FIG.
【0019】エレメント#2(即ち、Gデータ)では、
全てが02H(16進数)であるから、パックビッツ方
式では、図2(2)の第4バイト及び第5バイトに示す
ように、04H02Hと表記できる。In element # 2 (that is, G data),
Since all are 02H (hexadecimal number), in the Packbits method, it can be represented as 04H02H, as shown in the 4th and 5th bytes of FIG.
【0020】エレメント#3(即ち、Bデータ)に着目
すると、03Hが3回連続し、その後に、04Hと05
Hが続くことから、02H03HFFH04H05Hと
表記できる。Focusing on element # 3 (that is, B data), 03H is repeated three times, and then 04H and 05
Since H continues, it can be expressed as 02H03HFFH04H05H.
【0021】このように圧縮したデータを伸長する際
に、オリジナル・データのブロック数の情報が必要にな
る。本実施例では、圧縮データの先頭の1バイトをブロ
ック数情報用に割り当ててあり、図2(2)に示すよう
に、05Hが記録される。本実施例では、圧縮データの
データ量は10バイトになる。ブロック数の情報に加え
て、1ブロックのエレメント数の情報もあれば、伸長の
際に便利である。従って、エレメント数情報もヘッダな
どとして圧縮データ列に付加してもよい。When decompressing the data thus compressed, information on the number of blocks of the original data is required. In this embodiment, the first byte of the compressed data is allocated for the block number information, and 05H is recorded as shown in FIG. 2 (2). In this embodiment, the amount of compressed data is 10 bytes. In addition to the information on the number of blocks, the information on the number of elements in one block is useful for decompression. Therefore, the element number information may be added to the compressed data string as a header or the like.
【0022】参考のために、図2(1)に示すオリジナ
ル・データを従来例により圧縮した場合の圧縮データを
図2(3)に示す。従来例では、圧縮後のデータ量が1
6バイトになる。For reference, FIG. 2 (3) shows compressed data obtained by compressing the original data shown in FIG. 2 (1) by a conventional example. In the conventional example, the amount of data after compression is 1
It will be 6 bytes.
【0023】図3は、本実施例の圧縮手段12のフロー
チャートを示す。先ず、オリジナル・データのエレメエ
ント数を決定し、オリジナル・データをブロックに分割
する(S1)。ブロック数をメモリ18の先頭に記録す
る(S2)。このブロック数情報は、1バイトに限定さ
れず、2バイト以上の所定バイト数であってもよい。FIG. 3 shows a flow chart of the compression means 12 of this embodiment. First, the number of elements of the original data is determined, and the original data is divided into blocks (S1). The number of blocks is recorded at the beginning of the memory 18 (S2). The block number information is not limited to 1 byte and may be a predetermined number of bytes of 2 bytes or more.
【0024】各ブロックのエレメント#1に対して圧縮
処理を実行し(S3)、その圧縮データをメモリ18に
続けて格納する(S4)。各ブロックのエレメント#2
に対して圧縮処理を実行し(S5)、その圧縮データを
メモリ18に続けて格納し(S6)、各ブロックのエレ
メント#3に対して圧縮処理を実行し(S7)、その圧
縮データをメモリ18に順に格納する(S8)。A compression process is executed for the element # 1 of each block (S3), and the compressed data is stored in the memory 18 successively (S4). Element # 2 of each block
Is compressed (S5), the compressed data is continuously stored in the memory 18 (S6), the compression process is executed for the element # 3 of each block (S7), and the compressed data is stored in the memory. The data are sequentially stored in 18 (S8).
【0025】以上の処理により、図2(2)に示すよう
な圧縮データ列が生成される。By the above processing, a compressed data string as shown in FIG. 2 (2) is generated.
【0026】図4は、伸長手段14のフローチャートを
示す。ブロック数情報を変数Sに代入し(S21)、1
ブロックのエレメント数だけの制御変数S1,S2,S
3を用意し、0で初期化する(S22)。圧縮データを
順に伸長し、伸長後のデータ数を変数S1に保管し、S
1がSに一致するまでの伸長データをエレメント#1の
データであるとする(S23,24,25)。S1がS
に一致した後では(S25)、伸長後のデータ数を変数
S2に保管し、S2がSに一致するまでの伸長データを
エレメント#2のデータであるとする(S26,27,
28)。S2がSに一致した後では(S28)、伸長後
のデータ数を変数S3に保管し、S3がSに一致するま
での伸長データをエレメント#3のデータであるとする
(S29,30,31)。S3がSに一致したら(S3
0)、伸長処理を終了する。FIG. 4 shows a flowchart of the expanding means 14. Substitute block number information into variable S (S21), 1
Control variables S1, S2, S for the number of block elements
3 is prepared and initialized with 0 (S22). Decompress the compressed data in order, store the number of decompressed data in the variable S1,
It is assumed that the decompressed data until 1 matches S is the data of element # 1 (S23, 24, 25). S1 is S
(S25), the number of data after decompression is stored in the variable S2, and the decompressed data until S2 matches S are the data of the element # 2 (S26, 27,
28). After S2 matches S (S28), the number of expanded data is stored in the variable S3, and the expanded data until S3 matches S is the data of element # 3 (S29, 30, 31). ). If S3 matches S (S3
0), the decompression process ends.
【0027】このようにして、エレメント毎に伸長デー
タを得ることができる。エレメント毎の伸長データをそ
のブロックのエレメント数の周期で、且つ対称とするエ
レメントの番号のオフセットを付けてメモリ16に格納
すれば、圧縮前のオリジナル・データと同じ並びの伸長
データを得ることができる。In this way, decompressed data can be obtained for each element. If the decompressed data for each element is stored in the memory 16 with a cycle of the number of elements of the block and with an offset of the number of symmetrical elements, decompressed data in the same sequence as the original data before compression can be obtained. it can.
【0028】パックビッツ方式の圧縮アルゴリズムを簡
単に説明する。レングスが0以上、127未満のとき、
後続の1バイトのデータが、レングスで示される数値に
1を加算した数だけ連続している。レングスが1−12
7以上で且つ−1以下のとき、レングスで示される数値
の絶対値に1を加算した数だけ、非圧縮のデータが続い
ている。The Packbits compression algorithm will be briefly described. When the length is 0 or more and less than 127,
The subsequent 1-byte data is continuous by the number obtained by adding 1 to the numerical value indicated by the length. Length is 1-12
When it is 7 or more and -1 or less, uncompressed data continues by the number obtained by adding 1 to the absolute value of the numerical value indicated by the length.
【0029】[0029]
【発明の効果】以上の説明から容易に理解できるよう
に、本発明によれば、周期性を持っているデータを圧縮
する場合に、高い圧縮率を達成できる。As can be easily understood from the above description, according to the present invention, a high compression rate can be achieved when compressing data having periodicity.
【図1】 本発明の一実施例の概略構成ブロック図であ
る。FIG. 1 is a schematic block diagram of an embodiment of the present invention.
【図2】 本実施例の動作説明図である。FIG. 2 is an operation explanatory diagram of the present embodiment.
【図3】 圧縮手段12のフローチャートである。FIG. 3 is a flowchart of a compression unit 12.
【図4】 伸長手段14のフローチャートである。FIG. 4 is a flowchart of the expanding means 14.
10:演算処理装置 12:圧縮手段 14:伸長手段
16:オリジナル・データ・メモリ 18:圧縮デー
タ・メモリ 20:アドレス/データ・バス10: arithmetic processing device 12: compression means 14: decompression means 16: original data memory 18: compressed data memory 20: address / data bus
Claims (2)
トからなる複数のブロックに区分し、当該ブロック内の
同一エレメント位置のデータをまとめて圧縮することを
特徴とする圧縮方法。1. A compression method, wherein a data string to be compressed is divided into a plurality of blocks each having a predetermined number of elements, and data at the same element position in the block is collectively compressed.
トからなる複数のブロックに区分する第1の手段と、当
該ブロックの同一エレメント位置のデータをまとめて圧
縮する第2の手段とからなることを特徴とする圧縮装
置。2. A first means for dividing a data string to be compressed into a plurality of blocks each having a predetermined number of elements, and a second means for collectively compressing data at the same element position of the block. Compressor characterized by.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP5171544A JPH0730764A (en) | 1993-07-12 | 1993-07-12 | Method and device for compression |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP5171544A JPH0730764A (en) | 1993-07-12 | 1993-07-12 | Method and device for compression |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH0730764A true JPH0730764A (en) | 1995-01-31 |
Family
ID=15925099
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP5171544A Withdrawn JPH0730764A (en) | 1993-07-12 | 1993-07-12 | Method and device for compression |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0730764A (en) |
-
1993
- 1993-07-12 JP JP5171544A patent/JPH0730764A/en not_active Withdrawn
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3224926B2 (en) | Quantization / inverse quantization circuit | |
US5894300A (en) | Color image display apparatus and method therefor | |
USRE39925E1 (en) | Fast JPEG huffman encoding and decoding | |
JP2002507354A (en) | Visually lossless image compression scheme based on efficient lookup table | |
US5832037A (en) | Method of compressing and expanding data | |
JP3522331B2 (en) | Data compression method | |
WO2001067776A1 (en) | Improved vector quantization of images | |
JP2885235B1 (en) | Data compression method and machine readable recording medium recording compression program | |
JP2016208356A (en) | Image compression device, image compression method, image decompression device and image decompression method | |
JPH0730764A (en) | Method and device for compression | |
JP5070086B2 (en) | Data compression apparatus and image reading apparatus | |
JP2000244744A (en) | Image data compression method and image data management method | |
JP3781012B2 (en) | Image data compression method, image data expansion method, and image data expansion circuit | |
JP4649764B2 (en) | Image data decompression method and image data decompression apparatus | |
JP2882986B2 (en) | Image conversion system | |
US5991446A (en) | Image conversion device | |
JP2594767B2 (en) | How to decompress compressed data | |
JPH06290020A (en) | Method for compressing data | |
JP3131881B2 (en) | Packing / depacking circuit | |
JP2594770B2 (en) | How to decompress compressed data | |
JP2003299120A (en) | Color image compressing method | |
JPH0856164A (en) | Data coding decoding device and its method | |
JPH10290460A (en) | Image compression method | |
JP2734227B2 (en) | Encoding / decoding method in facsimile | |
JP2841643B2 (en) | Image processing device |
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: 20001003 |