JPH1093805A - Picture processing method and picture processor - Google Patents

Picture processing method and picture processor

Info

Publication number
JPH1093805A
JPH1093805A JP8243180A JP24318096A JPH1093805A JP H1093805 A JPH1093805 A JP H1093805A JP 8243180 A JP8243180 A JP 8243180A JP 24318096 A JP24318096 A JP 24318096A JP H1093805 A JPH1093805 A JP H1093805A
Authority
JP
Japan
Prior art keywords
block
image
encoding
data
lines
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
JP8243180A
Other languages
Japanese (ja)
Inventor
Yuji Ishikawa
祐司 石川
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP8243180A priority Critical patent/JPH1093805A/en
Publication of JPH1093805A publication Critical patent/JPH1093805A/en
Pending legal-status Critical Current

Links

Landscapes

  • Editing Of Facsimile Originals (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a picture processing method for reducing cost of a processor and to provide a picture processor by executing a picture rotation processing through a use of a memory of small capacity. SOLUTION: Pixel data which is read in a line unit in a read part 2 is stored in grid line buffers 7a and 7b for m-lines. Pixel data for m-lines is divided into blocks at every n-pixels in a main scanning direction. An encoding part 3 executes encoding for respective block units and data are accumulated in an accumulation memory 9. Encoded data are decoded in the block unit in a decoding part 4 and picture element data of m-pixels × n-pixels is rotated in a 90 deg. unit. The respective blocks are decoded in a prescribed order different from an encoding order in accordance with the rotation angle of the designated restored picture and a conversion processing to pixel array corresponding to the rotation angle of the designated restored picture is execute. Data is stored in a line buffer 8 from the prescribed direction corresponding to the rotation direction and pixel data of n.lines or m.lines are sequentially generated.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は画像処理方法及び装
置に関し、特にファクシミリ機能と複写機機能とを併せ
持つ複合装置における画像の回転処理に関するものであ
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image processing method and apparatus, and more particularly to image rotation processing in a multifunction device having both a facsimile function and a copier function.

【0002】[0002]

【従来の技術】従来、複写機における読み取り/記録の
主走査方向は、 A4原稿の場合は長辺方向 A3原稿の場合は短辺方向 とするのが一般的であった。これは、図21に示すよう
に、A3原稿とA4原稿の主走査方向の長さを統一で
き、A4原稿の場合には走査線数を減らせる、即ち、コ
ピー速度が速くなる、という利点があるからである。
2. Description of the Related Art Conventionally, the main scanning direction of reading / recording in a copying machine is generally the long side direction for A4 documents and the short side direction for A3 documents. This has the advantage that, as shown in FIG. 21, the length of the A3 document and the A4 document in the main scanning direction can be unified, and in the case of the A4 document, the number of scanning lines can be reduced, that is, the copy speed is increased. Because there is.

【0003】一方、ファクシミリ装置においては、IT
U−T3,T4,T5等の勧告により、送信原稿の主走
査方向は原稿の短辺方向とすることが規格化されてい
る。
On the other hand, in facsimile machines, IT
According to the recommendations of U-T3, T4, T5, etc., it is standardized that the main scanning direction of the transmission original is the short side direction of the original.

【0004】従って、複写機とファクシミリとの複合機
を実現しようとすると、A4画像の取り扱いに不整合が
生じてしまう。
Therefore, if an attempt is made to realize a multifunction machine of a copying machine and a facsimile, inconsistency occurs in handling of A4 images.

【0005】この読み取りについての解決策の一つとし
て、A4サイズのファクシミリ送信原稿については、読
み取り部への原稿設置方向を短辺が主走査方向となるよ
うに規定することが考えられる。しかし、この解決策は
使用者にとって複雑な操作を強いることとなり、使用者
が操作を間違えた場合、装置はA3サイズと誤認して縮
小送信してしまう危険性があり、しかも使用者がそれに
気付かないという重大な欠点がある。
As one solution to this reading, for an A4-size facsimile transmission original, it is conceivable to specify the direction in which the original is set in the reading section such that the short side is the main scanning direction. However, this solution imposes a complicated operation on the user, and if the user makes a mistake in the operation, there is a danger that the device may mistakenly recognize the A3 size and transmit the reduced size, and the user may not notice it. There is a serious disadvantage that there is no.

【0006】そこで、ファクシミリ送信時にも、複写時
と同様の方向で(即ち、長辺方向を主走査とする方向
で)A4原稿を読み取ることが望ましい。これを実現す
るには、ファクシミリ送信時に読み取り画像を90°回
転させる処理が必要となる。
Therefore, it is desirable to read the A4 original in the same direction as that during copying (ie, in the direction in which the long side direction is the main scanning direction) during facsimile transmission. To realize this, processing for rotating the read image by 90 ° at the time of facsimile transmission is required.

【0007】また、印刷処理についても読み取り処理と
同様な不整合が存在する。最も単純な解決策として、A
4縦とA4横の2種類の記録紙を給紙できる給紙部を備
える方法があるが、コストの増大、装置が大きくなるな
どの欠点がある。
[0007] Also, the printing process has the same inconsistency as the reading process. As the simplest solution, A
Although there is a method including a paper feeding unit capable of feeding two types of recording paper, that is, four lengths and four A4 widths, there are disadvantages such as an increase in cost and an increase in size of the apparatus.

【0008】そこで、印刷処理部についてもファクシミ
リ受信画像を90°回転させてから印刷処理を行うこと
により、A4サイズの給紙部を一つにすることができ
る。
[0008] Therefore, the A4 size paper feed unit can be reduced to one by rotating the facsimile reception image by 90 ° in the print processing unit and then performing the print processing.

【0009】更に、記録紙の両面に印刷を行う場合、記
録紙の短辺を主走査方向とする場合には、裏面に印刷す
る画像を180°回転させることが必要となる。
Further, when printing is performed on both sides of the recording paper, and when the short side of the recording paper is set in the main scanning direction, it is necessary to rotate the image to be printed on the back side by 180 °.

【0010】以上説明したように、ファクシミリと複写
機の複合装置では、画像の回転処理は操作性、コスト、
装置体積などの点から必須の処理である。
As described above, in a multifunction device of a facsimile and a copying machine, image rotation processing is performed with ease of operation, cost, and cost.
This is an indispensable process from the viewpoint of the volume of the device.

【0011】従来、この回転処理は回転対象の画像1ペ
ージ分のビットマップページメモリを用いて1画素ずつ
縦横変換することで行われていた。
Conventionally, this rotation processing has been performed by performing vertical and horizontal conversion one pixel at a time using a bitmap page memory for one page of the image to be rotated.

【0012】このビットマップページメモリの容量は、
A4サイズ1ページ/解像度200dpiとしても、
0.5Mバイトを必要とする。そして、ファクシミリ送
信動作と既受信済み画像の印刷とを同時動作させようと
すると、更に0.5Mバイトを必要とする。また、装置
のスループット向上のために、回転前の画像書き込み用
と、回転後の画像読み出し用の2ページ分のビットマッ
プページメモリを備えるとすると、更に2倍のメモリ容
量を必要とすることになる。
The capacity of the bit map page memory is as follows:
Even with A4 size 1 page / resolution 200 dpi,
Requires 0.5 MB. If the facsimile transmission operation and the printing of the already received image are to be performed simultaneously, an additional 0.5 MB is required. Further, if a bitmap page memory for two pages for writing an image before rotation and for reading an image after rotation is provided to improve the throughput of the apparatus, a double memory capacity is required. Become.

【0013】以上は、ファクシミリ装置で一般的な「フ
ァイン」解像度の場合のメモリ容量であるが、複写機と
して見た場合、最低でも400dpiの解像度が必要と
される。また、400dpiの場合には、上記のメモリ
容量は更に4倍を必要とし、A4サイズ1ページで2M
バイトもの容量を必要とする。
The above is the memory capacity in the case of "fine" resolution that is common in facsimile machines. However, when viewed as a copying machine, a resolution of at least 400 dpi is required. Further, in the case of 400 dpi, the above memory capacity needs to be further increased by four times, and 2M for one page of A4 size.
Requires as much capacity as bytes.

【0014】[0014]

【発明が解決しようとする課題】以上述べたように、従
来の画像回転処理の手法では、少なくても画像1ページ
分のビットマップページメモリを必要としていた。
As described above, the conventional image rotation processing method requires a bitmap page memory for at least one image page.

【0015】本発明は、上記課題を解決するためになさ
れたもので、画像回転処理を小容量のメモリを用いて行
うことにより、装置のコストを低減させた画像処理方法
及び装置を提供することを目的とする。
SUMMARY OF THE INVENTION The present invention has been made to solve the above problems, and provides an image processing method and apparatus in which the cost of the apparatus is reduced by performing image rotation processing using a small-capacity memory. With the goal.

【0016】[0016]

【課題を解決するための手段】上記目的を達成するため
に、本発明の画像処理装置は、原稿をライン単位で読み
取る読取手段と、前記読取手段により読み取った画素デ
ータを少なくともmライン分格納可能な格納手段と、前
記格納手段に格納された画素データを符号化する符号化
手段と、前記符号化手段により符号化された符号データ
を複数ページ分蓄積可能な蓄積手段とを備え、前記符号
化手段は、前記格納手段に格納されたmラインの画素デ
ータを主走査方向にn画素毎のブロックに分割し、各ブ
ロック単位で符号化を行うことを特徴とする。
To achieve the above object, an image processing apparatus according to the present invention comprises a reading means for reading a document line by line, and at least m lines of pixel data read by the reading means can be stored. Storage means, encoding means for encoding pixel data stored in the storage means, and accumulation means capable of accumulating a plurality of pages of encoded data encoded by the encoding means. The means divides the m-line pixel data stored in the storage means into blocks of n pixels in the main scanning direction, and performs encoding in units of each block.

【0017】また、上記目的を達成するために、本発明
の画像処理方法は、原稿をライン単位で読み取り、読み
取った画素データを少なくともmライン分の格納手段に
格納し、格納されたmラインの画素データを主走査方向
にn画素毎のブロックに分割し、各ブロック単位で符号
化し、符号データをブロック単位で復号し、復元された
m画素×n画素の画素データを90°単位で回転させ、
指定された復元画像の回転角度に応じて、符号化順序と
は異なる所定の順序で各ブロックを復号し、前記指定さ
れた復元画像の回転角度に応じた画素配列への変換処理
を行い、順次回転方向に応じた所定の方向から格納し、
n又はmラインの画素データを順次作成することを特徴
とする。
According to another aspect of the present invention, there is provided an image processing method comprising: reading a document in units of lines; storing read pixel data in a storage unit for at least m lines; The pixel data is divided into blocks of n pixels in the main scanning direction, encoded in units of blocks, the encoded data is decoded in units of blocks, and the restored pixel data of m pixels × n pixels is rotated in units of 90 °. ,
In accordance with the rotation angle of the specified restored image, each block is decoded in a predetermined order different from the encoding order, and a conversion process to a pixel array corresponding to the rotation angle of the specified restored image is performed. Store from a predetermined direction according to the rotation direction,
It is characterized in that pixel data of n or m lines is sequentially created.

【0018】[0018]

【発明の実施の形態】以下、図面を参照しながら本発明
に係る実施の形態を詳細に説明する。
Embodiments of the present invention will be described below in detail with reference to the drawings.

【0019】本実施形態での回転処理は、画像をm画素
×n画素を単位とする区画(以下、「ブロック」と称す
る)に分割して扱うことにより実現する。
The rotation processing in this embodiment is realized by dividing an image into blocks (hereinafter, referred to as "blocks") each having m pixels.times.n pixels.

【0020】また、読取部及び記録部、ファクシミリ送
受信部間の画像データのやり取りは、上記ブロック単位
で圧縮符号化した符号データを蓄積する蓄積メモリを介
して行う。
The exchange of image data among the reading section, the recording section, and the facsimile transmitting / receiving section is performed via a storage memory for storing code data compression-encoded in block units.

【0021】<蓄積処理>画像データを上述の蓄積メモ
リに格納する場合、まず一旦、mライン分(以下、これ
を「ストライプ」と称する)の画素データをラインバッ
ファに蓄積する。次に、符号化処理部がmラインのライ
ンバッファから主走査方向にn画素を取り出す。これを
当該ストライプの第1ブロックと称する。
<Storage Processing> When image data is stored in the above-described storage memory, pixel data for m lines (hereinafter, referred to as "stripe") is temporarily stored in a line buffer. Next, the encoding processing unit extracts n pixels from the m line buffer in the main scanning direction. This is called a first block of the stripe.

【0022】続いて、符号化処理部はこの第1ブロック
を圧縮符号化し、ブロック符号情報/ブロック符号長情
報/第1ブロックの符号情報格納開始位置情報の3種の
情報を蓄積メモリ中の各々の所定領域に格納する。ここ
で、ブロック符号長情報及び第1ブロックの符号情報格
納開始位置情報の2つは固定長の情報である。
Subsequently, the encoding processing unit compresses and encodes the first block, and stores three types of information, block code information / block code length information / code information storage start position information of the first block, in the storage memory. In a predetermined area. Here, two pieces of information of the block code length information and the code information storage start position information of the first block are fixed length information.

【0023】以下、続けてラインバッファからn画素ず
つ取り出し、第2ブロックから最終ブロックまでを第1
ブロックと同様に圧縮符号化し、蓄積メモリに格納して
いく。但し、蓄積メモリに格納する情報はブロック符号
情報/ブロック符号長情報の2種の情報だけとする。
Subsequently, n pixels are successively taken out of the line buffer, and the second to last blocks are taken out of the first block.
The data is compressed and encoded in the same manner as the block, and is stored in the storage memory. However, the information stored in the storage memory is only two types of information, block code information / block code length information.

【0024】以後、第2ストライプから原稿の最終スト
ライプまでを第1ストライプと同様に処理する。
Thereafter, the processing from the second stripe to the last stripe of the document is processed in the same manner as the first stripe.

【0025】以上の結果、蓄積メモリには、 (1)ブロック符号情報 (2)各ブロックのブロック符号長情報 (3)各ストライプの第1ブロックの符号データの格納
開始位置情報 の3種類の情報が格納される。
As a result, the storage memory has three types of information: (1) block code information, (2) block code length information of each block, and (3) storage start position information of the code data of the first block of each stripe. Is stored.

【0026】<伸張及び回転処理> ・伸張するだけの場合 まず、復号化処理部は格納開始位置情報を参照し、第1
ストライプの第1ブロックの符号情報の格納位置を確定
する。次に、ブロック符号長情報の最初の情報が第1ブ
ロックの符号長を表わすので、その格納位置から所定量
のブロック符号情報を読み出し、第1ブロックの復号処
理を行う。この復号結果として得られたn画素×mライ
ンの画像データをmラインのラインバッファの各ライン
にn画素ずつ、主走査方向に従って格納する。
<Decompression and Rotation Processing> In Case of Decompression Only First, the decryption processing unit refers to the storage start position information and
The storage position of the code information of the first block of the stripe is determined. Next, since the first information of the block code length information indicates the code length of the first block, a predetermined amount of block code information is read from the storage position and decoding processing of the first block is performed. The image data of n pixels × m lines obtained as a result of the decoding is stored in each line of the line buffer of m lines by n pixels in the main scanning direction.

【0027】次に、第1ストライプの第2ブロック以降
の格納開始位置情報は、1ブロック前の格納開始位置情
報にそのブロック符号長情報を加算することで順次得ら
れる。従って、その情報を基に第1ブロックと同様に、
第2ブロック以降を復号してラインバッファに格納す
る。
Next, the storage start position information of the second and subsequent blocks of the first stripe is sequentially obtained by adding the block code length information to the storage start position information of the previous block. Therefore, based on the information, similar to the first block,
The second and subsequent blocks are decoded and stored in the line buffer.

【0028】こうして、mラインからなる第1ストライ
プの画素データが復元される。第2ストライプ以降も、
第1ストライプと同様の順序で復号処理を行う。 ・伸張後、90°回転させる場合 まず、復号処理部が格納開始位置情報とブロック符号長
情報を用いて目的とするブロック符号情報の格納位置を
確定し、ブロックの復号処理を行うこと自体は上述の復
号するだけの場合と同じである。
Thus, the pixel data of the first stripe composed of m lines is restored. After the second stripe,
The decoding process is performed in the same order as the first stripe. When rotating by 90 ° after decompression First, the decoding processing unit determines the storage position of the target block code information using the storage start position information and the block code length information, and performs the decoding process of the block itself. Is the same as the case of only decoding

【0029】ここで異なるのは、復号処理するブロック
の順序と、各ブロックの復号結果を90°回転させてか
らラインバッファに格納する事の2点である。
Here, two points are different in the order of the blocks to be decoded and the decoding result of each block is rotated by 90 ° and then stored in the line buffer.

【0030】つまり、ブロックの復号処理は、第1スト
ライプから最終ストライプに向けて各々の第1ブロック
を全て処理し、同様に各々の第2ブロックを全て処理
し、…という順序で行われる。
In other words, the block decoding process is performed in the order of processing all the first blocks from the first stripe to the last stripe, processing all the second blocks in the same manner, and so on.

【0031】90°回転処理は、各ブロック毎に復号結
果のn画素×mラインの画像データを右方向に90°回
転し、m画素×nラインに変換した後に、nラインのラ
インバッファに順次主走査方向とは逆の方向から格納す
る。 ・伸張後、180°回転する場合 180°の回転は、用紙の短辺方向を主走査とする画像
を両面印刷する場合等に必要となる。また、復号処理を
行うストライプの順序は、最終ストライプから第1スト
ライプ方向に向けて行う。ブロックの復号順序は、各ス
トライプ毎に、第1ブロック、第2ブロック…の順序で
行う。そして、ラインバッファへの格納は、各ブロック
の復号結果であるn画素×mラインの画像データを18
0°回転後、mラインのラインバッファに順次主走査方
向とは逆方向に格納する。
In the 90 ° rotation processing, image data of n pixels × m lines as a result of decoding is rotated to the right by 90 ° for each block, converted to m pixels × n lines, and then sequentially stored in a line buffer of n lines. The data is stored from the direction opposite to the main scanning direction. -Rotation by 180 degrees after stretching Rotation by 180 degrees is necessary when two-sided printing is performed on an image whose main scanning is in the short side direction of the paper. The order of stripes to be decoded is from the last stripe toward the first stripe. The decoding order of the blocks is performed in the order of the first block, the second block,... For each stripe. Then, the image data of n pixels × m lines, which is the decoding result of each block, is stored in the line buffer in 18 lines.
After the rotation by 0 °, the data is sequentially stored in the line buffer of m lines in the direction opposite to the main scanning direction.

【0032】図1は、本実施形態における複合装置の構
成を示すブロック図であり、ファクシミリと複写機とを
複合した装置である。同図において、1はシステム制御
部であり、本システムを制御すると共に、以下のファク
シミリ送受信時の画像符号/復号処理を行う。
FIG. 1 is a block diagram showing the configuration of a multifunction device according to the present embodiment, which is a device in which a facsimile and a copying machine are combined. In FIG. 1, reference numeral 1 denotes a system control unit which controls the present system and performs the following image coding / decoding processing at the time of facsimile transmission / reception.

【0033】ファクシミリ送信時には、蓄積メモリ中の
符号データを一旦復号処理し、相手ファクシミリ受信装
置の復号能力に合致した符号化方式により再度符号化し
て、ファクシミリ送信処理を行う。ファクシミリ受信時
には、受信したファクシミリ符号データを一旦復号処理
し、この結果得られた画像データを「画像回転処理に適
した符号化」に従って再度符号化し蓄積メモリに格納す
る。
At the time of facsimile transmission, the code data in the storage memory is once decoded, re-encoded by an encoding method that matches the decoding capability of the other party's facsimile receiving apparatus, and the facsimile transmission processing is performed. At the time of facsimile reception, the received facsimile code data is once decoded, and the image data obtained as a result is re-encoded according to “encoding suitable for image rotation processing” and stored in the storage memory.

【0034】2は読取部であり、A3,B4原稿は短辺
を、A4原稿は長辺を主走査方向としてライン単位に画
像を読み取り、ラインバッファ7a,7bに順次格納す
る。3は符号化部であり、ラインバッファ7a、又は7
bに格納された画像データを「画像回転処理に適した符
号化」に従って符号化し、蓄積メモリ9に格納する。4
は復号化部であり、蓄積メモリ9に蓄積された符号デー
タを「画像回転処理に適した符号化」に従って復号処理
し、原稿サイズと記録用紙サイズに応じて無回転90°
回転、或いは180°回転の処理を加えてラインバッフ
ァ7a又は7bに画素データを格納する。
Reference numeral 2 denotes a reading unit, which reads an image in line units with A3 and B4 originals on the short side and A4 originals on the long side in the main scanning direction, and sequentially stores them in the line buffers 7a and 7b. Reference numeral 3 denotes an encoding unit, which is a line buffer 7a or 7
The image data stored in b is encoded according to “encoding suitable for image rotation processing” and stored in the storage memory 9. 4
Is a decoding unit that decodes the code data stored in the storage memory 9 in accordance with “encoding suitable for image rotation processing”, and performs non-rotation 90 ° according to the document size and the recording paper size.
The pixel data is stored in the line buffer 7a or 7b by performing a rotation or a 180 ° rotation.

【0035】5は印刷部であり、ラインバッファ7a,
7bに格納された画像データを順次読み出して記録用紙
に印刷する。6はバッファ制御部であり、ラインバッフ
ァ7a,7bに格納される画像データの有無等を管理す
ると共に、両ラインバッファに対するシステム制御部1
/読取部2/符号化部3/復号化部4/印刷部5からの
アクセス要求を調停する。7a,7bはラインバッファ
メモリであり、少なくとも1ストライプ分の画像データ
を記憶する容量を有する。
Reference numeral 5 denotes a printing unit, which is a line buffer 7a,
The image data stored in 7b is sequentially read out and printed on recording paper. Reference numeral 6 denotes a buffer control unit which manages the presence / absence of image data stored in the line buffers 7a and 7b, and controls the system control unit 1 for both line buffers.
It arbitrates for access requests from / reading unit 2 / encoding unit 3 / decoding unit 4 / printing unit 5. Reference numerals 7a and 7b denote line buffer memories having a capacity for storing image data of at least one stripe.

【0036】8はラインバッファメモリであり、システ
ム制御部1がファクシミリ送受信動作のために、符号化
部3、復号化部4と同等の符号/復号処理を行う場合に
画像データを一時格納するためのメモリである。9は蓄
積メモリであり、符号化された符号データを格納する。
10は通信部であり、通信回線を介してファクシミリ送
受信を行うため、信号の変調を行う。
Reference numeral 8 denotes a line buffer memory for temporarily storing image data when the system control unit 1 performs the same encoding / decoding processing as the encoding unit 3 and the decoding unit 4 for the facsimile transmission / reception operation. Memory. Reference numeral 9 denotes a storage memory for storing encoded code data.
A communication unit 10 modulates a signal to perform facsimile transmission and reception via a communication line.

【0037】S1〜S4は各処理部2〜5からバッファ
制御部6に対するラインバッファ7a又は7bへのアク
セス要求信号と、その信号に応答して制御部6がアクセ
スを許可するために発生するアクセス許可信号である。
D1〜D4は各処理部2〜5とバッファ制御部6を介し
てラインバッファ7a又は7bが画像データを入出力す
る画像データバスである。S5はバッファ制御部6によ
り生成され、アクセス要求を許可した各処理部2〜5の
処理内容に予め対応させたラインバッファ7a又は7b
のアドレス信号とアクセス制御信号である。D5はライ
ンバッファ7a,7bとバッファ制御部6の間のデータ
入出力バスである。S6はシステム制御部1がラインバ
ッファ7a又は7bにアクセス要求した場合に、バッフ
ァ制御部6がアクセスを許可するまでシステム制御部1
のアクセスサイクルを延長させるためのウエイト信号で
ある。
S1 to S4 denote an access request signal from each of the processing units 2 to 5 to the buffer control unit 6 to access the line buffer 7a or 7b, and an access generated by the control unit 6 in response to the signal to permit access. This is a permission signal.
D1 to D4 are image data buses through which the line buffer 7a or 7b inputs and outputs image data via the processing units 2 to 5 and the buffer control unit 6. S5 is a line buffer 7a or 7b generated by the buffer control unit 6 and previously associated with the processing contents of each of the processing units 2 to 5 that have permitted the access request.
Address signal and access control signal. D5 is a data input / output bus between the line buffers 7a and 7b and the buffer controller 6. In step S6, when the system control unit 1 requests access to the line buffer 7a or 7b, the system control unit 1 waits until the buffer control unit 6 permits the access.
Is a wait signal for extending the access cycle of the data.

【0038】以下、本実施形態では、1ブロックの大き
さをソフトウェアでの扱い易さや、バッファメモリの容
量、或いは符号化時のデータ量等を考慮し、16画素×
16画素として説明するが、本発明の特徴、効果がこの
大きさに限定されるものではないことは明白である。
In the present embodiment, the size of one block is determined by considering the ease of handling by software, the capacity of a buffer memory, the amount of data at the time of encoding, and the like.
Although described as 16 pixels, it is clear that the features and effects of the present invention are not limited to this size.

【0039】図2は、画像を90°回転する場合の概念
を例示したものである。同図に示す上部は回転前の画像
PIX(0)、下部は右90°回転後の画像PIX(9
0)であり、共に紙面向かって左から右方向を主走査方
向とする。
FIG. 2 exemplifies the concept of rotating an image by 90 °. The upper part shown in the figure is an image PIX (0) before rotation, and the lower part is an image PIX (9) after rotating 90 ° to the right.
0), and the direction from left to right with respect to the plane of the paper is the main scanning direction.

【0040】また、画像PIX(0)において、副走査
方向を16ライン毎に分割し、第1ストライプから第Y
ストライプとし、更に各ストライプの主走査方向を16
画素毎に分割し、第1ブロックから第Xブロックとす
る。
In the image PIX (0), the sub-scanning direction is divided every 16 lines,
Stripes, and the main scanning direction of each stripe is 16
The image is divided for each pixel and the first block to the X-th block.

【0041】従って、画像PIX(0)はs,bを変数
とし、主走査方向を[s,1]から[s,X]、副走査
方向を[1,b]から[Y,b]とするブロックの集合
体として構成される。尚、上記の[s,b]は第s番目
のストライプ中の第b番目のブロックを示す記号であ
る。
Therefore, the image PIX (0) uses s and b as variables, and changes the main scanning direction from [s, 1] to [s, X] and the sub-scanning direction from [1, b] to [Y, b]. It is configured as an aggregate of blocks to be executed. [S, b] is a symbol indicating the b-th block in the s-th stripe.

【0042】また、画像PIX(0)の符号化順序は、
まず第1ストライプを以下の順序で処理する。即ち、ス
トライプの左から右方向に符号処理する。
The encoding order of the image PIX (0) is as follows.
First, the first stripe is processed in the following order. That is, code processing is performed from left to right of the stripe.

【0043】 [1,1]、[1,2]、[1,3]、…、[1,X] 第2ストライプ以降も同様にして、以下の順序で処理す
る。
[1,1], [1,2], [1,3],..., [1, X] The second and subsequent stripes are similarly processed in the following order.

【0044】 [2,1]、[2,2]、[2,3]、…、[2,X] [Y,1]、[Y,2]、[Y,3]、…、[Y,X] そして、蓄積メモリ9には、予め以下の3つの異なる符
号情報の各領域が設けられているものとする。
[2, 1], [2, 2], [2, 3],..., [2, X] [Y, 1], [Y, 2], [Y, 3],. , X] The storage memory 9 is provided with the following three areas of different code information in advance.

【0045】(1)ブロック符号情報(以下、CODと
略記) (2)各ブロックのブロック符号長情報(以下、CNT
と略記) (3)各ストライプの第1ブロックの符号データの格納
開始位置情報(以下、ADDと略記) COD領域には、符号化したブロック順序通りに符号デ
ータを格納する。
(1) Block code information (hereinafter abbreviated as COD) (2) Block code length information of each block (hereinafter CNT)
(3) Storage start position information of the code data of the first block of each stripe (hereinafter abbreviated as ADD) In the COD area, the code data is stored in the order of the encoded blocks.

【0046】CNT領域には、符号化したブロック順序
通りに各ブロックの符号長データを格納する。
The CNT area stores the code length data of each block in the order of the coded blocks.

【0047】ADD領域には、1からYまでのストライ
プの第1ブロックの符号を格納したCOD領域のアドレ
スを格納する。
In the ADD area, the address of the COD area storing the code of the first block of the stripe from 1 to Y is stored.

【0048】また、図2に示す90°回転復号処理後の
画像PIX(90)は、画像の最上部に各ストライプの
第1ブロックをそれぞれ右に90°回転した形で並べる
ことにより実現できる。即ち、復号後の新たなストライ
プは、以下の順序でブロックを復号することで得られ
る。
The image PIX (90) after the 90 ° rotation decoding processing shown in FIG. 2 can be realized by arranging the first blocks of the respective stripes at the top of the image in a form rotated 90 ° to the right. That is, a new stripe after decoding is obtained by decoding blocks in the following order.

【0049】新第1ストライプ=[1,1]、[2,
1]〜[Y,1] 新第2ストライプ=[1,2]、[2,2]〜[Y,
2] 新第Xストライプ=[1,X]、[2,X]〜[Y,
X] 復号後の各ブロックの画素データは、その配列を90°
回転する処理を施した後、ラインバッファに主走査方向
とは逆の右詰めで格納する。
New first stripe = [1, 1], [2,
1] to [Y, 1] new second stripe = [1, 2], [2, 2] to [Y, 1
2] New X-th stripe = [1, X], [2, X] to [Y,
X] The pixel data of each block after decoding has an arrangement of 90 °
After performing the rotation process, the image data is stored in the line buffer right-justified in the opposite direction to the main scanning direction.

【0050】以上のように、復号後のブロックの配列を
新たなストライプとし、更にラインバッファに復号ブロ
ック画素を格納する時に画素配列を90°回転すること
で、画像全体の90°回転を実現できる。
As described above, the arrangement of the blocks after decoding is set as a new stripe, and the pixel arrangement is rotated by 90 ° when the decoded block pixels are stored in the line buffer, so that the entire image can be rotated by 90 °. .

【0051】図3は、画像を180°回転する場合の概
念を例示したものである。図3に示す上部は回転前の画
像PIX(0)、下部は180°回転後の画像PIX
(180)であり、共に紙面向かって左から右方向を主
走査方向とする。
FIG. 3 illustrates the concept when the image is rotated by 180 °. The upper part shown in FIG. 3 is an image PIX (0) before rotation, and the lower part is an image PIX after rotation by 180 °.
(180), and the direction from the left to the right with respect to the page is the main scanning direction.

【0052】尚、符号化を行うブロックの順序は、上述
した90°回転の場合と同様であるので説明は割愛す
る。
The order of the blocks to be coded is the same as that in the case of the above-mentioned 90 ° rotation, so that the description is omitted.

【0053】180°回転復号処理後の画像PIX(1
80)は、同図より画像の最上部に最終ストライプのブ
ロックを逆方向に並べ、かつ各ブロック内の画素配列を
180°回転させることで得られることが分かる。即
ち、復号後の新たなストライプは、以下の順序でブロッ
クを復号することで得られる。
The image PIX (1) after the 180 ° rotation decoding process
80) can be obtained by arranging the blocks of the last stripe in the reverse direction at the top of the image and rotating the pixel array in each block by 180 °. That is, a new stripe after decoding is obtained by decoding blocks in the following order.

【0054】新第1ストライプ=[Y,1],[Y2,
1]〜[Y,X] 新第2ストライプ=[Y−1,1],[Y−1,2]〜
[Y−1,X] 新第(Y−1)ストライプ=[2,1],[2,2]〜
[2,X] 新第Yストライプ=[1,1],[1,X]〜[1,
X] 復号後の各ブロックの画素データは、その配列を180
°回転する処理を施した後、ラインバッファに主走査方
向とは逆の右詰めで格納する。
New first stripe = [Y, 1], [Y2,
1] to [Y, X] new second stripe = [Y-1, 1], [Y-1, 2] to
[Y-1, X] New (Y-1) th stripe = [2, 1], [2, 2] to
[2, X] New Y-th stripe = [1, 1], [1, X] to [1,
X] The pixel data of each block after decoding has an array of 180
After performing the rotation process, the data is stored in the line buffer right-justified in the opposite direction to the main scanning direction.

【0055】以上のように、復号後のブロックの配列を
新たなストライプとし、更にラインバッファに復号ブロ
ック画素を格納する時に画素配列を180°回転するこ
とで、画像全体の180°回転が実現する。
As described above, the arrangement of the blocks after decoding is set as a new stripe, and the pixel arrangement is rotated by 180 ° when the decoded block pixels are stored in the line buffer, whereby the entire image is rotated by 180 °. .

【0056】図4は、読取部2の原稿読み取り動作を説
明するフローチャートである。尚、読み取った画素デー
タはライン順次に、バッファ制御部6によるアクセス調
停制御に従って、それぞれ16ライン分の容量を持つラ
インバッファ7a又は7bに格納される。また、ライン
バッファ7a,7bは7aから回帰的に用いることが予
め決められているものとする。
FIG. 4 is a flowchart for explaining the original reading operation of the reading section 2. The read pixel data is sequentially stored in the line buffer 7a or 7b having a capacity of 16 lines according to line arbitration control by the buffer control unit 6. It is also assumed that the line buffers 7a and 7b are determined to be used recursively from 7a.

【0057】まず、ステップS1において、原稿1ペー
ジの読み取り終了を表示するフラグDOC_END_F
のリセットと、変数rswを“0”に初期化する。尚、
変数rswは“0”又は“1”の値をもち、ラインバッ
ファ7a,7bの選択に用いられる。次に、ステップS
2において、読み取り対象の原稿を所定の読み取り位置
まで搬送する。そして、ステップS3で変数rswによ
り選択される格納対象のラインバッファ7a又は7bが
画像データを書き込み可能な状態にあるか否かを判定す
る。ここで、まだ過去に読み取った画像データが格納さ
れたままで符号処理が終了していない場合は符号処理の
終了を待ち合わせる。
First, in step S1, a flag DOC_END_F indicating that reading of one page of a document has been completed is performed.
Is reset, and the variable rsw is initialized to “0”. still,
The variable rsw has a value of "0" or "1" and is used for selecting the line buffers 7a and 7b. Next, step S
In 2, the document to be read is transported to a predetermined reading position. Then, in step S3, it is determined whether or not the line buffer 7a or 7b to be stored selected by the variable rsw is in a state where image data can be written. Here, if the encoding process is not completed while the image data read in the past is still stored, the end of the encoding process is waited for.

【0058】また、書き込み可能な状態であれば次のス
テップS4に進み、ラインバッファへの格納ライン数を
計数する変数loopに初期値として“16”を代入す
る。そして、ステップS5で1ラインの読み取りを実行
し、対象となっているラインバッファ7a又は7bに画
素データを格納する。次に、ステップS6において、フ
ラグDOC_END_Fがリセットされているかを判定
する。ここで、セットされていたならばステップS12
に進み、リセット状態であったならばステップS7に進
む。ステップS7では、読み取り位置よりも手前に設置
されたセンサが読み取り原稿の後端を検出したかを判定
する。ここで、まだ後端に達していない場合はステップ
S9に進み、次ラインの読み取りに備える。
If it is in a writable state, the process proceeds to the next step S4, where "16" is substituted as an initial value into a variable loop for counting the number of lines stored in the line buffer. Then, in step S5, one line is read, and pixel data is stored in the target line buffer 7a or 7b. Next, in step S6, it is determined whether the flag DOC_END_F has been reset. If it has been set, step S12
The process proceeds to step S7 if it is in the reset state. In step S7, it is determined whether a sensor installed before the reading position has detected the rear end of the read document. If the rear end has not been reached yet, the process proceeds to step S9 to prepare for reading the next line.

【0059】一方、後端を検出した場合はステップS8
に進み、フラグDOC_END_Fをセットすると共
に、センサから読み取り位置までの距離によって決まる
残りのライン数をNを変数lineに代入する。そし
て、ステップS9で変数loopを1減算し、ステップ
S10において、変数loopが“0”となったか、即
ち、格納対象のラインバッファに16ラインを読み取っ
たかを判定する。ここで、16ラインに達していなけれ
ばステップS5に戻り、次ラインの読み取りを行う。ま
た、16ラインを読み取ったならばステップS11に進
み、格納対象を選択する変数rswを反転させ、ステッ
プS3に戻る。
On the other hand, if the trailing edge is detected, step S8
, The flag DOC_END_F is set, and the remaining number of lines determined by the distance from the sensor to the reading position is substituted with N for the variable line. Then, in step S9, the variable loop is decremented by 1, and in step S10, it is determined whether the variable loop has become "0", that is, whether 16 lines have been read into the line buffer to be stored. Here, if it has not reached the 16th line, the process returns to the step S5 to read the next line. If 16 lines have been read, the process proceeds to step S11, inverts the variable rsw for selecting a storage target, and returns to step S3.

【0060】また、上述のステップS6で、フラグDO
C_END_FがセットされていたならばステップS1
2に進み、変数lineを1減算する。そして、ステッ
プS13で変数lineが“0”に達したか、即ち、原
稿を終端まで読み取ったかを判定する。ここで、“0”
でなければステップS9に進み、上述の読み取り処理を
繰り返す。また、“0”に達した場合はステップS14
に進み、フラグDOC_END_Fをリセットする。そ
して、ステップS15で読み取り最終ラインを格納した
ラインバッファが1ストライプを構成する、即ち、16
ラインに満たないライン数であったならば、残ったライ
ンバッファ領域に全白ラインを格納する終了処理を行う
と共に、バッファ制御部6に対して原稿1ページの読み
取り終了を通知する。次に、ステップS16において、
当該原稿の符号化処理が終了するまで待機し、終了する
と、ステップS17で続けて読み取るべき原稿があるか
を判定する。ここで、原稿がある場合はステップS1に
戻り、次原稿の読み取りに備え、無ければ読み取り動作
を終了する。
In step S6, the flag DO is set.
If C_END_F has been set, step S1
Proceed to 2 and subtract 1 from the variable line. In step S13, it is determined whether the variable line has reached "0", that is, whether the original has been read to the end. Here, "0"
If not, the process proceeds to step S9, and the above-described reading process is repeated. If it has reached “0”, step S14
To reset the flag DOC_END_F. Then, the line buffer storing the last line read in step S15 forms one stripe, that is, 16 lines.
If the number of lines is less than the number of lines, an end process for storing all white lines in the remaining line buffer area is performed, and the buffer controller 6 is notified of the end of reading one page of the document. Next, in step S16,
The process waits until the encoding process of the document is completed, and when it is completed, it is determined in step S17 whether there is a document to be continuously read. If there is a document, the process returns to step S1 to prepare for reading the next document. If not, the reading operation ends.

【0061】図5は、符号化部3の符号化動作を説明す
るフローチャートである。
FIG. 5 is a flowchart illustrating the encoding operation of the encoding unit 3.

【0062】尚、フローチャートの中のフラグ、変数、
定数は、次のような意味を表わす。LAST_Fは最終
ストライプの符号化処理であることを表わすフラグ。s
wは符号化に使用するラインバッファ7a,7bを切り
替えるフラグであり、“0”又は“1”の値を持つ。B
UF[sw]は符号化対象のラインバッファを表わし、
BUF[0]はラインバッファ7aを、BUF[1]は
ラインバッファ7bを指す。sはストライプ番号を表わ
す変数。bはブロック番号を表わす変数。pは符号デー
タを蓄積メモリ9に格納するアドレス値を持つポインタ
変数。cはブロックの符号データ長を計数するカウンタ
変数。ADD[s]は第Sストライプの第1ブロックの
符号を蓄積メモリ9に格納したアドレス値。CNT
[s,b]は第Sストライプの第Bブロックの符号デー
タ長。Xは原稿の主走査長により一義的に定まる、スト
ライプの最終ブロック番号。Pnextは符号の格納先
を蓄積メモリ9の別な区画に変更させるためにポインタ
変数に代入する、蓄積メモリ9のアドレス値。
The flags, variables,
The constant has the following meaning. LAST_F is a flag indicating that the encoding process is for the last stripe. s
w is a flag for switching the line buffers 7a and 7b used for encoding, and has a value of "0" or "1". B
UF [sw] represents a line buffer to be encoded,
BUF [0] indicates the line buffer 7a, and BUF [1] indicates the line buffer 7b. s is a variable representing a stripe number. b is a variable representing a block number. p is a pointer variable having an address value for storing the code data in the storage memory 9. c is a counter variable for counting the code data length of the block. ADD [s] is an address value at which the code of the first block of the S-th stripe is stored in the storage memory 9. CNT
[S, b] is the code data length of the B-th block of the S-th stripe. X is the last block number of the stripe uniquely determined by the main scanning length of the document. Pnext is an address value of the storage memory 9 to be assigned to a pointer variable in order to change a code storage destination to another section of the storage memory 9.

【0063】まず、ステップS21において、フラグL
AST_Fをリセットし、符号化対象のラインバッファ
を7a(フラグsw=0)とし、ポインタ変数pに格納
開始アドレス値をセットし、s=0、b=1、c=0と
初期化する。次に、ステップS22において、符号化対
象のラインバッファに16ラインの読み取りラインが格
納され符号化が開始できるかを判定する。ここで、開始
できるならばステップS26に進むが、できない場合は
ステップS23に進む。ステップS23では、読み取り
動作が既に終了したかを判定し、まだ終了していなけれ
ば再度ステップS22に戻る。
First, in step S21, the flag L
AST_F is reset, the line buffer to be encoded is set to 7a (flag sw = 0), the storage start address value is set in the pointer variable p, and s = 0, b = 1, and c = 0 are initialized. Next, in step S22, it is determined whether 16 read lines are stored in the line buffer to be encoded and encoding can be started. Here, if the process can be started, the process proceeds to step S26; otherwise, the process proceeds to step S23. In step S23, it is determined whether the reading operation has already been completed, and if not, the process returns to step S22.

【0064】また、読み取り動作が終了しているならば
ステップS24に進み、符号化対象のラインバッファに
符号化すべきデータが格納されているかを判定する。こ
こで、無ければ符号化処理を終了するが、あるならばス
テップS25に進み、フラグLAST_Fをセットす
る。次に、ステップS26において、ストライプ番号s
に1加算すると共に、ブロック番号bを“1”に初期化
する。そして、ステップS27において、当該ストライ
プの符号格納の開始アドレスとしてポインタpの値をA
DD[s]に格納する。
If the reading operation has been completed, the flow advances to step S24 to determine whether data to be encoded is stored in the encoding target line buffer. Here, if there is no encoding process, the encoding process ends. If there is, the process proceeds to step S25, and the flag LAST_F is set. Next, in step S26, the stripe number s
, And the block number b is initialized to “1”. Then, in step S27, the value of the pointer p is set to A as the start address for storing the code of the stripe.
DD [s].

【0065】次に、ステップS28では、ブロック
[s,b]を符号化し、順次ポインタpの指し示すアド
レスに符号を格納すると共に、その符号長cを計数す
る。次に、ステップS29では、ブロック符号長CNT
[s,b]に計数した当該ブロックの符号長cの値を格
納する。そして、ステップS30では、ブロック番号b
に1加算し、ステップS31で当該ストライプの最終ブ
ロックまでを符号化し終えたかを判定する。ここで、ま
だ最終ブロックに達していない場合はステップS28に
戻り、上述の符号化処理を繰り返す。
Next, in step S28, the block [s, b] is encoded, the code is sequentially stored at the address indicated by the pointer p, and the code length c is counted. Next, in step S29, the block code length CNT
The counted value of the code length c of the block is stored in [s, b]. Then, in step S30, the block number b
, And it is determined in step S31 whether encoding up to the last block of the stripe has been completed. If the last block has not been reached yet, the process returns to step S28, and the above-described encoding process is repeated.

【0066】また、最終ブロックまで符号化を終了した
場合はステップS32に進み、最終ストライプの符号化
を終了したかを判定する。ここで、終了した場合は符号
化処理を終了するが、まだ終了していない場合はステッ
プS33に進み、フラグswを反転させて符号化対象の
ラインバッファを変更し、ステップS22に戻る。
If the encoding has been completed up to the last block, the flow advances to step S32 to determine whether the encoding of the last stripe has been completed. If the encoding has been completed, the encoding process is terminated. If not, the process proceeds to step S33, in which the flag sw is inverted to change the line buffer to be encoded, and the process returns to step S22.

【0067】ここで、上述のステップS28におけるブ
ロックの符号化処理において、符号データを蓄積メモリ
9に格納する際の処理を更に詳述する。
Here, the processing for storing the code data in the storage memory 9 in the block coding processing in step S28 will be described in further detail.

【0068】図6は、格納処理を示すフローチャートで
ある。蓄積メモリ9の格納領域は、メモリの使用効率を
向上させるため、所定の容量ごとに区分けして管理する
のが一般的である。従って、格納する符号データの量が
所定の容量を超える場合は、不連続なアドレスに対して
格納処理を継続する必要がある。どの格納区画に更新す
べきかは、蓄積メモリ9を管理するシステム制御部1に
割り込み要求を出して新格納区画のアドレス値Pnex
tの値を返す例外処理を依頼する。
FIG. 6 is a flowchart showing the storing process. In general, the storage area of the storage memory 9 is divided and managed for each predetermined capacity in order to improve the use efficiency of the memory. Therefore, when the amount of code data to be stored exceeds a predetermined capacity, it is necessary to continue the storing process for discontinuous addresses. Which storage section should be updated can be determined by issuing an interrupt request to the system control unit 1 which manages the storage memory 9 and issuing the address value Pnex of the new storage section.
Request exception processing that returns the value of t.

【0069】まず、ステップS41において、符号デー
タをポインタpの差し示すアドレスに格納する。そし
て、ステップS42でポインタpの持つ値が所定の格納
区画の境界に相当するかを判定する。ここで、境界でな
ければステップS45に進み、ポインタpに1加算し、
終了する。また、境界であったならばステップS43に
進み、システム制御部1に割り込み要求を出し、次に格
納を開始すべきアドレス値Pnextを入力するように
例外処理を依頼する。そして、ステップS44におい
て、ポインタpにPnextを代入する。
First, in step S41, the code data is stored at the address indicated by the pointer p. Then, in step S42, it is determined whether or not the value of the pointer p corresponds to the boundary of a predetermined storage section. Here, if it is not a boundary, the process proceeds to step S45, 1 is added to the pointer p,
finish. If it is the boundary, the process proceeds to step S43, where an interrupt request is issued to the system control unit 1, and an exception process is requested to input an address value Pnext to start storage next. Then, in step S44, Pnext is substituted for the pointer p.

【0070】図7は、上述した符号化処理の結果、蓄積
メモリ9に格納される3種類の符号情報を表わしたもの
である。図示するように、ADD[s]は1ページの画
像を16ラインずつのストライプに分解し、各々のスト
ライプにおける第1ブロックの符号データCOD[s,
1]を格納したアドレス値を格納した、固定長なアドレ
ス情報を示す。また、COD[s,b]は以下の順序で
各ブロックを順次符号化した不定長な符号データを示
す。
FIG. 7 shows three types of code information stored in the storage memory 9 as a result of the above-described coding process. As shown in the figure, ADD [s] decomposes an image of one page into stripes of 16 lines, and encodes the first block of code data COD [s,
1] shows fixed-length address information storing an address value storing “1”. COD [s, b] indicates indefinite length code data obtained by sequentially coding each block in the following order.

【0071】第1ストライプの第1ブロック[1,1]
〜第Xブロック[1,X]、第2ストライプの第1ブロ
ック[2,1]〜第Xブロック[2,X]、第Yストラ
イプの第1ブロック[Y,1]〜第Xブロック[Y,
X]、そして、CNT[s,b]はCOD[s,b]と
同様なブロック順序をもち、各ブロックの符号長を示す
固定長な符号長データを示す。
The first block [1, 1] of the first stripe
To the X-th block [1, X], the first block [2,1] of the second stripe to the X-th block [2, X], the first block [Y, 1] of the Y-th stripe to the X-th block [Y ,
X] and CNT [s, b] have the same block order as COD [s, b], and indicate fixed-length code length data indicating the code length of each block.

【0072】図8は、図7に示す符号情報を用いてオリ
ジナル画像と同一方向に画像を復元する復号処理を表わ
したフローチャートである。まずステップS101にお
いて、バッファ選択sw=0、ストライプカウンタs=
1、ブロックカウンタb=1に各変数を初期化する。そ
して、ステップS102に進み、選択したバッファが復
元画像を格納できる状態にあるか判定し、その状態にな
い場合は待ち合わせる。バッファの準備ができるとステ
ップS103に進み、復号対象であるブロック[s,
b]の符号長情報をCNT[s,b]から読み出し、変
数cに代入する。そして、ステップS104において、
復号対象であるストライプsの符号が格納されている蓄
積メモリ9のアドレス情報をADD[s]から読み出
し、変数pに代入する。
FIG. 8 is a flowchart showing a decoding process for restoring an image in the same direction as the original image using the code information shown in FIG. First, in step S101, the buffer selection sw = 0 and the stripe counter s =
1. Initialize each variable to block counter b = 1. Then, the process proceeds to step S102, where it is determined whether or not the selected buffer is capable of storing the restored image. If not, the process waits. When the buffer is ready, the process proceeds to step S103, and the block [s,
The code length information of [b] is read from CNT [s, b] and substituted into a variable c. Then, in step S104,
The address information of the storage memory 9 in which the code of the stripe s to be decoded is stored is read from ADD [s] and substituted for the variable p.

【0073】次に、ステップS105において、次ブロ
ックの復号に備えてADD[s]の内容をp+cの値に
更新する。そして、ステップS106でブロック[s,
b]の復号処理を行い、16画素×16画素の画像に復
元する。復号処理が終了するとステップS107に進
み、復元結果の画像をラインバッファBUF[sw]に
主走査方向と同一に左詰めで格納し、続くステップS1
08でブロック番号bに1加算する。そして、ステップ
S109で、所定の画像サイズに応じて一義的に定まる
ストライプ当りのブロック数Xとブロック番号bとを比
較することにより、当該ストライプの最終ブロックの復
号が終了したかを判定する。ここで、まだの場合はステ
ップS103に戻り、上述の復号処理を繰り返す。
Next, in step S105, the contents of ADD [s] are updated to the value of p + c in preparation for decoding of the next block. Then, in step S106, the block [s,
b] to restore an image of 16 × 16 pixels. Upon completion of the decoding process, the process proceeds to step S107, where the restored image is stored in the line buffer BUF [sw], left-justified in the same manner as in the main scanning direction, and the subsequent step S1
At 08, 1 is added to the block number b. Then, in step S109, it is determined whether decoding of the last block of the stripe has been completed by comparing the block number b per stripe with the block number b uniquely determined according to the predetermined image size. Here, if not, the process returns to step S103, and the above-described decoding process is repeated.

【0074】一方、ステップS109で終了した場合は
ステップS110に進み、バッファ選択変数swの内容
を反転させて今後使用するラインバッファを変更する。
そして、ステップS111でストライプ番号sに1加算
し、ステップS112で符号化時のストライプ数Yと、
ストライプ番号sとを比較し、まだ最終ストライプを復
号し終えていない時はステップS102に戻り、上述の
ストライプの復号処理を再実行する。また、終了したら
ステップS113に進み、1ページの復号処理が終了し
たことをバッファ制御部6に通知する。
On the other hand, if the processing is completed in step S109, the flow advances to step S110 to invert the contents of the buffer selection variable sw to change the line buffer to be used in the future.
Then, in step S111, 1 is added to the stripe number s. In step S112, the number of stripes Y at the time of encoding is calculated.
If the last stripe has not been decoded yet, the process returns to step S102, and the above-described stripe decoding process is executed again. Upon completion, the process advances to step S113 to notify the buffer controller 6 that the decoding process for one page has been completed.

【0075】図9は図8と同様に、オリジナル画像を右
方向に90°回転させた画像を復元する復号処理を表わ
したフローチャートである。まずステップS201にお
いて、バッファ選択sw=0、ストライプカウンタs=
1、ブロックカウンタb=1に各変数を初期化する。そ
して、ステップS202に進み、選択したバッファが復
元画像を格納できる状態にあるか判定し、その状態にな
い場合は待ち合わせる。バッファの準備ができるとステ
ップS203に進み、復号対象であるブロック[s,
b]の符号長情報をCNT[s,b]から読み出し、変
数cに代入する。そして、ステップS204において、
復号対象であるストライプsの符号が格納されている蓄
積メモリ9のアドレス情報をADD[s]から読み出
し、変数pに代入する。
FIG. 9 is a flowchart showing a decoding process for restoring an image obtained by rotating the original image by 90 ° to the right similarly to FIG. First, in step S201, the buffer selection sw = 0 and the stripe counter s =
1. Initialize each variable to block counter b = 1. Then, the process proceeds to step S202, and it is determined whether the selected buffer is in a state where the restored image can be stored. If not, the process waits. When the buffer is ready, the process proceeds to step S203, and the block [s,
The code length information of [b] is read from CNT [s, b] and substituted into a variable c. Then, in step S204,
The address information of the storage memory 9 in which the code of the stripe s to be decoded is stored is read from ADD [s] and substituted for the variable p.

【0076】次に、ステップS205において、次ブロ
ックの復号に備えてADD[s]の内容をp+cの値に
更新する。そして、ステップS206でブロック[s,
b]の復号処理を行い、16画素×16画素の画像に復
元する。次に、ステップS207において、復元した1
6画素×16画素の画像を右方向に90°回転処理を行
う。そして、ステップS208で復元回転結果の画像を
ラインバッファBUF[sw]に主走査方向とは逆に右
詰めで格納し、ステップS209でストライプ番号sに
1加算する。次に、ステップS210において、符号化
時のストライプ数Yとストライプ番号sとを比較し、ま
だ最終ストライプを復号し終えていない時はステップS
203に戻り、次のストライプの同番号のブロックの復
号処理を実行する。
Next, in step S205, the contents of ADD [s] are updated to the value of p + c in preparation for decoding of the next block. Then, in step S206, the block [s,
b] to restore an image of 16 × 16 pixels. Next, in step S207, the restored 1
The image of 6 pixels × 16 pixels is rotated 90 ° clockwise. Then, in step S208, the image resulting from the restoration rotation is stored in the line buffer BUF [sw], right-justified in the opposite direction to the main scanning direction, and 1 is added to the stripe number s in step S209. Next, in step S210, the number of stripes Y at the time of encoding is compared with the stripe number s, and if the final stripe has not been decoded yet, step S210 is executed.
Returning to step 203, the decoding processing of the same-numbered block of the next stripe is executed.

【0077】一方、ステップS209で終了するとステ
ップS211に進み、バッファ選択変数swの内容を反
転させて今後使用するラインバッファを変更する。そし
て、ステップS212でブロック番号bに1加算し、ス
テップS213で所定の画像サイズに応じて一義的に定
まるストライプ当りのブロック数Xとブロック番号bと
を比較することにより、当該ストライプの最終ブロック
の復号が終了したかを判定する。ここで、まだの場合は
ステップS202に戻り、上述のストライプの復号処理
を繰り返す。また、終了した場合はステップS214に
進み、1ページの復号処理が終了したことをバッファ制
御部6に通知する。
On the other hand, when the processing ends in step S209, the flow advances to step S211 to invert the contents of the buffer selection variable sw and change the line buffer to be used in the future. Then, in step S212, 1 is added to the block number b, and in step S213, the number of blocks per stripe X uniquely determined according to a predetermined image size is compared with the block number b, thereby obtaining the last block of the stripe. It is determined whether the decryption has been completed. Here, if not, the process returns to step S202, and the above-described stripe decoding process is repeated. If the decoding has been completed, the process proceeds to step S214, and the buffer controller 6 is notified that the decoding process for one page has been completed.

【0078】図10は、図7に示す符号情報を用いてオ
リジナル画像を180°回転させた画像を復元する復号
処理を表わしたフローチャートである。まずステップS
101において、バッファ選択sw=0、ストライプカ
ウンタs=Y、ブロックカウンタb=1に各変数を初期
化する。尚、「Y」は最終ストライプの番号である。そ
して、ステップS302に進み、選択したバッファが復
元画像を格納できる状態にあるか判定し、その状態にな
い場合は待ち合わせる。バッファの準備ができるとステ
ップS303に進み、復号対象であるブロック[s,
b]の符号長情報をCNT[s,b]から読み出し、変
数cに代入する。そして、ステップS304において、
復号対象であるストライプsの符号が格納されている蓄
積メモリ9のアドレス情報をADD[s]から読み出
し、変数pに代入する。
FIG. 10 is a flowchart showing a decoding process for restoring an image obtained by rotating the original image by 180 ° using the code information shown in FIG. First, step S
At 101, each variable is initialized to a buffer selection sw = 0, a stripe counter s = Y, and a block counter b = 1. “Y” is the number of the last stripe. Then, the process proceeds to step S302, where it is determined whether the selected buffer is in a state where the restored image can be stored. If not, the process waits. When the buffer is ready, the process proceeds to step S303, and the block [s,
The code length information of [b] is read from CNT [s, b] and substituted into a variable c. Then, in step S304,
The address information of the storage memory 9 in which the code of the stripe s to be decoded is stored is read from ADD [s] and substituted for the variable p.

【0079】次に、ステップS305において、次ブロ
ックの復号に備えてADD[s]の内容をp+cの値に
更新する。そして、ステップS306でブロック[s,
b]の復号処理を行い、16画素×16画素の画像に復
元する。復号処理が終了するとステップS307に進
み、復元結果の画像をラインバッファBUF[sw]に
主走査方向とは逆に右詰めで格納し、続くステップS3
08でブロック番号bに1加算する。そして、ステップ
S309で、所定の画像サイズに応じて一義的に定まる
ストライプ当りのブロック数Xとブロック番号bとを比
較することにより、当該ストライプの最終ブロックの復
号が終了したかを判定する。ここで、まだの場合はステ
ップS303に戻り、上述の復号処理を繰り返す。
Next, in step S305, the contents of ADD [s] are updated to the value of p + c in preparation for decoding of the next block. Then, in step S306, the block [s,
b] to restore an image of 16 × 16 pixels. Upon completion of the decoding processing, the flow advances to step S307 to store the restored image in the line buffer BUF [sw], right-justified in the opposite direction to the main scanning direction, and then to step S3.
At 08, 1 is added to the block number b. Then, in step S309, it is determined whether decoding of the last block of the stripe is completed by comparing the block number b per stripe with the block number b uniquely determined according to the predetermined image size. Here, if not, the process returns to step S303, and the above-described decoding process is repeated.

【0080】一方、ステップS309で終了した場合は
ステップS310に進み、バッファ選択変数swの内容
を反転させて次回使用するラインバッファを変更する。
そして、ステップS311でストライプ番号sから1減
算し、ステップS312でストライプ番号が“0”か判
定する。ここで、まだ全ストライプを復号し終えていな
い時はステップS302に戻り、上述のストライプの復
号処理を再実行する。また、終了したらステップS31
3に進み、1ページの復号処理が終了したことをバッフ
ァ制御部6に通知する。
On the other hand, if the processing is ended in step S309, the flow advances to step S310 to change the line buffer used next time by inverting the contents of the buffer selection variable sw.
Then, 1 is subtracted from the stripe number s in step S311, and it is determined whether the stripe number is "0" in step S312. Here, if all stripes have not been decoded yet, the process returns to step S302, and the above-described stripe decoding process is executed again. When the processing is completed, step S31 is performed.
Proceeding to step 3, the buffer control unit 6 is notified that the decoding process for one page has been completed.

【0081】図11は、ラインバッファ7a、7bに格
納された画像の1ページを印刷する処理を行う、図1に
示す印刷部5の動作フローチャートである。まずステッ
プS401において、使用するラインバッファの選択フ
ラグpswを“0”に初期化する。尚、pswは、
“0”又は“1”の値を待つ。そして、ステップS40
2に進み、記録用紙を印刷開始位置まで搬送する。次
に、ステップS403で印刷対象のラインバッファBU
F[psw]に印刷すべき画像データが格納されている
かを判断する。ここで、画像データが準備されている場
合はステップS404に進み、ラインバッファBUF
[psw]から画像データを読み出し、16ラインの印
刷を実行する。そして、ステップS405では使用する
ラインバッファの選択フラグpswの値を反転する。
FIG. 11 is a flowchart showing the operation of the printing unit 5 shown in FIG. 1 for performing processing for printing one page of the image stored in the line buffers 7a and 7b. First, in step S401, the selection flag psw of the line buffer to be used is initialized to “0”. In addition, psw is
Wait for a value of “0” or “1”. Then, step S40
Proceed to 2 to transport the recording paper to the printing start position. Next, in step S403, the line buffer BU to be printed is
It is determined whether image data to be printed is stored in F [psw]. If the image data has been prepared, the process proceeds to step S404, and the line buffer BUF
The image data is read from [psw] and printing of 16 lines is executed. Then, in step S405, the value of the selection flag psw of the line buffer to be used is inverted.

【0082】一方、ステップS403で、画像データが
準備されていなければステップS406に進み、1ペー
ジの印刷動作の終了かを判定する。ここで、終了でなけ
ればステップS403に戻り、終了であれば印刷した記
録用紙を排出し、1ページの印刷動作を終了する。
On the other hand, if it is determined in step S403 that the image data has not been prepared, the flow advances to step S406 to determine whether the printing operation of one page is completed. If not, the process returns to step S403. If the process is completed, the printed recording paper is discharged, and the printing operation for one page is completed.

【0083】図12は、画素データを回転処理する回路
の構成を示す図である。本実施形態では、1ブロックを
16画素×16画素としているが、ここでは説明の簡略
化のため、2画素×2画素を選択的に0°/90°/1
80°/270°の何れかの角度に回転して出力する場
合を例として説明する。これを16画素×16画素に拡
張することは、容易に推測できるであろう。
FIG. 12 is a diagram showing a configuration of a circuit for rotating pixel data. In the present embodiment, one block is 16 pixels × 16 pixels, but here, for simplification of description, 2 pixels × 2 pixels are selectively set to 0 ° / 90 ° / 1.
An example in which the output is rotated at any angle of 80 ° / 270 ° will be described. It would be easy to guess to extend this to 16 × 16 pixels.

【0084】まず、入力信号として、Di1,Di0は
2ビットの画素データ及び回転角度を選択するデータの
データ入力信号、nCSは本回路のデータ入出力動作を
有効とする負論理のセレクト信号、nWRは入力データ
Di1,Di0の書き込みを行う負論理のライト信号、
nRD=出力データDo1,Do0の読み出しを行う負
論理のリード信号、A1,A0はデータ入出力の対象を
選択するアドレス信号である。そして、出力信号として
Do1,Do0は回転処理結果の画素データの出力信号
である。
First, as input signals, Di1 and Di0 are data input signals of 2-bit pixel data and data for selecting a rotation angle, nCS is a negative logic select signal for validating the data input / output operation of this circuit, and nWR. Is a negative logic write signal for writing the input data Di1, Di0,
nRD = negative logic read signal for reading output data Do1 and Do0, and A1 and A0 are address signals for selecting data input / output targets. Do1 and Do0 as output signals are output signals of pixel data as a result of the rotation processing.

【0085】また、回路ブロックとして101は2to
4のデコーダであり、図13に示す真理値表の機能を持
つ。102〜104は2ビットのDフリップフロップで
あり、クロックCKの立ち上がりエッジで、入力端子D
1/D0の状態をラッチし、出力端子Q1/Q0に出力
する。105は図14に示す真理値表の機能を持ったセ
レクタであり、選択入力端子S1/S0の状態に応じて
各々4ビットの4種類のデータ入力端子D*0/D*1
/D*2/D*3の何れかを選択し、出力端子Q*に出
力する。
The circuit block 101 is 2 to
4 has the function of the truth table shown in FIG. Reference numerals 102 to 104 denote 2-bit D flip-flops, which have input terminals D at the rising edge of the clock CK.
The state of 1 / D0 is latched and output to output terminals Q1 / Q0. Reference numeral 105 denotes a selector having the function of the truth table shown in FIG. 14, and four types of four-bit data input terminals D * 0 / D * 1 according to the states of the selection input terminals S1 / S0.
/ D * 2 / D * 3 is selected and output to the output terminal Q *.

【0086】106は図15に示す真理値表の機能を持
ったセレクタであり、選択入力端子SELの状態に応じ
て各々2ビットの2種類のデータ入力端子D*0/D*
1の何れかを選択し、出力端子Y*に出力する。107
は3入力のNORゲートである。そして、108a,1
08bは「1」、「0」、「ハイインピーダンス」の3
つの出力状態を持つ出力バッファである。
Reference numeral 106 denotes a selector having the function of the truth table shown in FIG. 15, and two types of two-bit data input terminals D * 0 / D * according to the state of the selection input terminal SEL.
1 is selected and output to the output terminal Y *. 107
Is a 3-input NOR gate. And 108a, 1
08b is 3 of “1”, “0”, and “high impedance”.
An output buffer with two output states.

【0087】次に、上述の回転処理回路の動作について
説明する。図16は、本回路の動作を説明するための図
である。まず入力画素pix00,pix01,pix
10,pix11の4画素は、Dフリップフロップ10
4にラッチされた回転角度選択データ(S1,S0)に
従って位置関係が変えられ、出力端子Do1/Do0か
ら読み出される。以下、90°回転を行う場合を例にそ
の動作を説明する。 (1)nCS=0,A1=0,A0=0の状態でnWR
に負パルスを加えることにより、Di1/Di0の状態
が最初の2画素pix01,pix00としてDフリッ
プフロップ102にラッチされる。 (2)nCS=0,A1=0,A0=1の状態でnWR
に負パルスを加えることにより、Di1/Di0の状態
が次の2画素pix11,pix10としてDフリップ
フロップ103にラッチされる。 (3)nCS=0,A1=1,A0=1の状態でnWR
に負パルスを加えることにより、Di1/Di0の状態
が回転角度選択データとしてDフリップフロップ104
にラッチされる。ここでは、90°回転の場合なのでD
フリップフロップ104に「01」をセットする。 (4)セレクタ105の選択入力S1/S0には、Dフ
リップフロップ104の出力が接続されているので、図
14に示す真理値表に従ってセレクタ105から4ビッ
トの出力データが出力される。
Next, the operation of the above-described rotation processing circuit will be described. FIG. 16 is a diagram for explaining the operation of this circuit. First, input pixels pix00, pix01, pix
10 and pix11 are D flip-flops 10
The positional relationship is changed in accordance with the rotation angle selection data (S1, S0) latched in No. 4 and read out from the output terminals Do1 / Do0. Hereinafter, the operation will be described by taking a case of performing a 90 ° rotation as an example. (1) nWR with nCS = 0, A1 = 0, A0 = 0
, A D1 flip-flop 102 latches the state of Di1 / Di0 as the first two pixels pix01 and pix00. (2) nWR with nCS = 0, A1 = 0 and A0 = 1
, A D1 flip-flop 103 latches the state of Di1 / Di0 as the next two pixels pix11 and pix10. (3) nWR with nCS = 0, A1 = 1, A0 = 1
By applying a negative pulse to the D flip-flop 104 as the rotation angle selection data.
Latched. Here, since it is a case of 90 ° rotation, D
“01” is set in the flip-flop 104. (4) Since the output of the D flip-flop 104 is connected to the selection input S1 / S0 of the selector 105, 4-bit output data is output from the selector 105 according to the truth table shown in FIG.

【0088】Qd=Dd1=pix10,Qc=Dc1
=pix00,Qb=Db1=pix11,Qa=Da
1=pix01, (5)nCS=0,A1=0,A0=0の状態でnRD
に負パルスを加えることにより、セレクタ106の2つ
の出力端子には、図15に示す真理値表に従ってDb0
/Da0側、即ち、pix11/pix01が出力さ
れ、出力バッファ108b/108aを介して外部出力
端子Do1/Do0に読み出される。 (6)nCS=0,A1=0,A0=1の状態でnRD
に負パルスを加えることにより、セレクタ106の2つ
の端子には、図15に示す真理値表に従ってDb1/D
a1側、即ち、pix10/pix00が出力され、出
力バッファ108b/108aを介して外部出力端子D
o1/Do0に読み出される。
Qd = Dd1 = pix10, Qc = Dc1
= Pix00, Qb = Db1 = pix11, Qa = Da
1 = pix01, (5) nRD with nCS = 0, A1 = 0, A0 = 0
, A negative pulse is applied to two output terminals of the selector 106 according to the truth table shown in FIG.
/ Da0 side, that is, pix11 / pix01 is output and read out to the external output terminals Do1 / Do0 via the output buffers 108b / 108a. (6) nRD with nCS = 0, A1 = 0 and A0 = 1
, A negative pulse is applied to two terminals of the selector 106 according to the truth table shown in FIG.
a1, that is, pix10 / pix00 is output, and the external output terminal D is output via the output buffers 108b / 108a.
o1 / Do0.

【0089】以上の結果として、2画素×2画素のpi
x00,pix10,pix11は、図17に示す位置
関係に変換される。
As a result of the above, pi of 2 × 2 pixels
x00, pix10, and pix11 are converted into the positional relationship shown in FIG.

【0090】[他の実施形態]前述した実施形態では、
右90°回転と180°回転の実現方法を述べたが、他
の実施形態として、符号化された画像を左90°に回転
する場合の実現方法を説明する。
[Other Embodiments] In the above embodiment,
Although the method of realizing the right 90 ° rotation and the 180 ° rotation has been described, as another embodiment, a method of realizing the case where the encoded image is rotated to the left 90 ° will be described.

【0091】図18は、画像を左90°回転させる場合
の概念を示す図である。同図に示す上部が回転前の画像
PIX(0)、下部が左90°回転後の画像PIX(2
70)であり、共に紙面向かって左から右方向を主走査
方向とする。
FIG. 18 is a diagram showing the concept of rotating an image by 90 degrees to the left. The upper part shown in the figure is the image PIX (0) before rotation, and the lower part is the image PIX (2) after rotating 90 °
70), and the main scanning direction is from left to right with respect to the page.

【0092】図示するように、PIX(270)では、
最初のストライプにブロック番号Xを並べなければなら
ない。しかしながら、前述した実施形態で説明したよう
に、ストライプアドレス情報ADD[s]は第1ブロッ
クのアドレス情報であるため、前述の90°回転、18
0°回転とは、多少異なる処理が必要となる。
As shown, in PIX (270),
The block number X must be arranged on the first stripe. However, as described in the above-described embodiment, the stripe address information ADD [s] is the address information of the first block.
Processing slightly different from 0 ° rotation is required.

【0093】まず、ストライプアドレス情報として、前
述した実施形態では最終ストライプのストライプアドレ
ス情報ADD[Y]までしかなかったが、この実施形態
ではこれに加え、ブロック[Y,X]を符号化して格納
した最終アドレスの次のアドレス情報を必要とする。こ
れをADD[Y+1]と称する。一方、ADD[1]の
情報は必要なくなる。基本的な復号手順としては、ブロ
ック[s,b]を復号するためにADD[s+1]から
CNT[s,b]を減算し、その結果をアドレスポイン
タpとして用い、ADD[s+1]に格納する。
First, as the stripe address information, only the last stripe address information ADD [Y] is provided in the above-described embodiment, but in addition to this, the block [Y, X] is encoded and stored. The next address information after the last address is required. This is called ADD [Y + 1]. On the other hand, the information of ADD [1] becomes unnecessary. As a basic decoding procedure, CNT [s, b] is subtracted from ADD [s + 1] to decode block [s, b], and the result is used as address pointer p and stored in ADD [s + 1]. .

【0094】図19は、左90°回転の復号処理を示す
フローチャートである。まずステップS501におい
て、バッファ選択sw=0、ストライプカウンタs=
1、ブロックカウンタb=Xに各変数を初期化する。そ
して、ステップS502に進み、選択したバッファが復
元画像を格納できる状態にあるか判定し、その状態にな
い場合は待ち合わせる。バッファの準備ができるとステ
ップS503に進み、復号対象であるブロック[s,
b]の符号長情報をCNT[s,b]から読み出し、変
数cに代入する。そして、ステップS504において、
復号対象であるストライプsの次のストライプのアドレ
ス情報ADD[s+1]から変数cを減算し、変数pに
代入する。
FIG. 19 is a flow chart showing the decoding processing of the 90-degree left rotation. First, in step S501, the buffer selection sw = 0 and the stripe counter s =
1. Initialize each variable to a block counter b = X. Then, the process proceeds to step S502, where it is determined whether the selected buffer is in a state capable of storing the restored image. If not, the process waits. When the buffer is ready, the process proceeds to step S503, and the block [s,
The code length information of [b] is read from CNT [s, b] and substituted into a variable c. Then, in step S504,
The variable c is subtracted from the address information ADD [s + 1] of the stripe next to the stripe s to be decoded, and is substituted for the variable p.

【0095】次に、ステップS505において、次ブロ
ックの復号に備えてADD[s+1]にpの値を格納す
る。そして、ステップS506でブロック[s,b]の
復号処理を行い、16画素×16画素の画像に復元す
る。次に、ステップS507において、復元した16画
素×16画素の画像を左方向に90°回転処理を行う。
そして、ステップS508で復元回転結果の画像をライ
ンバッファBUF[sw]に主走査方向と同様に左詰め
で格納し、ステップS509でストライプ番号sを1加
算する。次に、ステップS510において、符号化時の
ストライプ数Yとストライプ番号sとを比較し、まだ最
終ストライプを復号し終えていない時はステップS50
3に戻り、次のストライプの同番号のブロックの復号処
理を実行する。
Next, in step S505, the value of p is stored in ADD [s + 1] in preparation for decoding of the next block. Then, in step S506, the decoding process of the block [s, b] is performed to restore an image of 16 pixels × 16 pixels. Next, in step S507, the restored 16-pixel × 16-pixel image is rotated 90 ° to the left.
Then, in step S508, the restored rotation result image is stored left-justified in the line buffer BUF [sw] in the same manner as in the main scanning direction, and the stripe number s is incremented by 1 in step S509. Next, in step S510, the number of stripes Y at the time of encoding is compared with the stripe number s, and if the final stripe has not been decoded yet, step S50.
Then, the process returns to step S3, and the decoding processing of the same numbered block of the next stripe is executed.

【0096】一方、ステップS510で終了するとステ
ップS511に進み、バッファ選択変数swの内容を反
転させて今後使用するラインバッファを変更する。そし
て、ステップS512でブロック番号bから1減算し、
ステップS513でブロック番号bが“0”に達したか
を判定する。ここで、まだの場合はステップS502に
戻る。一方、終了した場合はステップS514に進み、
1ページの復号処理が終了したことをバッファ制御部6
に通知する。
On the other hand, when the processing ends in step S510, the flow advances to step S511 to invert the contents of the buffer selection variable sw to change the line buffer to be used in the future. Then, in step S512, 1 is subtracted from the block number b,
In step S513, it is determined whether the block number b has reached “0”. Here, if not, the process returns to step S502. On the other hand, if the processing has been completed, the process proceeds to step S514,
The completion of the decoding process for one page is notified by the buffer controller 6.
Notify.

【0097】実施形態においては、各ブロックの符号化
方式として特に言及していないが、ファクシミリ装置で
一般的に用いられているMH,MR,MMR等の符号化
方式を用いることも可能である。しかしながら、通常の
ライン単位での符号化に比べて圧縮率は悪化する。圧縮
率の観点からは、ITU−T勧告T82に規定された
「算術符号」が特に優れている。この方式は符号の単位
がバイトである点からも扱いやすい。
In the embodiment, although no particular mention is made of the coding method of each block, coding methods such as MH, MR, and MMR generally used in facsimile apparatuses can be used. However, the compression ratio is deteriorated as compared with the normal line-by-line coding. From the viewpoint of the compression ratio, the “arithmetic code” defined in ITU-T recommendation T82 is particularly excellent. This method is easy to handle because the code unit is bytes.

【0098】また、何れの符号化方式を用いる場合にお
いても、本発明の主眼とする「回転処理に要するメモリ
容量を削減する」点については同様の効果が得られるこ
とは明らかである。
It is apparent that the same effect can be obtained regardless of which encoding method is used, with respect to "reducing the memory capacity required for rotation processing", which is the main feature of the present invention.

【0099】符号化において、本発明を実施する場合に
必要な条件は、各ブロックの独立性を確保しなければな
らないという点である。即ち、周辺画素を参照して注目
画素を符号化する場合、参照画素が当該ブロックの中に
存在しないときは、隣接するブロックの実際の画素を参
照せず、仮想の参照画素を設定しなければならない。ブ
ロックの符号化において、全画素が「白」であるブロッ
クは、符号長情報=「0」、符号情報=無しで表現す
る。
In encoding, a necessary condition for implementing the present invention is that the independence of each block must be ensured. That is, when the target pixel is encoded with reference to the surrounding pixels, if the reference pixel does not exist in the block, the virtual pixel is not set without referring to the actual pixel of the adjacent block. No. In block coding, a block in which all pixels are “white” is represented by code length information = “0” and code information = none.

【0100】これにより、文書画像で発生確率の高い白
地部分の符号化圧縮率を向上させることができると共
に、符号化及び復号化の処理速度を早くすることができ
る。
As a result, it is possible to improve the coding compression ratio of a white background portion having a high probability of occurrence in a document image, and to increase the processing speed of coding and decoding.

【0101】尚、本発明は複数の機器(例えば、ホスト
コンピュータ,インタフェイス機器,リーダ,プリンタ
など)から構成されるシステムに適用しても、一つの機
器からなる装置(例えば、複写機,ファクシミリ装置な
ど)に適用してもよい。
The present invention can be applied to a system composed of a plurality of devices (for example, a host computer, an interface device, a reader, a printer, and the like), and can be applied to a single device (for example, a copier, a facsimile). Device).

【0102】また、本発明の目的は前述した実施形態の
機能を実現するソフトウェアのプログラムコードを記録
した記憶媒体を、システム或いは装置に供給し、そのシ
ステム或いは装置のコンピュータ(CPU若しくはMP
U)が記憶媒体に格納されたプログラムコードを読出し
実行することによっても、達成されることは言うまでも
ない。
An object of the present invention is to supply a storage medium storing a program code of software for realizing the functions of the above-described embodiments to a system or an apparatus, and to provide a computer (CPU or MP) of the system or apparatus.
It goes without saying that U) can also be achieved by reading and executing the program code stored in the storage medium.

【0103】この場合、記憶媒体から読出されたプログ
ラムコード自体が前述した実施形態の機能を実現するこ
とになり、そのプログラムコードを記憶した記憶媒体は
本発明を構成することになる。
In this case, the program code itself read from the storage medium realizes the functions of the above-described embodiment, and the storage medium storing the program code constitutes the present invention.

【0104】プログラムコードを供給するための記憶媒
体としては、例えばフロッピーディスク,ハードディス
ク,光ディスク,光磁気ディスク,CD−ROM,CD
−R,磁気テープ,不揮発性のメモリカード,ROMな
どを用いることができる。
As a storage medium for supplying the program code, for example, a floppy disk, hard disk, optical disk, magneto-optical disk, CD-ROM, CD
-R, a magnetic tape, a nonvolatile memory card, a ROM, or the like can be used.

【0105】また、コンピュータが読出したプログラム
コードを実行することにより、前述した実施形態の機能
が実現されるだけでなく、そのプログラムコードの指示
に基づき、コンピュータ上で稼働しているOS(オペレ
ーティングシステム)などが実際の処理の一部又は全部
を行い、その処理によって前述した実施形態の機能が実
現される場合も含まれることは言うまでもない。
When the computer executes the readout program code, not only the functions of the above-described embodiment are realized, but also the OS (Operating System) running on the computer based on the instruction of the program code. ) May perform some or all of the actual processing, and the processing may realize the functions of the above-described embodiments.

【0106】更に、記憶媒体から読出されたプログラム
コードが、コンピュータに挿入された機能拡張ボードや
コンピュータに接続された機能拡張ユニットに備わるメ
モリに書込まれた後、そのプログラムコードの指示に基
づき、その機能拡張ボードや機能拡張ユニットに備わる
CPUなどが実際の処理の一部又は全部を行い、その処
理によって前述した実施形態の機能が実現される場合も
含まれることは言うまでもない。
Further, after the program code read from the storage medium is written into a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer, based on the instructions of the program code, It goes without saying that the CPU included in the function expansion board or the function expansion unit performs part or all of the actual processing, and the functions of the above-described embodiments are realized by the processing.

【0107】[0107]

【発明の効果】以上説明したように、本発明によれば、
画像を回転処理する場合に必要とする画像を画素データ
として記憶するメモリの容量を最低限1ストライプ分、
スループットの向上を考慮しても最低限2ストライプ分
だけに減少させることが可能となり、装置コストの大幅
な削減を可能とする。
As described above, according to the present invention,
The capacity of a memory for storing an image required when rotating an image as pixel data is at least one stripe.
Even if the improvement of the throughput is taken into consideration, it is possible to reduce the number of stripes to at least two stripes, and it is possible to greatly reduce the apparatus cost.

【0108】図20は、A4画像を90°回転する場合
を従来のビットマップ方式と本発明のブロック方式とで
必要となるメモリ容量を比較したものである。このよう
に、対象とする画像の解像度が高くなればなるほど、こ
のメモリ削減のコスト効果は非常に大きなものとなる。
FIG. 20 is a comparison of the memory capacity required between the conventional bitmap system and the block system of the present invention when the A4 image is rotated by 90 °. Thus, the higher the resolution of the target image, the greater the cost effectiveness of this memory reduction.

【0109】尚、本発明のブロック方式では、ブロック
サイズを16画素×16画素、ストライプメモリがA3
幅16ライン×2を持つ場合を想定している。
In the block method of the present invention, the block size is 16 pixels × 16 pixels, and the stripe memory is A3.
It is assumed that there is a width of 16 lines × 2.

【0110】[0110]

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

【図1】本実施形態における複合装置の構成を示すブロ
ック図である。
FIG. 1 is a block diagram illustrating a configuration of a multifunction peripheral according to an embodiment.

【図2】90°回転処理の前後の画像ストライプとブロ
ック各々の位置関係を示した図である。
FIG. 2 is a diagram illustrating a positional relationship between an image stripe and a block before and after a 90 ° rotation process;

【図3】180°回転処理の前後の画像ストライプとブ
ロック各々の位置関係を示した図である。
FIG. 3 is a diagram illustrating a positional relationship between an image stripe and a block before and after a 180 ° rotation process;

【図4】読取部2の原稿読み取り動作を説明するフロー
チャートである。
FIG. 4 is a flowchart illustrating an original reading operation of the reading unit 2.

【図5】符号化部3の符号化動作を説明するフローチャ
ートである。
FIG. 5 is a flowchart illustrating an encoding operation of the encoding unit 3.

【図6】符号の格納処理を示すフローチャートである。FIG. 6 is a flowchart illustrating a code storing process.

【図7】蓄積メモリ9に格納される3種類の符号情報を
説明する概念図である。
FIG. 7 is a conceptual diagram illustrating three types of code information stored in a storage memory 9;

【図8】蓄積メモリ9に格納された符号画像を原画像の
方向のまま復号する動作を説明する復号化部4のフロー
チャートである。
FIG. 8 is a flowchart of the decoding unit 4 for explaining an operation of decoding a code image stored in the storage memory 9 in the original image direction.

【図9】蓄積メモリ9に格納された符号画像を90°回
転した画像に復元する動作を説明する復号化部4のフロ
ーチャートである。
FIG. 9 is a flowchart of the decoding unit 4 for explaining an operation of restoring a code image stored in the storage memory 9 into an image rotated by 90 °.

【図10】蓄積メモリ9に格納された符号画像を180
°回転した画像に復元する動作を説明する復号化部4の
フローチャートである。
FIG. 10 shows a case where the code image stored in the storage memory 9 is 180.
35 is a flowchart of the operation of the decoding unit 4 for describing an operation of restoring a rotated image.

【図11】画像を印刷する動作を説明する印刷部5の動
作フローチャートである。
FIG. 11 is an operation flowchart of the printing unit 5 for explaining an operation of printing an image.

【図12】2画素×2画素のマトリックス画像を選択的
に0°,90°,180°,27°回転処理して出力す
る回路の構成を示す図である。
FIG. 12 is a diagram showing a configuration of a circuit for selectively rotating a matrix image of 2 pixels × 2 pixels by 0 °, 90 °, 180 °, and 27 ° and outputting the result;

【図13】図12におけるデコーダ101の真理値表を
示す図である。
13 is a diagram showing a truth table of the decoder 101 in FIG.

【図14】図12におけるセレクタ105の真理値表を
示す図である。
FIG. 14 is a diagram showing a truth table of a selector 105 in FIG. 12;

【図15】図12におけるセレクタ106の真理値表を
示す図である。
FIG. 15 is a diagram showing a truth table of a selector 106 in FIG. 12;

【図16】図12に示す回路の動作を説明するための図
である。
FIG. 16 is a diagram for explaining the operation of the circuit shown in FIG.

【図17】2画素×2画素のマトリックスを90°回転
させた状態を示す図である。
FIG. 17 is a diagram showing a state in which a matrix of 2 pixels × 2 pixels is rotated by 90 °.

【図18】左90°回転処理の前後の、画像のストライ
プとブロック各々の位置関係を示す図である。
FIG. 18 is a diagram illustrating a positional relationship between an image stripe and a block before and after a left 90 ° rotation process;

【図19】蓄積メモリ9に格納された符号画像を左90
°回転した画像に復元する動作を説明する復号化部4の
フローチャートである。
FIG. 19 shows a code image stored in the storage memory 9 at 90 left
35 is a flowchart of the operation of the decoding unit 4 for describing an operation of restoring a rotated image.

【図20】A4画像を90°回転する場合の従来のビッ
トマップ方式と本発明のブロック方式とで必要となるメ
モリ容量を比較する図である。
FIG. 20 is a diagram comparing the memory capacities required for the conventional bitmap method and the block method according to the present invention when the A4 image is rotated by 90 °.

【図21】複写機における原稿の読み取り/記録の主走
査方向を示す図である。
FIG. 21 is a diagram illustrating a main scanning direction of reading / recording of a document in a copying machine.

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 原稿をライン単位で読み取る読取手段
と、 前記読取手段により読み取った画素データを少なくとも
mライン分格納可能な格納手段と、 前記格納手段に格納された画素データを符号化する符号
化手段と、 前記符号化手段により符号化された符号データを複数ペ
ージ分蓄積可能な蓄積手段とを備え、 前記符号化手段は、前記格納手段に格納されたmライン
の画素データを主走査方向にn画素毎のブロックに分割
し、各ブロック単位で符号化を行うことを特徴とする画
像処理装置。
A reading unit that reads a document in line units; a storage unit that can store at least m lines of pixel data read by the reading unit; and an encoding unit that encodes the pixel data stored in the storage unit. Means, and accumulating means capable of accumulating code data encoded by the encoding means for a plurality of pages, wherein the encoding means stores the m-line pixel data stored in the storage means in the main scanning direction. An image processing apparatus which divides an image into blocks of n pixels and performs encoding on a block basis.
【請求項2】 前記符号化手段は、符号化結果として、
各ブロックの画像を圧縮符号化した符号情報と、該符号
情報の量を表わす符号長情報と、最初のブロックの符号
情報を前記蓄積手段に蓄積した位置を示すアドレス情報
とを生成することを特徴とする請求項1記載の画像処理
装置。
2. The encoding means as an encoding result,
Code information obtained by compressing and encoding the image of each block, code length information indicating the amount of the code information, and address information indicating the position where the code information of the first block is stored in the storage means are generated. The image processing apparatus according to claim 1.
【請求項3】 前記蓄積手段に蓄積された符号データを
ブロック単位で復号する復号化手段と、 前記復号化手段により復元されたm画素×n画素の画素
データを90°単位で回転させた画素配列に変換するブ
ロック回転処理手段とを更に備え、 前記復号化手段は、指定された復元画像の回転角度に応
じて前記符号化手段で符号化した順序とは異なる所定の
順序で各ブロックを復号し、前記ブロック回転処理手段
も前記指定された復元画像の回転角度に応じた画素配列
への変換処理を行い、順次回転方向に応じた所定の方向
から前記格納手段に格納し、n又はmラインの画素デー
タを順次作成することを特徴とする請求項1記載の画像
処理装置。
3. A decoding means for decoding the code data stored in the storage means in units of blocks, and a pixel obtained by rotating the pixel data of m pixels × n pixels reconstructed by the decoding means in units of 90 °. And a block rotation processing unit for converting the data into an array, wherein the decoding unit decodes each block in a predetermined order different from the order of encoding by the encoding unit according to a designated rotation angle of the restored image. The block rotation processing unit also performs a conversion process into a pixel array corresponding to the rotation angle of the specified restored image, sequentially stores the converted image in the storage unit from a predetermined direction corresponding to the rotation direction, and stores n or m lines. 2. The image processing apparatus according to claim 1, wherein the pixel data is sequentially created.
【請求項4】 順次作成されたn又はmラインの画素デ
ータを入力し、記録媒体に印刷する印刷手段を更に備
え、 所定の角度に回転させた1ページ分の画像を印刷するこ
とを特徴とする請求項3記載の画像処理装置。
4. A printing means for inputting pixel data of n or m lines sequentially created and printing it on a recording medium, wherein an image for one page rotated by a predetermined angle is printed. The image processing apparatus according to claim 3, wherein:
【請求項5】 順次作成されたn又はmラインの画素デ
ータを入力し、ライン順次に送信宛先に応じて所定の符
号化を行う第2の符号化手段と、前記第2の符号化手段
により符号化されたデータを送信する通信手段とを更に
備え、 所定の角度に回転させた1ページ分の画像を送信するこ
とを特徴とする請求項3記載の画像処理装置。
5. A second encoding unit which receives sequentially created n or m lines of pixel data and performs predetermined encoding in line order according to a transmission destination, and a second encoding unit. The image processing apparatus according to claim 3, further comprising a communication unit that transmits the encoded data, wherein the image processing unit transmits an image of one page rotated by a predetermined angle.
【請求項6】 原稿をライン単位で読み取り、 読み取った画素データを少なくともmライン分の格納手
段に格納し、 格納されたmラインの画素データを主走査方向にn画素
毎のブロックに分割し、各ブロック単位で符号化し、 符号データをブロック単位で復号し、 復元されたm画素×n画素の画素データを90°単位で
回転させ、 指定された復元画像の回転角度に応じて、符号化順序と
は異なる所定の順序で各ブロックを復号し、前記指定さ
れた復元画像の回転角度に応じた画素配列への変換処理
を行い、順次回転方向に応じた所定の方向から格納し、
n又はmラインの画素データを順次作成することを特徴
とする画像処理方法。
6. A document is read line by line, read pixel data is stored in at least m lines of storage means, and the stored m lines of pixel data are divided into blocks of n pixels in the main scanning direction. Encode each block, decode the coded data in block units, rotate the restored m-pixel x n-pixel data in units of 90 °, and specify the encoding order according to the specified rotation angle of the restored image. Decode each block in a predetermined order different from the above, perform a conversion process to a pixel array according to the rotation angle of the specified restored image, sequentially store from a predetermined direction according to the rotation direction,
An image processing method characterized by sequentially creating pixel data of n or m lines.
JP8243180A 1996-09-13 1996-09-13 Picture processing method and picture processor Pending JPH1093805A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8243180A JPH1093805A (en) 1996-09-13 1996-09-13 Picture processing method and picture processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8243180A JPH1093805A (en) 1996-09-13 1996-09-13 Picture processing method and picture processor

Publications (1)

Publication Number Publication Date
JPH1093805A true JPH1093805A (en) 1998-04-10

Family

ID=17100018

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8243180A Pending JPH1093805A (en) 1996-09-13 1996-09-13 Picture processing method and picture processor

Country Status (1)

Country Link
JP (1) JPH1093805A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7742199B2 (en) 2004-10-06 2010-06-22 Kabushiki Kaisha Toshiba System and method for compressing and rotating image data
JP2011193279A (en) * 2010-03-15 2011-09-29 Canon Inc Image processing apparatus, image processing method, and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7742199B2 (en) 2004-10-06 2010-06-22 Kabushiki Kaisha Toshiba System and method for compressing and rotating image data
JP2011193279A (en) * 2010-03-15 2011-09-29 Canon Inc Image processing apparatus, image processing method, and program

Similar Documents

Publication Publication Date Title
JP3240638B2 (en) Image processing device
JP2000165656A (en) Image processing method, image combining method, image forming method, image processing system, image combining system and image forming system
US6411394B1 (en) Image signal processing apparatus and information transmission/reception apparatus using the same
US5193169A (en) Image data processing apparatus
JP3148103B2 (en) Image forming device
US5345316A (en) Image data encoding/decoding apparatus for concurrent processing of multiple image data streams
JP4136022B2 (en) Buffer memory control device
JP2000184157A (en) Digital copying machine
EP0868069A2 (en) Digital multi-functional machine capable of photocopying, printing and transmitting facsimile images
JPH1093805A (en) Picture processing method and picture processor
JP2000151878A (en) Digital copying machine
US7072078B2 (en) Image storage apparatus, image storage method, and storage medium
JP3359977B2 (en) Image forming device
JP3161080B2 (en) facsimile
US5282058A (en) Facsimile device having improved printing process with cut paper
JP2869104B2 (en) Facsimile machine with storage function
JP3213203B2 (en) Facsimile machine
JP4214678B2 (en) Document image reading device
JP3632066B2 (en) Digital image copying system
JPH0563959A (en) Method and device for processing picture
JP2002158810A (en) Image reading/recording device
JP2002185732A (en) Original reading and recording device
JP2000270177A (en) Image processor, image processing method and recording medium
JPH11150647A (en) Image processor, its method and storage medium
JPH11339026A (en) Recording controller and recording control method

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20031107