JP6115435B2 - Image processing apparatus and program - Google Patents

Image processing apparatus and program Download PDF

Info

Publication number
JP6115435B2
JP6115435B2 JP2013211999A JP2013211999A JP6115435B2 JP 6115435 B2 JP6115435 B2 JP 6115435B2 JP 2013211999 A JP2013211999 A JP 2013211999A JP 2013211999 A JP2013211999 A JP 2013211999A JP 6115435 B2 JP6115435 B2 JP 6115435B2
Authority
JP
Japan
Prior art keywords
size
data
bank
image
input buffer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2013211999A
Other languages
Japanese (ja)
Other versions
JP2015076735A (en
Inventor
玉谷 光之
光之 玉谷
和雄 山田
和雄 山田
松本 大輔
大輔 松本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Fujifilm Business Innovation Corp
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 Fuji Xerox Co Ltd, Fujifilm Business Innovation Corp filed Critical Fuji Xerox Co Ltd
Priority to JP2013211999A priority Critical patent/JP6115435B2/en
Publication of JP2015076735A publication Critical patent/JP2015076735A/en
Application granted granted Critical
Publication of JP6115435B2 publication Critical patent/JP6115435B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Record Information Processing For Printing (AREA)
  • Image Input (AREA)
  • Storing Facsimile Image Data (AREA)

Description

本発明は、画像処理装置及びプログラムに関する。   The present invention relates to an image processing apparatus and a program.

例えばページ記述言語等で記述された印刷データからプリンタに供給するラスター画像データを生成する印刷データ生成システムでは、その生成処理のうちハードウエア処理に適した部分をハードウエアの画像処理装置(ハードウエアアクセラレータとも呼ばれる)として実装する例がよくある。この種のシステムでは、印刷データ生成システムのCPUがソフトウエア処理により生成したデータを、ハードウエアアクセラレータである画像処理装置の入力バッファに読み込む。入力バッファに読み込まれた入力データは、画像処理装置内の画像処理のための回路に読み込まれ、処理される。回路による処理結果のデータは、出力バッファに保持され、出力バッファから、下流側の処理を行うソフトウエアへと供給される。   For example, in a print data generation system that generates raster image data to be supplied to a printer from print data described in a page description language or the like, a portion suitable for hardware processing is included in a hardware image processing device (hardware). Often implemented as an accelerator). In this type of system, data generated by software processing by the CPU of the print data generation system is read into an input buffer of an image processing apparatus that is a hardware accelerator. The input data read into the input buffer is read and processed by a circuit for image processing in the image processing apparatus. Data resulting from the processing by the circuit is held in the output buffer, and is supplied from the output buffer to software that performs downstream processing.

従来のこの種の画像処理装置では、入力バッファや出力バッファのサイズは固定であった。   In the conventional image processing apparatus of this type, the sizes of the input buffer and the output buffer are fixed.

一方、画像処理装置が行う画像処理の中には、画像オブジェク単位の処理がある。例えば、ディスプレイリスト等の中間言語データで表現された画像オブジェクトを、下地画像の上にラスタライズ(ラスター画像として描画する処理)する処理がその一例である。この処理では、下地画像のうち画像オブジェクトに対応する部分のデータを入力バッファに読み込む。画像処理のための回路は、その画像オブジェクトの中間言語データをラスタライズし、ラスタライズ結果の各画素の値を、入力バッファから読み込んだ下地画像の対応画素の値と例えば掛け合わせる(オーバープリントの場合)。   On the other hand, image processing performed by the image processing apparatus includes processing for each image object. For example, a process of rasterizing an image object expressed in intermediate language data such as a display list on a base image (a process of drawing as a raster image) is an example. In this processing, the data of the portion corresponding to the image object in the background image is read into the input buffer. The circuit for image processing rasterizes the intermediate language data of the image object, and multiplies the value of each pixel of the rasterized result with the value of the corresponding pixel of the background image read from the input buffer (in the case of overprinting). .

画像処理装置は、入力バッファにいったんバッファサイズ分のデータを読み込んでから画像処理を行うので、処理対象の画像オブジェクトのサイズがバッファサイズに合っていないと、処理の対象でない無駄なデータをバッファに読み込むことになる。無駄なデータの読み込みが多いと、その読み込みに要する時間だけ、画像処理の所要時間が無駄に長くなることとなる。   Since the image processing apparatus performs image processing after reading data for the buffer size once into the input buffer, if the size of the image object to be processed does not match the buffer size, useless data not to be processed is stored in the buffer. Will be read. If there is a lot of useless data reading, the time required for image processing will be unnecessarily increased by the time required for the reading.

画像処理装置におけるバッファの制御に関する従来技術として、特許文献1に示された技術が知られている。   As a conventional technique related to buffer control in an image processing apparatus, a technique disclosed in Patent Document 1 is known.

特許文献1には、メモリから読み出した画像データを画像処理し、画像処理結果をメモリに記憶するまでの時間を短縮するために、出力バッファの状態に応じて入力バッファを制御する技術が開示されている。この技術では、複数の出力用ライン・メモリのいずれかにデータ入力待ち状態、データ入力状態またはデータ出力状態のいずれでも無い空き状態のものがあると、入力バッファのいずれかの入力用ライン・メモリからの出力が許可される。出力用ライン・メモリには空き状態のものが存在する確立が高く、入力用ライン・メモリから画像データを出力する出力待ち状態の時間を短縮できる。   Patent Document 1 discloses a technique for controlling an input buffer in accordance with the state of an output buffer in order to reduce the time required to perform image processing on image data read from a memory and store the image processing result in the memory. ing. In this technique, if any of the plurality of output line memories is in an idle state that is not in a data input waiting state, a data input state, or a data output state, one of the input line memories in the input buffer Output from is allowed. It is highly probable that the output line memory is empty, and the output waiting time for outputting image data from the input line memory can be shortened.

特開2011−205176号公報JP 2011-205176 A

画像オブジェクト毎に画像処理を行う画像処理装置において、入力バッファに読み込まれるが画像処理には用いられない無駄データの量を、入力データを保持する入力バッファのサイズを固定とする場合よりも少なくすることを目的とする。   In an image processing apparatus that performs image processing for each image object, the amount of wasted data that is read into the input buffer but is not used for image processing is made smaller than when the size of the input buffer that holds input data is fixed. For the purpose.

請求項1に係る発明は、入力バッファと、外部から入力され前記入力バッファに保持された入力データを用いて画像処理を実行する画像処理回路と、処理対象の画像オブジェクトに対応するデータのサイズを取得する取得手段と、前記入力バッファのうち前記画像オブジェクトに対応するデータの保持に使用する部分の最適サイズを、前記取得手段が取得したサイズに基づき算出する算出手段と、前記入力バッファに対し、外部から、前記画像オブジェクトに対応する前記入力データとして前記最適サイズずつのデータを読み込むよう制御する読み込み制御手段と、を有する画像処理装置である。   According to the first aspect of the present invention, there is provided an input buffer, an image processing circuit that executes image processing using input data input from the outside and held in the input buffer, and a size of data corresponding to an image object to be processed. Obtaining means for obtaining, calculating means for calculating an optimum size of a portion used for holding data corresponding to the image object in the input buffer based on the size obtained by the obtaining means, and for the input buffer, An image processing apparatus comprising: reading control means for controlling to read data of the optimum size as the input data corresponding to the image object from the outside.

請求項2に係る発明は、前記算出手段は、前記入力バッファの使用サイズを単位サイズずつ変えた場合において、前記画像オブジェクトに対応するデータのサイズをその使用サイズで割った余りが最小となる場合の使用サイズを、前記画像オブジェクトに対応する前記入力バッファの最適サイズとする、ことを特徴とする請求項1に記載の画像処理装置である。   According to a second aspect of the present invention, in the case where the use size of the input buffer is changed by unit size, the calculation unit has a minimum remainder obtained by dividing the size of data corresponding to the image object by the use size. The image processing apparatus according to claim 1, wherein a use size of the input buffer is an optimum size of the input buffer corresponding to the image object.

請求項3に係る発明は、前記算出手段は、前記余りが最小となる前記使用サイズが複数ある場合、それら複数のうち最大のものを前記最適サイズに決定する、ことを特徴とする請求項2に記載の画像処理装置である。   The invention according to claim 3 is characterized in that, when there are a plurality of use sizes that minimize the remainder, the calculating means determines the maximum one of the plurality as the optimum size. The image processing apparatus described in the above.

請求項4に係る発明は、前記算出手段は、前記画像オブジェクトに対応するデータのサイズが前記入力バッファの上限サイズ以下である場合に、当該画像オブジェクトに対応するデータのサイズを前記最適サイズに決定する、ことを特徴とする請求項1に記載の画像処理装置である。   According to a fourth aspect of the present invention, when the size of data corresponding to the image object is equal to or smaller than the upper limit size of the input buffer, the calculation unit determines the size of data corresponding to the image object as the optimum size. The image processing apparatus according to claim 1, wherein:

請求項5に係る発明は、コンピュータを、処理対象の画像オブジェクトに対応するデータのサイズを取得する取得手段、画像処理回路に対する入力データを保持する入力バッファのうち前記画像オブジェクトに対応するデータの保持に使用する部分の最適サイズを、前記取得手段が取得したサイズに基づき算出する算出手段、前記入力バッファに対し、外部から、前記画像オブジェクトに対応する前記入力データとして前記最適サイズずつのデータを読み込むよう制御する読み込み制御手段、として機能させるためのプログラムである。   According to the fifth aspect of the present invention, the computer stores the data corresponding to the image object among the acquisition means for acquiring the size of the data corresponding to the image object to be processed, and the input buffer for holding the input data for the image processing circuit. The calculation unit for calculating the optimum size of the portion used for the acquisition based on the size acquired by the acquisition unit, and reading the data of the optimal size from the outside as the input data corresponding to the image object to the input buffer It is a program for functioning as a read control means for controlling the above.

請求項1、2、4及び5に係る発明によれば、入力バッファに読み込まれるが画像処理には用いられない無駄データの量を、入力データを保持する入力バッファのサイズを固定とする場合よりも少なくすることができる。   According to the first, second, fourth, and fifth aspects of the invention, the amount of useless data that is read into the input buffer but is not used for image processing is smaller than when the size of the input buffer that holds the input data is fixed. Can also be reduced.

請求項3に係る発明によれば、この発明を用いない場合よりも、同じ画像オブジェクトに対応するデータを前記最適サイズずつ前記入力バッファに読み込む回数が少なくなり、読み込みのリクエストの処理の時間が少なくなる分だけ、そのデータ全部を読み込むのに要する時間が少なくなる。   According to the third aspect of the present invention, the number of times of reading the data corresponding to the same image object into the input buffer by the optimum size is reduced, and the processing time of the read request is less than when not using the present invention. As a result, the time required to read all the data is reduced.

オブジェクトのサイズがバンクサイズよりも小さい場合のダミーデータを説明するための図である。It is a figure for demonstrating the dummy data in case the size of an object is smaller than bank size. オブジェクトのサイズがバンクサイズよりも大きい場合のダミーデータを説明するための図である。It is a figure for demonstrating the dummy data in case the size of an object is larger than bank size. オブジェクトとバウンディングボックスとの関係を説明するための図である。It is a figure for demonstrating the relationship between an object and a bounding box. 実施形態の画像処理装置の機能構成の例を示す図である。It is a figure which shows the example of a function structure of the image processing apparatus of embodiment. 最適バンクサイズ算出部の処理手順の一例を示す図である。It is a figure which shows an example of the process sequence of the optimal bank size calculation part. 実施形態の最適バンクサイズ算出を用いた場合の、画像データの読み込み時間の短縮効果を説明するための図である。It is a figure for demonstrating the shortening effect of the reading time of image data at the time of using the optimal bank size calculation of embodiment.

まず、図1〜図3を参照して、従来方式(バッファサイズ固定)の問題点を説明する。以下では、画像処理装置がラスター画像データをオブジェクト単位で読み込み、処理する場合を代表例にとって説明する。   First, with reference to FIGS. 1 to 3, problems of the conventional method (buffer size fixed) will be described. Hereinafter, a case where the image processing apparatus reads and processes raster image data in units of objects will be described as a representative example.

例えば中間データ形式で表現されたページの印刷データを、プリンタが取り扱い可能なラスター形式の画像データに変換(ラスタライズ)する場合、ページの印刷データ内でのオブジェクトの出現順に各オブジェクトをラスタライズしていく。これにより、重なり順が下のオブジェクトから順にラスタライズされていくことになる。このようなラスタライズをハードウエア回路で実現する場合、オブジェクト同士が重なる場合を考慮すると、その回路は、まずラスタライズ対象のオブジェクトの下地となる部分のラスター画像をページメモリから読み出し、その下地のラスター画像上にその対象オブジェクトのラスタライズ結果を書き込み、その書き込み結果のラスター画像をページメモリに書き戻すという処理を行うことになる。この書き戻しの後のページメモリ上の画像は、次のオブジェクトにとっての下地の画像となる。このような処理を1ページ中の先頭のオブジェクトから順にオブジェクトごとに繰り返すことで、1ページのラスター画像が形成される。   For example, when converting (rasterizing) print data of a page expressed in an intermediate data format into raster format image data that can be handled by the printer, each object is rasterized in the order of appearance of the objects in the print data of the page. . Thereby, the overlapping order is rasterized in order from the lower object. When such rasterization is realized by a hardware circuit, considering the case where objects overlap each other, the circuit first reads a raster image of a portion serving as a background of the object to be rasterized from the page memory, and then the raster image of the background The rasterization result of the target object is written above, and the raster image of the writing result is written back to the page memory. The image on the page memory after this rewriting is the background image for the next object. By repeating such processing for each object in order from the top object in one page, a raster image for one page is formed.

なお、中間データ形式とは、ページ記述言語とラスター形式の中間の粒度で画像を表現するデータ形式であり、ディスプレイリストなどがその一例である。中間データ形式は、一般に、ハードウエア回路での処理に適している。中間データ形式の画像データにおけるオブジェクトは、一般にページ記述言語データにおけるオブジェクトを複数に分割したものであり、中間データ形式でのオブジェクトはページ記述言語データでのオブジェクトよりも小さい単位となっている。   The intermediate data format is a data format that expresses an image with an intermediate granularity between the page description language and the raster format, and a display list is an example. The intermediate data format is generally suitable for processing in a hardware circuit. The object in the image data in the intermediate data format is generally obtained by dividing the object in the page description language data into a plurality of units, and the object in the intermediate data format is a smaller unit than the object in the page description language data.

このようなラスタライズ処理をハードウエア回路にて実行する画像処理装置は、例えば、ページ記述言語形式の印刷データをラスター画像データへと変換するコンピュータに、ハードウエアアクセラレータとして接続される。すなわち、この例では、コンピュータがソフトウエア処理によりページ記述言語形式の印刷データを中間データ形式へと変換し、変換結果の中間データ形式の印刷データを、ハードウエアアクセラレータである画像処理装置がラスター形式へと変換する。この場合、画像処理装置は、コンピュータのメインメモリ上に保持された中間データ形式の印刷データを受け取り、この印刷データをオブジェクト毎にラスタライズし、そのラスタライズ結果を同じメインメモリ上に確保されたページメモリ領域に書き込んでいく。ここで、オブジェクト同士が重なる場合があるので、ラスタライズ処理では、上述のように、オブジェクト毎に、下地画像をページメモリ領域から読み込み、その下地画像上にオブジェクトのラスタライズ結果を画素毎に書き込んでいくことになる。   An image processing apparatus that executes such rasterization processing with a hardware circuit is connected as a hardware accelerator to, for example, a computer that converts print data in a page description language format into raster image data. That is, in this example, the computer converts the print data in the page description language format into an intermediate data format by software processing, and the image processing apparatus, which is a hardware accelerator, converts the print data in the intermediate data format as a conversion result into a raster format. Convert to. In this case, the image processing apparatus receives the print data in the intermediate data format held on the main memory of the computer, rasterizes the print data for each object, and the page memory in which the rasterization result is secured on the same main memory. Write to the area. Here, since the objects may overlap, in the rasterizing process, as described above, the background image is read from the page memory area for each object, and the rasterization result of the object is written on the background image for each pixel. It will be.

このため、画像処理装置は、内蔵する入力バッファに、ラスタライズ対象のオブジェクトの下地となる部分の画像をページメモリから読み込む。そして、そのオブジェクトをラスタライズして得られる各画素の値を、その入力バッファから読み出した下地画像内の対応画素の値と組み合わせる(例えば後者に対し前者を上書き、あるいは前者と後者を乗算など)ことで、そのオブジェクトのラスタライズ結果を反映したラスター画像を得る。この画像処理装置によるラスタライズ処理の結果の画像は、画像処理装置内に内蔵される出力バッファに書き込まれる。あるオブジェクトについてのラスタライズ処理が完了すると、出力バッファ内に保持されたラスター画像データが、上位のコンピュータが管理するページメモリ領域へと書き戻される。   For this reason, the image processing apparatus reads, from the page memory, an image of a portion serving as a background of an object to be rasterized into a built-in input buffer. The value of each pixel obtained by rasterizing the object is combined with the value of the corresponding pixel in the background image read from the input buffer (for example, the former is overwritten with the former or the former is multiplied with the latter). Thus, a raster image reflecting the rasterization result of the object is obtained. An image obtained as a result of the rasterizing process by the image processing apparatus is written in an output buffer built in the image processing apparatus. When the rasterization process for an object is completed, raster image data held in the output buffer is written back to the page memory area managed by the host computer.

ここで、この種の画像処理装置では、入力バッファや出力バッファをそれぞれダブルバッファとして構成し、両者をピンポン動作させることで、バッファへの書き込みに要する時間を隠蔽することが行われている。以下では、ダブルバッファを構成する2つのバッファのことを「バンク」とも呼ぶ。ピンポン動作では、ダブルバッファの2つのバンクの一方から読み出しを行っている間に他方に書き込みを行う。このようなピンポン動作を行う場合、一方のバンクに対して容量一杯まで書き込んだ後でないと、書き込み先を他方のバンクへと切り換えることができない。   Here, in this type of image processing apparatus, an input buffer and an output buffer are each configured as a double buffer, and the time required for writing to the buffer is concealed by performing a ping-pong operation on both. Hereinafter, the two buffers constituting the double buffer are also referred to as “banks”. In the ping-pong operation, while reading from one of the two banks of the double buffer, writing to the other is performed. When such a ping-pong operation is performed, the write destination cannot be switched to the other bank until after the capacity is filled to one bank.

このような画像処理装置において、従来、入力バッファや出力バッファのサイズ(データ容量)は固定であった。このため、対象となるオブジェクトのサイズがバッファのサイズと異なる場合などには、バッファ容量一杯まで下地画像を読み込むと、そのオブジェクトの画素が絶対に存在しない範囲の画像も読み込むことになり、この読み込みに要する時間は実質上無駄な時間となる。   Conventionally, in such an image processing apparatus, the size (data capacity) of the input buffer and the output buffer has been fixed. For this reason, when the size of the target object is different from the buffer size, when the background image is read to the full capacity of the buffer, the image in the range where the pixels of the object do not exist is also read. The time required for this is substantially wasted time.

例えば、図1及び図2には、バッファのサイズ(バンクサイズ)が4K(キロ)バイトである場合において、ラスタライズ対象となるオブジェクト(以下「対象オブジェクト」と呼ぶ)のサイズが4Kより小さい場合(図1)と、4Kより大きい場合(図2)とのそれぞれについて、無駄が生じる場合を示している。   For example, in FIGS. 1 and 2, when the size of the buffer (bank size) is 4K (kilo) bytes, the size of an object to be rasterized (hereinafter referred to as “target object”) is smaller than 4K ( FIG. 1 shows a case where waste occurs for each of the cases where the value is larger than 4K (FIG. 2).

図1の例では、対象オブジェクトは幅が1ライン(走査線)あたり100バイトで高さが3ラインであり、そのオブジェクトのサイズは300バイトである。なお、オブジェクトのサイズは、そのオブジェクトのバウンディングボックスのサイズと等しいものとする。なお、図3に示すように、オブジェクト10のバウンディングボックス12は、走査線に平行な辺と垂直な辺からなる、そのオブジェクト10を内包する最小の矩形のことである。ページ記述言語形式や中間データ形式の印刷データは、一般にオブジェクトを表すデータの一部として、バウンディングボックスの情報(例えばその矩形の左上隅及び右下隅の頂点の座標)を含んでいる。   In the example of FIG. 1, the target object has a width of 100 bytes per line (scan line) and a height of 3 lines, and the size of the object is 300 bytes. Note that the size of the object is equal to the size of the bounding box of the object. As shown in FIG. 3, the bounding box 12 of the object 10 is a minimum rectangle that includes the object 10 and includes a side perpendicular to the side parallel to the scanning line. The print data in the page description language format or the intermediate data format generally includes bounding box information (for example, the coordinates of the vertices of the upper left corner and the lower right corner of the rectangle) as part of the data representing the object.

図1の例では、4Kバイトのバンクに対し、ページメモリから、対象オブジェクトのバウンディングボックスの範囲に該当する300バイトの下地画像を読み込む(バッファに対してはWrite(書き込み)処理)が、4Kバイトのバンクを一杯にするには、更にその範囲の外側の画像を3796バイト余計に読み込む必要がある。バウンディングボックスの外側の画像は、オブジェクトと絶対に重ならないので、ラスタライズにおいては全く不要なデータである。このような処理に不要なデータを、ダミーデータと呼ぶことにする。   In the example of FIG. 1, for a 4K-byte bank, a 300-byte background image corresponding to the bounding box range of the target object is read from the page memory (a write process for the buffer) is 4K bytes. To fill this bank, it is necessary to read 3796 bytes of images outside the range. Since the image outside the bounding box never overlaps the object, it is completely unnecessary data for rasterization. Data unnecessary for such processing will be referred to as dummy data.

ここで、メインメモリから画像形成装置のバッファへのデータの転送速度が1クロックあたり8バイトであり、クロック周波数が200MHzであるとすると、4Kバイトのバンクを一杯にするのに要する時間は4096バイト÷8バイト×5ns(ナノ秒)=2.56μs(マイクロ秒)である。一方、3796バイトのダミーデータを読み込むのに要する時間は、3796バイト÷8バイト×5ns(ナノ秒)=2.37μsである。   Here, assuming that the data transfer rate from the main memory to the buffer of the image forming apparatus is 8 bytes per clock and the clock frequency is 200 MHz, the time required to fill a 4 Kbyte bank is 4096 bytes. ÷ 8 bytes × 5 ns (nanoseconds) = 2.56 μs (microseconds). On the other hand, the time required to read 3796 bytes of dummy data is 3796 bytes ÷ 8 bytes × 5 ns (nanoseconds) = 2.37 μs.

バッファに対して4Kバイトの下地画像(うち3796バイトはダミーデータ)が書き込まれた(Writeされた)後、そのバッファが読み出し(Read)対象に切り替わる。   After a 4 Kbyte background image (3796 bytes of dummy data) is written (written) to the buffer, the buffer is switched to a read target.

仮に、このような300バイト程度のサイズのオブジェクトが1ページ内に10000個あったとする(中間データ形式では、オブジェクトの粒度がページ記述言語の場合よりもはるかに小さいので、1ページ中に10000個程度のオブジェクトが含まれる場合は少なくない)。この場合、1ページ分のラスタライズを行う際にダミーデータの読み込みに使われる時間は、2.37μs×10000、すなわち約24ms(ミリ秒)である。一方、仮に毎分2000ページの印刷を行う場合を考えると、1ページあたりの印刷所要時間は33.3msである。したがって、前述した1ページ中のダミーデータの読み込み時間24msは、1ページあたりの印刷所要時間33.3msのうちの73%に上ることとなる。   Suppose that there are 10,000 objects of such a size of about 300 bytes in one page (in the intermediate data format, the granularity of the object is much smaller than in the page description language, so 10,000 in one page) Is often included). In this case, the time used for reading the dummy data when rasterizing one page is 2.37 μs × 10000, that is, about 24 ms (milliseconds). On the other hand, assuming that 2000 pages are printed per minute, the time required for printing per page is 33.3 ms. Therefore, the above-described dummy data reading time of 24 ms for one page is 73% of the required printing time of 33.3 ms per page.

図2の例では、対象オブジェクトのサイズは2048バイト(=2Kバイト)×3ライン=6144バイト(6Kバイト)である。この場合、図示のように、ダブルバッファの一方のバンクに、そのオブジェクトに対応する6Kバイトの下地画像のうち2ライン分(2Kバイト×2)を書き込んだ後、そのバンクから1ライン目及び2ライン目を読み出して処理すると共にもう一方のバンクにそのオブジェクトの3ライン目及びダミーデータ(2Kバイト分)を書き込む。そして、その書き込みが終わると、それまで書き込んでいたバンクから3ライン目を読み出して処理を行う。この場合、2Kバイトのダミーデータの書き込みに要する時間は2048バイト÷8バイト×5ns=1.28μsである。したがって、このようなオブジェクトが10000個含まれるページの場合、1ページあたり約12msの時間がダミーデータの読み込みに使われていることとなる。この12msは、1ページの印刷所要時間33.3msのうちの36%に相当する。   In the example of FIG. 2, the size of the target object is 2048 bytes (= 2 Kbytes) × 3 lines = 6144 bytes (6 Kbytes). In this case, as shown in the figure, after writing 2 lines (2 Kbytes × 2) of the 6 Kbyte background image corresponding to the object to one bank of the double buffer, the first and second lines from the bank are written. The line is read and processed, and the third line of the object and dummy data (2 Kbytes) are written to the other bank. When the writing is completed, the third line is read from the bank that has been written so far, and processing is performed. In this case, the time required for writing 2 Kbytes of dummy data is 2048 bytes ÷ 8 bytes × 5 ns = 1.28 μs. Therefore, in the case of a page including 10,000 such objects, the time of about 12 ms per page is used for reading dummy data. This 12 ms corresponds to 36% of the time required for printing one page of 33.3 ms.

図2に示したように、オブジェクトのサイズがバンクのサイズより大きい場合、オブジェクトに対応するデータを何回かに分けてバンクに入れていくことになるが、そのうちの最後の回は、そのデータではバンクが一杯にならない。そこで、バンクの空いた部分にダミーデータが入れられることになる。   As shown in FIG. 2, when the size of the object is larger than the size of the bank, the data corresponding to the object is divided into several times and put into the bank. Then the bank does not fill up. Therefore, dummy data is put in the vacant part of the bank.

上述したダミーデータを読み込む時間は、画像処理装置が行う画像処理にとっては全くの無駄な時間であり、そのような無駄な時間はできるだけ少ない方が望ましい。   The time for reading the dummy data described above is a completely useless time for image processing performed by the image processing apparatus, and it is desirable that such a useless time be as small as possible.

以上、バッファサイズが固定であることによる問題を、入力バッファを代表例にとって説明したが、出力バッファも同様の問題を有する。   As described above, the problem due to the fixed buffer size has been described using the input buffer as a representative example, but the output buffer has the same problem.

そこで、本実施形態では、対象オブジェクト毎にそのオブジェクトのサイズに応じた最適なバンクサイズを計算し、対象オブジェクトを処理する際には、バンクの物理的な最大容量のうちそのオブジェクトに応じた最適バンクサイズの部分のみを使用する。オブジェクトに対応する「最適バンクサイズ」は、そのオブジェクトの大きさに対応するデータ量のデータをメモリとバンクとの間で転送する際に、その転送に要する時間が最も短くなる時のバンクのサイズのことである。この実施形態では、ダミーデータの量が最小となるバンクサイズのうち、最も大きいサイズを最適バンクサイズとして求める。ダミーサイズが小さいほど、無駄なデータの転送が少ないので効率がよい。ダミーデータの量が最小となるバンクサイズのうち、最も大きいサイズを最適バンクサイズとするのは、同じデータ量のデータを書き込む(あるいは読み出す)のなら、バンクサイズが大きいほどその書き込み(又は読み出し)の回数が少なくなるからである。バッファへの書き込み(又は読み出し)のためには、データ転送のためのバス使用権の獲得などの準備を行う必要があり、その準備のためにある程度の時間を要するので、ダミーデータの量が同じなら、その準備の回数が少ないほど、オブジェクト全体の処理に要する時間が短くなる。   Therefore, in the present embodiment, for each target object, an optimal bank size corresponding to the size of the object is calculated, and when processing the target object, the optimal bank size corresponding to the object among the physical maximum capacity of the bank is calculated. Use only the bank size part. The “optimal bank size” corresponding to an object is the size of the bank when the amount of data corresponding to the size of the object is transferred between the memory and the bank and the time required for the transfer is the shortest That is. In this embodiment, the largest size among the bank sizes that minimizes the amount of dummy data is obtained as the optimum bank size. The smaller the dummy size, the more efficient the transfer of useless data. Of the bank sizes with the smallest amount of dummy data, the largest bank size is set as the optimum bank size. If data of the same data amount is written (or read), the larger the bank size is, the larger the bank size is written (or read). This is because the number of times decreases. For writing (or reading) to the buffer, it is necessary to make preparations such as acquiring the right to use the bus for data transfer, and it takes a certain amount of time for the preparation, so the amount of dummy data is the same. Then, the smaller the number of preparations, the shorter the time required for processing the entire object.

図4に、本実施形態の画像処理装置100の機能構成の一例を示す。   FIG. 4 shows an example of a functional configuration of the image processing apparatus 100 according to the present embodiment.

図4において、SDRAM(Synchronous Dynamic Random Access Memory)200は、画像処理装置100が接続されるコンピュータのメインメモリである。一例としてSDRAMを挙げたが、メインメモリはSDRAM以外の方式のメモリであってもよい。   In FIG. 4, an SDRAM (Synchronous Dynamic Random Access Memory) 200 is a main memory of a computer to which the image processing apparatus 100 is connected. Although an SDRAM has been described as an example, the main memory may be a memory other than the SDRAM.

DRAMコントローラ102は、SDRAM200との間の読み書きを制御する装置である。DRAMコントローラ102は、SDRAM200に対するアクセス(読み出し又は書き込み)のために、SDRAM200及びDRAMコントローラ102が接続されているバスの使用権を取得するアービタ機能を有している。DRAMコントローラ102は、SDRAM200と入力バッファ110及び出力バッファ130との間で、データのバースト転送を実行する機能を有する。   The DRAM controller 102 is a device that controls reading and writing with the SDRAM 200. The DRAM controller 102 has an arbiter function for acquiring the right to use the bus to which the SDRAM 200 and the DRAM controller 102 are connected in order to access (read or write) the SDRAM 200. The DRAM controller 102 has a function of performing burst transfer of data between the SDRAM 200 and the input buffer 110 and the output buffer 130.

DRAM読出アドレス生成部104は、SDRAM200からデータを読み出す際の読出アドレスの情報を生成する。本実施形態では、SDRAM200内のページメモリ領域から、対象オブジェクトに対応する最小限の下地画像から読み出す。このため、DRAM読出アドレス生成部104は、その対象オブジェクトのバウンディングボックスの位置及びサイズの情報から、読出アドレスの情報、例えば読み出す先頭のアドレス及び読み出すデータの量(この量はバウンディングボックスのサイズに対応)を求める。   The DRAM read address generation unit 104 generates read address information when reading data from the SDRAM 200. In this embodiment, the minimum base image corresponding to the target object is read from the page memory area in the SDRAM 200. For this reason, the DRAM read address generation unit 104 determines the read address information, for example, the top address to be read and the amount of data to be read (the amount corresponds to the size of the bounding box from the information on the position and size of the bounding box of the target object. )

読出リクエスト部106は、DRAM読出アドレス生成部104が生成した読出アドレスの情報をもとに、DRAMコントローラ102に対して、バンクサイズ単位で読出リクエストを発行する。DRAMコントローラ102は、SDRAM200から、その読出リクエストに示されたアドレス及びサイズのデータを読み出し、入力バッファ110に転送する。   The read request unit 106 issues a read request in units of bank size to the DRAM controller 102 based on the read address information generated by the DRAM read address generation unit 104. The DRAM controller 102 reads data of the address and size indicated in the read request from the SDRAM 200 and transfers them to the input buffer 110.

ここで、本実施形態では、バンクサイズをオブジェクトのサイズに応じて制御する。すなわち、読出リクエスト部106は、最適バンクサイズ算出部150が求めた最適バンクサイズ毎に読出リクエストを発行する。   Here, in this embodiment, the bank size is controlled according to the size of the object. That is, the read request unit 106 issues a read request for each optimum bank size obtained by the optimum bank size calculation unit 150.

バッファ書込カウンタ108は、入力バッファ110の各バンク112a、112bに対してSDRAM200から書き込まれたデータ量をカウントする。バッファ読出カウンタ114は、入力バッファ110の各バンク112a、112bから処理回路120に読み出されたデータの量をカウントする。   The buffer write counter 108 counts the amount of data written from the SDRAM 200 to each bank 112a, 112b of the input buffer 110. The buffer read counter 114 counts the amount of data read from the banks 112 a and 112 b of the input buffer 110 to the processing circuit 120.

入力バッファ110は、SDRAM200から読み込まれた処理回路120の処理対象となるデータ(この例では下地画像)を保持するバッファである。この例では、入力バッファ110は、2つのバンク112a、112bからなるダブルバッファ構成である。図1は、第1のバンク112aに対してSDRAM200からデータの書き込みが行われ、第2のバンク112bから処理回路120にデータの供給が行われている時点の状態を示している。ピンポン動作により読み書きの対象となるバンクが切り換えられると、これに応じてバッファ書込カウンタ108とバッファ読出カウンタ114のカウント対象も切り換えられる。   The input buffer 110 is a buffer that holds data to be processed by the processing circuit 120 read from the SDRAM 200 (background image in this example). In this example, the input buffer 110 has a double buffer configuration including two banks 112a and 112b. FIG. 1 shows a state in which data is written from the SDRAM 200 to the first bank 112a and data is supplied from the second bank 112b to the processing circuit 120. When the bank to be read / written is switched by the ping-pong operation, the count targets of the buffer write counter 108 and the buffer read counter 114 are also switched accordingly.

処理回路120は、画像処理装置100が担う画像処理を実行するハードウエア回路である。この例では、処理回路120は、オブジェクトのラスタライズ処理を実行する。処理回路120の処理結果は、出力バッファ130のうちの書込対象のバンク132a又は132bに書き込まれる。   The processing circuit 120 is a hardware circuit that executes image processing performed by the image processing apparatus 100. In this example, the processing circuit 120 executes an object rasterization process. The processing result of the processing circuit 120 is written to the write target bank 132 a or 132 b in the output buffer 130.

出力バッファ130は、処理回路120の処理結果のデータ(この例では下地画像上に対象オブジェクトをラスタライズすることで得られる画像)を保持するバッファである。この例では、出力バッファ130も、2つのバンク132a、132bからなるダブルバッファとして構成されている。図1は、第2のバンク132bに対して処理回路120からデータの書き込みが行われ、第1のバンク132aからSDRAM200に対してデータの書き戻しが行われている時点の状態を示している。   The output buffer 130 is a buffer that holds processing result data of the processing circuit 120 (in this example, an image obtained by rasterizing a target object on a base image). In this example, the output buffer 130 is also configured as a double buffer including two banks 132a and 132b. FIG. 1 shows a state in which data is written from the processing circuit 120 to the second bank 132b and data is written back from the first bank 132a to the SDRAM 200.

バッファ書込カウンタ134は、出力バッファ130の各バンク132a、132bに対して処理回路120から書き込まれたデータ量をカウントする。バッファ読出カウンタ136は、入力バッファ110の各バンク132a、132bから読み出されSDRAM100に書き戻されたデータの量をカウントする。   The buffer write counter 134 counts the amount of data written from the processing circuit 120 to the banks 132 a and 132 b of the output buffer 130. The buffer read counter 136 counts the amount of data read from the banks 132 a and 132 b of the input buffer 110 and written back to the SDRAM 100.

DRAM書込アドレス生成部138は、出力バッファ130からSDRAM200へデータを書き込む際の書込アドレスの情報を生成する。この実施形態では、SDRAM200内のページメモリ領域から読み出した下地画像上に、処理回路120にて対象オブジェクトのラスタライズ結果を書き込み、その書込結果の画像データをページメモリ領域上のその下地画像が元々あった場所に書き戻す。したがって、DRAM書込アドレス生成部138が生成する書込アドレスの情報は、同じ対象オブジェクトについてDRAM読出アドレス生成部104が生成する読出アドレスの情報と同じ内容となる。   The DRAM write address generation unit 138 generates write address information when writing data from the output buffer 130 to the SDRAM 200. In this embodiment, the processing circuit 120 writes the rasterization result of the target object on the background image read from the page memory area in the SDRAM 200, and the background image on the page memory area originally stores the image data of the writing result. Write back to where it was. Therefore, the write address information generated by the DRAM write address generation unit 138 has the same content as the read address information generated by the DRAM read address generation unit 104 for the same target object.

書込リクエスト部140は、DRAM書込アドレス生成部138が生成した書込アドレスの情報をもとに、DRAMコントローラ102に対して、バンクサイズ単位で書込リクエストを発行する。DRAMコントローラ102は、出力バッファ130の読出対象のバンクからその書き込みリクエストに示されたサイズのデータを読み出し、そのデータをSDRAM200内のその書込リクエストに示されたアドレスに書き込む。   The write request unit 140 issues a write request for each bank size to the DRAM controller 102 based on the write address information generated by the DRAM write address generation unit 138. The DRAM controller 102 reads the data of the size indicated in the write request from the read target bank of the output buffer 130 and writes the data to the address indicated in the write request in the SDRAM 200.

なお、書込リクエスト部140は、読出リクエスト部106と同様、最適バンクサイズ算出部150が求めた最適バンクサイズ毎に書込リクエストを発行する。   Note that the write request unit 140 issues a write request for each optimum bank size obtained by the optimum bank size calculation unit 150, similar to the read request unit 106.

本実施形態の画像処理装置100は、以上に説明した構成に加え、最適バンクサイズ算出部150を有している。最適バンクサイズ算出部150は、入力バッファ110及び出力バッファ130のバンクのうち、対象オブジェクトの処理のために実際に使用する部分のサイズ(すなわち「最適バンクサイズ」)を算出する。最適バンクサイズは、オブジェクト毎に計算する。最適バンクサイズ算出部150は、ページのラスタライズ処理に先立って画像処理装置100内のメモリに読み込まれている当該ページのオブジェクトデータ160から、対象オブジェクトのサイズ情報を読み出し、このサイズ情報を用いて最適バンクサイズを求める。なお、このオブジェクトデータ160は、処理回路120により先頭から順に1オブジェクトずつ読み出され、ラスタライズされ、下地画像に対して書き込まれる。   The image processing apparatus 100 according to the present embodiment includes an optimum bank size calculation unit 150 in addition to the configuration described above. The optimum bank size calculation unit 150 calculates the size of the portion actually used for processing the target object (that is, “optimum bank size”) in the banks of the input buffer 110 and the output buffer 130. The optimal bank size is calculated for each object. The optimal bank size calculation unit 150 reads the size information of the target object from the object data 160 of the page read into the memory in the image processing apparatus 100 prior to the page rasterization process, and uses this size information to perform the optimal bank size calculation. Find the bank size. The object data 160 is read one by one from the top by the processing circuit 120, rasterized, and written to the background image.

図5に、最適バンクサイズ算出部150が実行する処理手順の一例を示す。   FIG. 5 shows an example of a processing procedure executed by the optimum bank size calculation unit 150.

この手順では、まず、オブジェクトデータ160から、次の対象オブジェクトのサイズ情報を求める(S10)。オブジェクトデータ160には、各オブジェクトのバウンディングボックスの例えば左上隅と右下隅の頂点の座標(例えば画素を単位として表したもの)の情報が含まれているので、この情報からバウンディングボックスの縦横の画素数を求め、この縦横の画素数と1画素あたりのデータ量からそのバウンディングボックスのデータサイズを求めることができる。   In this procedure, first, the size information of the next target object is obtained from the object data 160 (S10). Since the object data 160 includes information on the coordinates of the vertices of the upper left corner and the lower right corner of the bounding box of each object (for example, expressed in units of pixels), the vertical and horizontal pixels of the bounding box are obtained from this information. And the data size of the bounding box can be obtained from the number of vertical and horizontal pixels and the data amount per pixel.

次に最適バンクサイズ算出部150は、S10で求めたオブジェクトサイズと、バンクの上限サイズとを比較し、前者が後者以下であるかどうかを判定する(S12)。バンクの上限サイズは、入力バッファ110及び出力バッファ130の個々のバンク112a、112b、132a、132bが取り得る上限のデータ容量、すなわち個々のバンクの物理的な最大容量のことである。すなわち、本実施形態では、画像処理装置100内に設けられたバンクの物理的な全容量のうちの全部又は一部の容量を個々のオブジェクトの処理の際に使用するが、そのバンクの全容量がS12でいう上限サイズである。それらバンク112a、112b、132a、132bの上限サイズは等しい。   Next, the optimum bank size calculation unit 150 compares the object size obtained in S10 with the upper limit size of the bank, and determines whether the former is equal to or less than the latter (S12). The upper limit size of the bank is the upper limit data capacity that can be taken by the individual banks 112a, 112b, 132a, 132b of the input buffer 110 and the output buffer 130, that is, the physical maximum capacity of each bank. That is, in the present embodiment, all or a part of the physical capacity of a bank provided in the image processing apparatus 100 is used for processing each object, but the total capacity of the bank is used. Is the upper limit size in S12. The upper limit sizes of the banks 112a, 112b, 132a, 132b are equal.

S12にてオブジェクトサイズがバンクの上限サイズ以下であることがわかった場合は、最適バンクサイズ算出部150は、そのオブジェクトサイズを最適バンクサイズに決定する(S14)。   If it is found in S12 that the object size is equal to or smaller than the upper limit size of the bank, the optimum bank size calculation unit 150 determines the object size as the optimum bank size (S14).

S12にてオブジェクトサイズがバンクの上限サイズより大きいことがわかった場合は、最適バンクサイズ算出部150は、現在のバンクサイズを表す変数「カレントバンクサイズ」にバンクの上限サイズを設定する(S16)。そして、オブジェクトサイズをカレントバンクサイズで割り算し(S18)、割り切れるかどうかを判定する(S20)。S20にて割り切れることがわかった場合、最適バンクサイズ算出部150は、そのカレントバンクサイズを最適バンクサイズに決定する(S22)。一方、S20にて割り切れないことがわかった場合には、最適バンクサイズ算出部150は、S18の割り算の結果の余り(剰余)を、そのカレントバンクサイズに対応づけて記憶する(S24)。この余りが、ダミーデータのサイズである。すなわち、オブジェクトに対応するデータをそのカレントバンクサイズずつ複数回(S18の割り算の結果が)に分けてバンクに入れていく場合、最後の回には、そのデータの一部に加え、その余りの量のダミーデータがバンクに入れられることになる。例えばS18の割り算の商がn、余りがmバイトである場合、オブジェクトのデータの転送はn+1回に分けて行われ、そのうちの最初からn回目まではオブジェクトの処理に用いる有効なデータがバンクに入れられ、最後のn+1回目にはmバイトのダミーデータがバンクに入れられる。   If it is found in S12 that the object size is larger than the upper limit size of the bank, the optimum bank size calculation unit 150 sets the upper limit size of the bank in the variable “current bank size” indicating the current bank size (S16). . Then, the object size is divided by the current bank size (S18), and it is determined whether or not the object size is divisible (S20). When it is found that it is divisible in S20, the optimum bank size calculation unit 150 determines the current bank size as the optimum bank size (S22). On the other hand, when it is found that it is not divisible in S20, the optimum bank size calculation unit 150 stores the remainder (remainder) of the result of the division in S18 in association with the current bank size (S24). This remainder is the size of the dummy data. That is, when the data corresponding to the object is divided into a plurality of times (the result of the division in S18) by the current bank size and put into the bank, in the last round, in addition to a part of the data, the remainder An amount of dummy data will be put in the bank. For example, when the quotient of the division in S18 is n and the remainder is m bytes, the object data is transferred n + 1 times, and valid data used for object processing is stored in the bank from the first to the nth time. The dummy data of m bytes is put into the bank at the last (n + 1) th time.

次に最適バンクサイズ算出部150は、カレントバンクサイズをバースト長1つ分だけ減らす(S26)。ここでバースト長とは、SDRAM200と入力バッファ110又は出力バッファ130との間でのバースト転送の際の1サイクルあたりの転送データ量のことである。カレントバンクサイズを1バースト長だけ減らすと、カレントバンクサイズのバンクを一杯にするのに要する時間が1サイクル短くなる。バースト長は、DRAMコントローラ102で管理しているので、DRAMコントローラ102から取得すればよい。   Next, the optimum bank size calculation unit 150 reduces the current bank size by one burst length (S26). Here, the burst length is a transfer data amount per cycle at the time of burst transfer between the SDRAM 200 and the input buffer 110 or the output buffer 130. If the current bank size is reduced by one burst length, the time required to fill a bank of the current bank size is shortened by one cycle. Since the burst length is managed by the DRAM controller 102, it may be acquired from the DRAM controller 102.

S26の後、最適バンクサイズ算出部150は、カレントバンクサイズが下限値以下になったかどうかを判定する(S28)。カレントバンクサイズの下限値は、例えば0であってもよいし、0より大きい値であってもよい。下限値が0の場合においてS28の判定結果がYesとなると、その判定の直前のカレントバンクサイズは1バースト長である。この場合、カレントバンクサイズが上限サイズから1バースト長になるまで1バースト長刻みでカレントバンクサイズを減らしつつ、オブジェクトサイズがカレントバンクサイズで割りきれるかの判定(S20)を行ったことになる。   After S26, the optimum bank size calculation unit 150 determines whether or not the current bank size is equal to or smaller than the lower limit value (S28). The lower limit value of the current bank size may be 0, for example, or a value greater than 0. If the determination result in S28 is Yes when the lower limit is 0, the current bank size immediately before the determination is 1 burst length. In this case, it is determined whether the object size can be divided by the current bank size while reducing the current bank size in increments of 1 burst length until the current bank size reaches the burst length from the upper limit size (S20).

また、下限値としての適切な値を実験やシミュレーションで求めてもよい。最適バンクサイズを小さくするほど、一般にダミーサイズは小さくなる(ダミーサイズはバンクサイズ未満だから)ため無駄なデータの転送時間が減るが、その反面、SDRAM200に対する読出リクエストや書込リクエストの発行回数が増え、それらリクエストの処理のための時間が増大する。このトレードオフの関係において、これ以上最適バンクサイズを減らすと、ダミーデータの減少による転送時間の短縮効果が、リクエストの回数増大による処理時間の増大により打ち消されてしまうという限界点を、実験等により求める。この限界点は、SDRAM200の性能、バスの転送周波数、転送時のバースト長などといった様々な環境要因の組合せにより変わるので、1つのシステム(SDRAM200と画像処理装置100をバスで接続したシステム)を設計すると、そのシステムについて実験等により求める。そして、その限界点のサイズから1バースト長分減算した値を、S28で用いる下限値とすればよい。   Moreover, you may obtain | require an appropriate value as a lower limit by experiment or simulation. The smaller the optimal bank size, the smaller the dummy size (since the dummy size is less than the bank size), so the useless data transfer time is reduced. On the other hand, the number of read requests and write requests issued to the SDRAM 200 increases. , The time for processing those requests increases. In this trade-off relationship, if the optimal bank size is further reduced, the effect of shortening the transfer time due to the decrease in dummy data is negated by the increase in processing time due to the increase in the number of requests. Ask. Since this limit changes depending on the combination of various environmental factors such as the performance of SDRAM 200, bus transfer frequency, burst length during transfer, etc., one system (system in which SDRAM 200 and image processing apparatus 100 are connected by a bus) is designed. Then, the system is obtained by experiments or the like. Then, a value obtained by subtracting one burst length from the size of the limit point may be used as the lower limit value used in S28.

S28でカレントバンクサイズが下限値より大きいことがわかった場合、最適バンクサイズ算出部150は、S18に戻り同様の処理を繰り返す。S28でカレントバンクサイズが下限値以下になったことがわかった場合、最適バンクサイズ算出部150は、それまでに記憶した、カレントバンクサイズとダミーデータのサイズとのペアの中から、ダミーデータの量が最小のカレントバンクサイズを特定し、特定したカレントバンクサイズを最適バンクサイズに決定する(S30)。ダミーデータの量が最小のカレントバンクサイズが複数存在する場合には、そのうちで最も大きいカレントバンクサイズを最適バンクサイズに決定する。   If it is found in S28 that the current bank size is larger than the lower limit value, the optimum bank size calculation unit 150 returns to S18 and repeats the same processing. When it is found in S28 that the current bank size has become equal to or smaller than the lower limit value, the optimum bank size calculation unit 150 calculates the dummy data from the pair of the current bank size and the size of the dummy data stored so far. The current bank size with the smallest amount is specified, and the specified current bank size is determined as the optimum bank size (S30). When there are a plurality of current bank sizes with the smallest amount of dummy data, the largest current bank size is determined as the optimum bank size.

以上のようにして、S14、S22又はS30にて最適バンクサイズが決定されると、当該オブジェクトについての最適バンクサイズ決定処理を終了する。   As described above, when the optimum bank size is determined in S14, S22, or S30, the optimum bank size determination process for the object is terminated.

最適バンクサイズ算出部150は、このようにして求めた最適バンクサイズを、読出リクエスト部106、書込リクエスト部140、バッファ書込カウンタ108及び134、並びに、バッファ読出カウンタ114及び136に供給する。読出リクエスト部106及び書込リクエスト部140は、その最適バンクサイズ毎に、読出又は書込のためのリクエストを生成する。バッファ書込カウンタ108及び134は、書込対象のバンク112a、112b、132a、又は132bに対して書き込まれたデータ量が最適バンクサイズに達する毎に、その書込対象のバンクへのデータの書き込みを停止し、書込対象のバンクと読出対象のバンクの切り換えを可能とする。同様に、バッファ読出カウンタ114及び136は、読出対象のバンク112a、112b、132a、又は132bから読み出されたデータ量が最適バンクサイズに達する毎に、その読出対象のバンクからのデータの読出を停止し、書込対象のバンクと読出対象のバンクの切り換えを可能とする。1つのバッファ110又は130内の書込対象のバンクへの書込が終了し、読出対象のバンクからの読出が終了すると、書込対象と読出対象のバンクを切り換える。   The optimum bank size calculation unit 150 supplies the optimum bank size obtained in this way to the read request unit 106, the write request unit 140, the buffer write counters 108 and 134, and the buffer read counters 114 and 136. The read request unit 106 and the write request unit 140 generate a request for reading or writing for each optimum bank size. The buffer write counters 108 and 134 write data to the write target bank each time the amount of data written to the write target bank 112a, 112b, 132a, or 132b reaches the optimum bank size. Is stopped, and the bank to be written and the bank to be read can be switched. Similarly, the buffer read counters 114 and 136 read data from the read target bank each time the amount of data read from the read target bank 112a, 112b, 132a, or 132b reaches the optimum bank size. It stops and enables switching between the bank to be written and the bank to be read. When writing to the bank to be written in one buffer 110 or 130 is completed and reading from the bank to be read is completed, the bank to be written and the bank to be read are switched.

この実施形態の方式によれば、例えばバンクの上限サイズが4Kバイトである場合において、サイズが6Kバイトのオブジェクトを処理する場合、図6の(b)に示すように、最適バンクサイズが3Kバイト(=3096バイト)となる。この場合、そのオブジェクトに対応する6Kバイトの下地画像のデータが、3Kバイトずつ2回に分けて入力バッファ110のバンク112a及び112bに順に書き込まれ、ダミーデータは生じない。一方のバンク112aへの3Kバイトのデータの書込が完了した時点で、書込対象がもう一方のバックへと切り換えられると共に、それまで書き込んでいたバンクからのデータの読出が開始される。バンクへの書込の速度と読出の速度が等しいとし、その他の条件を図2の例と同様とすると、そのオブジェクトのラスタライズのために下地画像を入力バッファ110に読み込み、読み込んだ下地画像をその入力バッファ110からすべて読み出すまでに要する時間は図示の通り5.82μsとなる。   According to the method of this embodiment, for example, when an object having a size of 6 Kbytes is processed when the upper limit size of the bank is 4 Kbytes, the optimum bank size is 3 Kbytes as shown in FIG. (= 3096 bytes). In this case, 6 Kbytes of the background image data corresponding to the object is written into the banks 112 a and 112 b of the input buffer 110 in sequence by 3 Kbytes twice, and no dummy data is generated. When the writing of 3 Kbytes of data to one bank 112a is completed, the writing target is switched to the other back, and reading of data from the bank that has been written so far is started. If the writing speed to the bank is the same as the reading speed and the other conditions are the same as in the example of FIG. 2, the background image is read into the input buffer 110 for rasterization of the object, and the read background image is The time required to read all data from the input buffer 110 is 5.82 μs as shown.

これに対し、図2の例のように、バンクサイズを4Kバイト固定とすると、図6の(a)に示すように、1Kバイトのダミーデータをバンクに読み込む必要がある。この場合、オブジェクトに対応する6Kバイトの下地画像を入力バッファ110にいったん読み込んでから、すべて読み出す(そして処理する)までに要する時間は、図示の通り、7.68μsとなる。   On the other hand, if the bank size is fixed at 4 Kbytes as in the example of FIG. 2, it is necessary to read 1 Kbytes of dummy data into the bank as shown in FIG. In this case, the time required from once reading the 6 Kbyte background image corresponding to the object to the input buffer 110 to reading (and processing) it is 7.68 μs as shown in the figure.

図6の(a)と(b)を比較すると、本実施形態の方式の方が、そのオブジェクトを処理するのに要する時間がバンクサイズが4Kバイト固定の場合より1.86μs短くて済むことがわかる(処理回路120はハードウエア回路であり、入力バッファ110からデータを読み出すと同時にそのデータがその回路で処理されるので、処理に要する時間はデータを読み出す時間と等しい)。したがって、同様のオブジェクトが1ページ内に仮に10000個ある場合、そのページを処理するのに要する時間は、本実施形態の方がバンクサイズが4Kバイト固定の場合より約19ms短くなる。前述の通り1ページあたりの処理時間が33.3msであるとすると、約19msの短縮は、1ページの処理時間の約57%の短縮に相当する。   Comparing (a) and (b) of FIG. 6, the method of the present embodiment requires that the time required to process the object is 1.86 μs shorter than the case where the bank size is fixed to 4 Kbytes. (The processing circuit 120 is a hardware circuit, and since the data is processed by the circuit at the same time that the data is read from the input buffer 110, the time required for the processing is equal to the time for reading the data). Therefore, if there are 10,000 similar objects in one page, the time required to process the page is about 19 ms shorter in this embodiment than in the case where the bank size is fixed at 4 Kbytes. Assuming that the processing time per page is 33.3 ms as described above, a reduction of about 19 ms corresponds to a reduction of about 57% of the processing time of one page.

以上に説明した最適バンクサイズ算出部150は、例えば、画像処理装置100が備えるプロセッサ(図示省略)が、その最適バンクサイズ算出部150の処理を記述したプログラムを実行することにより実現される。ハードウエア回路である処理回路120があるオブジェクトについてのラスタライズ処理を実行している間に、プロセッサが、そのオブジェクトの次あるいはその後のオブジェクトについての最適バンクサイズを計算することで、最適バンクサイズの計算に要する時間が隠蔽される。   The optimal bank size calculation unit 150 described above is realized by, for example, a processor (not shown) included in the image processing apparatus 100 executing a program describing the processing of the optimal bank size calculation unit 150. While the processing circuit 120, which is a hardware circuit, is performing rasterization processing on an object, the processor calculates the optimal bank size for the next or subsequent object of the object, thereby calculating the optimal bank size. The time required for is hidden.

例えば、画像処理装置100を、特開2009−3765号公報に紹介されたDAP・DNAアーキテクチャ等の、動的再構成可能プロセッサ(DRP:Dynamic Reconfigurable Processor)を用いて構成することも可能である。この場合、処理回路120は、DNA(Distributed Network Architecture)と呼ばれる、構成を動的に変更可能なPE(プロセッサエレメント)のマトリックスを用いて構成する。また、入力バッファ110、出力バッファ130、バッファ書込カウンタ108及び134、バッファ読出カウンタ114及び136、オブジェクトデータ160を保持するメインメモリ、プログラムや設定値等を保持する不揮発性メモリ等は、固定のハードウエア回路としてDRPに内蔵される。そして、最適バンクサイズ算出部150は、不揮発性メモリに記憶されたプログラムを、DAP(Digital Application Processor)と呼ばれるプロセッサにより実行することにより実現される。なお、DAP・DNAアーキテクチャはあくまで一例に過ぎない。   For example, the image processing apparatus 100 can also be configured using a dynamic reconfigurable processor (DRP) such as the DAP / DNA architecture introduced in Japanese Patent Laid-Open No. 2009-3765. In this case, the processing circuit 120 is configured using a matrix of PE (processor elements) called DNA (Distributed Network Architecture) whose configuration can be dynamically changed. In addition, the input buffer 110, the output buffer 130, the buffer write counters 108 and 134, the buffer read counters 114 and 136, the main memory that holds the object data 160, the nonvolatile memory that holds programs, setting values, and the like are fixed. Built in DRP as a hardware circuit. The optimum bank size calculation unit 150 is realized by executing a program stored in the nonvolatile memory by a processor called DAP (Digital Application Processor). The DAP / DNA architecture is merely an example.

以上の例では、入力バッファ110及び出力バッファ130の両方のバンクサイズをオブジェクトのサイズに合わせて制御したが、それら両者のうち一方のみを制御するようにしてもよい。   In the above example, the bank sizes of both the input buffer 110 and the output buffer 130 are controlled in accordance with the size of the object, but only one of them may be controlled.

以上の説明では、オブジェクトをラスタライズして下地のラスター画像上に書き込む処理を例にとったが、本実施形態の最適バンクサイズの決定方式は、そのような応用例に限定されるものではない。例えば、画像に対して平均値フィルタやエッジ強調フィルタなどのフィルタ処理を施す場合などにおいて、適用するフィルタの種類やフィルタのパラメータをオブジェクトの種類毎に切り換える場合にも、オブジェクト毎の画像データをバンク(バッファ)に入れる必要がある。このような場合にも、本実施形態の方式を用いて、最適バンクサイズを求めることができる。   In the above description, the process of rasterizing an object and writing it on the underlying raster image is taken as an example, but the optimum bank size determination method of the present embodiment is not limited to such an application example. For example, when performing filter processing such as an average value filter or edge enhancement filter on an image, the image data for each object is banked even when the type of filter to be applied and the filter parameter are switched for each object type. (Buffer) need to be put. Even in such a case, the optimum bank size can be obtained using the method of the present embodiment.

100 画像処理装置、102 DRAMコントローラ、104 読出アドレス生成部、106 読出リクエスト部、108 バッファ書込カウンタ、110 入力バッファ、112a,112b,132a,132b バンク、114 バッファ読出カウンタ、120 処理回路、130 出力バッファ、134 バッファ書込カウンタ、136 バッファ読出カウンタ、138 DRAM書込アドレス生成部、140 書込リクエスト部、150 最適バンクサイズ算出部、160 オブジェクトデータ、200 SDRAM。
DESCRIPTION OF SYMBOLS 100 Image processing apparatus, 102 DRAM controller, 104 Reading address generation part, 106 Reading request part, 108 Buffer write counter, 110 Input buffer, 112a, 112b, 132a, 132b Bank, 114 Buffer reading counter, 120 Processing circuit, 130 Output Buffer, 134 Buffer write counter, 136 Buffer read counter, 138 DRAM write address generation unit, 140 Write request unit, 150 Optimal bank size calculation unit, 160 Object data, 200 SDRAM

Claims (5)

入力バッファと、
外部から入力され前記入力バッファに保持された入力データを用いて画像処理を実行する画像処理回路と、
処理対象の画像オブジェクトに対応するデータのサイズを取得する取得手段と、
前記入力バッファのうち前記画像オブジェクトに対応するデータの保持に使用する部分の最適サイズを、前記取得手段が取得したサイズに基づき算出する算出手段と、
前記入力バッファに対し、外部から、前記画像オブジェクトに対応する前記入力データとして前記最適サイズずつのデータを読み込むよう制御する読み込み制御手段と、
を有する画像処理装置。
An input buffer;
An image processing circuit that performs image processing using input data that is input from outside and held in the input buffer;
Acquisition means for acquiring the size of data corresponding to the image object to be processed;
A calculating unit that calculates an optimum size of a portion used for holding data corresponding to the image object in the input buffer based on the size acquired by the acquiring unit;
Reading control means for controlling the input buffer to read data of the optimum size as the input data corresponding to the image object from the outside;
An image processing apparatus.
前記算出手段は、前記入力バッファの使用サイズを単位サイズずつ変えた場合において、前記画像オブジェクトに対応するデータのサイズをその使用サイズで割った余りが最小となる場合の使用サイズを、前記画像オブジェクトに対応する前記入力バッファの最適サイズとする、ことを特徴とする請求項1に記載の画像処理装置。   The calculation means calculates the used size when the remainder obtained by dividing the size of data corresponding to the image object by the used size is minimum when the used size of the input buffer is changed by unit size. The image processing apparatus according to claim 1, wherein an optimum size of the input buffer corresponding to the input buffer is set. 前記算出手段は、前記余りが最小となる前記使用サイズが複数ある場合、それら複数のうち最大のものを前記最適サイズに決定する、ことを特徴とする請求項2に記載の画像処理装置。   3. The image processing apparatus according to claim 2, wherein, when there are a plurality of use sizes that minimize the remainder, the calculation unit determines the maximum one of the plurality as the optimum size. 前記算出手段は、前記画像オブジェクトに対応するデータのサイズが前記入力バッファの上限サイズ以下である場合に、当該画像オブジェクトに対応するデータのサイズを前記最適サイズに決定する、ことを特徴とする請求項1に記載の画像処理装置。   The calculation means, when the size of data corresponding to the image object is equal to or smaller than the upper limit size of the input buffer, determines the size of data corresponding to the image object as the optimum size. Item 8. The image processing apparatus according to Item 1. コンピュータを、
処理対象の画像オブジェクトに対応するデータのサイズを取得する取得手段、
画像処理回路に対する入力データを保持する入力バッファのうち前記画像オブジェクトに対応するデータの保持に使用する部分の最適サイズを、前記取得手段が取得したサイズに基づき算出する算出手段、
前記入力バッファに対し、外部から、前記画像オブジェクトに対応する前記入力データとして前記最適サイズずつのデータを読み込むよう制御する読み込み制御手段、
として機能させるためのプログラム。
Computer
Acquisition means for acquiring the size of data corresponding to the image object to be processed;
A calculating means for calculating an optimum size of a portion used for holding data corresponding to the image object in an input buffer for holding input data to the image processing circuit based on the size acquired by the acquiring means;
Read control means for controlling the input buffer to read data of the optimum size as the input data corresponding to the image object from the outside,
Program to function as.
JP2013211999A 2013-10-09 2013-10-09 Image processing apparatus and program Expired - Fee Related JP6115435B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013211999A JP6115435B2 (en) 2013-10-09 2013-10-09 Image processing apparatus and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013211999A JP6115435B2 (en) 2013-10-09 2013-10-09 Image processing apparatus and program

Publications (2)

Publication Number Publication Date
JP2015076735A JP2015076735A (en) 2015-04-20
JP6115435B2 true JP6115435B2 (en) 2017-04-19

Family

ID=53001283

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013211999A Expired - Fee Related JP6115435B2 (en) 2013-10-09 2013-10-09 Image processing apparatus and program

Country Status (1)

Country Link
JP (1) JP6115435B2 (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002288630A (en) * 2001-03-26 2002-10-04 Olympus Optical Co Ltd Image processing device
JP5611917B2 (en) * 2011-09-20 2014-10-22 株式会社東芝 Projector and image processing apparatus

Also Published As

Publication number Publication date
JP2015076735A (en) 2015-04-20

Similar Documents

Publication Publication Date Title
JP6009692B2 (en) Multi-mode memory access technique for graphics processing unit based memory transfer operations
WO2018077295A1 (en) Data processing method and apparatus for convolutional neural network
JP2006318178A (en) Device and method for data transfer arbitration
CN101084493A (en) Method and apparatus for reading and writing pixel-aligned subframes in a frame buffer
WO2016140764A1 (en) Providing asynchronous display shader functionality on a shared shader core
CN107682730B (en) Layer superposition processing method, layer superposition processing device and video processor
JP2014239304A (en) Image processing device and image processing method
JP6414388B2 (en) Accelerator circuit and image processing apparatus
JP6018398B2 (en) Image processing apparatus and processing method thereof
JP2007018222A (en) Memory access control circuit
US8368708B2 (en) Image processing apparatus, image processing method, and storage medium storing control program therefor
JP6115435B2 (en) Image processing apparatus and program
US20130235057A1 (en) Area-based dependency chain analysis of shaders and command stream
JP6160317B2 (en) Image processing apparatus and program
JP5583563B2 (en) Data processing device
JP4137903B2 (en) Graphics display device and graphics processor
JP6613699B2 (en) Image processing device
JP6120561B2 (en) Graphic drawing apparatus and graphic drawing program
JP5501298B2 (en) Image processing device
JP6283980B2 (en) Image processing apparatus and image processing method
JP6926940B2 (en) Image processing equipment and programs
JP2007058276A (en) Multiprocessor
JP2006031160A (en) Graphic object processing method
JP6379757B2 (en) Image processing apparatus and image forming apparatus
JP5316269B2 (en) Image processing apparatus, hardware accelerator, and image processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160524

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170130

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20170221

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170306

R150 Certificate of patent or registration of utility model

Ref document number: 6115435

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees