JPS61295765A - Run-length coding and decoding system - Google Patents

Run-length coding and decoding system

Info

Publication number
JPS61295765A
JPS61295765A JP13683085A JP13683085A JPS61295765A JP S61295765 A JPS61295765 A JP S61295765A JP 13683085 A JP13683085 A JP 13683085A JP 13683085 A JP13683085 A JP 13683085A JP S61295765 A JPS61295765 A JP S61295765A
Authority
JP
Japan
Prior art keywords
data
run
length
decoding
memory
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
Application number
JP13683085A
Other languages
Japanese (ja)
Inventor
Isamu Yasui
勇 安井
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP13683085A priority Critical patent/JPS61295765A/en
Publication of JPS61295765A publication Critical patent/JPS61295765A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To perform the run-length coding and decoding of data economically at a high speed without requiring any complex hardware by a run-length coding table and a decoding table previously and performing processing according to each table during the coding or decoding. CONSTITUTION:Object data of run-length coding or decoding is stored in a buffer memory 81 from a host device through a data signal line 2-2, an AND gate 86, and an OR gate 87. An instruction code from an address signal line 2-1 is stored in a flip-flop 74 through an instruction accepting circuit 72, but when the flip-flop 74 is set, a microprocessor 71 processes data in a buffer memory 81 under the control of a microprogram in a control memory 91 according to the instruction code. The data in the buffer memory 81 is read in the microprocessor 71 through a data line 100 and processed as specified and the result is written on the buffer memory 81 through a data line 101, an AND gate 85, and an OR gate 84.

Description

【発明の詳細な説明】 〔発明の利用分野〕 本発明は、文字および画像データのランレングス符号化
とランレングス符号化データの復号化を高速に行なうだ
めのランレングス符号化復号化方式に関するものである
[Detailed Description of the Invention] [Field of Application of the Invention] The present invention relates to a run-length encoding/decoding method for high-speed run-length encoding of character and image data and decoding of run-length encoded data. It is.

〔発明の背景〕[Background of the invention]

ビデオテックスやファクシミリにおける文字および画像
データはモデファイト・ノ・7マン(MH)符号などに
もとづく方式でランレングス符号化されることによって
、そのデータ圧縮が図られているのが実状である。とこ
ろで、ビデオテックス等テレビディスプレイにそれら文
字や画像を表示する場合には、MH符号化およびその復
号化には高速の処理が必要とされ、特にビデオテックス
のセンタ装置で多数の端末に対して一括処理する場合に
はよシ高速な処理が要求されるものとなっている。この
ため例えば特開昭58−121866号公報には復号化
の高速化処理方法が示されているが、符号解読回路や各
種カウンタ等複雑な回路構成を要するものとなっている
The reality is that character and image data in videotex and facsimile are compressed by run-length encoding using a method based on Modified No. 7 Man (MH) code or the like. By the way, when displaying such characters and images on a TV display such as Videotex, high-speed processing is required for MH encoding and decoding. When processing, extremely high-speed processing is required. For this reason, for example, Japanese Patent Application Laid-Open No. 58-121866 discloses a method for increasing the speed of decoding, but this method requires complicated circuit configurations such as a code decoding circuit and various counters.

〔発明の目的〕[Purpose of the invention]

本発明の目的は、複雑なハードウェア構成を要すること
なく高速、且つ経済的にデータのランレングス符号化と
ランレングス符号化データの復号化を行ない得るランレ
ングス符号化復号化方式を供するにある。
An object of the present invention is to provide a run-length encoding/decoding method that can perform run-length encoding of data and decoding of run-length encoded data at high speed and economically without requiring a complicated hardware configuration. .

〔発明の概要〕[Summary of the invention]

この目的のため本発明は、ランレングス符号化テーブル
とランレングス復号化テーブルを予め記憶しておき、ラ
ンレングス符号化の際はランレングス符号化テーブルに
よってランレングス符号化処理を行ない、ランレングス
復号化の際はランレングス復号化テーブルによってラン
レングス復号化処理を行なうようにしたものである。
For this purpose, the present invention stores a run-length encoding table and a run-length decoding table in advance, performs run-length encoding processing using the run-length encoding table during run-length encoding, and performs run-length decoding. When encoding, run-length decoding processing is performed using a run-length decoding table.

〔発明の実施例〕[Embodiments of the invention]

以下、本発明を第1図から第10図により説明する。 The present invention will be explained below with reference to FIGS. 1 to 10.

先ず本発明に係るランレングス符号化復号化装置につい
て説明する。第2図はその一例での構成を示したもので
ある。本例でのものはマイクロプログラム制御のもので
あって、マイクロプログラムカラアクセス可能なバッフ
ァメモリ81内には第1図に示すように符号化または復
号化されるべきデータが書込される入力バッファ404
、符号化または復号化されたデータが書込される出力バ
ッ7ア405、符号化のためのランレングスコードテー
ブル400 、401および復号化のだめのランレング
スデコードテーブル402. 403が用意されるよう
になっている。上位装置からの被処理データは一旦入カ
バッファ404に書込された後、ランレングステーブル
を参照して符号化または復号化されたうえ出力バッファ
405を介し上位装置に転送されるようになっているも
のである。
First, a run-length encoding/decoding device according to the present invention will be explained. FIG. 2 shows an example of the configuration. The one in this example is microprogram-controlled, and the microprogram-accessible buffer memory 81 includes an input buffer into which data to be encoded or decoded is written, as shown in FIG. 404
, an output buffer 405 into which encoded or decoded data is written, run-length code tables 400, 401 for encoding, and a run-length decode table 402 for decoding. 403 is now available. The data to be processed from the host device is once written into the input buffer 404, then encoded or decoded with reference to the run length table, and then transferred to the host device via the output buffer 405. It is something.

さて、第2図には主にデータの流れを中心とした構成が
示されているが、マイクロプロセッサ71は制御メモリ
91に格納されているマイクロプログラムを実行するこ
とによって制御を行なうようになっている。また上位装
置との接続はアドレス信号線2−1.データ信号線2−
2.リードライト制御線10゜初期設定線11などを介
し行われるものとなっている。
Now, although FIG. 2 mainly shows a configuration centered on the flow of data, the microprocessor 71 performs control by executing a microprogram stored in the control memory 91. There is. The connection with the host device is the address signal line 2-1. Data signal line 2-
2. This is done via the read/write control line 10° initial setting line 11, etc.

バッファメモリ81は既述の如く本装置と上位装置との
間のデータ転送や本装置が実行するデータの処理に使用
されるようになっている。
As described above, the buffer memory 81 is used for data transfer between this device and a host device and for data processing executed by this device.

ところで、アドレス信号線2−1からの内容には上位装
置から本装置への命令コードが含まれておシ、命令コー
ドは、命令受付回路72を介し7リツプフロツプ74に
記憶されるものとなっている。また、制御メモリ+91
のアドレスとバックアメモリ81のアドレスとは上位装
置からは同一アドレス空間の別アドレスが割付されてお
シ、制御メモリ91へのマイクロプログラムはアドレス
信号線2−11アンドゲート93.5オアゲート94を
介し支えられるアドレスと、データ信号線2−2、アン
ドゲート95を介し与えられるデータとによって上位装
置から書き込むことが可能となっている。アントゲート
92はまたマイクロプロセッサ71が7リツプフロツプ
74がセットされていることを条件として制御メモリ9
1のマイクロプログラムを読み出すだめのアドレスを与
えるものである。
By the way, the content from the address signal line 2-1 includes an instruction code sent from the host device to this device, and the instruction code is stored in the 7-lip flop 74 via the instruction reception circuit 72. There is. Also, control memory +91
and the address of the backup memory 81 are assigned different addresses in the same address space from the host device, and the microprogram to the control memory 91 is sent via the address signal line 2-11 and gate 93.5 or gate 94. Writing from a host device is possible using supported addresses and data applied via the data signal line 2-2 and the AND gate 95. Ant gate 92 also causes microprocessor 71 to control memory 9 provided that flip-flop 74 is set.
This gives the address from which to read the microprogram No. 1.

次にバッファメモIJ 81 Kおけるデータについて
説明すれば、ランレングス符号化または復号化さ1れる
データは上位装置からデータ信号線2−2、アンドゲー
ト86、オアゲート87を介しバッファメモIJ81に
格納されるようになっている。この場合バッファメモリ
81へのアドレスはアドレス信号線2−1、アンドゲー
トお、オアゲート編を介し上位装)置から与えられる。
Next, to explain the data in the buffer memo IJ81K, run-length encoded or decoded data is stored in the buffer memo IJ81 from the host device via the data signal line 2-2, the AND gate 86, and the OR gate 87. It has become so. In this case, the address to the buffer memory 81 is given from the host device via the address signal line 2-1, AND gate, and OR gate.

さて、このようにしてバックアメモリ81に処理すべき
データが格納さ°れると、上位装置は既述した如くアド
レス信号線2−1を介し命令コードを本装置に与えるが
、この命令コードは命令受付回路72を介しフリップ7
0ツブ74に記憶されるが、マイクロプロセッサ71は
フリップ70ツブ74がセットされると、その命令コー
ドに従い制御メモリ91内のマイクロプログラムによる
制御下にバッファメモリ81内のデータに対する処理を
実行するところとなるものである。バックアメモリ81
内のデータはデータ線(オペランドバス)100を介し
マイクロプロセッサ71に読み込まれ所定に演算された
後、データ線(リザルトバス)101、アンドゲート聞
、オアゲート87を介しバッファメモリ81に書き込ま
れるよう釦なっている。
Now, when the data to be processed is stored in the backup memory 81 in this way, the host device gives an instruction code to this device via the address signal line 2-1 as described above, but this instruction code is an instruction code. Flip 7 via reception circuit 72
When the flip 70 knob 74 is set, the microprocessor 71 executes processing on the data in the buffer memory 81 under the control of the microprogram in the control memory 91 according to the instruction code. This is the result. Backer memory 81
The data is read into the microprocessor 71 via the data line (operand bus) 100 and subjected to predetermined calculations, and then written to the buffer memory 81 via the data line (result bus) 101, AND gate, and OR gate 87. It has become.

このようにマイクロプロセッサ71ニヨツテバツ7アメ
モリ81内データの読取演算、バックアメモリ81への
書込といった具合に一連の動作を繰シ返し実行すること
で、ランレングス符号化または復号化処理が実行される
ものである。処理されたバックアメモリ81内のデータ
はその後データ線100゜アンドゲート羽、データ信号
線2−2を介し上位装置によって読み取られるが、この
場合でのバッファメモリ81へのアドレスはアドレス信
号線2−1、アンドゲート83、オアゲート84を介し
上位装置から与えられる。なお、マイクロプロセッサ7
1は処理終了時にオアゲート73を介しフリップフロッ
プ74をリセットするものとなっている。
In this way, run-length encoding or decoding processing is executed by repeatedly executing a series of operations such as reading data from the microprocessor 71 and memory 81 and writing data to the backup memory 81. It is something. The processed data in the buffer memory 81 is then read by the host device via the data line 100° and the data signal line 2-2, but the address to the buffer memory 81 in this case is the address signal line 2-2. 1 is given from the host device via the AND gate 83 and the OR gate 84. In addition, the microprocessor 7
1 resets the flip-flop 74 via the OR gate 73 at the end of processing.

第3図は第2図におけるマイクロプロセッサ71の内部
構成を一例として示したものである。レジスタ群(例え
ば1語16ビツトの16レジスタとして構成)204内
のデータはオペランドパス100介しシフトレジスタ2
01には第1オペランドとして、また、シフトレジスタ
202には第2オペランドとして格納されるようになっ
ている。シフト動作でない場合はシフトレジスタ201
 、202内のデータはそのまま演算回路203に与え
られるものである。
FIG. 3 shows an example of the internal configuration of the microprocessor 71 in FIG. 2. The data in the register group 204 (for example, configured as 16 registers with 16 bits per word) is transferred to the shift register 2 via the operand path 100.
01 as the first operand, and the shift register 202 as the second operand. If it is not a shift operation, shift register 201
, 202 is given to the arithmetic circuit 203 as is.

演算回路203は制御メモリ91のマイクロプログラム
による制御下に加減算や論理演算を実行しりザルトバス
101を介しその結果をレジスタ群204に書き込む一
方、マイクロプログラムがシフト動作を制御する場合に
は、シフトレジスタ201.202間で指定された桁数
分右方向、または左方向シフトが実行されシフト結果は
演算回路203を介しレジスタ群204に書き込まれる
ものである。なお、ステータスレジスタ200は演算回
路203の演算結果がオーバ70−状態とか、オーバ7
0−状態とかを表示するもので、その内容がマイクロプ
ログラムによってテストされることによって、マイクロ
プログラムはその流れの中で分岐動作が実行可となって
いる。
The arithmetic circuit 203 executes addition, subtraction, and logical operations under the control of the microprogram in the control memory 91 and writes the results to the register group 204 via the Zaruto bus 101. On the other hand, when the microprogram controls the shift operation, the shift register 201 A rightward or leftward shift is executed by the specified number of digits between .202 and the shift result is written to the register group 204 via the arithmetic circuit 203. Note that the status register 200 indicates that the calculation result of the calculation circuit 203 is in an over 70- state or in an over 70- state.
It displays something like a 0-state, and by testing its contents by the microprogram, the microprogram can execute a branching operation within its flow.

次にランレングスとMH符号との関係について説明すれ
ば、第4図、第5図はそれぞれ@O″ランレングス、′
1”ラングレスについての関係を示したものである。ラ
ンレングスがOから31まではターミネイトコードで以
て表現され得るが、32以上の場合はメイクアップコー
ドが併用されるようになっている。
Next, to explain the relationship between run length and MH code, Figures 4 and 5 show @O'' run length and '
This shows the relationship for a 1" run length. Run lengths from 0 to 31 can be expressed with a terminator code, but if the run length is 32 or more, a make-up code is used.

ところで、第1図に示すようにバッファメモリはアドレ
スA、B−1間は符号化または復号化すべきデータが格
納される入カバツ7ア404に、また、アドレスB、B
仁1間は符号化または復号化されたデータが格納される
出力バッファ405に割シ付され、更にアドレスC,D
−1間、アドレスD、 E−1間は符号化時に使用され
る′O”、@1”のランレングスコードテーブル400
 、401 K、更KまたアドレスE、F−1間、アド
レスF、G−1間は復号化時に使用されるIO”、gi
llのランレングスデコードテーブル402. 403
に割付されたものとなっている。ランレングスコードテ
ーブル400 、 401 (D内容はそれぞれ第6図
(A)、CB)に示されているところである。これら第
6図(イ)、[F])によシランレングスコードテーブ
ルの内容について説明すれば、第4図および第5図に示
すMH符号と、そのMH符号のビット長が1語16ビツ
トのメモリに収容されるようになっている。即ち、第6
図(至)、[F])に示すようにDo−D3にビット長
が、D8〜D15にはMH符号がD15ビット側につめ
られた状態で格納されるるものである。この場合メモリ
アドレスとしてはランレングスが用いられるが、本例で
のメモリアドレスはアドレスC,Dに対する相対アドレ
スとして表示されている。また、メモリの内容としては
ランレングスとメモリアドレスが一致しいる場合のみそ
の内容は有効となっている。
By the way, as shown in FIG. 1, the buffer memory is located between addresses A and B-1 in an input cover 7a 404 where data to be encoded or decoded is stored, and between addresses B and B-1.
Between 1 and 2 is allocated to an output buffer 405 in which encoded or decoded data is stored, and furthermore, addresses C and D are allocated.
-1, addresses D and E-1 are 'O'', @1'' run length code table 400 used during encoding.
, 401 K, and between addresses E and F-1 and between addresses F and G-1 are IO" and gi used during decoding.
Run length decoding table 402 of ll. 403
It has been assigned to. The run length code tables 400 and 401 (the contents of D are shown in FIGS. 6(A) and CB, respectively). If we explain the contents of the silane length code table using these figures 6 (a) and [F]), we will explain the MH codes shown in figures 4 and 5 and the bit length of the MH code of 16 bits per word. It is stored in memory. That is, the sixth
As shown in the figure (to), [F]), the bit length is stored in Do-D3, and the MH code is stored in D8 to D15 with the MH code compressed to the D15 bit side. In this case, the run length is used as the memory address, but the memory address in this example is displayed as a relative address with respect to addresses C and D. Furthermore, the contents of the memory are valid only when the run length and memory address match.

次にランレングスデコードテーブル402.403各々
について第7図(4)、[F])によシ説明すれば、1
語16ビツトのメモリにおけるDO−D3にはMH符号
のビット長が、またD4〜D6およびDIO〜D15の
9ピツトによってはそのMH符号対応のランレングス長
が格納され、メモリアドレスとしてはそのMH符号が用
いられるようになっているうここで、@O’ Oランレ
ングスデコードテーブル402について詳細に説明すれ
ば、例えばメモリアドレス加は、第4図からターミネイ
トコード@ooioo”(5ビツト)、ランレングス@
sjjを示すので、DO−D3にはビット長”5’が、
また、D4〜D6にランレングス”5”が格納され、結
局メモリデータは’0055″となるものである。更に
メモリアドレスIFとそのメモリデータ”0436”に
ついて説明すれば% IF(16進表示) (= ”0
0011111”)は第4図よシターミネイトコード″
’000111”に相当し、したがって、ビット長は6
(10進表示)、ランレングス長は11 (10進表示
)となる。10進表示の11は2進表示上”1011’
となることから、LLには1011”が、LHには”0
000001’が格納されるものである。なお、第1図
に示すようにバックアメモリ81にはアドレスG以降に
マイクロプログラム406が格納されているが、これは
制御メモリ91そのものであって、上位装置からみて、
バックアメモリ81と制御メモリ91のアドレスが連続
していることを示している。
Next, each of the run length decoding tables 402 and 403 will be explained using FIG. 7 (4), [F]).
The bit length of the MH code is stored in DO-D3 in the 16-bit memory, and the run length corresponding to the MH code is stored in the 9 pits D4 to D6 and DIO to D15, and the MH code is stored as the memory address. To explain the @O' O run length decode table 402 in detail, for example, when adding a memory address, from FIG. @
sjj, so DO-D3 has a bit length of “5”.
In addition, run length "5" is stored in D4 to D6, and the memory data becomes '0055' in the end.Moreover, to explain the memory address IF and its memory data "0436", % IF (hexadecimal representation) (=”0
0011111”) is the sitter terminated code in Figure 4.
corresponds to '000111' and therefore has a bit length of 6
(in decimal notation), and the run length length is 11 (in decimal notation). 11 in decimal notation is “1011” in binary notation
Therefore, LL has 1011" and LH has 0.
000001' is stored. As shown in FIG. 1, the microprogram 406 is stored in the backup memory 81 after address G, but this is the control memory 91 itself, and from the perspective of the host device,
This shows that the addresses of backup memory 81 and control memory 91 are consecutive.

さて、ここでライン単位の非圧縮データと圧縮されたラ
イン単位のデータとの関係について説明すれば、第8図
は非圧縮データの一例を示した本のである。図示の如<
41のライン初めにおいては′″0”のビットが8ビツ
ト連続した後は″1”が17ビツト連続し、そのライン
後尾ではi1”がおビット連続した後10”が冗ビット
連続してライン終了(EOL ’)となっている。また
、ム2のライン初めにおいては11”が羽ビット連続す
るようKなっているが、このようにしてなる非圧縮デー
タは第9図に示す如くに符号化によって圧縮されるもの
となっている。即ち、ライン最初の符号化データは10
”のランレングスより始まるものとしてランレングスが
31以下の場合はターミネイトコード(T)のみより、
32以上の場合にはメイクアップコード(M)とターミ
ネイトコードの組合せで以て圧縮されることになる。な
お、第9図においては第8図における判1の加ビット分
が符号化されていないが。
Now, to explain the relationship between line-by-line uncompressed data and compressed line-by-line data, FIG. 8 is a book showing an example of uncompressed data. As shown
At the beginning of line 41, there are 8 consecutive ``0'' bits, followed by 17 consecutive ``1'' bits, and at the end of that line, i1'' is consecutive bits, followed by redundant bits 10'', and the line ends. (EOL'). Also, at the beginning of line 2, K is set so that 11" bits are continuous, but the uncompressed data created in this way is compressed by encoding as shown in Figure 9. That is, the first encoded data of the line is 10
If the run length is 31 or less, start from the run length of ", then use only the terminator code (T),
If it is 32 or more, it will be compressed using a combination of make-up code (M) and termination code. Note that in FIG. 9, the additional bits of decision 1 in FIG. 8 are not encoded.

これは1ライン相轟のビット長が知れている場合はライ
ン最後尾にIO”のランレングスが存在しても、その1
0”はEOLで以て表現し得るからである。
This means that if the bit length of one line is known, even if there is a run length of "IO" at the end of the line, that one
This is because 0'' can be expressed by EOL.

ところで、第10図(5)は第8図の場合での非圧縮デ
ータの入力バッファへの格納態様を、また、第10図I
B)はそのデータの符号化後での出力バッファへの格納
態様を示したものである。これとは逆に第10図[F]
)に示す符号化データが入力バッファに格納される場合
は、そのデータの復号化での出カバソファへの格納態様
は第1θ図(至)に示す如くに格納きれるところとなる
ものである。
By the way, FIG. 10 (5) shows how uncompressed data is stored in the input buffer in the case of FIG.
B) shows how the data is stored in the output buffer after encoding. On the contrary, Fig. 10 [F]
) When the encoded data shown in ) is stored in the input buffer, the manner in which the data is stored in the output buffer upon decoding is such that it can be stored as shown in FIG.

最後に例として羽ビットの“O”のランレングスが如何
にして符号化され、また、それとは逆にその符号化され
たものが如何にして復号化されるかKついて説明すれば
以下のようである。−即ち、最初のラインにおける始め
に′01が羽ビット連続する場合を想定すれば、入カバ
ッ7アにおけるアドレスA、A+1対応のデータは全て
10”として、また、アドレスA+2対応のデータはt
ビット目、14ビツト目がそれぞれ1o”、@1″とし
て格納されていることになる。このように入カバツ7ア
404にデータが格納されている状態で上位装置よシ符
号化命令があったとすれば、先ずアドレスA対応のデー
タがバッファメモリよシマイクロプロセッサに読み出さ
れたうえ左方向にシフトされることによって、@O”ま
たは′ビのビットが連続して何個シフトアウトされるか
カウントされるものとなっている。この場合はアドレス
A対応のデータは全て′″0”であることから、l□I
Iを16個カウントした後は次にアドレスA+1対応の
データを読み出し同様なカウント処理が行なわれるもの
である。結局アドレスA+2対応のデータを2ピツト左
方向ヘシフトした時点で初めてR1″がシフトアウトさ
れることから、結局この時点でのO”カウンタの値は羽
、111カウンタの値はlとなる。
Finally, as an example, how the run length of feather bit "O" is encoded, and conversely, how the encoded thing is decoded is explained as follows. It is. - That is, assuming that '01' are continuous bits at the beginning of the first line, the data corresponding to addresses A and A+1 in the input cover 7a are all 10'', and the data corresponding to address A+2 is t.
The 1st bit and 14th bit are stored as 1o'' and @1'', respectively. If a higher-level device issues an encoding command while data is stored in the input port 7a 404 in this way, first the data corresponding to address A is read out from the buffer memory to the microprocessor, and then the left By shifting in the direction, the number of consecutively shifted out bits of @O" or 'Bi is counted. In this case, all data corresponding to address A is '0'. Therefore, l□I
After counting 16 I's, data corresponding to address A+1 is then read out and similar counting processing is performed. After all, since R1'' is shifted out only when the data corresponding to address A+2 is shifted two pits to the left, the value of the O'' counter at this point becomes 0, and the value of the 111 counter becomes l.

33 (10進表示)は2進表示上″’0001000
01’と表わされるから、そのうちの下位5ビツト″”
00001’はランレングス1のアドレスとして@Os
のランレングスコードテーブルからはメモリデータとし
て”4004 (16進表示)”が得られ、ターミネイ
トコードとして@0100”が得られるものである。一
方、そのうちの上位ビット”0001’は加00100
000’に変換され、結局16進表示のランレングス3
2のアドレス020として“Ollのランレングスコー
ドテーブルからはメモリデータとして@EOO4(16
進表示ビが得られ、メイクアップコードとして@111
0”が得られるものである。したがって、おビットのO
”のランレングスは@11100100”といった具合
に表現されるものである。以下、同様に処理を行なうこ
とによって、符号化データが2バイト分以上出揃う度に
その2バイト分の符号化データは出力バッファ上に書込
されるところとなるものである。
33 (in decimal notation) is “0001000 in binary notation
Since it is expressed as 01', the lower 5 bits of it are ``''
00001' is @Os as an address with run length 1
From the run length code table, "4004 (in hexadecimal notation)" is obtained as memory data, and "@0100" is obtained as the termination code.On the other hand, the upper bit "0001" is added as 00100.
000' and ended up with a run length of 3 in hexadecimal.
As the address 020 of “Oll run length code table, @EOO4 (16
You can get the progress display and use @111 as the makeup code.
0” is obtained. Therefore, the bit O
The run length of " is expressed as @11100100". Thereafter, by performing similar processing, each time two or more bytes of encoded data are received, the two bytes of encoded data are written onto the output buffer.

次にその復号化について説明する。この場合入1カバシ
フアのアドレスA対応のデータとして”1110010
0”が15ビツト目側につめられて格納されているもの
とすれば、上位装置からの復号化命令によって先ずマイ
クロプロセッサは入力バッファよシアドレスA対応のデ
ータを読み出し、その15ビツト目よシ8ビット目まで
のデータ、即ち、@E4”をアドレスとして10”のラ
ンレングスデコードテーブルよシデータを読み出すよう
になっている。データとして’ 1004”が読み出さ
れるわけである。したがって、ランレングスが32であ
ることが知れ、出力バツ7アのアドレスB、B+1には
10″が32ピット分書込されるものである。次にビッ
ト長4にもとづきアドレスA対応のデータ@E4XX”
は左方向へ4ビツトシフトされることKよって’4XX
Q”とされたうえ、4×”をアドレスとして10”のラ
ンレングスデコードテーブルよシデータが読み出される
ようになっている。データとして’0014”が読み出
されるものである。この場合にはLH=0であることか
ら、出力バッファには″O#は書込されなく、この後は
ビット長4にもとづきデータ″’4XXQ”は左方向に
4ビツトシフトされる。このシフトによ5 ”XXQQ
″′が得られるが、最初の1×”は少なくとも′1”の
ランレングス符号化データとなっていることから、以降
復号化処理が上記の場合と同様にして行なわれるところ
となるものである。但し、アドレス4×対応のデータは
@0014’であることから、アドレスB+2における
郷番目ビットは@0”として後に書込されることになる
Next, the decoding will be explained. In this case, the data corresponding to the address A of the input 1 cover is "1110010"
Assuming that 0'' is stored packed in the 15th bit side, the microprocessor first reads the data corresponding to the sea address A from the input buffer in response to the decoding command from the host device, and then writes the 15th bit to the 15th bit. The data up to the 8th bit, that is, the data from the 10" run length decode table is read out using @E4" as the address. '1004' is read out as the data. Therefore, it is known that the run length is 32, and 10'' is written for 32 pits in addresses B and B+1 of output cross 7A.Next, based on the bit length 4, data corresponding to address A @ E4XX”
is shifted 4 bits to the left, so '4XX
Q'', and data is read out from a 10'' run length decode table using 4x'' as an address. '0014' is read out as data. In this case, since LH=0, "O#" is not written to the output buffer, and after this, data "'4XXQ" is shifted 4 bits to the left based on the bit length 4. Yo5 “XXQQ
``'' is obtained, but since the first 1×'' is run-length encoded data of at least ``1'', the decoding process is thereafter performed in the same manner as in the above case. However, since the data corresponding to address 4x is @0014', the second bit at address B+2 will be written later as @0''.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明による場合は、複雑なハード
ウェア構成を要することなく高速、且つ経済的にデータ
のランレングス符号化とランレングス符号化データの復
号化を行ない得るという効果がある。
As described above, the present invention has the advantage that run-length encoding of data and decoding of run-length encoded data can be performed at high speed and economically without requiring a complicated hardware configuration.

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

第1図は、本発明に係るバッファメモリの一例でのメモ
リマツプを示す図、第2図、第3図は、本発明に係るラ
ンレングス符号化復号化装置の一例での構成とそのマイ
クロプロセッサの構成を示す図、第4図、第5図は、そ
れぞれ10”、′1”のランレングスとMH符号との関
係を示す図、第6図(A)、(B)は、それぞれ′″O
”、11″のランレングスコードテーブルを示す図、第
7図(至)、[F])は、それぞれO″、″′1”のラ
ンレングスデコードテーブルを示す図、第8図、第9図
は、ライン単位の非圧縮データと圧縮データとの関係を
説明するための図、第10図(至)、a3)は、それぞ
れ人力バッファ、出カパツ7アに格納されるデータの例
を示す図である。 71・・・マイクロプロセッサ、81・・・バッファメ
モリ、91・・・制御メモリ、400・・・fiO″ラ
ンレングスコードテーブル、401・・・@Isランレ
ングスコードテーブル% 402・・・“O”ランレン
グスデコードテーブル、403・・・”1’ 、Fンレ
ングスデコー)”チー7’ル、404・・・入力バッフ
ァ、405・・・出力バツファ代理人 弁理士 秋 本
 正 実 第3図 第4図 第5図 第6図 (A)              (B)第7図 しシクス                 レンγ△
第8図 第9図 第10図
FIG. 1 is a diagram showing a memory map of an example of a buffer memory according to the present invention, and FIGS. 2 and 3 show the configuration of an example of a run-length encoding/decoding apparatus according to the present invention and its microprocessor. 4 and 5 are diagrams showing the relationship between the run lengths of 10" and 1", respectively, and the MH code, and FIGS.
Figures 7 (to) and [F]) are diagrams showing run length decode tables for O'' and ``'1'', Figures 8 and 9, respectively. is a diagram for explaining the relationship between uncompressed data and compressed data in line units, and Figure 10 (to), a3) is a diagram showing an example of data stored in the manual buffer and output capacitor 7a, respectively. 71...Microprocessor, 81...Buffer memory, 91...Control memory, 400...fiO'' run length code table, 401...@Is run length code table% 402... “O” run-length decoding table, 403...”1', F-length decoding table, 404...input buffer, 405...output buffer Agent Patent attorney Tadashi Akimoto Minoru No. 3 Figure 4 Figure 5 Figure 6 (A) (B) Figure 7
Figure 8 Figure 9 Figure 10

Claims (1)

【特許請求の範囲】[Claims] 上位装置からの非圧縮データ、圧縮データが入力データ
バツフアに一時的に格納せしめられた後、マイクロプロ
グラム制御下に予め記憶されているランレングスコード
テーブル、ランレングスデコードテーブルを参照して符
号化、復号化されたうえ出力データバツフアに一時的に
格納され、該バツフア内のデータは上記上位装置に随時
転送されることを特徴とするランレングス符号化復号化
方式。
After the uncompressed data and compressed data from the host device are temporarily stored in the input data buffer, they are encoded and decoded by referring to the run-length code table and run-length decoding table stored in advance under microprogram control. A run-length encoding/decoding method characterized in that the data is encoded and temporarily stored in an output data buffer, and the data in the buffer is transferred to the host device at any time.
JP13683085A 1985-06-25 1985-06-25 Run-length coding and decoding system Pending JPS61295765A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP13683085A JPS61295765A (en) 1985-06-25 1985-06-25 Run-length coding and decoding system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP13683085A JPS61295765A (en) 1985-06-25 1985-06-25 Run-length coding and decoding system

Publications (1)

Publication Number Publication Date
JPS61295765A true JPS61295765A (en) 1986-12-26

Family

ID=15184497

Family Applications (1)

Application Number Title Priority Date Filing Date
JP13683085A Pending JPS61295765A (en) 1985-06-25 1985-06-25 Run-length coding and decoding system

Country Status (1)

Country Link
JP (1) JPS61295765A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1188192A (en) * 1997-05-12 1999-03-30 Lexmark Internatl Inc Method for compressing data and its device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5610774A (en) * 1979-07-09 1981-02-03 Ricoh Co Ltd Facsimile device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5610774A (en) * 1979-07-09 1981-02-03 Ricoh Co Ltd Facsimile device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1188192A (en) * 1997-05-12 1999-03-30 Lexmark Internatl Inc Method for compressing data and its device

Similar Documents

Publication Publication Date Title
US4825355A (en) Instruction format for program control type data processing systems
JP3203401B2 (en) Data processing device
JPS62283778A (en) Binary data expansion processor
JPS5852265B2 (en) data processing equipment
EP0718980A1 (en) Data compression method of individual sequences of strings of a data stream based on a dictionary and device for performing the same
US4931925A (en) High speed byte data rearranging processor
JPS623461B2 (en)
JPS61295765A (en) Run-length coding and decoding system
JPS5826584B2 (en) data processing equipment
US4041290A (en) Microprogram controlled binary decimal coded byte operator device
JP2905989B2 (en) I / O controller
JPS6285326A (en) Register file system
JP2585472B2 (en) Bus conversion circuit
JPS6022777B2 (en) Data transfer method
JPS5537662A (en) Information processor
JPS617769A (en) Image memory write control system
JPS5814250A (en) Data transfer device
JPH0326177A (en) Compression and expansion controller for image data
JPS60173587A (en) Data processor
JPS6310448B2 (en)
JPH01297758A (en) Data transmission method between microcomputers
JPS59117633A (en) Input and output controller
JPH0327919B2 (en)
JPS61292739A (en) Memory device
JPS62141860A (en) Data processing system