JPH07121067B2 - Run length decoding device - Google Patents

Run length decoding device

Info

Publication number
JPH07121067B2
JPH07121067B2 JP30575486A JP30575486A JPH07121067B2 JP H07121067 B2 JPH07121067 B2 JP H07121067B2 JP 30575486 A JP30575486 A JP 30575486A JP 30575486 A JP30575486 A JP 30575486A JP H07121067 B2 JPH07121067 B2 JP H07121067B2
Authority
JP
Japan
Prior art keywords
code
shift register
length
run length
clock
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.)
Expired - Lifetime
Application number
JP30575486A
Other languages
Japanese (ja)
Other versions
JPS63157566A (en
Inventor
寛 草尾
寧一 西野
博 三木
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP30575486A priority Critical patent/JPH07121067B2/en
Publication of JPS63157566A publication Critical patent/JPS63157566A/en
Publication of JPH07121067B2 publication Critical patent/JPH07121067B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

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

Description

【発明の詳細な説明】 産業上の利用分野 本発明は画像のデータ圧縮のために画像のランレングス
を符号化する方式において、符号化したコードデータを
元のランレングスに復号するランレングス復号化装置に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a run length decoding method for decoding coded code data into an original run length in a method of coding a run length of an image for data compression of the image. Regarding the device.

従来の技術 画像データが持つ冗長度を抑圧し画像の伝送および蓄積
をより効果的に行うために、画像のランレングスを符号
化し画像データを圧縮する方式がある。これは画像のラ
イン方向に連続する白画素または黒画素(白ランまたは
黒ラン)の長さ(ランレングス)に対して、その発生頻
度に応じてそれぞれ適当な符号語を与えるものである。
すなわち発生確率の高いランレングスには短い符号語を
割り当て、発生確率の低いランレングスには長い符号語
を割り当てる。このようにランレングスを符号化する方
式の一つに符号語長がランレングスの対数の1次関数と
なる符号がある(吹抜 著「FAX,OAのための画像の信号
処理」日刊工業新聞社 p68)。このような符号には、
例えばWYL符号,1−2符号等が知られている(遠藤,山
崎「会話型画像通信に適したファクシミリ信号の順次再
生符号化方式」電子通信学会論文誌′84/12 Vol.J67−B
No.12 pp.1462−1469)。WYLE符号、1−2符号をそれ
ぞれ第7図、第8図に示す。これらの符号はそれぞれア
ドレス符号とリメインダ符号とから成り、アドレス符号
はその符号の符号長で表し得るランレングスの最小値お
よび次に続くリメインダ符号のビット数を表し、リメイ
ンダ符号は前記ランレングスの最小値と実際のランレン
グスとの差を表す。
2. Description of the Related Art In order to suppress the redundancy of image data and more effectively transmit and store the image, there is a method of encoding the run length of the image and compressing the image data. This gives an appropriate code word to the length (run length) of white pixels or black pixels (white run or black run) that are continuous in the line direction of the image, depending on the frequency of occurrence.
That is, short code words are assigned to run lengths with a high occurrence probability, and long code words are assigned to run lengths with a low occurrence probability. One of the methods for encoding the run length is a code whose codeword length is a linear function of the logarithm of the run length (Fukigaki, "Signal processing of images for FAX and OA", Nikkan Kogyo Shimbun). p68). Such codes include
For example, WYL code, 1-2 code, etc. are known (Endo, Yamazaki "Sequential reproduction coding method of facsimile signal suitable for conversational image communication", IEICE Transactions '84 / 12 Vol.J67-B
No. 12 pp.1462-1469). WYLE code and 1-2 code are shown in FIGS. 7 and 8, respectively. Each of these codes is composed of an address code and a reminder code, and the address code represents the minimum value of the run length that can be represented by the code length of the code and the number of bits of the subsequent reminder code, and the reminder code is the minimum of the run length. It represents the difference between the value and the actual run length.

従って、元のランレングスを復号するには、アドレス符
号を検出してランレングスの最小値および次に続くリメ
インダ符号を求め、次にリメインダ符号が表す値とアド
レス符号が与えるランレングスの最小値とを加えればよ
い。例えばWYLE符号の符号語110は上位の1がアドレス
符号でありこれは最小ランレングスが1で次の2ビット
がリメインダ符号であることを示し、よって10がリメイ
ンダ符号で結局求めるランレングスは最小ランレングス
1に2進数の10すなわち2を加えて3となる。同様にWY
LE符号の符号語00010101は0001がアドレス符号でランレ
ングスの最小値は17であり、次の4ビット0101がリメイ
ンダ符号であることを示し、ランレングスは17に5(2
進数の0101)を加えて22となる。
Therefore, in order to decode the original run length, the address code is detected to find the minimum value of the run length and the subsequent remaining code, and then the value represented by the remaining code and the minimum value of the run length given by the address code are calculated. Should be added. For example, in the code word 110 of the WYLE code, the upper 1 is the address code, which means that the minimum run length is 1 and the next 2 bits are the reminder code. Therefore, 10 is the reminder code and the run length finally obtained is the minimum run length. Add a binary number of 10, or 2, to length 1 to get 3. Similarly WY
The code word 00010101 of the LE code indicates that 0001 is the address code and the minimum value of the run length is 17, and the next 4 bits 0101 is the reminder code, and the run length is 5 (2 to 17).
Add the base number 0101) to get 22.

次に従来の復号の方法をWYLE符号を例にとって説明す
る。WYLE符号の特徴として、符号語が表すランレングス
の2進表現は、符号語に1を加えた値そのものというこ
とがある。ただしランレングスが1から4までは例外
で、符号語のMSB(最上位ビット)の1を0としてから
1を加えた値がランレングスの2進表現である。復号に
はこの性質を利用する。第6図はWYLE符号の復号化装置
の従来例の一つである。コードデータ101はクロック102
に同期してMSBよりコードデータ制御回路104を経てシフ
トレジスタ108に入力される。コードデータ制御回路104
は符号語の最上位ビットが1の時のみ最上位ビットだけ
を反転して0としシフトレジスタ108に出力する。タイ
ミング制御回路103はクロック102に同期してMSBより入
力されるコードデータ101を監視して1となる時点でア
ドレス符号とリメインダ符号の切れ目を検出する。符号
長カウンタ部107のアドレス符号長カウンタ106はタイミ
ング制御回路103がアドレス符号とリメインダ符号の切
れ目を検出するまでクロック102に同期して計数を行い
アドレス符号のビット数を求める。アドレス符号とリメ
インダ符号の切れ目を検出しアドレス符号のビット数が
求まるとこれからリメインダ符号のビット数が求まるの
で,この値をリメインダ符号カウンタ105にセットす
る。WYLE符号の場合、アドレス符号のビット数=リメイ
ンダ符号のビット数である。ただしアドレス符号のビッ
ト数が1の時のみリメインダ符号のビット数は2であ
る。アドレス符号を検出した時点でシフトレジスタ108
にはアドレス符号が入力されている。ただし前記コード
データ制御回路104によりアドレス符号のビット数が1
の時は0が入力されている。引き続いてシフトレジスタ
108にはクロック102に同期してリメインダ符号が入力さ
れる。
Next, a conventional decoding method will be described by taking a WYLE code as an example. A feature of the WYLE code is that the binary representation of the run length represented by the code word is the value itself obtained by adding 1 to the code word. However, run lengths 1 to 4 are exceptions, and the value obtained by adding 1 to 0 of the MSB (most significant bit) of the code word is 1 is the binary representation of the run length. This property is used for decoding. FIG. 6 shows one example of a conventional WYLE code decoding device. Code data 101 is clock 102
The data is input from the MSB to the shift register 108 via the code data control circuit 104 in synchronism with. Code data control circuit 104
Only when the most significant bit of the code word is 1, only the most significant bit is inverted and set to 0 and output to the shift register 108. The timing control circuit 103 monitors the code data 101 input from the MSB in synchronization with the clock 102 and detects a break between the address code and the reminder code when the code data 101 becomes 1. The address code length counter 106 of the code length counter unit 107 counts in synchronization with the clock 102 until the timing control circuit 103 detects a break between the address code and the reminder code, and obtains the number of bits of the address code. When the break between the address code and the reminder code is detected and the number of bits of the address code is obtained, the number of bits of the reminder code is obtained, and this value is set in the reminder code counter 105. In the case of WYLE code, the number of bits of the address code = the number of bits of the retainer code. However, the number of bits of the reminder code is 2 only when the number of bits of the address code is 1. When the address code is detected, the shift register 108
An address code is input to. However, the bit number of the address code is set to 1 by the code data control circuit 104.
When is 0, 0 is input. Continued shift register
The reminder code is input to 108 in synchronization with the clock 102.

リメインダ符号の終了は先に設定したリメインダ符号カ
ウンタ105の値をクロック112によりカウントダウンして
0となった時点で検出し、検出信号113を出力する。
The end of the reminder code is detected when the value of the previously set reminder code counter 105 is counted down by the clock 112 and becomes 0, and the detection signal 113 is output.

この時シフトレジスタ108には実際のランレングスより
1少ない値が設定されていることになる。これは先に述
べたWYLE符号の性質によるものである。リメインダ符号
の終了すなわち符号語の終了を検出すると,シフトレジ
スタ108のデータ117はランレングスカウンタ部111に送
られランレングス復号用カウンタ110にセットされる。
さらにランレングス復号用カウンタ110をカウントクロ
ック116でカウントダウンして0となった時点でランレ
ングス終了信号118を出力することにより1つのランが
終了したことを知らせる。カウント値補正回路109は、
シフトレジスタ108に設定された実際のランレングスよ
り1少ない値を正しい値に補正する。求めるランレング
スはカウントクロック116のパルス数である。符号長カ
ウンタ部107におけるアドレス符号長カウンタ106とリメ
インダ符号カウンタ105を共用化した例もある(例え
ば、特公昭58−29916号公報)。
At this time, the shift register 108 is set to a value that is one less than the actual run length. This is due to the property of the WYLE code described above. When the end of the reminder code, that is, the end of the code word is detected, the data 117 of the shift register 108 is sent to the run length counter unit 111 and set in the run length decoding counter 110.
Further, when the run length decoding counter 110 is counted down by the count clock 116 and becomes 0, the run length end signal 118 is output to notify that one run is completed. The count value correction circuit 109
A value that is one less than the actual run length set in the shift register 108 is corrected to a correct value. The run length to be obtained is the number of pulses of the count clock 116. There is also an example in which the address code length counter 106 and the reminder code counter 105 in the code length counter unit 107 are shared (for example, Japanese Patent Publication No. 58-29916).

発明が解決しようとする問題点 従来の方式では、アドレス符号を検出する際にアドレス
符号のビット数をカウントし、このカウント値を基にリ
メインダ符号のビット数を求め、このビット数からリメ
インダ符号を検出してランレングスの復号を行ってい
た。このためにアドレス符号のビット数を求めるカウン
タとリメインダ符号のビット数を求めるカウンタが必要
であり、またこれらの制御も複雑であった。さらにラン
の分布の統計的性質により異なる複数の符号を適応的に
用いて画像データの圧縮をより効率的に行おうとする際
にはランレングス復号化装置は複数の符号を復号できる
のが望ましいが、先に述べた複雑さによりランレングス
復号装置の複数の符号への対応は困難であった。
Problems to be Solved by the Invention In the conventional method, the number of bits of the address code is counted when the address code is detected, the number of bits of the reminder code is obtained based on this count value, and the reminder code is calculated from this number of bits. It detected and decoded the run length. Therefore, a counter for obtaining the number of bits of the address code and a counter for obtaining the number of bits of the retainer code are required, and their control is also complicated. Furthermore, in order to more efficiently compress image data by adaptively using a plurality of codes that differ depending on the statistical property of the distribution of runs, it is desirable that the run-length decoding apparatus be able to decode a plurality of codes. Due to the complexity described above, it has been difficult for the run-length decoding device to deal with a plurality of codes.

本発明ではかかる点に鑑み、簡素な構成でランレングス
の復号を実現し、従って複数の符号に対しても容易に適
応することができるランレングス復号化装置を提供する
ことを目的とする。
In view of the above point, the present invention has an object to provide a run-length decoding device that can realize run-length decoding with a simple configuration and can easily adapt to a plurality of codes.

問題点を解決するための手段 本発明は上記問題点を解決するために、ランレングスを
再生するためのシフトレジスタと、アドレス符号を検出
するためのメモリ装置(シフトレジスタのシフトクロッ
クと同じ周波数でデータを読み込みその1/2の周波数で
データを入力順に出力するメモリ装置、例えばファスト
イン・ファストアウトメモリ)とを利用して、これらに
コードデータを入力することによりアドレス符号の検出
とランレングスの再生を同時に行うものである。
Means for Solving the Problems In order to solve the above problems, the present invention provides a shift register for reproducing a run length and a memory device for detecting an address code (at the same frequency as the shift clock of the shift register). By using the memory device that reads the data and outputs the data at the frequency of 1/2 of that in the input order, for example, fast-in / fast-out memory), by inputting the code data to these, the detection of the address code and the run length Playback is performed at the same time.

作用 本発明は上記の構成とすることにより、上記メモリ装置
の出力によってアドレス符号を検出した時点で既に2倍
の速度で動作するシフトレジスタにはリメインダ符号ま
でが入力されていることになり、よってこの時符号語の
切り出しは完了しシフトレジスタにはランレングスにオ
フセットを加えた値が再生されていることになる。従っ
てアドレス符号やリメインダ符号のビット数をカウント
すること無くランレングスを再生することができる。
Operation According to the present invention having the above-mentioned configuration, even the reminder code is already input to the shift register which operates at twice the speed when the address code is detected by the output of the memory device. At this time, the cutout of the code word is completed and the value obtained by adding the offset to the run length is reproduced in the shift register. Therefore, the run length can be reproduced without counting the number of bits of the address code and the reminder code.

実施例 第1図は本発明によるランレングス復号化装置の一実施
例を示すブロック図である。同図において、51は基本ク
ロック,50はコードデータ,52はタイミング制御回路,53
はコードデータ制御回路,56はシフトレジスタ,67はシフ
トクロック,63はシフトレジスタ56への入力,65はシフト
レジスタ56の出力,55はアドレス符号検出部,54はファス
トイン・ファストアウトメモリ(FIFO),60はFIFO54の
シフトインクロック,61はFIFO54のシフトアウトクロッ
ク,62はアドレス符号検出信号,59はランレングスカウン
タ部,57はカウント値補正回路,58はランレングス復号用
カウンタ,64はカウントクロック,66はランレングス終了
信号である。
Embodiment FIG. 1 is a block diagram showing an embodiment of a run length decoding device according to the present invention. In the figure, 51 is a basic clock, 50 is code data, 52 is a timing control circuit, 53
Is a code data control circuit, 56 is a shift register, 67 is a shift clock, 63 is an input to the shift register 56, 65 is an output of the shift register 56, 55 is an address code detector, 54 is a fast-in / fast-out memory (FIFO). ), 60 is a shift-in clock of the FIFO 54, 61 is a shift-out clock of the FIFO 54, 62 is an address code detection signal, 59 is a run length counter unit, 57 is a count value correction circuit, 58 is a run length decoding counter, and 64 is a count Clock, 66 is a run length end signal.

コードデータ50はクロック51に同期してMSBよりコード
データ制御回路53を経てシフトレジスタ56に入力され
る。コードデータ制御回路53はWYLE符号などランレング
スが短い所で例外パターンがある場合にデータ列に処理
を行いシフトレジスタ56に出力する。タイミング制御回
路52はシフトレジスタ56へは基本クロック51と同じ周波
数のシフトクロック67を,FIFO54へは基本クロック51と
同じ周波数のシフトインクロック60および基本クロック
51の1/2の周波数のシフトアウトクロック61を,ランレ
ングスカウンタ部59へはカウントクロック64を出力し,
またアドレス符号検出部55からアドレス符号を検出した
ことを知らせる信号62を入力するとシフトクロック67,
シフトインクロック60およびシフトアウトクロック61の
全てをマスクする。
The code data 50 is input from the MSB to the shift register 56 via the code data control circuit 53 in synchronization with the clock 51. The code data control circuit 53 processes the data string and outputs it to the shift register 56 when there is an exceptional pattern at a place where the run length is short such as WYLE code. The timing control circuit 52 supplies a shift clock 67 having the same frequency as the basic clock 51 to the shift register 56, and a shift-in clock 60 and a basic clock having the same frequency as the basic clock 51 to the FIFO 54.
A shift-out clock 61 having a frequency half that of 51 is output, and a count clock 64 is output to the run-length counter unit 59.
Further, when the signal 62 which notifies that the address code is detected is input from the address code detection unit 55, the shift clock 67,
All shift-in clocks 60 and shift-out clocks 61 are masked.

アドレス符号検出部55はシフトアウトクロック61に同期
してFIFO54より出力されるデータを監視して1となる時
点でアドレス符号とリメインダ符号の切れ目を検出し信
号62を出力する。アドレス符号が検出された時点で、シ
フトレジスタ56のシフトクロック67はFIFO54のシフトア
ウトクロック61の2倍の周波数であることからシフトレ
ジスタ56にはリメインダ符号までが入力されていること
になる。これはWYLE符号など対象としている符号語がア
ドレス符号長リメインダ符号長となっているためであ
る。タイミング制御回路52はアドレス符号の検出が終わ
った時点でシフトレジスタ56にリメインダ符号が丁度入
力し終わるようクロックを制御する。
The address code detection unit 55 monitors the data output from the FIFO 54 in synchronization with the shift-out clock 61, detects a break between the address code and the reminder code when the data becomes 1, and outputs a signal 62. At the time when the address code is detected, the shift clock 67 of the shift register 56 has twice the frequency of the shift-out clock 61 of the FIFO 54. Therefore, the shift register 56 is input up to the reminder code. This is because the target codeword such as the WYLE code has the address code length reminder code length. The timing control circuit 52 controls the clock so that the reminder code is just input to the shift register 56 when the address code is detected.

以上のように、タイミング制御回路52およびコードデー
タ制御回路53によりアドレス符号がアドレス符号検出部
55で検出された時点でシフトレジスタ56には求めるラン
レングスにオフセットを加えた値が設定されることにな
る。オフセット値は、例えばWYLE符号では−1,1−2符
号では0である。
As described above, the address code is detected by the timing control circuit 52 and the code data control circuit 53.
At the time of detection at 55, the value obtained by adding an offset to the run length to be obtained is set in the shift register 56. The offset value is, for example, −1 in the WYLE code and 0 in the 1-2 code.

アドレス符号検出部55がアドレス符号を検出すなわちシ
フトレジスタ56における符号語入力の終了を検出する
と、シフトレジスタ56のデータ65はランレングスカウン
タ部59に送られランレングス復号用カウンタ58にセット
される。ランレングス復号用カウンタ58はカウントクロ
ック64によりカウントダウンされ0となった時点でラン
レングス終了信号66を出力して1つのランが終了したこ
とを知らせる。
When the address code detection unit 55 detects the address code, that is, when the input of the code word in the shift register 56 is detected, the data 65 in the shift register 56 is sent to the run length counter unit 59 and set in the run length decoding counter 58. The run-length decoding counter 58 outputs a run-length end signal 66 at the time when it is counted down by the count clock 64 and becomes 0, to notify that one run has ended.

カウント値補正回路57は、シフトレジスタ56に設定され
た実際のランレングスにオフセットが加わった値を正し
い値に補正する。例えばWYLE符号の場合はランレングス
復号用カウンタ58が0となる時点より1クロック遅らせ
てランレングス終了信号66を出力し、1−2符号の場合
はランレングス復号用カウンタ58が0となる時点でラン
レングス終了信号66を出力する。カウントクロック64の
パルス数が復号したランレングスである。
The count value correction circuit 57 corrects a value obtained by adding an offset to the actual run length set in the shift register 56 to a correct value. For example, in the case of WYLE code, the run-length decoding signal 58 is output 1 clock after the run-length decoding counter 58 becomes 0, and in the case of 1-2 code, the run-length decoding counter 58 becomes 0. The run length end signal 66 is output. The number of pulses of the count clock 64 is the decoded run length.

第2図は、第1図のブロック図の具体的な一実施例を示
す図でありWYLE符号および1−2符号の復号を行うもの
である。同図において破線18′,26′,40は1−2符号の
復号に用いる部分であり実線はWYLE符号およびWYLEと1
−2符号共通に用いる部分である。最初に符号長が6の
WYLE符号を復号する場合を例にとって第2図の回路の動
作を第3図のタイミング図を参考にして説明する。まず
clear信号27〜31によって各フリップフロップとシフト
レジスタおよびFIFOがリセットされ初期設定される。
FIG. 2 is a diagram showing a specific embodiment of the block diagram of FIG. 1, and is for decoding WYLE code and 1-2 code. In the figure, broken lines 18 ', 26', and 40 are parts used for decoding the 1-2 code, and solid lines are WYLE code and WYLE and 1
-2 is a part commonly used for codes. First the code length is 6
The operation of the circuit of FIG. 2 will be described with reference to the timing chart of FIG. 3 by taking the case of decoding the WYLE code as an example. First
The clear signals 27 to 31 reset and initialize the flip-flops, shift register, and FIFO.

次にスタート信号1が入力されるとフリップフロップ10
がセットされると共にフリップフロップ4にコードデー
タ2のMSBが取り込まれる。アドレス符号が1の時(ラ
ンレングスが1〜4)以外はコードデータのMSBは0な
ので今の場合フリップフロップ4の出力15はLレベルと
なる。フリップフロップ10がセットされると周波数fの
クロック17と周波数f/2のクロック18がANDゲート11,12
で有効とされそれぞれクロック20とクロック19となって
出力される。シフトレジスタ7はクロック20をインバー
タ34で反転したクロック35によりシフト動作を行う。フ
リップフロップ4の出力15がLレベルでセレクタ5は入
力14を出力32とするためシフトレジスタ7の入力はコー
ドデータ2がフリップフロップ3で1クロック遅延され
たものとなる。コードデータ2はクロック39に同期して
シリアルに入力するが、フリップフロップ4の出力15が
LレベルであるためANDゲート36の出力37はLであり従
ってクロック39はクロック20に等しい。アドレス符号の
検出はFIFO6のシフトアウト出力23が1になることで検
出される。この時フリップフロップ10はリセットされ、
またFIFO6のシフトインクロック20はシフトレジスタ7
のシフトクロック35と同じ周波数fのクロックでありシ
フトアウトクロック21は周波数f/2のクロック(クロッ
ク19がインバータ13で反転されたもの)であるので第3
図の24に示すようにシフトレジスタ7には符号語の第6
ビットまで、つまり符号語全部が入力されている。フリ
ップフロップ10がリセットされるとクロック17,18はAND
ゲート11,12においてフリップフロップ10の出力22より
マスクされ第2図の回路の動作は一旦停止する。次にlo
ad信号33によりシフトレジスタ7の出力24がカウンタ8
にセットされる。この時カウンタ8にセットされている
値はランレングスの値から1を引いた値である。カウン
タ8はダウンカウンタでありカウントクロック16により
減算されて行き0となった時点でキャリー信号25を出力
する。キャリ信号25はフリップフロップ9で1クロック
遅延されてランレングス終了信号26となって出力され、
ランレングスの復号が終わったことを知らせる。この間
のカウントクロック16のパルス数がランレングスを表
す。カウンタ8にセットされたランレングスの値から1
を引いた値はフリップフロップ9により元の正しいラン
レングスに補正されたことになる。
Next, when the start signal 1 is input, the flip-flop 10
Is set and the MSB of the code data 2 is taken into the flip-flop 4. Since the MSB of the code data is 0 except when the address code is 1 (run length is 1 to 4), the output 15 of the flip-flop 4 is at the L level in this case. When the flip-flop 10 is set, the clock 17 of frequency f and the clock 18 of frequency f / 2 are AND gates 11 and 12.
Are valid and output as clock 20 and clock 19, respectively. The shift register 7 performs a shift operation with a clock 35 obtained by inverting the clock 20 with an inverter 34. Since the output 15 of the flip-flop 4 is at the L level and the selector 5 uses the input 14 as the output 32, the input of the shift register 7 is the code data 2 delayed by one clock in the flip-flop 3. The code data 2 is serially input in synchronization with the clock 39, but since the output 15 of the flip-flop 4 is at the L level, the output 37 of the AND gate 36 is at L and therefore the clock 39 is equal to the clock 20. The detection of the address code is detected when the shift-out output 23 of the FIFO 6 becomes 1. At this time, the flip-flop 10 is reset,
Further, the shift-in clock 20 of the FIFO 6 is the shift register 7
Since the shift-out clock 21 has the same frequency f as the shift clock 35 and the shift-out clock 21 has the frequency f / 2 (the clock 19 is inverted by the inverter 13),
As shown in FIG. 24, the shift register 7 has the sixth code word
Up to bits, that is, the entire codeword is input. When the flip-flop 10 is reset, the clocks 17 and 18 are AND
The gates 11 and 12 are masked by the output 22 of the flip-flop 10 and the operation of the circuit shown in FIG. 2 is temporarily stopped. Then lo
The output 24 of the shift register 7 is the counter 8 by the ad signal 33.
Is set to. At this time, the value set in the counter 8 is a value obtained by subtracting 1 from the run length value. The counter 8 is a down counter and outputs a carry signal 25 when the count clock 16 subtracts the count value to 0. The carry signal 25 is delayed by one clock in the flip-flop 9 and output as the run length end signal 26,
Notify that the run length decoding is complete. The number of pulses of the count clock 16 during this period represents the run length. 1 from the run length value set in counter 8
The value obtained by subtracting is corrected to the original correct run length by the flip-flop 9.

以上は符号長が6のWYLE符号を復号する場合についての
説明であるが、これはWYLE符号の他の符号長の符号語に
対しても同様である。ただしWYLE符号の符号長3の場合
(ランレングスが1〜4)は例外処理となる。すなわち
他の符号長ではアドレス符号長=リメインダ符号長であ
るが、符号長3の場合はアドレス符号長=1,リメインダ
符号長=2であるため前記FIFO6とシフトレジスタ7の
クロックの関係がそのまま適用できなくなり、また符号
語がランレングスの値から1を引いた値とはなっていな
いためである。そのため符号長3の時は次のような処理
を行う。符号長3の場合はFIFO6の出力23の1ビット目
でアドレス符号が検出され、この時シフトレジスタには
2ビットが入力されている。よって符号語の2ビット目
からシフトレジスタ7に入力すればアドレス符号検出時
のシフトレジスタ7の値はランレングスの値から1を引
いた値となっている。
The above is a description of the case of decoding a WYLE code having a code length of 6, but the same applies to codewords of other code lengths of the WYLE code. However, when the code length of the WYLE code is 3 (run length is 1 to 4), it is an exceptional process. That is, for other code lengths, the address code length = remainer code length, but when the code length is 3, the address code length = 1 and the retainer code length = 2, so the relationship between the clocks of the FIFO 6 and the shift register 7 is applied as it is. This is because it is not possible, and the code word is not a value obtained by subtracting 1 from the run length value. Therefore, when the code length is 3, the following processing is performed. When the code length is 3, the address code is detected at the first bit of the output 23 of the FIFO 6, and at this time, 2 bits are input to the shift register. Therefore, if the second bit of the code word is input to the shift register 7, the value of the shift register 7 at the time of detecting the address code is a value obtained by subtracting 1 from the value of the run length.

第2図の回路の符号長3の場合の動作を説明したのが第
4図のタイミング図である。以下には先の符号長が6場
合との相違点について述べる。スタート信号1が入力さ
れるとコードデータのMSBが1であるのでフリップフロ
ップ4の出力15はHレベルとなりセレクタ5によってシ
フトレジスタ7の入力32はコードデータ2となる。従っ
て第4図の24から明らかなようにシフトインクロック35
によってシフトレジスタ7には符号語の第2ビット目か
ら2ビット入力されることになる。
The operation of the circuit of FIG. 2 when the code length is 3 is explained with reference to the timing chart of FIG. The difference from the case where the code length is 6 will be described below. When the start signal 1 is input, since the MSB of the code data is 1, the output 15 of the flip-flop 4 becomes H level and the input 32 of the shift register 7 becomes the code data 2 by the selector 5. Therefore, as is clear from 24 in FIG. 4, the shift-in clock 35
Thus, the shift register 7 receives 2 bits from the second bit of the code word.

また第4図でFIFO6の出力23がHレベルになってアドレ
ス符号が検出された時点でのコードデータ入力2は符号
語の第3ビットのままになっており次の符号語のMSB
(第4ビットに相当)が準備されていない。これは先の
符号長6の場合の第3図のタイミング図の2と24では,
シフトレジスタに6ビット入力された時にコードデータ
入力2は7ビット目(次の符号語のMSB)を出力してい
るのと比べて異なる点である。そこでシフトレジスタ7
の出力24をカウンタ8にセットするload信号33を利用し
これをANDゲート36およびORゲート38を介してコードデ
ータ2のシフトクロック39に加えコードデータを1ビッ
トシフトしてやる。このload信号33によるコードデータ
のシフトはANDゲート36の入力15がHレベル、すなわち
符号長が3の時のみ有効である。
Further, in FIG. 4, when the output 23 of the FIFO 6 becomes H level and the address code is detected, the code data input 2 remains the 3rd bit of the codeword and the MSB of the next codeword.
(Corresponding to the 4th bit) is not prepared. This is the case in 2 and 24 of the timing diagram of FIG.
The difference is that the code data input 2 outputs the 7th bit (MSB of the next code word) when 6 bits are input to the shift register. So shift register 7
Using the load signal 33 for setting the output 24 of the counter 24 to the counter 8, this is applied to the shift clock 39 of the code data 2 via the AND gate 36 and the OR gate 38 to shift the code data by 1 bit. The shift of the code data by the load signal 33 is effective only when the input 15 of the AND gate 36 is at H level, that is, when the code length is 3.

次に第2図の回路を1−2符号の復号に用いた場合につ
いて説明する。同図で破線で示した所が1−2符号の復
号で用いる部分である。1−2符号では符号語がそのま
まその符号語が表すランレングスの2進表現となってい
る。またアドレス符号長=リメインダ符号長+1であ
る。以下には先に説明したWYLE符号の復号との相違点を
述べる。1−2符号ではWYLE符号と異なりランレングス
の短い所での例外パタンが無いため例外処理は不要であ
る。
Next, the case where the circuit of FIG. 2 is used for decoding the 1-2 code will be described. The part indicated by the broken line in the figure is the part used in the decoding of the 1-2 code. In the 1-2 code, the code word is a binary representation of the run length represented by the code word as it is. Further, the address code length = remainer code length + 1. The difference from the decoding of the WYLE code described above will be described below. Unlike the WYLE code, the 1-2 code does not require exception processing because there is no exception pattern at a short run length.

従って第2図のフリップフロップ4をclear信号40によ
りその出力15をLレベルに固定することにより、セレク
タ5がシフトレジスタ7への入力32として常にコードデ
ータ2を1クロック遅らせたデータ14を選択するように
している。また1−2符号では符号語がそのままその符
号語が表すランレングスの2進表現となっているのでカ
ウンタ8のキャリー信号25を1クロック遅らす必要は無
く、キャリー信号25をそのままランレングス終了信号2
6′としている。このように1−2符号に適用させた第
2図の回路の動作を第5図のタイミング図で示す。第5
図は符号語長が5ビットの場合である。同図に示すよう
に周波数f/2のクロック18′はWYLE符号の場合のクロッ
ク18に比べて1/4だけ位相を遅らせている。これはWYLE
符号がアドレス符号長=リメインダ符号長であるのに対
して1−2符号はアドレス符号長=リメインダ符号長+
1であるので,その補正を行うためである。以上の点を
除いては1−2符号に対する第2図の回路の動作はWYLE
符号の符号長3以外の場合の動作(例えば第3図で説明
した符号長6の場合)と同じである。
Therefore, by fixing the output 15 of the flip-flop 4 shown in FIG. 2 to the L level by the clear signal 40, the selector 5 always selects the data 14 obtained by delaying the code data 2 by 1 clock as the input 32 to the shift register 7. I am trying. Further, in the 1-2 code, since the code word is a binary representation of the run length represented by the code word, it is not necessary to delay the carry signal 25 of the counter 8 by one clock, and the carry signal 25 is directly used as the run length end signal 2.
6 '. The operation of the circuit of FIG. 2 thus applied to the 1-2 code is shown in the timing chart of FIG. Fifth
The figure shows the case where the code word length is 5 bits. As shown in the figure, the clock 18 'having the frequency f / 2 is delayed in phase by 1/4 as compared with the clock 18 in the case of the WYLE code. This is WYLE
The code is address code length = remainer code length, while the 1-2 code is address code length = remainer code length +
This is because it is 1, so that the correction is performed. Except for the above points, the operation of the circuit of FIG.
The operation is the same as the case where the code length of the code is other than 3 (for example, the case of the code length 6 described in FIG. 3).

発明の効果 従来ランレングス符号の復号に際してはアドレス符号と
リメインダ符号のビット数をカウントするカウンタが必
要であったのに対して、本発明では周波数fでデータを
読み込み周波数f/2で入力順にデータを読み出せるメモ
リ装置(例えばFIFO)を利用することにより前記カウン
タおよびカウンタ周辺の制御部を不要とし、きわめて簡
素な構成のランレングス復号化装置を可能としている。
さらに簡素な構成故に、複数のランレングス符号に対し
ても装置の一部の制御で容易に対応することが可能であ
る。
EFFECTS OF THE INVENTION Conventionally, in decoding run-length codes, a counter for counting the number of bits of the address code and the reminder code was required, whereas in the present invention, data is read at frequency f and data is input in order of frequency f / 2. By using a memory device (for example, a FIFO) capable of reading out, the counter and the control unit around the counter are unnecessary, and a run-length decoding device having an extremely simple configuration is possible.
Due to the simpler configuration, it is possible to easily handle a plurality of run length codes by controlling a part of the device.

【図面の簡単な説明】 第1図は本発明の一実施例のランレングス復号化装置の
ブロック図、第2図は同装置の具体的構成図、第3図は
第2図におけるWYLE符号の復号を示すタイミング図、第
4図は第2図におけるWYLE符号の復号で符号長3の時の
例外処理を示すタイミング図、第5図は第2図における
1−2符号の復号を示すタイミング図、第6図は従来例
のランレングス復号化装置のブロック図、第7図はWYLE
符号を表す図、第8図は1−2符号を表す図である。 50……コードデータ、51……基本クロック、52……タイ
ミング制御回路、53……コードデータ制御回路、54……
ファストイン・ファストアウトメモリ(FIFO)、55……
アドレス符号検出部、56……シフトレジスタ、57……カ
ウント値補正回路、58……ランレングス復号用カウン
タ、59……ランレングスカウンタ部、60……シフトイン
クロック、61……シフトアウトクロック、64……カウン
トクロック、66……ランレングス終了信号、67……シフ
トクロック。
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram of a run-length decoding device according to an embodiment of the present invention, FIG. 2 is a concrete configuration diagram of the device, and FIG. 3 is a WYLE code of FIG. FIG. 4 is a timing diagram showing decoding, FIG. 4 is a timing diagram showing exceptional processing when the WYLE code in FIG. 2 has a code length of 3, and FIG. 5 is a timing diagram showing decoding of 1-2 code in FIG. , FIG. 6 is a block diagram of a conventional run-length decoding device, and FIG. 7 is WYLE.
FIG. 8 is a diagram showing symbols, and FIG. 8 is a diagram showing 1-2 symbols. 50 …… code data, 51 …… basic clock, 52 …… timing control circuit, 53 …… code data control circuit, 54 ……
Fast-in / fast-out memory (FIFO), 55 ……
Address code detection unit, 56 ... Shift register, 57 ... Count value correction circuit, 58 ... Run length decoding counter, 59 ... Run length counter unit, 60 ... Shift in clock, 61 ... Shift out clock, 64 …… Count clock, 66 …… Run length end signal, 67 …… Shift clock.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】画像データのランレングスをWYLE符号等の
符号語長がランレングスの対数の1次関数となる符号に
より符号化したコードデータを元のランレングスに復号
するものであり、直列なコードデータを周波数fなるシ
フトクロックで入力し並列に出力するシフトレジスタ
と、前記シフトレジスタの並列出力を入力とするカウン
タと、周波数fなるクロックでコードデータを読み込
み、周波数f/2なるクロックで前記読み込みデータを入
力順に読み出し得るメモリ装置と、前記メモリ装置から
周波数f/2で読み出したコードデータの値が変化するこ
とでアドレス符号を検出する手段と、前記シフトレジス
タへのコードデータ入力を制御する手段と、前記カウン
タのキャリー信号を制御する手段とを有し、コードデー
タを前記シフトレジスタおよび前記メモリ装置に周波数
fで同時に入力し、また、それと同時に前記メモリ装置
からは周波数f/2でデータを読み出し、周波数f/2に同期
した前記メモリ装置の出力の変化によりアドレス符号を
検出した時点で既に周波数fで動作する前記シフトレジ
スタには符号語が入力されていることを利用してランレ
ングスの復号を行うことを特徴とするランレングス復号
化装置。
Claims: 1. The run length of image data is coded by a code such as a WYLE code whose codeword length is a linear function of the logarithm of the run length to decode the code data into the original run length, and serial data is decoded. A shift register for inputting code data at a shift clock of frequency f and outputting in parallel, a counter for receiving parallel output of the shift register, a code data at a clock of frequency f, and a clock at a frequency of f / 2 A memory device capable of reading the read data in the order of input, a means for detecting an address code by changing the value of the code data read from the memory device at a frequency f / 2, and controlling the code data input to the shift register. Means and means for controlling the carry signal of the counter, for transferring code data to the shift register and the shift register. To the memory device at the same time at the frequency f, and at the same time, data is read from the memory device at the frequency f / 2, and the address code is detected by the change in the output of the memory device in synchronization with the frequency f / 2. A run length decoding device, wherein the run length is decoded by utilizing the fact that a code word is already input to the shift register that operates at the frequency f.
【請求項2】符号語長がランレングスの対数の1次関数
となる符号の複数に対して、シフトレジスタへのコード
データ入力を制御する手段と前記カウンタのキャリー信
号を制御する手段とをそれぞれの符号に応じて複数準備
し各符号に応じて選択することにより、前記シフトレジ
スタおよび前記カウンタおよび前記アドレス符号を検出
する手段とを共有し複数の符号に対して復号を行えるこ
とを特徴とする特許請求の範囲第1項記載のランレング
ス復号化装置。
2. A means for controlling code data input to a shift register and a means for controlling a carry signal of the counter for a plurality of codes whose codeword length is a linear function of logarithm of run length. A plurality of codes are prepared according to the code and selected according to each code, so that the shift register, the counter, and the means for detecting the address code can be shared and decoding can be performed for the plurality of codes. The run-length decoding device according to claim 1.
JP30575486A 1986-12-22 1986-12-22 Run length decoding device Expired - Lifetime JPH07121067B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP30575486A JPH07121067B2 (en) 1986-12-22 1986-12-22 Run length decoding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP30575486A JPH07121067B2 (en) 1986-12-22 1986-12-22 Run length decoding device

Publications (2)

Publication Number Publication Date
JPS63157566A JPS63157566A (en) 1988-06-30
JPH07121067B2 true JPH07121067B2 (en) 1995-12-20

Family

ID=17948944

Family Applications (1)

Application Number Title Priority Date Filing Date
JP30575486A Expired - Lifetime JPH07121067B2 (en) 1986-12-22 1986-12-22 Run length decoding device

Country Status (1)

Country Link
JP (1) JPH07121067B2 (en)

Also Published As

Publication number Publication date
JPS63157566A (en) 1988-06-30

Similar Documents

Publication Publication Date Title
EP0453113B1 (en) Coding and decoding apparatus of variable length date
US4216460A (en) Transmission and/or recording of digital signals
US4800441A (en) Binary data compression and expansion processing apparatus
US4131915A (en) Facsimile signal transmission system
JPH0793724B2 (en) High efficiency coding apparatus and coding method for television signal
US3769453A (en) Finite memory adaptive predictor
JPH08251586A (en) Run length decoder
US4090222A (en) Facsimile signal reception system
US4616211A (en) Detecting codewords
US4618846A (en) Data coding
US4955061A (en) Method and apparatus for processing an image signal
US4677480A (en) System for detecting a transmission error
JPH07121067B2 (en) Run length decoding device
US4827337A (en) Inter-frame decoding system with frame memories for uninterrupted clear video signals
JP2785822B2 (en) High-efficiency encoding device and decoding device for television signal
JP3142911B2 (en) Processing method of encoding / decoding device
JPS6222303B2 (en)
JP3108243B2 (en) Encoding and decoding device
JPH04270569A (en) Data compression system for picture processor
JP2641442B2 (en) Decryption device
JPH0234508B2 (en)
JPS6343473A (en) Modified huffman code decoding circuit
JPH053185B2 (en)
JPS60117879A (en) Fill bit eliminating circuit
JPH0646777B2 (en) Decompression device for compression code