JP2017212601A - Image processing device, image processing method, program, and data - Google Patents

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

Info

Publication number
JP2017212601A
JP2017212601A JP2016104551A JP2016104551A JP2017212601A JP 2017212601 A JP2017212601 A JP 2017212601A JP 2016104551 A JP2016104551 A JP 2016104551A JP 2016104551 A JP2016104551 A JP 2016104551A JP 2017212601 A JP2017212601 A JP 2017212601A
Authority
JP
Japan
Prior art keywords
boundary
area
data
attribute value
attribute
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.)
Granted
Application number
JP2016104551A
Other languages
Japanese (ja)
Other versions
JP6762758B2 (en
Inventor
孝幸 長島
Takayuki Nagashima
孝幸 長島
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 JP2016104551A priority Critical patent/JP6762758B2/en
Publication of JP2017212601A publication Critical patent/JP2017212601A/en
Application granted granted Critical
Publication of JP6762758B2 publication Critical patent/JP6762758B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To improve the performance by reducing a cache mistake at the time of performing processing of an input image in such a configuration that the input image formed of pixels having a color value and an attribute value is encoded, and the encoded input image is decoded for use at the time of processing of the input image.SOLUTION: An image processing device identifies a boundary where a color value changes and a boundary where an attribute value changes in an input image formed of pixels having the color value and the attribute value, generates and outputs data containing a first region storing information indicating the color value and the attribute value of a region partitioned by the boundary and a second region storing the position information of the boundary.SELECTED DRAWING: Figure 3

Description

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

画像を処理する際に、画素の属性を表す属性マップを参照し、属性に応じて処理を変更する画像処理技術が知られている。例えば、スキャンして得られた画像に対して像域分離処理を行い、画素毎に文字領域の画素か写真領域の画素かを示す属性マップ情報を生成し、属性マップ情報に応じて画像処理のパラメータを設定することができる。例えば、文字領域の画素に対してはエッジ強調処理を行うことで文字部分の鮮鋭化を行い、写真領域の画素に対してはスムージング処理を行うことによって、良好な出力画像を得ることが可能となる。   An image processing technique is known in which, when an image is processed, an attribute map representing pixel attributes is referred to and processing is changed according to the attributes. For example, image area separation processing is performed on an image obtained by scanning, attribute map information indicating whether each pixel is a character area pixel or a photographic area pixel is generated, and image processing is performed according to the attribute map information. Parameters can be set. For example, it is possible to obtain a good output image by sharpening the character part by performing edge enhancement processing on the pixels in the character area and smoothing processing on the pixels in the photographic area. Become.

また、異なる属性の画素を含む混在画像の符号化における画質劣化を防ぐために、特許文献1は、次の方法を開示している。第1に、文字線画画素を含む前景画像領域を判定し、前景画像領域の多値画像データから2値画像データを生成して可逆圧縮する。第2に、文字線画画素の位置にある多値画素の値を、非文字線画画素の位置にある多値画素の値を用いて置換し、得られた画像(背景画像)を非可逆圧縮する。第3に、文字線画領域内の画素に対する属性データをあらかじめ設定された値でマスクしてから、属性データを可逆圧縮する。以上の方法により、属性データのデータ量を削減しながら、出力画像の画質を向上させることができる。   Further, Patent Document 1 discloses the following method in order to prevent image quality deterioration in encoding of mixed images including pixels having different attributes. First, a foreground image area including a character / line image pixel is determined, binary image data is generated from multivalued image data in the foreground image area, and lossless compression is performed. Second, the value of the multi-value pixel at the position of the character / line image pixel is replaced with the value of the multi-value pixel at the position of the non-character / line image pixel, and the obtained image (background image) is irreversibly compressed. . Third, the attribute data for the pixels in the character / line drawing area is masked with a preset value, and the attribute data is losslessly compressed. With the above method, the image quality of the output image can be improved while reducing the data amount of the attribute data.

特許第5132530号公報Japanese Patent No. 5132530

しかしながら、特許文献1に記載の方法では、前景画像、背景画像及び属性データがそれぞれ個別に圧縮される。このため、復号時には前景画像の色データ、背景画像の色データ、及び属性データがそれぞれ別々のメモリ領域に展開される。これらのデータを参照して処理を行う際には、色データと属性データとをそれぞれのメモリ領域から読み出す必要がある。また、処理前に色データと属性データとを画素毎に結合する場合であっても、色データと属性データとをそれぞれのメモリ領域から読み出す必要があることに変わりはない。そして、色データと属性データとをそれぞれのメモリ領域から読み出そうとすると、これらのデータを効率よく供給するための二次キャッシュのようなハードウェア資源なしには、キャッシュミスが生じやすくなるという課題があった。   However, in the method described in Patent Document 1, the foreground image, the background image, and the attribute data are individually compressed. For this reason, at the time of decoding, the color data of the foreground image, the color data of the background image, and the attribute data are developed in separate memory areas. When processing is performed with reference to these data, it is necessary to read out the color data and the attribute data from the respective memory areas. Even when color data and attribute data are combined for each pixel before processing, it is still necessary to read color data and attribute data from each memory area. Then, if color data and attribute data are read from the respective memory areas, a cache miss is likely to occur without a hardware resource such as a secondary cache for efficiently supplying these data. There was a problem.

本発明は、色値及び属性値を有する画素で構成される入力画像を符号化しておき、入力画像の処理を行う際には符号化された入力画像を復号して用いる構成において、入力画像の処理を行う際にキャッシュミスを低減し性能を向上させることを目的とする。   The present invention encodes an input image composed of pixels having color values and attribute values, and decodes and uses the encoded input image when processing the input image. The purpose is to reduce cache misses and improve performance when processing.

本発明の目的を達成するために、例えば、本発明の画像処理装置は以下の構成を備える。すなわち、
色値及び属性値を有する画素で構成される入力画像中で、色値が変化する境界及び属性値が変化する境界を特定する特定手段と、
前記境界によって区切られる領域の色値及び属性値を示す情報を格納する第1の領域と、前記境界の位置情報を格納する第2の領域と、を含むデータを生成及び出力する第1の圧縮手段と、
を備える。
In order to achieve the object of the present invention, for example, an image processing apparatus of the present invention comprises the following arrangement. That is,
A specifying means for specifying a boundary where a color value changes and a boundary where an attribute value changes in an input image including pixels having a color value and an attribute value;
First compression for generating and outputting data including a first area for storing information indicating color values and attribute values of an area delimited by the boundary, and a second area for storing position information of the boundary Means,
Is provided.

色値及び属性値を有する画素で構成される入力画像を符号化しておき、入力画像の処理を行う際には符号化された入力画像を復号して用いる構成において、入力画像の処理を行う際にキャッシュミスを低減し性能を向上させることができる。   When an input image composed of pixels having color values and attribute values is encoded, and when the input image is processed, the encoded input image is decoded and used. In addition, cache misses can be reduced and performance can be improved.

一実施形態に係る画像処理システムの構成図。1 is a configuration diagram of an image processing system according to an embodiment. フラットニング処理の概念を説明する図。The figure explaining the concept of a flattening process. 一実施形態に係る符号化部の構成図。The block diagram of the encoding part which concerns on one Embodiment. 一実施形態に係る第2の符号化部の構成図。The block diagram of the 2nd encoding part which concerns on one Embodiment. 中間データに含まれる圧縮されたビットマップデータのメモリイメージ例。An example of a memory image of compressed bitmap data included in intermediate data. ビットマップ内の矩形領域の例及びそこに含まれる領域を示す図。The figure which shows the example of the rectangular area | region in a bitmap, and the area | region contained therein. ビットマップ内の矩形領域の例及び可逆圧縮領域の境界を示す図。The figure which shows the example of the rectangular area | region in a bitmap, and the boundary of a lossless compression area | region. ビットマップ内の矩形領域の例及び非可逆圧縮領域の境界を示す図。The figure which shows the example of the rectangular area | region in a bitmap, and the boundary of an irreversible compression area | region. 可逆圧縮データのフォーマットの一例を示す図。The figure which shows an example of the format of lossless compression data. 一実施形態に係る第2の復号部及び第1の出力部の構成図。The block diagram of the 2nd decoding part and 1st output part which concern on one Embodiment. 一実施形態に係る画像処理方法のフローチャート。5 is a flowchart of an image processing method according to an embodiment.

以下、本発明の実施例を図面に基づいて説明する。ただし、本発明の範囲は以下の実施形態に限定されない。   Embodiments of the present invention will be described below with reference to the drawings. However, the scope of the present invention is not limited to the following embodiments.

以下に説明する、本発明の一実施形態に係る画像処理技術を用いることにより、符号化された画像データを復号した際には、色値と属性値とを持つ画素群で構成される画像データがメモリに展開される。このため、色値と属性値とを画素毎に結合するための処理、又はこの処理を効率化するための追加のハードウェア資源を用いることなく、色値と属性値とを持つ画素群で構成される画像データを効率よく復号後の処理で用いることが可能となる。   Image data composed of pixel groups having color values and attribute values when encoded image data is decoded by using an image processing technique according to an embodiment of the present invention described below. Is expanded in memory. For this reason, a pixel group having a color value and an attribute value is used without using a process for combining the color value and the attribute value for each pixel or an additional hardware resource for improving the efficiency of the process. It is possible to efficiently use the processed image data in the post-decoding process.

本発明に係る画像処理技術は、画像の符号化及び復号に一般的に利用可能である。例えば、コンピュータが画像を符号化し、符号化された画像をプリンタに送信し、プリンタが送信された画像を復号して画像処理を行ってから印刷を行う構成において、画像を符号化及び復号する際に、本発明に係る画像処理技術を適用することができる。以下では、本発明に係る画像処理技術の適用例として、ページ記述言語を用いて記述された印刷データをプリンタに送信し、プリンタは印刷データを中間データに変換して一次的に記憶する場合について説明する。この場合、プリンタは、一時的に記憶している中間データからレンダリングによりビットマップデータである印刷画像を生成し、印刷画像に基づいて印刷処理を行う。   The image processing technique according to the present invention is generally applicable to image encoding and decoding. For example, when encoding and decoding an image in a configuration in which a computer encodes an image, transmits the encoded image to a printer, decodes the transmitted image, performs image processing, and then performs printing. In addition, the image processing technique according to the present invention can be applied. Hereinafter, as an application example of the image processing technology according to the present invention, print data described using a page description language is transmitted to a printer, and the printer converts the print data into intermediate data and temporarily stores the data. explain. In this case, the printer generates a print image that is bitmap data by rendering from the temporarily stored intermediate data, and performs a print process based on the print image.

ここで、中間データには複数の描画要素が含まれており、印刷画像は中間データで定義されている描画要素を合成することにより生成される。また、中間データには、印刷データとして送信されるビットマップや、後述するフラットニング処理により生成されるビットマップのような、いくつかのビットマップが含まれることがある。そして、中間データの記憶領域を節約するためにこのようなビットマップを符号化して圧縮することができる。本発明に係る画像処理技術は、例えば、このようなビットマップの符号化及び復号に適用することができる。   Here, the intermediate data includes a plurality of drawing elements, and the print image is generated by synthesizing the drawing elements defined by the intermediate data. The intermediate data may include several bitmaps such as a bitmap transmitted as print data and a bitmap generated by flattening processing described later. Such a bitmap can be encoded and compressed in order to save a storage area for intermediate data. The image processing technique according to the present invention can be applied to such bitmap encoding and decoding, for example.

また、以下の実施形態では、1つの画像(例えば1つのビットマップ)中に可逆圧縮領域と非可逆圧縮領域とを設定し、可逆圧縮領域の画像のみを可逆圧縮し、非可逆圧縮領域の画像は可逆圧縮しない場合について説明する。しかしながら、本発明に係る画像処理技術は、1つの画像全体を1つの方法で圧縮する場合にも適用可能である。   In the following embodiment, a reversible compression area and an irreversible compression area are set in one image (for example, one bit map), and only the image in the lossless compression area is reversibly compressed. Will be described with respect to a case where lossless compression is not performed. However, the image processing technique according to the present invention can also be applied to a case where an entire image is compressed by a single method.

図1は、本実施形態に係る画像圧縮方法及び画像伸長方法を実行する画像処理システム100の構成の一例を示す。画像処理システム100は、例えば、1台のプリンタであってもよいし、複数の装置により構成される印刷システムであってもよい。図1において、CPU101はシステム全体の制御を行う。また、CPU101は、PDLによって記述された印刷データを、後述するレンダラ105によって解釈される中間データに変換する。この処理を中間データ生成処理という。本実施形態に係る画像圧縮方法は、中間データ生成処理において、圧縮された画像データを含む中間データを生成するために、印刷データに従う画像データを圧縮するために適用される。一実施形態において、CPU101は、中間データに含まれるビットマップを圧縮する。   FIG. 1 shows an example of the configuration of an image processing system 100 that executes an image compression method and an image expansion method according to the present embodiment. The image processing system 100 may be, for example, a single printer or a printing system including a plurality of devices. In FIG. 1, a CPU 101 controls the entire system. Further, the CPU 101 converts print data described in PDL into intermediate data that is interpreted by a renderer 105 described later. This process is called intermediate data generation process. The image compression method according to the present embodiment is applied to compress image data according to print data in order to generate intermediate data including compressed image data in the intermediate data generation process. In one embodiment, the CPU 101 compresses a bitmap included in the intermediate data.

RAM102は、例えばメモリコントローラとDRAMを備える。RAM102にはプログラムを展開することができ、CPU101がRAM102に展開されたプログラムに従って処理を行うことにより、後述する動作を実現できる。また、RAM102は、CPU101及び画像処理システム100上で動作する符号化部301のワークメモリとして使用することができる。さらに、RAM102は、印刷データ、中間データ、及び印刷画像を記憶することができる。   The RAM 102 includes, for example, a memory controller and a DRAM. A program can be expanded in the RAM 102, and the CPU 101 performs processing according to the program expanded in the RAM 102, whereby an operation described later can be realized. The RAM 102 can be used as a work memory for the encoding unit 301 that operates on the CPU 101 and the image processing system 100. Further, the RAM 102 can store print data, intermediate data, and print images.

ROM103はプログラムを記憶している。CPU101はこのプログラムに従って処理を行うことができる。外部インタフェース(IF)104は、画像処理システム100を外部機器と接続するインタフェースである。外部IF104を介して、Ethernet又はUSB等の技術を用いることにより、画像処理システム100は外部機器とデータを送受信することができる。レンダラ105は、レンダリング処理を行って中間データを印刷画像に変換する。   The ROM 103 stores a program. The CPU 101 can perform processing according to this program. An external interface (IF) 104 is an interface for connecting the image processing system 100 to an external device. By using a technology such as Ethernet or USB via the external IF 104, the image processing system 100 can transmit and receive data to and from an external device. The renderer 105 performs rendering processing to convert intermediate data into a print image.

画像処理装置106は、印刷画像に対する画像処理を行う。例えば、画像処理装置106は、印刷画像に対して高画質処理を行ったり、印刷画像を印刷装置107に入力可能なデータフォーマットに変換したりすることができる。印刷画像の各画素が属性値を有している場合、属性値を参照して高精度の高画質処理を行うことができる。一例として、文字属性を有する画素に対してはエッジ強調処理を、写真属性を有する画素に対してはスムージング処理を行うことができる。もっとも、画像処理装置106は、レンダラ105により復号されたビットマップに対して高画質処理を行ってもよい。印刷装置107は、電子情報である印刷画像に基づいて、トナーやインクを紙面に定着させて、紙面に画像を形成する。   The image processing device 106 performs image processing on the print image. For example, the image processing apparatus 106 can perform high-quality image processing on a print image or convert the print image into a data format that can be input to the printing apparatus 107. When each pixel of the print image has an attribute value, high-accuracy image quality processing can be performed with reference to the attribute value. As an example, edge enhancement processing can be performed on pixels having character attributes, and smoothing processing can be performed on pixels having photo attributes. However, the image processing apparatus 106 may perform high image quality processing on the bitmap decoded by the renderer 105. The printing apparatus 107 forms toner images on the paper surface by fixing toner and ink on the paper surface based on the print image that is electronic information.

インターコネクト108は、CPU101、外部IF104、レンダラ105、画像処理装置106、印刷装置107、RAM102、及びROM103間のデータ転送経路である。インターコネクト108は、共有バスやスイッチ等を用いて構成することができる。   The interconnect 108 is a data transfer path between the CPU 101, the external IF 104, the renderer 105, the image processing device 106, the printing device 107, the RAM 102, and the ROM 103. The interconnect 108 can be configured using a shared bus, a switch, or the like.

レンダラ105は、画像復号装置及び中間データ処理装置を備える。画像復号装置は、制御部109、第1の復号部110、第2の復号部111、及び第1の出力部112を備える。中間データ処理装置は、制御部109、描画部113、及び第2の出力部114を備える。図1の例において、制御部109は画像復号装置と中間データ処理装置に共通の構成要素であるが、画像復号装置と中間データ処理装置がそれぞれ制御部を有していてもよい。   The renderer 105 includes an image decoding device and an intermediate data processing device. The image decoding apparatus includes a control unit 109, a first decoding unit 110, a second decoding unit 111, and a first output unit 112. The intermediate data processing apparatus includes a control unit 109, a drawing unit 113, and a second output unit 114. In the example of FIG. 1, the control unit 109 is a component common to the image decoding device and the intermediate data processing device, but the image decoding device and the intermediate data processing device may each have a control unit.

制御部109は、中間データからレンダラ制御情報を読み出し、このレンダラ制御情報に従ってレンダラ105を制御する。具体的には、制御部109は、第1の復号部110、第2の復号部111、第1の出力部112、描画部113、及び第2の出力部114に制御情報を転送することにより、これらの各部を制御する。   The control unit 109 reads renderer control information from the intermediate data, and controls the renderer 105 according to the renderer control information. Specifically, the control unit 109 transfers control information to the first decoding unit 110, the second decoding unit 111, the first output unit 112, the drawing unit 113, and the second output unit 114. Control each of these parts.

第1の復号部110は、中間データに含まれる非可逆圧縮データを読み出して復号する。非可逆圧縮データの復号により、画素ごとの色値を含む画素データを得ることができる。そして、第1の復号部110は、復号により得られた色値で構成される画素データを第2の復号部111に転送する。   The first decoding unit 110 reads and decodes the irreversible compressed data included in the intermediate data. By decoding the lossy compressed data, pixel data including color values for each pixel can be obtained. Then, the first decoding unit 110 transfers pixel data composed of color values obtained by decoding to the second decoding unit 111.

第2の復号部111は、中間データに含まれる可逆圧縮データを読み出し復号する。非可逆圧縮データの復号により、画素ごとに色値及び属性値を含む画素データを得ることができる。そして、第2の復号部111は、復号により得られた画素データと、第1の復号部111から転送された画素データとを、第1の出力部112に転送する。第1の出力部112は、転送された画素データを、例えばRAM102等の所定のメモリ領域に書き出す。第1の出力部112は、可逆圧縮領域の画素については第2の復号部が復号した色値と属性値とを出力し、非可逆圧縮領域の画素については第1の復号部が復号した色値と第2の復号部が復号した属性値とを出力することができる。   The second decoding unit 111 reads and decodes the lossless compressed data included in the intermediate data. By decoding the lossy compressed data, pixel data including a color value and an attribute value can be obtained for each pixel. Then, the second decoding unit 111 transfers the pixel data obtained by the decoding and the pixel data transferred from the first decoding unit 111 to the first output unit 112. The first output unit 112 writes the transferred pixel data in a predetermined memory area such as the RAM 102. The first output unit 112 outputs the color value and attribute value decoded by the second decoding unit for the pixels in the lossless compression region, and the color decoded by the first decoding unit for the pixels in the lossy compression region. The value and the attribute value decoded by the second decoding unit can be output.

描画部113は、RAM102に記憶されている中間データに従って、印刷画像を構成する画素データを生成する。例えば、描画部113は、中間データで定義されている描画要素の合成処理により、印刷画像を生成することができる。具体的には、描画部113は、中間データから、描画要素の境界情報、塗り情報、及び合成情報を読み出し、重なり合う描画要素を合成することができる。描画部113は、そして、生成した画素データを第2の出力部114に転送する。具体的な合成処理の一例としては、画素ごとに、描画要素の色値と属性値である透過率を入力として用いて、所定の計算式に従ってその座標を占める複数の描画要素の色値を合成する方法がある。このような色合成方法はαブレンドと呼ばれ、広く知られている。第2の出力部114は、描画部113から転送された画素データを、例えばRAM102等の所定のアドレスに転送する。   The drawing unit 113 generates pixel data constituting a print image according to the intermediate data stored in the RAM 102. For example, the drawing unit 113 can generate a print image by a combining process of drawing elements defined by intermediate data. Specifically, the drawing unit 113 can read the boundary information, the paint information, and the synthesis information of the drawing elements from the intermediate data and synthesize overlapping drawing elements. The drawing unit 113 then transfers the generated pixel data to the second output unit 114. As an example of specific synthesis processing, for each pixel, the color value of the drawing element and the transmittance that is the attribute value are used as inputs, and the color values of a plurality of drawing elements that occupy the coordinates are synthesized according to a predetermined calculation formula. There is a way to do it. Such a color synthesis method is called α blend and is widely known. The second output unit 114 transfers the pixel data transferred from the drawing unit 113 to a predetermined address such as the RAM 102, for example.

中間データに圧縮ビットマップが含まれている場合、制御部109は、中間データに含まれるレンダラ制御情報に従って、圧縮ビットマップの復号制御情報を第1の復号部110および第2の復号部111に転送する。第1の復号部110及び第2の復号部111は、復号制御情報に従って圧縮ビットマップを復号し、第1の出力部112を介してRAM102に転送する。   When the compressed data is included in the intermediate data, the control unit 109 transmits the decoded bitmap decoding control information to the first decoding unit 110 and the second decoding unit 111 according to the renderer control information included in the intermediate data. Forward. The first decoding unit 110 and the second decoding unit 111 decode the compressed bitmap according to the decoding control information, and transfer it to the RAM 102 via the first output unit 112.

次に、制御部109は、中間データに含まれるレンダラ制御情報に従って、描画部113に制御情報を転送する。描画部113は、第1の復号部110及び第2の復号部111によって復号され、第1の出力部112によってRAM102に転送されているビットマップを読み込み、他の描画要素との合成処理を行う。さらに、合成処理によって得られた、画素データを第2の出力部114に転送する。第2の出力部114は、RAM102の所定のアドレスに、画素データを書き出す。以上のレンダリング処理によって、中間データは印刷画像に変換され、RAM102に記録される。   Next, the control unit 109 transfers the control information to the drawing unit 113 according to the renderer control information included in the intermediate data. The drawing unit 113 reads the bitmap decoded by the first decoding unit 110 and the second decoding unit 111 and transferred to the RAM 102 by the first output unit 112, and performs a synthesis process with other drawing elements. . Further, the pixel data obtained by the synthesis process is transferred to the second output unit 114. The second output unit 114 writes pixel data to a predetermined address in the RAM 102. Through the above rendering process, the intermediate data is converted into a print image and recorded in the RAM 102.

中間データに含まれるビットマップとしては、印刷データに最初から含まれているビットマップと、フラットニング処理という部分レンダリング処理によって生成されるビットマップと、がある。   As the bitmap included in the intermediate data, there are a bitmap included in the print data from the beginning and a bitmap generated by a partial rendering process called a flattening process.

ここで、フラットニング処理について述べる。CPU101により実行される中間データ生成処理は、指定されたサイズのメモリ領域を使って動作する。一方、中間データ生成処理では、多くの描画要素を含んでいたり、複雑な描画要素を含んでいたりする領域を処理する際に、処理に必要なメモリが足りなくなることがある。そこで、割り当てられたメモリが所定領域についての処理を行うのに不十分である場合、複数の描画要素についてビットマップ化処理及びαブレンド処理を行うことで、この領域のビットマップが生成される。この処理をフラットニング処理と呼ぶ。   Here, the flattening process will be described. The intermediate data generation process executed by the CPU 101 operates using a memory area having a specified size. On the other hand, in the intermediate data generation process, when processing an area that includes many drawing elements or a complicated drawing element, there may be a shortage of memory necessary for the process. Therefore, when the allocated memory is insufficient to perform the process for the predetermined area, the bitmap of this area is generated by performing the bitmap process and the α blend process for the plurality of drawing elements. This process is called flattening process.

フラットニング時には、フラットニングの対象となる描画要素の属性値を参照して、ビットマップに対応する属性値が生成される。属性値は、ビットマップの各画素についての属性を示し、例えば各画素に対応する描画要素の種類や、各画素の透過率等を含むことができる。本実施形態において、属性値は、例えば、ビットマップの各画素に対応する描画要素の種類を示す領域属性マップや、ビットマップの各画素に対応する透過率αを示す透過率マップ等として表される。また、中間データに含まれるビットマップは、多くの場合圧縮符号化される。そして、フラットニング処理で生成された属性値も、対応するビットマップとともに圧縮符号化される。属性値は、このように画像処理システム100によって生成されてもよいが、印刷データにビットマップとともに最初から含まれていてもよい。   At the time of flattening, the attribute value corresponding to the bitmap is generated with reference to the attribute value of the drawing element to be flattened. The attribute value indicates an attribute for each pixel of the bitmap, and can include, for example, the type of drawing element corresponding to each pixel, the transmittance of each pixel, and the like. In the present embodiment, the attribute value is represented as, for example, an area attribute map indicating the type of drawing element corresponding to each pixel of the bitmap, a transmittance map indicating the transmittance α corresponding to each pixel of the bitmap, or the like. The In addition, the bitmap included in the intermediate data is often compressed and encoded. The attribute value generated by the flattening process is also compression encoded together with the corresponding bitmap. The attribute value may be generated by the image processing system 100 as described above, but may be included in the print data from the beginning together with the bitmap.

図2は、フラットニング処理の概念を示す。図2は、処理対象の矩形領域201、透過率0のビットマップ202、透過率0の円形のグラフィック図形203、透過率0.5の三角形のグラフィック図形204、透過率0のテキスト205が示されている。フラットニング処理により、ビットマップ206が生成される。   FIG. 2 shows the concept of the flattening process. FIG. 2 shows a rectangular area 201 to be processed, a bitmap 202 with 0 transmittance, a circular graphic figure 203 with 0 transmittance, a triangular graphic figure 204 with 0.5 transmittance, and a text 205 with 0 transmittance. ing. A bitmap 206 is generated by the flattening process.

具体的には、フラットニング処理により、ビットマップ202、円形のグラフィック図形203、三角形のグラフィック図形204、及びテキスト205は順次重ね合わせられ、ビットマップ206が生成される。また、この際には、以下のような領域属性マップも生成される。すなわち、描画要素202、203、204、205のいずれも存在しない領域の画素には、背景属性が割り当てられる。ビットマップ202のみが存在する領域の画素には、ビットマップ画像属性が割り当てられる。グラフィック図形203のみが存在する領域と、グラフィック図形204のみが存在する領域と、グラフィック図形203及びグラフィック図形204が重なった領域と、の画素にはグラフィック属性が割り当てられる。ビットマップ202とグラフィック図形204とが重なった領域の画素には、所定の演算に従って決定された属性が割り当てられる。ビットマップ202とテキスト205とが重なった領域の画素には、テキスト属性が割り当てられる。   Specifically, the bitmap 202, the circular graphic figure 203, the triangular graphic figure 204, and the text 205 are sequentially overlapped by flattening processing to generate a bitmap 206. At this time, the following region attribute map is also generated. That is, a background attribute is assigned to a pixel in a region where none of the drawing elements 202, 203, 204, and 205 exists. A bitmap image attribute is assigned to a pixel in an area where only the bitmap 202 exists. Graphic attributes are assigned to pixels of an area where only the graphic figure 203 exists, an area where only the graphic figure 204 exists, and an area where the graphic figure 203 and the graphic figure 204 overlap. Attributes determined according to a predetermined calculation are assigned to pixels in an area where the bitmap 202 and the graphic figure 204 overlap. Text attributes are assigned to pixels in the area where the bitmap 202 and text 205 overlap.

さらに、フラットニング処理によりビットマップ206を生成する際には、以下のような透過率マップも生成される。すなわち、描画要素202、203、204、205のいずれも存在しない領域の画素には、透過率として1が設定される。グラフィック図形204のみが存在する領域の画素には、透過率として0.5が設定される。その他の領域は、透過率0の描画要素が占めるか、透過率0の描画要素を含む描画要素が重ね合わされているため、これらの領域の画素には透過率として0が設定される。   Further, when the bitmap 206 is generated by flattening processing, the following transmittance map is also generated. That is, 1 is set as the transmittance for the pixels in the region where none of the drawing elements 202, 203, 204, and 205 exists. For the pixels in the area where only the graphic figure 204 exists, 0.5 is set as the transmittance. Since the other area is occupied by a drawing element having a transmittance of 0 or a drawing element including a drawing element having a transmittance of 0 is overlapped, 0 is set as the transmittance of pixels in these areas.

このように、フラットニングによって生成されるビットマップは、異なる属性値を有する複数の領域によって構成され得る。そして、フラットニングによって生成されたビットマップを用いて印刷画像を生成する際には、ビットマップの色値と属性値(透過率)との双方が必要となる。このように、本実施形態に係る画像処理技術は、フラットニングによって生成されたビットマップの圧縮に適用することができる。   In this way, the bitmap generated by flattening can be composed of a plurality of regions having different attribute values. When a print image is generated using a bitmap generated by flattening, both the color value and attribute value (transmittance) of the bitmap are required. As described above, the image processing technique according to the present embodiment can be applied to compression of a bitmap generated by flattening.

以下では、各画素が属性値として透過率を有するビットマップの符号化について主に説明する。しかしながら、属性値は透過率に限られず、例えば前述したように文字領域の画素か写真領域の画素かを示す領域情報であってもよい。また、各画素が2つ以上の属性値の組み合わせを有していてもよい。   In the following, encoding of a bitmap in which each pixel has a transparency as an attribute value will be mainly described. However, the attribute value is not limited to the transmittance, and may be, for example, area information indicating whether the pixel is a character area pixel or a photographic area pixel as described above. Each pixel may have a combination of two or more attribute values.

図3は、本実施形態に係る画像圧縮方法を実現する符号化部の構成の一例を示す。符号化部301は、領域分割部302、画像置換部303、第1の符号化部304、属性結合部305、及び第2の符号化部306を備える。これらの各部の機能は、例えばROM103等に格納されているプログラムを、RAM102等のメモリに展開し、展開されたプログラムに従ってCPU101等のプロセッサが動作することにより実現できる。   FIG. 3 shows an example of the configuration of an encoding unit that implements the image compression method according to the present embodiment. The encoding unit 301 includes an area dividing unit 302, an image replacing unit 303, a first encoding unit 304, an attribute combining unit 305, and a second encoding unit 306. The functions of these units can be realized by, for example, expanding a program stored in the ROM 103 or the like in a memory such as the RAM 102 and operating a processor such as the CPU 101 according to the expanded program.

符号化部301には、色値及び属性値を有する画素で構成される入力画像が入力される。この入力画像は、中間データに含まれるビットマップであり、例えば印刷データに含まれているビットマップ、又はフラットニング処理によって生成されたビットマップ等でありうる。以下の説明において、入力画像はRGB各8ビットのビットマップであるものとする。この入力画像は、RAM102上には、以下の順に、各画素の色値(RGB値)が記録されている。   The encoding unit 301 receives an input image composed of pixels having color values and attribute values. This input image is a bitmap included in the intermediate data, and can be, for example, a bitmap included in the print data, a bitmap generated by flattening processing, or the like. In the following description, it is assumed that the input image is an RGB 8-bit bitmap. In this input image, the color values (RGB values) of the respective pixels are recorded on the RAM 102 in the following order.

R(0,0)、G(0,0)、B(0,0)、R(1,0)G(1,0)B(1,0)、……、R(X−max,0)、G(X−max,0)、B(X−max,0)、R(0,1)、G(0,1)、B(0,1)、R(1,1)、G(1,1)、B(1,1)、……、R(X−max,1)、G(X−max,1)、B(X−max,1)、……、R(0,Y−max)、G(0,Y−max)、B(0,Y−max)、R(1,Y−max)、G(1,Y−max)、B(1,Y−max)、……、R(X−max,Y−max)、G(X−max,Y−max)、B(X−max,Y−max)   R (0, 0), G (0, 0), B (0, 0), R (1, 0) G (1, 0) B (1, 0), ..., R (X-max, 0 ), G (X-max, 0), B (X-max, 0), R (0, 1), G (0, 1), B (0, 1), R (1, 1), G ( 1, 1), B (1, 1), ..., R (X-max, 1), G (X-max, 1), B (X-max, 1), ..., R (0, Y) -Max), G (0, Y-max), B (0, Y-max), R (1, Y-max), G (1, Y-max), B (1, Y-max), ... ..., R (X-max, Y-max), G (X-max, Y-max), B (X-max, Y-max)

ここで、R(X,Y)、G(X,Y)、B(X,Y)は、それぞれビットマップの座標(X,Y)にある画素のRGB値を示す。また、入力画像の幅又は高さが例えば16の倍数でない場合は、16の倍数となるように画像の右端と下端に所定の色値及び属性値を有する画素がパディングされる。X−maxは入力画像の右端画素のX座標であり、16m−1(mは自然数)で表される。Y−maxは入力画像の下端画素のY座標であり、16n−1(nは自然数)で表される。   Here, R (X, Y), G (X, Y), and B (X, Y) indicate the RGB values of the pixels at the coordinates (X, Y) of the bitmap, respectively. Further, when the width or height of the input image is not a multiple of 16, for example, pixels having predetermined color values and attribute values are padded at the right end and the lower end of the image so as to be a multiple of 16. X-max is the X coordinate of the rightmost pixel of the input image, and is represented by 16m-1 (m is a natural number). Y-max is the Y coordinate of the lower end pixel of the input image, and is represented by 16n-1 (n is a natural number).

また、以下の説明において、属性値を示す入力属性データは各画素8ビットの透過率マップであるものとする。RAM102上には、以下の順に、各画素の透過率が記録されている。以下において、α(X,Y)は、それぞれビットマップの座標(X,Y)にある画素の透過率αを示す。   In the following description, it is assumed that input attribute data indicating an attribute value is an 8-bit transmittance map for each pixel. On the RAM 102, the transmittance of each pixel is recorded in the following order. In the following, α (X, Y) indicates the transmittance α of the pixel at the coordinate (X, Y) of the bitmap.

α(0,0)、α(1,0)、……、α(X−max,0)、α(0,1)、α(1,1)、……、α(X−max,1)、……、α(0,Y−max)、α(1,Y−max)、……、α(X−max,Y−max)   α (0,0), α (1,0),..., α (X−max, 0), α (0,1), α (1,1),. ), ..., α (0, Y-max), α (1, Y-max), ..., α (X-max, Y-max)

領域分割部302は、入力画像中に、可逆圧縮領域と非可逆圧縮領域とを設定する。こうして、領域分割部302は、入力画像を非可逆圧縮領域と可逆圧縮領域とに分割する。また、領域分割部302は、入力画像のそれぞれの画素について、非可逆圧縮領域か可逆圧縮領域かを識別するための領域特定情報を生成する。   The area dividing unit 302 sets a lossless compression area and a lossy compression area in the input image. Thus, the region dividing unit 302 divides the input image into an irreversible compression region and a lossless compression region. The area dividing unit 302 generates area specifying information for identifying whether each pixel of the input image is a lossy compression area or a lossless compression area.

本実施形態において、領域分割部302は、同じ色値及び属性値を有し互いに隣接する所定数以上の画素で構成される領域を1つの可逆圧縮領域として設定する。本実施形態において、所定数は3画素であるが、特に限定されない。本実施形態においては全く同じ色値及び属性値を有する画素により1つの可逆圧縮領域が構成されるが、用途によっては、1つの可逆圧縮領域に含まれる画素の色値及び属性値に閾値以下の誤差が存在してもよい。また、入力画像において予め可逆圧縮領域及び非可逆圧縮領域が設定されている場合、又は可逆圧縮領域及び非可逆圧縮領域を設定しない場合、領域分割部302は不要である。   In this embodiment, the area dividing unit 302 sets an area composed of a predetermined number of pixels having the same color value and attribute value and adjacent to each other as one lossless compression area. In the present embodiment, the predetermined number is 3 pixels, but is not particularly limited. In this embodiment, one reversible compression area is configured by pixels having exactly the same color value and attribute value. However, depending on the application, the color value and attribute value of a pixel included in one reversible compression area are less than or equal to a threshold value. There may be errors. Further, when the lossless compression area and the lossy compression area are set in advance in the input image, or when the lossless compression area and the lossy compression area are not set, the area dividing unit 302 is unnecessary.

以下では、領域分割部302の具体的な処理例について説明する。領域分割部302は、RAM102から、16×16画素の矩形単位で、ビットマップの画素データを読み込む。ここで領域分割部302は、矩形領域の左上の画素からラスタ順に画素データを順次読み込み、読み込んだ画素データのうち連続する3ライン分の画素データをバッファする。そして、領域分割部302は、バッファされた3ライン分の画素データを参照し、隣接する3つ以上の画素についてRGB値が同一である場合、RGB値が同一である画素群で構成される領域を可逆圧縮領域と判定する。ここで、画素が隣接するとは、2つの画素について、X座標の差分が0又は1であり、かつY座標の差分が0又は1であることを意味する。一方、領域分割部302は、隣接する画素のRGB値が同一であっても2つの隣接する画素しかRGB値が同一ではない場合、又は隣接するいずれの画素ともRGB値が異なる場合には、これらの画素で構成される領域を非可逆圧縮領域と判定する。   Hereinafter, a specific processing example of the area dividing unit 302 will be described. The area dividing unit 302 reads bitmap pixel data from the RAM 102 in units of 16 × 16 pixel rectangles. Here, the area dividing unit 302 sequentially reads pixel data from the upper left pixel of the rectangular area in raster order, and buffers pixel data for three consecutive lines of the read pixel data. Then, the area dividing unit 302 refers to the buffered pixel data for three lines, and when the RGB values are the same for three or more adjacent pixels, the area dividing unit 302 is configured by a group of pixels having the same RGB value. Is determined to be a lossless compression region. Here, the fact that the pixels are adjacent means that the X coordinate difference is 0 or 1 and the Y coordinate difference is 0 or 1 for two pixels. On the other hand, if the RGB values of adjacent pixels are the same even if only two adjacent pixels have the same RGB value, or the RGB values of any adjacent pixels are different, An area composed of the pixels is determined as an irreversible compression area.

そして、領域分割部302は、可逆圧縮領域と判定された画素には、可逆圧縮領域であることを示す領域特定情報を割り当て、非可逆圧縮領域と判定された画素には、非可逆圧縮領域であることを示す領域特定情報を割り当てる。各画素について生成された領域特定情報は、ビットマップに含まれる画素の色値及び属性値の並びと同じ順序で、画像置換部303と属性結合部305とに供給される。   Then, the area dividing unit 302 assigns area specifying information indicating the lossless compression area to the pixel determined to be the lossless compression area, and the pixel determined to be the lossy compression area is the lossy compression area. Allocate area specifying information indicating that there is. The area specifying information generated for each pixel is supplied to the image replacement unit 303 and the attribute combination unit 305 in the same order as the arrangement of the color values and attribute values of the pixels included in the bitmap.

画像置換部303は、可逆圧縮領域中の画素の色値を所定値に置換することで、非可逆圧縮対象画像を生成する。本実施形態において、画像置換部303は、領域特定情報を参照して、可逆圧縮領域にある画素のRGB値を置換することで、非可逆圧縮対象画像を生成する。本実施形態において、画像置換部303は、非可逆圧縮領域にある画素のRGB値を参照して算出した置換値で、可逆圧縮領域にある画素のRGB値を置換する。例えば、画像置換部303は、入力画像データを16×16画素の矩形単位で読み出し、16×16画素の矩形単位の非可逆圧縮対象画像を生成することができる。この際に画像置換部303は、矩形領域内の画素のうち、非可逆圧縮領域にある画素の平均R値、平均G値、及び平均B値で、可逆圧縮領域にある画素のR値、G値、及びB値のそれぞれを置換することができる。   The image replacement unit 303 generates an irreversible compression target image by replacing the color value of the pixel in the lossless compression region with a predetermined value. In the present embodiment, the image replacement unit 303 generates an irreversible compression target image by replacing the RGB values of the pixels in the lossless compression region with reference to the region specifying information. In the present embodiment, the image replacement unit 303 replaces the RGB values of the pixels in the lossless compression area with the replacement values calculated with reference to the RGB values of the pixels in the lossy compression area. For example, the image replacement unit 303 can read input image data in a rectangular unit of 16 × 16 pixels and generate a lossy compression target image in a rectangular unit of 16 × 16 pixels. At this time, the image replacement unit 303 uses the average R value, the average G value, and the average B value of the pixels in the lossy compression region among the pixels in the rectangular region, and the R value of the pixels in the lossless compression region, G Each of the value and the B value can be replaced.

このように、可逆圧縮領域中の画素の色値を所定値に置換することで生成された入力画像に対して、第1の符号化部304により非可逆圧縮が行われる。この処理により、非可逆圧縮対象画像を非可逆圧縮及び復号した場合における、非可逆圧縮領域の画像劣化を抑えることができる。しかしながら、画像置換部303による置換処理は必須ではない。なお、後述する第1の符号化部304、属性結合部305、及び第2の符号化部306は、画像置換部303による置換処理と同じ矩形単位で処理を行うことができる。   As described above, the first encoding unit 304 performs lossy compression on the input image generated by replacing the color value of the pixel in the lossless compression region with a predetermined value. By this processing, it is possible to suppress image deterioration in the lossy compression region when the lossy compression target image is subjected to lossy compression and decoding. However, the replacement process by the image replacement unit 303 is not essential. Note that a first encoding unit 304, an attribute combining unit 305, and a second encoding unit 306, which will be described later, can perform processing in the same rectangular units as the replacement processing performed by the image replacement unit 303.

第1の符号化部304は、非可逆圧縮領域内の入力画像を表す非可逆圧縮データを生成する。例えば、第1の符号化部304は、非可逆圧縮対象画像を16×16画素の矩形単位で非可逆圧縮することで、非可逆圧縮データを生成することができる。圧縮方式は特に限定されないが、例えばJPEG方式が挙げられる。また、本実施形態においては非可逆圧縮対象画像の全体が圧縮されるが、非可逆圧縮領域内の入力画像のみが圧縮されてもよい。なお、本実施形態において、属性値は非可逆圧縮データには含まれない。   The first encoding unit 304 generates lossy compressed data representing an input image in the lossy compression region. For example, the first encoding unit 304 can generate lossy compressed data by irreversibly compressing the lossy compression target image in a 16 × 16 pixel rectangular unit. Although the compression method is not particularly limited, for example, the JPEG method can be mentioned. In the present embodiment, the entire irreversible compression target image is compressed, but only the input image in the irreversible compression area may be compressed. In the present embodiment, the attribute value is not included in the lossy compressed data.

属性結合部305は、16×16画素の矩形単位で、入力画像データと属性データを、矩形領域の左上画素から順次読み込む。そして、属性結合部305は、画素毎に入力画像データのRGB値と属性データを結合する。本実施形態で属性結合部305は、色値としてRGB値、属性値としてα値を結合する。こうして、属性結合部305は、各画素についてRGBα値を有する可逆圧縮対象画像を生成する。可逆圧縮対象画像のデータは、以下のように矩形順に整列され、第2の符号化部306に供給される。   The attribute combining unit 305 sequentially reads input image data and attribute data from the upper left pixel of the rectangular area in units of 16 × 16 pixels. The attribute combining unit 305 combines the RGB value of the input image data and the attribute data for each pixel. In the present embodiment, the attribute combining unit 305 combines RGB values as color values and α values as attribute values. Thus, the attribute combining unit 305 generates a lossless compression target image having RGBα values for each pixel. The data of the lossless compression target image is arranged in the rectangular order as described below, and is supplied to the second encoding unit 306.

[矩形(0,0)]、[矩形(1,0)]、[矩形(2,0)]、……、[矩形(X’max,0)]、[矩形(1,0)]、[矩形(1,1)]、……、[矩形(X’max,Y’max−1)]、[矩形(0,Y’max)]、[矩形(1,Y’max)]、……、[矩形(X’max,Y’max)]、   [Rectangle (0, 0)], [Rectangle (1, 0)], [Rectangle (2, 0)], ..., [Rectangle (X'max, 0)], [Rectangle (1, 0)], [Rectangle (1, 1)], ..., [Rectangle (X'max, Y'max-1)], [Rectangle (0, Y'max)], [Rectangle (1, Y'max)], ... ..., [Rectangle (X'max, Y'max)],

ここで、矩形(X,Y)は、左からX番目の、上からY番目の矩形を示す。また、X’max及びY’maxはそれぞれ横方向及び縦方向の矩形の数を表し、X’max=X−max−15)/16、Y’max=(Y−max−15)/16)である。それぞれの矩形の画像データは、以下のように画素順に整列されている。以下において、R(X,Y)、G(X,Y)、B(X,Y)、α(X,Y)は、それぞれ矩形内で左からX番目、上からY番目の画素のR値、G値、B値、及びα値を表す。   Here, the rectangle (X, Y) indicates the Xth rectangle from the left and the Yth rectangle from the top. X′max and Y′max represent the number of rectangles in the horizontal and vertical directions, respectively, and X′max = X−max−15) / 16, Y′max = (Y−max−15) / 16) It is. Each rectangular image data is arranged in pixel order as follows. In the following, R (X, Y), G (X, Y), B (X, Y), and α (X, Y) are the R values of the Xth pixel from the left and the Yth pixel from the top in the rectangle, respectively. , G value, B value, and α value.

R(0,0)、G(0,0)、B(0,0)、α(0,0)、R(1,0)、G(1,0)、B(1,0)、α(1,0)、……、R(15,0)、G(15,0)、B(15,0)、α(15,0)、R(0,1)、G(0,1)、B(0,1)、α(0,1)、R(1,1)、G(1,1)、B(1,1)、α(1,1)、……、R(15,1)、G(15,1)、B(15,1)、α(15,1)、……、R(0,15)、G(0,15)、B(0,15)、α(0,15)、R(1,15)、G(1,15)、B(1,15)、α(1,15)、……、R(15,15)、G(15,15)、B(15,15)、α(15,15)   R (0,0), G (0,0), B (0,0), α (0,0), R (1,0), G (1,0), B (1,0), α (1, 0), ..., R (15, 0), G (15, 0), B (15, 0), α (15, 0), R (0, 1), G (0, 1) , B (0, 1), α (0, 1), R (1, 1), G (1, 1), B (1, 1), α (1, 1), ..., R (15, 1), G (15, 1), B (15, 1), α (15, 1), ..., R (0, 15), G (0, 15), B (0, 15), α ( 0, 15), R (1, 15), G (1, 15), B (1, 15), α (1, 15), ..., R (15, 15), G (15, 15), B (15, 15), α (15, 15)

第2の符号化部306は、16×16画素の矩形単位で、可逆圧縮対象画像を後述するように図9に示すフォーマットの圧縮データに圧縮する。図4は、第2の符号化部306の構成の一例を示す。   The second encoding unit 306 compresses the reversible compression target image into compressed data having a format shown in FIG. 9 as will be described later in units of 16 × 16 pixel rectangles. FIG. 4 shows an exemplary configuration of the second encoding unit 306.

境界抽出部401は、色値が変化する境界及び属性値が変化する境界を特定する。この分割境界は、色値と属性値との少なくとも一方が変化する境界でありうる。本実施形態において、境界抽出部401は、画像領域を分割し、それぞれの領域を区切る分割境界の位置を示す境界情報を生成する。本実施形態において、境界抽出部401は、可逆圧縮領域中では色値が変化する境界及び属性値が変化する境界を特定する。こうして特定された境界により規定される可逆圧縮領域内の1つの分割領域は、色値及び属性値が同一である隣接画素群で構成される。また、境界抽出部401は、非可逆圧縮領域中では属性値が変化する境界を特定する。こうして特定された境界により規定される非可逆圧縮領域内の1つの分割領域は、属性値が同一である隣接画素群で構成される。このように、非可逆圧縮領域中で、属性値が変化する境界によって区切られる領域には、色値が異なる画素が含まれてもよい。境界抽出部401は、このような規則に従って、画像領域を1以上の分割領域に分割する。   The boundary extraction unit 401 identifies a boundary where the color value changes and a boundary where the attribute value changes. This division boundary may be a boundary where at least one of the color value and the attribute value changes. In the present embodiment, the boundary extraction unit 401 divides an image area and generates boundary information indicating the position of a division boundary that divides each area. In the present embodiment, the boundary extraction unit 401 identifies a boundary where the color value changes and a boundary where the attribute value changes in the lossless compression region. One divided region in the lossless compression region defined by the boundary thus specified is composed of adjacent pixel groups having the same color value and attribute value. In addition, the boundary extraction unit 401 identifies a boundary where the attribute value changes in the lossy compression region. One divided area in the lossy compression area defined by the boundary thus specified is composed of adjacent pixel groups having the same attribute value. In this way, in the lossy compression region, the region delimited by the boundary where the attribute value changes may include pixels having different color values. The boundary extraction unit 401 divides the image area into one or more divided areas according to such rules.

まず、可逆圧縮領域についての具体的な処理例について以下で説明する。境界抽出部401は、上端からラインごとに、左隣の画素との間で、色値又は属性値が異なる画素を、境界画素として抽出する。可逆圧縮領域の左端の画素は、常に境界として抽出される。さらに境界抽出部401は、上隣の画素との間で、色値又は属性値が異なる画素も、境界画素として抽出する。そして、境界抽出部401は、処理済の上隣のラインにある同一の色値及び属性値を有する画素を検出して、現在のラインにある境界画素と上隣のラインにある境界画素とを関連づけることにより、境界を特定する。このように、境界抽出部401は、色値及び属性値が変化する境界に加えて、色値が変化しないが属性値が変化する境界も特定する。   First, a specific processing example for the lossless compression area will be described below. The boundary extraction unit 401 extracts, as boundary pixels, pixels having different color values or attribute values from the upper left pixel for each line from the upper end. The pixel at the left end of the lossless compression area is always extracted as a boundary. Further, the boundary extraction unit 401 also extracts pixels having different color values or attribute values from the upper adjacent pixels as boundary pixels. Then, the boundary extraction unit 401 detects pixels having the same color value and attribute value in the processed upper adjacent line, and determines the boundary pixel in the current line and the boundary pixel in the upper adjacent line. Identify the boundaries by associating them. As described above, the boundary extraction unit 401 identifies a boundary where the color value does not change but the attribute value changes in addition to the boundary where the color value and the attribute value change.

非可逆圧縮領域においては、境界抽出部401は、上端からラインごとに、左隣の画素との間で、属性値が異なる画素を、境界画素として抽出する。さらに境界抽出部401は、上隣の画素との間で、属性値が異なる画素も、境界画素として抽出する。そして、境界抽出部401は、処理済の上隣のラインにある同一の属性値を有する画素を検出して、現在のラインにある境界画素と上隣のラインにある境界画素とを関連づけることにより、境界を特定する。   In the lossy compression region, the boundary extraction unit 401 extracts, as boundary pixels, pixels having different attribute values from the upper left pixel for each line from the upper end. Furthermore, the boundary extraction unit 401 also extracts pixels having different attribute values from the upper adjacent pixels as boundary pixels. The boundary extraction unit 401 detects pixels having the same attribute value in the processed upper adjacent line, and associates the boundary pixel in the current line with the boundary pixel in the upper adjacent line. Identify the boundaries.

ヘッダ生成部402は、境界抽出部401が特定した境界によって区切られる領域の色値及び属性値を示す情報を生成する。もっとも、非可逆圧縮領域については、領域の色を示す情報は生成されず、境界抽出部401が特定した境界によって区切られる領域の属性値を示す情報が生成される。また、軌跡生成部403は、境界抽出部401が特定した境界の位置情報を生成する。ヘッダ生成部402及び軌跡生成部403が生成する情報は、境界によって区切られる領域の色値及び属性値を示す情報、又は境界抽出部401が特定した境界の位置情報を含んでいるのであれば、特定のフォーマットに限定されない。例えば、境界の右側に存在する領域の色値及び属性値を示す情報と境界の位置情報とが生成されてもよい。さらに、1組の境界に挟まれる領域の色値及び属性値を示す情報とそれぞれの境界の位置情報とが生成されてもよい。   The header generation unit 402 generates information indicating the color value and attribute value of the region delimited by the boundary specified by the boundary extraction unit 401. However, for the lossy compression area, information indicating the color of the area is not generated, and information indicating the attribute value of the area delimited by the boundary specified by the boundary extraction unit 401 is generated. In addition, the trajectory generation unit 403 generates boundary position information specified by the boundary extraction unit 401. If the information generated by the header generation unit 402 and the trajectory generation unit 403 includes information indicating the color value and attribute value of the region delimited by the boundary or the boundary position information specified by the boundary extraction unit 401, It is not limited to a specific format. For example, information indicating the color value and attribute value of an area existing on the right side of the boundary and boundary position information may be generated. Furthermore, information indicating the color value and attribute value of an area sandwiched between a set of boundaries and position information of each boundary may be generated.

本実施形態においては、境界抽出部401が特定した境界によって区切られる可逆圧縮領域のそれぞれについて、左端の境界である開始境界と、右端の境界である終端境界と、を示す情報が生成される。このように、境界抽出部401は、開始境界と終端境界との組により規定され、開始境界と終端境界との間にある色値及び属性値が一定である領域を特定している。   In the present embodiment, information indicating the start boundary that is the left end boundary and the end boundary that is the right end boundary is generated for each of the lossless compression regions partitioned by the boundary specified by the boundary extraction unit 401. As described above, the boundary extraction unit 401 specifies an area that is defined by the set of the start boundary and the end boundary and has a constant color value and attribute value between the start boundary and the end boundary.

そして、ヘッダ生成部402は、開始境界と終端境界との組により規定される領域ごとに、領域内の画素の色値及び属性値を示す情報を生成する。また、ヘッダ生成部402はさらに、開始境界及び終端境界の起点座標情報及び終点座標情報を生成する。具体例として、ヘッダ生成部402は、開始境界の最上端におけるX座標及びY座標、開始境界の最下端におけるY座標、並びに終端境界の最上端におけるX座標を示す情報を生成する。一方、軌跡生成部403は、開始境界と終端境界とのそれぞれについて、開始境界及び終端境界が通る座標の座標値を符号化及び整列することで軌跡情報を生成する。例えば、軌跡生成部403は、最上端から最下端までの各横方向ライン間における境界のX座標の変位を示す情報を、軌跡情報として生成する。   Then, the header generation unit 402 generates information indicating the color value and the attribute value of the pixels in the area for each area defined by the combination of the start boundary and the end boundary. Further, the header generation unit 402 further generates start point coordinate information and end point coordinate information of the start boundary and the end boundary. As a specific example, the header generation unit 402 generates information indicating the X and Y coordinates at the uppermost end of the start boundary, the Y coordinate at the lowermost end of the start boundary, and the X coordinate at the uppermost end of the end boundary. On the other hand, the trajectory generation unit 403 generates trajectory information by encoding and aligning the coordinate values of the coordinates through which the start boundary and the end boundary pass for each of the start boundary and the end boundary. For example, the trajectory generation unit 403 generates information indicating the displacement of the X coordinate of the boundary between each horizontal line from the uppermost end to the lowermost end as trajectory information.

また、本実施形態においては、境界抽出部401が特定した境界によって区切られる非可逆圧縮領域のそれぞれについては、属性値が変化する境界を示す情報が生成される。具体例として、境界抽出部401が特定した属性値が変化する境界によって区切られる非可逆圧縮領域のそれぞれについては、左端の境界(属性境界)を示す情報が生成される。そして、ヘッダ生成部402は、属性値が変化する境界における変化後の属性値を示す情報を生成する。具体例として、ヘッダ生成部402は、属性境界の右側にある領域について、領域内の画素の属性値を示す情報を生成する。また、ヘッダ生成部402はさらに、属性境界の起点座標情報及び終点座標情報を生成する。具体例として、ヘッダ生成部402は、属性境界の最上端におけるX座標及びY座標、並びに属性境界の最下端におけるY座標を示す情報を生成する。そして、軌跡生成部403は、属性境界が通る座標の座標値を符号化することで軌跡情報を生成する。   Further, in the present embodiment, for each lossy compression region delimited by the boundary specified by the boundary extraction unit 401, information indicating the boundary where the attribute value changes is generated. As a specific example, for each irreversible compression region delimited by a boundary where the attribute value specified by the boundary extraction unit 401 changes, information indicating the leftmost boundary (attribute boundary) is generated. Then, the header generation unit 402 generates information indicating the changed attribute value at the boundary where the attribute value changes. As a specific example, the header generation unit 402 generates information indicating the attribute value of the pixel in the region for the region on the right side of the attribute boundary. The header generation unit 402 further generates starting point coordinate information and end point coordinate information of the attribute boundary. As a specific example, the header generation unit 402 generates information indicating the X coordinate and the Y coordinate at the uppermost end of the attribute boundary and the Y coordinate at the lowermost end of the attribute boundary. Then, the trajectory generation unit 403 generates trajectory information by encoding the coordinate values of the coordinates through which the attribute boundary passes.

一方、境界抽出部401が特定した境界によって区切られる非可逆圧縮領域の属性値が、左隣の可逆圧縮領域の属性値と同じである場合には、この領域についての属性境界を示す情報は省略される。本実施形態においては、左隣の可逆圧縮領域の終端境界と、右隣の可逆圧縮領域の開始境界又は非可逆圧縮領域の属性境界を示す情報を用いて、属性境界を示す情報が省略されている非可逆圧縮領域を特定することができる。   On the other hand, when the attribute value of the irreversible compression area divided by the boundary specified by the boundary extraction unit 401 is the same as the attribute value of the left-side lossless compression area, information indicating the attribute boundary for this area is omitted. Is done. In the present embodiment, the information indicating the attribute boundary is omitted using the information indicating the end boundary of the left-side lossless compression area and the start boundary of the right-side lossless compression area or the attribute boundary of the lossy compression area. The irreversible compression area can be specified.

以上のようにしてヘッダ生成部402が生成した情報は、可逆圧縮データ901の第1の領域(ヘッダ部)に格納される。また、軌跡生成部403が生成した情報は、可逆圧縮データ901の第2の領域(軌跡データ部)に格納される。   Information generated by the header generation unit 402 as described above is stored in the first area (header portion) of the lossless compressed data 901. The information generated by the trajectory generation unit 403 is stored in the second area (trajectory data unit) of the lossless compressed data 901.

次に、図1に示すシステムにより生成される圧縮データのフォーマットについて、図5〜図9を参照して説明する。   Next, the format of the compressed data generated by the system shown in FIG. 1 will be described with reference to FIGS.

図5は、中間データに含まれる圧縮されたビットマップデータのメモリイメージである。メモリイメージ5は、ページやフレームなどの描画領域に含まれるビットマップのデータとして、ビットマップヘッダ501と圧縮ビットマップデータ502を含む。   FIG. 5 is a memory image of compressed bitmap data included in the intermediate data. The memory image 5 includes a bitmap header 501 and compressed bitmap data 502 as bitmap data included in a drawing area such as a page or a frame.

ビットマップヘッダ501は、ページやフレームなどの描画領域に含まれるビットマップ(図5の例では、ビットマップ1〜ビットマップB)ごとに定義されるヘッダの集合である。ビットマップヘッダは、ビットマップサイズ5011、チャネル数5012、ビット精度5013、可逆圧縮データへのポインタマップ5014、及び非可逆圧縮データへのポインタマップ5015を含む。   The bitmap header 501 is a set of headers defined for each bitmap (bitmap 1 to bitmap B in the example of FIG. 5) included in a drawing area such as a page or a frame. The bitmap header includes a bitmap size 5011, the number of channels 5012, a bit precision 5013, a pointer map 5014 to lossless compressed data, and a pointer map 5015 to lossy compressed data.

1つのビットマップは16×16画素の矩形領域に分割されている。以下の説明では、ビットマップ1はW×H個の矩形領域で構成されているものとする。元のビットマップの縦画素数又は横画素数が16の整数倍でない場合は、縦画素数及び横画素数が16の整数倍となるようにパディングを付加した後に、ビットマップを矩形領域に分割することができる。   One bitmap is divided into rectangular regions of 16 × 16 pixels. In the following description, it is assumed that the bitmap 1 is composed of W × H rectangular areas. If the number of vertical or horizontal pixels in the original bitmap is not an integer multiple of 16, padding is added so that the number of vertical and horizontal pixels is an integer multiple of 16, and then the bitmap is divided into rectangular areas can do.

ビットマップサイズ5011は、ビットマップのサイズを示し、より具体的にはビットマップの幅及び高さのそれぞれについて、16の何倍であるかを示す。チャネル数5012は、ビットマップの色数を示す。チャネル数5012は、RGBの場合は3チャネル、CMYKの場合は4チャネル、YUVの場合は3チャネル、BWの場合は1チャネルとなる。ビット精度5013は、色を1チャネルあたり何ビットで表現するのかを示す。可逆圧縮データへのポインタマップ5014には、各矩形領域に対応する可逆圧縮データの先頭アドレスが格納される。非可逆圧縮データへのポインタマップ5015には、各矩形領域に対応する非可逆圧縮データの先頭アドレスが格納される。   The bitmap size 5011 indicates the size of the bitmap, and more specifically indicates how many times it is 16 for each of the width and height of the bitmap. The channel number 5012 indicates the number of colors in the bitmap. The number of channels 5012 is 3 channels for RGB, 4 channels for CMYK, 3 channels for YUV, and 1 channel for BW. The bit precision 5013 indicates how many bits are expressed per channel. In the pointer map 5014 to the lossless compressed data, the head address of the lossless compressed data corresponding to each rectangular area is stored. The pointer map 5015 to the lossy compressed data stores the head address of the lossy compressed data corresponding to each rectangular area.

圧縮ビットマップデータ502は、ページやフレームなどの描画領域に含まれるビットマップ(ビットマップ1〜ビットマップB)を圧縮したものである。可逆圧縮データは各ビットマップごとの可逆圧縮データで構成され、非可逆圧縮データも、各ビットマップごとの非可逆圧縮データで構成される。また、1つのビットマップについての可逆圧縮データは、各矩形領域に対応する可逆圧縮データで構成され、1つのビットマップについての非可逆圧縮データも、各矩形領域に対応する非可逆圧縮データで構成される。   The compressed bitmap data 502 is obtained by compressing a bitmap (bitmap 1 to bitmap B) included in a drawing area such as a page or a frame. The lossless compressed data is composed of lossless compressed data for each bitmap, and the lossy compressed data is also composed of lossy compressed data for each bitmap. Further, the lossless compressed data for one bitmap is composed of lossless compressed data corresponding to each rectangular area, and the irreversible compressed data for one bitmap is also composed of irreversible compressed data corresponding to each rectangular area. Is done.

例えば、ビットマップ1の圧縮ビットマップデータは、各矩形領域の可逆圧縮データ5016、5017、……、5018と、各矩形領域の非可逆圧縮データ5019、5020、……、5021と、を含む。そして、ビットマップ1内の矩形領域1の圧縮ビットマップデータは、可逆圧縮データ5016と非可逆圧縮データ5019とを含む。各矩形領域の可逆圧縮データは、16×16画素の矩形領域内の境界情報と、それぞれの分割領域(単色領域)についての色情報及び属性情報を含む。また、各矩形領域の非可逆圧縮データは、縦横2個ずつ、合計4個の8×8画素のMCU(Minimum Coded Unit)で構成される、16×16画素のJPEGデータである。可逆圧縮データ5016、5017、……、5018と、非可逆圧縮データ5019、5020、……、5021について、図6〜図8を参照してさらに説明する。   For example, the compressed bitmap data of bitmap 1 includes lossless compression data 5016, 5017,..., 5018 for each rectangular area and lossy compression data 5019, 5020,. The compressed bitmap data of the rectangular area 1 in the bitmap 1 includes lossless compressed data 5016 and lossy compressed data 5019. The lossless compressed data of each rectangular area includes boundary information in the rectangular area of 16 × 16 pixels, and color information and attribute information about each divided area (monochromatic area). The irreversible compressed data of each rectangular area is 16 × 16 pixel JPEG data composed of a total of four 8 × 8 pixel MCUs (Minimum Coded Units), two vertically and horizontally. The lossless compressed data 5016, 5017,..., 5018 and the lossy compressed data 5019, 5020,..., 5021 will be further described with reference to FIGS.

図6は、1つのビットマップに含まれる16×16画素の矩形領域6を表す。図6において、実線は矩形領域の外端及び分割領域の境界を示し、破線はJPEGのMCUに相当する8×8の小矩形領域の境界を示す。また、図6には、境界によって区切られた分割領域601〜608が示されている。具体的には、図6には、第1の領域601(可逆圧縮領域)、第2の領域602(非可逆圧縮領域)、第3の領域603(可逆圧縮領域)、及び第4の領域604(可逆圧縮領域)が示されている。図6には、さらに、第5の領域605(非可逆圧縮領域)、第6の領域606(可逆圧縮領域)、第7の領域(可逆圧縮領域)、及び第8の領域608(非可逆圧縮領域)が示されている。   FIG. 6 shows a rectangular area 6 of 16 × 16 pixels included in one bitmap. In FIG. 6, the solid line indicates the outer edge of the rectangular area and the boundary between the divided areas, and the broken line indicates the boundary of the 8 × 8 small rectangular area corresponding to the JPEG MCU. FIG. 6 also shows divided regions 601 to 608 that are separated by boundaries. Specifically, FIG. 6 shows a first area 601 (lossless compression area), a second area 602 (lossy compression area), a third area 603 (lossless compression area), and a fourth area 604. (Reversible compression area) is shown. FIG. 6 further shows a fifth area 605 (lossy compression area), a sixth area 606 (lossless compression area), a seventh area (lossless compression area), and an eighth area 608 (lossy compression). Area) is shown.

矩形領域6において、第2の領域602、第5の領域605、及び第8の領域608においては、同じ色値及び属性値を有する3つ以上の画素が隣接しておらず、これらの領域は非可逆圧縮される。第1の領域601、第3の領域603、第4の領域604、第6の領域606、及び第7の領域607は、同じ色値及び属性値を有する3つ以上の画素が隣接している領域であり、可逆圧縮される。   In the rectangular area 6, in the second area 602, the fifth area 605, and the eighth area 608, three or more pixels having the same color value and attribute value are not adjacent to each other. Lossy compression. In the first region 601, the third region 603, the fourth region 604, the sixth region 606, and the seventh region 607, three or more pixels having the same color value and attribute value are adjacent to each other. This area is reversibly compressed.

図7は、矩形領域6を分割する、可逆圧縮領域の横方向ライン上の先頭を示す属性を有する境界(開始境界)と、可逆圧縮領域の横方向ライン上の終端を示す属性を有する境界(終端境界)とを示す。図7において、実線は開始境界を示し、太い破線は終端境界を示す。開始境界の右隣の画素から1つの可逆圧縮領域が開始し、終端境界の右隣の画素で1つの可逆圧縮領域が終了する。以下では、1つの可逆圧縮領域を表す開始境界と終端境界とのセットを可逆圧縮領域境界と呼ぶ。開始境界と終端境界とは、互いに交わらないように、一対の組をなす境界情報として第2の符号化部306によって生成される。   FIG. 7 shows a boundary (start boundary) having an attribute indicating the head on the horizontal line of the lossless compression area and a boundary having an attribute indicating the end on the horizontal line of the lossless compression area (dividing the rectangular area 6). Terminal boundary). In FIG. 7, the solid line indicates the start boundary, and the thick broken line indicates the end boundary. One lossless compression area starts from the pixel right next to the start boundary, and one lossless compression area ends at the pixel right next to the end boundary. Hereinafter, a set of a start boundary and an end boundary representing one lossless compression area is referred to as a lossless compression area boundary. The start boundary and the end boundary are generated by the second encoding unit 306 as boundary information that forms a pair so as not to cross each other.

図7には、第1の領域601の開始境界701及び終端境界702と、第3の領域603の開始境界703及び終端境界704と、第4の領域604の開始境界705及び終端境界706と、が示されている。図7にはさらに、第6の領域606の開始境界707及び終端境界708と、第7の領域607の開始境界709及び終端境界710と、が示されている。   FIG. 7 includes a start boundary 701 and a termination boundary 702 of the first region 601, a start boundary 703 and a termination boundary 704 of the third region 603, a start boundary 705 and a termination boundary 706 of the fourth region 604, It is shown. FIG. 7 further shows the start boundary 707 and the end boundary 708 of the sixth area 606 and the start boundary 709 and the end boundary 710 of the seventh area 607.

図8は、矩形領域6内の非可逆圧縮領域について、属性のみを定義する境界を示す。図8には、第2の領域602の属性を定義する境界801、第5の領域605の属性を定義する境界802、並びに第8の領域608の属性を定義する境界803及び804を示す。図2の領域602及び第五の領域605においては、領域内で属性が変化しない。一方、第8の領域608は、属性が異なる2つの領域で構成される。以下では、これら属性のみを定義する境界のことを属性境界と呼ぶ。   FIG. 8 shows a boundary that defines only attributes for the lossy compression region in the rectangular region 6. FIG. 8 shows a boundary 801 that defines the attribute of the second area 602, a boundary 802 that defines the attribute of the fifth area 605, and boundaries 803 and 804 that define the attribute of the eighth area 608. In the area 602 and the fifth area 605 in FIG. 2, the attribute does not change in the area. On the other hand, the eighth area 608 includes two areas having different attributes. Hereinafter, a boundary that defines only these attributes is referred to as an attribute boundary.

図9は、可逆圧縮データのフォーマットを示す。901は、16×16画素の矩形領域の可逆圧縮データであり、可逆圧縮データ5016、5017、……、5018のうちの1つに相当する。可逆圧縮データ901は、境界数9011及び境界ヘッダ9012、……、9013が格納されるヘッダ部(第1の領域)と、軌跡データ9014、……、9015が格納される軌跡データ部(第2の領域)とに分割された構造を有する。   FIG. 9 shows a format of lossless compressed data. Reference numeral 901 denotes lossless compression data of a rectangular area of 16 × 16 pixels, which corresponds to one of the lossless compression data 5016, 5017,. The lossless compressed data 901 includes a header portion (first area) in which the boundary number 9011 and boundary headers 9012,..., 9013 are stored, and a locus data portion (second area) in which the locus data 9014,. The area is divided into two areas).

可逆圧縮データ901のヘッダ部には、色値及び属性値を有する画素で構成される画像において色値が変化する境界及び属性値が変化する境界によって区切られる領域の色値及び属性値を示す第1のデータ要素が含まれている。例えば、ヘッダ部には、ヘッダ生成部402が生成した情報を格納することができる。また、可逆圧縮データ901の軌跡データ部には、境界の位置を示す第2のデータ要素が含まれている。例えば、軌跡データ部には、軌跡生成部403が生成した情報を格納することができる。   The header portion of the lossless compressed data 901 includes a color value and an attribute value indicating a region delimited by a boundary where the color value changes and a boundary where the attribute value changes in an image including pixels having color values and attribute values. 1 data element is included. For example, information generated by the header generation unit 402 can be stored in the header part. The trajectory data portion of the lossless compressed data 901 includes a second data element indicating the position of the boundary. For example, information generated by the trajectory generation unit 403 can be stored in the trajectory data unit.

境界数9011は、16×16画素の矩形領域内にある、可逆圧縮領域の開始境界と終端境界の組の数と、属性のみを定義する属性境界の数と、の合計値を示す。図9において、境界数はEである。すなわち、矩形領域内には1番目〜E番目までの境界があり、それぞれの境界は可逆圧縮領域境界又は属性境界である。以下では、N番目の境界のことを境界N−1と呼ぶ。   The number of boundaries 9011 indicates the total value of the number of sets of the start boundary and the end boundary of the lossless compression region and the number of attribute boundaries that define only the attributes in the 16 × 16 pixel rectangular region. In FIG. 9, the number of boundaries is E. That is, there are first to Eth boundaries in the rectangular area, and each boundary is a lossless compression area boundary or an attribute boundary. Hereinafter, the Nth boundary is referred to as boundary N-1.

可逆圧縮データ901のヘッダ部には、境界0〜境界E−1のヘッダ情報である境界ヘッダが格納される。ヘッダ部は複数の領域に分割されており、1つの分割領域には、開始境界と終端境界との組により規定される1つの可逆圧縮領域の色値及び属性値、又は属性境界を用いて規定される1つの非可逆圧縮領域の属性値が格納される。   The header portion of the lossless compressed data 901 stores a boundary header that is header information of the boundary 0 to the boundary E-1. The header part is divided into a plurality of areas, and each divided area is defined by using the color value and attribute value of one reversible compression area defined by the combination of the start boundary and the end boundary, or the attribute boundary. The attribute value of one lossy compression area to be stored is stored.

例えば、境界0の境界ヘッダ9012は、1番目の境界の境界ヘッダであり、境界E−1の境界ヘッダ9013は、E番目の境界の境界ヘッダである。また、可逆圧縮データ901の軌跡データ部には、境界0〜境界E−1の軌跡データが格納される。例えば、軌跡データ9014は境界0の軌跡データであり、軌跡データ9015は境界E−1の軌跡データである。この軌跡データは、各横方向ラインにおける境界の横方向(X)座標を特定するためのデータであり、関数、横方向ライン上の横方向(X)座標、横方向ライン間の横方向(X)座標の差分、などを含むことができる。   For example, a boundary header 9012 at boundary 0 is a boundary header at the first boundary, and a boundary header 9013 at boundary E-1 is a boundary header at the Eth boundary. In the trajectory data portion of the reversible compression data 901, trajectory data of the boundary 0 to the boundary E-1 is stored. For example, the trajectory data 9014 is trajectory data at the boundary 0, and the trajectory data 9015 is trajectory data at the boundary E-1. This trajectory data is data for specifying the horizontal (X) coordinate of the boundary in each horizontal line. The function, the horizontal (X) coordinate on the horizontal line, and the horizontal direction (X ) Coordinate difference, etc.

902は、可逆圧縮領域境界についての境界ヘッダの、すなわち可逆圧縮領域の開始境界と終端境界の組に対応する境界ヘッダのフォーマットを示す。領域色(Region Color)・属性値9021は、それぞれ可逆圧縮領域の色値と属性値を示す。境界種別9026は、境界が可逆圧縮境界であるか属性境界であるかを示し、可逆圧縮領域境界についての境界ヘッダ902においては境界が可逆圧縮境界であることを示す。このように、可逆圧縮データ901のヘッダ部には、境界が可逆圧縮領域中の境界であるか非可逆圧縮領域中の境界であるかを示す情報が格納される。   Reference numeral 902 denotes the format of the boundary header for the lossless compression region boundary, that is, the boundary header corresponding to the set of the start boundary and the end boundary of the lossless compression region. A region color / attribute value 9021 indicates a color value and an attribute value of the lossless compression region, respectively. The boundary type 9026 indicates whether the boundary is a lossless compression boundary or an attribute boundary, and indicates that the boundary is a lossless compression boundary in the boundary header 902 for the lossless compression region boundary. As described above, information indicating whether the boundary is a boundary in the lossless compression area or the boundary in the lossy compression area is stored in the header portion of the lossless compression data 901.

また、境界ヘッダには、軌跡の位置情報の一部を格納することができる。例えば、先頭Y座標(Start Y Position)9022は、境界の開始点の縦方向(Y)座標、すなわち開始境界の最上端の位置を示す。開始X座標(Enabling X Position)9023は、開始境界の開始点の横方向(X)座標、すなわち開始境界の最上端におけるX座標を示す。末尾Y座標(End Y Position)9024は、境界の終端点の縦方向(Y)座標、すなわち開始境界の最下端の位置を示す。終端X座標(Disabling X Position)9025は、終端境界の開始点の横方向(X)座標、すなわち終端境界の最上端におけるX座標を示す。なお、終端境界の開始点及び終端点の縦方向(Y)座標は、対をなす開始境界の開始点及び終端点の縦方向(Y)座標と等しいため、境界ヘッダ902では省略されている。一方、これらの位置情報は、軌跡データとして記録することもできる。   In addition, a part of locus position information can be stored in the boundary header. For example, the head Y coordinate 9022 indicates the vertical (Y) coordinate of the start point of the boundary, that is, the position of the uppermost end of the start boundary. The start X coordinate 9023 indicates the horizontal (X) coordinate of the start point of the start boundary, that is, the X coordinate at the uppermost end of the start boundary. An end Y coordinate 9024 indicates the vertical (Y) coordinate of the end point of the boundary, that is, the position of the lowest end of the start boundary. The end X coordinate (Disabling X Position) 9025 indicates the horizontal (X) coordinate of the start point of the end boundary, that is, the X coordinate at the uppermost end of the end boundary. Note that the start point of the end boundary and the vertical direction (Y) coordinates of the end point are the same as the start point and end point of the paired start boundary and the vertical direction (Y) coordinates, and thus are omitted in the boundary header 902. On the other hand, these pieces of position information can also be recorded as trajectory data.

903は、属性境界についての境界ヘッダのフォーマットを示す。属性値9031は、属性境界の右側の領域についての属性値を示す。開始X座標(Enabling X Position)9033は、属性境界の開始点の横方向(X)座標を示す。また、境界ヘッダ903には、属性境界の先頭Y座標9022及び末尾Y座標9024が含まれる。   Reference numeral 903 denotes the format of the boundary header for the attribute boundary. The attribute value 9031 indicates the attribute value for the area on the right side of the attribute boundary. A starting X coordinate 9033 indicates the horizontal (X) coordinate of the starting point of the attribute boundary. Further, the boundary header 903 includes a head Y coordinate 9022 and a tail Y coordinate 9024 of the attribute boundary.

境界ヘッダ9012〜9013は、先頭Y座標9022の昇順にソートされており、かつ同じ先頭Y座標9022を有する境界ヘッダは、開始Y座標9023の昇順にソートされている。すなわち、矩形領域を左上から右下へ向かって走査する順番に整列された状態で、境界ヘッダはメモリに格納されている。   The boundary headers 9012 to 9013 are sorted in ascending order of the leading Y coordinate 9022, and the boundary headers having the same leading Y coordinate 9022 are sorted in the ascending order of the starting Y coordinate 9023. That is, the boundary headers are stored in the memory in a state where the rectangular areas are arranged in the order of scanning from the upper left to the lower right.

以下では、可逆圧縮データ901の復号方法について説明する。各横方向ラインにおいて、1つの可逆圧縮領域境界についての開始境界の横方向(X)座標から終端境界の横方向(X)座標までの間にある画素は、境界ヘッダ902に定義された領域色の色値及び属性値を有する画素となる。1つの横方向ライン上で、1つの可逆圧縮領域境界についての終端境界と別の可逆圧縮領域境界についての開始境界の間にギャップがないことは、可逆圧縮領域が隣接していることを示す。   Below, the decoding method of the lossless compression data 901 is demonstrated. In each horizontal line, pixels between the horizontal (X) coordinate of the start boundary and the horizontal (X) coordinate of the end boundary for one lossless compression region boundary are the region colors defined in the boundary header 902. The pixel has the color value and the attribute value. On one horizontal line, the absence of a gap between the end boundary for one lossless compression region boundary and the start boundary for another lossless compression region boundary indicates that the lossless compression regions are adjacent.

また、1つの横方向ライン上で、1つの可逆圧縮領域境界についての終端境界と別の可逆圧縮領域境界についての開始境界の間にギャップがあることは、終端境界の右隣の画素から次の開始境界の左隣の画素までは、非可逆圧縮領域に含まれることを示す。このような非可逆圧縮領域に含まれる画素の色値は、非可逆圧縮データを伸張することによって得られる。また、このような非可逆圧縮領域に含まれる画素の属性値は、属性境界が存在しなければ左隣の可逆圧縮領域と同じ値となる。一方、1つの横方向ライン上で、1つの可逆圧縮領域境界についての終端境界の右隣に属性境界が隣接する場合、又は非可逆圧縮領域中に属性境界が存在する場合には、属性境界の画素及びその右側の画素の属性値は、境界ヘッダ903に定義された属性値となる。   Also, on one horizontal line, there is a gap between the end boundary for one lossless compression region boundary and the start boundary for another lossless compression region boundary. The pixels up to the left of the start boundary are included in the lossy compression region. The color values of the pixels included in such a lossy compression area can be obtained by decompressing the lossy compression data. Further, the attribute value of the pixel included in such a lossy compression area is the same value as the left-side lossless compression area if there is no attribute boundary. On the other hand, when an attribute boundary is adjacent to the right of the end boundary for one lossless compression region boundary on one horizontal line, or when an attribute boundary exists in the lossy compression region, the attribute boundary The attribute values of the pixel and the pixel on the right side thereof are attribute values defined in the boundary header 903.

横方向ラインの左端(X=0)に可逆圧縮領域境界の開始境界が存在しない場合、横方向ライン上の左端(X=0)から、最初に出現する可逆圧縮領域境界の開始境界の左隣の画素までは、非可逆圧縮領域に含まれる。また、1つの横方向ラインに可逆圧縮領域境界の開始座標が存在しない場合は、左端(X=0)から右端(X=15)までが非可逆圧縮領域に含まれる。この場合、非可逆圧縮領域に含まれる画素の属性値は、属性境界が存在しなければ、1つ上の横方向ラインの右端画素の属性値と同じ値となる。一方、横方向ラインの左端(X=0)に属性境界がある場合は、左端画素及びその右側の画素の属性値は、属性境界の境界ヘッダ903に定義された属性値となる。   When the start boundary of the lossless compression region boundary does not exist at the left end (X = 0) of the horizontal line, the left end of the lossless compression region boundary that appears first from the left end (X = 0) on the horizontal line. These pixels are included in the lossy compression region. When the start coordinate of the lossless compression region boundary does not exist in one horizontal line, the irreversible compression region includes the left end (X = 0) to the right end (X = 15). In this case, the attribute value of the pixel included in the irreversible compression area is the same value as the attribute value of the rightmost pixel on the horizontal line one line up if there is no attribute boundary. On the other hand, when there is an attribute boundary at the left end (X = 0) of the horizontal line, the attribute values of the left end pixel and the right side pixel are attribute values defined in the boundary header 903 of the attribute boundary.

なお、矩形領域の一番上のラインの左端には、可逆圧縮領域境界の開始境界か、属性境界か、のいずれかが存在する。   Note that either the start boundary of the lossless compression area boundary or the attribute boundary exists at the left end of the top line of the rectangular area.

矩形領域6についての可逆圧縮データを表1に示す。   Table 1 shows lossless compression data for the rectangular area 6.

Figure 2017212601
Figure 2017212601

表1について簡単に説明する。矩形領域6には、可逆圧縮領域である第1の領域、第3の領域、第4の領域、第6の領域、及び第7の領域に対応する5つの可逆圧縮領域境界と、4つの属性境界が存在するため、境界数(E)は9である。   Table 1 will be briefly described. The rectangular area 6 includes five lossless compression area boundaries corresponding to the first area, the third area, the fourth area, the sixth area, and the seventh area, which are lossless compression areas, and four attributes. Since there is a boundary, the boundary number (E) is nine.

第1の領域についての境界である境界0の境界ヘッダには、境界種別として可逆圧縮領域境界であることを示す情報、領域色として第1の領域の色値である0xFF0000、属性値として第1の領域の属性値である0が記録されている。また、開始境界701及び終端境界702の最上端は座標(Y=0)の横方向ラインに存在するため、先頭Y座標は0であり、最下端は座標(Y=9)の横方向ラインに存在するため、末尾Y座標は9である。さらに、開始境界701及び終端境界702の最上端が存在する座標(Y=0)の横方向ラインにおいて、開始境界701の横方向(X)座標は0であるから開始X座標は0であり、終端境界702の横方向(X)座標は2であるから、終端X座標は2である。   In the boundary header of boundary 0 which is the boundary for the first area, information indicating that the boundary type is a lossless compression area boundary, 0xFF0000 which is the color value of the first area as the area color, and the first as the attribute value 0, which is the attribute value of the area, is recorded. In addition, since the uppermost ends of the start boundary 701 and the end boundary 702 exist on the horizontal line of coordinates (Y = 0), the leading Y coordinate is 0, and the lowermost end is on the horizontal line of coordinates (Y = 9). Since it exists, the end Y coordinate is 9. Further, in the horizontal line of the coordinate (Y = 0) where the uppermost ends of the start boundary 701 and the end boundary 702 exist, the horizontal (X) coordinate of the start boundary 701 is 0, so the start X coordinate is 0, Since the lateral (X) coordinate of the end boundary 702 is 2, the end X coordinate is 2.

属性境界801を表す境界1の境界ヘッダには、境界種別として属性境界であることを示す情報、属性値として属性境界801の右側の領域にある画素の属性値である2が記録されている。また、属性境界801の最上端は座標(Y=0)の横方向ラインに存在するため、先頭Y座標は0であり、最下端は座標(Y=3)の横方向ラインに存在するため、末尾Y座標は3である。さらに、属性境界801の最上端が存在する座標(Y=0)の横方向ラインにおいて、属性境界801の横方向(X)座標は3であるから、開始X座標は3である。境界2〜8についても同様であるから、説明は省略する。   In the boundary header of boundary 1 representing the attribute boundary 801, information indicating that it is an attribute boundary is recorded as the boundary type, and 2 that is the attribute value of the pixel in the right region of the attribute boundary 801 is recorded as the attribute value. Further, since the uppermost end of the attribute boundary 801 exists in the horizontal line of coordinates (Y = 0), the top Y coordinate is 0, and the lowermost end exists in the horizontal line of coordinates (Y = 3). The end Y coordinate is 3. Furthermore, since the horizontal (X) coordinate of the attribute boundary 801 is 3 in the horizontal line of the coordinate (Y = 0) where the uppermost end of the attribute boundary 801 exists, the start X coordinate is 3. Since the same applies to the boundaries 2 to 8, the description thereof is omitted.

第1の領域についての境界である境界0の軌跡データとしては、開始境界の軌跡データと終端境界の軌跡データとが記録される。先頭Y座標(Y=0)から末尾Y座標(Y=9)までの開始境界の横方向(X)座標は、順に0、0、0、0、0、0、1、2、3、4である。本実施形態では、開始境界の軌跡データとして、隣接する横方向ライン間での横方向(X)座標の差分である0、0、0、0、0、+1、+1、+1、+1を記録する。同様に、先頭Y座標(Y=0)から末尾Y座標(Y=9)までの終端境界の横方向(X)座標は、順に2、5、5、6、7、6、6、6、5、5である。したがって、終端境界の軌跡データとしては、隣接する横方向ライン間での横方向(X)座標の差分である+3、0、+1、+1、−1、0、0、−1、0を記録する。   The trajectory data of the start boundary and the trajectory data of the end boundary are recorded as the trajectory data of the boundary 0 that is the boundary for the first region. The horizontal (X) coordinates of the start boundary from the start Y coordinate (Y = 0) to the end Y coordinate (Y = 9) are 0, 0, 0, 0, 0, 0, 1, 2, 3, 4 in order. It is. In this embodiment, 0, 0, 0, 0, 0, +1, +1, +1, +1, which are differences in the horizontal (X) coordinates between adjacent horizontal lines, are recorded as the trajectory data of the start boundary. . Similarly, the lateral direction (X) coordinates of the end boundary from the start Y coordinate (Y = 0) to the end Y coordinate (Y = 9) are 2, 5, 5, 6, 7, 6, 6, 6, 5 and 5. Therefore, +3, 0, +1, +1, −1, 0, 0, −1, 0, which is the difference in the horizontal (X) coordinate between adjacent horizontal lines, is recorded as the trajectory data of the end boundary. .

属性境界801を表す境界1の軌跡データとしては、属性境界801の軌跡データが記録される。属性境界801の、先頭Y座標(Y=0)から末尾Y座標(Y=3)までの開始境界の横方向(X)座標は、順に3、6、6、7である。そこで、属性境界801を表す境界1の軌跡データとしては、横方向(X)座標の差分である+3、0、+1を記録する。境界2〜8についても同様であるから、説明は省略する。   As the locus data of the boundary 1 representing the attribute boundary 801, the locus data of the attribute boundary 801 is recorded. The horizontal (X) coordinates of the start boundary from the start Y coordinate (Y = 0) to the end Y coordinate (Y = 3) of the attribute boundary 801 are 3, 6, 6, and 7, respectively. Therefore, as trajectory data of the boundary 1 representing the attribute boundary 801, +3, 0, and +1 that are differences in the horizontal (X) coordinates are recorded. Since the same applies to the boundaries 2 to 8, the description thereof is omitted.

次に、非可逆圧縮データについて説明する。矩形領域6の非可逆圧縮データはJPEGによって圧縮されたデータであり、8×8画素のMCU4個で構成され、MCUは縦横それぞれ2個並んでいる。非可逆圧縮データは、矩形領域6の全画素の色値を示す。従って、可逆圧縮領域である第1の領域601、第3の領域603、第4の領域604、第6の領域606、及び第7の領域607についても色値を有している。   Next, lossy compressed data will be described. The lossy compressed data in the rectangular area 6 is data compressed by JPEG, and is composed of four MCUs each having 8 × 8 pixels, and two MCUs are arranged vertically and horizontally. The irreversible compressed data indicates the color values of all the pixels in the rectangular area 6. Therefore, the first region 601, the third region 603, the fourth region 604, the sixth region 606, and the seventh region 607, which are lossless compression regions, also have color values.

図10は、第2の復号部111及び第1の出力部112の構成の一例を示す。図10において、第2の復号部111は、データ読込部1001、境界追跡部1003、スパン情報生成部1004、領域色/属性値読取部1005、属性値読取部1006、及び属性値結合部1007を備える。また、第1の出力部112は、画像読込部1002及び画素選択部1008を備える。   FIG. 10 shows an exemplary configuration of the second decoding unit 111 and the first output unit 112. In FIG. 10, the second decoding unit 111 includes a data reading unit 1001, a boundary tracking unit 1003, a span information generation unit 1004, a region color / attribute value reading unit 1005, an attribute value reading unit 1006, and an attribute value combining unit 1007. Prepare. The first output unit 112 includes an image reading unit 1002 and a pixel selection unit 1008.

以下では、ビットマップ1の矩形領域6について復号を行う場合について説明するが、矩形領域1〜矩形領域W×HまでのW×H個の矩形領域について順次復号を行うことにより、ビットマップ1の全体を復号することができる。また、ビットマップ1〜Bのそれぞれについてこのような処理を行うことにより、画像全体を復号することができる。   In the following, a case where decoding is performed on the rectangular area 6 of the bitmap 1 will be described. By sequentially decoding W × H rectangular areas from the rectangular area 1 to the rectangular area W × H, The whole can be decoded. Further, by performing such processing for each of the bitmaps 1 to B, the entire image can be decoded.

データ読込部1001は、制御部109の指示に従ってRAM102から圧縮ビットマップデータ502に含まれるビットマップ1の矩形領域6の可逆圧縮データを読み込む。画像読込部1002は、第1の復号部110が圧縮ビットマップデータ502に含まれるビットマップ1の矩形領域6の非可逆圧縮データを復号することにより得た、画像データを読み込む。   The data reading unit 1001 reads lossless compressed data of the rectangular area 6 of the bitmap 1 included in the compressed bitmap data 502 from the RAM 102 in accordance with an instruction from the control unit 109. The image reading unit 1002 reads image data obtained by the first decoding unit 110 decoding the lossy compressed data of the rectangular area 6 of the bitmap 1 included in the compressed bitmap data 502.

境界追跡部1003及びスパン情報生成部1004は、可逆圧縮データ901の軌跡データ部に格納された軌跡データを参照して、スパン情報を生成する。スパン情報は、可逆圧縮領域については、画像の横方向ライン上で同一の色値及び属性値を有する画素群の位置を示す。また、スパン情報は、非可逆圧縮領域については、画像の横方向ライン上で同一の属性値を有する画素群の位置を示す。上述のように、この軌跡データには、色値が変化する境界及び属性値が変化する境界の位置情報が記録されている。   The boundary tracking unit 1003 and the span information generation unit 1004 generate span information with reference to the trajectory data stored in the trajectory data portion of the lossless compressed data 901. The span information indicates the position of the pixel group having the same color value and attribute value on the horizontal line of the image for the lossless compression region. The span information indicates the position of the pixel group having the same attribute value on the horizontal line of the image for the lossy compression region. As described above, in the locus data, position information on the boundary where the color value changes and the boundary where the attribute value changes is recorded.

本実施形態の場合、境界追跡部1003はさらに、境界0〜境界E−1のそれぞれについて、境界ヘッダを参照して可逆圧縮領域境界の開始境界及び終端境界、並びに属性境界の始点及び終点を取得する。そして境界追跡部1003は、軌跡データを参照して座標値を更新することで、境界0〜境界E−1のそれぞれについて、可逆圧縮領域境界の開始境界及び終端境界、並びに属性境界の位置を決定及び保持する。   In the case of the present embodiment, the boundary tracking unit 1003 further acquires the start boundary and the end boundary of the lossless compression region boundary and the start point and end point of the attribute boundary for each of the boundary 0 to the boundary E-1 by referring to the boundary header. To do. Then, the boundary tracking unit 1003 determines the positions of the start boundary and the end boundary of the lossless compression region boundary and the position of the attribute boundary for each of the boundary 0 to the boundary E-1 by updating the coordinate value with reference to the trajectory data. And hold.

スパン情報生成部1004は、各横方向ライン上に存在する境界のX座標を参照して、横方向ライン上にある領域の画素数を算出する。そして、スパン情報生成部1004は、横方向ライン上にある領域のそれぞれについて、左端境界のX座標と画素数とで構成されるスパン情報を生成する。スパン情報生成部1004は、境界ヘッダに基づいて、それぞれのスパン情報が、可逆圧縮領域のスパン情報であるか、非可逆圧縮領域のスパン情報であるか、を知ることができる。   The span information generation unit 1004 calculates the number of pixels in the region on the horizontal line with reference to the X coordinate of the boundary existing on each horizontal line. The span information generation unit 1004 generates span information including the X coordinate of the left end boundary and the number of pixels for each of the regions on the horizontal line. Based on the boundary header, the span information generation unit 1004 can know whether each piece of span information is span information of a lossless compression area or irreversible compression area.

領域色/属性値読取部1005は、可逆圧縮データ901のヘッダ部に格納された境界ヘッダを参照して、スパン情報に示される画素群の色値及び属性値を決定する。上述のように、この境界ヘッダには、境界によって区切られる領域の色値及び属性値を示す情報が記録されている。具体的には、領域色/属性値読取部1005は、可逆圧縮領域のそれぞれについて、スパン情報に対応する色値と属性値とを境界ヘッダから読み取る。   The area color / attribute value reading unit 1005 refers to the boundary header stored in the header part of the lossless compressed data 901 and determines the color value and attribute value of the pixel group indicated in the span information. As described above, information indicating the color value and attribute value of the area delimited by the boundary is recorded in the boundary header. Specifically, the area color / attribute value reading unit 1005 reads the color value and attribute value corresponding to the span information from the boundary header for each lossless compression area.

属性値読取部1006は、非可逆圧縮領域のそれぞれについて、境界ヘッダからスパン情報に対応する属性値を読み取る。属性値結合部1007は、画像読込部1002が読み込んだ画像における色値と、属性値結合部1007が読み取った属性値とを結合することで、スパン情報に対応する画素に色値と属性値とを設定する。   The attribute value reading unit 1006 reads the attribute value corresponding to the span information from the boundary header for each lossy compression area. The attribute value combining unit 1007 combines the color value in the image read by the image reading unit 1002 and the attribute value read by the attribute value combining unit 1007, so that the color value and the attribute value are added to the pixel corresponding to the span information. Set.

画素選択部1008は、スパン情報に基づいて可逆圧縮領域の画素と非可逆圧縮領域の画素を選択し、順次選択された画素の色値と属性値とを出力する。こうして、可逆圧縮データ及び非可逆圧縮データの復号が完了する。   The pixel selection unit 1008 selects a pixel in the lossless compression region and a pixel in the lossy compression region based on the span information, and outputs the color value and attribute value of the sequentially selected pixels. Thus, the decoding of the lossless compressed data and the lossy compressed data is completed.

本実施形態における画像処理方法について、図11のフローチャートを参照して簡単に説明する。図11(A)は、符号化処理のフローチャートである。ステップS1110において、領域分割部302は、上述のように、色値及び属性値を有する画素で構成される入力画像を、可逆圧縮領域と非可逆圧縮領域とに分割する。ステップS1115において、境界抽出部401は、入力画像中で色値が変化する境界及び属性値が変化する境界を特定する。ステップS1120において、ヘッダ生成部402は、境界によって区切られる領域の色値及び属性値を示す情報を、可逆圧縮データのヘッダ部に格納する。ステップS1125において、軌跡生成部403は、境界の位置情報を、可逆圧縮データの軌跡データ部に格納する。ステップS1130において、第1の符号化部304は、非可逆圧縮領域内の入力画像を表す非可逆圧縮データを生成する。   The image processing method in the present embodiment will be briefly described with reference to the flowchart of FIG. FIG. 11A is a flowchart of the encoding process. In step S1110, the region dividing unit 302 divides an input image composed of pixels having color values and attribute values into a lossless compression region and a lossy compression region as described above. In step S1115, the boundary extraction unit 401 identifies a boundary where the color value changes and a boundary where the attribute value changes in the input image. In step S1120, the header generation unit 402 stores information indicating the color value and attribute value of the region delimited by the boundary in the header portion of the lossless compressed data. In step S1125, the trajectory generation unit 403 stores the boundary position information in the trajectory data portion of the lossless compressed data. In step S1130, the first encoding unit 304 generates lossy compressed data representing an input image in the lossy compression region.

図11(B)は、復号処理のフローチャートである。ステップS1150において、データ読込部1001は、可逆圧縮データを取得する。ステップS1155において、スパン情報生成部1004は、可逆圧縮データの軌跡データ部に格納された、色値が変化する境界及び属性値が変化する境界の位置情報を参照する。そして、スパン情報生成部1004は、可逆圧縮領域について、画像の横方向ライン上で同一の色値及び属性値を有する画素群の位置を示すスパン情報を生成する。また、スパン情報生成部1004は、非可逆圧縮領域について、画像の横方向ライン上で同一の属性値を有する画素群の位置を示すスパン情報を生成する。ステップS1160において、領域色/属性値読取部1005は、可逆圧縮データのヘッダ部に格納された、境界によって区切られる領域の色値及び属性値を示す情報を参照する。そして、領域色/属性値読取部1005は、可逆圧縮領域について、スパン情報に示される画素群の色値及び属性値を決定する。ステップS1165において、属性値読取部1006は、非可逆圧縮領域について、スパン情報に示される画素群の属性値を決定する。ステップS1170において、第1の復号部110は、非可逆圧縮データを復号することにより画像データを生成する。ステップS1175において、属性値結合部1007は、非可逆圧縮領域について、ステップS1170で得られた画像データにおける色値と、ステップS1165で決定された属性値とを結合することで、スパン情報に対応する画素に色値と属性値とを設定する。   FIG. 11B is a flowchart of the decoding process. In step S1150, the data reading unit 1001 acquires lossless compressed data. In step S1155, the span information generation unit 1004 refers to the position information of the boundary where the color value changes and the boundary where the attribute value changes stored in the trajectory data part of the lossless compression data. Then, the span information generation unit 1004 generates span information indicating the position of the pixel group having the same color value and attribute value on the horizontal line of the image for the lossless compression region. Further, the span information generation unit 1004 generates span information indicating the position of a pixel group having the same attribute value on the horizontal line of the image for the lossy compression region. In step S1160, the region color / attribute value reading unit 1005 refers to the information indicating the color value and attribute value of the region delimited by the boundary stored in the header portion of the lossless compressed data. Then, the region color / attribute value reading unit 1005 determines the color value and attribute value of the pixel group indicated in the span information for the lossless compression region. In step S1165, the attribute value reading unit 1006 determines the attribute value of the pixel group indicated in the span information for the lossy compression area. In step S1170, the first decoding unit 110 generates image data by decoding the lossy compressed data. In step S1175, the attribute value combining unit 1007 corresponds to the span information by combining the color value in the image data obtained in step S1170 and the attribute value determined in step S1165 for the lossy compression region. A color value and an attribute value are set for the pixel.

以上述べたように、図3及び図4の構成により、画像データは可逆圧縮領域と非可逆圧縮領域に分割され、圧縮データが生成される。また、図10の構成により、それぞれの圧縮データが復号された後、結合されて画像が復号される。   As described above, the image data is divided into the lossless compression area and the lossy compression area according to the configuration shown in FIGS. 3 and 4, and compressed data is generated. Also, with the configuration of FIG. 10, the respective compressed data is decoded and then combined to decode the image.

画素選択部1008からは画素ごとに色値と属性値とが合わせて出力されるため、復号された画像を用いた画像処理を行う際に、キャッシュを有効活用して高速に処理を行うことができる。また、復号処理中においても、可逆圧縮領域の色値と属性値は両方とも境界ヘッダに格納されているため、同じメモリ領域に色値と属性値とを保持し、領域色/属性値読取部1005による処理をキャッシュを有効活用して高速に行うことができる。このように、図9に示す可逆圧縮データ901を用いることにより、画像処理性能の向上が実現できる。   Since the pixel selection unit 1008 outputs the color value and the attribute value together for each pixel, when performing image processing using the decoded image, the cache can be effectively used to perform processing at high speed. it can. Even during the decoding process, since both the color value and the attribute value of the lossless compression area are stored in the boundary header, the color value and the attribute value are held in the same memory area, and the area color / attribute value reading unit The processing by 1005 can be performed at high speed by effectively using the cache. As described above, the use of the reversible compression data 901 shown in FIG. 9 can improve the image processing performance.

また、本実施形態の方法によれば、境界によって区切られる領域の色値及び属性値を示す情報が可逆圧縮データのヘッダ部に格納される。このため、可逆圧縮領域の画像の色値及び属性値を容易に修正することができる。また、非可逆圧縮領域の画像の属性値も、容易に修正することができる。このような構成によれば、例えばプリンタの内部パラメータが変化した際に、この変化に合わせて、中間データに含まれる画像の色値及び属性値を少ない処理負荷で変更することができる。   Further, according to the method of the present embodiment, information indicating the color value and attribute value of the region delimited by the boundary is stored in the header portion of the lossless compressed data. For this reason, the color value and attribute value of the image in the lossless compression area can be easily corrected. Also, the attribute value of the image in the lossy compression area can be easily corrected. According to such a configuration, for example, when an internal parameter of the printer changes, the color value and attribute value of the image included in the intermediate data can be changed with a small processing load in accordance with the change.

110:第1の復号部、111:第2の復号部、112:第1の出力部、304:第1の符号化部、306:第2の符号化部、401:境界抽出部、402:ヘッダ生成部、403:軌跡生成部   110: 1st decoding part, 111: 2nd decoding part, 112: 1st output part, 304: 1st encoding part, 306: 2nd encoding part, 401: Boundary extraction part, 402: Header generation unit, 403: locus generation unit

Claims (15)

色値及び属性値を有する画素で構成される入力画像中で、色値が変化する境界及び属性値が変化する境界を特定する特定手段と、
前記境界によって区切られる領域の色値及び属性値を示す情報を格納する第1の領域と、前記境界の位置情報を格納する第2の領域と、を含むデータを生成及び出力する第1の圧縮手段と、
を備えることを特徴とする、画像処理装置。
A specifying means for specifying a boundary where a color value changes and a boundary where an attribute value changes in an input image including pixels having a color value and an attribute value;
First compression for generating and outputting data including a first area for storing information indicating color values and attribute values of an area delimited by the boundary, and a second area for storing position information of the boundary Means,
An image processing apparatus comprising:
前記特定手段は、色値及び属性値が変化する境界に加えて、色値が変化しないが属性値が変化する境界を特定することを特徴とする、請求項1に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the specifying unit specifies a boundary where the color value does not change but the attribute value changes in addition to the boundary where the color value and the attribute value change. 前記特定手段は、開始境界と終端境界との組により規定され、前記開始境界と前記終端境界との間にある色値及び属性値が一定である領域を特定し、
前記第1の領域は複数の分割領域を有し、
前記第1の圧縮手段は、前記第1の領域の1つの分割領域に、前記開始境界と終端境界との組により規定される領域の色値及び属性値を格納し、前記開始境界及び前記終端境界の位置情報を前記第2の領域に格納する
ことを特徴とする、請求項1又は2に記載の画像処理装置。
The specifying means specifies a region defined by a set of a start boundary and an end boundary, and having a constant color value and attribute value between the start boundary and the end boundary,
The first region has a plurality of divided regions;
The first compression means stores a color value and an attribute value of an area defined by a set of the start boundary and end boundary in one divided area of the first area, and the start boundary and end terminal The image processing apparatus according to claim 1, wherein boundary position information is stored in the second area.
前記第1の圧縮手段は、前記開始境界及び前記終端境界の起点座標情報及び終点座標情報を前記第1の領域に格納し、前記開始境界及び前記終端境界の軌跡情報を前記第2の領域に格納する
ことを特徴とする、請求項3に記載の画像処理装置。
The first compression means stores start point coordinate information and end point coordinate information of the start boundary and end boundary in the first region, and stores trajectory information of the start boundary and end boundary in the second region. The image processing apparatus according to claim 3, wherein the image processing apparatus is stored.
前記開始境界及び前記終端境界の軌跡情報は、前記開始境界及び前記終端境界が通る座標の座標値を符号化することにより得られることを特徴とする、請求項4に記載の画像処理装置。   The image processing apparatus according to claim 4, wherein the trajectory information of the start boundary and the end boundary is obtained by encoding coordinate values of coordinates through which the start boundary and the end boundary pass. 前記入力画像中に、可逆圧縮領域と非可逆圧縮領域とを設定する設定手段と、
前記非可逆圧縮領域内の前記入力画像を表す非可逆圧縮データを生成及び出力する第2の圧縮手段と、をさらに備え、
前記特定手段は、前記可逆圧縮領域中で、色値が変化する境界及び属性値が変化する境界を特定し、
前記第1の圧縮手段は、前記可逆圧縮領域についての前記色値及び属性値を示す情報を前記第1の領域に格納し、前記データを可逆圧縮データとして出力する
ことを特徴とする、請求項1乃至5の何れか1項に記載の画像処理装置。
Setting means for setting a reversible compression region and a lossy compression region in the input image;
Second compression means for generating and outputting lossy compressed data representing the input image in the lossy compression region;
The specifying means specifies a boundary where a color value changes and a boundary where an attribute value changes in the lossless compression region,
The first compression means stores information indicating the color value and attribute value of the lossless compression area in the first area, and outputs the data as lossless compression data. The image processing apparatus according to any one of 1 to 5.
前記特定手段は、前記非可逆圧縮領域中で、属性値が変化する境界を特定し、
前記第1の圧縮手段は、前記非可逆圧縮領域について、前記境界によって区切られる領域の属性値を示す情報をさらに前記第1の領域に格納し、前記境界の位置情報を前記第2の領域に格納することを特徴とする、請求項6に記載の画像処理装置。
The specifying means specifies a boundary where the attribute value changes in the lossy compression region,
The first compression unit further stores, in the first area, information indicating an attribute value of an area delimited by the boundary for the lossy compression area, and stores the boundary position information in the second area. The image processing apparatus according to claim 6, wherein the image processing apparatus is stored.
前記第1の圧縮手段は、前記属性値が変化する境界における変化後の属性値と、前記属性値が変化する境界の起点座標情報及び終点座標情報とを前記第1の領域に格納し、前記属性値が変化する境界の軌跡情報を前記第2の領域に格納することを特徴とする、請求項7に記載の画像処理装置。   The first compression means stores the attribute value after the change at the boundary where the attribute value changes, the starting point coordinate information and the end point coordinate information of the boundary where the attribute value changes, in the first area, and The image processing apparatus according to claim 7, wherein trajectory information of a boundary where the attribute value changes is stored in the second area. 前記第1の領域は、前記境界が前記可逆圧縮領域中の境界であるか前記非可逆圧縮領域中の境界であるかを示す情報をさらに格納することを特徴とする、請求項7又は8に記載の画像処理装置。   The first area further stores information indicating whether the boundary is a boundary in the lossless compression area or a boundary in the lossy compression area. The image processing apparatus described. 前記第2の圧縮手段は、前記可逆圧縮領域中の画素の色値を所定値に置換してから前記入力画像を非可逆圧縮することで、前記非可逆圧縮データを生成することを特徴とする、請求項7乃至9の何れか1項に記載の画像処理装置。   The second compression unit generates the lossy compressed data by irreversibly compressing the input image after replacing a color value of a pixel in the lossless compression region with a predetermined value. The image processing apparatus according to any one of claims 7 to 9. 色値及び属性値を有する画素で構成される画像において色値が変化する境界及び属性値が変化する境界によって区切られる領域の色値及び属性値を示す第1のデータ要素を第1の領域に含み、
前記境界の位置を示す第2のデータ要素を第2の領域に含む構造を有するデータ。
In an image composed of pixels having color values and attribute values, a first data element indicating a color value and an attribute value of a region delimited by a boundary where the color value changes and a boundary where the attribute value changes is a first region. Including
Data having a structure including a second data element indicating the position of the boundary in a second area.
請求項1乃至10の何れか1項に記載の画像処理装置が出力したデータ、又は請求項11に記載のデータを取得する取得手段と、
前記データの第2の領域に格納された、色値が変化する境界及び属性値が変化する境界の位置情報を参照して、画像の横方向ライン上で同一の色値及び属性値を有する画素群の位置を示すスパン情報を生成する情報生成手段と、
前記データの第1の領域に格納された、前記境界によって区切られる領域の色値及び属性値を示す情報を参照して、前記スパン情報に示される画素群の色値及び属性値を決定する決定手段と、
を備えることを特徴とする、画像処理装置。
An acquisition unit that acquires data output from the image processing apparatus according to any one of claims 1 to 10, or data according to claim 11.
Pixels having the same color value and attribute value on the horizontal line of the image with reference to the position information of the boundary where the color value changes and the boundary where the attribute value changes stored in the second area of the data Information generating means for generating span information indicating the position of the group;
A decision to determine a color value and an attribute value of a pixel group indicated in the span information with reference to information indicating a color value and an attribute value of an area delimited by the boundary stored in the first area of the data; Means,
An image processing apparatus comprising:
画像処理装置が行う画像処理方法であって、
色値及び属性値を有する画素で構成される入力画像中で、色値が変化する境界及び属性値が変化する境界を特定する特定工程と、
前記境界によって区切られる領域の色値及び属性値を示す情報を格納する第1の領域と、前記境界の位置情報を格納する第2の領域と、を含むデータを生成及び出力する圧縮工程と、
を備えることを特徴とする、画像処理方法。
An image processing method performed by an image processing apparatus,
A specifying step of identifying a boundary where a color value changes and a boundary where an attribute value changes in an input image composed of pixels having a color value and an attribute value;
A compression step of generating and outputting data including a first area storing information indicating color values and attribute values of an area delimited by the boundary, and a second area storing position information of the boundary;
An image processing method comprising:
画像処理装置が行う画像処理方法であって、
請求項11に記載のデータ、又は請求項13に記載の画像処理方法で出力されたデータ、を取得する取得工程と、
前記データの第2の領域に格納された、色値が変化する境界及び属性値が変化する境界の位置情報を参照して、画像の横方向ライン上で同一の色値及び属性値を有する画素群の位置を示すスパン情報を生成する情報生成工程と、
前記データの第1の領域に格納された、前記境界によって区切られる領域の色値及び属性値を示す情報を参照して、前記スパン情報に示される画素群の色値及び属性値を決定する決定工程と、
を備えることを特徴とする、画像処理方法。
An image processing method performed by an image processing apparatus,
An acquisition step of acquiring the data according to claim 11 or the data output by the image processing method according to claim 13;
Pixels having the same color value and attribute value on the horizontal line of the image with reference to the position information of the boundary where the color value changes and the boundary where the attribute value changes stored in the second area of the data An information generating step for generating span information indicating the position of the group;
A decision to determine a color value and an attribute value of a pixel group indicated in the span information with reference to information indicating a color value and an attribute value of an area delimited by the boundary stored in the first area of the data; Process,
An image processing method comprising:
コンピュータを、請求項1乃至10及び請求項12の何れか1項に記載の画像処理装置の各手段として機能させるためのプログラム。   A program for causing a computer to function as each unit of the image processing apparatus according to any one of claims 1 to 10 and claim 12.
JP2016104551A 2016-05-25 2016-05-25 Image processing equipment, image processing methods, and programs Active JP6762758B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016104551A JP6762758B2 (en) 2016-05-25 2016-05-25 Image processing equipment, image processing methods, and programs

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016104551A JP6762758B2 (en) 2016-05-25 2016-05-25 Image processing equipment, image processing methods, and programs

Publications (2)

Publication Number Publication Date
JP2017212601A true JP2017212601A (en) 2017-11-30
JP6762758B2 JP6762758B2 (en) 2020-09-30

Family

ID=60475724

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016104551A Active JP6762758B2 (en) 2016-05-25 2016-05-25 Image processing equipment, image processing methods, and programs

Country Status (1)

Country Link
JP (1) JP6762758B2 (en)

Also Published As

Publication number Publication date
JP6762758B2 (en) 2020-09-30

Similar Documents

Publication Publication Date Title
US8660347B2 (en) Image processing apparatus and processing method therefor
US20130155466A1 (en) Image processing device, image processing method, and image forming apparatus
US8971647B2 (en) Image compression apparatus, image compression method, and storage medium
US9536183B2 (en) Image processing device and image processing method
US8369615B2 (en) Image processing apparatus and method for efficiently reducing the amount of image data
US9230200B2 (en) Method of processing graphics with limited memory
US9928452B2 (en) Image decoding apparatus and method therefor
US6850338B1 (en) Method, system, program, and data structure for generating raster objects
JP6762758B2 (en) Image processing equipment, image processing methods, and programs
JP2008148264A (en) Image processing apparatus, method thereof, program and medium
JP6902861B2 (en) Coding device, coding method, decoding device, decoding method and generation method
US8654394B2 (en) Image processing apparatus, control method, and computer-readable medium
JP2017170884A (en) Image processing device, control method thereof, and program
US8582168B2 (en) Image processing apparatus and processing method thereof
JP2010050832A (en) Device and method for processing image, program, and recording medium
CN102572203A (en) Compression method and device for latticed page
CN107567709A (en) Compression of images
CN101394461A (en) Dot array page compression method and apparatus thereof
US20170256026A1 (en) Information processing device, image processing apparatus, and information processing method
US10182178B2 (en) Parallel fast drawing of unrotated delta row encoded images
JP5873272B2 (en) Image coding apparatus and control method thereof
JP5432690B2 (en) Image coding apparatus and control method thereof
JP6521650B2 (en) INFORMATION PROCESSING APPARATUS, CONTROL METHOD FOR INFORMATION PROCESSING APPARATUS, AND PROGRAM
JPH06113145A (en) Image processor
US9398193B2 (en) Image processing apparatus and image processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190521

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20200212

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200306

A601 Written request for extension of time

Free format text: JAPANESE INTERMEDIATE CODE: A601

Effective date: 20200430

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200706

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20200811

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200909

R151 Written notification of patent or utility model registration

Ref document number: 6762758

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151