JPH0774969A - Picture processing method and its device - Google Patents

Picture processing method and its device

Info

Publication number
JPH0774969A
JPH0774969A JP21563993A JP21563993A JPH0774969A JP H0774969 A JPH0774969 A JP H0774969A JP 21563993 A JP21563993 A JP 21563993A JP 21563993 A JP21563993 A JP 21563993A JP H0774969 A JPH0774969 A JP H0774969A
Authority
JP
Japan
Prior art keywords
size
image
block
blocks
reconstructing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP21563993A
Other languages
Japanese (ja)
Inventor
Jiyunichi Shishizuka
順一 宍塚
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 JP21563993A priority Critical patent/JPH0774969A/en
Publication of JPH0774969A publication Critical patent/JPH0774969A/en
Withdrawn legal-status Critical Current

Links

Abstract

PURPOSE:To make it possible to compress/extend blocks even when the size of a picture is not integer times the size of a block. CONSTITUTION:A CPU 101 divides an input picture into blocks each of which has size to be processed by a compressing/extending processor 106 and stores the size of a picture which does not fill a prescribed size out of divided pictures in an identification table prepared in a RAM 102 or the like. A divided block of the prescribed size is stored in a block buffer 106 as it is and a divided block less than the prescribed size is converted into a block of the prescribed size and then stored in the buffer 106. In the case of extending data, compressed data are extended and stored in the block buffer 106, blocks not stored in the identification table are validated as they are, and in the case of blocks stored in the table, only unconverted picture data are validated in accordance with the sizes of converted blocks stored in the table to restore the compressed picture to the picture of the original size.

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 for encoding / decoding an image, for example, when the block encoding is performed and the image size is not an integral multiple of the block size. However, the present invention also relates to an image processing method and apparatus capable of encoding / decoding.

【0002】[0002]

【従来の技術】従来、ブロックの符号化を行なう際に、
符号化できる画像の大きさには制限があった。例えば、
カラー画像の圧縮方式の1つであるJPEGのADCT
方式では、8×8の大きさのブロック毎に処理を行なう
ために、画像サイズは、縦、横共に8の倍数である必要
があった。そのために、100画素×100画素の大き
さの画像は、96×96にするか、104×104に変
換するといった処理を行なわなくてはならなかった。
2. Description of the Related Art Conventionally, when coding a block,
There is a limit to the size of the image that can be encoded. For example,
ADCT of JPEG, which is one of the compression methods for color images
In the system, the image size needs to be a multiple of 8 both vertically and horizontally in order to perform processing for each block of 8 × 8 size. Therefore, an image with a size of 100 pixels × 100 pixels must be processed into 96 × 96 or 104 × 104.

【0003】例えば、A4サイズの原稿分のメモリをも
てないシステムでは、数ラインのバッファを持ち、バッ
ファに画像を貯めては、圧縮することを繰り返して1画
面分の画像データを圧縮する方法が取られる。具体的に
図3に示す様な原稿をスキャナで読み込む際に、図4の
(a)に示す様な読み取り部402が主走査方向(x方
向)に移動して原稿を走査し、次に副走査方向(y方
向)に移動する場合を例として考える。
For example, in a system that does not have a memory for an A4 size document, a method of having a buffer of several lines, storing an image in the buffer and then repeating compression is used to compress image data for one screen. To be Specifically, when reading an original document as shown in FIG. 3 with a scanner, a reading unit 402 as shown in FIG. 4A moves in the main scanning direction (x direction) to scan the original document, and then the sub document. Consider the case of moving in the scanning direction (y direction) as an example.

【0004】図3に示すように、1回目の走査では30
1の部分(以下バンドという)、2回目では302のバ
ンド、という様に、301から310までのバンドを繰
り返し走査する。この場合において、図4の(a)にお
ける401が図3における301のバンドに対応する。
もしここで、バンドの大きさ(x方向、y方向の大き
さ)が8の倍数であれば、そのまま原稿を読み取って、
図4の(b)に示すバッファ403にデータを書き込
み、次にバッファ403に書き込んだデータを8画素×
8画素のブロック圧縮することが可能である。
As shown in FIG. 3, in the first scan, 30
Bands 301 to 310 are repeatedly scanned, such as part 1 (hereinafter referred to as band), band 302 at the second time, and so on. In this case, 401 in FIG. 4A corresponds to the band 301 in FIG.
If the size of the band (the size in the x direction and the y direction) is a multiple of 8, the original is read as it is,
The data written in the buffer 403 shown in FIG.
Block compression of 8 pixels is possible.

【0005】[0005]

【発明が解決しようとする課題】しかしながら、バンド
の大きさ(x方向、y方向の大きさ)が8の倍数でない
場合には、書き込んだデータを8画素×8画素のブロッ
ク圧縮することができなくなってしまう。又は、バンド
の大きさ(x方向、y方向の大きさ)が8の倍数であっ
ても、ここで解像度変換等して画像をバッファ403に
書き込んだ場合には、8の倍数でなくなってしまう可能
性もあり、このような場合にはやはり書き込んだデータ
を8画素×8画素のブロック圧縮することができなくな
ってしまう。
However, when the band size (size in the x direction and y direction) is not a multiple of 8, the written data can be compressed into blocks of 8 pixels × 8 pixels. It's gone. Alternatively, even if the size of the band (the size in the x direction and the y direction) is a multiple of 8, if the image is written in the buffer 403 after resolution conversion or the like here, it will not be a multiple of 8. There is a possibility that the written data cannot be compressed into a block of 8 pixels × 8 pixels.

【0006】[0006]

【課題を解決するための手段】本発明は上述の課題を解
決することを目的としてなされたもので、上述の課題を
解決する一手段として以下の構成を備える。即ち、M×
Nの大きさを持つ画像をm×nの大きさのブロックに分
割処理する分割手段と、該分割手段で分割したm×nに
満たない大きさの画像の大きさを記憶する記憶手段と、
前記分割手段で分割したm×nに満たない大きさの画像
をm×nの大きさに再構成する第1の再構成手段と、前
記分割手段で分割したm×nのブロック及び前記第1の
再構成手段で再構成したm×nのブロックをエンコード
するエンコード手段とを備える。
The present invention has been made for the purpose of solving the above-mentioned problems, and has the following structure as one means for solving the above-mentioned problems. That is, M ×
Dividing means for dividing an image having a size of N into blocks of a size of m × n, and storage means for storing the size of an image of a size less than m × n divided by the dividing means,
First reconstructing means for reconstructing an image of a size less than m × n divided by the dividing means into a size of m × n, m × n blocks divided by the dividing means, and the first And an encoding unit for encoding the m × n blocks reconstructed by the reconstructing unit.

【0007】そして例えば、更に、エンコードした画像
をm×nのブロックにデコードするデコード手段と、第
1の再構成手段で再構成したブロックを識別する識別手
段と、前記記憶手段に記憶された再構成ブロックの大き
さに従って前記デコード手段でデコードした画像を再構
成する第2の再構成手段と、該第2の再構成手段で再構
成した画像をM×Nの大きさの画像に復元する復元手段
とを備える。
Further, for example, further, decoding means for decoding the encoded image into m × n blocks, identification means for identifying the blocks reconstructed by the first reconstructing means, and reconstructing means stored in the storage means are provided. Second reconstruction means for reconstructing the image decoded by the decoding means according to the size of the constituent blocks, and restoration for restoring the image reconstructed by the second reconstruction means to an image of size M × N And means.

【0008】[0008]

【作用】以上の構成において、画像の大きさがブロック
の大きさの整数倍でない時でもエンコードあるいはデコ
ードすることが可能になる。
With the above construction, it is possible to perform encoding or decoding even when the image size is not an integral multiple of the block size.

【0009】[0009]

【実施例】以下、図面を参照して本発明に係る一実施例
を詳細に説明する。本発明に係る一実施例の画像処理装
置のブロック構成を図1に示す。図1において、101
は本実施例装置の全体を制御するためのCPU、102
はランダムアクセスメモリ(RAM)、103はプログ
ラムやデータが格納されているリードオンリメモリ(R
OM)である。また、104はスキャナインターフェイ
スであり、外部のスキャナ151と接続され、スキャナ
151とのインターフェイスを司る。105はスキャナ
151から読み取ったデータを一時的に格納しておくた
めのラインバッファである。ラインバッファ105は、
図4の(b)に示す403に相当する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment according to the present invention will be described in detail below with reference to the drawings. FIG. 1 shows a block configuration of an image processing apparatus according to an embodiment of the present invention. In FIG. 1, 101
Is a CPU for controlling the entire apparatus of this embodiment, 102
Is a random access memory (RAM), 103 is a read only memory (R) in which programs and data are stored.
OM). A scanner interface 104 is connected to an external scanner 151 and controls the interface with the scanner 151. Reference numeral 105 is a line buffer for temporarily storing the data read by the scanner 151. The line buffer 105 is
It corresponds to 403 shown in FIG.

【0010】106はブロックバッファ、107は画像
をエンコード(圧縮)したり、デコード(伸長)するた
めの圧縮伸長プロセッサであり、圧縮伸長プロセッサ1
07での圧縮方法はブロック単位に処理が行なわれる圧
縮伸長の方法である。ブロックバッファ106は、概念
的に考えると、110に示す構成のようになり、縦8画
素、横8画素のマトリックスで、便宜的に0から63間
で番号が振られた64個のセルに分けられる。データ
は、圧縮伸長プロセッサ107に入力される前に一旦ブ
ロックバッファ106に格納され、その後、処理が行な
われる。圧縮された(エンコードされた)データは、圧
縮メモリ108に格納される。
Reference numeral 106 is a block buffer, 107 is a compression / expansion processor for encoding (compressing) or decoding (expansion) an image.
The compression method in 07 is a compression / decompression method in which processing is performed in block units. Conceptually, the block buffer 106 has a configuration shown in 110, and is a matrix of 8 pixels in the vertical direction and 8 pixels in the horizontal direction, and is divided into 64 cells numbered from 0 to 63 for convenience. To be The data is temporarily stored in the block buffer 106 before being input to the compression / expansion processor 107, and then processed. The compressed (encoded) data is stored in the compression memory 108.

【0011】なお、CPU101、RAM102、RO
M103、スキャナインターフェイス104、ラインバ
ッファ105及びブロックバッファ10の各構成はバス
109を介して互いに接続されている。次に、以上の構
成を備える本実施例装置におけるデータの流れを説明す
る。CPU101は、スキャナインターフェイス104
を介して、外部のスキャナ151からデータを読み取
り、読み取ったデータをラインバッファ105に書き込
む。
The CPU 101, RAM 102, RO
The M103, scanner interface 104, line buffer 105, and block buffer 10 are connected to each other via a bus 109. Next, the data flow in the apparatus of this embodiment having the above configuration will be described. The CPU 101 has a scanner interface 104.
The data is read from the external scanner 151 via the, and the read data is written in the line buffer 105.

【0012】スキャナ151での読み取り方式として
は、図2の(a)及び(b)に示すように2通りある。
図2の(a)の201に示す第1の方式は、センサ20
3の受光素子をyに示す方向に所定数並べた構成であ
り、この受光素子がyに示す方向に所定数並んだセンサ
203をx方向に移動しながら読み取り原稿の走査を行
ない、y方向に移動することを繰り返す方式である。
There are two reading methods by the scanner 151, as shown in FIGS. 2 (a) and 2 (b).
The first method shown by 201 in FIG. 2A is the sensor 20.
3 is a configuration in which a predetermined number of light receiving elements are arranged in the direction y, and the sensor 203 having a predetermined number of light receiving elements arranged in the direction y is moved in the x direction to scan the read document, and in the y direction. It is a method of repeating moving.

【0013】図2の(b)に202に示す第2の方式
は、センサ204の受光素子をx方向に読み取り幅分並
べた構成であり、センサ全体はy方向に移動しながら走
査を行なう方式である。他にもいろいろな走査の方式が
考えられるが、いずれにしても、センサ全体が移動しな
がら原稿データを読み込む構成であり、この読み取りデ
ータがラインバッファ105に書き込まれる。
A second method 202 shown in FIG. 2B is a structure in which the light receiving elements of the sensor 204 are arranged in the x direction for the reading width, and the entire sensor performs scanning while moving in the y direction. Is. Other various scanning methods are possible, but in any case, the original sensor data is read while the entire sensor moves, and the read data is written in the line buffer 105.

【0014】ラインバッファ105に書き込まれたデー
タは、CPU101が8×8のブロックにして、ブロッ
クバッファ106に送られる。圧縮伸長プロセッサ10
7は110に示すセルにデータがそろうと圧縮処理を行
ない。圧縮メモリ108にデータを書き出す。このとき
のバスの制御はCPU101が行なう必要がある。逆
に、データを伸長する際には、圧縮伸長プロセッサ10
7は圧縮メモリ108からデータを取り出し、伸長(デ
コード)してブロックバッファ106に書き込む。CP
U101はブロックバッファ106からデータを読み出
し、RAM102やラインバッファ105にデータを書
き込む。
The data written in the line buffer 105 is sent to the block buffer 106 by the CPU 101 as an 8 × 8 block. Compression / expansion processor 10
In No. 7, the compression process is performed when the data is arranged in the cell 110. The data is written to the compression memory 108. The CPU 101 must control the bus at this time. Conversely, when decompressing data, the compression / decompression processor 10
Reference numeral 7 extracts data from the compression memory 108, decompresses (decodes) the data, and writes the data in the block buffer 106. CP
The U 101 reads data from the block buffer 106 and writes the data in the RAM 102 and the line buffer 105.

【0015】以上がデータの大まかな流れである。次に
詳細な流れを説明する。以下の説明は、スキャナ151
が図2の(a)に示す第1の方式により走査する場合を
例に説明する。先ず、図3に示す最初のバンド301
(図4では401に相当する。)を読み込む場合を考え
る。スキャナ151のセンサ203(図4ではセンサ4
02)がx方向に走査を開始する。もし、スキャナ15
1が自スキャナの読み取り解像度と等しい(等倍の)解
像度で読み取った時には、縦88画素、横152画素と
なり、縦横共に8の倍数になる。従って、読み取りデー
タは8×8のブロックに分けられ、圧縮伸長プロセッサ
107で問題なくブロック圧縮をすることが可能であ
る。
The above is the general flow of data. Next, the detailed flow will be described. The following description is for the scanner 151
Will be described as an example in which scanning is performed by the first method shown in FIG. First, the first band 301 shown in FIG.
Consider the case of reading (corresponding to 401 in FIG. 4). The sensor 203 of the scanner 151 (sensor 4 in FIG.
02) starts scanning in the x direction. If the scanner 15
When 1 is read at a resolution equal to (or equal to) the reading resolution of its own scanner, it has 88 pixels in the vertical direction and 152 pixels in the horizontal direction, which is a multiple of 8 in both the vertical and horizontal directions. Therefore, the read data is divided into 8 × 8 blocks, and the compression / expansion processor 107 can perform block compression without any problem.

【0016】しかし、解像度変換をするような場合にお
いては、解像度変換をした結果、画素数が8の倍数では
なくなってしまうことがあり、このような場合におい
て、このままではブロック圧縮することが困難になる。
例えば、解像度を1/2にして読み込む場合には、等倍
の時と比較して、センサ203はx方向には倍のスピー
ドで走査を行ない、y方向にはセンサ203のセル(受
光素子)を1/2に間引いてデータを読み込む。そして
これをラインバッファ105(図4の(b)では403
に相当する。)に格納することにより、ラインバッファ
105には解像度が1/2の画像が入力されることにな
る。即ち、図4の例においては、元の画像サイズが
(a)に示すサイズであっても、解像度を1/2に変換
した場合には図4の(b)に示す様に全体の面積比で1
/4になって格納されることになる。
However, in the case where resolution conversion is performed, the number of pixels may not be a multiple of 8 as a result of resolution conversion. In such a case, it becomes difficult to perform block compression as it is. Become.
For example, when the resolution is halved and the reading is performed, the sensor 203 scans at a double speed in the x direction, and the cell (light receiving element) of the sensor 203 in the y direction as compared with the case of the same size. Is halved to read the data. Then, this is changed to the line buffer 105 (403 in FIG. 4B).
Equivalent to. ), The image having a resolution of 1/2 is input to the line buffer 105. That is, in the example of FIG. 4, even if the original image size is the size shown in FIG. 4A, when the resolution is converted to 1/2, the total area ratio is as shown in FIG. In 1
It becomes / 4 and is stored.

【0017】このようにして入力された解像度が1/2
の画像を、ラインバッファ105に格納した場合のブロ
ック例を図5に示す。入力画像全体は、601に示され
るように、等倍時の「縦88画素、横152画素」の半
分である「縦44画素、横76画素」になっている。即
ち、解像度変換をした結果、8の倍数ではなくなってし
まっている。
The resolution input in this way is 1/2
FIG. 5 shows an example of a block when the image of FIG. As shown by 601, the entire input image has “vertical 44 pixels, horizontal 76 pixels” which is half of “vertical 88 pixels, horizontal 152 pixels” at the same size. That is, as a result of resolution conversion, it is not a multiple of 8.

【0018】このような入力画像が8の倍数でないよう
な場合においても、ラインバッファ105よりの入力画
像をブロックバッファ106に格納するに際して、図5
の601に示す様に、入力画像を左上から8×8のブロ
ックで分割してブロックバッファ106に格納してゆ
く。そして、0ブロック、1ブロックと進み、602で
示す9ブロックになると、このブロックはこのままでは
横4画素、縦8画素の大きさであるから、このまま圧縮
伸長プロセッサ107に送ってもブロック圧縮すること
ができなくなる。そこで、本実施例においては、602
に示すブロック9においては、603に示す様に4列目
の画素(3,11,19,27,35,43,51,5
9)を5列目から8列目まで繰り返し、8×8の大きさ
のブロックに変換してブロックバッファ107に格納す
る。そしてこの変換ブロックデータを圧縮伸長プロセッ
サ107に送ってブロック圧縮をする。同様の処理を6
01において、19ブロック、29ブロック、39ブロ
ック、49ブロックにも施す。
Even when such an input image is not a multiple of 8, when the input image from the line buffer 105 is stored in the block buffer 106, as shown in FIG.
As indicated by reference numeral 601, the input image is divided into 8 × 8 blocks from the upper left and stored in the block buffer 106. Then, when it advances to 0 block and 1 block and becomes 9 blocks shown by 602, since this block has a size of 4 pixels in the horizontal direction and 8 pixels in the vertical direction, the block is compressed even if it is sent to the compression / expansion processor 107 as it is. Can not be. Therefore, in this embodiment, 602
In block 9 shown in FIG. 6, as shown by 603, the pixels (3, 11, 19, 27, 35, 43, 51, 5 in the fourth column
9) is repeated from the fifth column to the eighth column, converted into a block of 8 × 8 size and stored in the block buffer 107. Then, this converted block data is sent to the compression / expansion processor 107 to perform block compression. Similar processing 6
In 01, it is also applied to 19 blocks, 29 blocks, 39 blocks, and 49 blocks.

【0019】また、図5の601において、604に示
す50ブロックは、このままでは縦4画素、横8画素の
ブロックとなる。この結果上述同様このままでは圧縮伸
長プロセッサ107に送ってもブロック圧縮することが
できなくなる。そこで、本実施例においては、604に
示す50ブロックを605に示す様に4行目の画素(2
4,25,26,27,28,29,30,31)を5
行目から8行目まで繰り返し、8×8の大きさのブロッ
クに変換する。同様の処理を601において、50ブロ
ック、51ブロック、52ブロック、53ブロック、5
4ブロック、55ブロック、56ブロック、57ブロッ
ク、58ブロックに施す。
Further, in 601 of FIG. 5, the 50 blocks indicated by 604 are 4 pixels in the vertical direction and 8 pixels in the horizontal direction as they are. As a result, block compression cannot be performed even if it is sent to the compression / expansion processor 107 as it is as described above. Therefore, in this embodiment, the 50 blocks indicated by 604 are converted into pixels (2
4, 25, 26, 27, 28, 29, 30, 31) 5
Repeat from the 8th line to the 8th line to convert to a block of size 8 × 8. The same processing is performed in 601, 50 blocks, 51 blocks, 52 blocks, 53 blocks, 5
It is applied to 4 blocks, 55 blocks, 56 blocks, 57 blocks and 58 blocks.

【0020】更に、図5の601において、606に示
す59ブロックは、このままの実際のブロックでは縦4
画素、横4画素となってしまうため、上記の処理と同様
に画素を繰り返して607に示す様に8×8のブロック
に変換する。このように、実際のブロックの境界の画素
を繰り返すことにより、圧縮伸長プロセッサ107で圧
縮することが可能となる。そして、この圧縮結果は、圧
縮メモリ108に格納されることになる。以上の処理は
また、伸張し直した時の画質の劣化を抑えることができ
るという効果も有している。
Further, in 601 of FIG. 5, 59 blocks indicated by 606 are vertical 4 in the actual block as it is.
Since the number of pixels is 4 pixels in the horizontal direction, the pixels are repeated in the same manner as the above processing to be converted into an 8 × 8 block as indicated by 607. In this way, by repeating the pixels at the boundary of the actual block, the compression / expansion processor 107 can perform compression. Then, the compression result is stored in the compression memory 108. The above processing also has an effect that it is possible to suppress the deterioration of the image quality when the image is expanded again.

【0021】以上のように、いかなるサイズの画像デー
タであっても、結果として8×8のブロックに変換し
て、ブロック圧縮をすることができる。しかしながら、
このブロック変換した圧縮データを含む圧縮データを伸
張した場合に、このままでは図6に示すような問題が発
生する。即ち、伸張した画像を図6に示す501とする
と、上記の処理をした結果、画像として余分な部分とし
て図6の502に示す部分ができてしまう。
As described above, image data of any size can be converted into an 8 × 8 block as a result, and the block compression can be performed. However,
When the compressed data including the block-converted compressed data is decompressed, the problem as shown in FIG. 6 occurs as it is. That is, assuming that the decompressed image is 501 shown in FIG. 6, as a result of the above processing, a portion shown by 502 in FIG. 6 is formed as an extra portion as an image.

【0022】この事態を防止するためには、伸張する際
にこの余分なデータがどのくらいの大きさなのかを情報
として何処かに格納しておく必要がある。そこで、本実
施例においては、例えば、図7に示すように圧縮データ
のヘッダの中にブロック情報テーブルを備え、このテー
ブルに元のブロック情報を確保しておく方法を採用して
いる。より具体的に説明すると、図7に示す702は画
像の圧縮データそのものであり、このデータを単に伸張
しただけでは図6に示すように余分な部分を含む。70
1は圧縮に関するヘッダであり、画像全体としての大き
さ等の種々のデータを含んでいる。その中の一部として
ブロック情報テーブル703が備えられている。
In order to prevent this situation, it is necessary to store the size of this extra data somewhere as information when decompressing. Therefore, in this embodiment, for example, as shown in FIG. 7, a block information table is provided in the header of the compressed data and the original block information is secured in this table. More specifically, 702 shown in FIG. 7 is the compressed data of the image itself, and simply decompressing this data includes an extra portion as shown in FIG. 70
Reference numeral 1 is a header relating to compression, which includes various data such as the size of the entire image. A block information table 703 is provided as a part thereof.

【0023】ブロック情報テーブル703には、実際に
は8×8の大きさを持たない(画素を付け足した)ブロ
ックに関する情報を格納している。即ち、実際には8×
8の大きさを持たない変換ブロック番号、該変換ブロッ
ク番号における縦の画素数及び横の画素数が格納されて
いる。例えば、図5に示すブロック情報を圧縮した場合
のブロック情報テーブルの例を図7の704に示す。7
04に詳細例を示すブロック情報テーブルにおいては、
9ブロックは伸張した時、縦8画素、横4画素が有効で
あり、50ブロックは縦4画素、横8画素が有効である
ことを示している。
The block information table 703 stores information about blocks that do not actually have a size of 8 × 8 (pixels are added). That is, actually 8 ×
A conversion block number not having a size of 8, a vertical pixel number and a horizontal pixel number in the conversion block number are stored. For example, an example of the block information table when the block information shown in FIG. 5 is compressed is shown in 704 of FIG. 7
In the block information table showing the detailed example in 04,
When the 9 blocks are expanded, the vertical 8 pixels and the horizontal 4 pixels are effective, and the 50 blocks are the vertical 4 pixels and the horizontal 8 pixels are effective.

【0024】したがって、伸張の処理を行なう際に、0
ブロックから順に伸張していく際に、そのブロックがブ
ロック情報テーブル704に登録されているか否かをチ
ェックする。そして、そのブロックがブロック情報テー
ブル704に登録されていればその大きさにブロックを
切り取るという処理を繰り返す。このように制御するこ
とにより、図6に示す様な画像になることはなく、正常
な画像を得ることができる。
Therefore, when performing the decompression process, 0
When the blocks are expanded sequentially, it is checked whether the block is registered in the block information table 704. Then, if the block is registered in the block information table 704, the process of cutting the block to that size is repeated. By controlling in this way, it is possible to obtain a normal image without the image as shown in FIG.

【0025】次に、図8、図9、図10に示すフローチ
ャートを用いて、上述した本実施例におけるブロック分
割とブロック情報の登録制御の詳細を説明する。先ず図
8に示すステツプS801で処理を開始する。そしてス
テツプS802で各種パラメータを初期化する初期化処
理(イニシャライズ処理)を実行する。なお、この時点
ではスキャナ151を起動して、1バンド分の画像デー
タがラインバッファ105に格納されているものとす
る。続くステツプS803において、『(yb+1)×
8≦yサイズ』か否かを調べ、縦方向(y方向)のルー
プのチェックを行う。ステップS803において、『y
b』は縦方向のブロックの数であり、図5において、0
ブロックから9ブロックにおいて『yb』は「0」、1
0ブロックから19ブロックにおいては『yb』は
「1」というように、縦方向のブロックの行番号を表わ
している。なお、後述する様にパラメータ『xb』は横
方向のブロックの列番号を示しており、例えば、34ブ
ロックは(yb=3、xb=4)になる。
Details of the block division and block information registration control in the above-described embodiment will be described below with reference to the flowcharts shown in FIGS. 8, 9 and 10. First, the process is started in step S801 shown in FIG. Then, in step S802, initialization processing (initialization processing) for initializing various parameters is executed. At this point, it is assumed that the scanner 151 is activated and the image data for one band is stored in the line buffer 105. In the following step S803, “(yb + 1) ×
8 ≦ y size ”, and a loop in the vertical direction (y direction) is checked. In step S803, "y
b ”is the number of blocks in the vertical direction, and is 0 in FIG.
“Yb” is “0”, 1 in the 9th block
In the 0th block to the 19th block, "yb" represents the row number of the vertical block, such as "1". As will be described later, the parameter “xb” indicates the column number of the block in the horizontal direction. For example, 34 blocks have (yb = 3, xb = 4).

【0026】ステツプS803でのチェックの結果、対
象としているブロックがyサイズ(読み込んだバンドの
縦の大きさ)を越えない場合にはステツプS804に、
対象としているブロックがyサイズを越える場合にはス
テツプS805に進む。なお、パラメータ『yc』は8
×8のブロック内の縦方向に関するループカウンタであ
る。
As a result of the check in step S803, if the target block does not exceed the y size (the vertical size of the read band), the process proceeds to step S804.
If the target block exceeds the y size, the process proceeds to step S805. The parameter "yc" is 8
It is a loop counter in the vertical direction within a × 8 block.

【0027】ステツプS804では、『yc』に「8」
をセットしてステップS807に進む。一方、ステツプ
S805では、縦方向に関するループの終了を示すパラ
メータである『y終了フラグ』をONにする。そして、
次のステツプS806で『yc=yサイズ−yb×8』
を実行し、実在のデータを出力する行数を計算する。そ
してステップS807に進む。
In step S804, "8" is added to "yc".
Is set and the process proceeds to step S807. On the other hand, in step S805, the "y end flag", which is a parameter indicating the end of the loop in the vertical direction, is turned on. And
At the next step S806, “yc = y size−yb × 8”
Execute and calculate the number of rows to output the actual data. Then, the process proceeds to step S807.

【0028】以上のステップS803〜ステップS80
6の処理により縦方向(y方向)の処理を終了すると、
続いてステップS807〜ステップS810の処理で横
方向(x方向)に関する処理を実行する。即ち、先ずス
テップS807において、『(xb+1)×8≦xサイ
ズ』か否かを調べ、横方向(X方向)のループのチェッ
クを行う。ステップS807において、『Xb』は横方
向のブロックの桁番号を表わしている。ステツプS80
7でのチェックの結果、対象としているブロックがxサ
イズ(読み込んだバンドの横の大きさ)を越えない場合
にはステツプS808に、対象としているブロックがx
サイズを越える場合にはステツプS809に進む。
The above steps S803 to S80
When the processing in the vertical direction (y direction) is completed by the processing of 6,
Subsequently, the processing in the horizontal direction (x direction) is executed in the processing of steps S807 to S810. That is, first in step S807, it is checked whether or not “(xb + 1) × 8 ≦ x size”, and a loop in the horizontal direction (X direction) is checked. In step S807, "Xb" represents the digit number of the horizontal block. Step S80
As a result of the check in 7, if the target block does not exceed the x size (horizontal size of the read band), in step S808, the target block is x.
If it exceeds the size, the process proceeds to step S809.

【0029】ステツプS808では、『xc』に「8」
をセットしてステップS811に進む。一方、ステツプ
S809では、横方向に関するループの終了を示すパラ
メータである『x終了フラグ』をONにする。そして、
次のステツプS810で『xc=xサイズ−xb×8』
を実行し、実在のデータを出力する桁数を計算する。そ
してステップS811に進む。
In step S808, "8" is added to "xc".
Is set and the process proceeds to step S811. On the other hand, in step S809, the parameter "x end flag" indicating the end of the loop in the horizontal direction is turned ON. And
In the next step S810, "xc = x size-xbx8"
And calculate the number of digits to output the actual data. Then, the process proceeds to step S811.

【0030】以上のステップS807〜ステップS81
1の処理により横方向(x方向)の処理を終了する。な
おここで、パラメータ『xc』は横方向に関するループ
カウンタである。以上の処理を図5に示す実際の処理と
の関連で以下に説明する。 (ブロック34)図5において、ブロック34を例に取
ると、yb=3、xb=4になるので、ステップS80
3で『(yb+1)×8≦ yサイズ』の条件は、
「(3+1)×8≦44」を満たすので、ステップS8
04に進み、『yc』に「8」をセットする。
The above steps S807 to S81
The processing of 1 ends the processing in the horizontal direction (x direction). Here, the parameter “xc” is a loop counter in the horizontal direction. The above processing will be described below in relation to the actual processing shown in FIG. (Block 34) In FIG. 5, if the block 34 is taken as an example, yb = 3 and xb = 4, so step S80
The condition of “(yb + 1) × 8 ≦ y size” in 3 is
Since “(3 + 1) × 8 ≦ 44” is satisfied, step S8
Go to 04 and set "8" to "yc".

【0031】また、ステップS807で、『(xb+
1)×8≦ xサイズ』の条件は、「(4+1)×8≦
76」を満たすので、ステップS808に進み、『x
c』に「8」をセットする。 (ブロック50)また、ブロック50の場合を考える
と、yb=5、xb=0になるので、ステップS803
で『(yb+1)×8≦ yサイズ』の条件は、「(5
+1)×8≧44」となり、条件を満たすことができな
いので、ステップS805に進み 『y終了フラグ』を
ONにして、ステップS806に進む。そして、「yc
=yサイズ−yb×8=44−40=4」により、『y
c』に「4」をセットする。
In step S807, "(xb +
The condition of “1) × 8 ≦ x size” is “(4 + 1) × 8 ≦
76 ”is satisfied, the process advances to step S808, and“ x
Set "8" to "c". (Block 50) Considering the case of block 50, yb = 5 and xb = 0, so that step S803 is performed.
Then, the condition of “(yb + 1) × 8 ≦ y size” is “(5
+1) × 8 ≧ 44 ”, and the condition cannot be satisfied. Therefore, the process proceeds to step S805, the“ y end flag ”is turned on, and the process proceeds to step S806. And "yc
= Y size−yb × 8 = 44-40 = 4 ”
Set "4" to "c".

【0032】また、ステップS807で『(xb+1)
×8≦xサイズ』の条件は、「(0+1)×8≦76」
を満たすので、ステップS808に進み、『xc』に
「8」をセットする。次にステップS811では、縦方
向(y方向)に関するループの判定を行なう。ループが
終了すると図10に示すステツプS1001に進む。一
方、ループの最中であると、図9に示すステップS90
1に進み、カウンタiが終了を意味するループカウンタ
xc値以下か、即ち『i<xc』か否かを調べ、今度は
横方向(x方向)のループの判定を行なう。ステップS
901のx方向のループの判定において、『i<xc』
と判定され終了であるとと判断されるとステップS90
6に進み、『i<xc』でなく終了でないと判断される
とステップS902に進む。
In step S807, "(xb + 1)"
The condition of “× 8 ≦ x size” is “(0 + 1) × 8 ≦ 76”.
Since the condition is satisfied, the process proceeds to step S808, and “xc” is set to “8”. Next, in step S811, a loop determination regarding the vertical direction (y direction) is performed. When the loop ends, the flow proceeds to step S1001 shown in FIG. On the other hand, if it is during the loop, step S90 shown in FIG.
The process proceeds to 1 and it is checked whether or not the counter i is equal to or less than the loop counter xc value which means the end, that is, "i <xc", and this time, the loop in the lateral direction (x direction) is determined. Step S
In the determination of the loop in the x direction of 901, “i <xc”
If it is determined that the process is finished, step S90
When it is determined that the processing is not “i <xc” and the processing is not completed, the processing proceeds to step S902.

【0033】ステップS902では、ラインバッファ1
05の601に示す対象ブロックの縦j、横iの画素
(以下「b(i,j)」とする。)をブロックバッファ
106の縦j、横iの位置(以下「B(i,j)」とす
る。)にセットする。図5における603を例に取る
と、j=3,i=2の時、b(2,3)の画素は26番
の画素を示しており、この位置の画像データをブロック
バッファ106のB(2,3)の位置(図1において、
110の26番)にセットする。
In step S902, the line buffer 1
The vertical j and horizontal i pixels (hereinafter referred to as “b (i, j)”) of the target block indicated by 601 of 05 are vertical j and horizontal i positions (hereinafter “B (i, j)” in the block buffer 106). ).). Taking 603 in FIG. 5 as an example, when j = 3 and i = 2, the pixel of b (2,3) indicates the 26th pixel, and the image data at this position is stored in B (2) of the block buffer 106. 2, 3) position (in FIG. 1,
No. 26 of 110).

【0034】さらに、ステップS903でセットしたデ
ータを一時的に格納しておくためのバッファである例え
ばRAM102中に設けられたバッファpにコピーす
る。そして、ステップS904でブロック内のj行の1
行分のデータを格納しておくための同じく例えばRAM
102中に設けられたラインバッファlにもデータをコ
ピーする。ラインバッファlは8画素分のデータ領域を
もっている。例えば603のb(2,3)の画素、すな
わち26番の画素を処理すると、ラインバッファlには
24番、25番、26番の画素が格納されることにな
る。そして、ステップS905でカウンタiをインクリ
メントしてステップS901に移り、x方向のループの
判定を行なう。
Further, the data set in step S903 is copied to a buffer p, which is a buffer for temporarily storing, for example, the RAM 102. Then, in step S904, 1 in the jth row in the block
Similarly, for example, a RAM for storing data for rows
The data is also copied to the line buffer 1 provided in 102. The line buffer 1 has a data area for 8 pixels. For example, when the pixel b (2,3) 603, that is, the 26th pixel is processed, the 24th, 25th, and 26th pixels are stored in the line buffer l. Then, in step S905, the counter i is incremented, and the process proceeds to step S901 to determine a loop in the x direction.

【0035】ステップS901でカウンタiが「xc」
以上になったらステップS906に進み、カウンタiが
「8」以下か、即ち、カウンタiが「8」になったかの
判定を行なう。これはブロックの横方向に関して8画素
出力したかの判定を行なうためのものである。そしてス
テップS907ではバッファpをリーダして対応するブ
ロックバッファ106位置にリードしたデータを書き込
み、続くステップS908では同じリードしたデータを
バッファlにライトする。そしてステップS909でカ
ウンタiをインクリメントする。このステップS906
からステップS909のループは、実在する画素を出力
するのではなくてダミーの画素を出力する処理部分であ
る。
In step S901, the counter i is "xc".
When it becomes above, it progresses to step S906, and it is determined whether the counter i is "8" or less, ie, whether the counter i has become "8". This is for determining whether eight pixels have been output in the horizontal direction of the block. Then, in step S907, the buffer p is read to write the read data to the corresponding position of the block buffer 106, and in the following step S908, the same read data is written to the buffer l. Then, in step S909, the counter i is incremented. This step S906
The loop from step S909 is a processing part that outputs dummy pixels instead of outputting existing pixels.

【0036】例えば、図5の603を例にとり説明する
と、ここではループカウンタxcの値は「4」であるの
でステップS901からステップS905のループを4
回繰り返す。即ち603の0番、1番、2番、3番の画
素を出力する処理である。4回のループが終了した時点
でバッファpには3番の画素データが、ラインバッファ
lには0、1、2、3番の画素が格納されている。
For example, taking 603 in FIG. 5 as an example, since the value of the loop counter xc is "4" here, the loop of steps S901 to S905 is set to four.
Repeat times. That is, it is a process of outputting the 0th, 1st, 2nd, and 3rd pixels of 603. At the time when the loop of four times is completed, the third pixel data is stored in the buffer p, and the first, second, third pixels are stored in the line buffer l.

【0037】次にステップS906に進む。ステップS
906からステップS909のループは4回行なわれ
る。ステップS907でバッファpのデータ即ち3番の
画素のデータをリードして、さらにブロックバッファ1
06にライトする。この処理によりループが終了した時
点では、603の1行目のデータ0、1、2、3、3、
3、3、3番のデータがブロックバッファの0行目に出
力される。このとき、ステップS908の処理でライン
バッファlにも同じ1行目のデータが格納されている。
Then, the process proceeds to step S906. Step S
The loop from 906 to step S909 is performed four times. In step S907, the data in the buffer p, that is, the data of the third pixel is read, and the block buffer 1
Write to 06. At the time when the loop is completed by this process, the data 0, 1, 2, 3, 3,
Data Nos. 3, 3, and 3 are output to the 0th row of the block buffer. At this time, the same data of the first row is also stored in the line buffer 1 in the process of step S908.

【0038】横方向(x方向)のループが終了するとス
テップS906よりステップS910に進み縦方向(y
方向)のカウンタjをインクリメントする。そして図8
に示すステップS811に戻り、縦方向に関してyc行
分のデータを出力したかの判定を行なう。もし、ycが
「8」でない時(ダミーの行を出力する必要がある時)
は図10に示すステツプS1001に進む。
When the loop in the horizontal direction (x direction) is completed, the process proceeds from step S906 to step S910 and the vertical direction (y
Direction) counter j is incremented. And FIG.
Returning to step S811 shown in step S811, it is determined whether or not yc rows of data have been output in the vertical direction. If yc is not "8" (when it is necessary to output a dummy row)
Proceeds to step S1001 shown in FIG.

【0039】ステップS1001ではカウンタjが
[8]以下かを判定する。カウンタjが「8」以下の場
合にはステツプS1002に進み、ラインバッファlの
データをリードしてブロックバッファ106にライトす
る。そして、ステップS1003でカウンタjをインク
リメントしてステップS1001に戻る。このステツプ
S1001からステツプS1003までのループを繰り
返し、最終的に8行のデータがブロックバッファ106
にコピーされるまで繰り返される。
In step S1001, it is determined whether the counter j is less than [8]. If the counter j is "8" or less, the flow advances to step S1002 to read the data in the line buffer 1 and write it in the block buffer 106. Then, in step S1003, the counter j is incremented and the process returns to step S1001. The loop from step S1001 to step S1003 is repeated until the data of 8 rows is finally stored in the block buffer 106.
Repeated until copied to.

【0040】例えば、図5に示す605を例にとり説明
すると、この場合にはループカウンタycは「4」であ
るので、横方向(x方向)の出力処理を4行分繰り返
す。このときラインバッファlには24,25,26,
27,28,29,30,31番の画像データが格納さ
れている。次にステツプS1001からステツプS10
03の処理でダミーの行としてラインバッファlを4ラ
イン分出力する。以上の処理により、結果として図5の
605に示す様な画像データがブロックバッファ110
に格納されることになる。
For example, taking 605 shown in FIG. 5 as an example, in this case, since the loop counter yc is "4", the output processing in the horizontal direction (x direction) is repeated for four lines. At this time, 24, 25, 26,
Image data Nos. 27, 28, 29, 30, and 31 are stored. Next, step S1001 to step S10
In the processing of 03, the line buffer 1 is output as a dummy row for four lines. As a result of the above processing, the image data as shown by 605 in FIG.
Will be stored in.

【0041】[ブロック登録]ループカウンタycまた
はループカウンタxcが「8」以下でない時(「8」と
なった場合)には、ダミーの行または列を出力したこと
になるので、ステップS1001よりステップS100
4の処理に移行し、図7のブロック情報テーブル704
に現在処理を終了したブロックの情報を登録する。図5
の603に示す例では、ブロック番号として「9」を、
そして縦方向の大きさを表わすyc=8、横方向の大き
さを表わすxc=4をそれぞれ登録する。尚、ブロック
番号のカウントは、ステツプS1004の処理に入る毎
にインクリメントされるパラメータで算出することがで
きる。また、ここでyc、xc共に「8」の時にはブロ
ック変換は行われていないことを示しているため、この
処理は行なわずステツプS1005に移る。
[Block registration] When the loop counter yc or the loop counter xc is not equal to or less than "8" (when it becomes "8"), it means that a dummy row or column has been output. S100
4, the block information table 704 of FIG.
The information of the block whose processing has ended is registered in. Figure 5
In the example shown in 603, “9” is set as the block number,
Then, yc = 8 representing the vertical size and xc = 4 representing the horizontal size are respectively registered. The block number count can be calculated using a parameter that is incremented each time the processing in step S1004 is entered. If yc and xc are both "8", it means that the block conversion is not performed. Therefore, this process is not performed and the process proceeds to step S1005.

【0042】ステツプS1005ではx方向の終了フラ
グであるx終了フラグのチェックを行なう。x終了フラ
グがONでなく条件を満たさない場合にはステツプS1
009に進み、x方向のブロック番号xbをインクリメ
ントしてステップS803に移り次のブロックを処理す
る。一方、ステップS1005でx終了フラグがONで
あればステップS1006に進み、y方向のブロック番
号ybをインクリメントする。そして続くステツプS1
007でx終了フラグをOFFにする。次にステツプS
1008でy終了フラグをチェックする。もし、y終了
フラグがONならば、全てのブロックを処理したことに
なるので、ステツプS1011に進み、全ての処理を終
了する。
In step S1005, the x end flag, which is the end flag in the x direction, is checked. If the x end flag is not ON and the condition is not satisfied, step S1
In step 009, the block number xb in the x direction is incremented, the process proceeds to step S803, and the next block is processed. On the other hand, if the x end flag is ON in step S1005, the flow advances to step S1006 to increment the block number yb in the y direction. And then step S1
At 007, the x end flag is turned off. Then step S
At 1008, the y end flag is checked. If the y end flag is ON, it means that all the blocks have been processed, so that the process proceeds to step S1011 to end all the processes.

【0043】また、ステップS1008でy終了フラグ
がOFFであればx方向のブロック番号xbに「0」を
セットして、ステップS803に進み、次のブロックの
処理を開始する。以上の説明を簡単にまとめて以下に説
明する。図8〜図10に示すフローチャートに従って、
ラインバッファ105に格納された画像データを分割し
てブロックバッファ106に転送する。その際に、8×
8の大きさにならないブロックに関しては画素を付け加
え、8×8の大きさにする。そして、その情報をブロッ
ク情報テーブル704に書き込む。
If the y end flag is OFF in step S1008, the block number xb in the x direction is set to "0", and the flow advances to step S803 to start the processing of the next block. The above description will be briefly summarized below. According to the flowcharts shown in FIGS. 8 to 10,
The image data stored in the line buffer 105 is divided and transferred to the block buffer 106. At that time, 8 ×
For blocks that do not have a size of 8, add pixels to make a size of 8 × 8. Then, the information is written in the block information table 704.

【0044】以上説明した様の本実施例によれば、ブロ
ック符号化を行なう際に、画像の大きさがブロックの大
きさの整数倍でない時でも圧縮ができるという効果があ
る。これにより、画像に解像度変換処理を施し、どのよ
うな大きさになったとしても圧縮ができる。また、ライ
ンバッファ105に読み込む画像がブロックの大きさの
整数倍でなければならないという制限がなくなるという
効果もある。
According to the present embodiment as described above, there is an effect that the compression can be performed even when the size of the image is not an integral multiple of the size of the block when performing the block coding. As a result, resolution conversion processing is performed on the image, and compression can be performed regardless of the size. Further, there is an effect that there is no limitation that the image read into the line buffer 105 has to be an integral multiple of the block size.

【0045】[第2実施例]以上の説明においては、圧
縮伸長プロセッサ106でブロックデータをエンコード
(圧縮)して圧縮メモリ108に格納する場合を主に説
明し、伸長処理は図6を例にわずかに説明したのみであ
った。しかし、本発明は以上の例に限定されるものでは
なく、以上の圧縮処理に加え、圧縮したデータを伸長し
て、ブロックバッファ106からラインバッファ10
5、またはRAM102に転送する圧縮伸長処理が共に
可能な本発明に係る第2実施例を以下に説明する。
[Second Embodiment] In the above description, the case where the block data is encoded (compressed) by the compression / expansion processor 106 and stored in the compression memory 108 is mainly described, and the expansion process is shown in FIG. 6 as an example. It was only explained briefly. However, the present invention is not limited to the above example, and in addition to the above compression processing, the compressed data is expanded and the block buffer 106 to the line buffer 10 are expanded.
5 or a second embodiment according to the present invention capable of both compression and decompression processing for transfer to the RAM 102 will be described below.

【0046】第2実施例においても、ハードウエア構成
は上述した第1の実施例と全く同様で足り、画像の圧縮
処理も全く同様の処理で足りる。このため、以上の構成
及び処理についての説明は省略する。以下、上述した図
8〜図10の処理で圧縮メモリ108に格納された圧縮
データを伸長する処理を図11のフローチヤートを参照
して以下に説明する。
Also in the second embodiment, the hardware configuration is exactly the same as that of the first embodiment described above, and the image compression processing is completely the same. Therefore, the description of the above configuration and processing is omitted. Hereinafter, the process of decompressing the compressed data stored in the compression memory 108 in the processes of FIGS. 8 to 10 will be described below with reference to the flow chart of FIG.

【0047】伸長処理が選択されると図11の処理に移
行し、ステツプS1101で伸長処理を開始する。まず
ステツプS1102で各種パラメータの初期化、圧縮伸
長プロセッサ107の初期化等を行なう。そして続くス
テツプS1103で圧縮すべきデータが圧縮メモリ10
8に存在するかどうかのチェックを行なう。もし、圧縮
すべきデータが圧縮メモリ108になければ全てのブロ
ックを伸長した、または初めからデータがないかを意味
しているので、ステツプS1111で処理を終了する。
When the decompression process is selected, the process proceeds to the process of FIG. 11, and the decompression process is started in step S1101. First, in step S1102, various parameters are initialized and the compression / expansion processor 107 is initialized. The data to be compressed in the subsequent step S1103 is the compression memory 10
Check whether it exists in 8. If the data to be compressed does not exist in the compression memory 108, it means that all blocks have been decompressed or there is no data from the beginning, so the process ends in step S1111.

【0048】一方、圧縮すべきデータが圧縮メモリ10
8にある場合には圧縮伸長プロセッサ107を起動して
ステツプS1004に進み、圧縮メモリ108より1ブ
ロック分の圧縮データを読み出して伸長し、ブロックバ
ッファ106にこの伸長データを書き込む。この時点で
は、ブロックバッファ106にあるデータが圧縮時に変
換された(余分な画像を含む)ブロックかどうかわから
ない。そこでステツプS1105でブロック情報テーブ
ル704をサーチして、現在処理しているブロックが登
録されているかをチェックする。ステツプS1106で
ブロック情報テーブル704に存在していなければ、ス
テツプS1110に進みブロックバッファ全体の8×8
の画素を全てRAM102(又はラインバッファ105
「以下同様である。」)の所定のアドレスにコピーす
る。
On the other hand, the data to be compressed is the compression memory 10
If it is 8, the compression / expansion processor 107 is activated and the process proceeds to step S1004 to read one block of compressed data from the compression memory 108 and decompress it, and write this decompressed data in the block buffer 106. At this point, it is not known if the data in the block buffer 106 is the block that was transformed during compression (including the extra image). Therefore, in step S1105, the block information table 704 is searched to check whether the block currently being processed is registered. If it does not exist in the block information table 704 in step S1106, the process proceeds to step S1110 and 8 × 8 of the entire block buffer.
All pixels of RAM 102 (or line buffer 105
"The same shall apply hereinafter.").

【0049】また、ステップS1106において、ブロ
ック情報テーブル704にもし現在処理しているブロッ
クが登録されている場合にはステップS1107に進
み、ブロック情報テーブル704から有効な横方向の画
素数、縦方向の画素数をリードする。そして、ステツプ
S1108においてブロックバッファ106に格納され
ている画像データから有効画素数だけRAM102の所
定のアドレスにコピーする。そしてステツプS1109
で現在処理を施しているブロックを識別するブロック番
号をインクリメントする。そして、ステツプS1103
に進み次のブロックの処理を開始する。
In step S1106, if the block currently being processed is registered in the block information table 704, the process advances to step S1107, and the effective number of pixels in the horizontal direction and the vertical direction in the block information table 704 are set. Read the number of pixels. Then, in step S1108, the number of effective pixels is copied from the image data stored in the block buffer 106 to a predetermined address of the RAM 102. And step S1109
The block number for identifying the block currently being processed is incremented. Then, step S1103
Proceed to and start processing the next block.

【0050】以上の処理を圧縮データがなくなるまで行
なう。その結果、図6の502に示す様な余分な画像は
削除され、501に示す所望の画像のみを得ることがで
きる。以上説明した様に第2実施例によれば、ブロック
符号化を行なう際に、画像の大きさがブロックの大きさ
の整数倍でない時でも圧縮伸長ができるという効果があ
る。これにより、画像に解像度変換処理を施し、どのよ
うな大きさになったとしても圧縮伸長ができる。また、
ラインバッファ105に読み込む画像がブロックの大き
さの整数倍でなければならないという制限がなくなると
いう効果もある。
The above processing is repeated until there is no compressed data. As a result, the extra image as shown by 502 in FIG. 6 is deleted, and only the desired image shown by 501 can be obtained. As described above, according to the second embodiment, it is possible to perform compression / expansion when performing block coding even when the size of the image is not an integral multiple of the size of the block. As a result, resolution conversion processing is performed on the image, and compression and expansion can be performed regardless of the size. Also,
There is also an effect that there is no restriction that the image read into the line buffer 105 must be an integral multiple of the block size.

【0051】[第3実施例]以上の実施例における図7
に示すブロック情報テーブル704は、スキャナ151
で読み込むデータに従ってその大きさが変化するので、
ヘッダ701の容量は可変長である。従って、圧縮方法
によるが、第3実施例ではヘッダが可変長でない場合や
ヘッダがない場合には、ブロック情報テーブル704に
圧縮データとは別のデータとしてブロック情報を格納す
る様に構成してもよい。
[Third Embodiment] FIG. 7 in the above embodiment.
The block information table 704 shown in FIG.
Since the size changes according to the data read by
The capacity of the header 701 is variable. Therefore, depending on the compression method, in the third embodiment, when the header is not variable length or there is no header, the block information table 704 may be configured to store the block information as data different from the compressed data. Good.

【0052】以上の各実施例の説明においては、入力画
像データとしてスキャナ151での読み込み画像データ
を用いる場合を説明したが、この処理画像データは以上
の例に限定されるものではなく、他のホストコンピュー
タ等よりの画像データであっても、また、他の機器より
の画像データであっても、また、パソコン通信等よりの
データでも、ファクシミリ通信により得られた画像デー
タであってもよく、このソース等は何ら限定されるもの
ではない。
In the above description of each embodiment, the case where the image data read by the scanner 151 is used as the input image data has been described, but the processed image data is not limited to the above example, and other image data is used. Image data from a host computer or the like, image data from another device, data from a personal computer communication or the like, or image data obtained by facsimile communication may be used. This source and the like are not limited at all.

【0053】更に、圧縮データを他の装置よりデータ通
信ファクシミリ通信等により受け取っても、磁気ディス
ク等を介して読み込んだものであってもよく、同様に圧
縮データのソースも何ら限定されるものではなく、圧縮
データとブロック情報データテーブルとが共に入力され
るものであればいかなるソースからであってもよい。
尚、本発明は、複数の機器から構成されるシステムに適
用しても1つの機器から成る装置に適用しても良い。
Further, the compressed data may be received from another device by data communication facsimile communication or the like, or may be read via a magnetic disk or the like. Similarly, the source of the compressed data is not limited at all. Alternatively, any source may be used as long as the compressed data and the block information data table are input together.
The present invention may be applied to a system including a plurality of devices or an apparatus including one device.

【0054】また、本発明は、システム或は装置にプロ
グラムを供給することによって達成される場合にも適用
できることはいうまでもない。
Further, it goes without saying that the present invention can be applied to the case where it is achieved by supplying a program to a system or an apparatus.

【0055】[0055]

【発明の効果】以上説明した様に本発明によれば、画像
の大きさがブロックの大きさの整数倍でない時でもエン
コードあるいはデコードすることが可能になる。
As described above, according to the present invention, it is possible to perform encoding or decoding even when the size of the image is not an integral multiple of the size of the block.

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

【図1】本発明に係る一実施例装置の構成を示すブロッ
ク図である。
FIG. 1 is a block diagram showing the configuration of a device according to an embodiment of the present invention.

【図2】スキャナにおける原稿の走査方向を示す図であ
る。
FIG. 2 is a diagram showing a scanning direction of a document in a scanner.

【図3】スキャナにおける読み取り原稿をバンドの単位
に分割した図である。
FIG. 3 is a diagram in which a document read by a scanner is divided into band units.

【図4】原稿を走査する際の画像読み取り例を示す図で
ある。
FIG. 4 is a diagram illustrating an example of image reading when scanning a document.

【図5】本実施例における読み取った画像をブロックに
分割する制御を説明するための図である。
FIG. 5 is a diagram for explaining control for dividing a read image into blocks in the present embodiment.

【図6】本実施例における変換ブロックデータをそのま
ま伸長した場合の出力例を示す図である。
FIG. 6 is a diagram showing an output example when the converted block data in this embodiment is expanded as it is.

【図7】本実施例におけるブロック情報テーブルの構成
例を示す図である。
FIG. 7 is a diagram showing a configuration example of a block information table according to the present embodiment.

【図8】本実施例の圧縮処理の詳細を説明するためのフ
ローチャートである。
FIG. 8 is a flowchart for explaining details of compression processing according to the present embodiment.

【図9】本実施例の圧縮処理の詳細を説明するためのフ
ローチャートである。
FIG. 9 is a flowchart for explaining details of compression processing according to the present embodiment.

【図10】本実施例の圧縮処理の詳細を説明するための
フローチャートである。
FIG. 10 is a flowchart for explaining details of compression processing according to the present embodiment.

【図11】本発明に係る第2実施例の伸長処理を説明す
るためのフローチャートである。
FIG. 11 is a flowchart for explaining decompression processing according to the second embodiment of the present invention.

【符号の説明】[Explanation of symbols]

101 CPU 102 RAM 103 ROM 104 スキャナインターフェイス 105 ラインバッファ 106 ブロックバッファ 107 圧縮伸長プロセッサ 108 圧縮メモリ 109 バス 110 ブロックバッファ 151 スキャナ 203,204,402 センサ 401 原稿 403 ラインバッファ 701 ヘッダ 702 圧縮データ 703,704 ブロック情報テーブル 101 CPU 102 RAM 103 ROM 104 Scanner Interface 105 Line Buffer 106 Block Buffer 107 Compression / Expansion Processor 108 Compression Memory 109 Bus 110 Block Buffer 151 Scanner 203, 204, 402 Sensor 401 Original 403 Line Buffer 701 Header 702 Compressed Data 703, 704 Block Information table

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 M×Nの大きさを持つ画像を、m×nの
大きさのブロックに分割処理し、m×nに満たない大き
さの画像の大きさを記憶し、当該m×nに満たない大き
さの画像をm×nの大きさに再構成すると共に、再構成
したブロックを識別可能に構成し、m×nのブロックを
エンコードすることを特徴とする画像処理方法。
1. An image having a size of M × N is divided into blocks having a size of m × n, the size of the image smaller than m × n is stored, and the m × n image is stored. An image processing method comprising reconstructing an image having a size less than the above into an m × n size, arranging the reconstructed block to be identifiable, and encoding the m × n block.
【請求項2】 エンコードした画像をm×nのブロック
にデコードすると共に再構成したブロックを識別し、記
憶しておいた再構成したブロックの大きさに従ってデコ
ードして再構成した画像をM×Nの大きさの画像に復元
することを特徴とする画像処理方法。
2. An image reconstructed by decoding the encoded image into m × n blocks, identifying the reconstructed block, and decoding the reconstructed image according to the size of the stored reconstructed block, and reconstructing the image M × N. An image processing method characterized in that the image is restored to an image of the size.
【請求項3】 M×Nの大きさを持つ画像を、m×nの
大きさのブロックに分割処理し、m×nに満たない大き
さの画像の大きさを記憶し、当該m×nに満たない大き
さの画像をm×nの大きさに再構成すると共に、再構成
したブロックを識別可能に構成し、m×nのブロックを
エンコードするとともに、エンコードした画像をm×n
のブロックにデコードすると共に再構成したブロックを
識別し、記憶しておいた再構成したブロックの大きさに
従ってデコードして再構成した画像をM×Nの大きさの
画像に復元することを特徴とする画像処理方法。
3. An image having a size of M × N is divided into blocks having a size of m × n, and the size of the image smaller than m × n is stored. Image having a size less than the above is reconstructed to have a size of m × n, the reconstructed block is configured to be identifiable, the m × n block is encoded, and the encoded image is resized to m × n.
And reconstructing a block according to the size of the stored reconstructed block to restore the reconstructed image into an image of size M × N. Image processing method.
【請求項4】 M×Nの大きさを持つ画像をm×nの大
きさのブロックに分割処理する分割手段と、 該分割手段で分割したm×nに満たない大きさの画像の
大きさを記憶する記憶手段と、 前記分割手段で分割したm×nに満たない大きさの画像
をm×nの大きさに再構成する第1の再構成手段と、 前記分割手段で分割したm×nのブロック及び前記第1
の再構成手段で再構成したm×nのブロックをエンコー
ドするエンコード手段とを備えることを特徴とする画像
処理装置。
4. A dividing unit for dividing an image having a size of M × N into blocks having a size of m × n, and a size of an image having a size smaller than m × n divided by the dividing unit. A first reconstructing unit for reconstructing an image of a size smaller than m × n divided by the dividing unit into a size of m × n, and m × divided by the dividing unit. n blocks and the first
And an encoding unit that encodes the m × n blocks reconstructed by the reconstructing unit.
【請求項5】 エンコードした画像をm×nのブロック
にデコードするデコード手段と、 再構成されているブロックを識別する識別手段と、 該識別手段で識別された再構成ブロックの大きさに従っ
てデコードされた画像を再構成する第2の再構成手段
と、 該第2の再構成手段で再構成した画像をM×Nの大きさ
の画像に復元する復元手段とを備えることを特徴とする
画像処理装置。
5. Decoding means for decoding the encoded image into m × n blocks, identification means for identifying reconstructed blocks, and decoding according to the size of the reconstructed blocks identified by the identification means. Image processing including a second reconstructing unit for reconstructing the reconstructed image and a reconstructing unit for reconstructing the image reconstructed by the second reconstructing unit into an image of size M × N. apparatus.
【請求項6】 M×Nの大きさを持つ画像をm×nの大
きさのブロックに分割処理する分割手段と、 該分割手段で分割したm×nに満たない大きさの画像の
大きさを記憶する記憶手段と、 前記分割手段で分割したm×nに満たない大きさの画像
をm×nの大きさに再構成する第1の再構成手段と、 前記分割手段で分割したm×nのブロック及び前記第1
の再構成手段で再構成したm×nのブロックをエンコー
ドするエンコード手段と、 該エンコード手段でエンコードした画像をm×nのブロ
ックにデコードするデコード手段と、 前記第1の再構成手段で再構成したブロックを識別する
識別手段と、 前記記憶手段に記憶された再構成ブロックの大きさに従
って前記デコード手段でデコードした画像を再構成する
第2の再構成手段と、 該第2の再構成手段で再構成した画像をM×Nの大きさ
の画像に復元する復元手段とを備えることを特徴とする
画像処理装置。
6. A dividing means for dividing an image having a size of M × N into blocks having a size of m × n, and a size of an image having a size smaller than m × n divided by the dividing means. A first reconstructing unit for reconstructing an image of a size smaller than m × n divided by the dividing unit into a size of m × n, and m × divided by the dividing unit. n blocks and the first
Encoding means for encoding the m × n blocks reconstructed by the reconstructing means, decoding means for decoding the image encoded by the encoding means into m × n blocks, and reconstructing by the first reconstructing means. The identification means for identifying the selected block, the second reconstruction means for reconstructing the image decoded by the decoding means according to the size of the reconstruction block stored in the storage means, and the second reconstruction means. An image processing apparatus, comprising: a restoration unit that restores a reconstructed image into an image having a size of M × N.
JP21563993A 1993-08-31 1993-08-31 Picture processing method and its device Withdrawn JPH0774969A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP21563993A JPH0774969A (en) 1993-08-31 1993-08-31 Picture processing method and its device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP21563993A JPH0774969A (en) 1993-08-31 1993-08-31 Picture processing method and its device

Publications (1)

Publication Number Publication Date
JPH0774969A true JPH0774969A (en) 1995-03-17

Family

ID=16675741

Family Applications (1)

Application Number Title Priority Date Filing Date
JP21563993A Withdrawn JPH0774969A (en) 1993-08-31 1993-08-31 Picture processing method and its device

Country Status (1)

Country Link
JP (1) JPH0774969A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008259224A (en) * 2002-06-06 2008-10-23 Matsushita Electric Ind Co Ltd Variable length encoding method and variable length decoding method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008259224A (en) * 2002-06-06 2008-10-23 Matsushita Electric Ind Co Ltd Variable length encoding method and variable length decoding method

Similar Documents

Publication Publication Date Title
JPH0636182B2 (en) Image filing / search method and device
JPH07143490A (en) Image compander
JPH0774969A (en) Picture processing method and its device
WO2010031259A1 (en) Method and device for decoding and scaling images, image displaying system
JP4109151B2 (en) Image processing device
JP2918360B2 (en) Inverse quantization method and image data restoration device
JP2839392B2 (en) Image data restoration method and apparatus
JPH0488749A (en) Picture processor
JP3437346B2 (en) Image encoding / decoding device
JPH11127356A (en) Image iterated conversion decoding device, its method and recording medium
JPH09219782A (en) Printing data generating device
JPH07264591A (en) Scanning method for original image data
JPH10136363A (en) Compressed data decoder and compressed data decoding method
JPH06291987A (en) Picture output device
JPH06292023A (en) Color picture processor
JP2000270192A (en) Image processing unit and its method
JPH07154603A (en) Picture processor and picture processing method using it
JPH07226848A (en) Picture signal encoding device
JPH07184063A (en) Binary image compression system
JPH0286267A (en) Semiconductor memory
JPH09247424A (en) Image processor and its method
JPH0955848A (en) Picture data processor
JPH06225123A (en) High speed restoring method for picture data
JPH05110832A (en) Restoration display system for picture
JPH0774923A (en) Image output device

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20001031