JPH03266525A - Run length coding circuit - Google Patents

Run length coding circuit

Info

Publication number
JPH03266525A
JPH03266525A JP6395690A JP6395690A JPH03266525A JP H03266525 A JPH03266525 A JP H03266525A JP 6395690 A JP6395690 A JP 6395690A JP 6395690 A JP6395690 A JP 6395690A JP H03266525 A JPH03266525 A JP H03266525A
Authority
JP
Japan
Prior art keywords
data
code
section
overflow
counter
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.)
Granted
Application number
JP6395690A
Other languages
Japanese (ja)
Other versions
JP3011960B2 (en
Inventor
Hirofumi Sakagami
弘文 阪上
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.)
Ricoh Co Ltd
Original Assignee
Ricoh 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2063956A priority Critical patent/JP3011960B2/en
Priority to US07/600,371 priority patent/US5142380A/en
Priority to DE4033552A priority patent/DE4033552A1/en
Publication of JPH03266525A publication Critical patent/JPH03266525A/en
Application granted granted Critical
Publication of JP3011960B2 publication Critical patent/JP3011960B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To attain high speed processing with simple constitution by employing the hardware for the run length coding processing. CONSTITUTION:The circuit is provided with a run length counter section 1 and an overflow code erasure section 2, a counter 11 of the run length counter section 1 counts consecutive zeros (ineffective coefficients) of an AC component data and outputs the result as a run length data and outputs once an overflow code when the count exceeds a prescribed value. when the overflow code is adjacent with a block end code EOB by the data count section 13, the code is erased by the overflow code erasure section 2. Thus, number of bits of the counter counting consecutive zeros is enough to be 4, and the simple circuit constitution not requiring complicated discrimination processing and enabling high speed processing is realized.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は連続する零データの個数を計数し、その個数
と零でないデータとを符号化してデータ圧縮を行うラン
レングス符号化回路に関し、特に静止画像データを圧縮
して伝送または記録する際のデータ圧縮に適用して好適
なものである。
[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to a run-length encoding circuit that counts the number of consecutive zero data and encodes that number and non-zero data to compress data, and particularly relates to a run-length encoding circuit that counts the number of consecutive zero data and encodes the number and non-zero data to compress data. This is suitable for application to data compression when still image data is compressed and transmitted or recorded.

〔従来の技術〕[Conventional technology]

第4図は自然画符号化方式の標準化を図るために提案さ
れている国際標準化方式のうちの“Ba5eline 
System”のデータ圧縮手順を示す概略図である。
Figure 4 shows "Ba5eline", one of the international standardization methods proposed to standardize natural image coding methods.
FIG. 2 is a schematic diagram showing a data compression procedure of "System".

このシステムは一枚の入力画像を1ブロック8×8画素
の複数ブロックに分割し、各ブロック毎に離散コサイン
変換(D CT : Discrete CoCo51
neTransforを行い(処理P1)、変換して得
られる8×8個のDCT係数を、8×8個の闇値からな
る量子化マトリクスの各閾値にスケールファクタを乗算
した値で除算することで量子化を行う(処理P2)。
This system divides one input image into multiple blocks of 8×8 pixels, and performs discrete cosine transformation (DCT) on each block.
neTransform (processing P1), and divides the 8 x 8 DCT coefficients obtained by the conversion by the value obtained by multiplying each threshold value of a quantization matrix consisting of 8 x 8 dark values by a scale factor. (processing P2).

量子化したDCT係数のうち直流(DC)成分は前のブ
ロックで量子化したDC成分と差分を取り(処理P3)
、その差分のビット数をハフマン符号化する(処理P4
)。交流(AC)成分はブロック内でジグザグスキャン
を行って1次元の数列Ap (p=i+2+・・・、6
3)に変換しく処理P5)、数列Ap中の連続する零(
無効係数)の個数をランレングス符号化して圧縮する(
処理P6)。そして、この圧縮した連続する零の個数と
有効係数のビット数とで2次元のハフマン符号化を行う
(処理P4)。
The direct current (DC) component of the quantized DCT coefficients is subtracted from the DC component quantized in the previous block (processing P3).
, the number of bits of the difference is Huffman encoded (processing P4
). The alternating current (AC) component performs a zigzag scan within the block and is converted into a one-dimensional sequence Ap (p=i+2+...,6
3) and processing P5), the consecutive zeros in the sequence Ap (
Run-length encoding and compressing the number of invalid coefficients (
Processing P6). Then, two-dimensional Huffman encoding is performed using the compressed number of consecutive zeros and the number of bits of the effective coefficient (processing P4).

第5図はランレングス符号化処理(処理P6)の1ブロ
ック分の処理動作を示すフローチャートである。
FIG. 5 is a flowchart showing the processing operation for one block in run-length encoding processing (processing P6).

この処理は、まず1ブロック内のAC成分の個数(6’
3=8X8−1)を計数する変数pと連続する零(無効
係数)の個数を計数する変数qとを零に初期設定する(
ステップSl)。
This process begins with the number of AC components in one block (6'
Initialize the variable p that counts the number of consecutive zeros (invalid coefficients) and the variable q that counts the number of consecutive zeros (invalid coefficients) to zero (
Step Sl).

次いで、変数pが63か否か、すなわちAC成分の全デ
ータ処理を終了したか否かの判断を行う(ステップS2
)。ステップS2でNO″と判断されると、変数Pをイ
ンクリメントして(ステップS3)、DCT係数Apの
値が零か否か判断する(ステップS4)。係数Apの値
が零であれば°“YES”と判断して変数qをインクリ
メントしくステップS5)、ステップS2に戻る。
Next, it is determined whether the variable p is 63, that is, whether all data processing of the AC component has been completed (step S2
). If NO" is determined in step S2, the variable P is incremented (step S3), and it is determined whether the value of the DCT coefficient Ap is zero (step S4). If the value of the coefficient Ap is zero, °"YES", the variable q is incremented in step S5), and the process returns to step S2.

もし、係数Apの値が零でなければ、変数qの値が15
を超えているか否か、すなわち零データが16個連続し
ているか否か判断しくステップS6)、連続していれば
“’YES”と判断して連続する零の個数(変数qの値
)を16で割った値をオーバーフローコードとして出力
する(ステップS7)。そして変数qから16を引き(
ステップS8)、ステップS6に戻る。
If the value of coefficient Ap is not zero, then the value of variable q is 15
, that is, whether there are 16 consecutive zero data or not (step S6). If they are consecutive, it is determined as "'YES" and the number of consecutive zeros (value of variable q) is determined. The value divided by 16 is output as an overflow code (step S7). Then subtract 16 from variable q (
Step S8), return to step S6.

変数qの値が15以下であれば、ステップS6で“NO
パと判断し、連続する零の個数(変数qの値)と零デー
タでない係数Apの値とを出力する(ステップS9)。
If the value of variable q is 15 or less, “NO” is returned in step S6.
It is determined that the number of consecutive zeros (value of variable q) and the value of coefficient Ap that is not zero data are output (step S9).

そして変数qをリセットしくステップ510)、ステッ
プS2に戻る。
Then, the variable q is reset (step 510), and the process returns to step S2.

AC成分の全データの処理が終了すると、ステップS2
で“’YES””と判断し、ブロック終了コードを出力
して(ステップ511)、1ブロック分のデータ処理を
終了する。
When the processing of all the AC component data is completed, step S2
``YES'' is determined, a block end code is output (step 511), and data processing for one block is ended.

[発明が解決しようとする課題] ところで、前述した”Ba5eltne 5ystea
*”によるデータ圧縮処理は、コンピュータ・シミュレ
ーションによるアルゴリズムが検討されている段階で、
D S P (Digital Signal Pro
cessor)を使用してハードウェア化した例が報告
されてはいるが、処理に時間がかかり実用的ではない。
[Problem to be solved by the invention] By the way, the above-mentioned "Ba5eltne 5ystea"
*” data compression processing is at the stage where algorithms based on computer simulation are being considered.
D S P (Digital Signal Pro
Although there have been reports of hardware implementation using cessor), it takes a long time to process and is not practical.

この発明は前述したランレングス符号化処理をハードウ
ェア化することにより、簡易な構成で高速処理が可能な
ランレングス符号化回路を提供することを目的とする。
An object of the present invention is to provide a run-length encoding circuit capable of high-speed processing with a simple configuration by converting the aforementioned run-length encoding processing into hardware.

〔課題を解決するための手段] この発明によるランレングス符号化回路は、連続する零
データの個数を計数してランレングスデータとして出力
するランレングスカウンタ部と、二〇カウンタ部から出
力されるオーバーフローコードを一定の条件のもとで消
去するオーバーフローコード消去部とからなる。
[Means for Solving the Problems] The run-length encoding circuit according to the present invention includes a run-length counter unit that counts the number of consecutive zero data and outputs the result as run-length data, and an overflow output from the twenty-counter unit. and an overflow code erasing section that erases codes under certain conditions.

ランレングスカウンタ部は1ブロックあたり複数n個の
入力データの各々が零データであるか否かを検出する零
データ検出部と、この零データ検出部の検出結果に基づ
いて入力データの連続する零の個数を計数しランレング
スデータとして出力するカウンタ部と、入力データの入
力個数を計数し複数n個のデータが入力したことを検知
してブロック終了コードを出力するデータ計数部と、入
力データが有効データの際またはカウンタ部からオーバ
ーフローコードが出力された際、さらにデータ計数部か
らブロック終了コードが出力された際にそれぞれフラッ
グデータおよびシフトパルスを出力する出力制御部とか
らなる。
The run length counter unit includes a zero data detection unit that detects whether each of a plurality of n pieces of input data per block is zero data, and a zero data detection unit that detects whether or not each of a plurality of n pieces of input data is zero data or not, and a run length counter unit that detects whether consecutive zeros of input data are detected based on the detection result of this zero data detection unit. a counter section that counts the number of input data and outputs it as run length data; a data counting section that counts the number of input data and outputs a block end code when it detects that a plurality of n pieces of data have been input; It consists of an output control section that outputs flag data and shift pulses when valid data or an overflow code is output from the counter section, and when a block end code is output from the data counting section.

オーバーフローコード消去部はシフトパルスによって入
力データ、ランレングスデータ、フラッグデータ、オー
バーフローコードおよびブロック終了コードをそれぞれ
ラッチするシフトレジスタと、このシフトレジスタにラ
ッチされたオーバーフローコードおよびブロック終了コ
ードのうちブロック終了コードに隣接するオーバーフロ
ーコードを検知して対応するフラッグデータをクリアす
ることによりオーバーフローコードを消去する連続性検
出部とからなる。
The overflow code erasing unit includes a shift register that latches input data, run length data, flag data, overflow code, and block end code, respectively, by a shift pulse, and a block end code among the overflow code and block end code latched in this shift register. and a continuity detection section that detects an overflow code adjacent to and erases the overflow code by clearing the corresponding flag data.

〔作 用〕[For production]

この構成において、入力データはその連続する零(無効
係数)の個数がランレングスカウンタ部によって計数さ
れ、その計数値がランレングスデータとして出力されて
データの圧縮が行われる。
In this configuration, the number of consecutive zeros (invalid coefficients) in the input data is counted by the run-length counter section, and the counted value is output as run-length data to perform data compression.

また、連続する零の個数が所定の値を超えるときは一旦
オーバーフローコードを出力し、カウンタ部をリセット
したのち零データの計数を再開する。
Furthermore, when the number of consecutive zeros exceeds a predetermined value, an overflow code is output once, the counter section is reset, and then counting of zero data is restarted.

また、オーバーフローコードが1ブロック分のデータ処
理が終了したことを示すブロック終了コードと隣接する
場合は、オーバーフローコードと共に出力されるフラッ
グデータの対応データをリセットすることによりオーバ
ーフローコードを消去するようにしている。従って、零
データの連続する個数が所定値以上であっても、オーバ
ーフローコードは出力せずにブロック終了コードのみ出
力する。
Additionally, if an overflow code is adjacent to a block end code that indicates that data processing for one block has been completed, the overflow code is erased by resetting the corresponding data of the flag data that is output with the overflow code. There is. Therefore, even if the number of consecutive zero data is greater than or equal to a predetermined value, only the block end code is output without outputting an overflow code.

この発明によれば、連続する零の個数を計数するカウン
タの進数は小さくてすみ、また複雑な判断処理が不要で
高速処理が可能な簡易な回路構成のランレングス符号化
回路を提供することが出来る。
According to the present invention, it is possible to provide a run-length encoding circuit having a simple circuit configuration, in which the base number of a counter that counts the number of consecutive zeros can be small, and complex judgment processing is not required and high-speed processing is possible. I can do it.

〔実施例〕〔Example〕

第1図はこの発明によるランレングス符号化回路の一実
施例を示す構成図である。
FIG. 1 is a block diagram showing an embodiment of a run-length encoding circuit according to the present invention.

この実施例はランレングスカウンタ部1とオーバーフロ
ーコード消去部2とから構成されている。
This embodiment consists of a run length counter section 1 and an overflow code erasing section 2.

ランレングスカウンタ部1は入力されるAC成分データ
ACDが零であるか否かを検出する零データ検出部10
と、この検出部10の出力を受けてデータACDの連続
する零(無効係数)の個数を計数するカウンタ11と、
データACDが零でないとき、またはカウンタ11がオ
ーバーフローしたときにカウンタ11にクリアパルスC
Pを出力し、またデータ消去部2の後述するシフトレジ
スタ20〜24にフラッグデータFDおよびシフトパル
スSPを出力する出力制御部12と、入力されるAC成
分データACDの個数を計数して1ブロック分のAC成
分データの入力が終了したことを検知するとブロック終
了コードEOBおよびクリアパルスCP’を出力するデ
ータ計数部13とからなる。
The run length counter section 1 includes a zero data detection section 10 that detects whether input AC component data ACD is zero or not.
and a counter 11 that receives the output of the detection unit 10 and counts the number of consecutive zeros (invalid coefficients) in the data ACD.
A clear pulse C is sent to the counter 11 when the data ACD is not zero or when the counter 11 overflows.
An output control section 12 outputs flag data FD and a shift pulse SP to shift registers 20 to 24 (described later) of the data erasing section 2, and counts the number of input AC component data ACD to form one block. The data counting section 13 outputs a block end code EOB and a clear pulse CP' when it detects that input of AC component data for minutes has ended.

オーバーフローコード消去部2はAC成分データACD
が直接入力されるシフトレジスタ2o、カウンタ11の
カウント値がランレングスデータRLDとして入力され
るシフトレジスタ21、フラッグデータFDの入力され
るシフトレジスタ22、カウンタ11のオーバーフロー
コードOVFが人力されるシフトレジスタ23、ブロッ
ク終了コードEOBが入力されるシフトレジスタ24、
データOVFおよびデータEOBの連続性を検出する連
続性検出部25からなる。シフトレジスタ20〜24は
何れも4段のD型フリップフロップ(以下、FF、と称
す)で構成され、各段のFFはシフトパルスSPによっ
て駆動される。
The overflow code erasing unit 2 collects AC component data ACD.
Shift register 2o to which is directly input, shift register 21 to which the count value of counter 11 is input as run length data RLD, shift register 22 to which flag data FD is input, shift register to which overflow code OVF of counter 11 is manually input. 23, shift register 24 into which the block end code EOB is input;
It consists of a continuity detection section 25 that detects continuity of data OVF and data EOB. Each of the shift registers 20 to 24 is composed of four stages of D-type flip-flops (hereinafter referred to as FF), and each stage of FF is driven by a shift pulse SP.

連続性検出部25は、シフトレジスタ23の2段目以降
の各段のFF23b〜23dの各出力とシフトレジスタ
24の初段0FF24aの出力とのアンド条件を取るア
ンド回路3o、シフトレジスタ23の3段目以降の各段
0FF23c〜23dの各出力とシフトレジスタ24の
2段目0FF24bの出力とのアンド条件を取るアンド
回路31、シフトレジスタ23の4段目0FF23dの
出力とシフトレジスタ24の3段目0FF24cの出力
とのアンド条件を取るアンド回路32およびアンド回路
30〜32の各出力のオア条件を取るオア回路33から
なる。オア回路33の出力はシフトレジスタ22の4段
目0FF22dのクリア端子CLRに入力される。
The continuity detection unit 25 includes an AND circuit 3o that takes an AND condition between each output of the FFs 23b to 23d in the second and subsequent stages of the shift register 23 and the output of the first stage 0FF 24a of the shift register 24, and a three-stage shift register 23. An AND circuit 31 that takes an AND condition between each output of each stage 0FF23c to 23d of the second stage and the output of the second stage 0FF24b of the shift register 24, the output of the fourth stage 0FF23d of the shift register 23, and the third stage of the shift register 24. It consists of an AND circuit 32 that takes an AND condition with the output of 0FF24c, and an OR circuit 33 that takes an OR condition of each output of the AND circuits 30 to 32. The output of the OR circuit 33 is input to the clear terminal CLR of the fourth stage 0FF22d of the shift register 22.

次に、第2図に示すタイミングチャートを参照してこの
実施例の動作を説明する。
Next, the operation of this embodiment will be explained with reference to the timing chart shown in FIG.

まず、スタートパルスST(図(a))によってデータ
計数部13をクリアし、同時にクリアパルスCP’によ
ってカウンタ11をクリアする。
First, the data counter 13 is cleared by a start pulse ST (FIG. (a)), and at the same time, the counter 11 is cleared by a clear pulse CP'.

次いで、クロックパルスφ(図う))に同期してAC成
分データACD (図(C))を入力し、零データ検出
部10で零データか否か検出する(図(d))。
Next, AC component data ACD (Figure (C)) is inputted in synchronization with the clock pulse φ (Figure (C)), and the zero data detection unit 10 detects whether or not it is zero data (Figure (D)).

検出部10では、零データでないことを検出すると、出
力制御部12からシフトパルスSPを出力してシフトレ
ジスタ20の初段0FF20aにデータACDをラッチ
し、同時にシフトレジスタ22の初段のFF22aにフ
ラッグデータFDをラッチする。さらにクリアパルスC
Pによってカウンタ11をクリアする。
When the detection unit 10 detects that the data is not zero, it outputs a shift pulse SP from the output control unit 12 to latch the data ACD in the first stage 0FF 20a of the shift register 20, and at the same time latches the flag data FD in the first stage FF 22a of the shift register 22. Latch. Further clear pulse C
The counter 11 is cleared by P.

AC成分データACDが零データであれば、零データ検
出部10で零データを検出しく図(d))、カウンタ1
1をインクリメントする(図(e))。零データが連続
すればその連続する個数がカウンタ11によって計数さ
れる。
If the AC component data ACD is zero data, the zero data detection unit 10 detects the zero data (Figure (d)), and the counter 1
Increment 1 (Figure (e)). If zero data continues, the number of consecutive zero data is counted by the counter 11.

次いで、データACDとして再び有効データが入力され
ると、出力制御部12からシフトパルスSP(図げ))
およびフラッグデータFD(図(9))が出力され、シ
フトパルスSPによってシフトレジスタ20の初段FF
20aにデータACD、シフトレジスタ21の初段FF
21 aにランレングスデータRLD、シフトレジスタ
22の初段FF22aにフラッグデータFDがそれぞれ
ラッチされる。またクリアパルスCPによってカウンタ
11がクリアされる。
Next, when valid data is input again as data ACD, the output control section 12 outputs a shift pulse SP
and flag data FD (FIG. (9)) are output, and the first stage FF of the shift register 20 is output by the shift pulse SP.
20a is data ACD, first stage FF of shift register 21
Run length data RLD is latched in 21a, and flag data FD is latched in the first stage FF 22a of the shift register 22. Further, the counter 11 is cleared by the clear pulse CP.

データACDとして零データが連続し、カウンタ11の
カウント値が15を超えると、オーバーフローコードO
VF (図Q1))が出力され、出力制御部12に入力
される。出力制御部12はこれを受けてシフトパルスS
PおよびフラッグデータFDを出力し、シフトパルスS
PによってデータACDの零データをFF20aに、デ
ータRLDをFF21aに、フラッグデータFDをFF
22aに、データOVFをFF23aにそれぞれラッチ
する。
When zero data continues as data ACD and the count value of counter 11 exceeds 15, overflow code O
VF (FIG. Q1)) is output and input to the output control section 12. In response to this, the output control section 12 outputs a shift pulse S.
P and flag data FD, and shift pulse S
By P, the zero data of data ACD is transferred to FF20a, the data RLD is transferred to FF21a, and the flag data FD is transferred to FF.
22a, the data OVF is latched into the FF 23a.

全てのAC成分データの入力が終了すると、データ計数
部13からブロック終了コードEOBが出力される。出
力制御部12はこれを受けて再びシフトパルスSPおよ
びフラッグデータFDを出力し、データACDをFF2
0aに、データRLDをFF21 aに、フラッグデー
タFDをFF22aに、データEOBをFF24aにそ
れぞれラッチする。
When input of all AC component data is completed, the data counting section 13 outputs a block end code EOB. In response to this, the output control unit 12 outputs the shift pulse SP and flag data FD again, and transfers the data ACD to FF2.
0a, data RLD to FF21a, flag data FD to FF22a, and data EOB to FF24a.

このようにしてシフトレジスタ20〜24の初段FF2
0a〜24aには1、各データが第2図(j)〜(n)
に示すようにラッチされる。
In this way, the first stage FF2 of shift registers 20 to 24
1 for 0a to 24a, each data is shown in Figure 2 (j) to (n)
latched as shown.

次に、第3図のデータ構成図を参照して連続性検出部2
5の動作を説明する。
Next, referring to the data configuration diagram in FIG.
The operation of step 5 will be explained.

この連続性検出部25はAC成分データACDの零デー
タがブロック終了コードEOBまで連続する場合に、デ
ータEOBに隣接するオーバーフローコードOVFを消
去する回路である。データACDは1ブロック63個の
データであり、零データが16個連続するケースは最大
3回である。
The continuity detection unit 25 is a circuit that erases the overflow code OVF adjacent to the data EOB when the zero data of the AC component data ACD continues up to the block end code EOB. Data ACD has 63 pieces of data in one block, and the number of cases in which 16 pieces of zero data are consecutive is three times at maximum.

そしてデータOVFとデータEOBとが連続するケース
は、第3図(a)〜(C)に示すように3通り考えられ
る。従って、図(C)に示すようにデータOVFが最大
3つ連続し、さらにデータEOBと隣接する場合には4
つのデータの連続性を検出する必要がある。そこでこの
実施例では、シフトレジスタ20〜24を各々4段構成
とし、データOVFの入力されるシフトレジスタ23の
各段の出力とデータEOBの入力されるシフトレジスタ
24の各段の出力とから4データの連続性を検出するよ
うにしている。なお、図中○印を付したデータOvFは
出力されるべきデータを示し、X印を付したデータOV
Fは消去されるべきデータを示している。
There are three possible cases in which data OVF and data EOB are continuous, as shown in FIGS. 3(a) to 3(C). Therefore, as shown in Figure (C), if there are a maximum of three consecutive data OVFs and further adjacent to the data EOB, four
It is necessary to detect the continuity of two data. Therefore, in this embodiment, each of the shift registers 20 to 24 has four stages, and the output of each stage of the shift register 23 to which the data OVF is input and the output of each stage of the shift register 24 to which the data EOB is input are divided into four stages. I am trying to detect continuity of data. In addition, the data OvF marked with ○ in the figure indicates the data to be output, and the data OV marked with
F indicates data to be erased.

まず、シフトレジスタ24のFF24cにデータEOB
がラッチされ、同時にシフトレジスタ23のFF23d
にデータOVFがラッチされると、アンド回路32のア
ンド条件が成立し、オア回路33からデータフラッグ・
クリアパルスDFCが出力される(図(a))。
First, data EOB is sent to FF24c of the shift register 24.
is latched, and at the same time FF23d of the shift register 23
When the data OVF is latched, the AND condition of the AND circuit 32 is satisfied, and the data flag is output from the OR circuit 33.
Clear pulse DFC is output (Figure (a)).

また、シフトレジスタ24のFF24bにデータEOB
がラッチされた際に、シフトレジスタ23のFF23C
〜23dにデータOvFがラッチされれば、アンド回路
31のアンド条件が成立し、オア回路33からデータフ
ラッグ・クリアパルスDFCが出力される(図(b))
In addition, data EOB is stored in FF24b of the shift register 24.
is latched, FF23C of the shift register 23
If the data OvF is latched at ~23d, the AND condition of the AND circuit 31 is satisfied, and the data flag clear pulse DFC is output from the OR circuit 33 (Figure (b))
.

さらに、シフトレジスタ24のFF24aにデータEO
Bがラッチされたときに、シフトレジスタ23のFF2
3b〜23dの何れにもデータOVFが同時にラッチさ
れれば、アンド回路30のアンド条件が成立し、オア回
路33からデータフラッグ・クリアパルスDFCが出力
される(図(C)) こうして出力されたクリアパルスDFCによってシフト
レジスタ22の最終段のFF22dにラッチされたフラ
ッグデータFDがクリアされ、対応するデータOVFを
無効とする。このようにしてデータEOBに隣接するデ
ータOVFを消去しデータEOBのみを出力する。
Furthermore, data EO is stored in the FF 24a of the shift register 24.
When B is latched, FF2 of the shift register 23
If the data OVF is latched in any of 3b to 23d at the same time, the AND condition of the AND circuit 30 is satisfied, and the data flag clear pulse DFC is output from the OR circuit 33 (Figure (C)). The clear pulse DFC clears the flag data FD latched in the final stage FF 22d of the shift register 22, invalidating the corresponding data OVF. In this way, data OVF adjacent to data EOB is erased and only data EOB is output.

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

この発明によれば、ランレングスカウンタ部とオーバー
フローコード消去部とを設け、ランレングスカウンタ部
によってAC成分データの連続する零(無効係数)の個
数を計数してその計数値をランレングスデータとして出
力すると共に、計数値が所定値を超えるときは一旦オー
バーフローコードを出力し、オーバーフローコードがブ
ロック終了コードEOBと隣接する場合にはオーバーフ
ローコード消去部で消去するようにしているいので、連
続する零の個数を計数するカウンタは4ビツトですみ、
また複雑な判断処理が不要で高速処理が可能な簡易な回
路構成のランレングス符号化回路を提供することが出来
る。
According to this invention, a run length counter section and an overflow code erasing section are provided, and the run length counter section counts the number of consecutive zeros (invalid coefficients) in AC component data and outputs the counted value as run length data. At the same time, when the count value exceeds a predetermined value, an overflow code is output once, and if the overflow code is adjacent to the block end code EOB, it is erased by the overflow code eraser, so the number of consecutive zeros is The counter to count only needs 4 bits,
Further, it is possible to provide a run-length encoding circuit with a simple circuit configuration that does not require complicated judgment processing and can perform high-speed processing.

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

第1図はこの発明によるランレングス符号化回路の一実
施例を示す構成図、 第2図は第1図の動作を説明するためのタイミングチャ
ート、 第3図は連続性検出部の動作を説明するためのデータ構
成図、 第4図はベースラインシステムのデータ圧縮手順を示す
図、 第5図は第4図のランレングス符号化処理のフローチャ
ートである。 1・・・ランレングスカウンタ部、2・・・、i −’
ハーフローコード消去部、10・・・零データ検出部、
11・・・カウンタ、12・・・出力制御部、13・・
・データ計数部、20〜24・・・シフトレジスタ、2
5・・・連続性検出部。
FIG. 1 is a block diagram showing an embodiment of the run-length encoding circuit according to the present invention, FIG. 2 is a timing chart for explaining the operation of FIG. 1, and FIG. 3 is for explaining the operation of the continuity detector. FIG. 4 is a diagram showing the data compression procedure of the baseline system. FIG. 5 is a flowchart of the run-length encoding process in FIG. 4. 1...Run length counter section, 2..., i-'
Half-low code erasing section, 10... zero data detection section,
11... Counter, 12... Output control unit, 13...
・Data counting section, 20 to 24...Shift register, 2
5... Continuity detection section.

Claims (1)

【特許請求の範囲】 1ブロックあたり複数n個の入力データの各々が零デー
タであるか否かを検出する零データ検出部と、上記零デ
ータ検出部の検出結果に基づいて上記入力データの連続
する零の個数を計数してランレングスデータとして出力
するカウンタ部と、上記入力データの入力個数を計数し
上記複数n個のデータが入力したことを検知してブロッ
ク終了コードを出力するデータ計数部と、上記入力デー
タが有効データの際または上記カウンタ部からオーバー
フローコードが出力された際、さらに上記データ計数部
からブロック終了コードが出力された際にそれぞれフラ
ッグデータおよびシフトパルスを出力する出力制御部と
からなるランレングスカウンタ部と、 上記シフトパルスによって上記入力データ、上記ランレ
ングスデータ、上記フラッグデータ、上記オーバーフロ
ーコードおよび上記ブロック終了コードをそれぞれラッ
チするシフトレジスタと、上記シフトレジスタにラッチ
された上記オーバーフローコードおよび上記ブロック終
了コードのうち、上記ブロック終了コードに隣接する上
記オーバーフローコードを検出してこのオーバーフロー
コードに対応する上記フラッグデータをクリアすること
によりオーバーフローコードを消去する連続性検出部と
からなるオーバーフローコード消去部とを有することを
特徴とするランレングス符号化回路。
[Claims] A zero data detection unit that detects whether each of a plurality of n pieces of input data per block is zero data, and a zero data detection unit that detects whether or not each of a plurality of n pieces of input data per block is zero data; a counter unit that counts the number of zeros in the input data and outputs it as run length data; and a data counting unit that counts the number of input data and outputs a block end code upon detecting that the plurality of n pieces of data have been input. and an output control section that outputs flag data and shift pulses when the input data is valid data, when an overflow code is output from the counter section, and when a block end code is output from the data counting section, respectively. a run-length counter section comprising: a shift register that latches the input data, the run-length data, the flag data, the overflow code, and the block end code, respectively, according to the shift pulse; A continuity detection unit detects the overflow code adjacent to the block end code among the overflow code and the block end code, and erases the overflow code by clearing the flag data corresponding to this overflow code. A run-length encoding circuit comprising: an overflow code erasing section.
JP2063956A 1989-10-23 1990-03-16 Run-length encoding circuit Expired - Fee Related JP3011960B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2063956A JP3011960B2 (en) 1990-03-16 1990-03-16 Run-length encoding circuit
US07/600,371 US5142380A (en) 1989-10-23 1990-10-18 Image data processing apparatus
DE4033552A DE4033552A1 (en) 1989-10-23 1990-10-22 IMAGE DATA PROCESSING DEVICE

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2063956A JP3011960B2 (en) 1990-03-16 1990-03-16 Run-length encoding circuit

Publications (2)

Publication Number Publication Date
JPH03266525A true JPH03266525A (en) 1991-11-27
JP3011960B2 JP3011960B2 (en) 2000-02-21

Family

ID=13244280

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2063956A Expired - Fee Related JP3011960B2 (en) 1989-10-23 1990-03-16 Run-length encoding circuit

Country Status (1)

Country Link
JP (1) JP3011960B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0624990A2 (en) * 1993-05-12 1994-11-17 Matsushita Electric Industrial Co., Ltd. Video recording and reproducing apparatus

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0624990A2 (en) * 1993-05-12 1994-11-17 Matsushita Electric Industrial Co., Ltd. Video recording and reproducing apparatus
EP0624990A3 (en) * 1993-05-12 1995-03-15 Matsushita Electric Ind Co Ltd Video recording and reproducing apparatus.
US5574568A (en) * 1993-05-12 1996-11-12 Matsushita Electric Industrial Co., Ltd. Video recording and reproducing apparatus

Also Published As

Publication number Publication date
JP3011960B2 (en) 2000-02-21

Similar Documents

Publication Publication Date Title
KR930009872B1 (en) Changing coding apparatus
JP7134200B2 (en) digital image recompression
US6055272A (en) Run length encoder
Slattery et al. The qx-coder
JPH0358574A (en) Dot picture data compressor
CN101502122B (en) Encoding device and encoding method
JP2001217721A (en) Huffman encoding device, huffman encoding method and recording medium recorded with huffman encoding processing program
Li et al. Parallel high-speed architecture for EBCOT in JPEG2000
JPH03266525A (en) Run length coding circuit
JPH10200892A (en) Image encoder
JPH1079940A (en) Image encoder
Noikaew et al. Dual Symbol Processing for MQ arithmetic coder in JPEG2000
JP2612343B2 (en) Data compression method
JPS63190473A (en) Method and apparatus for compressing quantity of information on multi-gradation picture data
JP3076461B2 (en) Huffman decoding circuit and Huffman decoding method
JP3434904B2 (en) Image data encoding device
Agaian et al. The application of logical transforms to lossless image compression using Boolean minimization
JP2724223B2 (en) Image data restoration method
JPH06178282A (en) Picture coder
Dziech et al. Methods of image compression by PHL transform
JP6821184B2 (en) Image decoder
JP2909189B2 (en) Image data compression device
Larrauri A new Algorithm for Lossless Compression applied to two-dimensional Static Images
Åhlander et al. Hardware Efficient Lossless Realtime Compression of Raw Image Data
JP2615215B2 (en) Image data compression method

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees