JP2007295130A - Image data encoder, program, computer-readable recording medium, and image data encoding method - Google Patents

Image data encoder, program, computer-readable recording medium, and image data encoding method Download PDF

Info

Publication number
JP2007295130A
JP2007295130A JP2006118511A JP2006118511A JP2007295130A JP 2007295130 A JP2007295130 A JP 2007295130A JP 2006118511 A JP2006118511 A JP 2006118511A JP 2006118511 A JP2006118511 A JP 2006118511A JP 2007295130 A JP2007295130 A JP 2007295130A
Authority
JP
Japan
Prior art keywords
image
encoding
unit
image data
image type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2006118511A
Other languages
Japanese (ja)
Inventor
Yukio Matsuda
行雄 松田
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.)
Sharp Corp
Original Assignee
Sharp Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sharp Corp filed Critical Sharp Corp
Priority to JP2006118511A priority Critical patent/JP2007295130A/en
Publication of JP2007295130A publication Critical patent/JP2007295130A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To achieve an image data encoder encoding image data including a plurality of objects having different image types at a high compression rate. <P>SOLUTION: The image data encoder 1 imitates the QM-Coder of JBIG. In this case, the image data encoder 1 comprises: a region determination section 22 that detects the image type of a region including a pixel to be encoded extracted by a context generator 21 and determines whether the detected result differs from a previous one; and a table change section 23 for resetting a learning table 32 stored in a recorder 31 when the region determination section 22 determines that the detected result differs from the previous one. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、画像データを算術符号化により符号化する画像データ符号化装置に関するものである。   The present invention relates to an image data encoding apparatus that encodes image data by arithmetic encoding.

2値画像データをマルコフ情報源でモデル化し、符号化対象シンボルをその周辺シンボルの状態に基づいて予測し、予測結果に応じて算術符号化する方式として、JBIG(ITU−T T.82)のQM−Coderが知られている(非特許文献1、2参照)。   As a method of modeling binary image data with a Markov information source, predicting an encoding target symbol based on the state of its surrounding symbols, and performing arithmetic encoding according to the prediction result, JBIG (ITU-T T.82) QM-Coder is known (see Non-Patent Documents 1 and 2).

このQM−Coderは、画像データを構成する2値の入力信号(入力ビット)列を0以上1未満の実数xに変換するものである。QM−Coderは、入力ビットに応じて、予め定めた手順で、符号化結果である実数xの存在し得る範囲(以下、「インターバル」という。)を変化させる。そして、新たなビットの入力にも関わらずインターバルが変化しなくなった場合に、そのインターバルの最小値である低数を符号化結果とする。   This QM-Coder converts a binary input signal (input bit) sequence constituting image data into a real number x of 0 or more and less than 1. The QM-Coder changes the range (hereinafter referred to as “interval”) in which the real number x as the encoding result can exist according to a predetermined procedure in accordance with the input bits. If the interval does not change despite the input of a new bit, the low number that is the minimum value of the interval is used as the encoding result.

より詳細には、QM−Coderは、前回までの入力ビット列から次の(今回の)入力ビットの予測値(優勢確率シンボル(MPS))を計算する。また、この予測に応じて、優勢確率シンボルの出現確率と予想されなかった方の劣勢確率シンボル(LPS)の出現確率との比に応じて、インターバルを2つの領域に分割する。ここで、分割された2つの領域のうち、0に近い方の領域は、優勢確率シンボルの出現確率に対応するMPSインターバルとし、0から遠い方の領域は、LPSの出現確率に対応するLPSインターバルとする。   More specifically, the QM-Coder calculates the predicted value (dominance probability symbol (MPS)) of the next (current) input bit from the input bit string up to the previous time. Further, according to this prediction, the interval is divided into two regions according to the ratio between the appearance probability of the dominant probability symbol and the appearance probability of the inferior probability probability symbol (LPS). Here, of the two divided regions, the region closer to 0 is the MPS interval corresponding to the appearance probability of the dominant probability symbol, and the region far from 0 is the LPS interval corresponding to the appearance probability of LPS. And

QM−Coderは、入力ビットとMPSとが一致する場合には、現在のインターバルからLPSインターバルを取り除くように、インターバルを変化させる。一方、入力ビットとMPSとが一致しない場合には、現在のインターバルからMPSインターバルを取り除くように、インターバルを変化させる。全ての入力列に対する処理が完了したときのインターバルの低数を実数xとし、この実数xを符号化結果とする。上述の処理手順によって、入力ビットが、予想された入力ビットと一致する場合には、インターバルの低数に変化を生じない。このため、出力(符号化結果)にも変化を生ずることがなく、新たなビットを出力する必要もないので、これを利用して符号化を行う。   The QM-Coder changes the interval so as to remove the LPS interval from the current interval when the input bit matches the MPS. On the other hand, if the input bit and the MPS do not match, the interval is changed so as to remove the MPS interval from the current interval. A low number of intervals when processing for all input strings is completed is a real number x, and the real number x is an encoding result. The above procedure does not change the low number of intervals when the input bits match the expected input bits. For this reason, there is no change in the output (encoding result), and there is no need to output a new bit, so encoding is performed using this.

上述のような手順を行うにあたって、符号化処理を実施していくと、インターバルの大きさが次第に小さくなり、やがて計算機の固定精度では表現できなくなってしまう。そこで、インターバルの大きさが0.5以上となるまで繰り返しインターバルの大きさを2倍にする、正規化処理と呼ばれる処理を行う。   When performing the above-described procedure, if the encoding process is performed, the interval size gradually decreases, and eventually cannot be expressed with the fixed accuracy of the computer. Therefore, a process called normalization processing is performed in which the size of the interval is doubled until the size of the interval becomes 0.5 or more.

ここで、QM−Coderにおいては、インターバルの大きさをメモリ領域のレジスタA(Areg)に保持し、インターバルの低数をメモリ領域のレジスタC(Creg)に保持する。また、0から1までのインターバルを、実装の際には、216(=65536)倍した値、すなわち0x0(=0;"0x"は16進数であることを表す)から0x10000(=65536)の16ビットで表現する。この場合、レジスタAには、大きさが0.5(0x8000)以上かつ1以下となるように正規化されたインターバルが入る。なお、レジスタAに記憶される値が、正規化処理によって2倍にされる度に、レジスタCに記憶される値も2倍とする。このため、レジスタAの値を2倍化していることによる出力への影響は相殺される。 Here, in the QM-Coder, the size of the interval is held in the register A (Areg) in the memory area, and the low number of intervals is held in the register C (Creg) in the memory area. In addition, the interval from 0 to 1 is multiplied by 2 16 (= 65536) at the time of implementation, that is, 0x0 (= 0; “0x” represents a hexadecimal number) to 0x10000 (= 65536). It is expressed by 16 bits. In this case, the register A contains a normalized interval so that the size is 0.5 (0x8000) or more and 1 or less. Each time the value stored in the register A is doubled by the normalization process, the value stored in the register C is also doubled. For this reason, the influence on the output caused by doubling the value of the register A is offset.

また、LPSインターバルを算出するには、本来、
(インターバルの大きさ)×(LPS出現確率)
という演算が必要であるが、QM−Coderの実装形態においては、このLPSインターバルの値を、統計的に求められた推定値(LSZ)によって近似する。このLSZは、予測に用いる前回までの入力ビット列と対応付けられたテーブルとして与えられる。
In order to calculate the LPS interval,
(Interval size) x (LPS appearance probability)
However, in the QM-Corder implementation, the value of this LPS interval is approximated by an estimated value (LSZ) obtained statistically. This LSZ is given as a table associated with the previous input bit string used for prediction.

以上をまとめると、QM−Coderの実装形態においては、入力としてMPSが与えられた際にはインターバルからLSZを引き、入力としてLPSが与えられたときにはインターバルをLSZとする。また、この操作の結果インターバルが0.5以下となったときには正規化を行う。正規化が行われたときにはLSZの値を更新する。また、上述の操作によって、MPSインターバルよりもLPSインターバルの方が大きくなってしまう場合がある。このときは、MPSインターバルとLPSインターバルの入れ替えを行う。   In summary, in the implementation form of QM-Coder, when MPS is given as an input, LSZ is subtracted from the interval, and when LPS is given as an input, the interval is set to LSZ. Also, normalization is performed when the interval of this operation becomes 0.5 or less. When normalization is performed, the value of LSZ is updated. Moreover, the LPS interval may become larger than the MPS interval due to the above-described operation. At this time, the MPS interval and the LPS interval are exchanged.

図12は、JBIGのQM−Coderを実装した従来の符号化装置の機能構成を示すブロック図である。また、図13は、従来の符号化装置による処理の流れを示すフロー図である。図12に示すように、従来の符号化装置100は、概略的に、コンテクスト生成部122、取得部123、算術符号化部129、記録部125、レジスタ126を備えている。   FIG. 12 is a block diagram showing a functional configuration of a conventional encoding apparatus in which JBIG QM-Coder is implemented. FIG. 13 is a flowchart showing the flow of processing by the conventional encoding apparatus. As shown in FIG. 12, the conventional encoding device 100 generally includes a context generation unit 122, an acquisition unit 123, an arithmetic encoding unit 129, a recording unit 125, and a register 126.

符号化装置100に2値画像データが入力されると、コンテクスト生成部122が、入力画像を少なくとも1つ以上のストライプに分ける(S150)。このストライプは、符号化処理を行う単位であり、画像中の1ライン以上の横ラインからなるものである。S150からS164までのストライプごとのループ(LOOP_A)によって、全てのストライプに対して処理が完了すると、画像の符号化処理が完了する。   When binary image data is input to the encoding apparatus 100, the context generation unit 122 divides the input image into at least one stripe (S150). The stripe is a unit for performing the encoding process, and is composed of one or more horizontal lines in the image. When the processing for all stripes is completed by the loop for each stripe (LOOP_A) from S150 to S164, the image encoding processing is completed.

コンテクスト生成部122は、符号化対象となる画素(符号化対象画素)を選択してその値(シンボル)を読み取る(S151)。ここで対象画素の選択は、ストライプの左上から右下に向けて順次行われる。S151〜S162のループ(LOOP_B)によって対象画素についての符号化を行い、ストライプに含まれる全ての画素について符号化処理が完了すると、1つのストライプの処理が完了したことになる。続いて、コンテクスト生成部122は、対象画素の周辺に存在している複数の周辺画素の値を読み取り、コンテクストを抽出する(S152)。コンテクストは、周辺画素群のパターンを示すものである。   The context generation unit 122 selects a pixel to be encoded (encoding target pixel) and reads the value (symbol) (S151). Here, the target pixel is selected sequentially from the upper left to the lower right of the stripe. When the encoding of the target pixel is performed by the loop (LOOP_B) of S151 to S162 and the encoding process is completed for all the pixels included in the stripe, the process of one stripe is completed. Subsequently, the context generation unit 122 reads the values of a plurality of peripheral pixels existing around the target pixel, and extracts the context (S152). The context indicates the pattern of the peripheral pixel group.

次に、取得部123が、記録部125の学習テーブル127にアクセスして、S152で抽出したコンテクストに対応するMPS及び劣勢確率シンボルの出現確率推定値のインデックスSTを取得する(S153)。   Next, the acquisition unit 123 accesses the learning table 127 of the recording unit 125 to acquire the index ST of the appearance probability estimation value of the MPS and the inferior probability symbol corresponding to the context extracted in S152 (S153).

次に、前処理部129dが、S151で読み取った対象画素の値(シンボル)と、S153で取得したMPSとに応じて、対象画素の値がMPSであるか否かを判別する(S154)。S154において対象画素の値がMPSであると判別された場合には、算術符号化部129において、MPS処理部129aがMPS処理(CODE_MPS:S155〜S158)を行う。一方、S154において対象画素の値がLPSであると判別された場合には、算術符号化部129に含まれるLPS処理部129bがLPS処理(CODE_LPS:S159〜S161)を行う。   Next, the preprocessing unit 129d determines whether or not the value of the target pixel is MPS based on the value (symbol) of the target pixel read in S151 and the MPS acquired in S153 (S154). When it is determined in S154 that the value of the target pixel is MPS, the MPS processing unit 129a performs MPS processing (CODE_MPS: S155 to S158) in the arithmetic coding unit 129. On the other hand, when it is determined in S154 that the value of the target pixel is LPS, the LPS processing unit 129b included in the arithmetic coding unit 129 performs LPS processing (CODE_LPS: S159 to S161).

MPS処理部129aは、記録部125の確率推定テーブル128にアクセスして、S153で取得したインデックスSTに対応する劣勢確率シンボルの出現確率推定値(LSZ)を取得し、これに応じてレジスタ126のAreg126a及びCreg126bを書き換える(S155)。そして、MPS処理部129aは、Areg126aの値が0.5未満であるか否かを判別して(S56)、0.5未満である場合にはS157に進み、0.5以上の場合にはS162に進む。S157ではMPS処理部129aがRENORM処理部129cに指示して、RENORM処理部129cがレジスタ126のAreg126a及びCreg126bに対して正規化処理をし、得られた符号化データを必要に応じて出力する。続いて、MPS処理部129aは、記録部125の確率推定テーブル128を参照して、記録部125の学習テーブル128をS154における判別結果に応じて更新し(S158)、S162に進む。   The MPS processing unit 129a accesses the probability estimation table 128 of the recording unit 125 to acquire the appearance probability estimated value (LSZ) of the inferior probability symbol corresponding to the index ST acquired in S153, and according to this, the register 126 stores The Areg 126a and the Creg 126b are rewritten (S155). Then, the MPS processing unit 129a determines whether or not the value of the Areg 126a is less than 0.5 (S56). If it is less than 0.5, the process proceeds to S157, and if it is 0.5 or more, The process proceeds to S162. In S157, the MPS processing unit 129a instructs the RENORM processing unit 129c, and the RENORM processing unit 129c normalizes the Areg 126a and the Creg 126b of the register 126, and outputs the obtained encoded data as necessary. Subsequently, the MPS processing unit 129a refers to the probability estimation table 128 of the recording unit 125, updates the learning table 128 of the recording unit 125 according to the determination result in S154 (S158), and proceeds to S162.

一方、S159では、LPS処理部129bが、記録部125の確率推定テーブル128にアクセスして、S153で取得したインデックスSTに対応する劣勢確率シンボルの確率推定値を取得し、これに応じてレジスタ126のAreg126a、Creg126bを書き換える(S159)。そして、S160では、LPS処理部129bが、レジスタ126のAreg126a及びCreg126bに対して、確率推定テーブル128のSWITCHの値に応じて、LPSとMPSとの入れ替え及び符号出力を行う。すなわち、LPS処理部129bは、インデックスSTに対応する確率推定テーブル128のSWITCHの値が1か否かによって、入れ替えを行うかどうかを判断する。LPS処理部129bは、記録部125の確率推定テーブル128を参照して、記録部125の学習テーブル128をS154における判別結果及びSWITCHの値に応じて更新し(S161)、S162に進む。   On the other hand, in S159, the LPS processing unit 129b accesses the probability estimation table 128 of the recording unit 125 to acquire the probability estimation value of the inferior probability symbol corresponding to the index ST acquired in S153, and the register 126 accordingly. Areg 126a and Creg 126b are rewritten (S159). Then, in S160, the LPS processing unit 129b performs switching between LPS and MPS and code output for the Areg 126a and Creg 126b of the register 126 according to the value of SWITCH of the probability estimation table 128. That is, the LPS processing unit 129b determines whether or not to perform the replacement depending on whether or not the value of SWITCH in the probability estimation table 128 corresponding to the index ST is 1. The LPS processing unit 129b refers to the probability estimation table 128 of the recording unit 125, updates the learning table 128 of the recording unit 125 according to the determination result in S154 and the value of SWITCH (S161), and proceeds to S162.

S162では、算術符号化部129がコンテクスト生成部122に対して画素インクリメントの指示を行い、画素についてのループを終了する。このような手順をストライプの全ての画素に対して行うことで、ストライプの符号化が行われる。S163では、ストライプについての処理が終了したか否かを判別し、終了していた場合にはレジスタ126が符号化済みデータを出力する(フラッシュ処理:S163)。このように、次のストライプの符号化に進む前に、ここまでの符号化結果のうちで、まだ出力されていない部分を出力する。S164では、コンテクスト生成部122が新たなストライプを選択する。全てのストライプの符号化が完了すれば画像全体の符号化が完了したことになり、入力画像データの全てを符号化した場合には、処理を終了する。   In S162, the arithmetic encoding unit 129 instructs the context generation unit 122 to increment the pixel, and the loop for the pixel ends. By performing such a procedure for all the pixels of the stripe, the encoding of the stripe is performed. In S163, it is determined whether or not the processing for the stripe has been completed. If it has been completed, the register 126 outputs the encoded data (flash processing: S163). Thus, before proceeding to the encoding of the next stripe, the portion of the encoding result so far that has not been output is output. In S164, the context generation unit 122 selects a new stripe. If encoding of all stripes is completed, it means that encoding of the entire image has been completed. If all of the input image data has been encoded, the process is terminated.

このように、学習型の算術符号化を用いるQM−Coderでは、コンテクストに基づいたシンボル出現確率の推定値(LSZ)が、学習テーブル127及び確率推定テーブル128に基づいて決定される。そして、学習テーブル127は、符号化対象画素の値がMPSであるかLPSであるかに応じて、確率推定テーブル128に示された更新内容に基づいて更新される。従って、学習テーブル127は、入力画像データの符号化に伴って最適化され、その結果、画像データの圧縮率が向上する。   As described above, in the QM-coder using the learning type arithmetic coding, the estimated value (LSZ) of the symbol appearance probability based on the context is determined based on the learning table 127 and the probability estimation table 128. The learning table 127 is updated based on the update contents shown in the probability estimation table 128 depending on whether the value of the encoding target pixel is MPS or LPS. Therefore, the learning table 127 is optimized as the input image data is encoded, and as a result, the compression rate of the image data is improved.

ところで、特許文献1では、算術符号化を行う際に、コンテクストに対応するシンボル出現確率推定値が示されたテーブルを、文書画像用、網点又はディザ画像用、及び誤差拡散画像用等の画像の種類ごとに複数用意しておき、入力画像に対して領域判定を行った結果に基づいて、算術符号化に使用するテーブルを選択する画像符号化装置が提案されている。なお、特許文献1に記載された画像符号化装置において、領域判定は、入力された画像データから統計的な手法を用いて領域情報を求めることにより行われている。
ITU-T(International Telecommunication Union Telecommunication standardization sector) WHITE BOOK ディジタル静止画像圧縮符号化関連勧告書(財団法人 新日本ITU協会) 勧告T.82 WTSC-93 (WORLD TELECOMMUNICATION STANDARDIZATION CONFERENCE), Helsinki, 1-12 MARCH 1993 特開平9−135358号公報(1997年5月20日公開)
By the way, in Patent Document 1, when arithmetic coding is performed, tables indicating symbol appearance probability estimation values corresponding to contexts are used as images for document images, halftone dots or dither images, and error diffusion images. There has been proposed an image encoding device that prepares a plurality of types for each type and selects a table to be used for arithmetic encoding based on a result of region determination on an input image. Note that in the image encoding device described in Patent Document 1, region determination is performed by obtaining region information from input image data using a statistical method.
ITU-T (International Telecommunication Union Telecommunication standardization sector) WHITE BOOK Digital still image compression coding related recommendation (New Japan ITU Association) Recommendation T.82 WTSC-93 (WORLD TELECOMMUNICATION STANDARDIZATION CONFERENCE), Helsinki, 1-12 MARCH 1993 Japanese Patent Laid-Open No. 9-135358 (published on May 20, 1997)

しかしながら、上述した従来のQM−Coderは、文字、図形及び写真等の複数の異なるオブジェクトが混在した画像を符号化するときに、満足のいく圧縮率が得られないという問題を抱えている。   However, the above-described conventional QM-Coder has a problem that a satisfactory compression rate cannot be obtained when an image in which a plurality of different objects such as characters, graphics, and photographs are mixed is encoded.

入力画像データの基となる画像には、複数種類の部分画像が含まれることが多い。例えば、文字、図形及び写真等が各所に配置された画像が作成されることがある。このように、符号化対象となる画像中に互いに異なる複数種類のオブジェクトが含まれる場合、オブジェクトの境界領域において、学習テーブル127の学習率が低下する傾向がある。この問題について具体的に説明すると以下の通りである。   An image that is the basis of input image data often includes a plurality of types of partial images. For example, an image in which characters, figures, photographs, etc. are arranged in various places may be created. As described above, when a plurality of different types of objects are included in the image to be encoded, the learning rate of the learning table 127 tends to decrease in the boundary region between the objects. This problem will be specifically described as follows.

例えば、入力画像データにおいて、文字領域に含まれる画素を順次符号化しているとする。この際、学習テーブル127が最適化されていくが、この場合、学習テーブル127は、文字領域の画素についてのシンボル出現確率を精度よく推定できるように最適化される。ここで、符号化対象の画素が文字領域から写真領域に移行した場合、文字領域用に最適化された学習テーブルによって、写真領域の画素におけるシンボルの出現確率を精度よく推定することはできない。そこで、学習テーブル127を写真領域用に再度最適化する必要が生じる。ここで、学習テーブル127が写真領域用に最適化されるまでの間は、圧縮率の低下を招いてしまう。   For example, assume that pixels included in a character area are sequentially encoded in input image data. At this time, the learning table 127 is optimized. In this case, the learning table 127 is optimized so that the symbol appearance probability for the pixels in the character area can be estimated with high accuracy. Here, when the encoding target pixel shifts from the character region to the photo region, the appearance probability of the symbol in the pixel of the photo region cannot be accurately estimated by the learning table optimized for the character region. Therefore, it is necessary to optimize the learning table 127 again for the photographic area. Here, the compression ratio is lowered until the learning table 127 is optimized for the photographic area.

なお、文字領域用に最適化された学習テーブル127は、未学習の状態よりも、写真領域の画素におけるシンボルの出現確率の推定精度が劣り、かつ、最適化に長い期間を必要とする場合も少なくない。なぜならば、通常、未学習の学習テーブルは、各領域用に特化したものではなく、平均的な内容に設定されるからである。   Note that the learning table 127 optimized for the character area may be less accurate in estimating the appearance probability of the symbols in the pixels in the photographic area than the unlearned state, and may require a long period for optimization. Not a few. This is because an unlearned learning table is usually not specialized for each area but is set to average contents.

このような理由から、従来のQM−Coderにおいては、異なる画像種別のオブジェクトが混在する画像のデータを符号化する際に、オブジェクト間の境界領域で圧縮率が低下し、満足のいく圧縮率が得られない。   For this reason, in the conventional QM-Coder, when encoding image data in which objects of different image types are mixed, the compression rate decreases in the boundary region between the objects, and a satisfactory compression rate is obtained. I can't get it.

また、特許文献1には、符号化対象画素が含まれる画像領域を判定することについて記載されているが、特許文献1では、画像領域を判定するために、入力画像データに基づいた統計的手法を採用している。しかしながら、入力画像データから統計的に画像領域を判定するためには多大な計算量及び統計データを必要とし、その上、正確さに欠けるという欠点がある。   Patent Document 1 describes determining an image area including a pixel to be encoded. However, Patent Document 1 describes a statistical method based on input image data in order to determine an image area. Is adopted. However, in order to statistically determine an image region from input image data, a large amount of calculation and statistical data are required.

以上のように、本発明は、上記問題点に鑑みてなされたものであり、その主たる目的は、複数の異なる画像種別のオブジェクトが混在する画像のデータであっても、高い圧縮率で符号化することのできる画像データ符号化装置を実現することにある。   As described above, the present invention has been made in view of the above problems, and its main purpose is to encode data with a high compression rate even for image data in which objects of a plurality of different image types are mixed. An object of the present invention is to realize an image data encoding device capable of performing the above.

そして、本発明のさらなる目的は、符号化対象のデータが画像中のどのような画像種別の領域に由来しているかを、簡便かつ正確に検出することのできる画像データ符号化装置を実現することにある。   A further object of the present invention is to realize an image data encoding device that can easily and accurately detect what image type region in an image the data to be encoded is derived from. It is in.

上記課題を解決するために、本発明に係る画像データ符号化装置は、画像のデータを構成するシンボルを符号化対象シンボルとし、該符号化対象シンボルを、周辺シンボルのパターンから推定されるシンボル出現確率に基づいて算術符号化により順次符号化する画像データ符号化装置において、上記周辺シンボルのパターンと、上記シンボル出現確率を特定するためのインデックスとの対応関係が示された学習テーブルを格納する学習テーブル記憶手段と、上記学習テーブルに示される上記インデックスと、上記シンボル出現確率と、上記学習テーブルにおける上記インデックスの更新内容を示す更新情報との対応関係が示された確率推定テーブルを格納する確率推定テーブル記憶手段と、上記画像のデータから上記符号化対象シンボルと上記周辺シンボルのパターンとを抽出する抽出手段と、上記抽出手段によって抽出された上記符号化対象シンボルに対応する上記画像中の部分領域の画像種別を検出する画像種別検出手段と、上記画像種別検出手段によって検出された画像種別が、以前に上記画像種別検出手段によって検出された画像種別と異なっている場合に、上記学習テーブル記憶手段に格納されている学習テーブルを変更する学習テーブル変更手段と、上記抽出手段によって抽出された上記周辺シンボルのパターンに対応する上記インデックスを上記学習テーブルから取得し、取得したインデックスに対応する上記出現確率及び上記更新情報を上記確率推定テーブルから取得し、取得した出現確率に基づいて上記抽出手段によって抽出された上記符号化対象シンボルを算術符号化により符号化するとともに、上記符号化対象シンボルと取得した更新情報とに基づいて上記学習テーブルに含まれる上記インデックスを更新する符号化手段と、上記抽出手段、上記画像種別検出手段、上記学習テーブル変更手段、及び上記符号化手段に対して処理を繰り返し実行させるループ手段とを備えていることを特徴とする。   In order to solve the above-described problems, an image data encoding apparatus according to the present invention uses symbols constituting image data as encoding target symbols, and uses the encoding target symbols as symbol appearances estimated from surrounding symbol patterns. Learning that stores a learning table in which a correspondence relationship between a pattern of the peripheral symbols and an index for specifying the symbol appearance probability is stored in an image data encoding device that sequentially encodes by arithmetic encoding based on a probability Probability estimation storing a probability estimation table in which a correspondence relationship between table storage means, the index shown in the learning table, the symbol appearance probability, and update information indicating the update contents of the index in the learning table is shown Table storage means, and the encoding target symbol and the upper Extraction means for extracting a pattern of peripheral symbols, image type detection means for detecting an image type of a partial region in the image corresponding to the encoding target symbol extracted by the extraction means, and the image type detection means Learning table changing means for changing the learning table stored in the learning table storage means when the image type detected by the above is different from the image type previously detected by the image type detecting means; The index corresponding to the pattern of the peripheral symbols extracted by the extraction unit is acquired from the learning table, the appearance probability and the update information corresponding to the acquired index are acquired from the probability estimation table, and the acquired appearance probability The encoding target symbol extracted by the extracting means is calculated based on An encoding unit that performs encoding by encoding and updates the index included in the learning table based on the encoding target symbol and the acquired update information; the extraction unit; the image type detection unit; the learning Table changing means and loop means for causing the encoding means to repeatedly execute processing are provided.

また、上記課題を解決するために、本発明に係る画像データ符号化方法は、画像のデータを構成するシンボルを符号化対象シンボルとし、該符号化対象シンボルを、周辺シンボルのパターンから推定されるシンボル出現確率に基づいて算術符号化により順次符号化する画像データ符号化方法において、抽出手段が、上記画像のデータから上記符号化対象シンボルと上記周辺シンボルのパターンとを抽出する抽出ステップと、画像種別検出手段が、上記抽出ステップにおいて抽出された上記符号化対象シンボルに対応する上記画像中の部分領域の画像種別を検出する画像種別検出ステップと、上記画像種別検出ステップにおいて検出された上記画像種別が、以前に上記画像種別検出ステップにおいて検出された上記画像種別と異なっている場合に、学習テーブル変更手段が、記憶手段に格納されている、上記周辺シンボルのパターンと上記シンボル出現確率を特定するためのインデックスとの対応関係が示された学習テーブルを変更する学習テーブル変更ステップと、符号化手段が、上記記憶手段に格納されている上記学習テーブルから、上記抽出ステップにおいて抽出された上記周辺シンボルのパターンに対応する上記インデックスを取得し、上記学習テーブルに示される上記インデックスと上記シンボル出現確率と上記学習テーブルにおける上記インデックスの更新内容を示す更新情報との対応関係が示された上記確率推定テーブルから、取得したインデックスに対応する上記出現確率及び上記更新情報を取得し、取得した出現確率に基づいて上記抽出ステップにおいて抽出された上記符号化対象シンボルを算術符号化により符号化するとともに、上記符号化対象シンボルと取得した更新情報とに基づいて上記学習テーブルに含まれる上記インデックスを更新する符号化ステップとを含み、上記抽出ステップ、上記画像種別検出ステップ、上記学習テーブル変更ステップ、及び上記符号化ステップを繰り返し実行することを特徴とする。   In order to solve the above problems, an image data encoding method according to the present invention uses symbols constituting image data as encoding target symbols, and the encoding target symbols are estimated from patterns of surrounding symbols. In an image data encoding method for sequentially encoding by arithmetic encoding based on a symbol appearance probability, an extraction unit extracts the encoding target symbol and the peripheral symbol pattern from the image data, and an image An image type detecting unit for detecting an image type of a partial region in the image corresponding to the encoding target symbol extracted in the extracting step; and the image type detected in the image type detecting step. Is different from the image type previously detected in the image type detection step A learning table changing step, wherein the learning table changing means changes the learning table stored in the storage means and indicating the correspondence relationship between the pattern of the surrounding symbols and the index for specifying the symbol appearance probability; The encoding means acquires the index corresponding to the pattern of the peripheral symbols extracted in the extraction step from the learning table stored in the storage means, and the index and the symbol shown in the learning table Acquire the appearance probability and the update information corresponding to the acquired index from the probability estimation table showing the correspondence between the appearance probability and the update information indicating the update contents of the index in the learning table, and the acquired appearance Extracted in the above extraction step based on probability An encoding step that encodes the encoding target symbol by arithmetic encoding and updates the index included in the learning table based on the encoding target symbol and the acquired update information, and the extraction step The image type detecting step, the learning table changing step, and the encoding step are repeatedly executed.

上記構成によれば、画像種別検出手段によって、符号化対象シンボルに対応する上記画像中の部分領域の画像種別(例えば、テキスト、ベクトルグラフィックス、ビットマップ等)が検出される。そして、上記画像種別検出手段によって検出された画像種別が、以前に検出された画像種別と異なっている場合に、学習テーブル変更手段によって、学習テーブル記憶手段に格納されている学習テーブルが変更される。よって、符号化対象シンボルに対応する画像中の部分領域が、画像中の異なる画像種別の領域に移行すると、そのことを画像種別検出手段によって検出することができる。そして、このとき、学習テーブルが変更されるので、それまでの古い画像種別用に最適化された学習テーブルをそのまま用いて、新しい画像種別のデータを符号化対象シンボルとして符号化することがない。そのため、学習テーブルを新しい画像種別に最適化するために必要な期間が短縮され、その結果、画像種別の異なるオブジェクト同士の境界領域での圧縮率の低下を抑制することができる。従って、複数の異なる画像種別のオブジェクトが混在する画像のデータであっても、高い圧縮率で符号化することができる。   According to the above configuration, the image type detection unit detects the image type (for example, text, vector graphics, bitmap, etc.) of the partial area in the image corresponding to the encoding target symbol. When the image type detected by the image type detection unit is different from the previously detected image type, the learning table stored in the learning table storage unit is changed by the learning table change unit. . Therefore, when the partial area in the image corresponding to the encoding target symbol shifts to an area of a different image type in the image, this can be detected by the image type detection means. At this time, since the learning table is changed, the learning table optimized for the old image type so far is used as it is, and the data of the new image type is not encoded as the encoding target symbol. Therefore, the period necessary for optimizing the learning table for a new image type is shortened, and as a result, it is possible to suppress a decrease in the compression rate in the boundary region between objects of different image types. Therefore, even image data in which objects of a plurality of different image types are mixed can be encoded at a high compression rate.

また、上記画像データ符号化装置は、上記学習テーブルのテンプレートとなる初期テーブルを格納する初期テーブル記憶手段をさらに備え、上記学習テーブル変更手段は、上記画像種別検出手段によって検出された上記画像種別が、以前に上記画像種別検出手段によって検出された上記画像種別と異なっている場合に、上記学習テーブル記憶手段に格納されている上記学習テーブルを、上記初期テーブル記憶手段に格納された上記初期テーブルに基づいて書き換えるものであってもよい。   The image data encoding device further includes an initial table storage unit that stores an initial table serving as a template for the learning table, and the learning table changing unit includes the image type detected by the image type detection unit. The learning table stored in the learning table storage means is stored in the initial table stored in the initial table storage means when the image type is different from the image type previously detected by the image type detection means. You may rewrite based on it.

上述したように、或る画像種別用に最適化された学習テーブルを別の画像種別の画像データの符号化に用いると、未学習の状態よりも、シンボルの出現確率の推定精度が劣る場合も少なくない。しかしながら、上記構成によれば、符号化対象シンボルに対応する画像中の部分領域が、画像中の異なる画像種別の領域に移行すると、学習テーブル変更手段によって、学習テーブルの内容が実質的に初期状態にリセットされるので、学習テーブルを新しい画像種別用に最適化するために必要な期間が短縮される。その結果、画像種別の異なるオブジェクト同士の境界領域での圧縮率の低下を抑制することができる。   As described above, when a learning table optimized for a certain image type is used for encoding image data of another image type, the estimation accuracy of the symbol appearance probability may be inferior to an unlearned state. Not a few. However, according to the above configuration, when the partial area in the image corresponding to the encoding target symbol shifts to an area of a different image type in the image, the contents of the learning table are substantially initialized by the learning table changing unit. Therefore, the period required for optimizing the learning table for a new image type is shortened. As a result, it is possible to suppress a decrease in the compression rate in the boundary region between objects of different image types.

また、この場合、上記初期テーブル記憶手段は、上記初期テーブルを上記画像種別ごとに複数格納し、上記学習テーブル変更手段は、上記画像種別検出手段によって検出された上記画像種別が、以前に上記画像種別検出手段によって検出された上記画像種別と異なっている場合に、上記学習テーブルを、上記符号化対象シンボルに対応する上記部分領域の画像種別に応じた上記初期テーブルに基づいて書き換えることが好ましい。   Also, in this case, the initial table storage means stores a plurality of the initial tables for each image type, and the learning table change means determines that the image type detected by the image type detection means is the previous image type. When the image type is different from the image type detected by the type detection unit, the learning table is preferably rewritten based on the initial table corresponding to the image type of the partial area corresponding to the encoding target symbol.

上記構成によれば、学習テーブル変更手段による学習テーブルの書き換えは、符号化対象のデータに対応する部分領域の画像種別に応じた初期テーブルに基づいて行われる。従って、符号化対象シンボルに対応する画像中の部分領域が、画像中の異なる画像種別の領域に移行すると、学習テーブルは、移行先の画像種別に適した内容に書き換えられるので、学習テーブルを移行先の画像種別用に最適化するのに必要な期間をさらに短縮することができ、その結果、圧縮率を一層向上させることができる。   According to the above configuration, the learning table is rewritten by the learning table changing unit based on the initial table corresponding to the image type of the partial area corresponding to the encoding target data. Therefore, when the partial area in the image corresponding to the encoding target symbol shifts to an area of a different image type in the image, the learning table is rewritten with contents suitable for the image type of the transfer destination. The period required for optimization for the previous image type can be further shortened, and as a result, the compression rate can be further improved.

あるいは、上記学習テーブル記憶手段は、上記学習テーブルを上記画像種別ごとに格納し、上記学習テーブル変更手段は、上記画像種別検出手段によって検出された上記画像種別が、以前に上記画像種別検出手段によって検出された上記画像種別と異なっている場合に、上記符号化手段によって参照及び更新される学習テーブルを、上記符号化対象シンボルに対応する上記部分領域の画像種別に応じた学習テーブルに切り換えてもよい。   Alternatively, the learning table storage unit stores the learning table for each image type, and the learning table change unit determines that the image type detected by the image type detection unit is previously detected by the image type detection unit. If the detected image type is different from the detected image type, the learning table referenced and updated by the encoding means may be switched to a learning table corresponding to the image type of the partial area corresponding to the encoding target symbol. Good.

上記構成によれば、学習テーブルが画像種別ごとに用意され、符号化対象シンボルに対応する画像中の部分領域が、画像中の異なる画像種別の領域に移行すると、それに伴って、符号化手段の利用する学習テーブルも移行先の画像種別用のものに切り換えられるので、学習テーブルの最適化をし直す必要がない。従って、圧縮率をさらに向上させることができる。   According to the above configuration, a learning table is prepared for each image type, and when the partial region in the image corresponding to the encoding target symbol is shifted to a region of a different image type in the image, the encoding means Since the learning table to be used is also switched to that for the destination image type, there is no need to re-optimize the learning table. Therefore, the compression rate can be further improved.

また、上記画像データ符号化装置は、上記画像を作成するために画像中に所望の種類のオブジェクトを所望の位置に配置するよう指示する描画命令を受け付ける描画命令受付手段と、上記描画命令受付手段が受け付けた描画命令に従って、上記画像のデータを作成する画像データ作成手段とをさらに備え、上記画像種別検出手段は、上記描画命令受付手段の受け付けた描画命令に基づいて、上記符号化対象シンボルに対応する上記部分領域の画像種別を検出することが好ましい。   In addition, the image data encoding device includes a drawing command receiving unit that receives a drawing command that instructs to place a desired type of object in a desired position in the image in order to create the image, and the drawing command receiving unit. Is further provided with image data creation means for creating the image data in accordance with the drawing command received by the image processing unit, and the image type detection means applies the symbol to be encoded based on the drawing command received by the drawing command reception means. It is preferable to detect the image type of the corresponding partial area.

上記構成によれば、画像種別検出手段による画像種別の判定は、描画命令に基づいて行われる。この描画命令は、画像データ符号化装置によって符号化される画像データを作成するための命令であり、所望のオブジェクト(例えば、テキストオブジェクト、グラフィックスオブジェクト、ビットマップオブジェクト等)を所望の位置に配置するよう指示する命令である。画像種別検出手段は、従来のように画像データから統計的手法によって判定するのではなく、上記の描画命令に基づいて符号化対象シンボルに対応する部分領域の画像種別を判定するため、判定精度が向上する。さらに、統計的手法を用いないので、判定に必要な処理も減少し、効率よく符号化することができる。以上のように、上記構成によれば、符号化対象のデータが画像中のどのような画像種別の領域に由来しているかを、簡便かつ正確に検出することができる。   According to the above configuration, the determination of the image type by the image type detection unit is performed based on the drawing command. This drawing command is a command for creating image data encoded by the image data encoding device, and a desired object (for example, a text object, a graphics object, a bitmap object, etc.) is arranged at a desired position. This is an instruction to instruct. Since the image type detection means determines the image type of the partial area corresponding to the encoding target symbol based on the above drawing command, instead of using a statistical method from image data as in the past, the determination accuracy is high. improves. Furthermore, since no statistical method is used, processing necessary for the determination is reduced, and encoding can be performed efficiently. As described above, according to the above configuration, it is possible to easily and accurately detect which image type region in an image the data to be encoded is derived from.

より具体的には、上記画像データ符号化装置は、上記描画命令受付手段が受け付けた描画命令から、上記画像中に配置されるオブジェクトの種類と当該オブジェクトの上記画像中に占める範囲とを取得し、取得したオブジェクトの上記種別及び範囲に基づいて上記画像を画像種別ごとの部分画像に区分するとともに、区分した部分画像の画像種別と当該部分画像の上記画像中に占める範囲とを示す領域情報を作成する領域情報作成手段をさらに備え、上記画像種別検出手段は、上記領域情報作成手段の作成した領域情報に基づいて、上記符号化対象シンボルに対応する上記部分領域の画像種別を検出することが挙げられる。   More specifically, the image data encoding device acquires the type of an object arranged in the image and a range occupied by the object in the image from the drawing command received by the drawing command receiving unit. And classifying the image into partial images for each image type based on the type and range of the acquired object, and region information indicating the image type of the divided partial image and the range occupied by the partial image in the image. A region information creating unit for creating the image information, and the image type detecting unit detects the image type of the partial region corresponding to the encoding target symbol based on the region information created by the region information creating unit. Can be mentioned.

また、上記画像データ符号化装置は、上記画像のデータを構成する全てのシンボルが符号化されることにより得られた符号化済みの画像のデータに対して、上記領域情報を付加する領域情報付加手段をさらに備えていることが好ましい。   The image data encoding device adds region information to the encoded image data obtained by encoding all symbols constituting the image data. Preferably further means are provided.

上記構成によれば、復号化の際に必要な領域情報が、符号化済みの画像のデータに付加されるので、領域情報をユーザ等が与えてやる必要がなくなり、ユーザの負担が軽減される。   According to the above configuration, the area information necessary for decoding is added to the encoded image data, so it is not necessary for the user or the like to provide the area information, and the burden on the user is reduced. .

また、上記確率推定テーブル記憶手段は、上記確率推定テーブルを上記画像種別ごとに複数格納し、上記画像種別検出手段によって検出された上記画像種別が、以前に上記画像種別検出手段によって検出された上記画像種別と異なっている場合に、上記符号化手段によって参照される上記確率推定テーブルを、上記符号化対象シンボルに対応する上記部分領域の画像種別に応じた確率推定テーブルに切り換えるテーブル切換手段をさらに備えていることが好ましい。   The probability estimation table storage means stores a plurality of the probability estimation tables for each image type, and the image type detected by the image type detection means is detected by the image type detection means before. Table switching means for switching the probability estimation table referred to by the encoding means to a probability estimation table corresponding to the image type of the partial area corresponding to the encoding target symbol when the image type is different from the image type; It is preferable to provide.

上記構成によれば、学習テーブルの更新情報が示された確率推定テーブルが画像種別ごとに用意され、符号化対象シンボルに対応する画像中の部分領域が、画像中の異なる画像種別の領域に移行すると、それに伴って、符号化手段の利用する確率推定テーブルも移行先の画像種別用のものに切り換えられる。これにより、符号化対象シンボルに対応する画像中の部分領域が、画像中の異なる画像種別の領域に移行したときに、学習テーブルの最適化方法(学習方法)が、移行先の画像種別に適したものに変更されるので、学習テーブルの最適化に必要な期間が短縮される。従って、圧縮率をさらに向上させることができる。   According to the above configuration, the probability estimation table indicating the update information of the learning table is prepared for each image type, and the partial region in the image corresponding to the encoding target symbol is shifted to a region of a different image type in the image. Accordingly, the probability estimation table used by the encoding means is also switched to that for the destination image type. As a result, when the partial region in the image corresponding to the encoding target symbol is shifted to a region of a different image type in the image, the learning table optimization method (learning method) is suitable for the destination image type. Therefore, the period required for the optimization of the learning table is shortened. Therefore, the compression rate can be further improved.

また、上記画像データ符号化装置は、上記符号化対象シンボルが上記符号化手段によって順次符号化されることにより得られる算術符号を保持するデータ保持手段をさらに備え、上記符号化データ保持手段は、上記画像種別検出手段によって検出された上記画像種別が、以前に上記画像種別検出手段によって検出された上記画像種別と異なっている場合に、上記算術符号を出力して、自身の保持する算術符号をリセットすることが好ましい。   The image data encoding device further includes data holding means for holding an arithmetic code obtained by sequentially encoding the encoding target symbols by the encoding means, and the encoded data holding means includes: When the image type detected by the image type detection unit is different from the image type previously detected by the image type detection unit, the arithmetic code is output and the arithmetic code held by itself is output. It is preferable to reset.

上記構成によれば、学習テーブルが変更される際に、符号化により得られた算術符号が出力される。従って、復号化の際に、学習テーブルの変更部分における復号化処理が容易になる。   According to the above configuration, when the learning table is changed, an arithmetic code obtained by encoding is output. Therefore, the decoding process at the changed part of the learning table is facilitated at the time of decoding.

なお、上記符号化手段は、QM−Coder方式に従って符号化を行うものであってもよい。また、上記画像データ符号化装置は、上記画像のデータが上記符号化手段によって符号化されることにより得られた符号化済みの画像のデータを画像形成装置に対して出力するデータ出力手段をさらに備えていてもよい。また、上記各手段は、コンピュータがプログラムを実行することにより実現されるものであり、上記描画命令受付手段は、アプリケーションプログラムからオペレーティングシステムを介して上記描画命令を受け付けるものであってもよい。   The encoding means may perform encoding according to the QM-Coder method. The image data encoding device further includes a data output means for outputting the encoded image data obtained by encoding the image data by the encoding means to the image forming apparatus. You may have. Each of the above means may be realized by a computer executing a program, and the drawing command receiving means may receive the drawing command from an application program via an operating system.

ところで、上記画像データ符号化装置は、ハードウェアで実現してもよいし、プログラムをコンピュータに実行させることによって実現してもよい。具体的には、本発明に係るプログラムは、上記画像データ符号化装置の各手段としてコンピュータを動作させるプログラムであり、本発明に係る記録媒体には、当該プログラムが記録されている。   By the way, the image data encoding apparatus may be realized by hardware or may be realized by causing a computer to execute a program. Specifically, the program according to the present invention is a program that causes a computer to operate as each unit of the image data encoding device, and the program is recorded on the recording medium according to the present invention.

これらのプログラムがコンピュータによって実行されると、当該コンピュータは、上記画像データ符号化装置として動作する。従って、複数の異なる画像種別のオブジェクトが混在する画像のデータであっても、高い圧縮率で符号化することができる。   When these programs are executed by a computer, the computer operates as the image data encoding device. Therefore, even image data in which objects of a plurality of different image types are mixed can be encoded at a high compression rate.

以上のように、本発明に係る画像データ符号化装置は、抽出された符号化対象シンボルに対応する画像中の部分領域の画像種別を検出する画像種別検出手段と、画像種別検出手段によって検出された画像種別が、以前に検出された画像種別と異なっている場合に、学習テーブル記憶手段に格納されている学習テーブルを変更する学習テーブル変更手段とを備えた構成となっている。   As described above, the image data encoding device according to the present invention is detected by the image type detection unit that detects the image type of the partial region in the image corresponding to the extracted encoding target symbol, and the image type detection unit. When the image type is different from the previously detected image type, there is provided a learning table changing means for changing the learning table stored in the learning table storage means.

また、本発明に係る画像データ符号化方法は、画像種別検出手段が、抽出された符号化対象シンボルに対応する画像中の部分領域の画像種別を検出する画像種別検出ステップと、画像種別検出ステップにおいて検出された画像種別が、以前に上記画像種別検出ステップにおいて検出された画像種別と異なっている場合に、学習テーブル変更手段が記憶手段に格納された学習テーブルを変更する学習テーブル変更ステップとを含んだ構成となっている。   The image data encoding method according to the present invention includes an image type detection step in which the image type detection means detects an image type of a partial region in the image corresponding to the extracted encoding target symbol, and an image type detection step. A learning table changing step in which the learning table changing means changes the learning table stored in the storage means when the image type detected in the step is different from the image type previously detected in the image type detecting step. It is a configuration that includes.

従って、上述したように、複数の異なる画像種別のオブジェクトが混在する画像のデータであっても、高い圧縮率で符号化することができる。   Therefore, as described above, even image data in which objects of a plurality of different image types are mixed can be encoded at a high compression rate.

本発明の一実施形態に係る画像データ符号化装置及びその制御方法について図1から図11に基づいて説明すると以下の通りである。本発明に係る画像データ符号化装置は、算術符号化により画像データを符号化するものであり、本実施形態では、一例として、算術符号化の実装形態が特にQM−coderである場合について説明する。すなわち、本実施形態は、本発明を、ITU−T(International Telecommunication Union Telecommunication standardization sector) WHITE BOOK ディジタル静止画像圧縮符号化関連勧告書(財団法人 新日本ITU協会)勧告T.82に記載されている、JBIGのQM−Coderに適用した例である。   An image data encoding apparatus and a control method thereof according to an embodiment of the present invention will be described below with reference to FIGS. The image data encoding apparatus according to the present invention encodes image data by arithmetic encoding. In this embodiment, as an example, a case where the implementation form of arithmetic encoding is particularly QM-coder will be described. . In other words, the present embodiment is based on the ITU-T (International Telecommunication Union Telecommunication standardization sector) WHITE BOOK digital still image compression coding related recommendation (New Japan ITU Association) recommendation T.264. 82, an example applied to JBIG's QM-Coder.

本実施形態の画像データ符号化装置に関して、本明細書では、JBIGのQM−Coderに基づいた構成で、本発明の特徴点とは関連しない構成については、適宜説明を省略することがあるが、本明細書において言及しない構成については、矛盾が生じない限りITU−T勧告T.82に従うものとする。ただし、本発明に係る画像データ符号化装置において、算術符号化の実装形態はJBIGのQM−Coderに限定されず、例えば、QM−Coderに適宜改良を施したもの等であってもよい。   Regarding the image data encoding device of the present embodiment, in this specification, the configuration based on JBIG's QM-Coder and not related to the features of the present invention may be omitted as appropriate. For configurations not mentioned in this specification, ITU-T Recommendation T.30 is used unless a contradiction arises. 82. However, in the image data encoding apparatus according to the present invention, the implementation form of arithmetic encoding is not limited to JBIG's QM-Coder. For example, QM-Coder may be appropriately improved.

JBIGのQM−Coderは、2値画像データをマルコフ情報源でモデル化し、符号化対象シンボルをその周辺のシンボル群のパターンに基づいて予測し、予測結果に応じて算術符号化する方式を用いている。JBIG圧縮はプログレッシブ方式を取っているが、ここでは、説明を簡単にするために最低解像度レイヤのみを持つJBIG圧縮について扱う。また、説明を簡単にするため、コンテクストの形状を変化させるAT(Adaptive Template)移動等のJBIGの仕様に含まれる付加的な機能に関しては説明を省略する。   JBIG's QM-Coder uses a method in which binary image data is modeled by a Markov information source, an encoding target symbol is predicted based on a pattern of surrounding symbol groups, and arithmetic coding is performed according to a prediction result. Yes. The JBIG compression uses a progressive method, but here, in order to simplify the explanation, the JBIG compression having only the lowest resolution layer is dealt with. For the sake of simplicity, the description of additional functions included in JBIG specifications such as AT (Adaptive Template) movement that changes the shape of the context will be omitted.

まず、本実施形態に係る画像データ符号化装置1が行う算術符号化の概略について説明する。画像データ符号化装置1は、2値画像のデータを算術符号化により圧縮し、それによって得られた圧縮画像データ(符号化済みの画像データ)を出力するものである。この画像データ符号化装置1は、例えば図示しないパーソナルコンピュータのプリンタドライバにおける符号化圧縮部として機能する。このプリンタドライバは、パーソナルコンピュータの図示しない記憶部(記録媒体)に蓄積されたプログラムをパーソナルコンピュータのCPU(Central Processing Unit)が読み込んで実行することによって実現される。プリンタドライバは、パーソナルコンピュータに対するユーザの指示に応じて、書類データを描画命令により画像データに変換するとともに、この画像データを画像データ符号化装置1を用いてJBIG符号化し、プリンタ本体に送信する。この符号化された画像データを受信したプリンタ本体は、画像データを復号化して印刷を行う。   First, an outline of arithmetic encoding performed by the image data encoding device 1 according to the present embodiment will be described. The image data encoding device 1 compresses binary image data by arithmetic encoding and outputs compressed image data (encoded image data) obtained thereby. The image data encoding device 1 functions as an encoding / compression unit in a printer driver of a personal computer (not shown), for example. This printer driver is realized by a CPU (Central Processing Unit) of a personal computer reading and executing a program stored in a storage unit (recording medium) (not shown) of the personal computer. The printer driver converts document data into image data by a drawing command in accordance with a user instruction to the personal computer, encodes the image data using the image data encoding device 1, and transmits the image data to the printer body. The printer main body that has received the encoded image data decodes the image data and performs printing.

図2は、算術圧縮の概念を説明するための図である。画像データ符号化装置1は、算術符号化を行うために、外部から入力された2値の画像データである入力ビット列(入力シンボル列)を0以上1未満の実数xに変換する。より詳細には、0以上1未満の半開区間を、入力ビット(入力シンボル)に応じて分割することにより、実数xに対応する半開区間(x以上y未満の区間)を求め、この半開空間の下限値を符号化結果とする。その結果、符号化結果である符号化データは、桁数の多い一つの小数となる。以下では、符号化結果である実数xに対応する半開区間(実数xの存在し得る範囲)を、インターバルと呼ぶ。   FIG. 2 is a diagram for explaining the concept of arithmetic compression. The image data encoding device 1 converts an input bit string (input symbol string), which is binary image data input from the outside, into a real number x between 0 and 1 in order to perform arithmetic encoding. More specifically, by dividing a half-open interval of 0 or more and less than 1 according to an input bit (input symbol), a half-open interval (interval of x or more and less than y) corresponding to the real number x is obtained. Let the lower limit value be the encoding result. As a result, the encoded data that is the encoding result is a single decimal with a large number of digits. Hereinafter, a half-open interval (a range in which the real number x can exist) corresponding to the real number x that is the encoding result is referred to as an interval.

図2に示すように、まだ1ビット(1シンボル)も入力が行なわれていない時点では、明らかにインターバルは0以上1未満の領域となる。画像データ符号化装置1は、このインターバルを、入力ビットに応じて、予め定めた手順で縮小させる。そして、全ての入力ビットに応じてインターバルを変化させた後におけるインターバルの下限値(最小値)である低数が符号化結果となる。   As shown in FIG. 2, the interval is clearly an area of 0 or more and less than 1 when 1 bit (1 symbol) has not yet been input. The image data encoding apparatus 1 reduces this interval according to a predetermined procedure according to the input bits. And the low number which is the lower limit (minimum value) of the interval after changing the interval according to all the input bits is the encoding result.

画像データ符号化装置1において、インターバルは、インターバルの下限値である低数と、インターバルの大きさ(下限値と上限値との差)との組み合わせとして記憶される。より詳細には、画像データ符号化装置1は、今回の入力ビットを前回の入力ビットまでの入力ビット列、より詳細には周辺のビット群のパターン(入力画素の周辺の画素に対応する複数の入力ビットの値の組み合わせ)から予測する。以下では、この周辺のビットのパターンをコンテクストという。   In the image data encoding device 1, the interval is stored as a combination of a low number that is the lower limit value of the interval and the size of the interval (difference between the lower limit value and the upper limit value). More specifically, the image data encoding apparatus 1 converts the current input bit into an input bit string up to the previous input bit, more specifically a pattern of peripheral bit groups (a plurality of inputs corresponding to peripheral pixels of the input pixel). Prediction from bit value combinations). Hereinafter, this peripheral bit pattern is referred to as a context.

画像データ符号化装置1は、上記のコンテクストから、符号化対象ビットにおいて出現する可能性が高い値、及び、その値の出現確率を推定する機能を持っている。これにより、周辺の画素の状態から、入力ビットとして0又は1のどちらの値(シンボル)が出現しやすいかを判断する。   The image data encoding device 1 has a function of estimating a value that is highly likely to appear in the encoding target bit and the appearance probability of the value from the above-described context. As a result, it is determined from the state of surrounding pixels which value (symbol) of 0 or 1 is likely to appear as an input bit.

ここで、入力ビットが取り得る0及び1の値のうち、入力ビットに出現する確率が高い方の値(シンボル)を優勢確率シンボル(以下、「MPS」ともいう)という。そして、残りの一方(入力ビットに出現する確率が低い方の値)を劣勢確率シンボル(以下、「LPS」ともいう)という。すなわち、画像データ符号化装置1は、優勢確率シンボル及び劣勢確率シンボルの出現確率を推定する機能を持っている。   Here, a value (symbol) having a higher probability of appearing in the input bit among 0 and 1 values that can be taken by the input bit is referred to as a dominant probability symbol (hereinafter also referred to as “MPS”). The remaining one (the value with the lower probability of appearing in the input bit) is referred to as an inferior probability symbol (hereinafter also referred to as “LPS”). That is, the image data encoding device 1 has a function of estimating the appearance probability of the dominant probability symbol and the inferior probability symbol.

そして、画像データ符号化装置1は、優勢確率シンボルの出現確率と劣勢確率シンボルの出現確率との比によってインターバルを2つの領域に分割し、一方の領域をMPSの出現確率に応じたMPSインターバル、他方の領域をLPSの出現確率に応じたLPSインターバルとする。ここで、分割された2つの領域のうち、0に近い方の領域をMPSインターバルとし、0から遠い方の領域をLPSインターバルとする。   Then, the image data encoding device 1 divides the interval into two regions according to the ratio between the appearance probability of the dominant probability symbol and the appearance probability of the inferior probability symbol, and one region is an MPS interval corresponding to the MPS appearance probability, The other area is set as an LPS interval corresponding to the appearance probability of LPS. Here, of the two divided areas, an area closer to 0 is an MPS interval, and an area far from 0 is an LPS interval.

入力ビット列(入力シンボル列)の符号化時には、各ビット(シンボル)の入力に応じて、入力ビット(入力シンボル)と優勢確率シンボル(MPS)との比較を行う。入力ビットと優勢確率シンボル(MPS)とが一致する場合には、現在のインターバルからLPSインターバルを取り除くように、インターバルを変化させる。一方、入力ビットとMPSとが一致しない場合には、現在のインターバルからMPSインターバルを取り除くように、インターバルを変化させる。   When the input bit string (input symbol string) is encoded, the input bit (input symbol) and the dominant probability symbol (MPS) are compared according to the input of each bit (symbol). If the input bit matches the dominant probability symbol (MPS), the interval is changed to remove the LPS interval from the current interval. On the other hand, if the input bit and the MPS do not match, the interval is changed so as to remove the MPS interval from the current interval.

一例として、入力ビット列(入力シンボル列)「0001」であり、そのときの優勢確率シンボル(MPS)が「0101」である場合の符号化処理を図2に基づいて説明する。この例において、2ビット目の入力値(前から2つ目の入力シンボル)は劣勢確率シンボルであるから、その入力の符号化時には、LPSインターバルが符号化後の新たなインターバルとして選択される。すなわち、現在のインターバルからMPSインターバルを取り除くようにインターバルを変化させることで、符号化が行われる。一方、2ビット目以外の入力値(前から1つ目、3つ目、4つ目のシンボル)は優勢確率シンボルであるから、その入力の符号化時には、MPSインターバルが符号化後のインターバルとして選択される。すなわち、現在のインターバルからLPSインターバルを取り除くようにインターバルを変化させることで、符号化が行われる。   As an example, an encoding process when the input bit string (input symbol string) is “0001” and the dominant probability symbol (MPS) is “0101” will be described with reference to FIG. In this example, since the input value of the second bit (second input symbol from the front) is an inferior probability symbol, when the input is encoded, the LPS interval is selected as a new interval after encoding. That is, encoding is performed by changing the interval so as to remove the MPS interval from the current interval. On the other hand, since the input values other than the second bit (the first, third, and fourth symbols from the front) are dominant probability symbols, when the input is encoded, the MPS interval is set as the encoded interval. Selected. That is, encoding is performed by changing the interval so as to remove the LPS interval from the current interval.

ここで、全ての入力ビット列に対する処理が完了したときのインターバルの低数を実数xとし、この実数xを符号化結果(符号データ)とする。上述の操作によって、入力ビットが予想される入力ビット(優勢確率シンボル)と一致する場合には、インターバルの低数に変化が生じない。このため、出力値(符号化結果)にも変化が生ずることがなく、新たなビットを出力する必要もないので、これを利用して符号化を行うことができる。なお、全ての入力ビットが優勢確率シンボルであれば符号化結果xは0となる。   Here, a low number of intervals when processing for all input bit strings is completed is a real number x, and this real number x is an encoding result (code data). If the input bit matches the expected input bit (dominance probability symbol) by the above operation, the low number of intervals does not change. For this reason, there is no change in the output value (encoding result), and there is no need to output a new bit, so that encoding can be performed using this. If all input bits are dominant probability symbols, the encoding result x is 0.

上述のような操作を行うにあたって、QM−Coderの動作を模倣している画像データ符号化装置1においては、以下の手順をさらに行う。すなわち、上述の算術符号化処理を実施していくと、インターバルの大きさが次第に小さくなる。このため、やがて計算機の固定精度では表現できなくなってしまう。そこで、インターバルの大きさが0.5以上となるまで繰り返しインターバルの大きさを2倍にする、正規化処理と呼ばれる処理を行う。   In performing the operation as described above, the image data encoding apparatus 1 that imitates the operation of the QM-Coder further performs the following procedure. That is, as the above arithmetic coding process is performed, the interval size gradually decreases. For this reason, it will eventually become impossible to express with the fixed precision of the computer. Therefore, a process called normalization processing is performed in which the size of the interval is doubled until the size of the interval becomes 0.5 or more.

画像データ符号化装置1においては、インターバルの大きさを、後述するレジスタ27内のレジスタA(以下、「Areg」と記す)27aに保持(記憶)し、インターバルの低数を、後述するレジスタ27内のレジスタC(以下、「Creg」と記す)27bに保持(記憶)している。ここで、本実施形態では、インターバルを、実際の値を216倍した値、すなわち0x0〜0x10000の範囲の値で表現する。以下では、16進表示の値("0x"を前に付けた値)は、インターバルを216倍した値である。従って、16進表示の値を216で割ったものが実際のインターバルの値である。この場合、Areg26aには、0.5("0x8000")以上かつ1("0x10000")以下となるように正規化されたインターバルの大きさが格納される。 In the image data encoding device 1, the size of the interval is held (stored) in a register A (hereinafter referred to as “Areg”) 27a in a register 27 described later, and the low number of intervals is stored in a register 27 described later. Is stored (stored) in a register C (hereinafter referred to as “Creg”) 27b. In the present embodiment, the interval, the actual value of 2 16 times the value, i.e., expressed by a value in the range of 0X0~0x10000. In the following, the hexadecimal representation of the value (value preceded by a "0x") is a 2 16 times the value of the interval. Accordingly, the actual interval value is obtained by dividing the hexadecimal display value by 2 16 . In this case, the size of the interval normalized so as to be 0.5 (“0x8000”) or more and 1 (“0x10000”) or less is stored in the Areg 26a.

また、Areg26aに記憶される値(インターバルの大きさ)が、正規化処理によって2倍にされる度に、Creg26bに記憶される値(インターバルの低数)も2倍とする。このため、Areg26aに記憶される値を2倍化していることによる出力への影響は、相殺(キャンセル)される。また、Creg26bの値は、オーバーフローしないように、上位バイトが適時取り出され、符号化結果として出力されるようになっている。なお、この際に発生するキャリーオーバーを解決する方法がITU−T T.82に記載されているが、本発明の内容を理解する上で必須ではないため、ここでは説明を省略する。   Further, every time the value (interval size) stored in the Areg 26a is doubled by the normalization process, the value (low number of intervals) stored in the Creg 26b is also doubled. For this reason, the influence on the output caused by doubling the value stored in the Areg 26a is canceled (cancelled). In order to prevent overflow of the value of Creg 26b, upper bytes are taken out in a timely manner and output as an encoding result. It should be noted that a method for solving the carryover that occurs at this time is described in ITU-T TT. However, since it is not essential for understanding the contents of the present invention, the description thereof is omitted here.

また、画像データ符号化装置1においては、以下のようにして近似を行うようになっている。LPSインターバルを計算するには、本来は、
(インターバルの大きさ)×(LPS出現確率)
という演算が必要である。画像データ符号化装置1においては、このLPSインターバルの値を、統計的に求められた推定値(推定LPSインターバル;以下、適宜、「LSZ」と略記する)によって近似する。この近似では、その時点でのインターバルの大きさが1("0x10000")とは限らないということを考慮せずにインターバルの大きさが1であるものとみなし、LPSインターバルの値を、統計的に求められたLPSの出現確率の推定値(LSZ)で近似する。そのため、インターバル全体のうち、推定LPSインターバルの占める割合は、インターバルの大きさに応じて変化してしまう。しかしながら、インターバルは大きさが0.5以上かつ1以下となるように正規化されているため、誤差はそれほど大きくはならない。
Further, the image data encoding device 1 performs approximation as follows. To calculate the LPS interval,
(Interval size) x (LPS appearance probability)
This operation is necessary. In the image data encoding device 1, the value of this LPS interval is approximated by a statistically obtained estimated value (estimated LPS interval; hereinafter, abbreviated as “LSZ” as appropriate). In this approximation, it is assumed that the interval size is 1 without considering that the interval size at that time is not always 1 ("0x10000"). Is approximated by the estimated value (LSZ) of the appearance probability of LPS obtained in step (1). Therefore, the proportion of the estimated LPS interval in the whole interval changes according to the size of the interval. However, since the interval is normalized so that the size is 0.5 or more and 1 or less, the error is not so large.

すなわち、上記の近似は、インターバル全体の大きさが0の出現確率と1の出現確率との合計であるものとみなして行うものであるから、本来はインターバル全体の大きさは1であるべきである。しかしながら、演算を行う都合上、インターバル全体の大きさを1にする処理は行わず、インターバル全体の大きさが0.5から1.0までの範囲におさまっていればよいこととしている。このため、インターバルの大きさが小さければ、インターバルからLPSインターバルを引いてMPSインターバルを求めたときに、LPSインターバルの大きさがMPSインターバルの大きさより大きくなる可能性がある。   That is, the above approximation is performed assuming that the size of the entire interval is the sum of the appearance probability of 0 and the appearance probability of 1, so that the size of the entire interval should be 1 originally. is there. However, for convenience of calculation, the process of setting the entire interval to 1 is not performed, and the entire interval needs to be within a range from 0.5 to 1.0. For this reason, if the size of the interval is small, when the MPS interval is obtained by subtracting the LPS interval from the interval, the size of the LPS interval may be larger than the size of the MPS interval.

以上をまとめると、画像データ符号化装置1において、入力ビット(入力シンボル)としてMPSが与えられた際にはインターバルからLSZを引き、その結果得られたインターバルを新たなインターバルとする。また、画像データ符号化装置1は、入力ビットとしてLPSが与えられたときには、インターバルをLSZに変更する。この操作によって、入力ビットが符号化される。画像データ符号化装置1は、この操作の結果としてインターバルが0.5以下となったときには正規化を行う。正規化が行われたときにはLSZの値を更新する。また、上述の符号化によって、MPSインターバルよりもLPSインターバルの方が大きくなってしまう場合がある。このときは、MPSインターバルとLPSインターバルとの入れ替えを行う。   In summary, in the image data encoding device 1, when MPS is given as an input bit (input symbol), LSZ is subtracted from the interval, and the resulting interval is set as a new interval. Also, the image data encoding device 1 changes the interval to LSZ when LPS is given as an input bit. By this operation, the input bits are encoded. The image data encoding apparatus 1 performs normalization when the interval becomes 0.5 or less as a result of this operation. When normalization is performed, the value of LSZ is updated. In addition, the LPS interval may become larger than the MPS interval due to the above encoding. At this time, the MPS interval and the LPS interval are exchanged.

図1は、本実施形態の画像データ符号化装置1の構成を示す機能ブロック図である。図1に示すように、画像データ符号化装置1は、描画命令受付部(描画命令受付手段)11、領域情報作成部(領域情報作成手段)12、画像データ作成部(画像データ作成手段)13、コンテクスト生成部(抽出手段)21、領域判定部(画像種別検出手段)22、テーブル変更部(学習テーブル変更手段、テーブル切換手段)23、取得部24(符号化手段)、算術符号化部(符号化手段、ループ手段)26、レジスタ(データ保持手段)27、領域情報付加部(領域情報付加手段、データ出力手段)28及び記録部(学習テーブル記憶手段、確率推定テーブル記憶手段、初期テーブル記憶手段)31を備えている。本実施形態では、これらの各部が、画像データ符号化装置1に備えられた図示しないCPU等の演算手段がROMやRAM等の記録媒体に格納されたプログラムコードを実行することで実現される。すなわち、画像データ符号化装置1は、ハードウェア資源としてCPU等の演算ユニット及びRAM等の記憶装置を備えたコンピュータである。   FIG. 1 is a functional block diagram showing the configuration of the image data encoding device 1 of the present embodiment. As shown in FIG. 1, the image data encoding device 1 includes a drawing command receiving unit (drawing command receiving unit) 11, an area information generating unit (region information generating unit) 12, and an image data generating unit (image data generating unit) 13. , Context generation unit (extraction unit) 21, region determination unit (image type detection unit) 22, table change unit (learning table change unit, table switching unit) 23, acquisition unit 24 (encoding unit), arithmetic encoding unit ( Encoding means, loop means 26, register (data holding means) 27, area information adding section (area information adding means, data output means) 28 and recording section (learning table storage means, probability estimation table storage means, initial table storage) Means) 31. In the present embodiment, each of these units is realized by execution of a program code stored in a recording medium such as a ROM or a RAM by an arithmetic unit such as a CPU (not shown) provided in the image data encoding device 1. That is, the image data encoding device 1 is a computer that includes an arithmetic unit such as a CPU and a storage device such as a RAM as hardware resources.

描画命令受付部11は、画像を作成するための描画命令を受け付けるものである。この描画命令には、例えば、(1)キャンバス上にテキストオブジェクトを描画するよう指示する命令、(2)キャンバス上にグラフィックスオブジェクトを描画するよう指示する命令、及び(3)キャンバス上に、指定されたビットマップオブジェクトを描画するよう指示する命令等が含まれる。   The drawing command receiving unit 11 receives a drawing command for creating an image. For example, (1) an instruction to draw a text object on the canvas, (2) an instruction to draw a graphics object on the canvas, and (3) a designation on the canvas A command for instructing to draw the bitmap object is included.

上記の(1)の命令は、キャンバス上に、図示しないフォント記憶部に格納された所望のフォントで所望のテキストを配置するための命令である。上記の(2)の命令は、キャンバス上に、関数によって定義された、例えば直線、曲線、円、多角形、又はそれらを組み合わせた図形を配置するための命令である。上記の(3)の命令は、キャンバス上に、網点或いは誤差拡散等によって表現された写真等のビットマップ画像を配置するための命令である。   The instruction (1) is an instruction for arranging desired text in a desired font stored in a font storage unit (not shown) on the canvas. The above instruction (2) is an instruction for arranging, for example, a straight line, a curve, a circle, a polygon, or a combination thereof, defined by a function on the canvas. The command (3) is a command for placing a bitmap image such as a photograph expressed by halftone dots or error diffusion on the canvas.

画像データ符号化装置1の符号化エンジンが、例えばコンピュータのプリンタドライバとして実装される場合、上記の描画命令は、アプリケーションプログラムから、オペレーティングシステムを介して画像データ符号化装置1に入力される。例えば、オペレーティングシステムがWindows(登録商標)である場合、アプリケーションプログラムは、印刷出力を行う場合に、オペレーティングシステムのGDI(Graphic Device Interface)関数の呼び出しを行う。すると、呼び出されたGDI関数は、さらに、プリンタドライバのDDI(Device Driver Interface)関数の呼び出しを行う。その結果、呼び出されたDDI関数は、指示されたオブジェクトを描画したビットマップ画像を作成し、プリンタに出力する。ここで、上記のDDI関数の呼出命令が、上記の描画命令の一例として挙げられる。   When the encoding engine of the image data encoding device 1 is implemented as a printer driver of a computer, for example, the drawing command is input from the application program to the image data encoding device 1 via the operating system. For example, when the operating system is Windows (registered trademark), the application program calls a GDI (Graphic Device Interface) function of the operating system when performing print output. Then, the called GDI function further calls a DDI (Device Driver Interface) function of the printer driver. As a result, the called DDI function creates a bitmap image in which the designated object is drawn and outputs it to the printer. Here, the above-mentioned DDI function call instruction is an example of the above-described drawing instruction.

なお、DDI関数の名前は、オペレーティングシステムによっても異なるが、Windows(登録商標)の場合、“DrvEnableDriver()”以外であれば、自由につけることができる。例えば、“DrvBitBlt()”又は“DrvTextOut()”等である。すなわち、オペレーティングシステムとしてWindows(登録商標)を採用する場合、描画命令受付部11が受け付け可能な描画関数及びその呼出命令を自由に作成することができる。DDI関数の呼出命令には、描画オブジェクトの種類を示す上記の関数名に加えて、描画オブジェクトのサイズ及び画像上の配置を指定する情報が引数として含まれる。   The name of the DDI function varies depending on the operating system, but in the case of Windows (registered trademark), any name other than “DrvEnableDriver ()” can be freely assigned. For example, “DrvBitBlt ()” or “DrvTextOut ()”. That is, when Windows (registered trademark) is adopted as the operating system, a drawing function that can be received by the drawing command receiving unit 11 and a call command thereof can be freely created. In addition to the above function name indicating the type of drawing object, the DDI function call instruction includes information specifying the size of the drawing object and the arrangement on the image as arguments.

なお、描画命令受付部11は、上述した描画命令を複数受け付けることができる。これにより、後述する画像データ作成部13は、複数の描画命令に従って、キャンバス上に種別の異なる複数のオブジェクトが混在して配置された画像の画像データを作成することができる。描画命令受付部11によって受け付けられた描画命令は、領域情報作成部12及び画像データ作成部13に送られる。   The drawing command receiving unit 11 can receive a plurality of the drawing commands described above. Accordingly, the image data creation unit 13 described later can create image data of an image in which a plurality of different types of objects are arranged on the canvas in accordance with a plurality of drawing commands. The drawing command received by the drawing command receiving unit 11 is sent to the area information creating unit 12 and the image data creating unit 13.

領域情報作成部12は、描画命令受付部11から受け取った描画命令から、領域情報を作成するものである。この領域情報とは、画像データ作成部13によって作成される画像において、どこに、どのような種類(画像種別)の画像(部分画像)が含まれるかを示す情報である。領域情報作成部12によって作成された領域情報は、記録部31に格納される。   The area information creating unit 12 creates area information from the drawing command received from the drawing command receiving unit 11. This area information is information indicating where and what type (image type) of image (partial image) is included in the image created by the image data creation unit 13. The area information created by the area information creating unit 12 is stored in the recording unit 31.

この領域情報を作成するため、領域情報作成部12は、まず、描画命令から、画像上に配置されるオブジェクトの種類と、そのオブジェクトが画像上に占める範囲とを検出する。ここで、画像に含まれるオブジェクトの種類は、描画命令に含まれる関数名に基づいて判別される。また、そのオブジェクトが画像上に占める範囲は、描画命令に含まれる関数の引数に基づいて認識される。   In order to create this area information, the area information creating unit 12 first detects the type of object arranged on the image and the range occupied by the object on the image from the drawing command. Here, the type of the object included in the image is determined based on the function name included in the drawing command. The range that the object occupies on the image is recognized based on the function argument included in the rendering command.

本実施形態において、領域情報作成部12は、画像上に配置される各オブジェクトを、上述したテキストオブジェクト、グラフィックスオブジェクト及びビットマップオブジェクトのうちの何れかの種別に分類する。そして、作成される画像を、オブジェクトの種別に基づいて区分する。   In the present embodiment, the area information creation unit 12 classifies each object arranged on the image into any one of the above-described text object, graphics object, and bitmap object. Then, the created image is classified based on the type of object.

図3は、領域情報作成部12による区分の一例を示す図である。図3に示すように、領域情報作成部12は、画像を、テキストオブジェクトが含まれるテキスト領域と、グラフィックスオブジェクトが含まれるグラフィックス領域と、ビットマップオブジェクトが含まれるビットマップ領域とに区分する。なお、本実施形態において、領域情報作成部12による画像の区分は、図3に示すように、縦方向についてのみ行われ、横方向については行われない。すなわち、領域情報作成部12による画像の区分は、画像の(横方向の)ラインによって行われる。   FIG. 3 is a diagram illustrating an example of classification by the region information creation unit 12. As illustrated in FIG. 3, the region information creation unit 12 divides an image into a text region including a text object, a graphics region including a graphics object, and a bitmap region including a bitmap object. . In the present embodiment, as shown in FIG. 3, image segmentation by the region information creation unit 12 is performed only in the vertical direction and not in the horizontal direction. That is, the segmentation of the image by the region information creation unit 12 is performed by the (horizontal) line of the image.

そして、領域情報作成部12は、各領域の上端及び下端の位置(各画像種別の部分画像が占める範囲)と、その領域の種別を示す領域情報を作成する。この領域情報により、画像中の任意のライン(さらにはそこに含まれる画素)が、テキスト領域、グラフィックス領域及びビットマップ領域のうちの何れの領域に含まれるかを認識することができる。   Then, the region information creation unit 12 creates region information indicating the positions of the upper and lower ends of each region (the range occupied by the partial image of each image type) and the type of the region. With this area information, it is possible to recognize which area of the text area, the graphics area, and the bitmap area an arbitrary line (and pixels included therein) in the image is included.

なお、種別の異なるオブジェクト同士が重なり合う場合、ビットマップ、グラフィックス、テキストの順で優先するものとする。例えば、ビットマップオブジェクト及びグラフィックオブジェクトの双方を含むラインについては、ビットマップ領域として認識するものとする。また、オブジェクトの配置されていないラインについては、何れの領域として認識してもよい。   If objects of different types overlap, priority is given to bitmap, graphics, and text. For example, a line including both a bitmap object and a graphic object is recognized as a bitmap area. A line where no object is arranged may be recognized as any region.

画像データ作成部13は、描画命令受付部11から受け取った描画命令に従って、画像を描画し、その画像を示すビットマップ画像データを作成するものである。このビットマップ画像データは算術符号化の対象となるデータである。なお、本実施形態において、画像データ作成部13によって描画される画像は、2値(モノクロ2階調)のビットマップ画像である。ただし、本発明は、モノクロ2階調に限定されるものではない。画像データ作成部13によって作成されたビットマップ画像データは、コンテクスト生成部21に送られる。   The image data creation unit 13 draws an image in accordance with the drawing command received from the drawing command reception unit 11 and creates bitmap image data indicating the image. This bitmap image data is data to be subjected to arithmetic coding. In the present embodiment, the image drawn by the image data creation unit 13 is a binary (monochrome two gradation) bitmap image. However, the present invention is not limited to monochrome two gradations. The bitmap image data created by the image data creation unit 13 is sent to the context generation unit 21.

コンテクスト生成部21は、画像データ作成部13から受け取ったビットマップ画像データから、符号化の対象となる画素(符号化対象シンボル)と、その周辺の複数画素のパターンを示すコンテクスト(周辺シンボル)とを抽出するものである。図4は、符号化対象の画素とコンテクストとの関係を示した図である。上述のように、QM−coderを模倣した画像データ符号化装置1では、予測の際に、前回の入力信号までの入力ビット列だけでなく、複数の周辺画素のパターン(コンテクスト)をも用いるようになっている。すなわち、画像データ符号化装置1は、予測の際に、周辺の複数画素がとりうる状態の組み合わせ(コンテクスト)に基づいて、優勢確率シンボル及び劣勢シンボルの出現確率を推定する。   From the bitmap image data received from the image data creation unit 13, the context generation unit 21 includes a pixel (encoding target symbol) to be encoded and a context (peripheral symbol) indicating a pattern of a plurality of surrounding pixels. Is extracted. FIG. 4 is a diagram illustrating a relationship between a pixel to be encoded and a context. As described above, in the image data encoding apparatus 1 that imitates the QM-coder, not only the input bit string up to the previous input signal but also the patterns (contexts) of a plurality of surrounding pixels are used for prediction. It has become. In other words, the image data encoding apparatus 1 estimates the appearance probability of the dominant probability symbol and the inferior symbol based on the combination (context) of states that can be taken by a plurality of neighboring pixels at the time of prediction.

ここで、今回の入力ビットを有する対象画素を選択した場合に、この符号化対象画素の周辺画素として、図3に示すように、対象画素より前に処理された画素のうち、対象画素と同じライン及びこれに隣接するライン(図3では1つ上のライン)に存在する複数画素を周辺画素として選択する。図3の例では、斜線部分が符号化対象となる画素であり、その周辺の10個の画素によって示されるパターンがコンテクストとなる。   Here, when the target pixel having the current input bit is selected, as the peripheral pixels of this encoding target pixel, the same as the target pixel among the pixels processed before the target pixel, as shown in FIG. A plurality of pixels existing in a line and a line adjacent to the line (upper line in FIG. 3) are selected as peripheral pixels. In the example of FIG. 3, the hatched portion is a pixel to be encoded, and a pattern indicated by 10 pixels around it is a context.

本実施形態では、コンテクストの画素数は10個であり、各画素の値(シンボル)は0か1の値を持つので、コンテクストは1024パターンを取り得る。なお、JBIG圧縮では、最低解像度レイヤのコンテクストとして、図3に示すような2ラインテンプレートの他に、3ラインテンプレートも用意されており、こちらを用いることもできる。ここでは2ラインテンプレートを用いるものとする。   In the present embodiment, the number of pixels in the context is 10, and the value (symbol) of each pixel has a value of 0 or 1, so the context can take 1024 patterns. In the JBIG compression, as the context of the lowest resolution layer, a 3-line template is also prepared in addition to the 2-line template as shown in FIG. 3, and this can also be used. Here, a two-line template is used.

コンテクスト生成部21は、抽出した画素の値(符号化対象シンボル)及びコンテクスト(周辺シンボル)を取得部24に送る。また、コンテクスト生成部21は、算術符号化部26から画素のインクリメント指示を受け取ると、入力されたビットマップ画像データから、次の対象画素及びコンテクストを抽出する。さらに、本実施形態において、コンテクスト生成部21は、上記の画素のインクリメント指示により、符号化対象の画素が次のラインに移行すると、移行先の新しいラインの画像中での位置を示す位置情報を領域判定部22に送る。   The context generation unit 21 sends the extracted pixel value (encoding target symbol) and context (neighboring symbols) to the acquisition unit 24. Further, when receiving the pixel increment instruction from the arithmetic encoding unit 26, the context generation unit 21 extracts the next target pixel and context from the input bitmap image data. Further, in the present embodiment, when the pixel to be encoded moves to the next line according to the pixel increment instruction, the context generation unit 21 obtains position information indicating the position of the new line to be transferred in the image. This is sent to the area determination unit 22.

取得部24は、コンテクスト生成部21から受け取ったコンテクストに対応する優勢確率シンボル(MPS)を、記録部31に格納された学習テーブル32から取得する。すなわち、取得部24は、コンテクストから、符号化対象画素の値を推定する機能を有している。さらに、取得部24は、学習テーブル32から、コンテクスト生成部21から受け取ったコンテクストに対応する劣勢確率シンボルの確率推定値のインデックスSTを取得する。取得したMPS及びSTは、算術符号化部26に送られる。   The acquisition unit 24 acquires a dominant probability symbol (MPS) corresponding to the context received from the context generation unit 21 from the learning table 32 stored in the recording unit 31. That is, the acquisition unit 24 has a function of estimating the value of the encoding target pixel from the context. Furthermore, the acquisition unit 24 acquires the index ST of the probability estimation value of the inferior probability symbol corresponding to the context received from the context generation unit 21 from the learning table 32. The acquired MPS and ST are sent to the arithmetic encoding unit 26.

ここで、記録部31に格納された学習テーブル32について説明する。図5は、学習テーブル32の内容を示した図である。図5に示すように、学習テーブル32では、コンテクストと、そのコンテクストから推定される劣勢確率シンボルの出現確率(LSZ)を特定するためのインデックスSTと、そのコンテクストから推定される優勢確率シンボルMPSとの対応関係が示されている。すなわち、学習テーブル32を記憶する記録部31には、コンテクストと、STと、MPSとが対応付けて格納されている。   Here, the learning table 32 stored in the recording unit 31 will be described. FIG. 5 is a diagram showing the contents of the learning table 32. As shown in FIG. 5, in the learning table 32, a context, an index ST for specifying the appearance probability (LSZ) of an inferior probability symbol estimated from the context, and a dominant probability symbol MPS estimated from the context, The correspondence relationship is shown. That is, the recording unit 31 that stores the learning table 32 stores a context, ST, and MPS in association with each other.

この学習テーブル32は、画像に含まれる画素が順次符号化されるにつれて最適化される。具体的には、画素の符号化に伴って、学習テーブル32に含まれるデータのうち、インデックスST及びMPSが算術符号化部26により更新される。また、本実施形態では、この学習テーブル32は、記録部31に格納された初期学習テーブル33をテンプレートとして作成される。すなわち、初期状態において、学習テーブル32は、初期学習テーブル33と同一の内容を保持しているが、その後、画素の符号化に伴って最適化されていく。   The learning table 32 is optimized as the pixels included in the image are sequentially encoded. Specifically, the index ST and MPS are updated by the arithmetic encoding unit 26 in the data included in the learning table 32 as the pixels are encoded. In the present embodiment, the learning table 32 is created using the initial learning table 33 stored in the recording unit 31 as a template. In other words, in the initial state, the learning table 32 holds the same contents as the initial learning table 33, but is subsequently optimized as the pixels are encoded.

なお、学習テーブル32に示される優勢確率シンボルは、0又は1の値を取る。また、LSZのインデックスSTは、JBIGにおいては、0から112までのいずれかの値を取る。このLSZのインデックスSTは、後述するJBIGの確率推定テーブル34において、近傍10画素に出現した0又は1の値(シンボル)のパターン(コンテクスト)ごとに、これまで注目画素の位置に出現した値(シンボル)の履歴から注目画素に出現するであろう値(シンボル)の出現確率を特定するために用いられる。   The dominant probability symbol shown in the learning table 32 takes a value of 0 or 1. Further, the index ST of LSZ takes any value from 0 to 112 in JBIG. The LSZ index ST is a value that has appeared at the position of the pixel of interest so far for each pattern (context) of a value (symbol) of 0 or 1 that appears in the neighboring 10 pixels in the JBIG probability estimation table 34 described later ( This is used to specify the appearance probability of a value (symbol) that will appear at the target pixel from the history of the symbol.

算術符号化部26は、取得部24から受け取った符号化対象画素の値、MPS及びインデックスSTから、算術符号である実数xを符号化済みデータとして生成する。本実施形態において、算術符号化部26による算術符号化の操作は、従来のQM−Coderのそれと同一である。算術符号化部26は、前処理部26a、MPS処理部26b、LPS処理部26c及びRENORM処理部26dを含んでいる。   The arithmetic encoding unit 26 generates a real number x, which is an arithmetic code, as encoded data from the encoding target pixel value, MPS, and index ST received from the acquisition unit 24. In the present embodiment, the operation of arithmetic coding by the arithmetic coding unit 26 is the same as that of the conventional QM-Coder. The arithmetic encoding unit 26 includes a preprocessing unit 26a, an MPS processing unit 26b, an LPS processing unit 26c, and a RENORM processing unit 26d.

前処理部26aは、取得部24から、符号化対象シンボルとして受け取った符号化対象画素の値(符号化対象シンボル)と、MPSとを比較し、符号化対象シンボルがMPSと一致するか否かを判定する。ここで、符号化対象シンボルがMPSと一致した場合はMPS処理部26bが機能し、一致しなかった場合はLPS処理部26cが機能する。すなわち、MPS処理部26bは、優勢確率シンボルを符号化するためのものであり、LPS処理部26cは、劣勢確率シンボルを符号化するためのものである。また、RENORM処理部26dは、上述した正規化処理を行うためのものである。   The preprocessing unit 26a compares the value of the encoding target pixel (coding target symbol) received as the encoding target symbol from the acquisition unit 24 with the MPS, and determines whether or not the encoding target symbol matches the MPS. Determine. Here, the MPS processing unit 26b functions when the encoding target symbol matches MPS, and the LPS processing unit 26c functions when they do not match. That is, the MPS processing unit 26b is for encoding the dominant probability symbol, and the LPS processing unit 26c is for encoding the inferior probability symbol. The RENORM processing unit 26d is for performing the normalization process described above.

MPS処理部26b及びLPS処理部26cは、取得部24から受け取ったシンボルとインデックスSTとに基づいて、該シンボルを符号化し、実数xを求める。MPS処理部26b又はLPS処理部26cは、算術符号化を行うにあたって、まず、記録部31に格納された確率推定テーブル34…を参照し、インデックスSTに対応する、劣勢確率シンボルの出現確率推定値LSZを取得する。   The MPS processing unit 26b and the LPS processing unit 26c encode the symbol based on the symbol received from the acquisition unit 24 and the index ST, and obtain a real number x. When performing the arithmetic coding, the MPS processing unit 26b or the LPS processing unit 26c first refers to the probability estimation table 34 stored in the recording unit 31 to estimate the appearance probability of the inferior probability symbol corresponding to the index ST. Get LSZ.

ここで、確率推定テーブル34…について説明する。図6は、記録部31に格納された複数の確率推定テーブル34…のうちの1つの内容を示す図である。図6に示すように、確率推定テーブル34には、インデックスSTと、劣勢確率シンボルの出現確率推定値LSZとの対応関係が示されている。換言すれば、確率推定テーブル34を格納する記録部31には、STとLSZとが対応付けて格納されている。このLSZは、上述したように、インターバルを変化させるために用いられる。   Here, the probability estimation table 34 will be described. FIG. 6 is a diagram illustrating the contents of one of the plurality of probability estimation tables 34... Stored in the recording unit 31. As shown in FIG. 6, the probability estimation table 34 shows the correspondence between the index ST and the appearance probability estimated value LSZ of the inferior probability symbol. In other words, ST and LSZ are stored in association with each other in the recording unit 31 that stores the probability estimation table 34. As described above, the LSZ is used to change the interval.

また、確率推定テーブル34には、インデックスSTと、学習テーブル32の更新内容との対応関係が示されている。具体的には、インデックスSTと、NLPS、NMPS、及びSWITCHとが対応付けられている。   In addition, the probability estimation table 34 shows the correspondence between the index ST and the updated contents of the learning table 32. Specifically, the index ST is associated with NLPS, NMPS, and SWITCH.

ここで、NLPSは、LPS処理部26cが劣勢確率シンボルを符号化したときの、コンテクストに対応付けられる次のインデックスSTの値を意味するものである。すなわち、符号化対象シンボルが劣勢確率シンボルの場合、学習テーブル32に含まれるSTのうち、コンテクスト生成部21が抽出したコンテクストに対応するSTが、NLPSによって上書きされる。   Here, NLPS means the value of the next index ST associated with the context when the LPS processing unit 26c encodes the inferior probability symbol. That is, when the encoding target symbol is an inferior probability symbol, among the STs included in the learning table 32, the ST corresponding to the context extracted by the context generation unit 21 is overwritten by the NLPS.

一方、NMPSは、MPS処理部26bが優勢確率シンボルを符号化したときの、コンテクストに対応付けられる次のインデックスSTの値を意味するものである。すなわち、符号化対象シンボルが優勢確率シンボルの場合、学習テーブル32に含まれるSTのうち、コンテクスト生成部21が抽出したコンテクストに対応するSTが、NMPSによって上書きされる。   On the other hand, NMPS means the value of the next index ST associated with the context when the MPS processing unit 26b encodes the dominant probability symbol. That is, when the encoding target symbol is a dominant probability symbol, among the STs included in the learning table 32, the ST corresponding to the context extracted by the context generation unit 21 is overwritten by the NMPS.

また、SWITCHは、優勢確率シンボルと劣勢確率シンボルとの入れ替えを行うかどうかを示すフラグであり、1の場合にシンボルの入れ替えを行うことを示す。すなわち、MPS処理部26b及びLPS処理部26cは、符号化対象シンボルとともに受け取ったインデックスSTに対応付けられたSWITCHが1の場合、学習テーブル32のMPSの値を反転させる(0から1あるいは1から0に変更する)。   SWITCH is a flag indicating whether or not to replace the dominant probability symbol and the inferior probability symbol. In the case of 1, SWITCH indicates that the symbol is replaced. That is, when the SWITCH associated with the index ST received together with the encoding target symbol is 1, the MPS processing unit 26b and the LPS processing unit 26c invert the MPS value in the learning table 32 (from 0 to 1 or from 1) Change to 0).

以上のように、確率推定テーブル34を記憶する記録部31には、STとLSZとNLPSとMPSとSWITCHとが対応付けて格納されている。これらの更新情報に基づいて学習テーブル32の内容を更新することにより、コンテクストから推定される劣勢確率シンボルの出現確率の値が、符号化したシンボルをも加味したものに更新される。   As described above, the recording unit 31 that stores the probability estimation table 34 stores ST, LSZ, NLPS, MPS, and SWITCH in association with each other. By updating the contents of the learning table 32 based on the update information, the appearance probability value of the inferior probability symbol estimated from the context is updated to take into account the encoded symbol.

なお、本実施形態では、確率推定テーブル34が、3つの画像種別ごとに用意される。すなわち、テキスト領域用、グラフィックス領域用、及びビットマップ領域用の3つの領域用の確率推定テーブル34…が記録部31に格納され、算術符号化部26は、符号化対象画素の含まれるラインが属する領域に対応する確率推定テーブル34を参照する。   In the present embodiment, the probability estimation table 34 is prepared for each of the three image types. That is, a probability estimation table 34 for three regions for a text region, a graphics region, and a bitmap region is stored in the recording unit 31, and the arithmetic encoding unit 26 includes a line including an encoding target pixel. The probability estimation table 34 corresponding to the region to which the

なお、確率推定テーブル34は、例えばビットマップ領域用であればディザパターンを考慮したものとなり、一方、グラフィックス領域用であれば線画を意識したものとなる。各領域に好適な確率推定テーブル34は、実験的にそれぞれの画像種別の画像を何枚かを符号化し、統計的に圧縮率がよくなるテーブルを求めて作成すればよい。   Note that the probability estimation table 34 takes into account a dither pattern if it is for a bitmap area, for example, while it is conscious of a line drawing if it is for a graphics area. The probability estimation table 34 suitable for each region may be created by experimentally encoding a number of images of each image type and obtaining a table that statistically improves the compression rate.

領域判定部22は、コンテクスト生成部21によって抽出された符号化対象の画素が、テキスト領域、グラフィックス領域及びビットマップ領域のうち、何れの領域に属するかを、コンテクスト生成部21から受け取った画素の位置情報と、記録部31に格納された領域情報35とに基づいて判定する。この判定結果は、領域判定部22に保持される。そして、領域判定部22は、今回の符号化対象画素についての判定結果と、保持している前回の符号化対象画素についての判定結果とを比較し、両者が異なっていれば、テーブル変更部23にテーブルの変更を指示する。   The region determination unit 22 receives the pixel received from the context generation unit 21 as to which of the text region, the graphics region, and the bitmap region the pixel to be encoded extracted by the context generation unit 21 belongs. And the area information 35 stored in the recording unit 31. This determination result is held in the area determination unit 22. Then, the region determination unit 22 compares the determination result for the current encoding target pixel with the determination result for the previous encoding target pixel that is held, and if the two are different, the table change unit 23 To change the table.

テーブル変更部23は、領域判定部22からの指示に従い、記録部31に格納された学習テーブル32のリセット、及び、算術符号化部26によって参照される確率推定テーブル34の切り換えを行うものである。   The table changing unit 23 resets the learning table 32 stored in the recording unit 31 and switches the probability estimation table 34 referred to by the arithmetic coding unit 26 in accordance with an instruction from the region determination unit 22. .

学習テーブル32のリセットは、未最適化状態の初期学習テーブル33の内容に基づいて、学習テーブル32のデータを上書きすることにより行われる。これにより、本実施形態では、学習テーブル32が未学習の初期状態へとリセットされる。一方、算術符号化部26によって参照される確率推定テーブル34の切り換えは、算術符号化部26に、符号化対象の画素が属する領域に応じた確率推定テーブル34を参照させるようにして行われる。   The learning table 32 is reset by overwriting the data in the learning table 32 based on the contents of the initial learning table 33 in an unoptimized state. Thereby, in this embodiment, the learning table 32 is reset to the unlearned initial state. On the other hand, switching of the probability estimation table 34 referred to by the arithmetic encoding unit 26 is performed by causing the arithmetic encoding unit 26 to refer to the probability estimation table 34 corresponding to the region to which the pixel to be encoded belongs.

これらの領域判定部22及びテーブル変更部23により、符号化対象の画素が異なる画像種別の領域に移行した場合に、学習テーブルのリセットが行われるとともに、算術符号化部26によって参照される確率推定テーブル34が、新たな領域に適したものに切り換えられる。   When the region determination unit 22 and the table change unit 23 shift the pixels to be encoded to regions of different image types, the learning table is reset and the probability estimation referred to by the arithmetic encoding unit 26 The table 34 is switched to the one suitable for the new area.

レジスタ27は、算術符号化部26によって生成された算術符号(実数x)を保持するものである。レジスタ27は、上述したように、Areg27a及びCreg27bを有し、Areg27aにはインターバルの大きさが、また、Creg27bには実数xとなるインターバルの低数が記録される。   The register 27 holds the arithmetic code (real number x) generated by the arithmetic encoding unit 26. As described above, the register 27 has the Areg 27a and the Creg 27b, and the size of the interval is recorded in the Areg 27a, and the low number of intervals that are the real number x is recorded in the Creg 27b.

領域情報付加部28は、画像データが全て符号化されたときに、符号化済みに画像データに対して、領域情報作成部12によって作成された領域情報を付加し、復号化のときに利用できるようにするものである。   The region information adding unit 28 adds the region information created by the region information creating unit 12 to the encoded image data when all the image data is encoded, and can be used for decoding. It is what you want to do.

なお、画像データ符号化装置1に含まれる上記の各ブロックは、ハードウェアロジックによって構成することもできるが、本実施形態では、次のようにCPUを用いてソフトウェアによって実現している。   Each of the blocks included in the image data encoding device 1 can be configured by hardware logic, but in the present embodiment, it is realized by software using a CPU as follows.

すなわち、画像データ符号化装置1は、各機能を実現する制御プログラムの命令を実行するCPU(central processing unit)、上記プログラムを格納したROM(read only memory)、上記プログラムを展開するRAM(random access memory)、上記プログラム及び各種データを格納するメモリ等の記憶装置(記録媒体)等を備えている。そして、本発明の目的は、上述した機能を実現するソフトウェアである画像データ符号化装置1の制御プログラムのプログラムコード(実行形式プログラム、中間コードプログラム、ソースプログラム)をコンピュータで読み取り可能に記録した記録媒体を、上記画像データ符号化装置1に供給し、そのコンピュータ(又はCPUやMPU)が記録媒体に記録されているプログラムコードを読み出し実行することによっても、達成可能である。   That is, the image data encoding apparatus 1 includes a CPU (central processing unit) that executes instructions of a control program that realizes each function, a ROM (read only memory) that stores the program, and a RAM (random access) that expands the program. memory), a storage device (recording medium) such as a memory for storing the program and various data. An object of the present invention is a recording in which a program code (execution format program, intermediate code program, source program) of a control program of the image data encoding device 1 which is software for realizing the above-described functions is recorded so as to be readable by a computer. This can also be achieved by supplying a medium to the image data encoding apparatus 1 and reading and executing the program code recorded on the recording medium by the computer (or CPU or MPU).

上記記録媒体としては、例えば、磁気テープやカセットテープ等のテープ系、フロッピー(登録商標)ディスク/ハードディスク等の磁気ディスクやCD−ROM/MO/MD/DVD/CD−R等の光ディスクを含むディスク系、ICカード(メモリカードを含む)/光カード等のカード系、あるいはマスクROM/EPROM/EEPROM/フラッシュROM等の半導体メモリ系等を用いることができる。   Examples of the recording medium include a tape system such as a magnetic tape and a cassette tape, a magnetic disk such as a floppy (registered trademark) disk / hard disk, and an optical disk such as a CD-ROM / MO / MD / DVD / CD-R. Card system such as IC card, IC card (including memory card) / optical card, or semiconductor memory system such as mask ROM / EPROM / EEPROM / flash ROM.

また、画像データ符号化装置1を通信ネットワークと接続可能に構成し、上記プログラムコードを通信ネットワークを介して供給してもよい。この通信ネットワークとしては、特に限定されず、例えば、インターネット、イントラネット、エキストラネット、LAN、ISDN、VAN、CATV通信網、仮想専用網(virtual private network)、電話回線網、移動体通信網、衛星通信網等が利用可能である。また、通信ネットワークを構成する伝送媒体としては、特に限定されず、例えば、IEEE1394、USB、電力線搬送、ケーブルTV回線、電話線、ADSL回線等の有線でも、IrDAやリモコンのような赤外線、Bluetooth(登録商標)、802.11無線、HDR、携帯電話網、衛星回線、地上波デジタル網等の無線でも利用可能である。なお、本発明は、上記プログラムコードが電子的な伝送で具現化された、搬送波に埋め込まれたコンピュータデータ信号の形態でも実現され得る。   Further, the image data encoding device 1 may be configured to be connectable to a communication network, and the program code may be supplied via the communication network. The communication network is not particularly limited. For example, the Internet, intranet, extranet, LAN, ISDN, VAN, CATV communication network, virtual private network, telephone line network, mobile communication network, satellite communication. A net or the like is available. Also, the transmission medium constituting the communication network is not particularly limited. For example, even in the case of wired such as IEEE 1394, USB, power line carrier, cable TV line, telephone line, ADSL line, etc., infrared rays such as IrDA and remote control, Bluetooth ( (Registered trademark), 802.11 wireless, HDR, mobile phone network, satellite line, terrestrial digital network, and the like can also be used. The present invention can also be realized in the form of a computer data signal embedded in a carrier wave in which the program code is embodied by electronic transmission.

次に、本実施形態の画像データ符号化装置1の動作について説明する。図7〜図9は、本実施形態の画像データ符号化装置1による処理を示すフロー図である。   Next, the operation of the image data encoding device 1 of this embodiment will be described. 7 to 9 are flowcharts showing processing by the image data encoding device 1 of the present embodiment.

まず、画像データ符号化装置1の描画命令受付部11は、アプリケーションプログラム等から、上述した描画命令を受け付ける(S11)。そして、描画命令受付部11は、受け付けた描画命令を、領域情報作成部12及び画像データ作成部13に送る。   First, the drawing command reception unit 11 of the image data encoding device 1 receives the above-described drawing command from an application program or the like (S11). Then, the drawing command reception unit 11 sends the received drawing command to the area information creation unit 12 and the image data creation unit 13.

次に、領域情報作成部12は、受け取った描画命令に基づいて、画像データ作成部13において作成される画像を、図3に示すように画像種別ごとの部分画像に区分し、区分した結果得られた部分画像の画像中に占める範囲を示す領域情報を作成する(S12)。そして、領域情報作成部12は、作成した領域情報を記録部31に格納する。   Next, the region information creation unit 12 classifies the image created by the image data creation unit 13 into partial images for each image type as shown in FIG. Area information indicating the range of the partial image in the image is created (S12). Then, the area information creation unit 12 stores the created area information in the recording unit 31.

次に、画像データ作成部13は、描画命令受付部11から受け取った描画命令に従って、2値画像のビットマップ画像データを作成する(S13)。この画像データに対応する画像は、例えば、図3の枠で囲まれた部分に示される画像である。そして、画像データ作成部13は、作成した画像データをコンテクスト生成部21に送る。   Next, the image data creating unit 13 creates bitmap image data of a binary image according to the drawing command received from the drawing command receiving unit 11 (S13). The image corresponding to this image data is, for example, an image shown in a portion surrounded by a frame in FIG. Then, the image data creation unit 13 sends the created image data to the context generation unit 21.

コンテクスト生成部21は、画像データを受け取ると、受け取った画像データに対応する画像(ビットマップ画像)を少なくとも1つ以上のストライプに分割する(S14)。このストライプは、圧縮処理を行う単位であり、画像中の1ライン以上の横ラインからなる。そして、コンテクスト生成部21は、圧縮対象となる画素に含まれるストライプを選択する。このストライプの選択順序は、特に限定されないが、例えば、画像の上から下に向けて順次選択される。S14〜S34におけるストライプについてのループ(LOOP_A)によって、全てのストライプに対して処理が完了すると、画像全体の圧縮が完了する。   When receiving the image data, the context generation unit 21 divides the image (bitmap image) corresponding to the received image data into at least one stripe (S14). This stripe is a unit for performing compression processing, and is composed of one or more horizontal lines in the image. Then, the context generation unit 21 selects a stripe included in the pixel to be compressed. The selection order of the stripes is not particularly limited. For example, the stripes are sequentially selected from the top to the bottom of the image. When the processing for all stripes is completed by the loop (LOOP_A) for the stripes in S14 to S34, the compression of the entire image is completed.

続いて、コンテクスト生成部21は、圧縮対象となる画素(対象画素)を選択する(S15)。この対象画素の選択は、特に限定されないが、例えば、ストライプの左端から右端に向けて順次行う。また、対象画素がラインの端部に到達した場合は、次のラインに移行する。なお、S15〜S32のループ(LOOP_B)にて対象画素についての圧縮を行い、ストライプに含まれる全ての画素の処理が完了すると1つのストライプの処理が完了したことになる。そして、コンテクスト生成部21は、対象画素の位置情報を領域判定部22に送る。   Subsequently, the context generation unit 21 selects a pixel (target pixel) to be compressed (S15). The selection of the target pixel is not particularly limited, but is sequentially performed from the left end to the right end of the stripe, for example. When the target pixel reaches the end of the line, the process proceeds to the next line. In addition, when the compression for the target pixel is performed in the loop (LOOP_B) of S15 to S32 and the processing of all the pixels included in the stripe is completed, the processing of one stripe is completed. Then, the context generation unit 21 sends the position information of the target pixel to the region determination unit 22.

次に、領域判定部22は、コンテクスト生成部21から受け取った対象画素の位置情報に基づいて、対象画素がラインの先頭にあるか否かを判定する(S16)。ここで、対象画素がラインの先頭でなかった場合は、S22に進む。一方、対象画素がラインの先頭である場合は、S17に進む。   Next, the region determination unit 22 determines whether the target pixel is at the head of the line based on the position information of the target pixel received from the context generation unit 21 (S16). If the target pixel is not the head of the line, the process proceeds to S22. On the other hand, if the target pixel is the head of the line, the process proceeds to S17.

S17において、領域判定部22は、対象画素が上述したテキスト領域、グラフィックス領域、ビットマップ領域のいずれの領域に含まれるかを、コンテクスト生成部21から受け取った対象画像の位置情報と、記録部31に格納された領域情報とに基づいて判定する。続いて、領域判定部22は、今回の領域判定結果を、保持していた前回の領域判定結果と比較し、2つの領域判定結果が異なるか否かを判定する(S18)。   In S <b> 17, the region determination unit 22 determines whether the target pixel is included in the above-described text region, graphics region, or bitmap region, the position information of the target image received from the context generation unit 21, and the recording unit. This is determined based on the area information stored in the area 31. Subsequently, the region determination unit 22 compares the current region determination result with the previous region determination result held and determines whether the two region determination results are different (S18).

ここで、2つの領域判定結果が異なる場合は、学習テーブル32のリセット及び確率推定テーブル34の切り換えが必要と判断し、今回の領域判定結果を保持してS19に進む。一方、2つの領域判定結果が一致する場合は、今回の領域判定結果を保持してS22に進む。   Here, if the two region determination results are different, it is determined that the learning table 32 needs to be reset and the probability estimation table 34 needs to be switched, the current region determination result is retained, and the process proceeds to S19. On the other hand, if the two area determination results match, the current area determination result is held and the process proceeds to S22.

ステップS19において、テーブル変更部23は、領域判定部22の指示に従って、後述する算術符号化部26によって参照される確率推定テーブル34の切り換えを行う。本実施形態では、上述したように、記録部31に、3つのそれぞれの領域に適した確率推定テーブルが格納されており、これらのテーブルの中から、テーブル変更部23が、領域判定部22による領域判定結果に基づいて、対象画素の含まれる領域に適した確率推定テーブル34を選択する。そして、テーブル変更部23は、選択したテーブル34を、算術符号化部26によって参照される確率推定テーブル34として設定する。この処理により、後述するS25、S28、S29、S31において算術符号化部によって参照される確率推定テーブルが、テーブル変更部23によって選択されたものへと変更される。   In step S <b> 19, the table changing unit 23 switches the probability estimation table 34 referred to by the arithmetic encoding unit 26 described later in accordance with the instruction from the region determination unit 22. In the present embodiment, as described above, the probability estimation tables suitable for each of the three areas are stored in the recording unit 31, and from these tables, the table changing unit 23 is operated by the area determining unit 22. Based on the region determination result, the probability estimation table 34 suitable for the region including the target pixel is selected. Then, the table changing unit 23 sets the selected table 34 as the probability estimation table 34 referred to by the arithmetic encoding unit 26. By this processing, the probability estimation table referred to by the arithmetic coding unit in S25, S28, S29, and S31 described later is changed to the one selected by the table changing unit 23.

続いて、テーブル変更部23は、記録部31の学習テーブル32のリセットを行う(S20)。本実施形態において、学習テーブル32のリセットは、上述したように、学習テーブル32の内容を、記録部31に格納された初期学習テーブル33の内容で上書きすることによって行われる。これにより、学習テーブル32の内容は、未学習の初期状態に戻る。   Subsequently, the table changing unit 23 resets the learning table 32 of the recording unit 31 (S20). In the present embodiment, the learning table 32 is reset by overwriting the contents of the learning table 32 with the contents of the initial learning table 33 stored in the recording unit 31 as described above. Thereby, the content of the learning table 32 returns to the unlearned initial state.

次に、レジスタ27が、Creg27bに保持されている符号化済みのデータ(算術符号)を領域情報付加部に出力するフラッシュ処理を行う(S21)。これにより、Areg27a及びCreg27bの内容はリセットされる。   Next, the register 27 performs a flash process for outputting the encoded data (arithmetic code) held in the Creg 27b to the area information adding unit (S21). Thereby, the contents of Areg 27a and Creg 27b are reset.

S22において、コンテクスト生成部21は、対象画素の値を符号化対象シンボルとして読み取るとともに、周辺画素群の値を読み取りコンテクストを生成する。そして、符号化対象シンボルとコンテクストとを取得部24に送る。   In S <b> 22, the context generation unit 21 reads the value of the target pixel as an encoding target symbol and reads the values of the peripheral pixel group to generate a context. Then, the encoding target symbol and the context are sent to the acquisition unit 24.

次に、取得部24は、コンテクスト生成部21から受け取ったコンテクストに基づいて、記録部31の学習テーブル32から、優勢確率シンボル(MPS)及び劣勢確率シンボルの確率推定値のインデックスSTを取得する(S23)。具体的には、取得部24は、学習テーブル32において、受け取ったコンテクストに対応するMPS及びSTを取得する。そして、取得部24は、符号化対象シンボルならびに取得したMPS及びSTを算術符号化部26に送る。   Next, the acquisition unit 24 acquires, from the learning table 32 of the recording unit 31, based on the context received from the context generation unit 21, the index ST of the probability estimation values of the dominant probability symbol (MPS) and the inferior probability symbol ( S23). Specifically, the acquisition unit 24 acquires the MPS and ST corresponding to the received context in the learning table 32. Then, the acquisition unit 24 sends the encoding target symbol and the acquired MPS and ST to the arithmetic encoding unit 26.

次に、算術符号化部26の前処理部26aは、受け取った符号化対象シンボルとMPSとを比較して、符号化対象シンボルがMPSであるか否かを判定する(S24)。ここで、符号化対象シンボルがMPSであった場合は、S25に進み、MPS処理部26bが算術符号化を行う(CODE_MPS:S25〜S28)。一方、対象画素の値がMPSでなくLPSであった場合は、S29に進み、MPS処理部26bが算術符号化を行う(CODE_LPS:S29〜S31)。   Next, the preprocessing unit 26a of the arithmetic encoding unit 26 compares the received encoding target symbol with the MPS, and determines whether or not the encoding target symbol is MPS (S24). If the encoding target symbol is MPS, the process proceeds to S25, and the MPS processing unit 26b performs arithmetic encoding (CODE_MPS: S25 to S28). On the other hand, when the value of the target pixel is not MPS but LPS, the process proceeds to S29, and the MPS processing unit 26b performs arithmetic coding (CODE_LPS: S29 to S31).

S25では、MPS処理部26bが、記録部31の確率推定テーブル34を参照して、取得部24から受け取ったインデックスSTに対応する劣勢確率シンボルの確率推定値(LSZ)を取得する。また、MPS処理部26bは、レジスタ27のAreg27a及びCreg27bから、現在のインターバルの情報を取得する。そして、MPS処理部26bは、現在のインターバルをLSZに基づいて分割し、分割により得られた新たなインターバルについての情報をレジスタ27のAreg27a及びCreg27bに格納する(S25)。その結果、レジスタ27には、S15において選択された画素の値(優勢確率シンボル)を含む画素データが符号化された算術符号データが格納される。   In S25, the MPS processing unit 26b refers to the probability estimation table 34 of the recording unit 31, and acquires the probability estimation value (LSZ) of the inferior probability symbol corresponding to the index ST received from the acquisition unit 24. Further, the MPS processing unit 26b acquires information on the current interval from the Areg 27a and the Creg 27b of the register 27. Then, the MPS processing unit 26b divides the current interval based on the LSZ, and stores information on the new interval obtained by the division in the Areg 27a and the Creg 27b of the register 27 (S25). As a result, the register 27 stores arithmetic code data obtained by encoding pixel data including the value (dominance probability symbol) of the pixel selected in S15.

次に、MPS処理部26bは、Areg27aの値が0.5(0x8000)未満か否かを判別する(S26)。ここで、Areg27aの値が0.5未満の場合は、S27に進み正規化処理を行う。一方、Areg27aの値が0.5以上の場合は、S32に進む。   Next, the MPS processing unit 26b determines whether or not the value of the Areg 27a is less than 0.5 (0x8000) (S26). If the value of Areg 27a is less than 0.5, the process proceeds to S27 and normalization processing is performed. On the other hand, when the value of Areg 27a is 0.5 or more, the process proceeds to S32.

S27では、RENORM処理部26dが、MPS処理部26bの指示に従い、レジスタ27のAreg27a及びCreg27bに対して正規化処理を行い(S27)、レジスタ27に対して、符号化済みデータを必要に応じて領域情報付加部28に出力させる。   In S27, the RENORM processing unit 26d performs normalization processing on the Areg 27a and Creg 27b of the register 27 in accordance with the instruction of the MPS processing unit 26b (S27), and the encoded data is transferred to the register 27 as necessary. The region information adding unit 28 outputs the information.

次に、MPS処理部26bは、記録部31の確率推定テーブル34を参照して、取得部24から受け取ったインデックスSTに対応するNMPS及びSWITCHを取得する。そして、MPS処理部26bは、取得したNMPSに基づいて、学習テーブル32の、S22において生成したコンテクストに対応するインデックスSTを更新する(S28)。また、このとき、SWITCHに応じて学習テーブル32のMPSの反転も行う。これにより、コンテクストから学習テーブル32によって導かれるLSZの値が、符号化対象シンボルを加味したものに更新される。そして、S32に進む。   Next, the MPS processing unit 26 b refers to the probability estimation table 34 of the recording unit 31 and acquires the NMPS and SWITCH corresponding to the index ST received from the acquisition unit 24. Then, the MPS processing unit 26b updates the index ST corresponding to the context generated in S22 in the learning table 32 based on the acquired NMPS (S28). At this time, the MPS of the learning table 32 is also inverted according to SWITCH. As a result, the value of LSZ derived from the context by the learning table 32 is updated to take into account the encoding target symbol. Then, the process proceeds to S32.

一方、S29では、LPS処理部26cが、記録部31の確率推定テーブル34を参照して、取得部24から受け取ったインデックスSTに対応する劣勢確率シンボルの確率推定値(LSZ)を取得する。また、LPS処理部26cは、レジスタ27のAreg27a及びCreg27bから、現在のインターバルの情報を取得する。そして、LPS処理部26cは、現在のインターバルをLSZに基づいて分割し、分割により得られた新たなインターバルについての情報をレジスタ27のAreg27a及びCreg27bに格納する。その結果、レジスタ27には、S15において選択された画素の値(劣勢確率シンボル)を含む画素データが符号化された算術符号データが格納される。   On the other hand, in S29, the LPS processing unit 26c refers to the probability estimation table 34 of the recording unit 31, and acquires the probability estimation value (LSZ) of the inferior probability symbol corresponding to the index ST received from the acquisition unit 24. Further, the LPS processing unit 26c acquires information on the current interval from the Areg 27a and the Creg 27b of the register 27. Then, the LPS processing unit 26c divides the current interval based on the LSZ, and stores information on the new interval obtained by the division in the Areg 27a and the Creg 27b of the register 27. As a result, the register 27 stores arithmetic code data obtained by encoding pixel data including the value of the pixel selected in S15 (inferior probability symbol).

次に、LPS処理部26cは、記録部31の確率推定テーブル34を参照して、取得部24から受け取ったインデックスSTに対応するNLPS及びSWITCHを取得する。そして、LPS処理部26cは、取得したSWITCHに応じて、学習テーブル32の、S22において生成したコンテクストに対応するMPSを反転させる(S30)。   Next, the LPS processing unit 26 c refers to the probability estimation table 34 of the recording unit 31 and acquires the NLPS and SWITCH corresponding to the index ST received from the acquisition unit 24. Then, the LPS processing unit 26c inverts the MPS corresponding to the context generated in S22 in the learning table 32 according to the acquired SWITCH (S30).

続いて、LPS処理部26cは、取得したNLPSに基づいて、学習テーブル32の、S22において生成したコンテクストに対応するインデックスSTを更新する(S31)。これにより、コンテクストから学習テーブル32によって導かれるLSZの値が、符号化対象シンボルを加味したものに更新される。   Subsequently, the LPS processing unit 26c updates the index ST corresponding to the context generated in S22 in the learning table 32 based on the acquired NLPS (S31). As a result, the value of LSZ derived from the context by the learning table 32 is updated to take into account the encoding target symbol.

S32では、MPS処理部26b又はLPS処理部26cがコンテクスト生成部21に対して画素インクリメントの指示を行い、S151に戻る。これにより、画素単位の符号化処理が完了する。この符号化処理が、S14で選択されたストライプに含まれる全ての画素について行われると、S33に進み、レジスタ27が符号化済みのデータのフラッシュ処理を行う。そして、S14に戻る。これにより、ストライプ単位の符号化処理が完了する(S34)。   In S32, the MPS processing unit 26b or the LPS processing unit 26c instructs the context generation unit 21 to increment the pixel, and the process returns to S151. This completes the pixel-by-pixel encoding process. When this encoding process is performed for all the pixels included in the stripe selected in S14, the process proceeds to S33, and the register 27 performs the flash process of the encoded data. Then, the process returns to S14. This completes the stripe unit encoding process (S34).

この符号化処理が、画像に含まれる全てのストライプについて行われると、領域情報付加部28には、算術符号によって表現された符号化済みの画像データの全部が蓄積される。最後に、領域情報付加部28は、記録部31から領域情報35を読み取って符号化済みの画像データに付加する(S35)とともに、得られたデータを、インターフェースを介して図示しない画像形成装置に出力し、処理を完了する。   When this encoding process is performed for all the stripes included in the image, the region information adding unit 28 stores all of the encoded image data expressed by the arithmetic code. Finally, the area information adding unit 28 reads the area information 35 from the recording unit 31 and adds it to the encoded image data (S35), and sends the obtained data to an image forming apparatus (not shown) via the interface. Output and complete the process.

以上のように、本実施形態の画像データ符号化装置1は、周辺シンボルのパターンであるコンテクストとLSZを特定するためのインデックスSTとの対応関係が示された学習テーブル32、及び、インデックスSTとLSZとNLPS、NMPS及びSWICTHとの対応関係が示された確率推定テーブル34を格納する記録部31と、画像データから符号化対象画素の値とコンテクストとを抽出するコンテクスト生成部21と、コンテクスト生成部21によって抽出されたコンテクストに対応するインデックスSTを学習テーブル32から取得し、取得したインデックスSTに対応するLSZ及びNLPS又はNMPSを確率推定テーブル34から取得し、取得したLSZに基づいて符号化対象画素の値を算術符号化により符号化するとともに、符号化対象画素の値とMPSとの比較結果に応じてNLPS又はNMPSに基づいて学習テーブル32に含まれるインデックスSTを更新する算術符号化部26とを備えている。また、算術符号化部26は、自身も含めた上記各部による処理を繰り返し実行させるために、画素インクリメントの指示を出力する。   As described above, the image data encoding device 1 according to the present embodiment includes the learning table 32 indicating the correspondence between the context that is the pattern of the peripheral symbols and the index ST for specifying the LSZ, and the index ST. A recording unit 31 that stores a probability estimation table 34 showing the correspondence between LSZ and NLPS, NMPS, and SWICTH, a context generation unit 21 that extracts the value and context of a pixel to be encoded from image data, and context generation The index ST corresponding to the context extracted by the unit 21 is acquired from the learning table 32, the LSZ and NLPS or NMPS corresponding to the acquired index ST are acquired from the probability estimation table 34, and the encoding target is based on the acquired LSZ. When the pixel value is encoded by arithmetic encoding Moni, and an arithmetic coding unit 26 to update the index ST included in the learning table 32 based on the NLPS or NMPS according to a result of comparison between the value of the coded pixel and MPS. In addition, the arithmetic encoding unit 26 outputs a pixel increment instruction in order to repeatedly execute the processing by each unit including itself.

これにより、画像データ符号化装置1は、画像を構成する画素の値を符号化対象シンボルとし、この符号化対象シンボルを、周辺シンボルのパターンから推定されるLSZに基づいて算術符号化により順次符号化する構成となっている。   As a result, the image data encoding apparatus 1 uses the values of the pixels constituting the image as encoding target symbols, and sequentially encodes the encoding target symbols by arithmetic encoding based on the LSZ estimated from the pattern of the surrounding symbols. It becomes the composition which becomes.

ここで、本実施形態の画像データ符号化装置1は、さらに、コンテクスト生成部21によって抽出された符号化対象画素が含まれる領域の画像種別を検出する領域判定部22と、領域判定部22によって検出された画像種別が、以前に検出された画像種別と異なっている場合に、学習テーブル32を変更するテーブル変更部23とを備えている。   Here, the image data encoding device 1 of the present embodiment further includes an area determination unit 22 that detects an image type of an area including the encoding target pixel extracted by the context generation unit 21, and an area determination unit 22. A table changing unit 23 is provided for changing the learning table 32 when the detected image type is different from the previously detected image type.

これにより、符号化対象画素が異なる画像種別の領域に移行した場合に、テーブル変更部23によって学習テーブル32の内容が変更されるので、他の画像種別用に最適化された学習テーブル32を用いて、符号化対象画素の値の符号化を行うことがない。従って、圧縮率が低下してしまうのを抑制することができる。   As a result, when the encoding target pixel shifts to a region of a different image type, the contents of the learning table 32 are changed by the table changing unit 23. Therefore, the learning table 32 optimized for other image types is used. Thus, the value of the encoding target pixel is not encoded. Therefore, it can suppress that a compression rate falls.

なお、本実施形態の画像データ符号化装置1では、上記の学習テーブル32の変更方法として、学習テーブル32のリセット(初期化)を行う構成となっている。すなわち、本実施形態の画像データ符号化装置1の記録部31には、学習テーブル32のテンプレートとなる初期学習テーブル33が格納され、テーブル変更部23は、符号化対象画素が異なる画像種別の領域に移行した場合に、学習テーブル32を初期学習テーブル33に基づいてリセットする構成となっている。   Note that the image data encoding device 1 of the present embodiment is configured to reset (initialize) the learning table 32 as a method of changing the learning table 32 described above. That is, the recording unit 31 of the image data encoding device 1 of the present embodiment stores an initial learning table 33 that serves as a template for the learning table 32, and the table changing unit 23 is an area of image types with different encoding target pixels. In this case, the learning table 32 is reset based on the initial learning table 33.

これにより、符号化対象画素が異なる画像種別の領域に移行した場合に、他の画像種別用に最適化された学習テーブル32の内容がリセットされるので、学習テーブル32が或る画像種別用に最適化された後に、符号化対象画素が画像種別の異なる領域に移行しても、圧縮率が低下してしまうのを抑制することができる。   As a result, when the encoding target pixel shifts to a region of a different image type, the contents of the learning table 32 optimized for other image types are reset, so that the learning table 32 is used for a certain image type. Even after the optimization, even if the encoding target pixel shifts to a region having a different image type, it is possible to suppress a reduction in the compression rate.

なお、本実施形態では、上述したように、記録部31に単一の初期学習テーブル33を用意しておき、学習テーブル32のリセットをこの初期学習テーブル33によって行う構成としたが、本発明はこれに限定されず、記録部31に、画像種別ごとに初期学習テーブル33…を用意しておき、テーブル変更部23は、符号化対象画素が異なる画像種別の領域に移行した場合に、算術符号化部26が利用する学習テーブル32を、符号化対象画素の含まれる領域の画像種別に応じた初期学習テーブル33に基づいてリセットしてもよい。すなわち、この場合、図10に示すように、記録部31には、テキスト領域用、グラフィックス領域用及びビットマップ領域用の3つの初期学習テーブル33a〜33cが格納され、符号化対象画素が属する領域用の初期学習テーブル33a〜33cに基づいて学習テーブル32のリセットが行われる。   In the present embodiment, as described above, a single initial learning table 33 is prepared in the recording unit 31 and the learning table 32 is reset by the initial learning table 33. The initial learning table 33... Is prepared for each image type in the recording unit 31, and the table changing unit 23 calculates the arithmetic code when the encoding target pixel is shifted to a different image type region. The learning table 32 used by the conversion unit 26 may be reset based on the initial learning table 33 corresponding to the image type of the region including the encoding target pixel. That is, in this case, as shown in FIG. 10, the recording unit 31 stores three initial learning tables 33a to 33c for the text area, the graphics area, and the bitmap area, and the encoding target pixel belongs to the recording area 31. The learning table 32 is reset based on the area initial learning tables 33a to 33c.

これにより、符号化対象画素が画像種別の異なる領域に移行した場合に、学習テーブル32が移行先の領域の画像種別に適した内容に書き換えられるので、学習テーブル32が最適化されるまでの期間が短縮される。その結果、圧縮率を向上させることができる。   As a result, when the encoding target pixel shifts to a region having a different image type, the learning table 32 is rewritten with contents suitable for the image type of the transfer destination region, so that the period until the learning table 32 is optimized Is shortened. As a result, the compression rate can be improved.

なお、初期学習テーブル33は、例えばビットマップ領域用であればディザパターンを考慮したものとなり、一方、グラフィックス領域用であれば線画を意識したものとなる。各領域に好適な初期学習テーブル33は、実験的にそれぞれの画像種別の画像を何枚かを符号化し、統計的に最適化までの期間が短いテーブルを求めて作成すればよい。   Note that the initial learning table 33 takes into account a dither pattern if it is for, for example, a bitmap area, while being aware of a line drawing if it is for a graphics area. The initial learning table 33 suitable for each region may be created by experimentally coding a number of images of each image type and obtaining a table that has a short period until optimization statistically.

また、学習テーブル32の変更方法の変形例として次のものが挙げられる。すなわち、変形例では、記録部31に、学習テーブル32のテンプレートである初期学習テーブル33ではなく、図11に示すように、学習テーブル32そのものを画像種別ごとに用意しておく。つまり、記録部31に、テキスト領域用、グラフィックス領域用及びビットマップ領域用の3つの学習テーブル32a〜32cを格納しておく。そして、テーブル変更部23は、符号化対象画素が異なる画像種別の領域に移行した場合に、算術符号化部26が利用する学習テーブル32を、符号化対象画素の含まれる領域の画像種別に応じた学習テーブル32に切り換える構成とする。   Moreover, the following is mentioned as a modification of the change method of the learning table 32. FIG. That is, in the modification, the learning table 32 itself is prepared for each image type in the recording unit 31 as shown in FIG. 11 instead of the initial learning table 33 that is a template of the learning table 32. That is, three learning tables 32a to 32c for the text area, the graphics area, and the bitmap area are stored in the recording unit 31. Then, the table changing unit 23 changes the learning table 32 used by the arithmetic coding unit 26 according to the image type of the region including the encoding target pixel when the encoding target pixel shifts to a region of a different image type. The learning table 32 is switched.

これにより、符号化対象画素が画像種別の異なる領域に移行した場合に、学習テーブル32が移行先の領域の画像種別に応じたものに切り換えられ、テキスト領域の画素を符号化するときはテキスト領域用の学習テーブル32aを用い、グラフィックス領域の画素を符号化するときはグラフィックス領域用の学習テーブル32bを用い、ビットマップ領域の画素を符号化するときはビットマップ領域用の学習テーブル32cを用いることになる。そのため、符号化対象画素が画像種別の異なる領域に移行した際に、学習テーブル32を再び最適化する必要がない。その結果、圧縮率をさらに向上させることができる。   As a result, when the encoding target pixel shifts to a region having a different image type, the learning table 32 is switched to one corresponding to the image type of the transfer destination region, and the text region is encoded when the text region pixel is encoded. The learning table 32a for the graphics area is used. When the pixels in the graphics area are encoded, the learning table 32b for the graphics area is used. When the pixels in the bitmap area are encoded, the learning table 32c for the bitmap area is used. Will be used. Therefore, it is not necessary to optimize the learning table 32 again when the encoding target pixel shifts to a region having a different image type. As a result, the compression rate can be further improved.

なお、本実施形態では、符号化対象画素が画像種別の異なる領域に移行した場合に、テーブル変更部23が必ず学習テーブル32の変更(リセット)を行う構成としたが、本発明はこれに限定されず、符号化対象画素が画像種別の異なる領域に移行し、かつ、所定の条件を満たしたときに、学習テーブルの変更(リセット)を行ってもよい。この場合、例えば、符号化対象画素がグラフィックス領域からテキスト領域へ移行したとき、及び、テキスト領域からグラフィックス領域へ移行したときには、学習テーブルの変更(リセット)を行わず、符号化対象画素がビットマップ領域から他の領域へ移行したとき、及び、他の領域からビットマップ領域へ移行したときのみ、学習テーブルの変更(リセット)を行ってもよい。   In this embodiment, the table changing unit 23 always changes (resets) the learning table 32 when the encoding target pixel shifts to a region having a different image type. However, the present invention is not limited to this. Instead, the learning table may be changed (reset) when the encoding target pixel shifts to a region having a different image type and a predetermined condition is satisfied. In this case, for example, when the encoding target pixel shifts from the graphics area to the text area, and when the encoding target pixel shifts from the text area to the graphics area, the learning table is not changed (reset), and the encoding target pixel does not change. The learning table may be changed (reset) only when shifting from the bitmap area to another area and when shifting from another area to the bitmap area.

また、本実施形態では、符号化対象画素が含まれる領域の画像種別は、次のようにして検出される。すなわち、画像データ符号化装置1は、画像を作成するために画像中に所望の種類のオブジェクトを所望の位置に配置するよう指示する描画命令を受け付ける描画命令受付部11と、描画命令受付部11が受け付けた描画命令に従って、画像のデータを作成する画像データ作成部13とをさらに備えている。そして、領域判定部22は、描画命令受付部11の受け付けた描画命令に基づいて、符号化対象画素が含まれる領域の画像種別を検出する。   In the present embodiment, the image type of the area including the encoding target pixel is detected as follows. That is, the image data encoding device 1 includes a drawing command receiving unit 11 that receives a drawing command for instructing to place an object of a desired type in a desired position in the image, and a drawing command receiving unit 11. Is further provided with an image data creation unit 13 for creating image data in accordance with the drawing command received by the user. Then, the region determination unit 22 detects the image type of the region including the encoding target pixel based on the drawing command received by the drawing command receiving unit 11.

より具体的には、画像データ符号化装置1が、描画命令受付部11の受け付けた描画命令から、画像中に配置されるオブジェクトの種類と当該オブジェクトの画像中に占める範囲との情報を取得し、取得したオブジェクトの種別及び範囲の情報に基づいて画像をテキスト領域、グラフィックス領域及びビットマップ領域に区分するとともに、区分した各領域の画像種別と当該領域の上記画像中に占める範囲とを示す領域情報を作成する領域情報作成部12をさらに備えている。そして、領域判定部22は、領域情報作成部12の作成した領域情報に基づいて、符号化対象画素が含まれる領域の画像種別を検出する。   More specifically, the image data encoding device 1 acquires information on the type of object arranged in the image and the range occupied by the object in the image from the drawing command received by the drawing command receiving unit 11. The image is divided into a text area, a graphics area, and a bitmap area based on the acquired object type and range information, and the image type of each divided area and the range of the area in the image are indicated. An area information creation unit 12 for creating area information is further provided. Then, the region determination unit 22 detects the image type of the region including the encoding target pixel based on the region information created by the region information creation unit 12.

このように本実施形態の画像データ符号化装置1では、画像データを作成するための描画命令によって配置が指示されるオブジェクトの種類及び当該オブジェクトが画像中に占める範囲に基づいて、画像中の各位置における画素が属する領域の画像種別を検出する。従って、ビットマップ画像のデータを基に統計的手法を用いて領域判定を行う従来の方法に比べて、領域判定を正確かつ簡便に行うことができる。   As described above, in the image data encoding device 1 according to the present embodiment, each of the images in the image is based on the type of the object instructed by the drawing command for creating the image data and the range occupied by the object in the image. The image type of the area to which the pixel at the position belongs is detected. Therefore, the region determination can be performed accurately and easily as compared with the conventional method in which the region determination is performed using the statistical method based on the bitmap image data.

なお、本実施形態では、画像をライン単位で画像種別ごとの領域に区分したが、本発明はこれに限定されず、画素単位で画像種別ごとの領域に区分してもよい。この場合、上述したS16の処理を省略すればよい。このようにすれば、領域判定処理の回数が増えるため処理量は増加するが、判定の頻度が上がることにより、学習テーブル32の変更を迅速に行い、圧縮率を一層向上させることができる。   In this embodiment, the image is divided into regions for each image type in units of lines. However, the present invention is not limited to this, and may be divided into regions for each image type in units of pixels. In this case, the process of S16 described above may be omitted. In this way, the processing amount increases because the number of area determination processes increases, but by increasing the determination frequency, the learning table 32 can be quickly changed and the compression rate can be further improved.

また、本実施形態の画像データ符号化装置1は、記録部31に、テキスト領域用、グラフィックス領域用及びビットマップ領域用の3つの確率推定テーブル34…が格納されている。そして、テーブル変更部23は、符号化対象画素が異なる画像種別の領域に移行した場合に、算術符号化部26によって参照される確率推定テーブル34を、符号化対象画素が含まれる領域の画像種別に応じた確率推定テーブル34に切り換える構成となっている。   In the image data encoding apparatus 1 of the present embodiment, the recording unit 31 stores three probability estimation tables 34 for the text area, the graphics area, and the bitmap area. Then, the table changing unit 23 uses the probability estimation table 34 referred to by the arithmetic encoding unit 26 when the encoding target pixel shifts to a region of a different image type, and the image type of the region including the encoding target pixel. The configuration is switched to the probability estimation table 34 according to the above.

確率推定テーブル34…は、学習テーブル32の更新情報を含んでいるため、学習テーブル32の更新方法(学習方法)を決定するものであるともいえる。従って、上記の構成により、学習テーブル32の最適化方法を画像種別ごとに変更することができ、学習テーブル32の最適化を効率よく行うことができる。   Since the probability estimation table 34 includes update information of the learning table 32, it can be said that an update method (learning method) of the learning table 32 is determined. Therefore, with the above configuration, the optimization method of the learning table 32 can be changed for each image type, and the learning table 32 can be optimized efficiently.

本発明は上述した実施形態に限定されるものではなく、請求項に示した範囲で種々の変更が可能である。すなわち、請求項に示した範囲で適宜変更した技術的手段を組み合わせて得られる実施形態についても本発明の技術的範囲に含まれる。   The present invention is not limited to the above-described embodiments, and various modifications can be made within the scope of the claims. That is, embodiments obtained by combining technical means appropriately modified within the scope of the claims are also included in the technical scope of the present invention.

本発明によれば、画像データを高い圧縮率で符号化することができる。従って、画像データを圧縮して送信する必要がある各種装置、例えばファクシミリ送信機、あるいは画像形成装置へ画像データを出力する出力装置等に好適に利用することができる。   According to the present invention, image data can be encoded at a high compression rate. Therefore, the present invention can be suitably used for various devices that need to compress and transmit image data, such as a facsimile transmitter or an output device that outputs image data to an image forming apparatus.

本発明の一実施形態を示すものであり、画像データ符号化装置の構成を示す機能ブロック図である。1, showing an embodiment of the present invention, is a functional block diagram illustrating a configuration of an image data encoding device. FIG. 算術符号化の処理内容を説明する図である。It is a figure explaining the processing content of arithmetic coding. 本発明の一実施形態を示すものであり、画像を画像種別ごとの領域に区分する様子を示した図である。FIG. 1 is a diagram illustrating an embodiment of the present invention and illustrating how an image is divided into regions for each image type. 符号化対象の画素とコンテクストに用いられる周辺画素との位置関係を示す図である。It is a figure which shows the positional relationship of the pixel of encoding object, and the surrounding pixel used for a context. 学習テーブルの内容を示す図である。It is a figure which shows the content of the learning table. 確率推定テーブルの内容を示す図である。It is a figure which shows the content of the probability estimation table. 本発明の一実施形態を示すものであり、画像データ符号化装置による処理の前期部分を示すフロー図である。FIG. 4 is a flowchart illustrating an embodiment of the present invention and illustrating a first half of processing by an image data encoding device. 本発明の一実施形態を示すものであり、画像データ符号化装置による処理の中期部分を示すフロー図である。FIG. 7 is a flowchart illustrating an embodiment of the present invention and showing a middle part of processing by an image data encoding device. 本発明の一実施形態を示すものであり、画像データ符号化装置による処理の後期部分を示すフロー図である。FIG. 7 is a flowchart illustrating an embodiment of the present invention and illustrating a latter part of processing by an image data encoding device. 本発明の他の実施形態を示すものであり、記録部の内容を示したものである。The other embodiment of this invention is shown and the content of the recording part is shown. 本発明のさらに他の実施形態を示すものであり、記録部の内容を示したものである。FIG. 6 shows still another embodiment of the present invention, and shows the contents of a recording unit. FIG. 従来技術を示すものであり、QM−Coderの構成を示すブロック図である。It is a block diagram which shows a prior art and shows the structure of QM-Coder. 従来技術を示すものであり、QM−Coderによる処理の流れを示すフロー図である。It is a flowchart which shows a prior art and shows the flow of a process by QM-Coder.

符号の説明Explanation of symbols

1 画像データ符号化装置
11 描画命令受付部(描画命令受付手段)
12 領域情報作成部(領域情報作成手段)
13 画像データ作成部(画像データ作成手段)
21 コンテクスト生成部(抽出手段)
22 領域判定部(画像種別検出手段)
23 テーブル変更部(学習テーブル変更手段、テーブル切換手段)
24 取得部(符号化手段)
26 算術符号化部(符号化手段、ループ手段)
27 レジスタ(データ保持手段)
28 領域情報付加部(領域情報付加手段)
31 記録部(学習テーブル記憶手段、確率推定テーブル記憶手段、初期テーブル記憶手段)
32 学習テーブル
33 初期学習テーブル(初期テーブル)
34 確率推定テーブル
35 領域情報
DESCRIPTION OF SYMBOLS 1 Image data encoding apparatus 11 Drawing command reception part (drawing command reception means)
12 Area information creation unit (area information creation means)
13 Image data creation unit (image data creation means)
21 Context generation part (extraction means)
22 Area determination unit (image type detection means)
23 Table changing section (learning table changing means, table switching means)
24 Acquisition unit (encoding means)
26 Arithmetic coding unit (encoding means, loop means)
27 register (data holding means)
28 Area information adding unit (area information adding means)
31 recording unit (learning table storage means, probability estimation table storage means, initial table storage means)
32 learning table 33 initial learning table (initial table)
34 Probability estimation table 35 Area information

Claims (15)

画像のデータを構成するシンボルを順次符号化対象シンボルとし、該符号化対象シンボルを、周辺シンボルのパターンから推定されるシンボル出現確率に基づいて算術符号化により順次符号化する画像データ符号化装置において、
上記周辺シンボルのパターンと、上記シンボル出現確率を特定するためのインデックスとの対応関係が示された学習テーブルを格納する学習テーブル記憶手段と、
上記学習テーブルに示される上記インデックスと、上記シンボル出現確率と、上記学習テーブルにおける上記インデックスの更新内容を示す更新情報との対応関係が示された確率推定テーブルを格納する確率推定テーブル記憶手段と、
上記画像のデータから上記符号化対象シンボルと上記周辺シンボルのパターンとを抽出する抽出手段と、
上記抽出手段によって抽出された上記符号化対象シンボルに対応する上記画像中の部分領域の画像種別を検出する画像種別検出手段と、
上記画像種別検出手段によって検出された画像種別が、以前に上記画像種別検出手段によって検出された画像種別と異なっている場合に、上記学習テーブル記憶手段に格納されている学習テーブルを変更する学習テーブル変更手段と、
上記抽出手段によって抽出された上記周辺シンボルのパターンに対応する上記インデックスを上記学習テーブルから取得し、取得したインデックスに対応する上記出現確率及び上記更新情報を上記確率推定テーブルから取得し、取得した出現確率に基づいて上記抽出手段によって抽出された上記符号化対象シンボルを算術符号化により符号化するとともに、上記符号化対象シンボルと取得した更新情報とに基づいて上記学習テーブルに含まれる上記インデックスを更新する符号化手段と、
上記抽出手段、上記画像種別検出手段、上記学習テーブル変更手段、及び上記符号化手段に対して処理を繰り返し実行させるループ手段と、を備えていることを特徴とする画像データ符号化装置。
In an image data encoding apparatus that sequentially encodes symbols constituting image data as encoding target symbols, and sequentially encodes the encoding target symbols by arithmetic encoding based on symbol appearance probabilities estimated from surrounding symbol patterns ,
Learning table storage means for storing a learning table showing a correspondence relationship between the pattern of the peripheral symbols and an index for specifying the symbol appearance probability;
A probability estimation table storage means for storing a probability estimation table in which a correspondence relationship between the index shown in the learning table, the symbol appearance probability, and update information indicating update contents of the index in the learning table is shown;
Extraction means for extracting the encoding target symbol and the peripheral symbol pattern from the image data;
Image type detection means for detecting the image type of the partial area in the image corresponding to the encoding target symbol extracted by the extraction means;
A learning table for changing a learning table stored in the learning table storage unit when the image type detected by the image type detection unit is different from the image type previously detected by the image type detection unit Change means,
The index corresponding to the pattern of the peripheral symbols extracted by the extraction unit is acquired from the learning table, the appearance probability and the update information corresponding to the acquired index are acquired from the probability estimation table, and the acquired appearance The encoding target symbol extracted by the extraction unit based on the probability is encoded by arithmetic encoding, and the index included in the learning table is updated based on the encoding target symbol and the acquired update information. Encoding means for
An image data encoding apparatus comprising: the extraction unit; the image type detection unit; the learning table change unit; and a loop unit that causes the encoding unit to repeatedly execute processing.
上記学習テーブルのテンプレートとなる初期テーブルを格納する初期テーブル記憶手段をさらに備え、
上記学習テーブル変更手段は、上記画像種別検出手段によって検出された上記画像種別が、以前に上記画像種別検出手段によって検出された上記画像種別と異なっている場合に、上記学習テーブル記憶手段に格納されている上記学習テーブルを、上記初期テーブル記憶手段に格納された上記初期テーブルに基づいて書き換えることを特徴とする請求項1に記載の画像データ符号化装置。
An initial table storage means for storing an initial table serving as a template for the learning table;
The learning table changing means is stored in the learning table storage means when the image type detected by the image type detecting means is different from the image type previously detected by the image type detecting means. The image data encoding apparatus according to claim 1, wherein the learning table is rewritten based on the initial table stored in the initial table storage unit.
上記初期テーブル記憶手段は、上記初期テーブルを上記画像種別ごとに複数格納し、
上記学習テーブル変更手段は、上記画像種別検出手段によって検出された上記画像種別が、以前に上記画像種別検出手段によって検出された上記画像種別と異なっている場合に、上記学習テーブルを、上記符号化対象シンボルに対応する上記部分領域の画像種別に応じた上記初期テーブルに基づいて書き換えることを特徴とする請求項2に記載の画像データ符号化装置。
The initial table storage means stores a plurality of the initial tables for each image type,
The learning table changing unit encodes the learning table when the image type detected by the image type detecting unit is different from the image type previously detected by the image type detecting unit. The image data encoding apparatus according to claim 2, wherein rewriting is performed based on the initial table corresponding to the image type of the partial area corresponding to the target symbol.
上記学習テーブル記憶手段は、上記学習テーブルを上記画像種別ごとに格納し、
上記学習テーブル変更手段は、上記画像種別検出手段によって検出された上記画像種別が、以前に上記画像種別検出手段によって検出された上記画像種別と異なっている場合に、上記符号化手段によって参照及び更新される学習テーブルを、上記符号化対象シンボルに対応する上記部分領域の画像種別に応じた学習テーブルに切り換えることを特徴とする請求項1に記載の画像データ符号化装置。
The learning table storage means stores the learning table for each image type,
The learning table changing unit refers to and updates by the encoding unit when the image type detected by the image type detection unit is different from the image type previously detected by the image type detection unit. The image data encoding apparatus according to claim 1, wherein the learning table is switched to a learning table corresponding to an image type of the partial area corresponding to the encoding target symbol.
上記画像を作成するために画像中に所望の種類のオブジェクトを所望の位置に配置するよう指示する描画命令を受け付ける描画命令受付手段と、
上記描画命令受付手段が受け付けた描画命令に従って、上記画像のデータを作成する画像データ作成手段とをさらに備え、
上記画像種別検出手段は、上記描画命令受付手段の受け付けた描画命令に基づいて、上記符号化対象シンボルに対応する上記部分領域の画像種別を検出することを特徴とする請求項1に記載の画像データ符号化装置。
A drawing command receiving means for receiving a drawing command for instructing to place a desired type of object in a desired position in the image in order to create the image;
Image data creating means for creating the image data according to the drawing command received by the drawing command receiving means;
2. The image according to claim 1, wherein the image type detection unit detects an image type of the partial region corresponding to the encoding target symbol based on a drawing command received by the drawing command receiving unit. Data encoding device.
上記描画命令受付手段が受け付けた描画命令から、上記画像中に配置されるオブジェクトの種類と当該オブジェクトの上記画像中に占める範囲とを取得し、取得したオブジェクトの上記種別及び範囲に基づいて上記画像を画像種別ごとの部分画像に区分するとともに、区分した部分画像の画像種別と当該部分画像の上記画像中に占める範囲とを示す領域情報を作成する領域情報作成手段をさらに備え、
上記画像種別検出手段は、上記領域情報作成手段の作成した領域情報に基づいて、上記符号化対象シンボルに対応する上記部分領域の画像種別を検出することを特徴とする請求項5に記載の画像データ符号化装置。
From the drawing command received by the drawing command receiving means, the type of the object arranged in the image and the range occupied by the object in the image are acquired, and the image is based on the type and range of the acquired object. Is further provided with region information creating means for creating region information indicating the image type of the divided partial image and the range of the partial image in the image,
6. The image according to claim 5, wherein the image type detection unit detects an image type of the partial region corresponding to the encoding target symbol based on the region information created by the region information creation unit. Data encoding device.
上記画像のデータを構成する全てのシンボルが符号化されることにより得られた符号化済みの画像のデータに対して、上記領域情報を付加する領域情報付加手段をさらに備えていることを特徴とする請求項6に記載の画像データ符号化装置。   The image processing apparatus further comprises region information adding means for adding the region information to encoded image data obtained by encoding all symbols constituting the image data. The image data encoding device according to claim 6. 上記確率推定テーブル記憶手段は、上記確率推定テーブルを上記画像種別ごとに複数格納し、
上記画像種別検出手段によって検出された上記画像種別が、以前に上記画像種別検出手段によって検出された上記画像種別と異なっている場合に、上記符号化手段によって参照される上記確率推定テーブルを、上記符号化対象シンボルに対応する上記部分領域の画像種別に応じた確率推定テーブルに切り換えるテーブル切換手段をさらに備えていることを特徴とする請求項1に記載の画像データ符号化装置。
The probability estimation table storage means stores a plurality of the probability estimation tables for each image type,
When the image type detected by the image type detection unit is different from the image type previously detected by the image type detection unit, the probability estimation table referred to by the encoding unit is 2. The image data encoding apparatus according to claim 1, further comprising table switching means for switching to a probability estimation table corresponding to the image type of the partial area corresponding to the encoding target symbol.
上記符号化対象シンボルが上記符号化手段によって順次符号化されることにより得られる算術符号を保持するデータ保持手段をさらに備え、
上記符号化データ保持手段は、上記画像種別検出手段によって検出された上記画像種別が、以前に上記画像種別検出手段によって検出された上記画像種別と異なっている場合に、上記算術符号を出力して、自身の保持する算術符号をリセットすることを特徴とする請求項1に記載の画像データ符号化装置。
Data holding means for holding an arithmetic code obtained by sequentially encoding the encoding target symbols by the encoding means;
The encoded data holding unit outputs the arithmetic code when the image type detected by the image type detection unit is different from the image type previously detected by the image type detection unit. The image data encoding apparatus according to claim 1, wherein the arithmetic code held by itself is reset.
上記符号化手段は、QM−Coder方式に従って符号化を行うことを特徴とする請求項1に記載の画像データ符号化装置。   The image data encoding apparatus according to claim 1, wherein the encoding unit performs encoding according to a QM-Coder system. 上記画像のデータが上記符号化手段によって符号化されることにより得られた符号化済みの画像のデータを画像形成装置に対して出力するデータ出力手段をさらに備えていることを特徴とする請求項1に記載の画像データ符号化装置。   The data output means for outputting the encoded image data obtained by encoding the image data by the encoding means to the image forming apparatus. 2. The image data encoding device according to 1. 上記各手段は、コンピュータがプログラムを実行することにより実現されるものであり、
上記描画命令受付手段は、アプリケーションプログラムからオペレーティングシステムを介して上記描画命令を受け付けることを特徴とする請求項5に記載の画像データ符号化装置。
Each of the above means is realized by a computer executing a program,
6. The image data encoding apparatus according to claim 5, wherein the drawing command receiving unit receives the drawing command from an application program via an operating system.
請求項1から12の何れか1項に記載の画像データ符号化装置の各手段としてコンピュータを機能させるためのプログラム。   The program for functioning a computer as each means of the image data coding apparatus of any one of Claim 1 to 12. 請求項13に記載のプログラムが記録されたコンピュータ読み取り可能な記録媒体。   A computer-readable recording medium on which the program according to claim 13 is recorded. 画像のデータを構成するシンボルを符号化対象シンボルとし、該符号化対象シンボルを、周辺シンボルのパターンから推定されるシンボル出現確率に基づいて算術符号化により順次符号化する画像データ符号化方法において、
抽出手段が、上記画像のデータから上記符号化対象シンボルと上記周辺シンボルのパターンとを抽出する抽出ステップと、
画像種別検出手段が、上記抽出ステップにおいて抽出された上記符号化対象シンボルに対応する上記画像中の部分領域の画像種別を検出する画像種別検出ステップと、
上記画像種別検出ステップにおいて検出された上記画像種別が、以前に上記画像種別検出ステップにおいて検出された上記画像種別と異なっている場合に、学習テーブル変更手段が、記憶手段に格納されている、上記周辺シンボルのパターンと上記シンボル出現確率を特定するためのインデックスとの対応関係が示された学習テーブルを変更する学習テーブル変更ステップと、
符号化手段が、上記記憶手段に格納されている上記学習テーブルから、上記抽出ステップにおいて抽出された上記周辺シンボルのパターンに対応する上記インデックスを取得し、上記記憶手段に格納されている、上記学習テーブルに示される上記インデックスと上記シンボル出現確率と上記学習テーブルにおける上記インデックスの更新内容を示す更新情報との対応関係が示された上記確率推定テーブルから、取得したインデックスに対応する上記出現確率及び上記更新情報を取得し、取得した出現確率に基づいて上記抽出ステップにおいて抽出された上記符号化対象シンボルを算術符号化により符号化するとともに、上記符号化対象シンボルと取得した更新情報とに基づいて上記学習テーブルに含まれる上記インデックスを更新する符号化ステップとを含み、
上記抽出ステップ、上記画像種別検出ステップ、上記学習テーブル変更ステップ、及び上記符号化ステップを繰り返し実行することを特徴とする画像データ符号化方法。
In an image data encoding method in which a symbol constituting image data is an encoding target symbol, and the encoding target symbol is sequentially encoded by arithmetic encoding based on a symbol appearance probability estimated from a pattern of surrounding symbols.
An extraction step in which the extraction means extracts the encoding target symbol and the pattern of the peripheral symbols from the image data;
An image type detection unit for detecting an image type of a partial region in the image corresponding to the encoding target symbol extracted in the extraction step;
When the image type detected in the image type detection step is different from the image type previously detected in the image type detection step, a learning table changing unit is stored in a storage unit, A learning table changing step for changing a learning table showing a correspondence relationship between a pattern of surrounding symbols and an index for specifying the symbol appearance probability;
The encoding means obtains the index corresponding to the pattern of the peripheral symbols extracted in the extraction step from the learning table stored in the storage means, and stores the learning stored in the storage means From the probability estimation table showing a correspondence relationship between the index shown in the table, the symbol appearance probability, and update information indicating update contents of the index in the learning table, the appearance probability corresponding to the acquired index and the Update information is acquired, and the encoding target symbol extracted in the extraction step based on the acquired appearance probability is encoded by arithmetic encoding, and the encoding target symbol and the acquired update information are used as described above. Coding to update the index included in the learning table And a step,
An image data encoding method comprising repeatedly executing the extraction step, the image type detection step, the learning table change step, and the encoding step.
JP2006118511A 2006-04-21 2006-04-21 Image data encoder, program, computer-readable recording medium, and image data encoding method Pending JP2007295130A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006118511A JP2007295130A (en) 2006-04-21 2006-04-21 Image data encoder, program, computer-readable recording medium, and image data encoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006118511A JP2007295130A (en) 2006-04-21 2006-04-21 Image data encoder, program, computer-readable recording medium, and image data encoding method

Publications (1)

Publication Number Publication Date
JP2007295130A true JP2007295130A (en) 2007-11-08

Family

ID=38765323

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006118511A Pending JP2007295130A (en) 2006-04-21 2006-04-21 Image data encoder, program, computer-readable recording medium, and image data encoding method

Country Status (1)

Country Link
JP (1) JP2007295130A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013189077A1 (en) * 2012-06-21 2013-12-27 Intel Corporation Techniques for improved graphics encoding
JP2015106742A (en) * 2013-11-28 2015-06-08 シャープ株式会社 Determination device, portable terminal device, program, and recording medium
CN112997214A (en) * 2018-11-13 2021-06-18 索尼公司 Information processing apparatus, information processing method, and program

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013189077A1 (en) * 2012-06-21 2013-12-27 Intel Corporation Techniques for improved graphics encoding
US10158851B2 (en) 2012-06-21 2018-12-18 Intel Corporation Techniques for improved graphics encoding
JP2015106742A (en) * 2013-11-28 2015-06-08 シャープ株式会社 Determination device, portable terminal device, program, and recording medium
CN112997214A (en) * 2018-11-13 2021-06-18 索尼公司 Information processing apparatus, information processing method, and program
CN112997214B (en) * 2018-11-13 2024-04-26 索尼公司 Information processing device, information processing method, and program

Similar Documents

Publication Publication Date Title
JP5132517B2 (en) Image processing apparatus and image processing method
JP4979323B2 (en) Image processing apparatus and control method thereof
KR101146162B1 (en) Adaptive Compression of Multi-Level Images
KR100845090B1 (en) Image encoding apparatus, image decoding apparatus and control method therefor
JP2000115781A (en) Coder
KR20120065394A (en) Image processing apparatus and processing method therefor
JP2000115783A (en) Decoder and its method
JP2008042688A (en) Image processing apparatus and control method thereof, and computer program and computer readable storage medium
JP2003348360A (en) Document encoding system, document decoding system and methods therefor
JP5893379B2 (en) Image compression apparatus, image compression method, and computer program
JP4364809B2 (en) Image processing apparatus, image processing method, program, and recording medium
JP5375372B2 (en) Compression encoding apparatus and decoding apparatus
US8107743B2 (en) Image processing device, image processing method, and storage medium
JP2007295130A (en) Image data encoder, program, computer-readable recording medium, and image data encoding method
KR101454208B1 (en) Method and apparatus for encoding/decoding halftone image
US8649051B2 (en) Image composition device, image forming apparatus and computer readable medium storing program
JP2006121302A (en) Device and method for encoding
JP2008278462A (en) Image processing device, image processing method, and storage medium
JP3750367B2 (en) Image encoding / decoding device
JP2010074444A (en) Image compression apparatus and method, image decoding apparatus and method, and computer program
JP4719924B2 (en) Image processing apparatus and image processing method
JP4343863B2 (en) Image encoding device, image decoding device, and control method thereof
JP4757172B2 (en) Image coding apparatus and control method thereof
JP3847891B2 (en) Encoding apparatus and method and storage medium storing method
JP2005341098A (en) Image processing unit, program, and recording medium