JP2022086187A - Image processing device, image processing device, image processing method, and program - Google Patents

Image processing device, image processing device, image processing method, and program Download PDF

Info

Publication number
JP2022086187A
JP2022086187A JP2020198070A JP2020198070A JP2022086187A JP 2022086187 A JP2022086187 A JP 2022086187A JP 2020198070 A JP2020198070 A JP 2020198070A JP 2020198070 A JP2020198070 A JP 2020198070A JP 2022086187 A JP2022086187 A JP 2022086187A
Authority
JP
Japan
Prior art keywords
image data
output
input
processing
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
JP2020198070A
Other languages
Japanese (ja)
Inventor
明洋 吉谷
Akihiro Yoshitani
友貴 小林
Tomoki Kobayashi
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 JP2020198070A priority Critical patent/JP2022086187A/en
Publication of JP2022086187A publication Critical patent/JP2022086187A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

To provide an image processing device having excellent processing performance and being able to be configured at low cost.SOLUTION: An image processing device 100 includes transfer means (input DMAC 103) for dividing and transferring original image data representing an original image into image data consisting of a certain number of lines along a main scanning direction, and variable magnification processing means (variable magnification processing unit 1041) for setting the image data transferred from the transfer means as input image data in a processing unit, and executing variable magnification processing for the input image data at a preset magnification to generate variable magnification image data (magnification processing means). The variable magnification processing means includes output setting means for setting the number of output lines to be output from the variable magnification processing means, and from among the variable magnification image data that can be generated using the input image data, image data limited to the number of output lines set by the output setting means is output as the output image data.SELECTED DRAWING: Figure 1

Description

本発明は、入力画像データに対して変倍処理を行う画像処理装置、画像処理方法、及びプログラムに関する。 The present invention relates to an image processing apparatus, an image processing method, and a program for performing scaling processing on input image data.

デジタル複写機等に設けられている画像処理装置では、原稿画像データの縮小・拡大等の変倍処理を行う機能が備えられている。原稿画像データの変倍処理では、画像全体のデータを処理単位とせず、画面全体を垂直方向に帯状に分割したバンドと称する複数ライン分の画像データを処理単位とし、作業用のメモリからバンド毎にデータを順に読み出して変倍処理することが行われている。また、画像処理装置では、変倍処理された画像データに対し、圧縮処理、量子化処理等の処理を行う処理部が変倍処理部の後段に設けられているものがある。 The image processing device provided in a digital copier or the like is provided with a function of performing scaling processing such as reduction / enlargement of original image data. In the scaling processing of the original image data, the data of the entire image is not used as the processing unit, but the image data of multiple lines called bands in which the entire screen is vertically divided into bands is used as the processing unit, and each band is used from the working memory. The data is read out in order and scaled. Further, in some image processing devices, a processing unit that performs processing such as compression processing and quantization processing on the image data that has been scaled is provided after the scaling processing unit.

変倍処理部の後段に設けられた処理部(以下、後段処理部という)としては、例えば、JPEG圧縮部やディザ処理部などがあるが、これらの後段処理部では、一定ライン数(8か16ライン)単位で処理を行うものがある。このため、変倍処理部で変倍処理した画像データを、後段処理部に直接入力させるためには、変倍処理部から出力される画像データを後段処理の処理単位にあわせた一定ライン数からなる画像データを出力させる必要がある。 Examples of the processing unit provided after the variable magnification processing unit (hereinafter referred to as the post-stage processing unit) include a JPEG compression unit and a dither processing unit. In these post-stage processing units, a fixed number of lines (8 or more) 16 lines) There are some that perform processing in units. Therefore, in order to directly input the image data that has been scaled by the scaling processing unit to the post-stage processing unit, the image data output from the scaling processing unit is input from a fixed number of lines according to the processing unit of the post-stage processing. It is necessary to output the image data.

特許文献1には、変倍処理部から常に一定ライン数の画像データを出力する技術が開示されている。具体的には、変倍後の出力ライン数が一定になるように、変倍処理部へ入力するライン数を入力バンド毎に変更している。これによれば、変倍処理部から出力された画像データをバッファメモリを介さずに、直接、後段処理に入力することが可能になる。 Patent Document 1 discloses a technique for constantly outputting a fixed number of lines of image data from a scaling processing unit. Specifically, the number of lines to be input to the scaling processing unit is changed for each input band so that the number of output lines after scaling becomes constant. According to this, the image data output from the scaling processing unit can be directly input to the subsequent processing without going through the buffer memory.

特開2006-135565号公報Japanese Unexamined Patent Publication No. 2006-135565

しかしながら、特許文献1においては、変倍処理部へ入力する各入力バンドのライン数を変化させるための回路構成または処理工程が必要になり、装置コストの増大や処理性能の低下を招くという課題がある。 However, Patent Document 1 requires a circuit configuration or a processing process for changing the number of lines of each input band input to the scaling processing unit, which causes an increase in equipment cost and a decrease in processing performance. be.

そこで、本発明は、処理性能及びに優れ、低コストに構成することが可能な画像処理装置及び画像処理方法の提供を目的とする。 Therefore, an object of the present invention is to provide an image processing apparatus and an image processing method which are excellent in processing performance and can be configured at low cost.

本発明は、元画像を表す元画像データを主走査方向に沿った一定数のラインからなる画像データに分割して転送する転送手段と、前記転送手段から転送された前記画像データを処理単位の入力画像データとし、当該入力画像データに対して予め設定された倍率で変倍処理を施し、変倍画像データを生成可能とする変倍処理手段と、前記変倍処理手段から出力させるべき出力ライン数を設定する出力設定手段と、を備え、前記変倍処理手段は、前記入力画像データを用いて生成可能な変倍画像データのうち、前記出力設定手段により設定された出力ライン数に制限した画像データを出力画像データとして出力することを特徴とする画像処理装置である。 The present invention has a transfer means for dividing and transferring the original image data representing the original image into image data consisting of a certain number of lines along the main scanning direction, and the image data transferred from the transfer means as a processing unit. A scaling processing means that can generate scaling image data by performing scaling processing on the input image data at a preset magnification as input image data, and an output line to be output from the scaling processing means. The variable magnification processing means includes an output setting means for setting the number, and the scaling processing means is limited to the number of output lines set by the output setting means among the variable magnification image data that can be generated using the input image data. It is an image processing device characterized by outputting image data as output image data.

本発明によれば、処理性能に優れ、低コストに構成することが可能な画像処理装置及び画像処理方法を提供することができる。 According to the present invention, it is possible to provide an image processing apparatus and an image processing method which are excellent in processing performance and can be configured at low cost.

第1及び第2実施形態における画像処理装置の全体構成を示すブロック図である。It is a block diagram which shows the whole structure of the image processing apparatus in 1st and 2nd Embodiment. 入力DMACの動作を説明するための概念図である。It is a conceptual diagram for demonstrating the operation of the input DMAC. 変倍処理部に入力される入力画素及び変倍処理された出力画素を示す図である。It is a figure which shows the input pixel which is input to a variable magnification processing unit, and the output pixel which has undergone a variable magnification processing. 第1比較例により複数バンドの画像データを変倍処理した状態を示す図である。It is a figure which shows the state which the image data of a plurality of bands was scaled by the 1st comparative example. 第2比較例により複数バンドの画像データを変倍処理した状態を示す図である。It is a figure which shows the state which the image data of a plurality of bands was scaled by the 2nd comparative example. 本実施形態により複数バンドの画像データを変倍 処理した状態を示す図である。It is a figure which shows the state which the image data of a plurality of bands was scaled by this embodiment. 本実施形態による変倍処理のアルゴリズムを示すフローチャートである。It is a flowchart which shows the algorithm of the scaling process by this embodiment. 第3実施形態及び第3比較例における画像処理装置の全体構成を示すブロック図である。It is a block diagram which shows the whole structure of the image processing apparatus in 3rd Embodiment and 3rd comparative example.

以下、本発明の実施の形態について、図面を参照しつつ詳細に説明する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

(第1実施形態)
図1は、本発明の第1実施形態における画像処理装置100の全体構成を示すブロック図である。本実施形態では、画像処理装置として、原稿画像を読み取って元画像データを生成し、その生成した元画像データを記録媒体に出力する複写機としての機能を有するものを例に採り説明する。
(First Embodiment)
FIG. 1 is a block diagram showing the overall configuration of the image processing apparatus 100 according to the first embodiment of the present invention. In the present embodiment, an image processing device having a function as a copying machine that reads a manuscript image, generates original image data, and outputs the generated original image data to a recording medium will be described as an example.

図1において、画像処理装置100は、後述の各部の動作を統括的に制御するCPU101を有する。また、画像処理装置100には、スキャナ102、入力DMAC103、スキャナ画像処理部104、JPEG圧縮器105、JPEG伸張器106、プリンタ画像処理部107、プリンタ108、メインメモリ130、及びバス150を備える。 In FIG. 1, the image processing device 100 has a CPU 101 that comprehensively controls the operation of each part described later. Further, the image processing apparatus 100 includes a scanner 102, an input DMAC 103, a scanner image processing unit 104, a JPEG compressor 105, a JPEG decompressor 106, a printer image processing unit 107, a printer 108, a main memory 130, and a bus 150.

スキャナ102は、原稿をスキャンしてRGB多値の画素からなるビットマップ画像データ(元画像データ)を得る画像取得手段として機能する。但し、画像取得手段は、スキャナに限らず、ラスタ順に他の装置から画像データを得ることのできるi/fであってもよい。スキャナ102によって取得したビットマップ画像データは、メインメモリ130に一旦格納される。また、メインメモリ130は、後述の各部での各部の処理結果を一時的に保存するもの記憶手段であり、通常はDRAMで構成される。 The scanner 102 functions as an image acquisition means for scanning a document to obtain bitmap image data (original image data) composed of RGB multi-valued pixels. However, the image acquisition means is not limited to the scanner, and may be an i / f that can acquire image data from other devices in the order of raster. The bitmap image data acquired by the scanner 102 is temporarily stored in the main memory 130. Further, the main memory 130 is a storage means for temporarily storing the processing results of each part in each part described later, and is usually composed of a DRAM.

入力DMAC(Direct Memory Access Controller)103は、メインメモリ130に格納されたRGBビットマップデータを、メインメモリ130からバンド単位で読み出してスキャナ画像処理部104へ供給する。ここでバンドとは、スキャナ102によって取得される原稿画像全体のデータを、縦方向において帯状に分割した画像データを指す。このバンドは、縦方向と交差する横方向に並ぶ画素からなる横ラインを複数備え、これが後述の画像処理の処理単位となる。なお、以下の説明において、横ラインは、単にラインともいう。また、このライン(横ライン)と区別するため、画像データにおいて縦方向に並ぶ画素からなるラインについては縦ラインと称す。 The input DMAC (Direct Memory Access Controller) 103 reads RGB bitmap data stored in the main memory 130 in band units from the main memory 130 and supplies the data to the scanner image processing unit 104. Here, the band refers to image data obtained by dividing the data of the entire original image acquired by the scanner 102 into strips in the vertical direction. This band includes a plurality of horizontal lines composed of pixels arranged in the horizontal direction intersecting the vertical direction, and this is a processing unit for image processing described later. In the following description, the horizontal line is also simply referred to as a line. Further, in order to distinguish from this line (horizontal line), a line composed of pixels arranged in the vertical direction in image data is referred to as a vertical line.

スキャナ画像処理部104は、メインメモリ130から読み出されたRGB画像データに対して、色調整やエッジ強調、変倍などの画像処理を所定数のバンド毎に行う。なお、本実施形態において変倍処理は1バンド毎に処理を行う。また、スキャナ画像処理部104の内部には、各バンド毎にRGB画像データの補間変倍処理を行う変倍処理部(変倍処理手段)1041が設けられている。変倍処理部1041は、入力DMAC103から入力された一定ライン数のバンドに対して変倍処理を行い、所定数の横ラインからなる変倍処理後の画像データ(変倍画像データ)を後段のJPEG圧縮器105に出力する。 The scanner image processing unit 104 performs image processing such as color adjustment, edge enhancement, and scaling on the RGB image data read from the main memory 130 for each predetermined number of bands. In this embodiment, the scaling process is performed for each band. Further, inside the scanner image processing unit 104, a scaling processing unit (magnification processing means) 1041 that performs interpolation scaling processing of RGB image data for each band is provided. The scaling processing unit 1041 performs scaling processing on a band having a fixed number of lines input from the input DMAC 103, and obtains image data (magnification image data) after scaling consisting of a predetermined number of horizontal lines in the subsequent stage. Output to JPEG compressor 105.

JPEG圧縮器105は、MCU(Minimum Code Unit)の高さに等しい所定ライン数の画像データ(出力バンドデータ)に対してJPEG圧縮を行う。このため、スキャナ画像処理部104からJPEG圧縮器105へと出力される処理後のRGB画像データのライン数は、MCUの高さに等しいライン数を出力することが必要となる。JPEG圧縮器105から出力される圧縮後の画像データ(JPEGデータ)は、メインメモリ130に格納される。JPEG伸張器106は、メインメモリ130に格納されたJPEGデータを読み出してこれを伸長してRGBデータに戻す。このRGBデータは再びメインメモリ130に格納される。 The JPEG compressor 105 performs JPEG compression on image data (output band data) having a predetermined number of lines equal to the height of the MCU (Minimum Code Unit). Therefore, it is necessary to output the number of lines of the processed RGB image data output from the scanner image processing unit 104 to the JPEG compressor 105 to be equal to the height of the MCU. The compressed image data (JPEG data) output from the JPEG compressor 105 is stored in the main memory 130. The JPEG decompressor 106 reads out the JPEG data stored in the main memory 130, decompresses the JPEG data, and returns the JPEG data to the RGB data. This RGB data is stored in the main memory 130 again.

プリンタ画像処理部107は、RGBデータをメインメモリ130から読み出して、プリンタ108で使用されるCMYK色空間への変換及び量子化等の処理を行う。プリンタ108は、プリンタ画像処理部107で量子化されたCMYKデータに基づいて記録用紙等の記録媒体に画像の記録を行う。プリンタ108としては、インクを吐出して記録を行うインクジェットプリンタ等がある。但し、プリンタの種類は特に限定されるものではなく、他の形態のプリンタ、例えば電子写真方式を用いたプリンタ等も適用可能である。 The printer image processing unit 107 reads RGB data from the main memory 130, and performs processing such as conversion to the CMYK color space used in the printer 108 and quantization. The printer 108 records an image on a recording medium such as recording paper based on the CMYK data quantized by the printer image processing unit 107. As the printer 108, there is an inkjet printer or the like that ejects ink for recording. However, the type of printer is not particularly limited, and other forms of printers, for example, printers using an electrophotographic method, and the like can also be applied.

図2は、本実施形態における入力DMAC103が、メインメモリ130に格納されている画像データを読み出し、入力DMAC103の後段のスキャナ画像処理部104へ画素単位のデータを転送する転送処理を示す図である。 FIG. 2 is a diagram showing a transfer process in which the input DMAC 103 in the present embodiment reads out the image data stored in the main memory 130 and transfers the data in pixel units to the scanner image processing unit 104 in the subsequent stage of the input DMAC 103. ..

メインメモリ130には、入力画像幅のRGB画像データを複数ライン分(後述の入力バンドの2バンドB1、B2分)格納できる領域が確保されている。この領域をスキャンバッファ1301と称す。スキャナ102からは、横ライン毎に出力されるデータが、スキャンバッファへ順次格納される。 The main memory 130 secures an area capable of storing RGB image data having an input image width for a plurality of lines (two bands B1 and B2 of the input band described later). This area is referred to as scan buffer 1301. The data output from the scanner 102 for each horizontal line is sequentially stored in the scan buffer.

入力DMAC103は、内部にHV変換メモリ1031を持つ。このHV変換メモリ1031は、「DRAMバースト長のバイト数」×「入力バンドの高さ(入力バンドの横ライン数)」分の容量を持つ。この容量に相当する画像データを、ここではHV(Horizontal-Vertical)ブロックと称す。 The input DMAC 103 has an HV conversion memory 1031 inside. The HV conversion memory 1031 has a capacity corresponding to "the number of bytes of the DRAM burst length" x "the height of the input band (the number of horizontal lines of the input band)". The image data corresponding to this capacity is referred to as an HV (Horizontal-Vertical) block here.

入力DMAC103は、スキャンバッファ1301内に格納された入力バンドB1の左上端からDRAMバースト長(32バイト等)の単位で画像データを読み出してHV変換メモリ1031へ書き込む。このときの、スキャンバッファ1301からの画像データの読み出しは、図2(a)の破線矢印に示すように、入力バンドB1において、DRAMバースト長に相当するバイト数分の画像データ(1つの横ライン分の画像データ)を読み出す。そして、DRAMバースト長分の画像データを読み出す毎に、バンド内の次の横ライン(図中、下の横ライン)へと移動して、その横ラインの画像データを読み出す。この処理を入力バンドB1の高さ分(横ライン数分)繰り返す。そして、入力バンドB1の下端のラインの読み出しが行われると(つまり、HVブロック1つ分の読み出しが行われると)、次の入力バンドB2の最初の横ラインに移行し、その入力バンドB2の画像データを入力バンドB1と同様に順次読み出す。 The input DMAC 103 reads image data in units of DRAM burst length (32 bytes or the like) from the upper left end of the input band B1 stored in the scan buffer 1301 and writes the image data to the HV conversion memory 1031. At this time, the image data is read from the scan buffer 1301 in the input band B1 for the number of bytes corresponding to the DRAM burst length (one horizontal line) as shown by the broken line arrow in FIG. 2 (a). Read the minute image data). Then, each time the image data corresponding to the DRAM burst length is read, the image data is moved to the next horizontal line (lower horizontal line in the figure) in the band, and the image data of the horizontal line is read. This process is repeated for the height of the input band B1 (for the number of horizontal lines). Then, when the line at the lower end of the input band B1 is read (that is, when one HV block is read), the process shifts to the first horizontal line of the next input band B2, and the input band B2 The image data is sequentially read out in the same manner as the input band B1.

スキャンバッファ1301から読み出された画像データは、図2(b)の破線矢印に示されるように、HV変換メモリ1031に順次格納される。入力DMAC103は、内部のHV変換メモリ1031に1つのHVブロック分のデータが格納されると、次に、図2(c)の破線矢印に示すように、HVブロックの左上端から画像の縦ライン方向に1画素ずつ画像データ(画素データ)を読み出す。そして、読み出した画像データを次段に設けられているスキャナ画像処理部104へ転送する。なお、ここでいう縦ラインとは、前述の横ラインと直交する方向に沿って配列された複数の画素からなるラインを指す。また、以下の説明において、縦ラインに沿う方向を副走査方向、横ラインに沿う方向を主走査方向ともいう。 The image data read from the scan buffer 1301 is sequentially stored in the HV conversion memory 1031 as shown by the broken line arrow in FIG. 2 (b). When the data for one HV block is stored in the internal HV conversion memory 1031 of the input DMAC 103, then, as shown by the broken arrow in FIG. 2 (c), the vertical line of the image from the upper left end of the HV block. Image data (pixel data) is read out one pixel at a time in the direction. Then, the read image data is transferred to the scanner image processing unit 104 provided in the next stage. The vertical line referred to here refers to a line consisting of a plurality of pixels arranged along a direction orthogonal to the above-mentioned horizontal line. Further, in the following description, the direction along the vertical line is also referred to as a sub-scanning direction, and the direction along the horizontal line is also referred to as a main scanning direction.

HV変換メモリ1031に格納されている1バンド分の画像データの中の1番目の縦ライン(図中、左端に位置するライン)の画像データの読み出し・転送が終了すると、その1番目の縦ラインの右側に隣接する2番目の縦ラインへ移行する。そして、2番目のラインの上端の画素データから順次画素データの読み出し・転送を行う。この処理を繰り返し、1つのHVブロック分の画像データ、すなわち1バンド分の画像データがスキャナ画像処理部104に転送する。 When the reading / transfer of the image data of the first vertical line (the line located at the left end in the figure) in the image data for one band stored in the HV conversion memory 1031 is completed, the first vertical line is completed. Move to the second vertical line adjacent to the right side of. Then, the pixel data is sequentially read and transferred from the pixel data at the upper end of the second line. This process is repeated, and the image data for one HV block, that is, the image data for one band is transferred to the scanner image processing unit 104.

以上の処理によって、例えば、図2(a)に示す1つの入力バンドB1の画像データがスキャナ画像処理部104に転送されると、次に、1つ右の入力バンドB2分の画像データ(HVブロック分の画像データ)をスキャンバッファ1301から読み出す。そして、読み出したデータをHV変換メモリ1031に一旦格納する。そして、先に転送したバンドB1に対する画像処理の進行に応じて、HV変換メモリ1031に格納された入力バンドB2分の画像データが読み出され、スキャナ画像処理部104へ転送される。この処理を入力バンドの右下端まで繰り返す。 By the above processing, for example, when the image data of one input band B1 shown in FIG. 2A is transferred to the scanner image processing unit 104, the image data (HV) for the input band B2 on the right side is next. (Image data for blocks) is read from the scan buffer 1301. Then, the read data is temporarily stored in the HV conversion memory 1031. Then, the image data for the input band B2 stored in the HV conversion memory 1031 is read out and transferred to the scanner image processing unit 104 according to the progress of the image processing for the previously transferred band B1. This process is repeated up to the lower right corner of the input band.

このように、入力DMAC103からスキャナ画像処理部104へは入力バンド毎に縦ラインを構成する画像データが、1画素ずつのRGBデータとして転送される。この際、スキャナ画像処理部104では、変倍処理部1041も含めた複数のサブブロック(変倍処理部以外は図示せず)の各々では、入力された画素データに対して順次処理を行う。すなわち、1つのサブブロックで処理された結果を次段のサブブロックへ転送するという処理を、1画素毎にパイプラインで繰り返し処理を行う。 In this way, the image data constituting the vertical line for each input band is transferred from the input DMAC 103 to the scanner image processing unit 104 as RGB data for each pixel. At this time, in the scanner image processing unit 104, each of the plurality of sub-blocks (not shown except the scaling processing unit) including the scaling processing unit 1041 sequentially processes the input pixel data. That is, the process of transferring the result processed in one subblock to the next subblock is repeated in the pipeline for each pixel.

図3は、変倍処理部1041における入出力バンド、及び変倍処理における入力画素と出力画素との関係を示す図である。ここではHV変換メモリ1031に格納された6本の横ラインからなる入力バンドの画像データを、図2(c)に示すように変倍処理部1041へ縦ライン順に入力し、その画像データを変倍処理部1041で縮小する場合を示している。ここでいう縮小とは、画素数を減らすことであり、これはすなわち、解像度を小さくすることであるため、各画素の大きさは大きくなると考えることができる。以下、変倍処理について、縮小処理を例に採り説明する。 FIG. 3 is a diagram showing an input / output band in the scaling processing unit 1041 and a relationship between an input pixel and an output pixel in the scaling processing. Here, the image data of the input band consisting of six horizontal lines stored in the HV conversion memory 1031 is input to the scaling processing unit 1041 in the order of vertical lines as shown in FIG. 2 (c), and the image data is changed. The case where the reduction is performed by the double processing unit 1041 is shown. The reduction referred to here is to reduce the number of pixels, that is, to reduce the resolution, so that the size of each pixel can be considered to be large. Hereinafter, the scaling process will be described by taking the reduction process as an example.

図3(a)は、変倍処理部1041への入力画素Piの位置を示し、図3(b)は、変倍処理部1041から出力される出力画素Poの位置を示している。図3(a)では、縦ライン方向(Y方向)に6画素(0番~5番の画素)の画像データが変倍処理部1041に入力された時点で、入力画素Piの入力位置を右へ1画素分、上へ5画素分移動し、その後、6~11の入力画素が縦ライン方向に沿って順次入力される。この動作を1入力バンド分の画像データが入力されるまで繰り返す。また、図3(b)は、入力バンドの画像データに変倍処理を施すことによって得られる出力バンドを示している。ここでは、図3(a)に示す6本の横ラインからなる入力バンドに対し、4本の横ラインからなる出力バンドを出力する。すなわち、図3(b)では、縦ライン方向(Y方向)に沿って、0番~3番の4つの出力画素が出力された時点で、出力画素Poの出力位置を右へ1画素分、上へ3画素分移動し、その後、4番~7番の出力画素を出力する。この動作を1入力バンド分の入力画像データを用いて繰り返す。 FIG. 3A shows the position of the input pixel Pi to the scaling processing unit 1041, and FIG. 3B shows the position of the output pixel Po output from the scaling processing unit 1041. In FIG. 3A, when the image data of 6 pixels (pixels 0 to 5) is input to the scaling processing unit 1041 in the vertical line direction (Y direction), the input position of the input pixel Pi is set to the right. It moves up by 1 pixel and 5 pixels upward, and then 6 to 11 input pixels are sequentially input along the vertical line direction. This operation is repeated until image data for one input band is input. Further, FIG. 3B shows an output band obtained by subjecting the image data of the input band to scaling processing. Here, the output band consisting of four horizontal lines is output with respect to the input band consisting of six horizontal lines shown in FIG. 3A. That is, in FIG. 3B, when the four output pixels 0 to 3 are output along the vertical line direction (Y direction), the output position of the output pixel Po is set to the right by one pixel. It moves up by 3 pixels, and then outputs the 4th to 7th output pixels. This operation is repeated using the input image data for one input band.

ここで、図3(c)を参照しつつ、入力画素Piの画素値に対する出力画素Poの画素値の計算方法を説明する。なお、図3(c)において、Pi(0)は、図3(a)における0番の入力画素Piを示している。同様に、Pi(1)、Pi(6)、Pi(7)は、1番、6番、7番の入力画素Piをそれぞれ示している。また、Po(0)は、図3(b)に示す0番の出力画素Poを示している。以下の説明では、不図示の他の画素についても同様の表記を行う。 Here, a method of calculating the pixel value of the output pixel Po with respect to the pixel value of the input pixel Pi will be described with reference to FIG. 3 (c). In addition, in FIG. 3C, Pi (0) shows the 0th input pixel Pi in FIG. 3A. Similarly, Pi (1), Pi (6), and Pi (7) indicate the input pixels Pi of Nos. 1, 6, and 7, respectively. Further, Po (0) indicates the 0th output pixel Po shown in FIG. 3 (b). In the following description, the same notation is used for other pixels (not shown).

出力画素Poの画素値は、当該出力画素Poを包含する4つの入力画素Piが入力されることによって計算することができる。図3(a)、(b)の例では、7番の入力画素Pi(7)が入力されることによって出力画素Po(0)の画素値を計算することができる。同様に、入力画素Pi(8)が入力された時点で出力画素Po(1)の画素値を、入力画素Pi(13)が入力された時点で出力画素Po(4)の画素値を計算することができる。 The pixel value of the output pixel Po can be calculated by inputting four input pixels Pi including the output pixel Po. In the examples of FIGS. 3A and 3B, the pixel value of the output pixel Po (0) can be calculated by inputting the 7th input pixel Pi (7). Similarly, the pixel value of the output pixel Po (1) is calculated when the input pixel Pi (8) is input, and the pixel value of the output pixel Po (4) is calculated when the input pixel Pi (13) is input. be able to.

また、図3(c)では、出力画素Po(0)の周辺の4つの画素Pi(0)、Pi(1)、Pi(6)、Pi(7)のそれぞれの中心の点をA、B、C、Dとし、出力画素Po(0)の中心の点をPとする。さらに、点Eは、点A、Bそれぞれの主走査方向に一次元の線形補間を行った点、点Fは、点C、Dの主走査方向に一次元の線形補間を行った点とする。この場合、点Pは点E、Fの副走査方向に一次元の線形補間を行うことにより求められる。 Further, in FIG. 3C, the central points of the four pixels Pi (0), Pi (1), Pi (6), and Pi (7) around the output pixel Po (0) are A and B. , C, D, and let P be the center point of the output pixel Po (0). Further, point E is a point where one-dimensional linear interpolation is performed in the main scanning directions of points A and B, and point F is a point where one-dimensional linear interpolation is performed in the main scanning directions of points C and D. .. In this case, the point P is obtained by performing one-dimensional linear interpolation in the sub-scanning direction of the points E and F.

点Pの位置は、点AB間の距離をbase(固定値、例えば8192)、点AC間の距離を同じくbaseとした平面上の座標で表され、点Aを原点とすると、点Aの座標は(0,0)、点Dの座標は(base,base)となる。 The position of the point P is represented by coordinates on a plane in which the distance between the points AB is a base (fixed value, for example, 8192) and the distance between the points AC is also a base. Is (0,0), and the coordinates of the point D are (base, base).

この座標系での画素Pの画素値は、以下の計算で求められる。点A、B、C、D、E、F、Pの画素値をそれぞれa、b、c、d、e、f、pとする。また、点Pの主走査方向(X方向)の位置は、点AB間をbaseとしたときの点Aからの距離hphaseで表し、点Pの副走査方向の位置は、点AC間をbaseとした時の点Aからの距離vphaseで表す。 The pixel value of the pixel P in this coordinate system is obtained by the following calculation. Let the pixel values of points A, B, C, D, E, F, and P be a, b, c, d, e, f, and p, respectively. Further, the position of the point P in the main scanning direction (X direction) is represented by the distance hphase from the point A when the point AB is the base, and the position of the point P in the sub-scanning direction is the base between the points AC. It is expressed by the distance vphase from the point A at the time of.

ここで、点Pの画素値は以下の式で表される。
e=a+(b-a)×hphase/base
f=c+(d-c)×vphase/base
p=e+(f-e)×vphase/base
なお、図3(c)では各画素の位置を、各画素の中心の座標で示しているが、各画素の左上端の座標で示したとしても各画素の相対位置は同じであり、前述の計算結果は同じとなる。このため、以降の説明では各画素の左上位置(Aに対するA’)をその画素の位置を示す座標とする。
Here, the pixel value of the point P is expressed by the following equation.
e = a + (baa) × hphase / base
f = c + (dc) × vphase / base
p = e + (fe) × vface / base
Although the position of each pixel is shown by the coordinates of the center of each pixel in FIG. 3C, the relative position of each pixel is the same even if it is shown by the coordinates of the upper left end of each pixel, as described above. The calculation result is the same. Therefore, in the following description, the upper left position of each pixel (A'with respect to A) is used as the coordinates indicating the position of the pixel.

また、入力バンドの左上端の入力画素においては、初期座標値を(hphase_base,vphase_base)として指定することも可能である。初期座標値を0として処理を開始すると、1/n(nは整数)の縮小時に各phase値が常に0となって補間演算が行われず、結果的に間引き縮小となって出力画像の画質が低下する。初期座標値を(hphase_base,vphase_base)として指定すれば画質低下を回避することがでる。但し、hphase_baseの指定は本実施形態の特徴的処理とは無関係であるため、0として以降の説明を行う。なお、vphase_baseの値は、入力バンド毎に生成される出力画像の位相を合わせるため、入力バンド毎に、直前の入力バンドにおいて生成された出力画像のラインの座標値を基準に設定される。 Further, in the input pixel at the upper left end of the input band, the initial coordinate value can be specified as (hphase_base, vphase_base). When the processing is started with the initial coordinate value set to 0, each phase value is always 0 at the time of reduction of 1 / n (n is an integer) and the interpolation calculation is not performed, resulting in thinning reduction and the image quality of the output image. descend. If the initial coordinate values are specified as (hphase_base, vphase_base), deterioration of image quality can be avoided. However, since the designation of hphase_base is irrelevant to the characteristic processing of this embodiment, the following description will be given with 0. The value of vphase_base is set for each input band based on the coordinate value of the line of the output image generated in the immediately preceding input band in order to match the phase of the output image generated for each input band.

次に、複数のバンドの画像データに対する変倍処理について説明する。なお、以下の説明では、本実施形態において実行する変倍処理の特徴を明確にするため、まず、本実施形態の比較例において実行されている従来の変倍処理を説明し、その後、本実施形態において実行する変倍処理を説明する。 Next, scaling processing for image data of a plurality of bands will be described. In the following description, in order to clarify the characteristics of the scaling process executed in the present embodiment, first, the conventional scaling process executed in the comparative example of the present embodiment will be described, and then the present embodiment will be described. The scaling process executed in the form will be described.

<第1比較例の変倍処理>
図4は、第1比較例によって複数の入力バンドを変倍処理を模式的に示す図である。ここでは、副走査方向(Y方向)における変倍率(倍率)を、baseに対する相対値magvで与える。例えば、base=8192とすると、80%の縮小を行う場合は、magv=8192/0.8=10240を設定する。図4に示す例では、75%の縮小、つまりmagv=base/0.75=10922を設定したときの処理を示している。ここでは、1バンド目のvphase_base=base/3としている。また、図4~図6において、入力画像及び出力画像の左端の画素に付している番号は、図3のように各画素の処理順を示す番号ではなく、入画像及び出力画像全体における横ラインのライン番号を示している。以下の説明において、ライン番号0のラインを1ライン目のライン、ライン番号1のラインを2ライン目のラインと称し、以下同様とする。
<Scale processing of the first comparative example>
FIG. 4 is a diagram schematically showing scaling processing for a plurality of input bands according to the first comparative example. Here, the variable magnification (magnification) in the sub-scanning direction (Y direction) is given as a relative value magv with respect to the base. For example, if base = 8192 and 80% reduction is to be performed, magv = 8192 / 0.8 = 10240 is set. The example shown in FIG. 4 shows a reduction of 75%, that is, a process when magv = base / 0.75 = 10922 is set. Here, vphase_base = base / 3 of the first band is set. Further, in FIGS. 4 to 6, the numbers attached to the leftmost pixels of the input image and the output image are not the numbers indicating the processing order of each pixel as in FIG. 3, but are horizontal in the entire input image and output image. Shows the line number of the line. In the following description, the line with line number 0 will be referred to as the first line, the line with line number 1 will be referred to as the second line, and the same shall apply hereinafter.

図4の左上端に示すように、入力画像の左上端の座標を(0,0)とし、入力バンド高さを6ラインとする。入力画像の副走査方向の座標値は、0から始まり1画素ごとにbaseずつ加算される。出力画像の副走査方向の座標値は、vphase_baseから始まりmagvずつ加算される。副走査方向の入力により、入力画素の座標値がvphase_base+magv以上になったときに出力画素を取得するための出力処理が可能となる。図4の例では、入力画像の2ライン目のライン(ライン番号1のライン)まで入力されることにより、出力画像の1ライン目(ライン番号0)の出力が可能になる。さらに、入力画像の3ライン目のライン(ライン番号2のライン)まで入力されることにより、出力画像の2ライン目(ライン番号1)の出力が可能となる。同様にLライン目(図では6ライン目)まで入力すると、入力の座標値はL×baseとなり、出力ライン数Mは
M=(L×base-vphase_base)/magv (計算結果は切り捨て)
という計算で得られる。
As shown in the upper left corner of FIG. 4, the coordinates of the upper left corner of the input image are (0,0), and the height of the input band is 6 lines. The coordinate values in the sub-scanning direction of the input image start from 0 and are added by base for each pixel. The coordinate values in the sub-scanning direction of the output image start from vphase_base and are added in magv increments. The input in the sub-scanning direction enables an output process for acquiring an output pixel when the coordinate value of the input pixel becomes vphase_base + magv or more. In the example of FIG. 4, by inputting up to the second line (line number 1) of the input image, the first line (line number 0) of the output image can be output. Further, by inputting up to the third line (line number 2) of the input image, the second line (line number 1) of the output image can be output. Similarly, when inputting up to the Lth line (6th line in the figure), the input coordinate value becomes L × base, and the number of output lines M is M = (L × base-vphase_base) / magv (calculation result is rounded down).
It can be obtained by the calculation.

図4の例では、M=4であり、出力画像の5ライン目は、図示のように入力ライン数が不足しているため、出力することができない。例えば、出力画像の5ライン目を出力するためには、入力画像の7ライン目(ライン番号5のライン)の入力が必要となるが、第1バンドの入力ライン数は6ライン(ライン番号0~5の6ライン)である。このため、第1バンドの入力では入力ライン数が不足し、5ライン目を出力することができない。よって、この第1バンドでは、6ラインの入力に対して、4ラインが出力されることになる。 In the example of FIG. 4, M = 4, and the fifth line of the output image cannot be output because the number of input lines is insufficient as shown in the figure. For example, in order to output the 5th line of the output image, it is necessary to input the 7th line (line number 5) of the input image, but the number of input lines in the first band is 6 lines (line number 0). ~ 5 6 lines). Therefore, the number of input lines is insufficient for the input of the first band, and the fifth line cannot be output. Therefore, in this first band, 4 lines are output for 6 lines of input.

また、前の入力バンドに続く次の入力バンドの変倍処理では、図示のように、前の入力バンドより常に1ライン戻ったラインから入力を行い、次の入力バンドの処理開始時のvphase_baseの値を、
(vphase_base+magv×M)-base×(L-1)
として、前の入力バンドと同様の処理を行う。これにより、前の入力バンドの出力画像に連続して次の出力画像を出力することができる。
Further, in the scaling process of the next input band following the previous input band, as shown in the figure, input is always performed from the line one line back from the previous input band, and vphase_base at the start of processing of the next input band. The value,
(Vphase_base + magv × M) -base × (L-1)
, The same processing as the previous input band is performed. As a result, the next output image can be continuously output to the output image of the previous input band.

以上の処理においては、各入力バンドの入力ライン数は一定であり、かつ、入力バンド間のオフセット(offset)アドレス(ある入力バンドと次の入力バンドの読み出し開始アドレスの差、図4の例では入力画像5ライン分)も一定である。このため、入力DMAC103は比較的単純なアドレス計算で連続動作を行うことが可能である。 In the above processing, the number of input lines of each input band is constant, and the offset address between the input bands (the difference between the read start address of one input band and the next input band, in the example of FIG. 4). (For 5 lines of input image) is also constant. Therefore, the input DMAC 103 can perform continuous operation with a relatively simple address calculation.

ところが、上述の変倍処理を繰り返すと、入力バンドに対応する出力画像のライン数が、magvの値によって一定ではなくなる。これは、入力バンドの処理が進むに従ってvphase_baseの値がバンドごとに変わるため、出力ライン数Mの値
M=(int)(L×base-vphase_base)/magv
が一定ではなくなるためである。図4の例では第3バンドで出力ライン数が3となり、第1バンド及び第2バンドとは出力ライン数が変化してしまう。
However, when the above-mentioned scaling process is repeated, the number of lines of the output image corresponding to the input band is not constant depending on the value of magv. This is because the value of vphase_base changes for each band as the processing of the input band progresses, so the value of the number of output lines M M = (int) (L × base-vbase_base) / magv
Is not constant. In the example of FIG. 4, the number of output lines is 3 in the third band, and the number of output lines is different from that of the first band and the second band.

すなわち第1比較例では、変倍処理部1041に一定のライン数の入力バンドを入力し、バンド毎のオフセットライン数も一定(ここでは、(入力バンドのライン数)-(1ライン))としてバンドごとの変倍処理を行っている。その結果、変倍率magvの値によっては変倍処理部から出力される出力バンドのライン数は一定にならず、ばらつきが生じる。このため、変倍処理部1041の後に一定のライン数の入力を必要とする処理、例えばJPEG圧縮処理に対して、変倍処理部の出力を直接入力させることができないという問題が生じる。この問題を解消する方法として、次に述べる第2比較例が知られている。 That is, in the first comparative example, an input band having a fixed number of lines is input to the scaling processing unit 1041, and the number of offset lines for each band is also fixed (here, (number of lines of input band)-(1 line)). The scaling process is performed for each band. As a result, the number of lines of the output band output from the scaling processing unit is not constant depending on the value of the scaling factor magv, and variations occur. Therefore, there arises a problem that the output of the scaling processing unit cannot be directly input for a process that requires input of a certain number of lines after the scaling processing unit 1041, for example, a JPEG compression process. As a method for solving this problem, the second comparative example described below is known.

<第2比較例>
第2比較例では、一定の出力ライン数が出せるだけの入力ライン数を入力バンド毎に計算し、入力バンド毎に算出したライン数分の画像データをメインメモリから読み出して、変倍処理部に供給することにより、上記の第1比較例における問題を解決している。
<Second comparative example>
In the second comparative example, the number of input lines that can output a certain number of output lines is calculated for each input band, and the image data for the number of lines calculated for each input band is read from the main memory and stored in the scaling processing unit. By supplying the data, the problem in the first comparative example described above is solved.

図5に、第2比較例において実行される変倍処理を示す。ここでは、図4と同様にBase、及びmagvを設定して変倍処理を行う。前述のように、図4に示す処理を行うと、第3バンドで入力ライン数が不足し、出力ライン数が一定(図3では4ライン)ではなくなる。このため、第2比較例では、3バンド目の入力ライン数を、第1、第2バンドと同様の6ラインではなく、1ライン増加させた7ラインとする。すなわち、ライン番号10~15の7ラインを第3バンドとして入力する。これにより、ライン番号14、15の2ラインによってライン番号11の出力ラインの画像データを出力することが可能になり、4ライン(ライン番号8~11の出力ライン)の出力画像を出力することが可能になる。 FIG. 5 shows the scaling process executed in the second comparative example. Here, the scaling process is performed by setting Base and magv in the same manner as in FIG. As described above, when the process shown in FIG. 4 is performed, the number of input lines is insufficient in the third band, and the number of output lines is not constant (4 lines in FIG. 3). Therefore, in the second comparative example, the number of input lines in the third band is 7 lines, which is increased by 1 line, instead of the same 6 lines as in the 1st and 2nd bands. That is, 7 lines of line numbers 10 to 15 are input as the third band. As a result, it becomes possible to output the image data of the output line of the line number 11 by the two lines of the line numbers 14 and 15, and it is possible to output the output image of the four lines (output lines of the line numbers 8 to 11). It will be possible.

しかしながら、第2比較例では次のような問題が生じる。すなわち、第2比較例では、変倍処理部1041への入力バンドのライン数をバンド毎に異ならせる必要がある。このため、変倍処理部(図1の構成では、変倍処理部1041を内包するスキャナ画像処理部104)へ入力バンドの画像データを供給する入力DMAC103の回路構成が、各バンドのライン数を一定とする第2比較例より複雑になる。例えば、入力DMAC103内のHV変換メモリ1031において、図2(b)、(c)に示す画像データの入出力動作を、各バンド毎に変える必要がある。 However, in the second comparative example, the following problems occur. That is, in the second comparative example, it is necessary to make the number of lines of the input band to the scaling processing unit 1041 different for each band. Therefore, the circuit configuration of the input DMAC 103 that supplies the image data of the input band to the scaling processing unit (in the configuration of FIG. 1, the scanner image processing unit 104 including the scaling processing unit 1041) determines the number of lines in each band. It is more complicated than the second comparative example, which is constant. For example, in the HV conversion memory 1031 in the input DMAC 103, it is necessary to change the input / output operation of the image data shown in FIGS. 2 (b) and 2 (c) for each band.

さらに、入力バンド毎にライン数を異ならせることに伴い、隣接する入力バンド間のオフセットライン数も入力バンド毎に変化させる必要があるという問題も生じる。図5の例では、第1バンドから第2バンドの間に設定するオフセットライン数と第2バンドからの第3バンドの間のオフセットライン数は、いずれも5ラインである。しかし、第3バンドから第4バンドの間のオフセットライン数は6ラインであり、オフセットライン数が変化している。このような処理を行うためには、入力バンド毎にオフセットアドレスを計算する必要がある。しかし、オフセットアドレスの計算を入力DMAC103において自動的に行い得るようにするには多くの困難を伴う。 Further, as the number of lines differs for each input band, there arises a problem that the number of offset lines between adjacent input bands also needs to be changed for each input band. In the example of FIG. 5, the number of offset lines set between the first band and the second band and the number of offset lines between the second band and the third band are both five lines. However, the number of offset lines between the third band and the fourth band is 6, and the number of offset lines is changing. In order to perform such processing, it is necessary to calculate the offset address for each input band. However, there are many difficulties in allowing the calculation of the offset address to be performed automatically at the input DMAC 103.

そこで、DMAC103自体はオフセットアドレスの計算をせず、CPU101が入力バンド毎にオフセットアドレスを計算し、計算した値を入力DMAC101にその都度設定する構成とすれば、入力DMAC103の回路構成は単純で済む。しかし、その場合には、各バンドを出力する間に、CPUがオフセットアドレスの計算及び設定を行う時間が必要となる。このため、入力DMAC103が自動計算を行う場合に比べて総処理時間が長くなってしまい、装置全体の処理性能に影響を及ぼすという問題が生じる。そこで、本実施形態では、以下のような変倍処理を実行する。 Therefore, if the DMAC 103 itself does not calculate the offset address, but the CPU 101 calculates the offset address for each input band and sets the calculated value in the input DMAC 101 each time, the circuit configuration of the input DMAC 103 can be simplified. .. However, in that case, it takes time for the CPU to calculate and set the offset address while outputting each band. Therefore, the total processing time becomes longer than when the input DMAC 103 performs automatic calculation, which causes a problem that the processing performance of the entire device is affected. Therefore, in the present embodiment, the following scaling processing is executed.

<第1実施形態における変倍処理>
本実施形態では、以下に挙げる構成により、上記の第1比較例及び第2比較例の問題を解決している。
<Variable magnification processing in the first embodiment>
In the present embodiment, the problems of the first comparative example and the second comparative example described above are solved by the configurations listed below.

i)入力DMAC103によってメインメモリ130から一定数の入力ラインを読み出し、当該読み出した一定数の入力ラインからなる入力バンドを、スキャナ画像処理部104に内包される変倍処理部1041に入力する。 i) Input A fixed number of input lines are read from the main memory 130 by the input DMAC 103, and an input band composed of the read fixed number of input lines is input to the scaling processing unit 1041 included in the scanner image processing unit 104.

ii)変倍処理部1041では、入力された一定ライン数の入力バンドに基づいて生成可能な出力ラインのうち、予め設定した出力ライン数を超える出力ラインに対しては、不要な出力ラインとして出力せず、内部で消滅させる。すなわち、第1変形例及び第2変形例のような既存の変倍処理部では、一定ライン数の入力バンドを入力した場合、変倍後の出力ライン数はNまたはN+1となって出力ライン数にばらつきが生じる。これに対し、本実施形態では、予め定めた設定出力ライン数を上回る数の出力ラインを生成可能な場合であっても、設定した出力ライン数を超える出力ラインは余計な出力ラインとして変倍処理部から出力せず、内部で消滅させる。これにより、変倍処理部の後段へ供給する出力ライン数を一定数(ここではN)とする。 ii) In the scaling processing unit 1041, among the output lines that can be generated based on the input band of a fixed number of input lines, the output lines exceeding the preset number of output lines are output as unnecessary output lines. Do not make it disappear internally. That is, in the existing scaling processing unit such as the first modification and the second modification, when a fixed number of input bands are input, the number of output lines after scaling becomes N or N + 1, and the number of output lines. Will vary. On the other hand, in the present embodiment, even if the number of output lines exceeding the preset number of output lines can be generated, the output lines exceeding the set number of output lines are scaled as extra output lines. It does not output from the part, but disappears internally. As a result, the number of output lines supplied to the subsequent stage of the scaling processing unit is set to a fixed number (here, N).

なお、出力ライン数Nの値は、変倍処理部1041から出力された画像データに対して所定の画像処理を行う後段処理部の画像処理単位に応じて、予め変倍処理部1041内の出力設定手段により一定の出力ライン数に固定されている。但し、画像処理装置100の入力部等によって任意の出力ライン数を設定し得るように構成することも可能である。 The value of the number of output lines N is output in the scaling processing unit 1041 in advance according to the image processing unit of the post-stage processing unit that performs predetermined image processing on the image data output from the scaling processing unit 1041. It is fixed to a fixed number of output lines by the setting means. However, it is also possible to configure the image processing device 100 so that an arbitrary number of output lines can be set by an input unit or the like.

iii)変倍処理部1041において、変倍処理で消費する入力ライン数をカウントしておき、そのカウント値を示す情報を入力DMAC103へ伝達する。入力DMAC103では、その変倍処理部1041から伝達された情報に基づき、次に入力される入力バンドのオフセットアドレスを自動計算し、次の入力バンドの入力ラインを定める。 iii) The scaling processing unit 1041 counts the number of input lines consumed in the scaling processing, and transmits information indicating the count value to the input DMAC 103. The input DMAC 103 automatically calculates the offset address of the input band to be input next based on the information transmitted from the scaling processing unit 1041, and determines the input line of the next input band.

ここで、図6及び図7を用いて、本実施形態における入力DMAC103及び変倍処理部1041で実行される処理を説明する。 Here, with reference to FIGS. 6 and 7, the processing executed by the input DMAC 103 and the scaling processing unit 1041 in the present embodiment will be described.

画像処理装置100の入力部(倍率設定手段)によって設定された倍率(magv)で変倍処理を行うに際し、全ての入力バンドで同一の出力ライン数Mの出力が可能になるような、各バンドの入力ライン数Lを、CPU101により予め計算しておく。vphase_baseの最大値は、base-1であるため、Lは以下の式1によって算出することができる。
L=(int)(((base-1+magv×(M-1))/base)+1) (式1)
ここで、(int)は切り捨て処理を意味する。図5に示す例では、M=4に対してL=7となる。
When performing scaling processing at the magnification (magv) set by the input unit (magnification setting means) of the image processing device 100, each band is capable of outputting the same number of output lines M in all input bands. The number of input lines L of the above is calculated in advance by the CPU 101. Since the maximum value of vphase_base is base-1, L can be calculated by the following equation 1.
L = (int) (((base-1 + magv × (M-1)) / base) +1) (Equation 1)
Here, (int) means a truncation process. In the example shown in FIG. 5, L = 7 with respect to M = 4.

入力DMAC103は、入力バンド毎に常にライン数Lの画像データをメインメモリ130から読み出す。これにより、入力DMAC103は常にLライン分の画像データをスキャナ画像処理部104へ供給すればよくなる。このため、図2に示すHV変換メモリ1031におけるデータの読み出し動作を、第2変形例のように、バンド毎に変える必要がなくなる。従って、本実施形態によれば、第2比較例の動作を実現しようとする場合に比べ、入力DMAC103の構成を大幅に単純化することができる。 The input DMAC 103 always reads image data having the number of lines L for each input band from the main memory 130. As a result, the input DMAC 103 may always supply image data for the L line to the scanner image processing unit 104. Therefore, it is not necessary to change the data reading operation in the HV conversion memory 1031 shown in FIG. 2 for each band as in the second modification. Therefore, according to the present embodiment, the configuration of the input DMAC 103 can be significantly simplified as compared with the case where the operation of the second comparative example is to be realized.

また、変倍処理部1041にLライン分のデータを常に入力して、第1比較例と同様の変倍処理を行った場合には、各入力バンドにおけるvphase_baseの値によって、出力バンドのライン数がMまたはM+1となる。このため、一定数の出力ラインを後段に供給することができない。 Further, when the data for L lines is always input to the scaling processing unit 1041 and the scaling processing similar to that of the first comparative example is performed, the number of lines in the output band is determined by the value of vphase_base in each input band. Is M or M + 1. Therefore, it is not possible to supply a fixed number of output lines to the subsequent stage.

これに対し、本実施形態の変倍処理部1041では、各縦ラインの出力画素数をMで打ち切り、M+1ライン目の出力画素を生成可能な場合には、その出力画素を後段へ出力せず消滅させる。そして、出力座標を1つ右上へ移動し、次の縦ラインの出力画素を上から順次生成し、出力していく。この処理を、入力バンドの全入力画素に対して繰り返す。これにより、各入力バンドに対し変倍処理を施した一定力ライン数の画像データを出力することができる。つまり、本実施形態によれば、変倍処理部1041から後段の処理部(本例では、JPEG圧縮器105)に対し、常に一定ライン数に制限した変倍処理後の画像データを後段に出力することができる。 On the other hand, in the scaling processing unit 1041 of the present embodiment, if the number of output pixels of each vertical line is cut off by M and the output pixel of the M + 1th line can be generated, the output pixel is not output to the subsequent stage. Extinguish. Then, the output coordinates are moved one to the upper right, and the output pixels of the next vertical line are sequentially generated from the top and output. This process is repeated for all the input pixels of the input band. As a result, it is possible to output image data having a constant force line number obtained by subjecting each input band to scaling processing. That is, according to the present embodiment, the scaling processing unit 1041 outputs the image data after the scaling processing, which is always limited to a fixed number of lines, to the subsequent processing unit (JPEG compressor 105 in this example). can do.

また、本実施形態では、次のバンドの入力を、第1、第2比較例のように、前の入力バンドの最後から1ラインだけ戻ったラインから行うのではなく、図6に示すように、消滅させた出力ラインを生成可能なラインまで戻して行う。 Further, in the present embodiment, the input of the next band is not performed from the line returned by one line from the end of the previous input band as in the first and second comparative examples, as shown in FIG. , Return the extinguished output line to the line that can be generated.

さらに、次のバンドの初期位相値vphase_baseは、消滅させたライン(出力画像の各縦ラインの上からM+1番目の画素から構成される横ライン)の値ではなく、直前の最終出力ライン(M番目の画素から構成される横ライン)のvphase値とする。 Further, the initial phase value vphase_base of the next band is not the value of the disappeared line (horizontal line composed of M + 1st pixel from the top of each vertical line of the output image), but the last output line immediately before (the horizontal line). Let it be the vphase value of the horizontal line composed of the Mth pixel).

以上の処理を行うことにより、ある出力バンドで消滅させた出力ラインを、次の出力バンドで補うことができるようになる。このため、変倍後の複数の出力バンドをスムーズにつなげることができる。 By performing the above processing, the output line disappeared in one output band can be supplemented by the next output band. Therefore, it is possible to smoothly connect a plurality of output bands after scaling.

図6では、M=4、magv=base×4/3、vphase_base=base/4とした場合の変倍処理を示す。この場合、第1、第2、第3入力バンドそれぞれの入力ライン数Lは7となる。この入力ライン数Lは、前述の式1の計算をCPU101が行うことによって算出される。 FIG. 6 shows the scaling process when M = 4, magv = base × 4/3, and vphase_base = base / 4. In this case, the number of input lines L for each of the first, second, and third input bands is 7. The number of input lines L is calculated by the CPU 101 performing the calculation of the above equation 1.

第1入力バンドが変倍処理部1041に入力された場合、本来生成することが可能な出力ライン数は5ラインとなるが、本実施形態では、出力バンドの最下位ラインを消滅させて4本の出力ラインを生成し、第1出力バンドとして出力する。 When the first input band is input to the scaling processing unit 1041, the number of output lines that can be originally generated is 5, but in the present embodiment, the lowest line of the output band is eliminated and 4 lines are eliminated. Output line is generated and output as the first output band.

また、第2入力バンドの入力は、消滅させた5ライン目の出力ライン(ライン番号4の出力ライン)を生成する際に使用する入力ラインから行う。すなわち、第1入力バンドの最終ラインである7ライン目のライン(ライン番号6の入力ライン)を含めて2ライン分戻ったラインである6ライン目のライン(ライン番号5のライン))から第2入力バンドの入力を行う。この場合、オフセットライン数は5ラインとなる。第2入力バンドに対応する出力バンドの初期位相値vphase_baseは、消滅させた5ライン目の位相値vphaseとする。 Further, the input of the second input band is performed from the input line used when generating the disappeared fifth output line (output line of line number 4). That is, from the 6th line (line number 5), which is the line returned by 2 lines including the 7th line (input line of line number 6) which is the final line of the 1st input band. 2 Input the input band. In this case, the number of offset lines is five. The initial phase value vphase_base of the output band corresponding to the second input band is the phase value vphase of the fifth line that has been extinguished.

図7のフローチャートを用いて、入力バンド毎に変倍処理部1041内で変倍処理を行ってMラインの出力画像を出力するまでの処理内容を詳細に説明する。但し、走査の変倍処理においては、特許文献1等に開示の周知の技術であるため、本実施形態では詳細な記述を省き、副走査方向における変倍処理のみについて説明する。なお、図7のフローチャートにおいて、各工程番号に付したSは、ステップを意味する。 Using the flowchart of FIG. 7, the processing contents from performing the scaling processing in the scaling processing unit 1041 for each input band to outputting the output image of the M line will be described in detail. However, since the scanning scaling process is a well-known technique disclosed in Patent Document 1 and the like, detailed description thereof will be omitted in the present embodiment, and only the scaling process in the sub-scanning direction will be described. In the flowchart of FIG. 7, S attached to each process number means a step.

フローチャートに示す処理を実行する前に、CPU101が前述の式1に従って、各入力バンドの入力ライン数Lを予め計算しておく。入力DMAC103は、常に、算出されたライン数Lの画像データを1バンドとしてメインメモリ130から読み出し、図2(c)に示すように縦ライン順に変倍処理部1041へ供給する。 Before executing the process shown in the flowchart, the CPU 101 calculates in advance the number L of input lines of each input band according to the above-mentioned equation 1. The input DMAC 103 always reads out the calculated image data having the number of lines L as one band from the main memory 130, and supplies the image data to the scaling processing unit 1041 in the order of vertical lines as shown in FIG. 2 (c).

S700では、初期設定を行う。ここでは、第1入力バンドの位相値vphase_baseとして1以上base未満の任意の値を設定し、第1入力バンドの変倍処理を開始する。 In S700, the initial setting is performed. Here, an arbitrary value of 1 or more and less than base is set as the phase value vphase_base of the first input band, and the scaling process of the first input band is started.

S701では、以下のように変倍処理部1041の内部変数を初期化する。
vphase=vphase_base
in_ctr=out_ctr=0
ここで、vphaseは画素出力時点の副走査位相値、in_ctrは副走査方向の入力画素数をカウントする入力カウンタのカウント値、out_ctrは副走査方向の出力画素数をカウントする出力カウンタのカウント値をそれぞれ示している。初期化処理の後、入力バンドの変倍処理を開始する。
In S701, the internal variables of the scaling processing unit 1041 are initialized as follows.
vface = vface_base
in_ctr = out_ctr = 0
Here, vphase is the sub-scanning phase value at the time of pixel output, in_ctr is the count value of the input counter that counts the number of input pixels in the sub-scanning direction, and out_ctr is the count value of the output counter that counts the number of output pixels in the sub-scanning direction. Each is shown. After the initialization process, the input band scaling process is started.

S702では、入力画素が変倍処理部1041に入力される毎に、入力カウンタのカウント値in_ctrを1増す。 In S702, the count value in_ctr of the input counter is incremented by 1 each time the input pixel is input to the scaling processing unit 1041.

S703では、カウント値in_ctrに基づき、変倍処理部1041に入力された入力画素を用いて出力画素を生成することが可能であるか否かの判定を行う。この判定は、入力画素の副走査位相値の合計値(in_ctr×base)が、vphase_baseとmagvとの合計値以上であるか否かを判定することにより行う。すなわち、
in_ctr×base≧vphase+magv (式2)
の関係を満たすか否かの判定を行う。ここで、式2の関係を満たす場合(Yesの場合)には、S704へ進み、満たさない場合(Noの場合)にはS702に戻る。
In S703, it is determined whether or not it is possible to generate an output pixel by using the input pixel input to the scaling processing unit 1041 based on the count value in_ctr. This determination is made by determining whether or not the total value (in_ctr × base) of the sub-scanning phase values of the input pixels is equal to or greater than the total value of vphase_base and magv. That is,
in_ctr × base ≧ vphase + magv (Equation 2)
Judgment as to whether or not the relationship of is satisfied. Here, if the relation of the equation 2 is satisfied (in the case of Yes), the process proceeds to S704, and if the relationship is not satisfied (in the case of No), the process returns to S702.

S704では、vphaseの値をvphase+magvに更新する。
S705では、変倍処理部1041から出力画素が出力される毎に、出力カウンタのカウント値out_ctrを1増やす。
In S704, the value of vphase is updated to vphase + magv.
In S705, the count value out_ctr of the output counter is incremented by 1 each time the output pixel is output from the scaling processing unit 1041.

S706では、出力バンドの上からout_ctr番目の画素値を計算し、結果を次段へ出力する。ここで、出力値out_valは、次の式3によって求められる。
out_val
=(in_val[in_ctr-1]×vphase
+in_val[in_ctr]×(base-vphase))/base (式3)
なお、in_val[x]は、出力バンドの上からx+1番目の画素の画素値を表す。
In S706, the out_ctrth pixel value from the top of the output band is calculated, and the result is output to the next stage. Here, the output value out_val is obtained by the following equation 3.
out_val
= (In_val [in_ctr-1] × vphase
+ In_val [in_ctr] × (base-vphase)) / base (Equation 3)
In addition, in_val [x] represents the pixel value of the x + 1th pixel from the top of the output band.

S707では、次の式4の計算を行う。
next_vphase=vphase-in_ctr×base (式4)
ここで、next_vphaseは次のバンドでのvphase_baseの初期値であり、変倍処理部1041内にレジスタとして次バンドの処理まで保持している。
In S707, the following equation 4 is calculated.
next_vphase = vphase-in_ctr × base (Equation 4)
Here, next_vphase is an initial value of vphase_base in the next band, and is held in the scaling processing unit 1041 as a register until the processing of the next band.

S708では、1つの縦ラインの最後の出力画素が出力されたか否かの判定を行う。この判定は、出力カウンタのカウント値out_ctrが、予め設定した出力ライン数Mに達したか否かを判定することにより行う。すなわち、
out_ctr=M
であるか否かを判定することによって行う。判定の結果、out_ctr=Mであれば(Yesであれば)S709へ進み、そうでなければ(Noであれば)S703に戻る。この判定を行うことにより、変倍後の出力ライン数が一定値Mになる。なお、変倍処理部1041の次段が、図1に示すようにJPEG圧縮器105である場合、変倍処理部1041から出力すべきライン数Mは、通常はM=8またはM=16である。
In S708, it is determined whether or not the last output pixel of one vertical line is output. This determination is performed by determining whether or not the count value out_ctr of the output counter has reached the preset number of output lines M. That is,
out_ctr = M
It is performed by determining whether or not it is. As a result of the determination, if out_ctr = M, the process proceeds to S709 (if Yes), and if not, the process returns to S703 (if No). By making this determination, the number of output lines after scaling becomes a constant value M. When the next stage of the scaling processing unit 1041 is a JPEG compressor 105 as shown in FIG. 1, the number of lines M to be output from the scaling processing unit 1041 is usually M = 8 or M = 16. be.

この後、S709では、次の式5の計算を行う。
offset=in_ctr-1 (式5)
式5におけるin_ctrとは、ある入力バンドの中の1つの縦ラインにおいて、M番目の出力画素を生成した時点の入力画素数である。つまり、offset(オフセット)とは、現在処理中の入力バンドと次の入力バンドとの開始アドレスの差(ライン数)を意味している。また、S709では、ある入力バンドに含まれる1つの縦ラインにおいて、M番目の出力画素の生成を可能とする入力画素が入力されると、それ以降に入力される入力画素は無視する。
After that, in S709, the following equation 5 is calculated.
offset = in_ctr-1 (Equation 5)
The in_ctr in the equation 5 is the number of input pixels at the time when the Mth output pixel is generated in one vertical line in a certain input band. That is, the offset means the difference (number of lines) between the start addresses of the input band currently being processed and the next input band. Further, in S709, when an input pixel capable of generating an Mth output pixel is input in one vertical line included in a certain input band, the input pixels input after that are ignored.

ステップS710では、入力バンドの1つの縦ラインにおいて、M番目の出力画素を生成した時の入力画素が、入力バンドの右端に位置するかどうかを判定する。すなわち、Mラインの出力画像データを生成するための入力画素が全て入力されたか否かを判定する。ここで、判定結果がYesである場合には、S712へ移行し、NOである場合にはS711へ進む。 In step S710, it is determined whether or not the input pixel at the time of generating the Mth output pixel is located at the right end of the input band in one vertical line of the input band. That is, it is determined whether or not all the input pixels for generating the output image data of the M line have been input. Here, if the determination result is Yes, the process proceeds to S712, and if NO, the process proceeds to S711.

S711では、入力バンドの全ての縦ラインが入力されていない状態にあるため、入力バンド及び出力バンドのそれぞれにおいて、処理対象となる縦ラインを1ライン分だけ右に移した後、S701へと移行する。そして、再びS704~S710において縦ラインの一番上の画素から変倍処理を行う。 In S711, since all the vertical lines of the input band are not input, in each of the input band and the output band, the vertical line to be processed is moved to the right by one line, and then the process proceeds to S701. do. Then, in S704 to S710, the scaling process is performed again from the top pixel of the vertical line.

また、S712では、次の式6の処理を行った後、入力バンドの処理を終了する。
vphase_base=next_vphase (式6)
なお、式6におけるvphase_baseは、次の出力バンドの副走査方向における初期位相値vphaseとなる。
Further, in S712, after the processing of the following equation 6 is performed, the processing of the input band is terminated.
vface_base = next_vface (Equation 6)
The vphase_base in Equation 6 is the initial phase value vphase in the sub-scanning direction of the next output band.

以上の処理を行うことにより、本実施形態における変倍処理部1401では、入力されるLラインの入力バンドに対して、変倍処理を施したMラインの出力バンドを常に出力することができる。 By performing the above processing, the scaling processing unit 1401 in the present embodiment can always output the output band of the M line subjected to the scaling processing to the input band of the input L line.

なお、第1、第2比較例では、S708に相当する出力ライン数の判断を行わず、入力バンドの各縦ラインの最後の画素まで用いて変倍処理を行う。これに対し、本実施形態では、S708でM番目の出力画素が出力されたと判断した場合、縦ラインの中で使用されていない入力画素は無視し、入力バンドの次の縦ライン(右の縦ライン)を用いた処理へと移行する。すなわち、入力バンドの全ての入力画素を用いれば、第1出力バンドにおいて出力できるはずの画素を出力させずに消滅させる。この消滅画素は、図6において1バンド目の5ライン目の出力画素、つまり(4)の画素に相当する。 In the first and second comparative examples, the number of output lines corresponding to S708 is not determined, and the scaling process is performed using up to the last pixel of each vertical line of the input band. On the other hand, in the present embodiment, when it is determined that the Mth output pixel is output in S708, the input pixel that is not used in the vertical line is ignored, and the next vertical line (right vertical) of the input band is ignored. Shift to processing using line). That is, if all the input pixels of the input band are used, the pixels that should be able to be output in the first output band are extinguished without being output. This disappearing pixel corresponds to the output pixel of the fifth line of the first band in FIG. 6, that is, the pixel of (4).

また、次のバンドでの初期位相値vphase_baseは、消滅画素の処理により計算される値ではなく、あくまで出力バンドの各縦ラインの最終画素(M番目の画素)が出力された時点でのnext_vphaseの値を用いる(S712)。また、このバンドについては、入力DMAC103は、前のバンドからオフセットライン数分のアドレスだけ進んだ位置から読み出しを開始する。具体的には、前の入力バンドの読み出し開始位置のアドレスをA、入力画像1ラインのバイト数をKとすると、次の入力バンドは、(A+offset×K)のアドレスから読み出しを開始する。これにより、消滅画素(図6の(4)の画素)を含む横ラインの画素を、次のバンドの処理で出力させることができる。 Further, the initial phase value vphase_base in the next band is not a value calculated by processing the disappearing pixels, but is the next_vphase at the time when the final pixel (Mth pixel) of each vertical line of the output band is output. The value is used (S712). Further, for this band, the input DMAC 103 starts reading from a position advanced by an address corresponding to the number of offset lines from the previous band. Specifically, assuming that the address of the read start position of the previous input band is A and the number of bytes of one input image line is K, the next input band starts reading from the address of (A + offset × K). As a result, the pixels of the horizontal line including the disappearing pixels (pixels of (4) in FIG. 6) can be output by the processing of the next band.

なお、以上の説明では、変倍処理として縮小処理を例に採り説明したが、上記の処理は、拡大処理についても同様に適用可能であり、有効である。つまり、拡大処理においても、一定ライン数の入力画像データを入力した場合、第1変形例においては、出力画像データのライン数が一定とならず、ばらつきが生じる。これに対し、本実施形態における上述の処理を適用することで、一定のライン数の出力画像データを得ることが可能になる。 In the above description, the reduction process is taken as an example of the scaling process, but the above process can be similarly applied to the enlargement process and is effective. That is, even in the enlargement process, when a fixed number of input image data is input, the number of lines of the output image data is not constant in the first modification, and variations occur. On the other hand, by applying the above-mentioned processing in the present embodiment, it becomes possible to obtain output image data of a certain number of lines.

(第2実施形態)
次に、本発明の第2実施形態を説明する。前述の第1実施形態では、magvや最初のvphase_base等の設定値に応じてオフセットライン数を入力バンドによって変化させることが必要になる。このため入力DMAC103には、アドレス進み量(offset×K)を設定する必要があるが、入力DMAC103自身にアドレス進み量の算出機能を持たせることは困難である。そこで、アドレス進み量あるいは読み出し開始のアドレス値の計算をCPU101で行い、算出した値を入力DMAC103に設定することが考えられているが、この場合にはCPU101の処理に多くの時間が必要となる。すなわち、CPU101は、ある入力バンドの処理終了後に変倍処理部1041からオフセット(offset)値を読み出し、その値に基づいてアドレス進み量を計算し、計算した値を入力DMAC103に設定するという処理を行う。このため、CPU101における処理に多くの時間がかかり、その分システム全体の処理時間が増大する可能性がある。
(Second Embodiment)
Next, a second embodiment of the present invention will be described. In the above-mentioned first embodiment, it is necessary to change the number of offset lines depending on the input band according to the set value such as magv or the first vphase_base. Therefore, it is necessary to set the address advance amount (offset × K) in the input DMAC 103, but it is difficult to give the input DMAC 103 itself a function of calculating the address advance amount. Therefore, it is considered that the CPU 101 calculates the address advance amount or the read start address value and sets the calculated value in the input DMAC103. However, in this case, a large amount of time is required for the processing of the CPU 101. .. That is, the CPU 101 reads the offset value from the scaling processing unit 1041 after the processing of a certain input band is completed, calculates the address advance amount based on the value, and sets the calculated value in the input DMAC 103. conduct. Therefore, the processing in the CPU 101 takes a lot of time, and the processing time of the entire system may increase accordingly.

このような処理時間の増大を避けるため、この第2実施形態では次のような構成を採る。図1において、スキャナ画像処理部104内の変倍処理部1041から入力DMAC103への通信線1043(図1内の破線矢印)を情報送信手段として設ける。そして、変倍処理部1041内で行われる上述の処理により得られるオフセットライン数に関連する情報を通信線1043を介して送信する。入力DMAC103は、この情報に基づきオフセットアドレス(offset×K[バイト])を計算し、その値を用いて自動で次のバンドの読み出し開始アドレスを導出する。 In order to avoid such an increase in processing time, the following configuration is adopted in this second embodiment. In FIG. 1, a communication line 1043 (broken line arrow in FIG. 1) from the scaling processing unit 1041 in the scanner image processing unit 104 to the input DMAC 103 is provided as an information transmission means. Then, information related to the number of offset lines obtained by the above-mentioned processing performed in the scaling processing unit 1041 is transmitted via the communication line 1043. The input DMAC 103 calculates an offset address (offset × K [byte]) based on this information, and automatically derives the read start address of the next band using the value.

このように、オフセットライン数に関する情報を変倍処理部1041から、変倍処理部1041へと送信することにより、アドレス計算及び設定のためのCPUの割り込み応答時間やCPU101の計算にかかる時間を無視できるようになる。このため、スキャナ画像処理部104は1ページ分をバンドごとに止まることなく連続処理することが可能になる。 In this way, by transmitting the information regarding the number of offset lines from the scaling processing unit 1041 to the scaling processing unit 1041, the interrupt response time of the CPU for address calculation and setting and the time required for the calculation of the CPU 101 are ignored. become able to. Therefore, the scanner image processing unit 104 can continuously process one page without stopping for each band.

(第3実施形態)
次に本発明の第3実施形態を説明する。上記の各実施形態では、スキャナ画像処理部104に内包される変倍処理部1041で無段階変倍処理を行った出力一定ライン数の画像データをJPEG圧縮器105に直接入力させる構成を採る。しかし、変倍処理自体はRGB多値状態であればいずれの処理フローで行ってもよい。従って、上記実施形態のように、JPEG圧縮前にスキャナ画像処理部104に内包される変倍処理部1041で変倍処理を行うものに限らず、JPEG伸張後にプリンタ画像処理部107内で変倍処理を行う処理フローも考えられる。
(Third Embodiment)
Next, a third embodiment of the present invention will be described. In each of the above embodiments, the JPEG compressor 105 is configured to directly input the image data of a fixed number of output lines subjected to the stepless scaling process by the scaling processing unit 1041 included in the scanner image processing unit 104. However, the scaling process itself may be performed in any processing flow as long as it is in the RGB multi-valued state. Therefore, as in the above embodiment, the scaling process is not limited to the scaling processing unit 1041 included in the scanner image processing unit 104 before the JPEG compression, and the scaling is performed in the printer image processing unit 107 after the JPEG decompression. A processing flow for processing is also conceivable.

例えば、プリンタ画像処理部107の最終段で必要となる量子化処理では、4×4画素等のタイル単位にディザ処理を行う構成を採る場合がある。この場合、ディザ処理への入力は4ラインの倍数でなければならない。よって、ディザ処理の直前に無段階変倍処理を行う処理フローである場合も、上記実施形態に示した変倍処理を適用することが有効である。本実施形態では、上記第1実施形態に示した変倍処理を、プリンタ画像処理部において行う例を示す。 For example, in the quantization processing required in the final stage of the printer image processing unit 107, a configuration may be adopted in which dither processing is performed in tile units such as 4 × 4 pixels. In this case, the input to the dithering process must be a multiple of 4 lines. Therefore, it is effective to apply the scaling process shown in the above embodiment even in the case of a processing flow in which the stepless scaling process is performed immediately before the dither process. In this embodiment, an example is shown in which the scaling process shown in the first embodiment is performed in the printer image processing unit.

以下、図8を用いて、本実施形態における画像処理装置を、従来の画像処理装置と対比しつつ説明する。 Hereinafter, the image processing apparatus according to the present embodiment will be described with reference to FIG. 8 in comparison with the conventional image processing apparatus.

図8(a)は、従来の画像処理装置を示すブロック図、図8(b)は本実施形態における画像処理装置を示すブロック図である。図8(a)に示す画像処理装置には、前述の第1比較例と同様の変倍処理を行う変倍処理部107bがプリンタ画像処理部107に設けられている。これに対し、本実施形態における画像処理装置には、第1実施形態と同様の変倍処理を行う変倍処理部107bがプリンタ画像処理部107に設けられている。 FIG. 8A is a block diagram showing a conventional image processing apparatus, and FIG. 8B is a block diagram showing an image processing apparatus according to the present embodiment. In the image processing apparatus shown in FIG. 8A, the printer image processing unit 107 is provided with a scaling processing unit 107b that performs the same scaling processing as in the first comparative example described above. On the other hand, in the image processing apparatus of the present embodiment, the printer image processing unit 107 is provided with a scaling processing unit 107b that performs the same scaling processing as that of the first embodiment.

図8(a)の従来の画像処理装置では、JPEG伸張後のプリンタ画像処理部107の入力DMAC107aが固定ライン数及び固定送り量でメインメモリ130から画像データを読み出し、プリンタ画像処理部107内の変倍処理部107bで変倍処理を行う。この場合、変倍処理部107bの出力ライン数は出力バンドごとに可変となる。このため、変倍処理部から出力された出力バンドをそのまま4×4タイルの画像データを処理単位とするディザ処理部へ入力することはできない。そこで、ライン数調節のためにインメモリ130に一旦格納し、その後ディザ処理部で処理可能なライン数の画像データを読み出す必要がある。この場合、変倍処理部の後に出力DMAC107cが必要となり、さらに、ディザ処理部107eの前に入力DMAC107dが必要となり、ハードウェアリソース及びメモリ帯域を消費することとなる。 In the conventional image processing apparatus of FIG. 8A, the input DMAC107a of the printer image processing unit 107 after JPEG decompression reads image data from the main memory 130 with a fixed number of lines and a fixed feed amount, and the image data is read from the main memory 130 in the printer image processing unit 107. The scaling processing unit 107b performs the scaling processing. In this case, the number of output lines of the scaling processing unit 107b is variable for each output band. Therefore, the output band output from the scaling processing unit cannot be directly input to the dither processing unit whose processing unit is 4 × 4 tile image data. Therefore, it is necessary to temporarily store the image data in the in-memory 130 for adjusting the number of lines, and then read out the image data of the number of lines that can be processed by the dither processing unit. In this case, the output DMAC107c is required after the scaling processing unit, and the input DMAC107d is required before the dither processing unit 107e, which consumes hardware resources and memory bandwidth.

これに対し図8(a)に示す本実施形態では、プリンタ画像処理部107内の変倍処理部107bにおいて、第1実施形態と同様の変倍処理を行うことによって一定出力ライン数の画像データ(出力バンド)を出力することが可能になる。すなわち、本実施形態では、入力DMAC107aの入力ライン数を一定にした上で、変倍処理部107bにおいて生成可能な出力ラインのうち、予め設定したライン数の出力ライン以外は消滅させる。これにより、変倍処理部107bの変倍処理を施した一定ライン数の画像データ(出力バンド)を出力することが可能になる。このため、変倍処理された画像データをディザ処理部107eに直接供給することが可能になり、ライン数調整のためのDMAC107c及び107d等のハードウェアリソースが不要となると共に、メモリ帯域を低減することも可能になる。また、本実施形態においても、第2実施例と同様に、バンドごとのオフセットライン数の情報を変倍処理部107bから入力DMAC107aへ送るようにすることも可能である。これによれば、入力DMAC107aがバンドごとに自動動作可能となるため、処理時間の向上を図ることが可能になる。 On the other hand, in the present embodiment shown in FIG. 8A, the scaling processing unit 107b in the printer image processing unit 107 performs the same scaling processing as in the first embodiment to obtain image data having a constant number of output lines. (Output band) can be output. That is, in the present embodiment, after the number of input lines of the input DMAC107a is fixed, among the output lines that can be generated by the scaling processing unit 107b, all the output lines other than the preset number of lines are eliminated. This makes it possible to output a fixed number of image data (output bands) that have undergone scaling processing by the scaling processing unit 107b. Therefore, the scaled image data can be directly supplied to the dither processing unit 107e, which eliminates the need for hardware resources such as DMAC 107c and 107d for adjusting the number of lines and reduces the memory bandwidth. It will also be possible. Further, also in the present embodiment, it is possible to send information on the number of offset lines for each band from the scaling processing unit 107b to the input DMAC107a as in the second embodiment. According to this, since the input DMAC107a can be automatically operated for each band, it is possible to improve the processing time.

(他の実施形態)
上記実施形態では、変倍処理部に入力する入力画像データのライン数の算出、設定を行う入力設定手段としての機能を、CPU101によって実現する例を示したが、本発明はこれに限定されない。変倍処理部に入力する画像データのライン数は、画像処理装置に設けられた入力装置等からユーザが設定することも可能である。但し、ユーザが設定した入力ライン数では、変倍処理部から出力させるべきライン数が得られない可能性もあり、その場合には、ライン数または変倍率の再設定を促すような通知を行うようにしてもよい。また、変倍処理部から出力させるべきライン数に比べ、ユーザが過剰な入力ライン数を設定した場合に、入力ライン数の削減または変倍率の変更(増加)を促すような通知を行うようにしてもよい。
(Other embodiments)
In the above embodiment, an example is shown in which the CPU 101 realizes a function as an input setting means for calculating and setting the number of lines of input image data to be input to the scaling processing unit, but the present invention is not limited thereto. The number of lines of image data to be input to the variable magnification processing unit can also be set by the user from an input device or the like provided in the image processing device. However, with the number of input lines set by the user, there is a possibility that the number of lines to be output from the scaling processing unit may not be obtained. You may do so. In addition, when the user sets an excessive number of input lines compared to the number of lines to be output from the scaling processing unit, a notification is given to prompt the user to reduce the number of input lines or change (increase) the scaling factor. You may.

また、本発明は、上記実施形態の1以上の機能を実現するプログラムをネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。 Further, the present invention supplies a program that realizes one or more functions of the above embodiment to a system or an apparatus via a network or a storage medium, and one or more processors in the computer of the system or the apparatus read and execute the program. It can also be realized by the processing to be performed. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.

100 画像処理装置
101 CPU
103 入力DMAC(転送手段)
1041 変倍処理部(変倍処理手段)
100 Image processing device 101 CPU
103 Input DMAC (transfer means)
1041 scaling processing unit (magnification processing means)

Claims (11)

元画像を表す元画像データを主走査方向に沿った一定数のラインからなる画像データに分割して転送する転送手段と、
前記転送手段から転送された前記画像データを処理単位の入力画像データとし、当該入力画像データに対して予め設定された倍率で変倍処理を施し、変倍画像データを生成可能とする変倍処理手段と、
前記変倍処理手段から出力させるべき出力ライン数を設定する出力設定手段と、を備え、
前記変倍処理手段は、前記入力画像データを用いて生成可能な変倍画像データのうち、前記出力設定手段により設定された出力ライン数に制限した画像データを出力画像データとして出力することを特徴とする画像処理装置。
A transfer means for dividing the original image data representing the original image into image data consisting of a certain number of lines along the main scanning direction and transferring the data.
The image data transferred from the transfer means is used as input image data for a processing unit, and the input image data is subjected to scaling processing at a preset magnification to generate scaling image data. Means and
An output setting means for setting the number of output lines to be output from the scaling processing means is provided.
The scaling processing means is characterized in that, of the variable magnification image data that can be generated using the input image data, image data limited to the number of output lines set by the output setting means is output as output image data. Image processing device.
前記転送手段により前記変倍処理手段へ転送する前記入力画像データのライン数を設定する入力設定手段と、
前記変倍処理の倍率を設定する倍率設定手段と、
をさらに備えることを特徴とする請求項1に記載の画像処理装置。
An input setting means for setting the number of lines of the input image data to be transferred to the scaling processing means by the transfer means, and an input setting means.
A magnification setting means for setting the magnification of the variable magnification process and
The image processing apparatus according to claim 1, further comprising.
前記入力設定手段は、前記倍率と前記出力ライン数とを用いて前記入力画像データのライン数を設定することを特徴とする請求項2に記載の画像処理装置。 The image processing apparatus according to claim 2, wherein the input setting means sets the number of lines of the input image data by using the magnification and the number of output lines. 所定の処理単位の入力画像データに応じて前記変倍処理手段が前記出力設定手段により設定された前記出力ライン数の出力画像データを前記変倍処理手段が出力したとき、当該出力画像データの前記主走査方向と交差する副走査方向における位相値を記憶する記憶手段を設け、
前記変倍処理手段は、所定の処理単位の次の処理単位の入力画像データの変倍処理において、前記記憶手段に記憶された前記位相値を前記次の処理単位の入力画像データに対応する出力画像データの初期位相値として用いることを特徴とする請求項1ないし3のいずれか1項に記載の画像処理装置。
When the scaling processing means outputs the output image data of the number of output lines set by the output setting means according to the input image data of a predetermined processing unit, the output image data is said to be the same. A storage means for storing the phase value in the sub-scanning direction intersecting the main scanning direction is provided.
The scaling processing means outputs the phase value stored in the storage means corresponding to the input image data of the next processing unit in the scaling processing of the input image data of the next processing unit of the predetermined processing unit. The image processing apparatus according to any one of claims 1 to 3, wherein the image processing apparatus is used as an initial phase value of image data.
前記出力設定手段により設定した前記出力ライン数からなる出力画像データの生成に用いた前記入力画像データの量に関連する情報を前記転送手段に送信する情報送信手段を備え、
前記転送手段は、前記元画像データを格納したメモリから前記処理単位の入力画像データを読み出すためのアドレスを前記情報に基づいて導出し、当該導出したアドレスの入力画像データを前記変倍処理手段へ転送することを特徴とする請求項1ないし4のいずれか1項に記載の画像処理装置。
An information transmitting means for transmitting information related to the amount of the input image data used for generating the output image data consisting of the number of output lines set by the output setting means to the transfer means is provided.
The transfer means derives an address for reading the input image data of the processing unit from the memory storing the original image data based on the information, and transfers the input image data of the derived address to the scaling processing means. The image processing apparatus according to any one of claims 1 to 4, wherein the image processing apparatus is to be transferred.
前記転送手段は、前記変倍処理手段と前記メモリとの間に設けられた入力DMAC(Direct Memory Access Controller)を含むことを特徴とする請求項5に記載の画像処理装置。 The image processing apparatus according to claim 5, wherein the transfer means includes an input DMAC (Direct Memory Access Controller) provided between the scaling processing means and the memory. 前記出力設定手段は、所定の画像処理を施す後段処理手段における画像処理単位に相当するライン数を設定し、
前記変倍処理手段は、前記出力画像データを前記後段処理手段に直接入力させることを特徴とする請求項1に記載の画像処理装置。
The output setting means sets the number of lines corresponding to the image processing unit in the post-stage processing means that performs predetermined image processing.
The image processing apparatus according to claim 1, wherein the scaling processing means directly inputs the output image data to the post-stage processing means.
前記後段処理手段は、前記変倍処理手段から出力された前記出力画像データに対して圧縮処理を行うJPEG圧縮手段であることを特徴とする請求項7に記載の画像処理装置。 The image processing apparatus according to claim 7, wherein the post-stage processing means is a JPEG compression means that performs compression processing on the output image data output from the scaling processing means. 前記後段処理手段は、前記変倍処理手段から出力された前記出力画像データの量子化を行うディザ処理手段であることを特徴とする請求項7または8に記載の画像処理装置。 The image processing apparatus according to claim 7, wherein the post-stage processing means is a dither processing means for quantizing the output image data output from the scaling processing means. 元画像を表す元画像データを主走査方向に沿った一定数のラインからなる画像データに分割して転送する転送工程と、
前記転送工程によって転送された前記画像データを処理単位の入力画像データとし、当該入力画像データに対して予め設定された倍率で変倍処理を施し、変倍画像データを生成可能とする変倍処理工程と、
前記変倍処理工程により出力させるべき出力ライン数を設定する出力設定工程と、を備え、
前記変倍処理工程は、前記入力画像データを用いて生成可能な変倍画像データのうち、前記出力設定工程により設定された出力ライン数に制限した画像データを出力画像データとして出力することを特徴とする画像処理方法。
A transfer process in which the original image data representing the original image is divided into image data consisting of a certain number of lines along the main scanning direction and transferred.
The image data transferred by the transfer step is used as input image data for a processing unit, and the input image data is subjected to scaling processing at a preset magnification to generate scaling image data. Process and
It is provided with an output setting step of setting the number of output lines to be output by the scaling processing step.
The variable magnification processing step is characterized in that, of the variable magnification image data that can be generated using the input image data, image data limited to the number of output lines set by the output setting step is output as output image data. Image processing method.
コンピュータを、
元画像を表す元画像データを主走査方向に沿った一定数のラインからなる画像データに分割して転送する転送手段と、
前記転送手段から転送された前記画像データを処理単位の入力画像データとし、当該入力画像データに対して予め設定された倍率で変倍処理を施し、変倍画像データを生成可能とする変倍処理手段と、
前記変倍処理手段から出力させるべき出力ライン数を設定する出力設定手段と、
前記変倍処理手段により前記入力画像データを用いて生成可能な変倍画像データのうち、前記出力設定手段により設定された出力ライン数に制限した画像データを出力画像データとして出力する制限手段と、
して機能させること特徴とするプログラム。
Computer,
A transfer means for dividing the original image data representing the original image into image data consisting of a certain number of lines along the main scanning direction and transferring the data.
The image data transferred from the transfer means is used as input image data for a processing unit, and the input image data is subjected to scaling processing at a preset magnification to generate scaling image data. Means and
An output setting means for setting the number of output lines to be output from the variable magnification processing means, and an output setting means.
Among the variable magnification image data that can be generated by the variable magnification processing means using the input image data, the limiting means for outputting the image data limited to the number of output lines set by the output setting means as the output image data, and the limiting means.
A program that is characterized by its function.
JP2020198070A 2020-11-30 2020-11-30 Image processing device, image processing device, image processing method, and program Pending JP2022086187A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020198070A JP2022086187A (en) 2020-11-30 2020-11-30 Image processing device, image processing device, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2020198070A JP2022086187A (en) 2020-11-30 2020-11-30 Image processing device, image processing device, image processing method, and program

Publications (1)

Publication Number Publication Date
JP2022086187A true JP2022086187A (en) 2022-06-09

Family

ID=81894180

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020198070A Pending JP2022086187A (en) 2020-11-30 2020-11-30 Image processing device, image processing device, image processing method, and program

Country Status (1)

Country Link
JP (1) JP2022086187A (en)

Similar Documents

Publication Publication Date Title
US8659793B2 (en) Image processing apparatus and image processing method
JP6029344B2 (en) Image processing apparatus, image processing method, and program
JP4725336B2 (en) Image processing apparatus and image processing program
JP4382000B2 (en) Print control system and print control method
US8488893B2 (en) Image compression apparatus and image compression method
JP2004289667A (en) Image processor
JP2022086187A (en) Image processing device, image processing device, image processing method, and program
JP5020998B2 (en) Image processing apparatus and image processing method
EP1383081A2 (en) Image processing apparatus and method
JP2020145661A (en) Image processing device, control method thereof, and program
EP1154632A2 (en) Method, system, program and data structure for generating raster objects
US8654394B2 (en) Image processing apparatus, control method, and computer-readable medium
JP4336470B2 (en) Drawing control apparatus, drawing control method and program
JPH11203071A (en) Picture processor
JP5441676B2 (en) Image processing apparatus and processing method thereof
JPH11127339A (en) Image processor
JP4031442B2 (en) Image processing apparatus and image forming apparatus having the same
JP2020088694A (en) Image processing apparatus and image processing method
JP3190118B2 (en) Image processing device
JPH08123939A (en) Picture processor
JP3997851B2 (en) Image coding apparatus and image coding program
JP4368280B2 (en) Image processing device
JP2017087514A (en) Image processing device, image processing method, and program
JP6809158B2 (en) Image processing equipment and programs
JP2016225794A (en) Copying device