JP2012095227A - Image processing system, image processing method, and program - Google Patents

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

Info

Publication number
JP2012095227A
JP2012095227A JP2010242649A JP2010242649A JP2012095227A JP 2012095227 A JP2012095227 A JP 2012095227A JP 2010242649 A JP2010242649 A JP 2010242649A JP 2010242649 A JP2010242649 A JP 2010242649A JP 2012095227 A JP2012095227 A JP 2012095227A
Authority
JP
Japan
Prior art keywords
color
data
encoding
stage
pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2010242649A
Other languages
Japanese (ja)
Inventor
Daisuke Matsunaga
大佑 松永
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 JP2010242649A priority Critical patent/JP2012095227A/en
Publication of JP2012095227A publication Critical patent/JP2012095227A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an image processing system in which the number of times of memory access is reduced at decompression of the compressed data that has been compressed in multiple stages, with circuit scale being suppressed from growing too large.SOLUTION: The image processing system includes: representative color decoding means which determines a position for decompressing a representative color obtained by N-th encoding based on the arrangement information available by first-Nth encodings, and decompresses the representative color at the determined position; and N pieces of interpolating color decoding means which determines the position for decompressing the interpolation color obtained by Mth (M is any of integers 1-N) encoding based on the arrangement information available by first-Mth encodings, and decompresses the interpolation color obtained by the Mth encoding at the determined position. The representative color decoding means and the N pieces of interpolation color decoding means operate separately from each other.

Description

本発明は、画像を所定のブロック単位に圧縮する技術とブロック単位に圧縮された画像の画像処理や復号化処理を行う技術に関する。   The present invention relates to a technique for compressing an image in predetermined block units and a technique for performing image processing and decoding processing on an image compressed in block units.

従来、高解像度のカラー画像への需要は高く、それらの高画質化への要望へ応えるべくデジタル複合機では1200dpiやそれを超える解像度の画像を扱うことが多くなってきている。画像の高解像度化が進むにつれて、画像処理を必要とする画素数が飛躍的に増え、その処理負荷が増大しているという課題がある。デジタル複合機に限らず、デジタルカメラやファクシミリ装置などの画像処理装置では、メモリ/ハードディスク量の節約やそれらへの書き込み時間を短縮するために、カラー画像データの圧縮を行い、低コスト化や高速化を実現している。   Conventionally, there is a high demand for high-resolution color images, and digital multifunction peripherals are increasingly handling images with a resolution of 1200 dpi or higher in order to meet the demand for higher image quality. As the resolution of an image increases, there is a problem that the number of pixels that require image processing increases dramatically and the processing load increases. Image processing devices such as digital cameras and facsimile machines, not limited to digital multifunction devices, compress color image data in order to save memory and hard disk space and shorten the time required for writing to them. Has been realized.

カラー静止画像の圧縮方式には、離散コサイン変換を利用したJPEG方式やWavelet変換を利用した方式が多く使われている。この種の符号化方式は、一般的に画像を所定のブロック(例えば8×8や16×16画素単位)に符号化し、離散コサイン変換、量子化及びエントロピー符号化を行うことで高い圧縮効率を達成している。この種の符号化方式は、可変長符号化方式であるので、符号化対象の画像毎に符号量が変化するものである。これらの画像圧縮を用いた場合、その画素データを参照し、その画素データを変換するには、圧縮データの復号処理が必要になる。つまり、圧縮データのままで画像処理を行うことはできず、必ず復号処理が必要になり、高解像度データ全ての画素に対して画素単位に処理を行う必要が出てしまい、処理時間の増大を招く。   As a color still image compression method, a JPEG method using discrete cosine transform or a method using Wavelet transform is often used. In this type of encoding method, generally, an image is encoded into a predetermined block (for example, 8 × 8 or 16 × 16 pixel unit), and high compression efficiency is achieved by performing discrete cosine transform, quantization, and entropy encoding. Have achieved. Since this type of encoding method is a variable-length encoding method, the code amount changes for each image to be encoded. When these image compressions are used, in order to refer to the pixel data and convert the pixel data, it is necessary to decode the compressed data. In other words, image processing cannot be performed with compressed data as it is, and decoding processing is necessarily required, and it is necessary to perform processing on a pixel basis for all pixels of high resolution data, which increases processing time. Invite.

圧縮処理を行う技術としては、画素データとその連続数を記憶する公知のランレングス圧縮方式やブロック単位でエッジを検出し、そのエッジの持つ2色を記憶することで圧縮する技術が開示されている(例えば、特許文献1、特許文献2)。   As a technique for performing compression processing, a known run-length compression method for storing pixel data and the number of continuous data, or a technique for compressing by detecting edges in units of blocks and storing two colors of the edges are disclosed. (For example, Patent Document 1 and Patent Document 2).

特開2008−271046号公報JP 2008-271046 A 特開平10−257488号公報JP-A-10-257488

特許文献1においては、ブロック内を2色化し、その2色の配置に関する形状情報と2色の色情報を記憶していた。これに対し、さらなる高画質化、処理高速化を図るため、本願出願人による先願である特願2009−221444では、2以上の色数を持つブロックの画質を落とさずに高圧縮化を実現している。特願2009−221444では、まず、画像データをブロック(例えば2×2画素サイズのブロック)毎に分割する。そして、ブロック内の各画素の色データを比較することにより、注目ブロックに含まれる色データの配置パターン情報と、注目ブロックに含まれる色数分の色データ情報とを出力する。そして、出力された色データ情報のうち、各ブロックの予め決められた特定位置の画素に対応する第1の色データ情報と、その他の色データ情報(2×2画素ブロックの場合は第2〜4色の色データ情報)とに分けて、それぞれ異なるメモリ領域にまとめて格納する。したがって、メモリ領域には、配置パターン情報と、第1色の色データ情報と、その他の色データ情報とがそれぞれまとめて格納されることになる。これにより、特定位置の間引き画像データ(すなわち第1色の色データ情報)を連続メモリ領域に置くことになるので、第1色の色データ情報を読み出すだけで、複雑な復号化処理を必要とせずに、半分の解像度の低解像度画像を扱える。   In Patent Document 1, the inside of a block is made into two colors, and shape information relating to the arrangement of the two colors and color information of the two colors are stored. On the other hand, in order to achieve higher image quality and higher processing speed, Japanese Patent Application No. 2009-212444, which is a prior application by the applicant of the present application, realizes high compression without degrading the image quality of blocks having two or more colors. is doing. In Japanese Patent Application No. 2009-212444, first, image data is divided into blocks (for example, blocks of 2 × 2 pixel size). Then, by comparing the color data of each pixel in the block, the arrangement pattern information of the color data included in the block of interest and the color data information for the number of colors included in the block of interest are output. Among the output color data information, the first color data information corresponding to the pixel at a predetermined specific position of each block and the other color data information (in the case of a 2 × 2 pixel block, the second to second color data information). 4 color data information) and stored in different memory areas. Therefore, arrangement pattern information, first color data information, and other color data information are collectively stored in the memory area. As a result, thinned-out image data (that is, color data information of the first color) at a specific position is placed in the continuous memory area, so that complex decoding processing is required only by reading out the color data information of the first color. Can handle low-resolution images with half the resolution.

一方で、特願2009−221444では、該圧縮技術で圧縮されたデータを展開処理する方法についても述べられている。例えば、図19に示すように、まず注目ブロックの配置パターン情報と第1の色データ情報をメモリから読み込み、更に、配置パターン情報に基づいて、必要な色数分だけその他の色データ情報(第2〜4色の色データ情報)を読込む。そして、配置パターン情報にしたがって、第1の色データ情報とその他の色データ情報とをメモリ上に配置することで、データの展開(復号化)を行う。   On the other hand, Japanese Patent Application No. 2009-212444 also describes a method of decompressing data compressed by the compression technique. For example, as shown in FIG. 19, first, the arrangement pattern information of the block of interest and the first color data information are read from the memory, and further, the other color data information (the first number of colors) corresponding to the required number of colors based on the arrangement pattern information. 2-4 color data information). Then, in accordance with the arrangement pattern information, the first color data information and the other color data information are arranged on the memory to perform data expansion (decoding).

また、本出願人は、特願2009−221444で提案している圧縮技術を複数回繰り返し適用することにより、多段階圧縮することも考えている。多段階圧縮の手法については、後述する実施形態で詳述するが、簡単に説明すると次のようになる。すなわち、元の画像データに対して上述した圧縮処理(1段階目の圧縮処理)を適用することにより、1段階目の配置パターン情報と、第1色の色データ情報と、その他の色データ情報とに変換する。そして、更に、1段階目の圧縮処理で得られた第1色の色データ情報を次の処理対象画像として、2段階目の圧縮処理を行う。このような多段階圧縮を行えば、1段階目の圧縮処理で得た第1色の色データ情報が、2段階目の圧縮処理による2段階目の配置パターン情報と2段階目の第1色の色データ情報と2段階目のその他の色データ情報に置き換えられることになる。例えば、ブロックのサイズを2×2画素とした場合、その他の色データ情報は第2〜4色の色データ情報で表わされるため、上述した圧縮処理を2段階繰り返し行うと、図14(b)に示されるような圧縮データが得られる。   The present applicant also considers multi-stage compression by repeatedly applying the compression technique proposed in Japanese Patent Application No. 2009-212444 a plurality of times. The multi-stage compression method will be described in detail in an embodiment to be described later, but will be briefly described as follows. That is, by applying the compression process (first-stage compression process) described above to the original image data, the first-stage arrangement pattern information, the first color data information, and the other color data information And convert to Further, the second-stage compression processing is performed using the color data information of the first color obtained by the first-stage compression processing as the next processing target image. If such multi-stage compression is performed, the color data information of the first color obtained by the compression process of the first stage becomes the arrangement pattern information of the second stage by the compression process of the second stage and the first color of the second stage. Color data information and other color data information in the second stage. For example, when the block size is 2 × 2 pixels, the other color data information is represented by the color data information of the second to fourth colors. Therefore, if the above-described compression process is repeated two stages, FIG. The compressed data as shown in FIG.

一方、1つの展開部を用いて、上述したように多段階圧縮されたデータを圧縮時と逆順で段階的に展開するように構成した場合、以下のような課題が生じると考えられる。第1に、多段階展開時、メモリアクセス回数が多くなることでメモリ帯域が圧迫される。例えば、16ブロックの処理対象画像(2×2画素サイズのブロックが4×4個存在する画像)に対して第1段階の圧縮処理後の第1色の色データ情報は、4ブロックの画像(2×2画素サイズのブロックが2×2個存在する画像)で構成されることになる。さらに、この4ブロックの画像に対して第2段階の圧縮処理を行った後の第1色の色データ情報は、1ブロックの画像になる。この1ブロックに圧縮された圧縮データを2段階展開して元の画像に展開する場合、まず、第2段階圧縮データの展開処理(2段階目の配置パターン情報に従って、2段階目の第1色の色データ情報と第2〜4色の色データ情報とを展開する処理)で、少なくとも1ブロックの色データ読み出しと4ブロックの色データ書き込みを行う。さらに、そのデータを処理対象として第1段階圧縮データの展開処理を行った場合、少なくとも4ブロックの色データ読み出しと16ブロックの色データ書き込みを行う。したがって、メモリアクセス回数が大きくなり、メモリ帯域を圧迫する。   On the other hand, when it is configured to use a single decompression unit to decompress data that has been compressed in multiple stages as described above in a reverse order as compared with the time of compression, the following problems may occur. First, at the time of multi-stage development, the memory bandwidth is compressed by increasing the number of memory accesses. For example, the color data information of the first color after the first stage compression processing for a 16-block processing target image (an image having 4 × 4 blocks of 2 × 2 pixel size) is an image of 4 blocks ( 2 × 2 pixel size image). Further, the color data information of the first color after the second-stage compression processing is performed on the four-block image becomes a one-block image. When the compressed data compressed into one block is developed in two stages and developed into the original image, first, the second stage compressed data is developed (the first color in the second stage according to the arrangement pattern information in the second stage). In this process, at least one block of color data is read and four blocks of color data are written. Further, when the decompression process of the first-stage compressed data is performed with the data as a processing target, at least 4 blocks of color data are read and 16 blocks of color data are written. Therefore, the number of memory accesses increases, and the memory bandwidth is reduced.

また、多段階展開のスループットを上げるために、上述した展開部を複数設けてパイプライン化して、段階的に展開するように構成した場合、第1と第2の展開部の間に配置する中間バッファや、展開部の数が多くなることで、回路規模が増大する。例えば、第2段階圧縮データの展開を行う展開部での展開によって、1ブロックの情報は4ブロック分に増加する。したがって、第2段階圧縮データの展開部でのスループットと同じスループットで、第1段階圧縮データの展開部が展開処理するためには、第1段階圧縮データの展開を行う4つの展開部が必要となり、4ブロック分の中間バッファも必要となる。そのため、全体として展開部は5つ必要となり、中間バッファも含め、回路規模は増加する。さらに、3段階以上圧縮されたデータの展開を行う場合、必要な展開部の数は指数関数的に増加し、回路規模が増加するため、実装が難しくなるといった課題がある。   In addition, in order to increase the throughput of multi-stage deployment, in the case where a plurality of development sections described above are provided and pipelined so as to develop in stages, an intermediate arrangement between the first and second development sections As the number of buffers and expansion units increases, the circuit scale increases. For example, one block of information is increased to four blocks by expansion in the expansion unit that expands the second-stage compressed data. Therefore, in order for the decompression unit of the first stage compressed data to perform the decompression process with the same throughput as the decompression unit of the second stage compressed data, four decompression units that decompress the first stage compressed data are required. An intermediate buffer for 4 blocks is also required. Therefore, five expansion units are required as a whole, and the circuit scale increases including the intermediate buffer. Further, when decompressing data compressed in three or more stages, the number of necessary decompression units increases exponentially and the circuit scale increases, which makes it difficult to implement.

つまり、多段階圧縮された圧縮データを、1つの展開部で段階的に展開しようとすると、メインメモリへのアクセス回数が多くなり、メモリ帯域を圧迫する。また、複数の展開部をパイプライン化して段階的に展開を行う場合、中間バッファ等、回路規模が増加してしまい、実装が困難となる。   That is, if compressed data that has been subjected to multi-stage compression is expanded in a stepwise manner by one expansion unit, the number of accesses to the main memory increases and the memory bandwidth is compressed. In addition, when a plurality of development units are pipelined and development is performed in stages, the circuit scale, such as an intermediate buffer, increases, which makes implementation difficult.

上記課題を解決するために本発明は以下の構成を有する。すなわち、画像データを2×2画素サイズのブロックごとに分割し、当該分割された各ブロックにおける所定の位置の画素の画素値を代表色、前記各ブロックにおける代表色以外の画素値を補間色、前記各ブロックにおける前記代表色と前記補間色の配置パターンを配置情報として取得し、前記代表色と前記補間色と前記配置情報とをそれぞれ異なる記憶領域に記憶する符号化手段により、N−1回目(Nは2以上の整数)の符号化により得られた代表色からなる画像データに対してN回目の符号化を行うことで得られた圧縮データを復号する画像処理装置であって、前記符号化手段によるN回目の符号化によって得られた代表色を展開すべき位置を、前記符号化手段による1〜N回目の符号化によって得られた配置情報それぞれに基づいて特定し、当該特定した位置に前記代表色を展開する代表色復号手段と、前記符号化手段によるM回目(Mは1〜Nのいずれかの整数)の符号化によって得られた補間色を展開すべき位置を、前記符号化手段による1〜M回目の符号化によって得られた配置情報それぞれに基づいて特定し、当該特定した位置に前記M回目の符号化によって得られた補間色を展開するN個の補間色復号手段とを有し、前記代表色復号手段と、前記N個の補間色復号手段は、それぞれ独立して動作することを特徴とする。   In order to solve the above problems, the present invention has the following configuration. That is, the image data is divided into blocks each having a 2 × 2 pixel size, the pixel value of a pixel at a predetermined position in each divided block is a representative color, and the pixel value other than the representative color in each block is an interpolation color. The encoding unit that acquires the arrangement pattern of the representative color and the interpolation color in each block as arrangement information and stores the representative color, the interpolation color, and the arrangement information in different storage areas respectively, An image processing apparatus for decoding compressed data obtained by performing N-th coding on image data composed of representative colors obtained by encoding (N is an integer of 2 or more), wherein the code The position where the representative color obtained by the Nth encoding by the encoding means should be developed is based on the arrangement information obtained by the 1st to Nth encodings by the encoding means. The representative color decoding means for developing the representative color at the specified position and the interpolation color obtained by the Mth encoding (M is an integer from 1 to N) by the encoding means are developed. The position to be determined is specified based on the arrangement information obtained by the 1st to Mth encodings by the encoding means, and the interpolation color obtained by the Mth encoding is developed at the specified position. And N interpolation color decoding means, wherein the representative color decoding means and the N interpolation color decoding means operate independently of each other.

多段階圧縮データの展開時にメモリアクセス回数が少なく、かつ回路規模を増加させることなく高速化のための実装が容易な復号化方法を提供する。   Provided is a decoding method in which the number of memory accesses is small when multi-stage compressed data is expanded, and the implementation for speeding up is easy without increasing the circuit scale.

本発明に係るMFPシステムの概要示した図。1 is a diagram showing an outline of an MFP system according to the present invention. 本発明に係るコントローラの概要を示した図。The figure which showed the outline | summary of the controller which concerns on this invention. 画像をブロック分割した際にそのブロックのパターンを列挙した図。The figure which enumerated the pattern of the block when dividing an image into blocks. ブロックのパターンとその識別子を列挙した図。The figure which enumerated the pattern of the block and its identifier. 第一実施形態に係る画像圧縮のフローを示した図。The figure which showed the flow of the image compression which concerns on 1st embodiment. 第一実施形態に係る1段階圧縮処理に対する入力と出力の関係を示した図。The figure which showed the relationship between the input and output with respect to 1 step | paragraph compression processing which concerns on 1st embodiment. 第一実施形態に係る1段階圧縮データのメモリ空間上でのレイアウトを示す図。The figure which shows the layout on the memory space of the 1 step | paragraph compression data which concern on 1st embodiment. 第一実施形態に係る2段階圧縮データのメモリ空間上でのレイアウトを示す図。The figure which shows the layout on the memory space of the 2 step | paragraph compression data which concern on 1st embodiment. 本発明に係る展開部211の詳細なブロック図を示す図。The figure which shows the detailed block diagram of the expansion | deployment part 211 which concerns on this invention. 本発明に係る1段階圧縮データの展開処理フローを示す図。The figure which shows the expansion | deployment processing flow of the 1 step | paragraph compression data based on this invention. 1段階圧縮データのメモリ空間上でのレイアウトの一例を示す図。The figure which shows an example of the layout on the memory space of 1 step | paragraph compression data. 1段階圧縮データの展開時に出力される展開画素位置を示す図。The figure which shows the expansion | deployment pixel position output at the time of expansion | deployment of 1 step | paragraph compression data. 本発明に係る2段階圧縮データの展開処理フローを示す図。The figure which shows the expansion | deployment processing flow of the two-step compression data based on this invention. 2段階圧縮データのメモリ空間上でのレイアウトの一例を示す図。The figure which shows an example of the layout on the memory space of 2 step | paragraph compression data. 1段階圧縮データの展開時に出力される展開画素位置を示す図。The figure which shows the expansion | deployment pixel position output at the time of expansion | deployment of 1 step | paragraph compression data. 従来構成と本発明との展開部によるメモリアクセス量の比較を示す図。The figure which shows the comparison of the memory access amount by the expansion | deployment part of a conventional structure and this invention. 従来構成と本発明との展開部を並列化して行う場合のブロック図。The block diagram in the case of performing in parallel the expansion | deployment part of a conventional structure and this invention. 本発明に係る展開部を並列化して行う場合のブロック図。The block diagram at the time of carrying out in parallel the expansion | deployment part which concerns on this invention. 従来構成の展開部の詳細なブロック図。The detailed block diagram of the expansion | deployment part of a conventional structure. 従来構成の展開部に係る1段階圧縮データの展開処理フローを示す図。The figure which shows the expansion | deployment processing flow of the 1 step | paragraph compression data which concern on the expansion | deployment part of a conventional structure. 第二実施形態に係るリピートフラグの画像例を示す図。The figure which shows the example of an image of the repeat flag which concerns on 2nd embodiment. 第二実施形態に係るリピートフラグを適用した場合の2段階圧縮データのメモリ空間上でのレイアウトの一例を示した図。The figure which showed an example of the layout on the memory space of the two-step compression data at the time of applying the repeat flag which concerns on 2nd embodiment.

以下、本発明を実施するための形態について図面を用いて説明する。なお、以下に示す構成は本発明を実現するための一例であり、構成はこれに限定するものではない。本実施形態では、画像処理装置として、スキャン、プリント、コピーなどの複数の機能を有するデジタル複合機(MFP:MultiFunction Peripheral)を例に説明する。   Hereinafter, embodiments for carrying out the present invention will be described with reference to the drawings. In addition, the structure shown below is an example for implement | achieving this invention, and a structure is not limited to this. In the present embodiment, a digital multifunction peripheral (MFP) having a plurality of functions such as scanning, printing, and copying will be described as an example of the image processing apparatus.

[第一実施形態]
図1に示すように、コントローラ101は、画像入力機器であるスキャナ102や画像出力機器であるプリンタ103と接続される。また、コントローラ101はLANや公衆回線(WAN)などのネットワーク104と接続することで、画像情報やデバイス情報の入出力、PDLデータのイメージ展開を行う。CPU105は、後述するHDD記憶部107に格納されたプログラムを実行することにより、MFP全体を制御するプロセッサである。メモリ106は、CPU105が動作するためのシステムワークメモリであり、画像データを一時記憶するための画像メモリでもある。HDD記憶部107は、ハードディスクドライブであり、システムソフトウェアやプログラム、画像データなどを格納する。
[First embodiment]
As shown in FIG. 1, the controller 101 is connected to a scanner 102 as an image input device and a printer 103 as an image output device. Further, the controller 101 is connected to a network 104 such as a LAN or a public line (WAN) to input / output image information and device information and develop an image of PDL data. The CPU 105 is a processor that controls the entire MFP by executing a program stored in an HDD storage unit 107 described later. The memory 106 is a system work memory for operating the CPU 105, and is also an image memory for temporarily storing image data. The HDD storage unit 107 is a hard disk drive, and stores system software, programs, image data, and the like.

次に、図2に示すコントローラ101の構成例を参照してコントローラ101の各部の詳細な処理を説明する。まず、スキャナ102によってスキャンされた画像データを読み込む場合を説明する。スキャナ102で読み取られたRGB(レッド、グリーン、ブルー)3色の画像データ(ラスタ画像)をスキャナ用画像処理部201が受け取る。そして、その画像データに対してシェーディング処理やフィルタ処理等の画像処理を行い、圧縮部202で圧縮(符号化)処理を行う。そして、圧縮部202で圧縮されたデータ(圧縮データ)は、画像メモリバスを介してメモリ106に格納される。   Next, detailed processing of each unit of the controller 101 will be described with reference to a configuration example of the controller 101 shown in FIG. First, a case where image data scanned by the scanner 102 is read will be described. The scanner image processing unit 201 receives RGB (red, green, blue) three-color image data (raster image) read by the scanner 102. Then, image processing such as shading processing and filter processing is performed on the image data, and the compression unit 202 performs compression (encoding) processing. The data (compressed data) compressed by the compression unit 202 is stored in the memory 106 via the image memory bus.

次に、スキャンされた画像データをプリントする場合、メモリ106に格納された圧縮データを、画像メモリバスを介して展開部211へ転送する。展開部211は、圧縮部202で圧縮されたデータを展開(復号化)し、色処理部212へ転送する。そして、色処理部212がCMYK(シアン、マゼンタ、イエロー、ブラック)色空間へ変換する。その後、更に色処理部212がCMYKの各値に対して濃度調整やプリンタガンマ補正などの色処理を行った後、該色処理後のデータを、圧縮部202に転送して改めて圧縮処理を行い、画像メモリバスを介してメモリ106に再度格納する。その後、プリント用の画像処理を行うために、メモリ106に格納されているラスタ画像データを、画像メモリバスを介して展開部211、プリント用画像処理部221の順に転送し、展開処理とプリント用画像処理を行う。プリント用画像処理部221は、入力されたラスタのCMYK画像データを、ディザ法や誤差拡散法による面積階調処理を行い、プリンタ103へ出力する。ここでの面積階調処理については、上記に述べた方法に限定するものではなく、本発明を適用可能であれば他の手法による面積階調処理を適用しても構わない。   Next, when printing the scanned image data, the compressed data stored in the memory 106 is transferred to the expansion unit 211 via the image memory bus. The expansion unit 211 expands (decodes) the data compressed by the compression unit 202 and transfers the data to the color processing unit 212. Then, the color processing unit 212 converts into a CMYK (cyan, magenta, yellow, black) color space. Thereafter, the color processing unit 212 further performs color processing such as density adjustment and printer gamma correction on each value of CMYK, and then transfers the data after the color processing to the compression unit 202 to perform compression processing again. Then, it is stored again in the memory 106 via the image memory bus. Thereafter, in order to perform image processing for printing, raster image data stored in the memory 106 is transferred via the image memory bus to the developing unit 211 and the printing image processing unit 221 in this order, and the developing processing and printing Perform image processing. The print image processing unit 221 performs area gradation processing by the dither method or the error diffusion method on the input raster CMYK image data, and outputs the processed data to the printer 103. The area gradation processing here is not limited to the method described above, and area gradation processing by another method may be applied as long as the present invention is applicable.

また、スキャンされた画像データをネットワークへ送信する場合、メモリ106に格納されている圧縮データを、画像メモリバスを介して展開部211に転送する。そして展開されたラスタデータを、色処理部212へ転送する。色処理部212は、ディスプレイガンマ調整や用紙地色調整等を行った後、YCbCr(輝度、BLUE色差、RED色差)色空間へ変換する。そして、色処理部212で処理されたデーを、圧縮部202に転送して改めて圧縮し、再度画像メモリバスを介してメモリ106に格納する。その後、送信用の画像処理を行うために、画像メモリバスを介してメモリ106に格納されている圧縮データを展開部211へ転送する。そして、展開部211が圧縮データをラスタ画像データに展開する。その後、ラスタのYCbCr画像データに対して送信処理部233がカラー画像送信であればJPEG圧縮処理を行い、モノクロの2値画像送信であればYデータに対して2値化を行ってJBIG圧縮等を行い、ネットワーク104へ出力する。   When the scanned image data is transmitted to the network, the compressed data stored in the memory 106 is transferred to the expansion unit 211 via the image memory bus. The developed raster data is transferred to the color processing unit 212. The color processing unit 212 performs display gamma adjustment, paper background color adjustment, and the like, and then converts to a YCbCr (luminance, BLUE color difference, RED color difference) color space. Then, the data processed by the color processing unit 212 is transferred to the compression unit 202, compressed again, and stored again in the memory 106 via the image memory bus. Thereafter, the compressed data stored in the memory 106 is transferred to the expansion unit 211 via the image memory bus in order to perform image processing for transmission. Then, the expansion unit 211 expands the compressed data into raster image data. Thereafter, if the transmission processing unit 233 performs color image transmission on the raster YCbCr image data, JPEG compression processing is performed. If the monochrome binary image transmission is performed, binarization is performed on the Y data to perform JBIG compression or the like. And output to the network 104.

また、スキャンされた画像データを保存する場合、メモリ106に格納されている圧縮データを、画像メモリバスを介してディスクスプール高圧縮/展開部242へ転送する。ディスクスプール高圧縮/展開部242では、HDDへの書き込みスピードがメモリへの書き込みスピードに対して遅いため、更に高圧縮のJPEG圧縮を施す。その後、ディスクアクセスコントローラ243を介してHDD記憶部107へ圧縮データを保存する。また、HDD記憶部107に保存されている圧縮データをメモリ106に再度転送する場合には、上述した処理を逆に行えば良い。   When the scanned image data is saved, the compressed data stored in the memory 106 is transferred to the disk spool high compression / decompression unit 242 via the image memory bus. In the disk spool high compression / decompression unit 242, since the writing speed to the HDD is slower than the writing speed to the memory, a higher compression JPEG compression is performed. Thereafter, the compressed data is stored in the HDD storage unit 107 via the disk access controller 243. In addition, when the compressed data stored in the HDD storage unit 107 is transferred again to the memory 106, the above-described processing may be performed in reverse.

ここで、図1に示すネットワーク104を介して接続された他の装置から送られてきたPDLデータをメモリ106へ書き込む場合を説明する。図2にはPDL解釈部が図示されていないが、PDL解釈部として機能するCPU105がPDLデータを解釈し、その結果のディスプレイリストをメモリ106に出力する。その後、メモリ106に格納されているディスプレイリストをレンダリング部253がラスタのRGB画像データとしてレンダリングを行い、圧縮部202が当該レンダリングされたRGB画像データ(ラスタ画像データ)に対して画像圧縮処理を行う。そして、画像圧縮処理された後の圧縮データを、画像メモリバスを介してメモリ106に格納する。尚、PDLデータをプリント、ネットワークへ送信、保存する処理は、スキャンされた画像データの場合と同様の処理を行うことで実現可能である。   Here, a case where PDL data sent from another device connected via the network 104 shown in FIG. Although the PDL interpretation unit is not shown in FIG. 2, the CPU 105 functioning as the PDL interpretation unit interprets the PDL data and outputs the display list as a result to the memory 106. Thereafter, the rendering unit 253 renders the display list stored in the memory 106 as raster RGB image data, and the compression unit 202 performs image compression processing on the rendered RGB image data (raster image data). . Then, the compressed data after the image compression processing is stored in the memory 106 via the image memory bus. It should be noted that the process of printing, transmitting to a network, and storing the PDL data can be realized by performing the same process as in the case of scanned image data.

[圧縮処理]
次に、ラスタ画像データの符号化による圧縮処理を詳細に説明する。なお、本実施形態において、すべての圧縮処理は、圧縮部202にて行われるものとするが、この構成に限るものではない。例えば、図2のようにすべての圧縮処理を圧縮部202で行うのではなく、複数の圧縮処理部を設けて、画像パスごとに圧縮部を分散して使用するように構成しても構わない。本実施形態では、まずページ単位のラスタ画像データを、2×2画素単位のブロック毎に分割し、分割して抽出されたブロックを単位にデータの圧縮処理を行う。
[Compression processing]
Next, compression processing by encoding raster image data will be described in detail. In the present embodiment, all compression processing is performed by the compression unit 202, but the present invention is not limited to this configuration. For example, instead of performing all the compression processing in the compression unit 202 as shown in FIG. 2, a plurality of compression processing units may be provided so that the compression units are distributed and used for each image path. . In this embodiment, first, raster image data in units of pages is divided into blocks of 2 × 2 pixels, and data compression processing is performed in units of blocks extracted by division.

ここで本実施形態における圧縮処理を説明する前に、2×2画素からなるブロックの中に占める色数に応じてその組み合わせの場合の数を考える。ここで、ブロックに含まれる画素数が4画素なので、各ブロック内に占める色数は最大4色になり、ブロック内では高々1色〜4色の組み合わせしか存在しない。図3は、色数が1色〜4色のそれぞれの場合に、生じうるブロック内の色の配置パターンを示す図である。   Here, before describing the compression processing in this embodiment, the number of combinations is considered according to the number of colors occupied in a block of 2 × 2 pixels. Here, since the number of pixels included in the block is four, the maximum number of colors in each block is four, and there are at most combinations of one to four colors in the block. FIG. 3 is a diagram illustrating an arrangement pattern of colors in a block that can occur when the number of colors is 1 to 4 respectively.

まず、ブロック内の色数が1色の場合、4画素がすべて同色で構成されていることになるので、その組み合わせは1通りである。   First, when the number of colors in a block is one, all four pixels are composed of the same color, so there is only one combination.

次に、ブロック内の色数が2色の場合を考える(各色を第1色と第2色と呼ぶこととする)。ブロック内の予め決められた所定の位置の画素(本実施形態ではブロック内の左上の画素とする)の色データを第1色として考えると、左上画素以外の残りの3画素へ第1色もしくは第2色が入るので、4画素同色の場合を除くと、7通りの組み合わせが考えられる。   Next, consider a case where the number of colors in a block is two (each color will be referred to as a first color and a second color). Considering the color data of a pixel at a predetermined position in the block (in this embodiment, the upper left pixel in the block) as the first color, the first color or the remaining three pixels other than the upper left pixel are changed to the first color or Since the second color is included, there are seven possible combinations except for the case of four pixels having the same color.

次に、ブロック内の色数が3色(第1色〜第3色)の場合を考える。3色が4画素内にレイアウトされる場合の組み合わせは、3色のうち1色だけ2度使われる場合の数と言い換えることが可能であり、4画素の座標のうち、2画素が同じ色になる場合の数を求めれば良い。つまり、3色の場合の組み合わせの数は、4つの座標から2つの座標を取る組み合わせとなり、全部で6通りとなる。また、ブロック内の色数が4色(第1色〜第4色)の場合の組み合わせは1通りである。   Next, consider a case where the number of colors in a block is three (first to third colors). The combination in the case where three colors are laid out in four pixels can be rephrased as the number when only one of the three colors is used twice. Of the coordinates of the four pixels, the two pixels have the same color. What is necessary is just to obtain | require the number of cases. That is, the number of combinations in the case of three colors is a combination that takes two coordinates from four coordinates, and there are six combinations in total. Further, there are only one combination when the number of colors in the block is four (first to fourth colors).

以上により、2×2画素からなるブロック内の色数が1色〜4色の全ての場合の組み合わせ数を合計すると、全部で15通りの配置パターンが考えられる。また、これら全てのパターンを識別するためにフラグ(識別子)を付与することを考えると、フラグのデータ量としては4ビット必要となる。この15通りのパターンとフラグとの関係を図4に示すように定義し、以下、この配置情報を示すフラグを「パターンフラグ」と呼ぶ。また、第1色をそのブロックにおける「代表色」、第2色、第3色、第4色(すなわち、代表色以外の色)をまとめて「補間色」とも呼ぶ。なお、ブロックを構成する画素数は2×2画素に限定されるものではなく、このサイズよりも大きくても構わない。なお、その場合には配置パターンの組み合わせ数が増えるので、4ビットで表現していたパターンフラグのビット数も増加する。   As described above, when the number of combinations in all cases where the number of colors in a block of 2 × 2 pixels is 1 to 4 is added up, 15 arrangement patterns can be considered in total. Further, considering that a flag (identifier) is added to identify all these patterns, 4 bits are required as the data amount of the flag. The relationship between these 15 patterns and flags is defined as shown in FIG. 4, and a flag indicating the arrangement information is hereinafter referred to as a “pattern flag”. In addition, the first color is collectively referred to as “representative color”, the second color, the third color, and the fourth color (that is, colors other than the representative color) in the block. Note that the number of pixels constituting the block is not limited to 2 × 2 pixels, and may be larger than this size. In this case, since the number of arrangement pattern combinations increases, the number of bits of the pattern flag expressed by 4 bits also increases.

[圧縮処理フロー]
上述のように、2×2画素のブロック内において取り得る組み合わせ(色の配置パターン)を踏まえ、圧縮部202で行われる処理を、圧縮部202の圧縮処理フロー(図5)を用いて説明する。本実施形態における入力としては、例えばRGBそれぞれ8ビットの256階調とし、またデータとしては8ビットデータの点順次で1画素当たり24ビットの色値(画素値)を有する画像データとして説明する。本実施形態において、圧縮部202は、図2で示したようにコントローラ101内に存在するものであり、電子回路等のハードウェア(ASICなど)で構成されるものとする。しかし、別の構成として、CPUがプログラムを実行することによりその一部または全部の機能を実現するようにしても構わない。
[Compression processing flow]
As described above, the processing performed by the compression unit 202 will be described using the compression processing flow (FIG. 5) of the compression unit 202 based on the combinations (color arrangement patterns) that can be taken in the 2 × 2 pixel block. . The input in the present embodiment will be described as image data having, for example, 256 gradations of 8 bits for each of RGB and image data having a color value (pixel value) of 24 bits per pixel in a dot sequential manner of 8 bit data. In this embodiment, the compression unit 202 exists in the controller 101 as shown in FIG. 2 and is configured by hardware (such as an ASIC) such as an electronic circuit. However, as another configuration, a part or all of the functions may be realized by the CPU executing the program.

まず、本処理が開始され、2×2画素サイズのブロック毎に分割された画像が、前段のスキャナ用画像処理部201もしくはレンダリング部253から入力される(S501)。そして、圧縮部202は、2×2画素ブロック内の色の減色処理とパターンフラグの算出処理とを行う(S502)。S502における減色処理は、2×2画素の中に色が近い画素値を有する複数の画素が存在した場合に、それらを同一の色(画素値)に変更することで、本圧縮処理の圧縮効率を高めるために行う。ここでの減色処理については、特に限定せず、本発明が適用可能であれば、いずれの方法を用いても構わない。そして、減色処理後の2×2画素からなるブロックの色データを比較することにより、そのブロックにおける減色後の色数と色の配置パターンとを示すパターンフラグが算出される。   First, this processing is started, and an image divided into blocks each having a 2 × 2 pixel size is input from the scanner image processing unit 201 or the rendering unit 253 in the previous stage (S501). Then, the compression unit 202 performs color reduction processing and pattern flag calculation processing in the 2 × 2 pixel block (S502). The color reduction processing in S502 is performed by changing the compression efficiency of the main compression processing by changing them to the same color (pixel value) when there are a plurality of pixels having similar pixel values in 2 × 2 pixels. To increase. The color reduction processing here is not particularly limited, and any method may be used as long as the present invention is applicable. Then, by comparing the color data of the block composed of 2 × 2 pixels after the color reduction processing, a pattern flag indicating the number of colors after color reduction and the color arrangement pattern in the block is calculated.

次に、S502で算出されたパターンフラグに基づいて、圧縮部202は、ブロック内の色数と配置パターンを判定して、各色の色データを抽出する(S503)。図4に示したように、4ビットのパターンフラグに対して、ブロック内を構成する色数と、各色の配置パターンが対応づけられているので、パターンフラグから各ブロックにおける色数と各色の色データを特定することができる。   Next, based on the pattern flag calculated in S502, the compression unit 202 determines the number of colors and the arrangement pattern in the block, and extracts color data of each color (S503). As shown in FIG. 4, since the number of colors constituting the block and the arrangement pattern of each color are associated with the 4-bit pattern flag, the number of colors in each block and the color of each color from the pattern flag. Data can be identified.

ここで、本実施形態の図4では、全てのパターンにおいて、左上の画素の色(画素値)が第1色(1番目の色データ)となるように定義している。パターンフラグが“0”の場合は、色数が1なので、左上の画素の色(画素値)を第1色として抽出する。また、パターンフラグが1〜7の場合は、色数が2なので、左上の画素の色(画素値)を第1色として抽出し、更に、各パターンフラグに応じて定義されている第2色(2番目の色データ)が存在する位置の画素の色(画素値)を抽出する。例えば、パターンフラグが“1”の場合は、ブロックにおける右上の画素の色を第2色(2番目の色データ)として抽出する。   Here, in FIG. 4 of the present embodiment, it is defined that the color (pixel value) of the upper left pixel is the first color (first color data) in all patterns. When the pattern flag is “0”, since the number of colors is 1, the color of the upper left pixel (pixel value) is extracted as the first color. When the pattern flag is 1 to 7, since the number of colors is 2, the color of the upper left pixel (pixel value) is extracted as the first color, and further, the second color defined according to each pattern flag The color (pixel value) of the pixel at the position where (second color data) exists is extracted. For example, when the pattern flag is “1”, the color of the upper right pixel in the block is extracted as the second color (second color data).

また、パターンフラグが8〜Dの場合は、色数が3であるので、ブロックにおける左上の画素の色(画素値)を第1色として抽出する。更に各パターンフラグに応じて定義されている第2色(2番目の色データ)及び第3色(3番目の色データ)が存在する位置の画素の色(画素値)を抽出する。例えば、パターンフラグが“8”の場合は、ブロックにおける左上の画素の色を第1色、右上の画素の色(画素値)を第2色、右下の画素の色(画素値)を第3色として抽出する。   When the pattern flag is 8 to D, since the number of colors is 3, the color (pixel value) of the upper left pixel in the block is extracted as the first color. Further, the color (pixel value) of the pixel at the position where the second color (second color data) and the third color (third color data) defined according to each pattern flag exist is extracted. For example, when the pattern flag is “8”, the color of the upper left pixel in the block is the first color, the color of the upper right pixel (pixel value) is the second color, and the color of the lower right pixel (pixel value) is the first color. Extract as 3 colors.

また、パターンフラグが“E”の場合は、色数が4であるので、ブロックにおける左上の画素の色を第1色、右上の画素の色を第2色、左下の画素の色を第3色、右下の画素の色を第4色として抽出する。   When the pattern flag is “E”, since the number of colors is 4, the color of the upper left pixel in the block is the first color, the color of the upper right pixel is the second color, and the color of the lower left pixel is the third color. The color and the color of the lower right pixel are extracted as the fourth color.

すなわち、パターンフラグに基づいて、圧縮部202は、ブロック内を構成する色数を特定し(S504、S506、S508)、当該特定した色数それぞれに応じて、パターンフラグと色データとを出力する(S505、S507、S509、S510)。そして、本処理フローを終了する。   In other words, based on the pattern flag, the compression unit 202 specifies the number of colors constituting the block (S504, S506, S508), and outputs a pattern flag and color data according to the specified number of colors. (S505, S507, S509, S510). Then, this processing flow ends.

この出力されるデータを、図6を用いて説明する。ここで、入力データは、2×2画素それぞれが24ビット(RGB各色8ビット)の画素値を有し、1ブロックあたり96ビットのデータ量となる。これに対し、図6に示すように、例えばパターンフラグが“0”(すなわちブロックの4画素が1色で構成されている)の場合(図5のS504でYES)、2色目以降の色データは存在しない。従って、パターンフラグの4ビットと1色目の画素値(24ビット分の色データ)とが出力される(図5のS505)。すなわち、パターンフラグが“0”のブロックは、28ビットのデータ量のデータを出力する。また、パターンフラグが1〜7(即ち4画素が2色で構成されている)の場合(図5のS506でYES)、2色目が存在する画素の座標をパターンフラグから求め、パターンフラグの4ビットと2色分の画素値(48ビット分の色データ)とを出力する(図5のS507)。すなわち、パターンフラグが1〜7のブロックは、52ビットのデータ量のデータを出力する。   The output data will be described with reference to FIG. Here, each of the 2 × 2 pixels has a pixel value of 24 bits (8 bits for each color of RGB), and the input data has a data amount of 96 bits per block. On the other hand, as shown in FIG. 6, for example, when the pattern flag is “0” (that is, four pixels of the block are configured with one color) (YES in S504 in FIG. 5), the color data for the second and subsequent colors Does not exist. Accordingly, 4 bits of the pattern flag and the pixel value of the first color (24-bit color data) are output (S505 in FIG. 5). That is, the block having the pattern flag “0” outputs data having a data amount of 28 bits. When the pattern flag is 1 to 7 (that is, four pixels are composed of two colors) (YES in S506 in FIG. 5), the coordinates of the pixel in which the second color exists is obtained from the pattern flag, and the pattern flag 4 Bits and pixel values for two colors (color data for 48 bits) are output (S507 in FIG. 5). That is, the blocks having the pattern flags 1 to 7 output data having a data amount of 52 bits.

また、パターンフラグが8〜D(即ち3色)の場合(図5のS508でYES)、1色目と2色目と3色目とが存在する画素の位置をパターンフラグに基づいて求め、パターンフラグの4ビットと3色分の画素値(72ビット分の色データ)とが出力される(図5のS509)。すなわち、パターンフラグが8〜Dのブロックは、76ビットのデータ量のデータを出力する。   If the pattern flag is 8 to D (that is, three colors) (YES in S508 in FIG. 5), the position of the pixel where the first color, the second color, and the third color exist is obtained based on the pattern flag, and the pattern flag The pixel values for 4 bits and 3 colors (color data for 72 bits) are output (S509 in FIG. 5). That is, a block having a pattern flag of 8 to D outputs data having a data amount of 76 bits.

そして、パターンフラグが“E”(即ち4色)の場合(図5のS508でNO)、パターンフラグの4ビットと4色分の画素値(96ビット分の色データ)とが出力される(図5のS510)。すなわち、パターンフラグが“E”のブロックは、100ビットのデータ量のデータを出力する。   When the pattern flag is “E” (that is, four colors) (NO in S508 in FIG. 5), 4 bits of the pattern flag and pixel values for four colors (96-bit color data) are output ( (S510 in FIG. 5). That is, the block having the pattern flag “E” outputs data having a data amount of 100 bits.

言い換えると、各ブロックから出力される色データは、ブロック内の位置順(左上から右上、左下、右下の順に1、2、3、4とする)に走査した場合に、それまでに出現していなかった色データが現れるたびに順に出力していくことに相当する。   In other words, the color data output from each block appears until then when scanned in the order of position within the block (from left to top, top left, bottom left, bottom right, 1, 2, 3, 4). This is equivalent to outputting the data every time color data that has not been displayed appears.

このように、2×2画素からなるブロックの4色分の色データ(96ビット)を、4ビットのパターンフラグと、当該ブロックに存在する色数分の画素値のデータ(色データ)として出力する。その結果、簡単な処理により出力データ量を削減することが可能になる。特に、2×2画素からなるブロック内で同色の画素が存在するブロック(即ち各ブロック内の色数が少ないブロック)が多いラスタ画像の場合は、出力されるデータ量の圧縮率も大きくなる。また、パターンフラグを参照することで、そのブロック内の色数およびその配置パターンを特定することが可能になる。このような処理を画像ブロック全てに対して行うことで、画像全面をデータ圧縮することが可能になる。   As described above, the color data (96 bits) for the four colors of the block composed of 2 × 2 pixels is output as the data (color data) of the pixel values for the number of colors existing in the block and the 4-bit pattern flag. To do. As a result, the amount of output data can be reduced by simple processing. In particular, in the case of a raster image having a large number of blocks having the same color pixel (that is, a block having a small number of colors in each block) in a 2 × 2 pixel block, the compression rate of the output data amount is also increased. Further, by referring to the pattern flag, the number of colors in the block and the arrangement pattern can be specified. By performing such processing on all the image blocks, the entire image can be compressed.

[格納方式]
以上に述べた方法による圧縮部202で求めて出力されたパターンフラグと色データとは、メモリ106に書き込まれる(メモリ格納処理)。このとき、圧縮部202は、メモリ106におけるパターンフラグと、第1色のデータと、第2色、第3色、第4色のデータとの書き込み位置を変更する。圧縮部202は、パターンフラグ書き込みのためのメモリ先頭アドレスと、第1色データの書き込みのためのメモリ先頭アドレスと、第2〜4色データの書き込みのためのメモリ先頭アドレスとの、3つのアドレスを指定する。すなわち、各ブロックのパターンフラグはメモリ106上のパターンフラグ格納部(パターンフラグを格納するためのメモリ領域)にまとめて格納されることになる。また、各ブロックの第1色(1色目)の色データは、メモリ106上の第1色格納部(各ブロックの1色目の色データを格納するためのメモリ領域)にまとめて格納されることになる。更に、各ブロックの第2〜4色目の色データは、メモリ106上の第2,3,4色格納部(各ブロックの2〜4色目の色データを格納するためのメモリ領域)にまとめて格納されることになる。
[Storage method]
The pattern flag and the color data obtained and output by the compression unit 202 by the method described above are written in the memory 106 (memory storing process). At this time, the compression unit 202 changes the writing position of the pattern flag, the first color data, and the second color, third color, and fourth color data in the memory 106. The compression unit 202 has three addresses: a memory start address for writing a pattern flag, a memory start address for writing first color data, and a memory start address for writing second to fourth color data. Is specified. That is, the pattern flags of each block are collectively stored in a pattern flag storage unit (memory area for storing pattern flags) on the memory 106. The color data of the first color (first color) of each block is stored together in a first color storage unit (memory area for storing the first color data of each block) on the memory 106. become. Further, the color data of the second to fourth colors of each block are collected in a second, third, and fourth color storage unit (memory area for storing the second to fourth color data of each block) on the memory 106. Will be stored.

図7は、圧縮部202によって圧縮された画像データのメモリ空間への書き込み例を示す図である。尚、サイズがM×N画素のRGB各色8ビットの画像を圧縮部へ2×2画素のブロックごとに入力する場合、パターンフラグのデータが格納されるパターンフラグ格納部のデータサイズは、(M×N/2/2×4/8)バイトとなる。また、第1色のデータが格納される第1色格納部のデータサイズは、(M×N/2/2×24/8)バイトとなる。また、第2色、第3色、第4色のデータが格納される第2,3,4色格納部のデータサイズは、処理対象となるラスタ画像に応じて異なる。これは、第2,3,4色が存在するブロックの数が画像によって異なるためである。つまり、各ブロックに含まれる色数はそのパターンにより異なるため、ブロック数に対して、パターンフラグおよび第1色は必ず1つに特定されるが、第2,3,4色の数は変動する。よって、圧縮部202で圧縮処理された出力データサイズの大小は、メモリ106上の第2,3,4色格納部に格納されるデータ量に依存する。また、第1色書き込み先頭アドレス以降のメモリ領域(第1色格納部、及び第2,3,4色格納部)に関しては、画素の色データがそのままのビット数で格納されている。従って、例えばLUT(ルックアップテーブル)を用いた色変換やガンマ補正処理、行列演算を用いた色空間変換処理等の1画素入力と1画素出力で完結する色処理を行う場合、圧縮データをデコード(復号化)して元のラスタ画像に戻さなくても、圧縮データ中の該当する色データを処理することが可能である。つまり、図7のようにメモリの第1色格納部と第2〜4色格納部に格納されているデータに対して、該当する画素値(色データ)の部分を直接処理することが可能である。   FIG. 7 is a diagram illustrating an example of writing the image data compressed by the compression unit 202 into the memory space. When an 8-bit RGB image having a size of M × N pixels is input to the compression unit for each 2 × 2 pixel block, the data size of the pattern flag storage unit in which the pattern flag data is stored is (M × N / 2/2 × 4/8) bytes. Further, the data size of the first color storage unit in which the first color data is stored is (M × N / 2/2 × 24/8) bytes. The data sizes of the second, third, and fourth color storage units that store the second, third, and fourth color data differ depending on the raster image to be processed. This is because the number of blocks in which the second, third, and fourth colors are present differs depending on the image. That is, since the number of colors included in each block differs depending on the pattern, the number of the second, third, and fourth colors varies, although the pattern flag and the first color are always specified as one with respect to the number of blocks. . Therefore, the size of the output data compressed by the compression unit 202 depends on the amount of data stored in the second, third, and fourth color storage units on the memory 106. In addition, in the memory area (first color storage unit and second, third, fourth color storage unit) after the first color write start address, pixel color data is stored in the same number of bits. Therefore, for example, when performing color processing that is completed with one pixel input and one pixel output, such as color conversion using a lookup table (LUT), gamma correction processing, and color space conversion processing using matrix operation, the compressed data is decoded. The corresponding color data in the compressed data can be processed without (decoding) and returning to the original raster image. That is, as shown in FIG. 7, the corresponding pixel value (color data) portion can be directly processed with respect to the data stored in the first color storage unit and the second to fourth color storage units of the memory. is there.

また、図7に示すように、画像データ700を、パターンフラグと第1色とその他の色(第2,3,4色)とに分け、離散的にメモリ106上の記憶領域へ格納している。従って、第1色格納部には、ラスタ画像を2×2画素からなるブロックに分割して、各ブロックの左上の画素をサンプリングした場合の画素値(色データ)がメモリ上に連続して存在することになる。   Further, as shown in FIG. 7, the image data 700 is divided into a pattern flag, a first color, and other colors (second, third, and fourth colors), and discretely stored in a storage area on the memory 106. Yes. Therefore, in the first color storage unit, pixel values (color data) when the raster image is divided into blocks of 2 × 2 pixels and the upper left pixel of each block is sampled are continuously present in the memory. Will do.

[多段階圧縮]
次に、上述した圧縮方式で多段階圧縮を行った場合について説明する。ここでの多段階圧縮とは、同じ画像データに対し、複数回(N回:Nは2以上の整数)の圧縮処理を施すことを意味する。例えば、2段階圧縮とは、入力された画像データに対し、1回目の圧縮処理を施したのち、当該生成された各代表色のみの画像データ(第1色格納部に格納される第1色のデータ)を次の圧縮処理対象画像として2回目の圧縮処理を行うことを意味する。よって、N回目の圧縮処理では、N−1回目の圧縮処理によって得られた代表色で構成される画像データを用いて圧縮処理を行う。上述した圧縮方式によれば、1回目の圧縮処理後の第1色格納部には、圧縮率の高低によらず、図7の白色で示される部分の画素の色データがラスタ順に格納されている。つまり、元の画像データが縦横2画素ごとに間引かれたデータが格納されている。多段階圧縮は、この間引かれて生成された画像データをさらに2×2画素ごとにブロック化して、再度上述した圧縮処理を適用する。
[Multi-stage compression]
Next, a case where multistage compression is performed by the above-described compression method will be described. The multistage compression here means that the same image data is subjected to compression processing a plurality of times (N times: N is an integer of 2 or more). For example, in the two-stage compression, after the first compression process is performed on the input image data, the generated image data of only the representative colors (the first color stored in the first color storage unit) The second compression processing is performed on the next compression processing target image. Therefore, in the N-th compression process, the compression process is performed using image data composed of representative colors obtained by the N-1th compression process. According to the above-described compression method, the first color storage unit after the first compression processing stores the color data of the pixels of the portion shown in white in FIG. 7 in raster order regardless of the compression rate. Yes. That is, data obtained by thinning the original image data every two horizontal and vertical pixels is stored. In the multi-stage compression, the image data generated by the thinning is further divided into blocks of 2 × 2 pixels, and the above-described compression process is applied again.

すなわち、図8(a)に示すように、第1段階の圧縮処理によって圧縮された画像データのうち、第1色格納部に格納されたデータに注目する。図8(a)の第1段階圧縮処理後のメモリの第1色格納部に格納されている色データは、画像データ800の白色と黒色で示された位置の画素データである。そして、第1色格納部に格納されている画像データ(第1段階圧縮処理後の第1色の色データ)をさらに2×2画素ごとにブロック化し、上述した圧縮処理を行う。この結果、第1段階の圧縮処理結果の第1色の色データは、第2段階の圧縮処理結果のパターンフラグと、第2段階の第1色の色データと、第2段階の第2,3,4色の色データとに圧縮変換される。したがって、図8(b)の第2段階圧縮時メモリ空間に示すような圧縮結果が得られる。ここで、図8(b)に示すように、メモリ空間において、第2段階圧縮時の第1色格納部には、画像データ800の白色で示された位置の色データが格納される。また、第2段階圧縮時の第2,3,4色格納部には、画像データ800の黒色で示された位置の画素に基づいて求めた第1色以外の色データが格納される。ただし、第2段階圧縮時の第2,3,4色格納部には、2×2画素中に存在する同一の色データは複数格納されることはない。このように多段階圧縮されたデータは、図8(b)のように入れ子構造の形式でデータ格納される。なお、他の格納方法として、同一のメモリ領域ではなく、別のメモリ領域を新たに確保して第2段階圧縮データを格納しても良い。   That is, as shown in FIG. 8A, attention is focused on data stored in the first color storage unit among the image data compressed by the first stage compression processing. The color data stored in the first color storage unit of the memory after the first-stage compression processing in FIG. 8A is pixel data at positions indicated by white and black in the image data 800. Then, the image data (first color data after the first stage compression process) stored in the first color storage unit is further blocked every 2 × 2 pixels, and the above-described compression process is performed. As a result, the color data of the first color as a result of the compression process of the first stage includes the pattern flag of the result of the compression process of the second stage, the color data of the first color of the second stage, the second color of the second stage. It is compressed and converted into color data of 3 or 4 colors. Therefore, a compression result as shown in the second-stage compression memory space in FIG. 8B is obtained. Here, as shown in FIG. 8B, in the memory space, the color data at the position indicated by white in the image data 800 is stored in the first color storage unit at the time of the second stage compression. In the second, third, and fourth color storage units in the second stage compression, color data other than the first color obtained based on the pixel at the position indicated by black in the image data 800 is stored. However, the second, third, and fourth color storage units in the second stage compression do not store a plurality of the same color data existing in 2 × 2 pixels. The multi-stage compressed data is stored in a nested structure as shown in FIG. 8B. As another storage method, the second-stage compressed data may be stored by newly securing another memory area instead of the same memory area.

[展開処理]
次に、本発明の中核をなす展開部211を説明する。展開部211では、上述したような圧縮処理で生成されたパターンフラグと色データとを、元のラスタ画像データへ戻す処理を行う。図9に本発明における展開部211の詳細なブロック図を示す。本実施形態における展開部211は、図2で示したようにコントローラ101内に存在するものであり、3つのデータ展開部900,910,920で構成されるものとする。なお、本実施形態の展開部211は、電子回路等のハードウェア(ASICなど)で構成されるものとするが、CPUがプログラムを実行することによりその一部または全部の機能を実現するようにしても構わない。
[Deployment processing]
Next, the developing unit 211 that forms the core of the present invention will be described. The expansion unit 211 performs processing to return the pattern flag and color data generated by the compression processing as described above to the original raster image data. FIG. 9 shows a detailed block diagram of the expansion unit 211 in the present invention. The expansion unit 211 in the present embodiment exists in the controller 101 as shown in FIG. 2 and is configured by three data expansion units 900, 910, and 920. Note that the expansion unit 211 of this embodiment is configured by hardware such as an electronic circuit (ASIC or the like), but the CPU executes a program to realize part or all of the functions. It doesn't matter.

まず、1段階の圧縮処理がなされている圧縮データが展開対象である場合について、展開部211の詳細な処理を、図10に示すフローチャートと、図11の圧縮画像例とを用いて説明する。   First, in the case where compressed data that has been subjected to one-stage compression processing is a decompression target, detailed processing of the decompression unit 211 will be described using the flowchart shown in FIG. 10 and the compressed image example shown in FIG.

本実施形態では、説明を簡単にするため、図11(a)に示されるような4×4画素からなる画像データの圧縮データを例として、当該圧縮データを展開する場合について述べる。メモリ106の圧縮データ格納に関する一部のメモリマップを抽出したものを図11(b)に示し、さらにメモリ内部のデータ領域を詳細にしたものを図11(c)に示す。画像データ1101は、それぞれ同じパターン(斜線部、白色部、縦線部、格子線部)で表わされた画素は、同一の画素値を有する画素を示している。   In the present embodiment, in order to simplify the description, a case where the compressed data is expanded will be described by taking compressed data of 4 × 4 pixels as shown in FIG. 11A as an example. FIG. 11B shows an extracted part of the memory map for storing compressed data in the memory 106, and FIG. 11C shows a detailed data area in the memory. In the image data 1101, pixels represented by the same pattern (shaded part, white part, vertical line part, grid line part) indicate pixels having the same pixel value.

図11(a)に示した画像データ1101に対して1段階の圧縮処理を適用した場合、該画像データ1101は2×2画素ごとのブロックで黒太線のように分割され、圧縮される。そして、圧縮された結果の各ブロックのパターンフラグ、第1色の色データ、第2〜4色の色データが図11(b)に示すメモリ106上のパターンフラグ格納部1102、第1色格納部1103、第2,3,4色格納部1104にそれぞれ格納されている。画像データ1101の各ブロックのパターンフラグは、図4に示した割り当てにより、左上ブロック、右上ブロック、左下ブロック、右下ブロックの順に、“B”、“5”、“1”、“E”となる。これらの値がパターンフラグ格納部1102に格納され、図11(c)のアドレス0x00,0x01のように配置されている。   When one-stage compression processing is applied to the image data 1101 shown in FIG. 11A, the image data 1101 is divided and compressed as a thick black line in blocks of 2 × 2 pixels. Then, the pattern flag, the first color data, and the second to fourth color data of each block as a result of compression are stored in the pattern flag storage unit 1102 on the memory 106 shown in FIG. Are stored in the unit 1103 and the second, third, and fourth color storage units 1104, respectively. The pattern flag of each block of the image data 1101 is “B”, “5”, “1”, “E” in the order of the upper left block, the upper right block, the lower left block, and the lower right block according to the assignment shown in FIG. Become. These values are stored in the pattern flag storage unit 1102 and arranged as addresses 0x00 and 0x01 in FIG.

また、第1色格納部1103には、各ブロックの左上の画素値データが連続して格納される。したがって、図11(c)のアドレス0x10−0x1Bのように、画素00,02,20,22の画素値が格納されている。ただし、本実施形態においては、8bitのRGB画像を扱っているものとし、1画素データのサイズは24bit(3Byte)である。また、図11(c)に示す各アドレスのデータ量は、8bit(1Byte)である。   The first color storage unit 1103 stores pixel value data at the upper left of each block continuously. Accordingly, the pixel values of the pixels 00, 02, 20, and 22 are stored as in the address 0x10-0x1B in FIG. However, in this embodiment, an 8-bit RGB image is handled, and the size of one pixel data is 24 bits (3 bytes). In addition, the data amount of each address shown in FIG. 11C is 8 bits (1 byte).

なお、図11(c)において、横方向の値が第1の位のメモリアドレスの値を示し、縦方向の値が第2の位のメモリアドレスの値を指す。すなわち、図11(b)にて示された第1色格納部1103の先頭アドレスである“0x10”は、図11(c)において、横方向の“00”と縦方向の“10”とが交わるアドレスを意味する。   In FIG. 11C, the horizontal value indicates the value of the first significant memory address, and the vertical value indicates the value of the second significant memory address. That is, “0x10”, which is the first address of the first color storage unit 1103 shown in FIG. 11B, is “00” in the horizontal direction and “10” in the vertical direction in FIG. It means the address that intersects.

最後に、第2,3,4色格納部1104には、各ブロックの左上画素以外の画素値(第1色と異なる色の色データ)が格納されている。ただし、同一ブロックに同色の色が存在した場合、重複して格納はされない。例えば図11(a)に示す画像データ1101の左上ブロックの画素01と画素10は同色であるため、画素01と画素11の画素値(すなわち第1色と異なる色の色データ)だけが第2,3,4色格納部に格納されている。また、同様にして、画像データ1101の右上ブロックの画素02と画素03と画素13は同色(第1色)であるため、画素12の画素値だけが、第2,3,4色格納部に格納されている。したがって、図11の画像データ1101の例において、第2,3,4色格納部に格納される画素値は、画素01,11,12,21,23,32,33の画素値(色データ)であるため、図11(c)のアドレス0x40−0x54のように格納されている。   Finally, the second, third and fourth color storage unit 1104 stores pixel values (color data of a color different from the first color) other than the upper left pixel of each block. However, if the same color exists in the same block, it is not stored redundantly. For example, since the pixel 01 and the pixel 10 in the upper left block of the image data 1101 illustrated in FIG. 11A have the same color, only the pixel values of the pixel 01 and the pixel 11 (that is, color data of a color different from the first color) are the second. , 3 and 4 color storage units. Similarly, since the pixel 02, the pixel 03, and the pixel 13 in the upper right block of the image data 1101 have the same color (first color), only the pixel value of the pixel 12 is stored in the second, third, and fourth color storage units. Stored. Therefore, in the example of the image data 1101 in FIG. 11, the pixel values stored in the second, third, and fourth color storage units are the pixel values (color data) of the pixels 01, 11, 12, 21, 23, 32, and 33. Therefore, it is stored as addresses 0x40-0x54 in FIG.

本実施形態において、図11のように1段階の圧縮処理がなされている圧縮データの展開処理は、図9の3つあるデータ展開部900,910,920のうちの2つを使用して行われる。ここでは、データ展開部900が第1色データの展開を行い、データ展開部910が第2,3,4色データの展開を行うものとする。すなわち、データ展開部900は、展開するラスタ画像において、パターンフラグに基づき圧縮データ内の第1色データによって塗りつぶされている画素のみを特定する。そして、読み込んだ第1色データによって当該特定した画素を塗りつぶす。また、データ展開部910は、展開するラスタ画像において、パターンフラグに基づき圧縮データ内の第2,3,4色データによって塗りつぶされている画素のみを特定する。そして、読み込んだ第2,3,4色データによって、当該特定した画素それぞれを塗りつぶす処理を行う。ここで塗りつぶす処理とは、画像データの展開領域(展開用のメモリ領域)において、各画素の値に色データの値を適用する処理を意味する。   In this embodiment, the decompression processing of compressed data that has been subjected to one-stage compression processing as shown in FIG. 11 is performed using two of the three data decompression units 900, 910, and 920 in FIG. Is called. Here, it is assumed that the data expansion unit 900 expands the first color data, and the data expansion unit 910 expands the second, third, and fourth color data. That is, the data expansion unit 900 specifies only pixels that are filled with the first color data in the compressed data based on the pattern flag in the raster image to be expanded. Then, the specified pixel is filled with the read first color data. In addition, the data development unit 910 specifies only pixels that are filled with the second, third, and fourth color data in the compressed data based on the pattern flag in the raster image to be developed. Then, a process for painting each of the specified pixels is performed with the read second, third, and fourth color data. Here, the painting process means a process of applying the value of the color data to the value of each pixel in the development area (development memory area) of the image data.

まず、第1色データを展開するデータ展開部900の動作について図10(a)を用いて説明する。以下、データ出力部904、914、924が1回の展開処理で注目するブロックを注目ブロックと呼ぶ。1段階の圧縮処理がなされている圧縮データの展開処理においては、注目ブロックは、画像データ1101の2×2画素単位のブロックとなる。   First, the operation of the data expansion unit 900 that expands the first color data will be described with reference to FIG. Hereinafter, a block that the data output units 904, 914, and 924 focus on in one expansion process is referred to as a target block. In the decompression processing of compressed data that has been subjected to one-stage compression processing, the target block is a 2 × 2 pixel unit block of the image data 1101.

パターンフラグDMAC901は、パターンフラグ格納部1102の先頭アドレスと画像サイズとが設定され、当該設定されたアドレス(例えば0x00)から順番にパターンフラグを読み込んで、データ出力部904に順次転送する処理を行う(S1001)。並行して、データDMAC903は、第1色格納部1103の先頭アドレスと画像サイズが設定され、当該設定されたアドレス(例えば0x10)から順番に第1色データを読み込んで、データ出力部904に順次転送する処理を行う(S1002)。データ出力部904は、パターンフラグ格納部1102から取得するパターンフラグに基づいて、同時に取得する第1色データで塗りつぶす画素位置を特定する(S1003)。   The pattern flag DMAC 901 is set with the head address and image size of the pattern flag storage unit 1102, reads the pattern flag in order from the set address (for example, 0x00), and sequentially transfers it to the data output unit 904. (S1001). In parallel, the data DMAC 903 is set with the first address of the first color storage unit 1103 and the image size, reads the first color data sequentially from the set address (for example, 0x10), and sequentially outputs it to the data output unit 904. Transfer processing is performed (S1002). Based on the pattern flag acquired from the pattern flag storage unit 1102, the data output unit 904 specifies the pixel position to be filled with the first color data acquired simultaneously (S1003).

例えば、データ出力部904は、パターンフラグ格納部1102から最初に読み込んだパターンフラグ“B”に対しては、図4に示す対応表から、左上画素の画素00だけを、当該ブロックの第1色の色データで塗りつぶすと判定する。また、次に読みこんだパターンフラグ“5”に対しては、同じく図4に示す対応表から、左上画素、右上画素、右下画素の画素02,画素03,画素13を、当該ブロックの第1色の色データで塗りつぶすと判定する。   For example, for the pattern flag “B” first read from the pattern flag storage unit 1102, the data output unit 904 selects only the pixel 00 of the upper left pixel from the correspondence table shown in FIG. 4 as the first color of the block. Is determined to be filled with color data. For the pattern flag “5” read next, the upper left pixel, the upper right pixel, the lower right pixel 02, the pixel 03, and the pixel 13 are similarly assigned to the block number of the block from the correspondence table shown in FIG. It is determined to fill with one color data.

次に、注目ブロックに塗りつぶす画素がある場合(S1004にてYes)、データ出力部904は、予めデータ出力部904に設定されたラスタ展開後の画像を格納する先頭アドレス、および展開画像のサイズ情報から、第1色の色データで塗りつぶす画素に対応するメモリアドレスを算出する(S1005)。そして、データDMAC903から受信した第1色データを、算出したアドレスのメモリ領域に書き込む(S1006)。   Next, when there is a pixel to be filled in the target block (Yes in S1004), the data output unit 904 stores the rasterized image start address stored in advance in the data output unit 904 and the size information of the expanded image Then, a memory address corresponding to a pixel to be painted with the first color data is calculated (S1005). Then, the first color data received from the data DMAC 903 is written in the memory area of the calculated address (S1006).

S1004〜S1006の処理は、1ブロックの中で、第1色データを書き込む画素数分、繰り返し実行される。すなわち、画像データ1101の左上ブロックにおいては、第1色データを書き込む画素は1画素分なので、S1004〜S1006の処理は1回行われる。また、画像データ1101の右上ブロックにおいては、第1色データを書き込む画素は3画素分なので、S1004〜S1006の処理は3回行われる。このようにして1ブロック分の処理が終わると、S1004において、データ出力部904は、塗りつぶす画素がなくなったと判定し(S1004のNo)、注目ブロックの展開処理を完了する。   The processing of S1004 to S1006 is repeatedly executed for the number of pixels to which the first color data is written in one block. That is, in the upper left block of the image data 1101, the pixels for writing the first color data are for one pixel, so the processing of S1004 to S1006 is performed once. Further, in the upper right block of the image data 1101, the pixels for writing the first color data are for three pixels, so the processing of S1004 to S1006 is performed three times. When the processing for one block is completed in this way, in S1004, the data output unit 904 determines that there are no pixels to be filled (No in S1004), and completes the processing for developing the target block.

以上の処理によって、展開用のメモリ上で、各ブロックの第1色の色データが画素値として書き込まれた画素は、図12(a)の斜線部で表わされる。言い換えれば、図12(a)の斜線部で表わされる画素の画素値が、データ展開部900によって展開されることになる。   With the above processing, the pixels in which the color data of the first color of each block is written as pixel values on the development memory are represented by the hatched portion in FIG. In other words, the pixel value of the pixel represented by the hatched portion in FIG.

次に、第2,3,4色データを展開するデータ展開部910の動作について図10(b)を用いて説明する。パターンフラグDMAC911は、パターンフラグ格納部1102の先頭アドレスと画像サイズが設定され、当該設定されたアドレス(例えば0x00)から順番にパターンフラグを読み込んで、データ出力部914に順次転送する処理を行う(S1021)。並行して、データDMAC913は、第2,3,4色格納部1104の先頭アドレスと画像サイズが設定され、当該設定されたアドレス0x40から順番に第2,3,4色データを読み込んで、データ出力部914に順次転送する処理を行う(S1022)。データ出力部914は、パターンフラグ格納部1102から取得する注目ブロックのパターンフラグに基づいて、まず、当該注目ブロックに第2,3,4色データがあるか否かを判定する(S1023)。   Next, the operation of the data expansion unit 910 that expands the second, third, and fourth color data will be described with reference to FIG. The pattern flag DMAC 911 sets the head address and image size of the pattern flag storage unit 1102, reads the pattern flag in order from the set address (for example, 0x00), and sequentially transfers the data to the data output unit 914 ( S1021). In parallel, the data DMAC 913 is set with the start address and image size of the second, third, and fourth color storage units 1104, and reads the second, third, and fourth color data in order from the set address 0x40. A process of sequentially transferring to the output unit 914 is performed (S1022). Based on the pattern flag of the target block acquired from the pattern flag storage unit 1102, the data output unit 914 first determines whether there is second, third, and fourth color data in the target block (S 1023).

例えば、パターンフラグ“0”を有するブロックがあった場合、その注目ブロックは第1色データのみで構成されるブロックであるので、当該注目ブロックに第2,3,4色データは存在しない(S1023にてNo)。そのため、データ展開部910は、注目ブロックの第2,3,4色の色データによる画素塗りつぶし処理は行わず、次のブロックの処理に移る。それ以外のパターンフラグが読み込まれた場合は、少なくとも第2色データが存在するブロックであると判定される(S1023にてYes)。   For example, when there is a block having the pattern flag “0”, since the target block is a block composed only of the first color data, the second, third and fourth color data do not exist in the target block (S1023). No). For this reason, the data development unit 910 does not perform pixel filling processing using the color data of the second, third, and fourth colors of the block of interest, and moves to processing of the next block. If any other pattern flag is read, it is determined that the block has at least the second color data (Yes in S1023).

次に、少なくとも第2色データが存在するブロックであり(S1023にてYes)、かつ注目ブロックにまだ塗りつぶす画素がある場合(S1024にてYes)、データ出力部914は、読み込んだ第2,3,4色データによって塗りつぶされる画素位置を、パターンフラグに基づいて特定する(S1025)。データDMACは1ブロック内の第2,3,4色データをデータ出力部914に順次転送してくるため、データ出力部914は、第2色データで塗りつぶす画素、第3色データで塗りつぶす画素、第4色データで塗りつぶす画素を別々に特定する。さらに、データ出力部914は、予めデータ出力部914に設定されたラスタ展開後の画像を格納する先頭アドレス、展開画像のサイズ情報から、第2,3,4色の色データそれぞれで塗りつぶす画素に対応するメモリアドレスを算出する(S1026)。   Next, in a case where at least the second color data exists (Yes in S1023) and there are still pixels to be filled in the target block (Yes in S1024), the data output unit 914 reads the second and third data read. , The pixel position to be filled with the four color data is specified based on the pattern flag (S1025). Since the data DMAC sequentially transfers the second, third, and fourth color data in one block to the data output unit 914, the data output unit 914 includes pixels that are filled with the second color data, pixels that are filled with the third color data, The pixels to be filled with the fourth color data are specified separately. Further, the data output unit 914 applies the color data of the second, third, and fourth colors to the pixels that are filled with the color data of the second, third, and fourth colors from the start address for storing the rasterized image set in the data output unit 914 and the size information of the developed image. The corresponding memory address is calculated (S1026).

そして、データ出力部914は、データDMAC913から受信した第2,3,4色データを、算出したそれぞれのアドレスのメモリ領域に書き込む(S1027)。S1024〜S1026の処理は、1ブロックの中で、第2,3,4色データを書き込む画素数分繰り返される。すなわち、画像データ1101の左上ブロックにおいては、書き込む第2,3,4色データは3画素分なので、S1024〜S1026の処理は3回行われる。また、画像データ1101の右上ブロックにおいては、書き込む第2,3,4色データは1画素分なので、S1024〜S1026の処理は1回行われる。このようにして1ブロック分の処理が終わると、S1024において、データ出力部914は、塗りつぶす画素がなくなったと判定し(S1024にてNo)、注目ブロックの展開処理を終了する。以上の処理によって、展開用のメモリ上で、各ブロックの第2,3,4色の色データが画素値として書き込まれた画素は、図12(b)の斜線部で示される。言い換えれば、図12(b)の斜線部で示される画素の画素データが、データ展開部910によって展開されることになる。   Then, the data output unit 914 writes the second, third, and fourth color data received from the data DMAC 913 in the memory area of each calculated address (S1027). The processing of S1024 to S1026 is repeated for the number of pixels to which the second, third, and fourth color data are written in one block. That is, in the upper left block of the image data 1101, since the second, third, and fourth color data to be written are for three pixels, the processing of S1024 to S1026 is performed three times. In the upper right block of the image data 1101, the second, third, and fourth color data to be written is for one pixel, so the processing of S1024 to S1026 is performed once. When the processing for one block is completed in this way, in S1024, the data output unit 914 determines that there are no pixels to be filled (No in S1024), and ends the development processing of the target block. Through the above processing, the pixels in which the color data of the second, third, and fourth colors of each block are written as pixel values on the development memory are indicated by hatched portions in FIG. In other words, the pixel data of the pixel indicated by the hatched portion in FIG. 12B is expanded by the data expansion unit 910.

1段階圧縮されたデータは、以上のような方法により、展開部211により展開される。なお、各DMACについては、データ読み出しの効率を上げるために使用しているものであり、DMACを削除して、各データ出力部が必要なデータに順次アクセスするような構成を採用しても構わない。   The data compressed by one stage is expanded by the expansion unit 211 by the method as described above. Each DMAC is used to increase the efficiency of data reading, and a configuration in which each DMAC is deleted and each data output unit sequentially accesses necessary data may be employed. Absent.

[2段階圧縮データに対する展開処理]
次に、2段階の圧縮処理がなされている圧縮データが展開対象である場合について、展開部211の詳細な処理を、図13に示すフローチャートと、図14の圧縮画像例とを用いて説明する。すなわち、図11(a)に示される4×4画素からなる画像データ1101を2段階圧縮した2段階圧縮データ(図14(b))を展開する場合について述べる。
[Expansion processing for two-stage compressed data]
Next, in the case where the compressed data that has been subjected to the two-stage compression processing is a decompression target, the detailed processing of the decompression unit 211 will be described using the flowchart shown in FIG. 13 and the compressed image example shown in FIG. . That is, a case will be described in which the two-stage compressed data (FIG. 14B) obtained by compressing the image data 1101 composed of 4 × 4 pixels shown in FIG.

画像データ1101は2段階圧縮されると、図14(b)、(c)で示されるような圧縮データとしてメモリ106上に格納される。まずは、この伸張する2段階圧縮データが生成される仕組みについて説明しておく。   When the image data 1101 is compressed in two stages, it is stored in the memory 106 as compressed data as shown in FIGS. 14B and 14C. First, a mechanism for generating the decompressed two-stage compressed data will be described.

メモリ106の圧縮データ格納に関する一部のメモリマップを抽出したものを図14(b)に示し、さらにメモリ内部のデータ領域を詳細にしたものを図14(c)に示す。なお、図14(c)において、横方向の値が第1の位のメモリアドレスの値を示し、縦方向の値が第2の位のメモリアドレスの値を指す。すなわち、図14(b)にて示された第2段階第1色格納部1404の先頭アドレスである“0x18”は、図14(c)において、横方向の“08”と縦方向の“10”とが交わるアドレスを意味する。   FIG. 14B shows an extracted part of the memory map for storing compressed data in the memory 106, and FIG. 14C shows a detailed data area inside the memory. In FIG. 14C, the horizontal value indicates the value of the first-order memory address, and the vertical value indicates the value of the second-order memory address. That is, “0x18”, which is the start address of the second stage first color storage unit 1404 shown in FIG. 14B, is “08” in the horizontal direction and “10” in the vertical direction in FIG. "Means the address where"

第1段階パターンフラグ格納部1402と、第1段階第2,3,4色格納部1406に格納されているデータ及びその生成方法は、図11(b)のパターンフラグ格納部1102と、第2,3,4色格納部1104とに格納されているデータ及びその生成方法と同じである。よって、説明は割愛する。第1段階の圧縮処理によって、第1色格納部1103に格納された第1色データは、画像データ1101の各ブロックの左上画素が格納されている。つまり、主走査方向、副走査方向それぞれに2画素ごとに間引いた画像データ1401(図14(a))が格納されていることと同義である。   The data stored in the first stage pattern flag storage unit 1402, the first stage second, third, and fourth color storage units 1406 and the generation method thereof are the same as the pattern flag storage unit 1102 in FIG. , 3 and 4 color storage unit 1104 and the same generation method. Therefore, explanation is omitted. As the first color data stored in the first color storage unit 1103 by the first-stage compression processing, the upper left pixel of each block of the image data 1101 is stored. That is, it is synonymous with storing image data 1401 (FIG. 14A) thinned out every two pixels in each of the main scanning direction and the sub-scanning direction.

そこで、第2段階圧縮は、第1段階圧縮によって間引いて得られた画像データ1401に対して、圧縮処理を行う。このとき、図4に示す割り当てにより、画像データ1401のブロックのパターンフラグは“2”となる。これが第2段階パターンフラグ格納部1403に格納され、図14(c)のアドレス0x10のように配置されている。また、第2段階第1色格納部1404には、第2段階圧縮の処理対象ブロックの左上画素の画素値(色データ)が格納される。従って、図14(c)のアドレス0x18−0x1Aのように、画素00の画素データが格納される。   Therefore, the second stage compression performs a compression process on the image data 1401 obtained by thinning out by the first stage compression. At this time, the pattern flag of the block of the image data 1401 becomes “2” by the assignment shown in FIG. This is stored in the second stage pattern flag storage unit 1403, and is arranged as address 0x10 in FIG. 14 (c). The second-stage first color storage unit 1404 stores the pixel value (color data) of the upper left pixel of the processing target block for the second-stage compression. Accordingly, the pixel data of the pixel 00 is stored like the address 0x18-0x1A in FIG.

最後に、第2段階第2,3,4色格納部1405には、第2段階圧縮の処理対象の注目ブロックにおける左上画素の色データ(第1色)以外の色データ(第2〜4色)が格納されている。ただし、同一ブロック内に同色の色が存在した場合、その色のデータは重複して格納されない。例えば、画像データ1401のブロックの画素00と画素22は同色の値(第1色の色データ)を有し、かつ、画素02と画素20は同色の値(第2色の色データ)を有するため、画素02の画素値(第2色データ)だけが第2段階第2,3,4色格納部1405に格納される。従って、画像データ1401の中で第2段階第2,3,4色格納部1405に格納される画素データは、画素02のみであるため、図14(c)のアドレス0x20−0x22のように格納されている。   Finally, the second stage second, third, and fourth color storage unit 1405 stores color data (second to fourth colors) other than the color data (first color) of the upper left pixel in the target block to be processed in the second stage compression. ) Is stored. However, if the same color exists in the same block, the data of that color is not stored redundantly. For example, the pixel 00 and the pixel 22 of the block of the image data 1401 have the same color value (first color data), and the pixel 02 and the pixel 20 have the same color value (second color data). Therefore, only the pixel value (second color data) of the pixel 02 is stored in the second stage second, third, fourth color storage unit 1405. Accordingly, the pixel data stored in the second stage second, third, and fourth color storage unit 1405 in the image data 1401 is only the pixel 02, and is stored as the address 0x20-0x22 in FIG. Has been.

2段階の圧縮処理がなされている圧縮データ(図14(b)、(c))の展開処理は、図9に示された3つのデータ展開部900,910,920をすべて使用して行う。ここでは、データ展開部900が第2段階第1色データの展開を行い、データ展開部910が第2段階第2,3,4色データの展開を行い、データ展開部920が第1段階第2,3,4色データの展開を行うものとする。すなわち、データ展開部900は、展開後のラスタ画像において、圧縮データ内の第2段階第1色データによって、展開後のデータサイズにおいて塗りつぶされる画素を第2段階パターンフラグと第1段階パターンフラグとに基づいて特定する。そして、読み込んだ第2段階第1色データによって当該特定した画素を塗りつぶす。また、データ展開部910は、展開後のラスタ画像において、圧縮データ内の第2段階第2,3,4色データによって塗りつぶされる画素を第2段階パターンフラグと第1段階パターンフラグとに基づいて特定する。そして、読み込んだ第2段階第2,3,4色データによって当該特定した画素を塗りつぶす処理を行う。さらに、データ展開部920は、展開後のラスタ画像において、圧縮データ内の第1段階第2,3,4色データによって塗りつぶされる画素を第1段階パターンフラグに基づいて特定する。そして、読み込んだ第1段階第2,3,4色データによって当該特定した画素を塗りつぶす処理を行う。   The decompression processing of the compressed data (FIGS. 14B and 14C) subjected to the two-stage compression processing is performed using all the three data decompression units 900, 910, and 920 shown in FIG. Here, the data development unit 900 develops the second stage first color data, the data development unit 910 develops the second stage second, third, and fourth color data, and the data development unit 920 performs the first stage first color data. It is assumed that 2, 3 and 4 color data are developed. That is, the data development unit 900 uses the second-stage pattern flag and the first-stage pattern flag to represent pixels that are filled in the data size after development by the second-stage first color data in the compressed data in the raster image after development. Identify based on. Then, the specified pixel is filled with the read second-stage first color data. In addition, the data expansion unit 910 uses the second-stage pattern flag and the first-stage pattern flag to indicate pixels that are filled with the second-stage second, third, and fourth color data in the compressed data in the raster image after development. Identify. And the process which fills the said specified pixel with the read 2nd step 2nd, 3rd, 4th color data is performed. Further, the data expansion unit 920 identifies pixels to be filled with the first-stage second, third, and fourth color data in the compressed data in the raster image after development based on the first-stage pattern flag. And the process which fills the said specified pixel with the read 1st step 2nd, 3rd, 4th color data is performed.

まず、第2段階第1色データを展開するデータ展開部900の動作について図13(a)を用いて説明する。ここで、前述の1段階の圧縮処理がなされている圧縮データの展開処理時とは異なり、2段階の圧縮処理がなされている圧縮データの展開処理において、1回の展開処理で注目する注目ブロックは、画像データ1101における4×4画素単位に相当する。また、以下の説明において、S1301〜S1303の処理は並行して行われるものとして記載されているが、図13(a)に示すように、順番に処理を行うことも可能である。   First, the operation of the data expansion unit 900 that expands the second stage first color data will be described with reference to FIG. Here, unlike the compressed data decompression process in which the one-stage compression process is performed, in the decompression process of the compressed data in which the two-stage compression process is performed, the target block to be noted in one decompression process Corresponds to a 4 × 4 pixel unit in the image data 1101. In the following description, the processing of S1301 to S1303 is described as being performed in parallel, but the processing can also be performed in order as shown in FIG.

パターンフラグDMAC901は、第1段階パターンフラグ格納部1402の先頭アドレスと画像サイズが設定され、当該設定されたアドレス(0x00)からパターンフラグを読み込んで、データ出力部904に順次転送する(S1301)。並行して、パターンフラグDMAC902は、第2段階パターンフラグ格納部1403の先頭アドレスと画像サイズが設定され、当該設定されたアドレス(0x10)からパターンフラグを読み込み、データ出力部904に順次転送する(S1302)。   The pattern flag DMAC 901 is set with the head address and image size of the first stage pattern flag storage unit 1402, reads the pattern flag from the set address (0x00), and sequentially transfers it to the data output unit 904 (S1301). In parallel, the pattern flag DMAC 902 is set with the head address and image size of the second stage pattern flag storage unit 1403, reads the pattern flag from the set address (0x10), and sequentially transfers it to the data output unit 904 ( S1302).

さらに並行して、データDMAC903は、第2段階第1色格納部1404の先頭アドレスと画像サイズが設定され、当該設定されたアドレス(0x18)から順に第2段階第1色データを読み込んで、データ出力部904に順次転送する(S1303)。   In parallel, the data DMAC 903 is set with the head address and image size of the second stage first color storage unit 1404, and reads the second stage first color data in order from the set address (0x18). The data is sequentially transferred to the output unit 904 (S1303).

データ出力部904は、取得した第1段階パターンフラグと第2段階パターンフラグとに基づいて、展開後の4×4画素サイズの画像データにおいて第2段階第1色データで塗りつぶす画素位置を特定する(S1304)。これにより、第一特定手段を実現する。具体的にいうと、図14(c)の圧縮データの例では、まず、第2段階パターンフラグ(“2”)に基づき、画素00,02,20,22のうち、第2段階第1色データで塗りつぶす画素位置として、画素00,22を特定できる。更に、データ出力部904は、第2段階パターンフラグに基づいて第2段階第1色データで塗りつぶすと特定された画素位置が含まれる第1段階圧縮のブロックについて、第1段階パターンフラグに基づき、第2段階第1色データで塗りつぶす画素位置を特定する。図14(c)の例では、画素00が含まれる第1段階圧縮のブロックにおける第1段階パターンフラグが“B”であり、また、画素22が含まれる第1段階圧縮のブロックにおける第1段階パターンフラグが“E”である。したがって、画素00,22が含まれるブロック(画像データ1101の左上ブロックと右下ブロックに相当するブロック)の画素00,22以外の画素位置に対して、第2段階第1色データで塗りつぶす画素は存在しないと判定する。よって、図14(c)の圧縮データの例では、展開後の4×4画素サイズの画像データにおいて第2段階第1色データで塗りつぶす画素位置は画素00,22のみであると特定できる。   The data output unit 904 specifies a pixel position to be filled with the second-stage first color data in the developed 4 × 4 pixel size image data based on the acquired first-stage pattern flag and second-stage pattern flag. (S1304). Thereby, a 1st specific means is implement | achieved. Specifically, in the example of the compressed data in FIG. 14C, first, the second stage first color among the pixels 00, 02, 20, and 22 based on the second stage pattern flag (“2”). Pixels 00 and 22 can be specified as pixel positions to be filled with data. Further, the data output unit 904, based on the first stage pattern flag, for the block of the first stage compression including the pixel position specified to be filled with the second stage first color data based on the second stage pattern flag. The pixel position to be filled with the second stage first color data is specified. In the example of FIG. 14C, the first stage pattern flag in the first stage compression block including the pixel 00 is “B”, and the first stage in the first stage compression block including the pixel 22 is set. The pattern flag is “E”. Therefore, the pixels to be filled with the second-stage first color data for the pixel positions other than the pixels 00 and 22 of the block including the pixels 00 and 22 (the blocks corresponding to the upper left block and the lower right block of the image data 1101) are Judge that it does not exist. Therefore, in the example of the compressed data in FIG. 14C, it is possible to specify that only the pixels 00 and 22 are filled in with the second-stage first color data in the expanded 4 × 4 pixel size image data.

次に、S1304で特定された画素のうち、まだ第2段階第1色データの塗りつぶし処理(書き込み処理)を行っていない画素があれば(S1305にてYes)、当該未処理の画素の1つを処理対象としてS1306の処理に進む。データ出力部904は、予めデータ出力部904に設定されたラスタ展開後の画像を格納する先頭アドレス、展開画像のサイズ情報、当該処理対象の画素の画素位置から、第2段階第1色データで塗りつぶす画素に対応するメモリアドレスを算出する(S1306)。これにより、第一メモリアドレス算出手段を実現する。   Next, if there is a pixel that has not yet been subjected to the second-stage first-color data filling process (writing process) among the pixels specified in S1304 (Yes in S1305), one of the unprocessed pixels. The process proceeds to S1306. The data output unit 904 is a second-stage first color data from the start address for storing the rasterized image set in advance in the data output unit 904, the size information of the developed image, and the pixel position of the pixel to be processed. A memory address corresponding to the pixel to be painted is calculated (S1306). This implements a first memory address calculation means.

そして、データ出力部904は、データDMAC903から受信した第2段階第1色データを、算出したアドレスのメモリ領域に書き込む(S1307)。これにより、第一格納手段を実現する。   Then, the data output unit 904 writes the second-stage first color data received from the data DMAC 903 in the memory area of the calculated address (S1307). Thereby, the first storage means is realized.

S1306〜S1307の処理は、1ブロックの中で、第2段階第1色データを書き込む画素数分繰り返される。図14(c)の例では、展開後の4×4画素サイズの画像データにおいて、第2段階第1色データは、画素00,22の2画素分書き込まれるので、S1306〜S1307の処理は2回行われる。   The processing of S1306 to S1307 is repeated for the number of pixels to which the second stage first color data is written in one block. In the example of FIG. 14C, in the expanded 4 × 4 pixel size image data, the second-stage first color data is written for two pixels 00 and 22, so the processing of S 1306 to S 1307 is 2. Performed once.

以上のようにして、1つの注目ブロック分(2段階圧縮のため、4×4画素に相当)の処理が終わると、S1305において、データ出力部904は、第2段階第1色データの塗りつぶし対象画素がなくなった(塗りつぶし処理が終了した)と判定し(S1305にてNo)、注目ブロックに対する処理を終了する。以上の処理によって、図14(c)の圧縮データの場合、メモリ上に展開された画像データにおいて、第2段階第1色データが書き込まれる画素は、図15(a)の斜線部で表される。言い換えれば、図15(a)の斜線部で表される画素の画素データが、データ展開部900によって展開されることになる。   As described above, when the processing for one target block (corresponding to 4 × 4 pixels because of two-stage compression) is completed, the data output unit 904 fills the second-stage first color data in S1305. It is determined that there are no pixels (the painting process has been completed) (No in S1305), and the process for the block of interest is completed. With the above processing, in the case of the compressed data in FIG. 14C, in the image data expanded on the memory, the pixel to which the second stage first color data is written is represented by the hatched portion in FIG. The In other words, the pixel data of the pixel represented by the hatched portion in FIG.

次に、第2段階第2,3,4色データを展開するデータ展開部910の動作について図13(b)を用いて説明する。なお、以下の説明において、S1321〜S1323の処理は並行して行われるものとして記載されているが、図13(b)に示すように、順番に処理を行うことも可能である。   Next, the operation of the data expansion unit 910 that expands the second stage second, third, and fourth color data will be described with reference to FIG. In the following description, the processing of S1321 to S1323 is described as being performed in parallel, but the processing can also be performed in order as shown in FIG. 13B.

パターンフラグDMAC911は、第1段階パターンフラグ格納部1402の先頭アドレスと画像サイズが設定され、当該設定されたアドレス(0x00)からパターンフラグを読み込んで、データ出力部914に順次転送する(S1321)。この処理に並行して、パターンフラグDMAC912は、第2段階パターンフラグ格納部1403の先頭アドレスと画像サイズが設定され、当該設定されたアドレス(0x10)からパターンフラグを読み込んで、データ出力部914に順次転送する(S1322)。   The pattern flag DMAC 911 is set with the head address and image size of the first stage pattern flag storage unit 1402, reads the pattern flag from the set address (0x00), and sequentially transfers it to the data output unit 914 (S1321). In parallel with this processing, the pattern flag DMAC 912 is set with the head address and image size of the second stage pattern flag storage unit 1403, reads the pattern flag from the set address (0x10), and sends it to the data output unit 914. Transfer sequentially (S1322).

さらに並行して、データDMAC913は、第2段階第2,3,4色格納部1405の先頭アドレスと画像サイズが設定され、当該設定されたアドレス(0x20)から第2段階第2,3,4色データを読み込んで、データ出力部914に順次転送する(S1323)。   In parallel, in the data DMAC 913, the start address and image size of the second stage second, third, and fourth color storage units 1405 are set, and the second stage second, third, and fourth are set from the set address (0x20). The color data is read and sequentially transferred to the data output unit 914 (S1323).

データ出力部914は、第2段階パターンフラグ格納部1403から取得する第2段階パターンフラグに基づいて、まず、第2段階第2,3,4色データがあるか否かを判定する(S1324)。例えば、第2段階パターンフラグ“0”のブロックについては、当該注目ブロックの第2段階第2,3,4色データは存在しないと判定される(S1324にてNo)。そのため、データ展開部910は、当該注目ブロックについて、第2段階第2,3,4色データによる画素塗りつぶし処理は行わず、次のブロック処理に移る。それ以外の第2段階パターンフラグが読み込まれた場合は、少なくとも第2段階第2色データが存在するブロックであると判定される(S1324にてYes)。   The data output unit 914 first determines whether there is second-stage second, third, and fourth color data based on the second-stage pattern flag acquired from the second-stage pattern flag storage unit 1403 (S1324). . For example, for the block of the second stage pattern flag “0”, it is determined that the second stage second, third, and fourth color data of the block of interest does not exist (No in S1324). For this reason, the data development unit 910 does not perform the pixel filling process using the second-stage second, third, and fourth color data for the target block, and proceeds to the next block process. If any other second-stage pattern flag is read, it is determined that the block has at least the second-stage second color data (Yes in S1324).

データ展開部910が、当該注目ブロックについて、第2段階第2,3,4色データが存在すると判定した場合(S1324にてYes)、データ展開部910は、注目ブロックに未処理の第2段階第2,3,4色データがあるかどうかを判定する(S1325)。注目ブロックに未処理の第2段階第2,3,4色データがあると判定した場合(S1325にてYes)、データ展開部910は、未処理の第2段階第2,3,4色データのうちの1つを処理対象にする。更に、データ展開部910は、第2段階パターンフラグと第1段階パターンフラグとに基づいて、展開後の4×4画素サイズの画像データにおいて、当該処理対象にした色データで塗りつぶす画素位置を特定する(S1326)。これにより、第二特定手段を実現する。   If the data development unit 910 determines that the second stage second, third, and fourth color data exists for the target block (Yes in S1324), the data development unit 910 displays the unprocessed second stage in the target block. It is determined whether there are second, third, and fourth color data (S1325). If it is determined that there is unprocessed second-stage second, third, and fourth color data in the target block (Yes in S1325), the data expansion unit 910 displays the unprocessed second-stage second, third, and fourth color data. One of them is set as a processing target. Further, the data development unit 910 specifies the pixel position to be filled with the color data targeted for processing in the image data of 4 × 4 pixel size after development based on the second stage pattern flag and the first stage pattern flag. (S1326). Thereby, a 2nd specific means is implement | achieved.

データDMAC913は、1ブロック内の第2段階第2,3,4色データをデータ出力部914に順次転送するため、データ出力部914は、第2段階第2色データで塗りつぶす画素、第3色データで塗りつぶす画素、第4色データで塗りつぶす画素を別々に特定する。したがって、S1326では、未処理の色データのうち、第2段階の第2色データから順に処理対象にしていくものとする。   Since the data DMAC 913 sequentially transfers the second stage second, third, and fourth color data in one block to the data output unit 914, the data output unit 914 includes pixels to be filled with the second stage second color data, the third color The pixel to be filled with data and the pixel to be filled with the fourth color data are specified separately. Therefore, in S1326, it is assumed that the unprocessed color data is processed in order from the second color data in the second stage.

このS1324〜S1326の処理に関して、図14ならびに図11に基づいて、具体的に説明を行う。まず第2段階パターンフラグとして“2”が読み込まれ、図4を参照すれば分かるように、第2色データが存在する配置パターンであると判定される。すなわち、注目ブロックの第2段階圧縮を行った際の配置パターンが画像データ1401のようなパターンだということが判定される。したがって、第2段階第2,3,4色格納部1405には第2色データだけが格納されているため、データ出力部914は、データDMAC913から受信した第2色データで、どこの画素を塗りつぶすかを算出する。つまり、データ出力部914は、第2段階パターンフラグのパターン“2”に基づき、画素02と画素20とを、データDMAC913から読み込んだ第2色データで塗りつぶす対象の画素であると判定する。   The processing of S1324 to S1326 will be specifically described based on FIG. 14 and FIG. First, “2” is read as the second stage pattern flag, and it is determined that the arrangement pattern includes the second color data, as can be seen from FIG. That is, it is determined that the arrangement pattern when the second stage compression of the block of interest is performed is a pattern like the image data 1401. Accordingly, since only the second color data is stored in the second stage second, third, and fourth color storage unit 1405, the data output unit 914 uses the second color data received from the data DMAC 913 to determine which pixel. Calculate whether to fill. That is, the data output unit 914 determines that the pixel 02 and the pixel 20 are pixels to be filled with the second color data read from the data DMAC 913 based on the pattern “2” of the second stage pattern flag.

更に、画素02と画素20はそれぞれ、画像データ1101の右上ブロックおよび左下ブロックの第1色データでもある。よって、これと対応する第1段階パターンフラグのパターン“5”、“1”に基づいて、データ出力部914は、画像データ1101の画素03,13,30,31も塗りつぶし対象画素であると判定する。すなわち、図14(c)の圧縮データの例では、以上で示した画素02,03,13,20,30,31の6画素分を、S1324〜S1326のフローの中で、第2段階第2色データで塗りつぶす対象の画素位置であると特定する(図15(b))。   Further, the pixel 02 and the pixel 20 are also the first color data of the upper right block and the lower left block of the image data 1101, respectively. Therefore, based on the first-stage pattern flag patterns “5” and “1” corresponding thereto, the data output unit 914 determines that the pixels 03, 13, 30, and 31 of the image data 1101 are also pixels to be filled. To do. That is, in the example of the compressed data in FIG. 14C, the second pixel of the pixels 02, 03, 13, 20, 30, and 31 shown above is converted into the second stage 2 in the flow of S 1324 to S 1326. The pixel position to be filled with color data is specified (FIG. 15B).

図13(b)の処理フローの説明に戻る。塗りつぶす画素位置が特定されると、予めデータ出力部914に設定されたラスタ展開後の画像データを格納する展開領域の先頭アドレス、展開画像のサイズ情報、当該塗りつぶし対象画素の位置から、データ出力部914は第2段階第2,3,4色データで塗りつぶす画素に対応するメモリアドレスを算出する(S1327)。これにより、第二メモリアドレス算出手段を実現する。   Returning to the description of the processing flow in FIG. When the pixel position to be filled is specified, a data output unit is obtained from the start address of the development area storing the image data after raster development set in the data output unit 914 in advance, the size information of the developed image, and the position of the pixel to be painted. In step S1327, a memory address corresponding to a pixel to be filled with the second, second, third, and fourth color data is calculated. This implements a second memory address calculation unit.

そして、データ出力部914は、データDMAC913から受信した第2,3,4色データのうち、S1326で処理対象にした色データを、算出したアドレスのメモリ領域に書き込む(S1328)。これにより第二格納手段を実現する。S1325〜S1328の処理は、注目ブロックの中で、第2,3,4色データを書き出す画素数分繰り返される。すなわち、図14(c)の圧縮データの例では、第2段階第2色データで図15(b)のように6画素分塗りつぶすことになるため、S1325〜S1328の処理は6回行われる。   The data output unit 914 writes the color data to be processed in S1326 among the second, third, and fourth color data received from the data DMAC 913 in the memory area of the calculated address (S1328). This implements a second storage means. The processing of S1325 to S1328 is repeated for the number of pixels in which the second, third, and fourth color data are written in the target block. That is, in the example of the compressed data in FIG. 14C, since the second stage second color data is painted for 6 pixels as shown in FIG. 15B, the processing from S1325 to S1328 is performed six times.

このようにして1つの注目ブロック分の処理が終わると、S1325において、データ出力部914は、塗りつぶす画素がなくなったと判定し(S1325にてNo)、注目ブロックに対する処理を終了する。以上の処理によって、図14(c)の圧縮データの場合、メモリ上に展開された画像データにおいて、第2段階第2色データが書き込まれる画素は、図15(b)の斜線部で表わされる。言い換えれば、図15(b)の斜線部で表される画素の画素値が、データ展開部910によって展開されることになる。   When the processing for one target block is completed in this way, in S1325, the data output unit 914 determines that there are no more pixels to be filled (No in S1325), and ends the processing for the target block. With the above processing, in the case of the compressed data in FIG. 14C, in the image data expanded on the memory, the pixel to which the second stage second color data is written is represented by the hatched portion in FIG. 15B. . In other words, the pixel value of the pixel represented by the hatched portion in FIG. 15B is expanded by the data expansion unit 910.

最後に、第1段階第2,3,4色データを展開するデータ展開部920の動作について図13(c)を用いて説明する。なお、以下の説明において、S1341〜S1342の処理は並行して行われるものとして記載されているが、図13(c)に示すように、順番に処理を行うことも可能である。なお、第1段階第2,3,4色データを展開する場合は、第2段階パターンフラグは使用しないので、パターンフラグDMAC922は省略しても構わない。   Finally, the operation of the data expansion unit 920 that expands the first-stage second, third, and fourth color data will be described with reference to FIG. In the following description, the processing of S1341 to S1342 is described as being performed in parallel, but the processing can also be performed in order as shown in FIG. Note that when developing the first stage second, third, and fourth color data, the second stage pattern flag is not used, and therefore the pattern flag DMAC 922 may be omitted.

パターンフラグDMAC921は、第1段階パターンフラグ格納部1402の先頭アドレスと画像サイズが設定され、当該設定されたアドレス(0x00)から第1段階パターンフラグを読み込んで、データ出力部914に順次転送する(S1341)。並行して、データDMAC923は、第1段階第2,3,4色格納部1406の先頭アドレスと画像サイズが設定され、当該設定されたアドレス(0x40)から第1段階第2,3,4色データを読み込んで、データ出力部924に順次転送する(S1342)。   The pattern flag DMAC 921 is set with the head address and image size of the first stage pattern flag storage unit 1402, reads the first stage pattern flag from the set address (0x00), and sequentially transfers it to the data output unit 914 ( S1341). In parallel, the data DMAC 923 is set with the head address and image size of the first stage second, third, and fourth color storage unit 1406, and the first stage second, third, and fourth colors from the set address (0x40). Data is read and sequentially transferred to the data output unit 924 (S1342).

データ出力部924は、第1段階パターンフラグ格納部1402から取得する第1段階パターンフラグに基づいて、まず、第1段階第2,3,4色データがあるか否かを判定する(S1343)。例えば、本第1段階パターンフラグ“0”のブロックについては、当該注目ブロックの第1段階第2,3,4色データは存在しないと判定される(S1343にてNo)。そのため、データ展開部920は、当該注目ブロックについて、第1段階第2,3,4色データによる画素塗りつぶし処理は行わず、次のブロック処理に移る。それ以外の第1段階パターンフラグが読み込まれた場合は、データ展開部920は、少なくとも第1段階第2色データが存在するブロックであると判定する(S1343にてYes)。   Based on the first stage pattern flag acquired from the first stage pattern flag storage unit 1402, the data output unit 924 first determines whether there is first stage second, third, and fourth color data (S1343). . For example, for the block of the first stage pattern flag “0”, it is determined that the first stage second, third, fourth color data of the target block does not exist (No in S1343). Therefore, the data development unit 920 does not perform the pixel filling process using the first-stage second, third, and fourth color data for the target block, and proceeds to the next block process. If any other first stage pattern flag is read, the data development unit 920 determines that the block has at least the first stage second color data (Yes in S1343).

データ展開部920が、当該注目ブロックについて、第1段階第2,3,4色データが存在すると判定した場合(S1343にてYes)、データ出力部924は、注目ブロック内に未処理の第1段階第2,3,4色データが存在するかを判定する(S1344)。注目ブロック内に未処理の第1段階第2,3,4色データが存在すると判定した場合(S1344にてYes)、データ出力部924は、未処理の第1段階第2,3,4色データのうちの1つを処理対象にする。更に、データ出力部924は、第1段階パターンフラグに基づいて、展開後の画像データにおいて、当該処理対象にした色データで塗りつぶす画素位置を特定する(S1345)。   When the data development unit 920 determines that the first-stage second, third, and fourth color data exists for the target block (Yes in S1343), the data output unit 924 displays the unprocessed first in the target block. It is determined whether the second, third, and fourth color data are present (S1344). If it is determined that unprocessed first stage second, third, and fourth color data exists in the block of interest (Yes in S1344), the data output unit 924 displays the unprocessed first stage second, third, and fourth color data. One of the data is processed. Further, the data output unit 924 specifies a pixel position to be filled with the color data to be processed in the developed image data based on the first stage pattern flag (S1345).

データDMAC923は、1ブロック内の第1段階第2,3,4色データをデータ出力部924に順次転送してくるため、データ出力部924は、第1段階第2色データで塗りつぶす画素、第1段階第3色データで塗りつぶす画素、第1段階第4色データで塗りつぶす画素を別々に特定する。   Since the data DMAC 923 sequentially transfers the first, second, third, and fourth color data in one block to the data output unit 924, the data output unit 924 includes the pixels to be filled with the first step second color data, the first color The pixels to be filled with the first stage third color data and the pixels to be filled with the first stage fourth color data are specified separately.

このS1343〜S1345の処理に関して、図14ならびに図11に基づいて、具体的に説明を行う。まず第1段階パターンフラグとして、最初にパターン“B”が読み込まれた場合、図4を参照すれば分かるように、第2色データと第3色データとが存在する配置パターンであると判定される。すなわち、注目ブロックの第1段階圧縮を行った際の配置パターンは、まず画像データ1101の左上ブロックのようなパターンであると判定される。したがって、第1段階第2,3,4色格納部1406には、第2色データと第3色データが格納されているので、データDMAC923から受信した第2色データと第3色データで、どの画素を塗りつぶすかが算出される。つまり、データ出力部924は、第1段階パターンフラグのパターン“B”に基づいて、画素01と画素10とを、データDMAC923から読み込んだ第2色データによって塗りつぶす対象の画素であると判定する。また、画素11は、同じくデータDMAC923から読み込んだ第3色データによって塗りつぶす対象の画素であると判定される。   The processing of S1343 to S1345 will be specifically described based on FIG. 14 and FIG. First, when the pattern “B” is first read as the first stage pattern flag, it is determined that the arrangement pattern includes the second color data and the third color data, as can be understood with reference to FIG. The That is, the arrangement pattern when the first stage compression of the block of interest is first determined to be a pattern like the upper left block of the image data 1101. Therefore, since the second color data and the third color data are stored in the first stage second, third, and fourth color storage unit 1406, the second color data and the third color data received from the data DMAC 923 are Which pixels are filled is calculated. That is, the data output unit 924 determines that the pixel 01 and the pixel 10 are pixels to be filled with the second color data read from the data DMAC 923 based on the pattern “B” of the first stage pattern flag. Similarly, the pixel 11 is determined to be a pixel to be filled with the third color data read from the data DMAC 923.

図13(c)のフローの説明に戻る。塗りつぶす画素位置が特定されると、予めデータ出力部924に設定されたラスタ展開後の画像を格納する先頭アドレス、展開画像のサイズ情報、当該塗りつぶし対象画素の位置から、データ出力部924は、第1段階第2,3,4色データで塗りつぶす画素に対応するメモリアドレスを算出する(S1346)。   Returning to the description of the flow in FIG. When the pixel position to be filled is specified, the data output unit 924 determines the first address from which the rasterized image set in advance in the data output unit 924 is stored, the size information of the developed image, and the position of the pixel to be filled. A memory address corresponding to a pixel to be painted with the first, second, third, and fourth color data is calculated (S1346).

そして、データ出力部924は、データDMAC923から受信した第2,3,4色データのうち、S1345で処理対象にした色データを、算出したアドレスのメモリ領域に転送して書き込む(S1347)。S1344〜S1347の処理は、注目ブロックの中で、第1段階第2,3,4色データを書き出す画素数分繰り返される。   Then, the data output unit 924 transfers the color data to be processed in S1345 out of the second, third, and fourth color data received from the data DMAC 923 to the memory area of the calculated address and writes it (S1347). The processing of S1344 to S1347 is repeated for the number of pixels in which the first stage second, third, and fourth color data are written in the target block.

このようにして1ブロック分の処理が終わると、S1344において、データ出力部924は、塗りつぶす画素がなくなったと判定し(S1344にてNo)、注目ブロックに対する展開処理を終了する。以上の処理によって、図14(c)の圧縮データの場合、メモリ106上に展開された画像データにおいて、第1段階第2,3,4色データが書き込まれる画素は、展開後の各ブロックにおいて図15(c)の斜線部で表わされる。言い換えれば、図15(c)の斜線部で表される画素の画素値が、データ展開部920によって展開される。   When the processing for one block is completed in this way, in S1344, the data output unit 924 determines that there are no pixels to be filled (No in S1344), and ends the development processing for the block of interest. With the above processing, in the case of the compressed data in FIG. 14C, in the image data expanded on the memory 106, the pixels in which the first, second, third, and fourth color data are written are in each expanded block. It is represented by the hatched portion in FIG. In other words, the pixel value of the pixel represented by the hatched portion in FIG.

[アクセス数における対比]
本発明の展開部211の特徴として、データ展開部900、910、920のように並列に配置して、それぞれを独立して動作させることができ、メモリアクセスを効率化できる点にある。
[Contrast in number of accesses]
The development unit 211 of the present invention is characterized in that it can be arranged in parallel like the data development units 900, 910, and 920, and can be operated independently, and the memory access can be made efficient.

2段階圧縮データの展開処理に必要なメモリアクセス量について、展開部211を上記の本発明に基づいた構成にした場合(図9)と、特願2009−221444で述べた図19のような構成で圧縮時と逆順で段階的に展開するように構成した場合(以下では従来構成と呼ぶ)とを、それぞれ図16(a)、(b)に示す。また、従来構成としての処理フローを図20に示す。図16(a)は、画像データ1101が2段階圧縮されたデータ(図14(b))を、本発明の展開部(図9)によってラスタデータに展開する時のメモリアクセス量を示す。また、図16(b)は、画像データ1101が2段階圧縮されたデータ(図14(b))を、従来構成の展開部(図19)によってラスタデータに展開する時のメモリアクセス量を示す。図16(a)に示す本発明と図16(b)に示す従来構成とのアクセス種の差分として、本発明においては「第1段階第1色データ読み込み(図16(b)の1613に対応)」の処理が不要であるため、その項目が無くなっている。   Regarding the memory access amount necessary for the decompression processing of the two-stage compressed data, when the decompressing unit 211 is configured based on the above-described present invention (FIG. 9), the configuration as illustrated in FIG. 16 (a) and 16 (b) respectively show the case where it is configured to expand in stages in the reverse order of compression (hereinafter referred to as the conventional configuration). FIG. 20 shows a processing flow as a conventional configuration. FIG. 16A shows the memory access amount when the data (FIG. 14B) obtained by compressing the image data 1101 in two stages is expanded into raster data by the expansion unit (FIG. 9) of the present invention. FIG. 16B shows the memory access amount when the data (FIG. 14B) obtained by compressing the image data 1101 in two stages is developed into raster data by the development unit (FIG. 19) having the conventional configuration. . As a difference in access type between the present invention shown in FIG. 16A and the conventional configuration shown in FIG. 16B, in the present invention, “first stage first color data read (corresponding to 1613 in FIG. 16B)” is shown. ) ”Is not necessary, and the item is missing.

まず、本発明の展開部211は、第2段階第1色データ、第2段階第2,3,4色データ、第1段階第2,3,4色データをそれぞれデータDMAC903、913、923にて読み込む。それぞれの読み込むトータルのデータ量は、図14(c)の圧縮データ例の場合、それぞれ3byte(1603)、3byte(1604)、21byte(1602)である。また、第1段階パターンフラグは、パターンフラグDMAC901、911、921それぞれによって読み込まれ、第2段階パターンフラグは、パターンフラグDMAC902、912によって読み込まれる。それぞれの読み込むデータ量は、図14(c)の圧縮データ例の場合、それぞれ2byteが3モジュール分(1600)、1byteが2モジュール分(1601)である。また、出力データの書き込みは、データ出力部904、914、924のトータルで、画像データ1101のラスタデータ量分となるため、3byteの16画素分(1605)となる。総計のメモリアクセス量(読み込みと書き込みのデータ量)は、83byteとなる。   First, the expansion unit 211 of the present invention converts the second stage first color data, the second stage second, third, fourth color data, and the first stage second, third, fourth color data into data DMACs 903, 913, and 923, respectively. Read. The total amount of data read is 3 bytes (1603), 3 bytes (1604), and 21 bytes (1602) in the case of the compressed data example in FIG. The first stage pattern flag is read by pattern flags DMAC 901, 911, and 921, respectively, and the second stage pattern flag is read by pattern flags DMAC 902 and 912. In the example of compressed data shown in FIG. 14C, the amount of data to be read is 2 bytes for 3 modules (1600) and 1 byte for 2 modules (1601), respectively. In addition, since the output data is written in a total of the data output units 904, 914, and 924 for the amount of raster data of the image data 1101, it corresponds to 16 pixels (1605) of 3 bytes. The total memory access amount (read and write data amount) is 83 bytes.

一方、従来構成の展開部1900の場合、まず第2段階圧縮データを第1段階圧縮データに展開する最初の段階と、その後、当該第1段階圧縮データを更にラスタデータに展開する次の段階とに分けて展開することになる。よって、展開時の最初の段階では、第2段階パターンフラグと、第2段階第1色データと、第2段階第2,3,4色データとを読み込む。図14(c)の圧縮データ例の場合、それぞれのメモリアクセス量は、1byte(1611)、3byte(1614)、3byte(1615)となる。また、第2段階圧縮データを1段階展開した後の第1段階圧縮データは、図11(c)のようになる。そのため、この第1段階圧縮データをラスタデータに展開する次の展開段階では、第1段階パターンフラグと、第1段階第1色データと、第1段階第2,3,4色データとを読み込む。図11(c)の圧縮データ例の場合、それぞれのメモリアクセス量は、2byte(1610)、3byteの4画素分(1612)、21byte(1613)となる。   On the other hand, in the case of the expansion unit 1900 having the conventional configuration, firstly, the first stage of expanding the second-stage compressed data into the first-stage compressed data, and then the next stage of expanding the first-stage compressed data into raster data. It will be divided into two. Therefore, in the first stage of development, the second stage pattern flag, the second stage first color data, and the second stage second, third, and fourth color data are read. In the case of the compressed data example in FIG. 14C, the respective memory access amounts are 1 byte (1611), 3 bytes (1614), and 3 bytes (1615). Further, the first-stage compressed data after the second-stage compressed data is expanded by one stage is as shown in FIG. Therefore, in the next development stage where the first stage compressed data is developed into raster data, the first stage pattern flag, the first stage first color data, and the first stage second, third, and fourth color data are read. . In the case of the compressed data example of FIG. 11C, the respective memory access amounts are 2 bytes (1610), 3 bytes of 4 pixels (1612), and 21 bytes (1613).

また、出力データの書き込みは、第2段階圧縮データを展開した結果を第1色格納部1103に書き込む処理と、第1段階圧縮データを展開した結果のラスタデータを書き込む処理の2段階で行われ、それぞれ画像データ1401、画像データ1101のラスタデータ量分、データ出力されるのに等しい。そのため、それぞれのメモリアクセス量は、3byteの4画素分と、3byteの16画素分となる(1616)。よって、総計のメモリアクセス量(読み込みと書き込みのデータ量)は、102byteとなる。なお、従来構成においては、本発明のようなメモリにアクセスするそれぞれ部位ごとの役割分担は特定せず、総じて展開部1900が行っているものとする。   The output data is written in two stages, a process of writing the result of expanding the second-stage compressed data into the first color storage unit 1103 and a process of writing raster data as a result of expanding the first-stage compressed data. These are equivalent to data output of raster data amounts of the image data 1401 and the image data 1101, respectively. Therefore, each memory access amount is 4 pixels of 3 bytes and 16 pixels of 3 bytes (1616). Therefore, the total memory access amount (read and write data amount) is 102 bytes. In the conventional configuration, the division of roles for each part that accesses the memory as in the present invention is not specified, and it is assumed that the development unit 1900 generally performs the division of roles.

図9の展開部は、複数のデータ展開部で同一のパターンフラグを読み込んで使用する。したがって、図19の展開部よりもパターンフラグに関するメモリアクセス量が増加している(1600、1601、1610、1611)。一方で、本実施形態では、2段階圧縮データを直接ラスタデータに展開してメモリに書き戻す。そのため、第2段階の圧縮データから第1段階への圧縮データへ展開して出力する時のメモリへのデータ書き戻しと、第1段階への圧縮データの読み込みが一部不要になる(1612、1605、1616)。パターンフラグのデータ量と比較して、画素データのデータ量は大きいため、図9の本実施形態によるトータルのメモリアクセス量は、図19のように段階的に展開する場合のメモリアクセス量よりも20%削減されることがわかる。   The development unit in FIG. 9 reads and uses the same pattern flag by a plurality of data development units. Accordingly, the memory access amount related to the pattern flag is increased more than that of the expansion unit in FIG. 19 (1600, 1601, 1610, 1611). On the other hand, in this embodiment, the two-stage compressed data is directly expanded into raster data and written back to the memory. Therefore, part of the data writing back to the memory and the reading of the compressed data to the first stage when the compressed data of the second stage are expanded to the compressed data to the first stage and output (1612, 1605, 1616). Since the data amount of the pixel data is larger than the data amount of the pattern flag, the total memory access amount according to the present embodiment in FIG. 9 is larger than the memory access amount in the case of developing in stages as shown in FIG. It can be seen that it is reduced by 20%.

また、第2段階圧縮データの第1段階圧縮データへの展開用と、第1段階圧縮データのラスタデータへの展開用とで、図19の展開部を複数用意し、その間に中間バッファを設けるように構成すれば、システムメモリへのメモリアクセス回数を減らせる。しかしながら、このような構成にすると回路規模が大きくなってしまう。一方で、図9の本実施形態によるデータ展開部900、910、920は、2段階圧縮データを直接ラスタ画像に展開できるため、このような中間バッファは必要ない。   In addition, a plurality of expansion units shown in FIG. 19 are prepared for the expansion of the second-stage compressed data into the first-stage compressed data and the expansion of the first-stage compressed data into the raster data, and an intermediate buffer is provided therebetween. With this configuration, the number of memory accesses to the system memory can be reduced. However, such a configuration increases the circuit scale. On the other hand, since the data expansion units 900, 910, and 920 according to the present embodiment in FIG. 9 can directly expand the two-stage compressed data into a raster image, such an intermediate buffer is not necessary.

さらに、3段階以上の圧縮データを扱う場合、図19に示す展開部1900を使用すると、データ展開の各段階で展開部を必要とするため、ラスタ画像まで効率良く展開するためには、更に多くの展開部と中間バッファを必要とする。例えば3段階圧縮されたデータを展開する場合、図17(a)のように、多くの展開部(1+4+16個)と、その間の中間バッファ(4+16個)とを必要とする。一方、本発明では、図9のデータ展開部900、910、920に対して、図17(b)のようにデータ展開部を1つ追加すれば良い。   Further, when handling compressed data of three or more stages, if a decompression unit 1900 shown in FIG. 19 is used, a decompression unit is required at each stage of data decompression. Requires an expansion part and an intermediate buffer. For example, when decompressing data compressed in three stages, as shown in FIG. 17A, many decompressing units (1 + 4 + 16) and intermediate buffers (4 + 16) between them are required. On the other hand, in the present invention, one data expansion unit may be added to the data expansion units 900, 910, and 920 of FIG. 9 as shown in FIG.

より詳細には、図18のように、各データ圧縮部を3段階圧縮データの展開のために、3段階におけるパターンフラグを読み込めるように変更を行う。そして、データ出力部における内部のアルゴリズムは、パターンフラグによる塗りつぶし画素位置の判定を1段階分増やせば良い。このような変更を行い、第3段階第1色データ、第3段階第2,3,4色データ、第2段階第2,3,4色データ、第1段階第2,3,4色データを、それぞれモジュール(データ展開部)1801、1802、1803、1804で処理する。これによって、第3段階圧縮データの展開への拡張が中間バッファの追加を抑えながら可能となる。   More specifically, as shown in FIG. 18, each data compression unit is changed so as to be able to read the pattern flag in the three stages in order to expand the three-stage compressed data. The internal algorithm in the data output unit may increase the determination of the fill pixel position by the pattern flag by one step. By making such a change, the third stage first color data, the third stage second, third, fourth color data, the second stage second, third, fourth color data, the first stage second, third, fourth color data Are processed by modules (data development units) 1801, 1802, 1803, and 1804, respectively. As a result, the expansion to the expansion of the third stage compressed data becomes possible while suppressing the addition of the intermediate buffer.

つまり、N段階の圧縮処理を行った圧縮画像データを展開する場合には、N+1個のデータ展開部を備えればよい。この多重化した構成により、N回目の圧縮処理によって得られた代表色を1〜N回目の符号化によって得られたパターンフラグを用いて展開するための代表色復号手段と、1〜M回目(Mは1〜Nのいずれかの整数)の圧縮処理それぞれによって得られた補間色を用いて展開するためのN個の補間色復号手段を実現している。   That is, when decompressing compressed image data that has been subjected to N stages of compression processing, it is sufficient to provide N + 1 data decompressing units. With this multiplexed configuration, the representative color decoding means for expanding the representative color obtained by the Nth compression process using the pattern flag obtained by the 1st to Nth encoding, and the 1st to Mth ( N is an interpolation color decoding means for developing using the interpolation colors obtained by each of the compression processes (M is an integer from 1 to N).

また、本発明の展開部においては、画像によっては、一部のデータ展開部に処理が集中する場合がある。このような状況に対し、各データ展開部を同一構成にすれば、いずれのデータ展開部においても使用可能なデータ展開部として機能させることが可能になり、負荷分散するように構成しても構わない。   In the development unit of the present invention, depending on the image, processing may be concentrated on some data development units. In such a situation, if each data development unit has the same configuration, it can function as a data development unit that can be used in any data development unit, and may be configured to distribute the load. Absent.

[第二実施形態]
第一実施形態においては、各ブロックを圧縮したデータを出力する場合、パターンフラグに加えて、必ず第1色データが出力され、メモリに書き出される。本発明で記載している圧縮形態においては、図4のパターンフラグの定義に加え、リピートフラグというパターンフラグ“F”を定義して使用することも可能である。これは、ブロック圧縮時に1回前に処理を行ったブロックと同一の色の配置(配置パターン)のブロックに対しては、パターンフラグとしてリピートフラグ“F”を出力するが、第1色データおよび第2,3,4色データはメモリへ出力しないようにする。
[Second Embodiment]
In the first embodiment, when outputting data obtained by compressing each block, first color data is always output in addition to the pattern flag, and is written to the memory. In the compression mode described in the present invention, in addition to the definition of the pattern flag of FIG. 4, it is also possible to define and use a pattern flag “F” called a repeat flag. This is because the repeat flag “F” is output as a pattern flag for a block having the same color arrangement (arrangement pattern) as the block processed once before the block compression. The second, third, and fourth color data are not output to the memory.

これによって、圧縮後のメモリ出力するデータ量をさらに削減することができる。なお、ここでの1回前のブロックとは、例えばラスタ順でブロック処理している場合、着目ブロックに隣接した処理済みのブロックとなる。このとき、処理の順番が基準となるため、例えば着目ブロックの上に位置するなど着目ブロックに対していずれの位置にあっても構わない。また、パターンフラグにリピートフラグを追加する場合、本実施形態においてパターンフラグを4ビットで表しているが、通常のパターンフラグ15種に加え、リピートフラグ1種を加えても、パターンフラグのデータ量(4ビット)に変動は生じない。   As a result, the amount of data output to the memory after compression can be further reduced. Note that the previous block here is a processed block adjacent to the block of interest when, for example, block processing is performed in raster order. At this time, since the processing order is a reference, the position may be any position with respect to the block of interest, for example, located on the block of interest. In addition, when a repeat flag is added to a pattern flag, the pattern flag is represented by 4 bits in the present embodiment. However, even if one repeat flag is added in addition to 15 normal pattern flags, the data amount of the pattern flag There is no change in (4 bits).

第二実施形態では、このリピートフラグが混在した圧縮データの展開フローについて説明を行う。また、第二実施形態では、圧縮時に、最終圧縮段階においてのみリピートフラグを付加され、且つ、主走査ラインの先頭ブロックにはリピートフラグは付加しないものとする。すなわち、2段階で圧縮するように構成した場合、図21の画像データ2100を例とすると、第1段階圧縮した後の第1段階圧縮ブロックである画像データ2101にはリピートフラグは設定されない。一方、これを第2段階圧縮(最終段階の圧縮)する際に左隣のブロックと同じ色配置のブロックがあれば、当該ブロックに対するパターンフラグにリピートフラグ“F”が設定される。例えば、図21の第2段階圧縮ブロック2102で、“R”と記載されたブロックがリピートフラグ“F”が設定されたブロックであったとする。すなわち、リピートフラグ“F”により、ブロックS2_04はブロックS2_00の繰り返しであることを意味し、また、ブロックS2_44はブロックS2_40の繰り返しであることを意味している。ここで、第2段階圧縮ブロックのブロックS2_44は、第1段階圧縮時に生成された第1色を元にリピートフラグを付与すべきブロックであるか判定される。すなわち、ブロックS2_40とブロックS2_44は、図21の画像データ2100に示されるように、元の画像パターンが異なるにもかかわらず、第1段階圧縮後の第1色で構成される画像データ2101におけるブロックの色配置が同じため、ブロックS2_44にリピートフラグが設定される。この第2段階圧縮ブロック化された時のメモリ上の圧縮データの状態は図22(a)、(b)のように表される。   In the second embodiment, a decompression flow of compressed data in which repeat flags are mixed will be described. Further, in the second embodiment, at the time of compression, a repeat flag is added only in the final compression stage, and a repeat flag is not added to the head block of the main scanning line. That is, when the image data 2100 shown in FIG. 21 is taken as an example in the case where the image data 2100 shown in FIG. On the other hand, if this is the second stage compression (final stage compression) and there is a block having the same color arrangement as the left adjacent block, the repeat flag “F” is set in the pattern flag for that block. For example, in the second stage compressed block 2102 of FIG. 21, it is assumed that the block described as “R” is a block in which the repeat flag “F” is set. That is, the repeat flag “F” means that the block S2_04 is a repetition of the block S2_00, and the block S2_44 is a repetition of the block S2_40. Here, it is determined whether the block S2_44 of the second stage compressed block is a block to which a repeat flag should be added based on the first color generated during the first stage compression. That is, the block S2_40 and the block S2_44 are blocks in the image data 2101 composed of the first color after the first stage compression, although the original image pattern is different, as shown in the image data 2100 of FIG. Since the same color arrangement is set, a repeat flag is set in the block S2_44. The state of the compressed data on the memory when the second-stage compressed block is formed is expressed as shown in FIGS.

第1段階圧縮時の処理対象となる画像データ2100において、各ブロックの左上画素の画素値を第1色データとすると、第1段階第2,3,4色データは画素23,27,43,45,47,63,65,67の画素値が第1段階第2,3,4色格納部2205に格納される。また、第1段階圧縮時のパターンフラグは第1段階パターンフラグ格納部2201に格納される。また、第2段階圧縮時の処理対象となる画像データ2101において、各ブロックの左上画素の画素値を第1色とするが、左上ブロックと右上ブロックは同じ色配置になっており、左下ブロックと右下ブロックも同じ色配置となっている。したがって、第2段階第1色データは、画素00,40の画素値のみが第2段階第1色格納部2203に格納され、同一色を有しリピートフラグが付与されるブロックの画素04,44の画素値は格納されない。   In the image data 2100 to be processed in the first stage compression, if the pixel value of the upper left pixel of each block is the first color data, the first stage second, third, and fourth color data are the pixels 23, 27, 43, Pixel values of 45, 47, 63, 65, and 67 are stored in the first stage second, third, and fourth color storage unit 2205. In addition, the pattern flag at the time of the first stage compression is stored in the first stage pattern flag storage unit 2201. In the image data 2101 to be processed in the second stage compression, the pixel value of the upper left pixel of each block is the first color, but the upper left block and the upper right block have the same color arrangement, and the lower left block and The lower right block has the same color arrangement. Accordingly, in the second stage first color data, only the pixel values of the pixels 00 and 40 are stored in the second stage first color storage unit 2203, and the pixels 04 and 44 of the block having the same color and the repeat flag are given. No pixel value is stored.

第2段階第2,3,4色データは、画素22の画素値は第2段階第2,3,4色格納部2204に格納されるが、リピートフラグが付加されるブロックの画素26の画素値はメモリ格納されない。また、第2段階圧縮時のパターンフラグは第2段階パターンフラグ格納部2202に格納され、このとき同じ色配置と判定されたブロックについてはリピートフラグ“F”が付与される。   In the second stage second, third, and fourth color data, the pixel value of the pixel 22 is stored in the second stage second, third, and fourth color storage unit 2204, but the pixel of the pixel 26 of the block to which the repeat flag is added. The value is not stored in memory. Further, the pattern flag at the time of the second stage compression is stored in the second stage pattern flag storage unit 2202, and a repeat flag “F” is given to the blocks determined to have the same color arrangement at this time.

このようにして多段階圧縮された圧縮データを、図9の展開部211で展開する時の動作について説明する。なお、フローの説明は、既に説明済みの図13を元に、差分だけを詳細に説明する。ここで、各データ展開部900,910,920は、リピートフラグ処理のために、前に処理されたブロックの画素値を保持するためのバッファを有するものとする。   The operation when the compressed data compressed in multiple stages in this way is expanded by the expansion unit 211 of FIG. 9 will be described. The flow will be described in detail only for the differences based on FIG. 13 that has already been described. Here, each data development unit 900, 910, and 920 has a buffer for holding the pixel value of the previously processed block for the repeat flag processing.

まず、第2段階第1色を展開するデータ展開部900は、S1304の塗りつぶし画素の特定時に、第2段階パターンフラグがリピートフラグか否かを判定し、リピートフラグでなかった場合は、第一実施形態で説明した通常処理を行う。リピートフラグだった場合、データ展開部900は以下のように動作する。   First, the data development unit 900 that develops the second stage first color determines whether or not the second stage pattern flag is a repeat flag at the time of specifying the fill pixel in S1304. The normal processing described in the embodiment is performed. If it is a repeat flag, the data expansion unit 900 operates as follows.

第2段階第1色の展開を行うデータ展開部900は、リピートフラグを受信すると、データDMAC903から受信したデータではなく、バッファに格納された前ブロックの第1色データをS1307の転送データとして使用する。第2段階第2,3,4色の展開を行うデータ展開部910は、リピートフラグを受信すると、データDMAC913から受信したデータではなく、バッファに格納された前ブロックの第2,3,4色データをS1328の転送データとして使用する。一方、第1段階第2,3,4色の展開を行うデータ展開部920は、第2段階リピートフラグを読み込まず、それに依存した処理を行わないので、第一実施形態と同じ処理を行う。   When receiving the repeat flag, the data development unit 900 that performs the second stage first color development uses the first color data of the previous block stored in the buffer as the transfer data in S1307, not the data received from the data DMAC 903. To do. When receiving the repeat flag, the data expansion unit 910 that expands the second, second, third, and fourth colors, instead of the data received from the data DMAC 913, receives the second, third, and fourth colors of the previous block stored in the buffer. The data is used as transfer data in S1328. On the other hand, the data development unit 920 that develops the first-stage second, third, and fourth colors does not read the second-stage repeat flag and does not perform processing dependent on the second-stage repeat flag, and thus performs the same processing as in the first embodiment.

以上の処理によって、リピートフラグが混在する圧縮データに対しても、図9の展開部211は圧縮データの展開処理を行うことができる。これにより、第一実施形態と同様の効果を得ることができる。   Through the above processing, the decompression unit 211 of FIG. 9 can perform decompression processing of compressed data even for compressed data in which repeat flags are mixed. Thereby, the effect similar to 1st embodiment can be acquired.

<その他の実施形態>
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。
<Other embodiments>
The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, or the like) of the system or apparatus reads the program. It is a process to be executed.

Claims (5)

画像データを2×2画素サイズのブロックごとに分割し、当該分割された各ブロックにおける所定の位置の画素の画素値を代表色、前記各ブロックにおける代表色以外の画素値を補間色、前記各ブロックにおける前記代表色と前記補間色の配置パターンを配置情報として取得し、前記代表色と前記補間色と前記配置情報とをそれぞれ異なる記憶領域に記憶する符号化手段により、N−1回目(Nは2以上の整数)の符号化により得られた代表色からなる画像データに対してN回目の符号化を行うことで得られた圧縮データを復号する画像処理装置であって、
前記符号化手段によるN回目の符号化によって得られた代表色を展開すべき位置を、前記符号化手段による1〜N回目の符号化によって得られた配置情報それぞれに基づいて特定し、当該特定した位置に前記代表色を展開する代表色復号手段と、
前記符号化手段によるM回目(Mは1〜Nのいずれかの整数)の符号化によって得られた補間色を展開すべき位置を、前記符号化手段による1〜M回目の符号化によって得られた配置情報それぞれに基づいて特定し、当該特定した位置に前記M回目の符号化によって得られた補間色を展開するN個の補間色復号手段と
を有し、
前記代表色復号手段と、前記N個の補間色復号手段は、それぞれ独立して動作することを特徴とする画像処理装置。
The image data is divided into blocks each having a 2 × 2 pixel size, the pixel value of a pixel at a predetermined position in each of the divided blocks is a representative color, the pixel values other than the representative color in each block are interpolated colors, The arrangement pattern of the representative color and the interpolation color in the block is acquired as arrangement information, and the representative means, the interpolation color, and the arrangement information are stored in different storage areas, respectively, by encoding means N−1th (N Is an image processing apparatus that decodes compressed data obtained by performing the N-th encoding on image data composed of representative colors obtained by encoding (an integer of 2 or more),
The position where the representative color obtained by the Nth encoding by the encoding means is to be developed is specified based on the arrangement information obtained by the 1st to Nth encodings by the encoding means, and the identification Representative color decoding means for expanding the representative color at the position,
The position where the interpolation color obtained by the Mth encoding (M is an integer from 1 to N) by the encoding unit is to be developed is obtained by the 1st to Mth encoding by the encoding unit. N interpolating color decoding means for identifying each of the arranged arrangement information and expanding the interpolated color obtained by the M-th encoding at the identified position,
The image processing apparatus, wherein the representative color decoding unit and the N interpolation color decoding units operate independently of each other.
前記代表色復号手段は、
前記符号化手段によるN回の符号化によって取得された前記配置情報それぞれを用いて、展開後の画像における前記代表色を展開すべき位置を特定する第一特定手段と、
前記第一特定手段にて特定した前記代表色を展開すべき位置に対応する、前記展開後の画像のデータが格納される展開領域のメモリアドレスを算出する第一メモリアドレス算出手段と、
前記第一メモリアドレス算出手段にて算出した展開領域のメモリアドレスに前記代表色を格納する第一格納手段と
を有することを特徴とする請求項1に記載の画像処理装置。
The representative color decoding means includes:
First specifying means for specifying the position where the representative color in the developed image is to be developed using each of the arrangement information acquired by encoding N times by the encoding means;
First memory address calculation means for calculating a memory address of a development area in which data of the image after development corresponding to a position where the representative color specified by the first specification means is to be developed;
The image processing apparatus according to claim 1, further comprising: a first storage unit that stores the representative color at a memory address of a development area calculated by the first memory address calculation unit.
前記M回目の符号化によって得られた補間色を展開する補間色復号手段は、
前記符号化手段による1〜M回の符号化によって取得された前記配置情報それぞれを用いて、展開後の画像における前記補間色を展開すべき位置を特定する第二特定手段と、
前記第二特定手段によって特定した前記補間色を展開すべき位置に対応する、前記展開後の画像のデータが格納される展開領域のメモリアドレスを算出する第二メモリアドレス算出手段と、
前記第二メモリアドレス算出手段にて算出した展開領域のメモリアドレスに前記M回目の符号化によって得られた補間色を格納する第二格納手段と
を有することを特徴とする請求項1または2に記載の画像処理装置。
Interpolation color decoding means for expanding the interpolation color obtained by the M-th encoding,
Using each of the arrangement information acquired by encoding 1 to M times by the encoding means, a second specifying means for specifying the position where the interpolation color in the developed image is to be developed;
Second memory address calculation means for calculating a memory address of a development area in which data of the image after development corresponding to a position where the interpolation color specified by the second specification means is to be developed;
3. The second storage means for storing the interpolation color obtained by the M-th encoding at the memory address of the development area calculated by the second memory address calculation means. The image processing apparatus described.
画像データを2×2画素サイズのブロックごとに分割し、当該分割された各ブロックにおける所定の位置の画素の画素値を代表色、前記各ブロックにおける代表色以外の画素値を補間色、前記各ブロックにおける前記代表色と前記補間色の配置パターンを配置情報として取得し、前記代表色と前記補間色と前記配置情報とをそれぞれ異なる記憶領域に記憶する符号化手段により、N−1回目(Nは2以上の整数)の符号化により得られた代表色からなる画像データに対してN回目の符号化を行うことで得られた圧縮データを復号する画像処理方法であって、
代表色復号手段が、前記符号化手段によるN回目の符号化によって得られた代表色を展開すべき位置を、前記符号化手段による1〜N回目の符号化によって得られた配置情報それぞれに基づいて特定し、当該特定した位置に前記代表色を展開する代表色復号工程と、
N個の補間色復号手段それぞれが、前記符号化手段によるM回目(Mは1〜Nのいずれかの整数)の符号化によって得られた補間色を展開すべき位置を、前記符号化手段による1〜M回目の符号化によって得られた配置情報それぞれに基づいて特定し、当該特定した位置に前記M回目の符号化によって得られた補間色を展開する補間色復号工程と
を有し、
前記代表色復号手段により実行される前記代表色復号工程と、前記N個の補間色復号手段により実行される前記補間色復号工程は、それぞれ独立して行われることを特徴とする画像処理方法。
The image data is divided into blocks each having a 2 × 2 pixel size, the pixel value of a pixel at a predetermined position in each of the divided blocks is a representative color, the pixel values other than the representative color in each block are interpolated colors, The arrangement pattern of the representative color and the interpolation color in the block is acquired as arrangement information, and the representative means, the interpolation color, and the arrangement information are stored in different storage areas, respectively, by encoding means N−1th (N Is an image processing method for decoding the compressed data obtained by performing the Nth encoding on the image data composed of the representative color obtained by the encoding of 2 or an integer),
The representative color decoding unit determines the position where the representative color obtained by the Nth encoding by the encoding unit should be developed based on the arrangement information obtained by the first to Nth encodings by the encoding unit. A representative color decoding step of developing the representative color at the specified position;
Each of the N interpolation color decoding means uses the encoding means to determine the position where the interpolation color obtained by the M-th encoding (M is an integer from 1 to N) by the encoding means should be developed. An interpolation color decoding step that specifies each of the arrangement information obtained by the 1st to Mth encodings and develops the interpolation color obtained by the Mth encoding at the specified position,
The image processing method, wherein the representative color decoding step executed by the representative color decoding unit and the interpolation color decoding step executed by the N interpolation color decoding units are performed independently.
画像データを2×2画素サイズのブロックごとに分割し、当該分割された各ブロックにおける所定の位置の画素の画素値を代表色、前記各ブロックにおける代表色以外の画素値を補間色、前記各ブロックにおける前記代表色と前記補間色の配置パターンを配置情報として取得し、前記代表色と前記補間色と前記配置情報とをそれぞれ異なる記憶領域に記憶する符号化手段により、N−1回目(Nは2以上の整数)の符号化により得られた代表色からなる画像データに対してN回目の符号化を行うことで得られた圧縮データを復号するために、
コンピュータを、
前記符号化手段によるN回目の符号化によって得られた代表色を展開すべき位置を、前記符号化手段による1〜N回目の符号化によって得られた配置情報それぞれに基づいて特定し、当該特定した位置に前記代表色を展開する代表色復号手段、
前記符号化手段によるM回目(Mは1〜Nのいずれかの整数)の符号化によって得られた補間色を展開すべき位置を、前記符号化手段による1〜M回目の符号化によって得られた配置情報それぞれに基づいて特定し、当該特定した位置に前記M回目の符号化によって得られた補間色を展開するN個の補間色復号手段
として機能させ、
前記代表色復号手段と、前記N個の補間色復号手段は、それぞれ独立して動作させることを特徴とするプログラム。
The image data is divided into blocks each having a 2 × 2 pixel size, the pixel value of a pixel at a predetermined position in each of the divided blocks is a representative color, the pixel values other than the representative color in each block are interpolated colors, The arrangement pattern of the representative color and the interpolation color in the block is acquired as arrangement information, and the representative means, the interpolation color, and the arrangement information are stored in different storage areas, respectively, by encoding means N−1th (N In order to decode the compressed data obtained by performing the N-th encoding on the image data composed of the representative colors obtained by the encoding of
Computer
The position where the representative color obtained by the Nth encoding by the encoding means is to be developed is specified based on the arrangement information obtained by the 1st to Nth encodings by the encoding means, and the identification Representative color decoding means for expanding the representative color at the position,
The position where the interpolation color obtained by the Mth encoding (M is an integer from 1 to N) by the encoding unit is to be developed is obtained by the 1st to Mth encoding by the encoding unit. And based on each of the arrangement information, function as N interpolation color decoding means for expanding the interpolation color obtained by the M-th encoding at the specified position,
The representative color decoding unit and the N interpolation color decoding units operate independently of each other.
JP2010242649A 2010-10-28 2010-10-28 Image processing system, image processing method, and program Withdrawn JP2012095227A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010242649A JP2012095227A (en) 2010-10-28 2010-10-28 Image processing system, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010242649A JP2012095227A (en) 2010-10-28 2010-10-28 Image processing system, image processing method, and program

Publications (1)

Publication Number Publication Date
JP2012095227A true JP2012095227A (en) 2012-05-17

Family

ID=46388064

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010242649A Withdrawn JP2012095227A (en) 2010-10-28 2010-10-28 Image processing system, image processing method, and program

Country Status (1)

Country Link
JP (1) JP2012095227A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020137611A1 (en) * 2018-12-28 2020-07-02 日本電信電話株式会社 Data compression method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020137611A1 (en) * 2018-12-28 2020-07-02 日本電信電話株式会社 Data compression method

Similar Documents

Publication Publication Date Title
JP5393574B2 (en) Image processing apparatus, image processing method, and program
JP5558767B2 (en) Image processing apparatus and processing method thereof
US8849021B2 (en) Image processing apparatus, method, and storage medium for high speed compression processing
US8452083B2 (en) Image processing apparatus, image processing method, and computer-readable medium
US8401287B2 (en) Image processing apparatus and processing method thereof
US8953220B2 (en) Image processing for rotation of compressed image data
JP2011193394A (en) Image processing apparatus, image processing method, and program
US8406517B2 (en) Image processing apparatus and image processing method
JP2012095227A (en) Image processing system, image processing method, and program
US8494261B2 (en) Image processing apparatus, image processing method, and computer-readable medium
JP3346051B2 (en) Image processing device
US8531746B2 (en) Image processing apparatus
JP5441676B2 (en) Image processing apparatus and processing method thereof
JP5643578B2 (en) Image processing apparatus, image processing method, and program
JP5595142B2 (en) Image processing apparatus and image processing method
JP5606223B2 (en) Image processing apparatus and processing method thereof
US8837021B2 (en) Image processing apparatus, control method, and computer-readable medium
JP2013085173A (en) Image processing device and control method therefor
JP2012074897A (en) Image processing device, image processing method, and program
JP2012054789A (en) Image processor, image processing method, and program

Legal Events

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

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20140107