JP4978934B2 - Image compression apparatus and program - Google Patents

Image compression apparatus and program Download PDF

Info

Publication number
JP4978934B2
JP4978934B2 JP2008127894A JP2008127894A JP4978934B2 JP 4978934 B2 JP4978934 B2 JP 4978934B2 JP 2008127894 A JP2008127894 A JP 2008127894A JP 2008127894 A JP2008127894 A JP 2008127894A JP 4978934 B2 JP4978934 B2 JP 4978934B2
Authority
JP
Japan
Prior art keywords
code amount
compression rate
compression
compressed
tile
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2008127894A
Other languages
Japanese (ja)
Other versions
JP2009278390A (en
Inventor
信二 林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kyocera Document Solutions Inc
Original Assignee
Kyocera Document Solutions Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kyocera Document Solutions Inc filed Critical Kyocera Document Solutions Inc
Priority to JP2008127894A priority Critical patent/JP4978934B2/en
Publication of JP2009278390A publication Critical patent/JP2009278390A/en
Application granted granted Critical
Publication of JP4978934B2 publication Critical patent/JP4978934B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Description

画像データを圧縮するための画像圧縮装置及びプログラムに関するものである。   The present invention relates to an image compression apparatus and a program for compressing image data.

近年、デジタル機器の発展に伴って、画像データ等の様々な圧縮方式が提案されているが、圧縮方式の1つとしてJPEG(Joint Photographic Experts Group)2000が知られている。JPEG2000は画像の圧縮・展開の方法を規定したもので、JPEGを発展させたものである。JPEG2000は、特許文献1に記載されているように、画像データを複数のタイルに分割し、タイル毎にウェーブレット変換、量子化、エントロピー符号化等の処理を施して符号化データを生成する。
特開2005−167841号公報
In recent years, with the development of digital devices, various compression methods for image data and the like have been proposed, and JPEG (Joint Photographic Experts Group) 2000 is known as one of the compression methods. JPEG2000 defines an image compression / decompression method, and is an extension of JPEG. JPEG 2000 divides image data into a plurality of tiles and generates encoded data by performing processing such as wavelet transform, quantization, and entropy encoding for each tile, as described in Patent Document 1.
Japanese Patent Laying-Open No. 2005-167841

このようなJPEG2000の場合、任意の圧縮率を設定しても、実際にはその設定された圧縮率より高い圧縮率(少ない符号量)で圧縮が行われている場合があった。例えば20%の圧縮率を設定したとしても、あるタイルは18%で圧縮されていたり、別のタイルは17%で圧縮されていたりする場合があった。この場合、20%と18%の差である2%分の符号量は有効に使われなかった符号量であり、例えばこの2%分の符号量を他のタイルで使用すれば、画質が格段に向上する場合も考えられる。   In the case of such JPEG 2000, even if an arbitrary compression rate is set, there is a case where the compression is actually performed at a higher compression rate (small code amount) than the set compression rate. For example, even if a compression rate of 20% is set, a certain tile may be compressed by 18%, and another tile may be compressed by 17%. In this case, the code amount of 2%, which is the difference between 20% and 18%, is the code amount that was not used effectively. For example, if the code amount of 2% is used in other tiles, the image quality is remarkably high. In some cases, it may be improved.

本発明は、上記の問題を解決するためになされたもので、使われなかった符号量を有効利用することによって、設定された圧縮率で圧縮したときに得られる圧縮データの符号量を保ちつつ画質を向上させる画像圧縮装置及びプログラムを提供することを目的とするものである。   The present invention has been made in order to solve the above-described problem, and by effectively using a code amount that has not been used, while maintaining the code amount of compressed data obtained when compression is performed at a set compression rate. An object of the present invention is to provide an image compression apparatus and program for improving image quality.

本発明の請求項1に記載の発明の画像圧縮装置は、画像を複数のタイルに分割する分割手段と、設定された圧縮率を含む予め定められた範囲の複数の圧縮率で前記各タイルの圧縮を行う圧縮手段と、前記複数の圧縮率で圧縮された各タイルの符号量を算出する符号量算出手段と、前記複数の圧縮率で圧縮された各タイルの画質への影響度を算出する影響度算出手段と、前記設定された圧縮率で圧縮された各タイルの符号量の合計を算出する合計符号量算出手段と、前記設定された圧縮率で前記画像を圧縮したときに得られる圧縮データの符号量である目標符号量を算出する目標符号量算出手段と、前記目標符号量から前記合計符号量を引いた符号量差を算出する符号量差算出手段と、前記符号量差が予め定められた数より大きい場合、前記設定された圧縮率で圧縮されたタイルのうち前記影響度が最も高いタイルから前記設定された圧縮率より一段低い圧縮率を前記設定された圧縮率として更新する圧縮率調整手段と、を備えたことを特徴としている。   An image compression apparatus according to a first aspect of the present invention includes a dividing unit that divides an image into a plurality of tiles, and a plurality of compression rates within a predetermined range including a set compression rate. A compression unit that performs compression; a code amount calculation unit that calculates a code amount of each tile compressed at the plurality of compression rates; and an influence degree on an image quality of each tile compressed at the plurality of compression rates. Influence degree calculating means, total code amount calculating means for calculating the total code amount of each tile compressed at the set compression rate, and compression obtained when the image is compressed at the set compression rate A target code amount calculating unit that calculates a target code amount that is a code amount of data; a code amount difference calculating unit that calculates a code amount difference obtained by subtracting the total code amount from the target code amount; and If it is greater than the set number, Compression rate adjusting means for updating, as the set compression rate, a compression rate that is one step lower than the set compression rate from the tile having the highest influence degree among the tiles compressed at the set compression rate. It is characterized by.

また、本発明の請求項5に記載の発明のプログラムは、コンピュータを、画像を複数のタイルに分割する分割手段、設定された圧縮率を含む予め定められた範囲の複数の圧縮率で前記各タイルの圧縮を行う圧縮手段、前記複数の圧縮率で圧縮された各タイルの符号量を算出する符号量算出手段、前記複数の圧縮率で圧縮された各タイルの画質への影響度を算出する影響度算出手段、前記設定された圧縮率で圧縮された各タイルの符号量の合計を算出する合計符号量算出手段、前記設定された圧縮率で前記画像を圧縮したときに得られる圧縮データの符号量である目標符号量を算出する目標符号量算出手段、前記目標符号量から前記合計符号量を引いた符号量差を算出する符号量差算出手段、前記符号量差が予め定められた数より大きい場合、前記設定された圧縮率で圧縮されたタイルのうち前記影響度が最も高いタイルから前記設定された圧縮率より一段低い圧縮率を前記設定された圧縮率として更新する圧縮率調整手段、として機能させることを特徴としている。   According to a fifth aspect of the present invention, there is provided a program according to a fifth aspect of the present invention, wherein each of the computers is divided into a plurality of compression ratios in a predetermined range including a dividing unit that divides an image into a plurality of tiles and a set compression ratio. Compression means for compressing tiles, code amount calculation means for calculating the code amount of each tile compressed at the plurality of compression rates, and the degree of influence on image quality of each tile compressed at the plurality of compression rates Influence degree calculating means, total code amount calculating means for calculating the total code amount of each tile compressed at the set compression rate, compression data obtained when the image is compressed at the set compression rate Target code amount calculating means for calculating a target code amount that is a code amount; code amount difference calculating means for calculating a code amount difference obtained by subtracting the total code amount from the target code amount; and a predetermined number of the code amount difference If greater than It functions as a compression rate adjustment unit that updates a compression rate that is one step lower than the set compression rate as the set compression rate from the tile that has the highest degree of influence among the tiles compressed at the set compression rate. It is characterized by that.

これらの構成によれば、各タイルを設定された圧縮率を含む複数の圧縮率で圧縮し、設定された圧縮率で圧縮したタイルの符号量を積算した合計符号量から画像データを設定された圧縮率で圧縮したときに得られる圧縮データの理論上の符号量である目標符号量を引いた符号量差を、影響度の高いタイルの圧縮率を1つ低い圧縮率にするために使用することにより、合計符号量を目標符号量に抑えつつ、画質を向上させることができる。   According to these configurations, the image data is set from the total code amount obtained by compressing each tile with a plurality of compression rates including the set compression rate and integrating the code amounts of the tiles compressed at the set compression rate. The difference in code amount minus the target code amount, which is the theoretical code amount of the compressed data obtained when compression is performed at the compression rate, is used to reduce the compression rate of the high-impact tile to one lower compression rate. Thus, it is possible to improve the image quality while suppressing the total code amount to the target code amount.

また、請求項2に記載の発明は、請求項1に記載の画像圧縮装置であって、前記圧縮率調整手段は、前記設定された圧縮率で圧縮されたタイルから前記影響度が最も高いタイルを検出し、検出したタイルを前記設定された圧縮率で圧縮したときの符号量と前記設定された圧縮率より一段低い圧縮率で圧縮したときの符号量との差を求め、当該差が前記符号量差以下であるとき、前記設定された圧縮率より一段低い圧縮率を前記設定された圧縮率として更新して前記符号量差から当該差を差し引くものであり、前記圧縮率調整手段が前記設定された圧縮率を更新して前記符号量差から前記差を差し引く処理を、前記符号量差が前記予め定められた数以下になるまで、又は予め定められた回数繰り返し行わせる制御を行う繰り返し制御手段と、を備えたことを特徴としている。   The invention according to claim 2 is the image compression apparatus according to claim 1, wherein the compression rate adjusting means is a tile having the highest influence degree from tiles compressed at the set compression rate. And detecting the difference between the code amount when the detected tile is compressed at the set compression rate and the code amount when compressed at a compression rate one step lower than the set compression rate, and the difference is When the code amount difference is equal to or less than the code amount difference, the compression rate that is one step lower than the set compression rate is updated as the set compression rate, and the difference is subtracted from the code amount difference. Repeating the process of updating the set compression rate and subtracting the difference from the code amount difference until the code amount difference is equal to or less than the predetermined number, or a predetermined number of times. Control means, It is characterized in that was example.

この構成によれば、圧縮データの合計符号量を目標符号量に抑えつつ、画質を向上させることができる。   According to this configuration, it is possible to improve the image quality while suppressing the total code amount of the compressed data to the target code amount.

また、請求項3に記載の発明は、請求項1又は2に記載の画像圧縮装置であって、主走査方向に配列する前記タイルを一つのバンドとして区分する区分手段を更に備え、前記合計符号量算出手段、前記目標符号量算出手段、前記符号量差算出手段及び前記圧縮率調整手段は、バンド毎に各処理を行うことを特徴としている。   The invention according to claim 3 is the image compression apparatus according to claim 1 or 2, further comprising sorting means for sorting the tiles arranged in the main scanning direction as one band, and the total code The amount calculation unit, the target code amount calculation unit, the code amount difference calculation unit, and the compression rate adjustment unit perform each process for each band.

この構成によれば、符号量差の配分処理をバンド単位で行うことによって、処理作業に必要なメモリ容量の増加を抑えることができる。   According to this configuration, by performing the code amount difference distribution processing in units of bands, it is possible to suppress an increase in memory capacity necessary for processing work.

また、請求項4に記載の発明は、請求項3に記載の画像圧縮装置であって、前記繰り返し制御手段による制御によって前記圧縮率調整手段が前記処理を予め定められた回数まで繰り返し行った後の前記符号量差が前記予め定められた数より大きい場合、前記圧縮率調整手段は異なるバンドのタイルに対して圧縮率調整を行う際に前記符号量差を前記目標符号量に加算することを特徴としている。   According to a fourth aspect of the present invention, there is provided the image compression apparatus according to the third aspect, wherein the compression rate adjusting unit repeatedly performs the process up to a predetermined number of times under the control of the repetitive control unit. When the code amount difference is larger than the predetermined number, the compression rate adjusting means adds the code amount difference to the target code amount when adjusting the compression rate for tiles of different bands. It is a feature.

この構成によれば、あるバンドの符号量差の配分処理で余った符号量を他のバンドで使うことにより、余った符号量を有効に使って画質向上を図ることができる。   According to this configuration, it is possible to improve the image quality by effectively using the surplus code amount by using the surplus code amount in another band by using the code amount difference distribution process of a certain band.

この発明によれば、各タイルを設定された圧縮率を含む複数の圧縮率で圧縮し、設定された圧縮率で圧縮したタイルの符号量を積算した合計符号量から画像データを設定された圧縮率で圧縮したときに得られる圧縮データの理論上の符号量である目標符号量を引いた符号量差を、影響度の高いタイルの圧縮率を1つ低い圧縮率にするために使用することにより、合計符号量を目標符号量に抑えつつ、画質を向上させることができる。   According to this invention, each tile is compressed at a plurality of compression ratios including a set compression ratio, and image data is set from the total code amount obtained by integrating the code amounts of tiles compressed at the set compression rate. The difference in code amount minus the target code amount, which is the theoretical code amount of the compressed data obtained when compression is performed at a rate, is used to reduce the compression rate of tiles with high impact to one lower compression rate. Thus, it is possible to improve the image quality while suppressing the total code amount to the target code amount.

本発明における画像圧縮装置及びプログラムの実施の形態について図面を参照して説明する。図1は、本実施の形態における画像圧縮装置1の電気的構成を示すブロック図である。尚、画像圧縮装置1は、パーソナルコンピュータ(パソコン)やワークステーション、携帯情報端末等の情報処理装置で実現され、図1のブロック図は画像圧縮装置1がこれらの情報処理装置によって実現された場合を例に図示している。この他、コピー機やスキャナ等の画像読取装置や、デジタルカメラやデジタルビデオカメラ、デジタルカメラを搭載した携帯電話等の撮像装置に組み込まれて用いられてもよい。   Embodiments of an image compression apparatus and a program according to the present invention will be described with reference to the drawings. FIG. 1 is a block diagram showing an electrical configuration of an image compression apparatus 1 according to the present embodiment. The image compression apparatus 1 is realized by an information processing apparatus such as a personal computer (personal computer), a workstation, or a portable information terminal. The block diagram of FIG. 1 shows a case where the image compression apparatus 1 is realized by these information processing apparatuses. Is shown as an example. In addition, it may be used by being incorporated in an image reading apparatus such as a copying machine or a scanner, or an imaging apparatus such as a digital camera, a digital video camera, or a mobile phone equipped with a digital camera.

図1に示すように、画像圧縮装置1は制御部11、記憶部12、入力操作部13、表示部14、I/F部15、ネットワークI/F部16、画像圧縮部17及びRAM18等を備えて構成される。制御部11は、CPU(Central Processing Unit:中央処理装置)等によって構成され、入力された指示信号等に応じて記憶部12に記憶されたプログラムを読み出して処理を実行し、各機能部への指示信号の出力、データ転送等を行って画像圧縮装置1を統括的に制御する。   As shown in FIG. 1, the image compression apparatus 1 includes a control unit 11, a storage unit 12, an input operation unit 13, a display unit 14, an I / F unit 15, a network I / F unit 16, an image compression unit 17, a RAM 18, and the like. It is prepared for. The control unit 11 is configured by a CPU (Central Processing Unit) or the like, reads a program stored in the storage unit 12 in accordance with an input instruction signal or the like, executes a process, and sends the processing to each functional unit. The image compression apparatus 1 is comprehensively controlled by outputting an instruction signal, transferring data, and the like.

記憶部12は、画像圧縮装置1の備える種々の機能を実現するためのプログラムやデータ等を記憶する。本実施の形態では、記憶部12は画像圧縮プログラム121を記憶する。画像圧縮プログラム121は、I/F部15又はネットワークI/F部16が入力した画像データをJPEG2000方式で圧縮して符号化データを生成するためのプログラムである。   The storage unit 12 stores programs, data, and the like for realizing various functions provided in the image compression apparatus 1. In the present embodiment, the storage unit 12 stores an image compression program 121. The image compression program 121 is a program for compressing the image data input by the I / F unit 15 or the network I / F unit 16 using the JPEG2000 method to generate encoded data.

入力操作部13は、各種操作ボタンやマウス等のポインティングデバイスを備え、ユーザによって操作がなされると、操作信号を制御部11へ出力する。またユーザは入力操作部13を介して圧縮率の設定を行う。表示部14は、液晶ディスプレイ等の表示画面であり、入力操作部13から入力された内容に応じた表示を行ったり、制御部11による処理内容や処理結果を表示したりする。   The input operation unit 13 includes various operation buttons and a pointing device such as a mouse, and outputs an operation signal to the control unit 11 when operated by a user. The user also sets the compression rate via the input operation unit 13. The display unit 14 is a display screen such as a liquid crystal display, and displays according to the content input from the input operation unit 13 or displays the processing content and processing result by the control unit 11.

I/F部15はIEEE1394やUSB等のインターフェイスであり、外部装置と直接データの送受信を行うことができる。ネットワークI/F部16は、LANボード等の通信モジュールから構成され、ネットワークI/F部16と接続されたネットワーク(不図示)を介して外部装置と種々のデータの送受信を行う。   The I / F unit 15 is an interface such as IEEE1394 or USB, and can directly transmit / receive data to / from an external device. The network I / F unit 16 includes a communication module such as a LAN board, and transmits / receives various data to / from an external device via a network (not shown) connected to the network I / F unit 16.

画像圧縮部17は、記憶部12に記憶された画像圧縮プログラム121を実行することによって、I/F部15やネットワークI/F部16を介して入力された画像データをJPEG2000方式で圧縮して符号化データを生成する。RAM(Random Access Memory)18は、制御部11が実行するための制御プログラムや処理を実行する際のデータ等を一時的に保存する。また、画像圧縮部17が画像圧縮プログラム121に従って処理を実行する際に生成される符号化データや圧縮率調整データ等を一時的に保存する。   The image compression unit 17 executes the image compression program 121 stored in the storage unit 12 to compress the image data input via the I / F unit 15 or the network I / F unit 16 using the JPEG 2000 method. Generate encoded data. A RAM (Random Access Memory) 18 temporarily stores a control program to be executed by the control unit 11, data for executing processing, and the like. In addition, the image compression unit 17 temporarily stores encoded data, compression rate adjustment data, and the like generated when processing is performed according to the image compression program 121.

図2は、本実施の形態におけるJPEG2000方式による画像圧縮の流れを示す図である。まず画像圧縮部17は、入力された画像データの表色系を例えばRGB方式からYCbCr方式へコンポーネント変換して(色空間変換21)、表色系が変換された画像データを図3に示すように複数のタイルに分割する(タイル分割22)。ここで、画像圧縮部17は主走査方向に配列したタイルを1つのバンドとして区分し、離散ウェーブレット変換23から圧縮率調整26(又は符号ストリーム27)までの処理をバンド毎に行う。図3を用いて説明すると、タイルA〜E、タイルF〜K、タイルL〜Q、タイルR〜Vをそれぞれ1つのバンドとして区分し、バンド別に離散ウェーブレット変換23以下の処理を行う。従って、以下で説明する処理は全てバンド単位で行われるものとして説明する。   FIG. 2 is a diagram showing a flow of image compression according to the JPEG2000 system in the present embodiment. First, the image compression unit 17 performs component conversion of the color system of the input image data from, for example, the RGB system to the YCbCr system (color space conversion 21), and the image data obtained by converting the color system is shown in FIG. Is divided into a plurality of tiles (tile division 22). Here, the image compression unit 17 classifies tiles arranged in the main scanning direction as one band, and performs processing from the discrete wavelet transform 23 to the compression rate adjustment 26 (or code stream 27) for each band. Referring to FIG. 3, tiles A to E, tiles F to K, tiles L to Q, and tiles R to V are each divided into one band, and the processing of the discrete wavelet transform 23 and the subsequent processes is performed for each band. Therefore, it is assumed that all the processes described below are performed on a band basis.

図2に戻り、画像圧縮部17は1つのバンドの各タイルに対して離散ウェーブレット変換を施して係数データを出力する(ウェーブレット変換23)。図4は、離散ウェーブレット変換について示した模式図である。図4(a)のタイル画像(0LL)に対して、離散ウェーブレット変換を施し、図4(b)に示すようにサブバンド1LL、1HL、1LH及び1HHに分解する。続いて、低周波成分1LLに対して離散ウェーブレット変換を施し、図4(c)に示すようにサブバンド2LL、2HL、2LH及び2HHに分解する。尚、図4では2レベル変換について図示しているが、離散ウェーブレット変換の回数は特に制限されるものではない。   Returning to FIG. 2, the image compression unit 17 performs discrete wavelet transform on each tile of one band and outputs coefficient data (wavelet transform 23). FIG. 4 is a schematic diagram showing the discrete wavelet transform. Discrete wavelet transform is applied to the tile image (0LL) in FIG. 4A, and is decomposed into subbands 1LL, 1HL, 1LH, and 1HH as shown in FIG. 4B. Subsequently, a discrete wavelet transform is performed on the low frequency component 1LL, and it is decomposed into subbands 2LL, 2HL, 2LH and 2HH as shown in FIG. Although FIG. 4 illustrates two-level conversion, the number of discrete wavelet conversions is not particularly limited.

次に、画像圧縮部17は離散ウェーブレット変換された係数データに対して線形量子化を行う(量子化24)。ここで、画像圧縮部17は任意に設定された圧縮率(以下「設定圧縮率」という)を含む予め定められた範囲にある複数の圧縮率に従って量子化を行う。例えば、設定圧縮率が20%である場合は、18%、19%、20%、21%及び22%等の5つの圧縮率に従って量子化を行う。尚、圧縮率の数はこの限りではないが、画像圧縮処理の際に用いるメモリ(本実施の形態ではRAM18)の容量に応じて圧縮率の数を適宜調整することが望ましい。   Next, the image compression unit 17 performs linear quantization on the coefficient data subjected to discrete wavelet transform (quantization 24). Here, the image compression unit 17 performs quantization according to a plurality of compression rates within a predetermined range including a compression rate arbitrarily set (hereinafter referred to as “set compression rate”). For example, when the set compression ratio is 20%, quantization is performed according to five compression ratios such as 18%, 19%, 20%, 21%, and 22%. Note that the number of compression ratios is not limited to this, but it is desirable to appropriately adjust the number of compression ratios according to the capacity of a memory (RAM 18 in the present embodiment) used for image compression processing.

そして、画像圧縮部17は、各圧縮率で量子化された量子化データに対してエントロピー符号化を行う(エントロピー符号化25)。ここで、エントロピー符号化25の処理手順について説明する。図5は、エントロピー符号化の流れを示す図である。画像圧縮部17は、まず各サブバンドの係数をプレシンクトと呼ばれる領域に分割する(プレシンクト分割251)。図6はプレシンクト分割を模式的に示した図である。図6において、51の部分は元の画像において同領域の部分を周波数変換したものであり、これらの部分は同じプレシンクトに属しているという。   Then, the image compression unit 17 performs entropy coding on the quantized data quantized at each compression rate (entropy coding 25). Here, the processing procedure of the entropy encoding 25 will be described. FIG. 5 is a diagram showing a flow of entropy encoding. The image compression unit 17 first divides each subband coefficient into regions called precincts (precinct division 251). FIG. 6 is a diagram schematically showing precinct division. In FIG. 6, a portion 51 is obtained by frequency-converting a portion of the same region in the original image, and these portions belong to the same precinct.

次に、画像圧縮部17はプレシンクトをコードブロックという更に小さな領域に分割する(コードブロック分割252)。図7はコードブロック分割を模式的に示した図である。このコードブロック単位がエントロピー符号化を行う際の基本単位となる。   Next, the image compression unit 17 divides the precinct into smaller areas called code blocks (code block division 252). FIG. 7 is a diagram schematically showing code block division. This code block unit is a basic unit when entropy encoding is performed.

そして、画像圧縮部17は各コードブロックについて線形量子化された離散ウェーブレット変換の変換係数をビット毎に展開する(ビットプレーン分割253)。図8はビットプレーン分割を模式的に示した図である。図8において、61はあるコードブロックにおける線形量子化された離散ウェーブレット変換の係数データを例示したものである。62は、係数データ61の符号を表すビット列であり、値0は正値、値1は負値を意味する。63は係数データ61の絶対値をMSB(Most Significant Bit)からLSB(Least Significant Bit)に2値展開したビットプレーンである。   Then, the image compression unit 17 expands the transform coefficient of the discrete wavelet transform linearly quantized for each code block for each bit (bit plane division 253). FIG. 8 is a diagram schematically showing bit plane division. In FIG. 8, 61 is an example of coefficient data of the linearly quantized discrete wavelet transform in a certain code block. 62 is a bit string representing the sign of the coefficient data 61, where value 0 means a positive value and value 1 means a negative value. 63 is a bit plane in which the absolute value of the coefficient data 61 is binary-developed from MSB (Most Significant Bit) to LSB (Least Significant Bit).

例えば、値が+12の係数データ64は正値であるため、対応する符号ビット65は‘0’である。また、+12の絶対値の2進数表現は(1100)であるため、ビットプレーンに対応する箇所66a、66b、66c及び66dの値はそれぞれ‘1’、‘1’、‘0’、‘0’となる。同様に、値が−6の係数データ67は負値であるため、対応する符号ビット68は‘1’である。また、−6の絶対値の2進数表現は(0110)であるため、ビットプレーンの対応する箇所69a、69b、69c及び69dの値はそれぞれ‘0’、‘1’、‘1’、‘0’となる。MSB側で全て0であるビットプレーンをゼロビットプレーンといい、データは保存されない一方、コードブロック毎に後述のゼロビットプレーン枚数がカウントされる。   For example, since the coefficient data 64 having a value of +12 is a positive value, the corresponding sign bit 65 is “0”. Also, since the binary representation of the absolute value of +12 is (1100), the values of the locations 66a, 66b, 66c and 66d corresponding to the bit plane are “1”, “1”, “0”, “0”, respectively. It becomes. Similarly, since the coefficient data 67 having a value of −6 is a negative value, the corresponding sign bit 68 is “1”. Since the binary representation of the absolute value of −6 is (0110), the values of the corresponding portions 69a, 69b, 69c, and 69d of the bit plane are “0”, “1”, “1”, “0”, respectively. 'Become. Bit planes that are all zero on the MSB side are called zero bit planes, and no data is stored, while the number of zero bit planes described later is counted for each code block.

続いて、画像圧縮部17は、ビットプレーンを更にsignificance propagationパスと、magnitude refinementパスと、cleanupパスに分割する(コーディングパスへの分割254)。図9はコーディングパスへの分割を模式的に示した図である。図9に示すように、各ビットプレーン71a〜71d(以下、これらをまとめて「ビットプレーン71」という)は、コーディングパスへの分割により次のように分割される。つまり、それぞれsignificance propagationパス72b〜72d(以下、これらをまとめて「significance propagationパス72」という)、magnitude refinementパス73b〜73d(以下、これらをまとめて「magnitude refinementパス73」という)、cleanupパス74b〜74dに分割される。ただし、最上位ビット(MSB側)のビットプレーン71aはcleanupパス74aにのみ対応させる。以下、cleanupパス74a〜74dをまとめて「cleanupパス74」という。   Subsequently, the image compression unit 17 further divides the bit plane into a significance propagation pass, a magnitude refinement pass, and a cleanup pass (division 254 into coding passes). FIG. 9 is a diagram schematically showing division into coding passes. As shown in FIG. 9, the bit planes 71a to 71d (hereinafter collectively referred to as “bit plane 71”) are divided as follows by division into coding paths. That is, significance propagation paths 72b to 72d (hereinafter collectively referred to as “significance propagation path 72”), magnitude refinement paths 73b to 73d (hereinafter collectively referred to as “magnitude refinement path 73”), and cleanup path 74b. Divided into ~ 74d. However, the most significant bit (MSB side) bit plane 71a is made to correspond only to the cleanup path 74a. Hereinafter, the cleanup paths 74a to 74d are collectively referred to as “cleanup path 74”.

各ビットプレーン71及び各コーディングパス72〜74は、全て縦横方向の座標長によるサイズが等しい。また、各コーディングパス72〜74にはビット値が定義された位置と定義されていない位置とが存在する。図9において、例えば76や77のように、ビット値が定義された位置には網掛け(斜線)が施されている。そして、コーディングパス72〜74(例えば、コーディングパス72b〜74b)の網掛け部分に定義されたビット値は、分割前のビットプレーン71(例えば、ビットプレーン71b)上の対応する位置におけるビット値と等しい。ビットプレーンをコーディングパスに分割する処理については、各文献により周知のものであるため説明を省略する。   Each bit plane 71 and each coding pass 72 to 74 are all equal in size according to the coordinate length in the vertical and horizontal directions. Each coding pass 72 to 74 has a position where a bit value is defined and a position where it is not defined. In FIG. 9, for example, 76 and 77, the positions where bit values are defined are shaded (hatched). The bit values defined in the shaded portions of the coding paths 72 to 74 (for example, the coding paths 72b to 74b) are the bit values at the corresponding positions on the bit plane 71 (for example, the bit plane 71b) before the division. equal. Since the process of dividing the bit plane into coding passes is well known in each document, description thereof is omitted.

最後に画像圧縮部17は、コーディングパス分割後のデータを算術符号化する(二値算術符号化255)。以上のようにしてエントロピー符号化25を行った後、画像圧縮部17は圧縮率の調整を行う(圧縮率調整26)。JPEG2000は圧縮率を任意に設定できるが、設定圧縮率で画像データの圧縮を行うと、従来は設定圧縮率より高い圧縮率で圧縮が行われていた。例えば設定圧縮率が20%であった場合、あるタイルは18%で圧縮されていたり、別のタイルは17%で圧縮されていたりする場合があった。この場合、20%と18%の差である2%分の符号量は有効に使われなかった符号量であり、例えばこの2%分の符号量を他のタイルで使用すれば、画質が格段に向上する場合も考えられる。そこで、この圧縮率調整26において、各タイルの圧縮率の調整を行って、使われなかった符号量を他のタイルに配分する処理を行う。圧縮率調整の処理手順の詳細は後述する。   Finally, the image compression unit 17 arithmetically encodes the data after the coding pass division (binary arithmetic encoding 255). After performing the entropy encoding 25 as described above, the image compression unit 17 adjusts the compression rate (compression rate adjustment 26). JPEG2000 can arbitrarily set the compression rate, but when image data is compressed at the set compression rate, conventionally, compression is performed at a compression rate higher than the set compression rate. For example, when the set compression ratio is 20%, a certain tile may be compressed by 18%, and another tile may be compressed by 17%. In this case, the code amount of 2%, which is the difference between 20% and 18%, is the code amount that was not used effectively. For example, if the code amount of 2% is used in other tiles, the image quality is remarkably high. In some cases, it may be improved. Therefore, in this compression rate adjustment 26, the compression rate of each tile is adjusted, and processing for allocating the unused code amount to other tiles is performed. Details of the compression rate adjustment procedure will be described later.

圧縮率調整が終わった後、画像圧縮部17はファイルにデータを書き込むための符号ストリームの形成を行う(符号ストリーム27)。この符号ストリーム処理については、各文献により周知のものであるため説明を省略する。   After the compression rate adjustment is completed, the image compression unit 17 forms a code stream for writing data to the file (code stream 27). Since this code stream processing is well known from each document, the description thereof is omitted.

図10及び11は、画像圧縮部17が画像圧縮プログラム121に従って実行される画像圧縮処理の流れを示したフローチャートである。まず画像圧縮部17は画像データの色空間変換、タイル分割を行い、分割されたタイルをバンド別に区分する(ステップS11)。そして、画像圧縮部17は変数n(nは1以上の整数)に1を代入し(ステップS12)、n番目のバンドに対して離散ウェーブレット変換、量子化、エントロピー符号化を行う(ステップS13)。ここで、画像圧縮部17は設定圧縮率を含んだ予め定められた範囲の複数の圧縮率で量子化を行い、複数の圧縮率で圧縮された各タイルの符号化データをRAM18に格納する。   10 and 11 are flowcharts showing the flow of the image compression processing executed by the image compression unit 17 in accordance with the image compression program 121. First, the image compression unit 17 performs color space conversion and tile division of the image data, and divides the divided tiles by band (step S11). Then, the image compression unit 17 substitutes 1 for a variable n (n is an integer equal to or greater than 1) (step S12), and performs discrete wavelet transform, quantization, and entropy encoding on the nth band (step S13). . Here, the image compression unit 17 performs quantization at a plurality of compression rates within a predetermined range including a set compression rate, and stores the encoded data of each tile compressed at the plurality of compression rates in the RAM 18.

次に、画像圧縮部17は各タイルの符号量と画質への影響度(以下、単に「影響度」という)を算出して圧縮率調整用データを作成し、この圧縮率調整用データをRAM18に格納する(ステップS14、S15)。図12は圧縮率調整用データの一例を示した図である。図12に示すように、画像圧縮部17は各タイルの各圧縮率毎に符号量と影響度を算出する。   Next, the image compression unit 17 calculates the code amount of each tile and the degree of influence on the image quality (hereinafter simply referred to as “influence degree”) to create compression rate adjustment data, and this compression rate adjustment data is stored in the RAM 18. (Steps S14 and S15). FIG. 12 is a diagram showing an example of compression rate adjustment data. As shown in FIG. 12, the image compression unit 17 calculates a code amount and an influence degree for each compression rate of each tile.

影響度の算出方法の一例を説明する。例えば、図9に示すようにコーディングパスへの分割が行われたとする。画像処理部17はMSBからLSBのビットプレーンに対して上位ビットほど重み付け係数を高く設定する。例えばMSBからLSBのビットプレーンに8、4、2、1の重み付け係数を設定し、significance propagationパス、magnitude refinementパス、cleanupパスにもそれぞれ所定の重み付け係数を設定する。そして画像処理部17は、コーディングパスの‘1’の数とビットプレーンの重み付け係数とコーディングパスの重み付け係数を掛け合わせた数値をビット位置毎に算出して積算して1つのコードブロックにおける影響度を算出する。この影響度を全てのコードブロックに渡って算出し、算出された影響度を積算することによってタイルの影響度とする。   An example of how to calculate the influence level will be described. For example, assume that division into coding passes is performed as shown in FIG. The image processing unit 17 sets a higher weighting coefficient for the upper bits for the MSB to LSB bit planes. For example, weighting factors of 8, 4, 2, 1 are set for the MSB to LSB bit planes, and predetermined weighting factors are set for the significance propagation path, the magnitude refinement path, and the cleanup path, respectively. Then, the image processing unit 17 calculates and adds a numerical value obtained by multiplying the number of coding path '1's, the bit plane weighting coefficient, and the coding path weighting coefficient for each bit position, and the degree of influence in one code block. Is calculated. This influence degree is calculated over all the code blocks, and the influence degree of the tile is obtained by integrating the calculated influence degrees.

つまり、図9を用いて説明すると、画像圧縮部17はコードブロック61の影響度を、
影響度=(cleanupパス74aの‘1’の数×重み付け係数(8)×cleanupパスの重み付け係数)
+{(significance propagationパス72bの‘1’の数×重み付け係数(4)×significance propagationパスの重み付け係数)+(magnitude refinementパス73bの‘1’の数×重み付け係数(4)×magnitude refinementパスの重み付け係数)+(cleanupパス74bの‘1’の数×重み付け係数(4)×cleanupパスの重み付け係数)}
+{(significance propagationパス72cの‘1’の数×重み付け係数(2)×significance propagationパスの重み付け係数)+(magnitude refinementパス73cの‘1’の数×重み付け係数(2)×magnitude refinementパスの重み付け係数)+(cleanupパス74cの‘1’の数×重み付け係数(2)×cleanupパスの重み付け係数)}
+{(significance propagationパス72dの‘1’の数×重み付け係数(1)×significance propagationパスの重み付け係数)+(magnitude refinementパス73dの‘1’の数×重み付け係数(1)×magnitude refinementパスの重み付け係数)+(cleanupパス74dの‘1’の数×重み付け係数(1)×cleanupパスの重み付け係数)}
の式を用いて算出する。この計算を全てのコードブロックに渡って行う。
That is, with reference to FIG. 9, the image compression unit 17 determines the degree of influence of the code block 61 as follows.
Influence = (number of “1” s in cleanup path 74a × weighting coefficient (8) × weighting coefficient of cleanup path)
+ {(Number of '1's of the significance propagation path 72b) × weighting coefficient (4) × weighting coefficient of the significance propagation path 72b) + (number of'1's of the magnitude refinement path 73b) × weighting coefficient (4) × magnitude refinement path (Weighting coefficient) + (number of “1” in cleanup path 74b × weighting coefficient (4) × cleanup path weighting coefficient)}
+ {(Number of '1's of the significance propagation path 72c) × weighting coefficient (2) × weighting coefficient of the significance propagation path 72c) + (number of'1's of the magnitude refinement path 73c) × weighting coefficient (2) × magnitude refinement path (Weighting coefficient) + (number of “1” s in cleanup path 74c × weighting coefficient (2) × weighting coefficient of cleanup path)}}
+ {(Number of '1's of the significance propagation path 72d) × weighting coefficient (1) × weighting coefficient of the significance propagation path 73d) + (number of'1's of the magnitude refinement path 73d) × weighting coefficient (1) × magnitude refinement path (Weighting coefficient) + (number of “1” s in cleanup path 74d × weighting coefficient (1) × weighting coefficient of cleanup path)}}
This is calculated using the following formula. This calculation is performed over all code blocks.

図10に戻る。次に画像圧縮部17は、設定圧縮率で圧縮された各タイルの符号量を積算して合計符号量を算出する(ステップS16)。例えば設定圧縮率が20%である場合、図12に示すタイルA〜Eの圧縮率20%のときの符号量を積算した「12432」を合計符号量とする。続いて、画像圧縮部17は画像データを設定圧縮率で圧縮したときに得られる圧縮データの理論上の符号量を算出し、バンドの数で割った符号量を目標符号量として設定する(ステップS17)。   Returning to FIG. Next, the image compression unit 17 calculates the total code amount by integrating the code amounts of the tiles compressed at the set compression rate (step S16). For example, when the set compression rate is 20%, “12432” obtained by integrating the code amounts of the tiles A to E shown in FIG. Subsequently, the image compression unit 17 calculates the theoretical code amount of the compressed data obtained when the image data is compressed at the set compression rate, and sets the code amount divided by the number of bands as a target code amount (step). S17).

更に画像圧縮部17は、目標符号量から合計符号量を引いた値である符号量差を算出する(ステップS18)。例えば、求められた合計符号量は「12432」であり、目標符号量が15000である場合、符号量差は「2568」となる。この「2568」は、圧縮データとして使用してもよい符号量であるにも関わらず、有効に使われなかった符号量である。従って、以下の処理において、有効に使われなかった符号量を影響度の高いタイルから順次配分する。   Further, the image compression unit 17 calculates a code amount difference that is a value obtained by subtracting the total code amount from the target code amount (step S18). For example, when the obtained total code amount is “12432” and the target code amount is 15000, the code amount difference is “2568”. This “2568” is a code amount that has not been used effectively despite being a code amount that may be used as compressed data. Accordingly, in the following processing, the code amount that has not been used effectively is sequentially allocated from the tiles having a high degree of influence.

まず、画像圧縮部17は設定圧縮率を仮の圧縮率に設定する。現段階では圧縮率20%を仮の圧縮率として設定する。そして変数mに1を代入する(ステップS19)。この変数mは符号量差の配分処理の繰り返し回数を示すものである。   First, the image compression unit 17 sets the set compression rate to a temporary compression rate. At this stage, a compression rate of 20% is set as a temporary compression rate. Then, 1 is substituted into the variable m (step S19). This variable m indicates the number of repetitions of the code amount difference allocation process.

符号量差が1以上である場合(ステップS20;NO)、画像圧縮部17はバンド内における仮の圧縮率で圧縮されたタイルの中から最も影響度の高いタイルを検出する。図12においては、仮の圧縮率(20%)で圧縮されたタイルの中で最も影響度の高いタイルはタイルDである。そして画像圧縮部17は検出されたタイル(例えばタイルD)のフラグを‘1’とする(ステップS21)。このフラグはタイル毎に設定されており、画像処理部17が有するワークメモリ(不図示)に記憶されている。   When the code amount difference is 1 or more (step S20; NO), the image compression unit 17 detects the tile having the highest influence from the tiles compressed at the temporary compression rate in the band. In FIG. 12, the tile having the highest influence is the tile D among the tiles compressed at the temporary compression rate (20%). Then, the image compression unit 17 sets the flag of the detected tile (for example, tile D) to “1” (step S21). This flag is set for each tile and is stored in a work memory (not shown) included in the image processing unit 17.

そして、画像圧縮部17は検出されたタイルについて、
a=仮の圧縮率で圧縮されたときの符号量
b=仮の圧縮率より1つ低い圧縮率で圧縮されたとき符号量
とし、変数a、bに該当する符号量を代入する(ステップS22)。例えば、ステップ21でタイルDが検出された場合、a=1293、b=2723となる。
And the image compression part 17 is about the detected tile.
a = code amount when compressed at a temporary compression rate b = code amount when compressed at a compression rate one lower than the temporary compression rate, and substituting the code amounts corresponding to the variables a and b (step S22) ). For example, when tile D is detected in step 21, a = 1293 and b = 2723.

続いて、画像圧縮部17は、仮の圧縮率より1つ低い圧縮率で圧縮されたとき符号量から仮の圧縮率で圧縮されたときの符号量を差し引いたb−aの値が符号量差以下であるか否かを判別する(ステップS23)。つまり、a=1293、b=2723の場合、b−a=1430であり、この値はステップS18で求めた符号量差「2568」より小さい。従って、画像圧縮部17は、タイルDにおいて仮の圧縮率より1つ低い圧縮率を仮の圧縮率に設定する。つまり、圧縮率21%を仮の圧縮率として設定する。そして、符号量差からb−aの値を引いた値を符号量差として更新する(ステップS24)。従って、符号量差=2568−(2723−1293)=1138となる。   Subsequently, the image compression unit 17 calculates the code amount by subtracting the code amount when compressed at the temporary compression rate from the code amount when compressed at the compression rate one lower than the temporary compression rate. It is determined whether the difference is equal to or less than the difference (step S23). That is, when a = 1293 and b = 2723, b−a = 1430, and this value is smaller than the code amount difference “2568” obtained in step S18. Therefore, the image compression unit 17 sets a compression rate one lower than the temporary compression rate in the tile D as the temporary compression rate. That is, a compression rate of 21% is set as a temporary compression rate. Then, a value obtained by subtracting the value b−a from the code amount difference is updated as a code amount difference (step S24). Accordingly, the code amount difference = 2568− (2723−1293) = 1138.

そして、画像圧縮部17はフラグをリセットし、変数mに1加算する(ステップS25)。変数mが64でない場合(ステップS28;NO)、画像圧縮部17はステップS20へ処理を移行する。以上説明したようにステップS20及びS21の処理を行うと、図12において仮の圧縮率で圧縮されたタイルの中で最も影響度の高いタイルとして検出されるタイルはタイルAとなる。そしてa=645、b=1024であり(ステップS22)、b−a=379となるため、符合量差=1138より小さい(ステップS23;YES)。従って、画像圧縮部17はタイルAの仮の圧縮率を21%とし、符号量差を1138−379=759に更新する(ステップS24)。   Then, the image compression unit 17 resets the flag and adds 1 to the variable m (step S25). If the variable m is not 64 (step S28; NO), the image compression unit 17 proceeds to step S20. As described above, when the processes of steps S20 and S21 are performed, the tile detected as the tile having the highest influence among the tiles compressed at the temporary compression rate in FIG. Since a = 645 and b = 1024 (step S22), and b−a = 379, the sign amount difference is smaller than 1138 (step S23; YES). Therefore, the image compression unit 17 sets the temporary compression ratio of the tile A to 21% and updates the code amount difference to 1138-379 = 759 (step S24).

そして、画像圧縮部17はフラグをリセットし、変数mに1加算する(ステップS25)。変数mは64でないため(ステップS28;NO)、画像処理部17は再びステップS20へ処理を移行する。ここでステップS21において仮の圧縮率で圧縮されたタイルの中で最も影響度の高いタイルとして検出されるタイルはタイルAとなる。そしてa=1024、b=2612であり(ステップS22)、b−a=1588である。このb−aの値は符号量差759より大きい(ステップS23;NO)。つまり、ここでタイルAの仮の圧縮率を1つ下げると、合計符号量が目標符号量を超えてしまうことになる。従って、タイルA以外のタイルの中から(つまり、フラグの立っていないタイルの中から)影響度の最も高いタイルを検出する。   Then, the image compression unit 17 resets the flag and adds 1 to the variable m (step S25). Since the variable m is not 64 (step S28; NO), the image processing unit 17 shifts the process to step S20 again. Here, the tile detected as the tile having the highest influence level among the tiles compressed at the temporary compression rate in step S21 is the tile A. Then, a = 1024, b = 2612 (step S22), and b−a = 1588. The value of b−a is larger than the code amount difference 759 (step S23; NO). That is, if the temporary compression rate of the tile A is lowered by one here, the total code amount exceeds the target code amount. Therefore, a tile having the highest influence level is detected from tiles other than the tile A (that is, from tiles with no flag set).

即ち、フラグの立っていないタイルがある場合(ステップS26;YES)、画像圧縮部17はフラグの立っていないタイルから影響度が最も高いタイルを検出し、そのタイルのフラグを立てる(ステップS27)。図12の場合、仮の圧縮率で圧縮されたタイルAを除くタイルの中で最も影響度の高いタイルはタイルEである。そして画像圧縮部17はステップS22へ処理を移行する。タイルEの場合、a=567、b=1045であり、b−a=478であるため、符号量差756より小さい(ステップS23;YES)。従って、画像圧縮部17はタイルEの仮の圧縮率を21%とし、符号量差を756−478=278に更新する。   That is, when there is a tile with no flag set (step S26; YES), the image compression unit 17 detects the tile having the highest influence from the tiles with no flag set, and sets the flag for the tile (step S27). . In the case of FIG. 12, the tile having the highest influence is the tile E among the tiles excluding the tile A compressed at the temporary compression rate. Then, the image compression unit 17 proceeds to step S22. In the case of the tile E, a = 567, b = 1045, and b−a = 478, which is smaller than the code amount difference 756 (step S23; YES). Therefore, the image compression unit 17 updates the temporary compression rate of the tile E to 21% and the code amount difference to 756-478 = 278.

ステップS26において、フラグの立っていないタイルがない場合は(ステップS26;NO)、仮の圧縮率で圧縮された全てのタイルにおいて圧縮率を1つ下げると目標符号量を超えてしまうことを意味する。従って、画像圧縮部17は各タイルへの符号量差の配分を終了し、ステップS29へ処理を移行する。   If there is no tile with no flag set in step S26 (step S26; NO), it means that the target code amount will be exceeded if the compression rate is lowered by 1 for all tiles compressed at the temporary compression rate. To do. Accordingly, the image compressing unit 17 finishes distributing the code amount difference to each tile, and proceeds to step S29.

以上の処理を、符号量が0以下になるまで、又は64回(変数mが64になるまで)繰り返し行う。尚、この繰り返し回数の条件は上記の限らず、適宜変更可能である。そして符号量が0以下となった(ステップS20;YES)、変数mが64となった場合(ステップS28;YES)、画像圧縮部17は各タイルの現段階における仮の圧縮率を正式な圧縮率として設定する(ステップS29)。   The above processing is repeated until the code amount becomes 0 or less or 64 times (until the variable m becomes 64). The condition for the number of repetitions is not limited to the above, and can be changed as appropriate. When the code amount becomes 0 or less (step S20; YES) and the variable m becomes 64 (step S28; YES), the image compression unit 17 officially compresses the temporary compression rate at the current stage of each tile. The rate is set (step S29).

n番目のバンドが最後のバンドでない場合(ステップS30;NO)、画像圧縮部17は変数nに1を加算し(ステップS31)、ステップS13へ処理を移行する。ここで、既に符号量差の配分処理が終了したバンドについて、正式な圧縮率以外の圧縮率で圧縮された各タイルの符号化データや圧縮率調整データをRAM18から削除することによって、RAM18における作業領域を広げることができる。また、この段階において、符号量差が0(又は予め定められた数)より大きい場合、この符号量差をステップS17において次に算出される目標符号量に加算する。このように、あるバンドの配分処理で余った符号量を他のバンドで使うことにより、余った符号量を有効に使って画質向上を図ることができる。   If the nth band is not the last band (step S30; NO), the image compression unit 17 adds 1 to the variable n (step S31), and the process proceeds to step S13. Here, for the band for which the code amount difference allocation processing has already been completed, the encoded data and compression rate adjustment data of each tile compressed at a compression rate other than the official compression rate are deleted from the RAM 18, thereby allowing the work in the RAM 18 to be performed. The area can be expanded. At this stage, if the code amount difference is larger than 0 (or a predetermined number), the code amount difference is added to the next target code amount calculated in step S17. In this way, by using the remaining code amount in the distribution process of a certain band in other bands, the remaining code amount can be used effectively to improve the image quality.

n番目のバンドが最後のバンドである場合(ステップS30;YES)、画像圧縮部17は符号ストリームを形成して(ステップS32)処理を終了する。   If the n-th band is the last band (step S30; YES), the image compression unit 17 forms a code stream (step S32) and ends the process.

以上、説明したように、各タイルを設定圧縮率を含む複数の圧縮率で圧縮し、設定圧縮率で圧縮したタイルの符号量を積算した合計符号量から画像データを設定圧縮率で圧縮したときに得られる圧縮データの理論上の符号量である目標符号量を引いた符号量差を、条件に合致した影響度の高いタイルに割り当てることにより、合計符号量を目標符号量に抑えつつ、画質を向上させることができる。更に、このような符号量差の配分処理をバンド単位で行うことによって、処理作業に必要なメモリ容量の増加を抑えることができる。   As described above, when each tile is compressed at a plurality of compression rates including the set compression rate, and the image data is compressed at the set compression rate from the total code amount obtained by integrating the code amounts of tiles compressed at the set compression rate By assigning the code amount difference obtained by subtracting the target code amount, which is the theoretical code amount of the compressed data obtained to the above, to tiles with high impact that meet the conditions, the total code amount is suppressed to the target code amount and the image quality is reduced. Can be improved. Furthermore, by performing such code amount difference distribution processing in units of bands, it is possible to suppress an increase in memory capacity required for processing operations.

尚、本発明は上記実施の形態の構成に限られず種々の変形が可能である。例えば、上記実施の形態では、分割されたタイルをバンドに区分し、バンド毎に符号量差の配分処理を行った。これは各タイルにおいて複数の圧縮率で圧縮された符号化データを生成する必要があり、これらの符号化データを格納するRAM18の使用領域を最小限に抑えるためである。しかし、RAM18に十分なメモリ容量がある場合には、バンド毎に符号量差の配分処理を行う必要はない。つまり、画像圧縮部17は設定圧縮率で圧縮された全てのタイルから影響度の最も高いタイルを検出し、条件に合致したら1つ低い圧縮率に仮の圧縮率を更新する。この処理を符号量差が予め定められた数以下になるまで、又は予め定められた回数だけタイル全体に渡って行う。   The present invention is not limited to the configuration of the above embodiment, and various modifications can be made. For example, in the above embodiment, the divided tiles are divided into bands, and the code amount difference distribution process is performed for each band. This is because it is necessary to generate encoded data compressed at a plurality of compression rates in each tile, and to minimize the use area of the RAM 18 for storing these encoded data. However, if the RAM 18 has a sufficient memory capacity, it is not necessary to perform a code amount difference distribution process for each band. That is, the image compression unit 17 detects the tile having the highest influence level from all the tiles compressed at the set compression rate, and updates the temporary compression rate to the next lower compression rate when the condition is met. This process is performed over the entire tile until the code amount difference is equal to or smaller than a predetermined number, or a predetermined number of times.

画像圧縮装置の電気的構成を示すブロック図。1 is a block diagram showing an electrical configuration of an image compression apparatus. JPEG2000方式による画像圧縮の流れを示す図。The figure which shows the flow of the image compression by a JPEG2000 system. タイル分割について説明するための図。The figure for demonstrating tile division | segmentation. 離散ウェーブレット変換について示した模式図。The schematic diagram shown about discrete wavelet transform. エントロピー符号化の流れを示す図。The figure which shows the flow of entropy encoding. プレシンクト分割を模式的に示した図。The figure which showed the precinct division | segmentation typically. コードブロック分割を模式的に示した図。The figure which showed code block division | segmentation typically. ビットプレーン分割を模式的に示した図。The figure which showed bit-plane division | segmentation typically. コーディングパスへの分割を模式的に示した図。The figure which showed the division | segmentation to a coding pass typically. 画像圧縮処理の流れを示したフローチャート。The flowchart which showed the flow of the image compression process. 図10の続きのフローチャート。FIG. 11 is a flowchart continued from FIG. 10. 圧縮率調整用データの一例を示した図。The figure which showed an example of the data for compression rate adjustment.

符号の説明Explanation of symbols

1 画像圧縮装置
11 制御部
12 記憶部
121 画像圧縮プログラム
13 入力操作部
14 表示部
15 I/F部
16 ネットワークI/F部
17 画像圧縮部
18 RAM
DESCRIPTION OF SYMBOLS 1 Image compression apparatus 11 Control part 12 Storage part 121 Image compression program 13 Input operation part 14 Display part 15 I / F part 16 Network I / F part 17 Image compression part 18 RAM

Claims (5)

画像を複数のタイルに分割する分割手段と、
ユーザによって設定された圧縮率を含む予め定められた範囲の複数の圧縮率で前記各タイルの圧縮を行う圧縮手段と、
前記複数の圧縮率で圧縮された各タイルの符号量を算出する符号量算出手段と、
前記複数の圧縮率で圧縮された各タイルの画質への影響度を算出する影響度算出手段と、
前記設定された圧縮率で圧縮された各タイルの符号量の合計を算出する合計符号量算出手段と、
前記設定された圧縮率で前記画像を圧縮したときに得られる圧縮データの符号量である目標符号量を算出する目標符号量算出手段と、
前記目標符号量から前記合計符号量を引いた符号量差を算出する符号量差算出手段と、
前記符号量差が予め定められた数より大きい場合、前記設定された圧縮率で圧縮されたタイルのうち前記影響度が最も高いタイルから前記設定された圧縮率より一段低い圧縮率を前記設定された圧縮率として更新する圧縮率調整手段と、
を備えた画像圧縮装置。
A dividing means for dividing the image into a plurality of tiles;
Compression means for compressing each tile at a plurality of compression ratios in a predetermined range including a compression ratio set by a user;
Code amount calculation means for calculating the code amount of each tile compressed at the plurality of compression rates;
An influence degree calculating means for calculating an influence degree on the image quality of each tile compressed at the plurality of compression ratios;
A total code amount calculating means for calculating a total code amount of each tile compressed at the set compression rate;
Target code amount calculating means for calculating a target code amount that is a code amount of compressed data obtained when the image is compressed at the set compression rate;
Code amount difference calculating means for calculating a code amount difference obtained by subtracting the total code amount from the target code amount;
If the code amount difference is larger than a predetermined number, the compression rate that is one step lower than the set compression rate is set from the tile having the highest influence level among the tiles compressed at the set compression rate. A compression rate adjusting means for updating the compressed compression rate;
An image compression apparatus comprising:
前記圧縮率調整手段は、前記設定された圧縮率で圧縮されたタイルから前記影響度が最も高いタイルを検出し、検出したタイルを前記設定された圧縮率で圧縮したときの符号量と前記設定された圧縮率より一段低い圧縮率で圧縮したときの符号量との差を求め、当該差が前記符号量差以下であるとき、前記設定された圧縮率より一段低い圧縮率を前記設定された圧縮率として更新して前記符号量差から当該差を差し引くものであり、
前記圧縮率調整手段が前記設定された圧縮率を更新して前記符号量差から前記差を差し引く処理を、前記符号量差が前記予め定められた数以下になるまで、又は予め定められた回数繰り返し行わせる制御を行う繰り返し制御手段と、
を備えた請求項1に記載の画像圧縮装置。
The compression rate adjusting means detects a tile having the highest influence level from tiles compressed at the set compression rate, and the code amount when the detected tile is compressed at the set compression rate and the setting A difference from the code amount when compressed at a compression rate that is one step lower than the set compression rate is obtained, and when the difference is equal to or less than the code amount difference, a compression rate that is one step lower than the set compression rate is set. Update the compression rate and subtract the difference from the code amount difference.
The compression rate adjustment means updates the set compression rate and subtracts the difference from the code amount difference until the code amount difference is equal to or less than the predetermined number, or a predetermined number of times. Repetitive control means for performing repetitive control;
The image compression apparatus according to claim 1, further comprising:
主走査方向に配列する前記タイルを一つのバンドとして区分する区分手段を更に備え、
前記合計符号量算出手段、前記目標符号量算出手段、前記符号量差算出手段及び前記圧縮率調整手段は、バンド毎に各処理を行うことを特徴とする請求項1又は2に記載の画像圧縮装置。
Further comprising sorting means for sorting the tiles arranged in the main scanning direction as one band;
3. The image compression according to claim 1, wherein the total code amount calculating unit, the target code amount calculating unit, the code amount difference calculating unit, and the compression rate adjusting unit perform each process for each band. apparatus.
前記繰り返し制御手段による制御によって前記圧縮率調整手段が前記処理を前記予め定められた回数まで繰り返し行った後の前記符号量差が予め定められた数より大きい場合、前記圧縮率調整手段は異なるバンドのタイルに対して圧縮率調整を行う際に前記符号量差を前記目標符号量に加算することを特徴とする請求項3に記載の画像圧縮装置。   When the code amount difference after the compression rate adjusting unit repeatedly performs the process up to the predetermined number of times by the control by the repetition control unit is larger than the predetermined number, the compression rate adjusting unit is different in band. The image compression apparatus according to claim 3, wherein the code amount difference is added to the target code amount when the compression rate adjustment is performed for each tile. コンピュータを、
画像を複数のタイルに分割する分割手段、
設定された圧縮率を含む予め定められた範囲の複数の圧縮率で前記各タイルの圧縮を行う圧縮手段、
前記複数の圧縮率で圧縮された各タイルの符号量を算出する符号量算出手段、
前記複数の圧縮率で圧縮された各タイルの画質への影響度を算出する影響度算出手段、
前記設定された圧縮率で圧縮された各タイルの符号量の合計を算出する合計符号量算出手段、
前記設定された圧縮率で前記画像を圧縮したときに得られる圧縮データの符号量である目標符号量を算出する目標符号量算出手段、
前記目標符号量から前記合計符号量を引いた符号量差を算出する符号量差算出手段、
前記符号量差が予め定められた数より大きい場合、前記設定された圧縮率で圧縮されたタイルのうち前記影響度が最も高いタイルから前記設定された圧縮率より一段低い圧縮率を前記設定された圧縮率として更新する圧縮率調整手段、
として機能させるためのプログラム。
Computer
A dividing means for dividing an image into a plurality of tiles;
Compression means for compressing each tile at a plurality of compression rates within a predetermined range including a set compression rate;
Code amount calculation means for calculating the code amount of each tile compressed at the plurality of compression rates;
An influence degree calculating means for calculating an influence degree on the image quality of each tile compressed at the plurality of compression ratios;
A total code amount calculating means for calculating the total code amount of each tile compressed at the set compression rate;
Target code amount calculating means for calculating a target code amount that is a code amount of compressed data obtained when the image is compressed at the set compression rate;
Code amount difference calculating means for calculating a code amount difference obtained by subtracting the total code amount from the target code amount;
If the code amount difference is larger than a predetermined number, the compression rate that is one step lower than the set compression rate is set from the tile having the highest influence level among the tiles compressed at the set compression rate. Compression rate adjusting means for updating as a compressed compression rate,
Program to function as.
JP2008127894A 2008-05-15 2008-05-15 Image compression apparatus and program Expired - Fee Related JP4978934B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008127894A JP4978934B2 (en) 2008-05-15 2008-05-15 Image compression apparatus and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008127894A JP4978934B2 (en) 2008-05-15 2008-05-15 Image compression apparatus and program

Publications (2)

Publication Number Publication Date
JP2009278390A JP2009278390A (en) 2009-11-26
JP4978934B2 true JP4978934B2 (en) 2012-07-18

Family

ID=41443397

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008127894A Expired - Fee Related JP4978934B2 (en) 2008-05-15 2008-05-15 Image compression apparatus and program

Country Status (1)

Country Link
JP (1) JP4978934B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112565834B (en) * 2021-02-24 2021-05-11 北京创世云科技股份有限公司 Method and device for controlling output data and electronic equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10136365A (en) * 1996-10-31 1998-05-22 Sanyo Electric Co Ltd Image data coder
JP2002185966A (en) * 2000-12-15 2002-06-28 Matsushita Electric Ind Co Ltd Video encoder
JP2003032680A (en) * 2001-07-18 2003-01-31 Canon Inc Image coded, image coding method, program code of the same image coder, and memory medium of the same image coder
JP2004297696A (en) * 2003-03-28 2004-10-21 Matsushita Electric Ind Co Ltd Video signal encoder
JP2004328406A (en) * 2003-04-24 2004-11-18 Matsushita Electric Ind Co Ltd Code amount controlling method and coder

Also Published As

Publication number Publication date
JP2009278390A (en) 2009-11-26

Similar Documents

Publication Publication Date Title
JP5114462B2 (en) Image compression apparatus and image compression program
KR101320534B1 (en) Encoding device and method, composite device and method, and transmission system
US9414068B2 (en) Image processing apparatus and method
JP2006229538A (en) Image processing system, image processing method, and program therefor
CN113068037B (en) Method, apparatus, device, and medium for sample adaptive compensation
JP2002176650A (en) Image encoder, electronic camera, and recording medium for image encoding program
CN102271251B (en) Lossless image compression method
JP4978934B2 (en) Image compression apparatus and program
JP2020102704A (en) Image encoding device, control method of the same, and program
CN111654696B (en) Intra-frame multi-reference-line prediction method and device, storage medium and terminal
WO2012160626A1 (en) Image compression device, image restoration device, and program
JP2005039793A (en) Image encoding device, program, and storage medium
JP4966263B2 (en) Image processing apparatus and image processing program
JP6611562B2 (en) Image processing apparatus, image processing method, and program
JP5560172B2 (en) Image processing apparatus, image processing method, and image processing program
JP2001231009A (en) Image data storage device ad method
JP6564314B2 (en) Image encoding apparatus, control method thereof, program, and storage medium
JP5157490B2 (en) Target code amount calculation device, target code amount calculation method, and target code amount calculation program
US10284879B2 (en) Image processing apparatus and method based on integerprecision image data
JP2011077760A (en) Image compression device and image compression program
JP5017198B2 (en) Image processing apparatus and image processing program
JP2018033044A (en) Image encoder and control method and program thereof
JP2008124969A (en) Lossless image coding method and lossless image coding apparatus
KR20110099238A (en) Moving image data compressing method
JP4309220B2 (en) Image coding apparatus and image coding method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20101221

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120228

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120313

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120410

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150427

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4978934

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees