JP2008271193A - Image processing apparatus and program - Google Patents
Image processing apparatus and program Download PDFInfo
- Publication number
- JP2008271193A JP2008271193A JP2007111470A JP2007111470A JP2008271193A JP 2008271193 A JP2008271193 A JP 2008271193A JP 2007111470 A JP2007111470 A JP 2007111470A JP 2007111470 A JP2007111470 A JP 2007111470A JP 2008271193 A JP2008271193 A JP 2008271193A
- Authority
- JP
- Japan
- Prior art keywords
- area
- image processing
- unit
- data
- unit data
- 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
Links
Images
Landscapes
- Compression Of Band Width Or Redundancy In Fax (AREA)
Abstract
【課題】分類された独立に処理可能な単位データ毎に複数種類の画像処理を実行する際に、プログラムの処理時間を改善することができる画像処理装置およびプログラムを提供する。
【解決手段】分類された独立に処理可能な単位データを順次記憶するための第1の領域を記憶部に確保する第1領域確保手段(S1)と、単位データに対して実行する複数種類の画像処理に必要な第2の領域を記憶部に確保する第2領域確保手段(S2)と、第1の領域に一の単位データを記憶する記憶手段(S3)と、第1の領域に記憶された一の単位データに対して第2の領域を用いて複数種類の画像処理を順次実行する画像処理手段(S4〜S7)と、全ての単位データに対して画像処理手段による処理が終了したと判断した場合には(S8のYes)、第1の領域および第2の領域を開放する開放手段(S9、10)と、を備える。
【選択図】 図10An image processing apparatus and a program capable of improving the processing time of a program when executing a plurality of types of image processing for each classified unit data that can be processed independently.
First area securing means (S1) for securing a first area for sequentially storing classified unit data that can be independently processed in a storage unit, and a plurality of types to be executed for the unit data Second area securing means (S2) for securing a second area necessary for image processing in the storage unit, storage means (S3) for storing one unit data in the first area, and storage in the first area The processing by the image processing means (S4 to S7) for sequentially executing a plurality of types of image processing using the second area for the single unit data, and the processing by the image processing means for all the unit data are completed. (Yes in S8), an opening means (S9, 10) for opening the first area and the second area is provided.
[Selection] Figure 10
Description
本発明は、画像処理装置およびプログラムに関する。 The present invention relates to an image processing apparatus and a program.
特許文献1には、印刷時の使用メモリ量を節約するために、画像情報を多値データと2値データとに分離し、2値データはビットマップメモリに記憶し、多値データは階調情報メモリに記憶するという内容の発明が記載されている。
In
一方、画像の圧縮・伸長処理を行う装置においては、処理対象の画像データのサイズなどから予想される最大サイズのメモリスペースを予め確保する方法や、一定サイズのメモリスペースを予め確保し、処理中にメモリスペースが不足した時にメモリスペースを追加する方法が一般的である。 On the other hand, in an apparatus that performs image compression / decompression processing, a method for pre-allocating a memory space of the maximum size expected from the size of image data to be processed, or a memory space of a certain size in advance, A general method is to add a memory space when the memory space is insufficient.
また、JPEG2000(IS15444−1)のような圧縮・伸長アルゴリズムでは、圧縮処理又は伸長処理は複数の処理工程からなっており、同一の処理工程を繰り返し実行する場合には、処理工程の実行の前後でメモリスペースの確保/開放を繰り返す方法が一般的である。 Further, in the compression / decompression algorithm such as JPEG2000 (IS15444-1), the compression process or the decompression process consists of a plurality of processing steps. When the same processing step is repeatedly executed, before and after the execution of the processing step. In general, the method of repeatedly securing / releasing the memory space is used.
ところで、画像の圧縮・伸長処理において必要とされるメモリスペースは、サイズが大きく、また、メモリは一般に他のアプリケーションとも共用していることなどから、メモリスペースの確保/開放処理は、圧縮・伸長処理の際に行われる演算処理に比べ、非常に時間がかかるものとなっている。 By the way, the memory space required for image compression / decompression processing is large in size, and the memory is generally shared with other applications. Compared with the arithmetic processing performed at the time of processing, it takes much time.
したがって、JPEG2000のような圧縮・伸長アルゴリズムにおいて、同一の処理工程の繰り返し回数が多い場合には、メモリスペースの確保/開放処理にかかる時間が処理時間に占める比率が非常に大きくなるので、プログラムの処理時間に影響を及ぼす結果となっている。 Therefore, in a compression / decompression algorithm such as JPEG2000, if the number of repetitions of the same processing step is large, the ratio of the time taken to secure / release the memory space to the processing time becomes very large. The result affects the processing time.
なお、特許文献1に記載の技術によれば、メモリの使用量を改善することによりプログラムの高速化を図ることができるが、JPEG2000のような圧縮・伸長アルゴリズムにおいて、同一の処理工程の繰り返し回数が多い場合の処理は考慮されていない。
According to the technique described in
本発明は、上記に鑑みてなされたものであって、分類された独立に処理可能な単位データ毎に複数種類の画像処理を実行する際に、プログラムの処理時間を改善することができる画像処理装置およびプログラムを提供することを目的とする。 The present invention has been made in view of the above, and is capable of improving the processing time of a program when executing a plurality of types of image processing for each classified unit data that can be processed independently An object is to provide an apparatus and a program.
上述した課題を解決し、目的を達成するために、請求項1にかかる発明は、分類された独立に処理可能な単位データを順次記憶するための第1の領域を記憶部に確保する第1領域確保手段と、前記単位データに対して実行する前記複数種類の画像処理に必要な第2の領域を記憶部に確保する第2領域確保手段と、前記第1の領域に一の前記単位データを記憶する記憶手段と、前記第1の領域に記憶された一の前記単位データに対して前記第2の領域を用いて前記複数種類の画像処理を順次実行する画像処理手段と、全ての前記単位データに対して前記画像処理手段による処理が終了したと判断した場合には、前記第1の領域および前記第2の領域を開放する開放手段と、を備える。
In order to solve the above-described problems and achieve the object, the invention according to
また、請求項2にかかる発明は、分類された独立に処理可能な単位データを順次記憶するための第1の領域を記憶部に確保する第1領域確保手段と、前記単位データに対して実行する複数種類の画像処理に必要な第2の領域を前記単位データ毎に記憶部に順次確保する第2領域確保手段と、前記第1の領域に一の前記単位データを記憶する記憶手段と、前記第1の領域に記憶された一の前記単位データに対して前記第2の領域を用いて前記複数種類の画像処理を順次実行する画像処理手段と、全ての前記単位データに対して前記画像処理手段による処理が終了したと判断した場合には、前記第1の領域および前記第2の領域を開放する開放手段と、を備える。 According to a second aspect of the present invention, there is provided a first area securing means for securing a first area in the storage unit for sequentially storing classified unit data that can be processed independently, and the unit data is executed on the unit data. Second area securing means for sequentially securing a second area necessary for a plurality of types of image processing in the storage unit for each unit data; storage means for storing one unit data in the first area; Image processing means for sequentially executing the plurality of types of image processing on the one unit data stored in the first region using the second region, and the image for all the unit data An opening unit that opens the first area and the second area when it is determined that the processing by the processing unit has been completed;
また、請求項3にかかる発明は、請求項2記載の画像処理装置において、前記第2領域確保手段は、既に確保されている前記第2の領域のサイズと、処理対象となる前記単位データに必要となる前記第2の領域のサイズとを比較し、必要となる前記第2の領域のサイズの方が小さい場合は既に確保されている前記第2の領域のサイズをそのまま使用し、必要となる前記第2の領域のサイズの方が大きい場合は前記第2の領域を開放および再確保することによって十分なサイズの前記第2の領域のサイズを確保する。 According to a third aspect of the present invention, in the image processing apparatus according to the second aspect, the second area securing means includes the size of the second area that has already been secured and the unit data to be processed. Compare the required size of the second area, and if the required size of the second area is smaller, use the already secured size of the second area as it is. When the size of the second area is larger, the second area is opened and re-secured to secure a sufficient size of the second area.
また、請求項4にかかる発明は、請求項3記載の画像処理装置において、前記第2領域確保手段は、処理対象となる前記単位データに必要となる前記第2の領域のサイズの方が既に確保されている前記第2の領域のサイズより大きい場合は、既に確保されている前記第2の領域を部分的に開放した後、処理対象となる前記単位データに必要となる前記第2の領域のサイズを確保する。 According to a fourth aspect of the present invention, in the image processing apparatus according to the third aspect, the second area securing means is configured such that the size of the second area required for the unit data to be processed is already greater. If it is larger than the size of the reserved second area, the second area required for the unit data to be processed after partially releasing the already reserved second area Ensure the size of the.
また、請求項5にかかる発明は、請求項3または4記載の画像処理装置において、前記第2領域確保手段は、既に確保されている前記第2の領域を部分的に開放する際に、開放される部分のみを初期化する。 According to a fifth aspect of the present invention, in the image processing apparatus according to the third or fourth aspect, the second area securing means opens when the second area that has already been secured is partially opened. Initialize only the part to be used.
また、請求項6にかかる発明は、請求項1ないし5のいずれか一記載の画像処理装置において、前記単位データは、画像データの色成分、分割領域、周波数帯域、有効ビットプレーンのいずれかである。 According to a sixth aspect of the present invention, in the image processing device according to any one of the first to fifth aspects, the unit data is any one of a color component, a divided region, a frequency band, and an effective bit plane of the image data. is there.
また、請求項7にかかる発明は、請求項1ないし5のいずれか一記載の画像処理装置において、前記単位データは、画像データの色成分、分割領域、周波数帯域、有効ビットプレーンのいずれかにかかる符号列データである。 According to a seventh aspect of the present invention, in the image processing apparatus according to any one of the first to fifth aspects, the unit data is any one of a color component, a divided region, a frequency band, and an effective bit plane of the image data. Such code string data.
また、請求項8にかかる発明は、請求項1ないし7のいずれか一記載の画像処理装置において、前記単位データに対する前記複数種類の画像処理は、JPEG2000(IS15444−1)の圧縮または伸長アルゴリズムに準拠したものである。 According to an eighth aspect of the present invention, in the image processing apparatus according to any one of the first to seventh aspects, the plurality of types of image processing for the unit data is performed by a JPEG2000 (IS15444-1) compression or expansion algorithm. It is compliant.
また、請求項9にかかる発明は、分類された独立に処理可能な単位データを順次記憶するための第1の領域を記憶部に確保する第1領域確保機能と、前記単位データに対して実行する複数種類の画像処理に必要な第2の領域を記憶部に確保する第2領域確保機能と、前記第1の領域に一の前記単位データを記憶する記憶機能と、前記第1の領域に記憶された一の前記単位データに対して前記第2の領域を用いて前記複数種類の画像処理を順次実行する画像処理機能と、全ての前記単位データに対して前記画像処理機能による処理が終了したと判断した場合には、前記第1の領域および前記第2の領域を開放する開放機能と、をコンピュータに実行させる。 According to a ninth aspect of the present invention, there is provided a first area securing function for securing a first area in the storage unit for sequentially storing classified unit data that can be independently processed, and the unit data being executed. A second area securing function that secures a second area necessary for a plurality of types of image processing in the storage unit, a storage function that stores one unit data in the first area, and a storage function that stores the unit data in the first area. An image processing function for sequentially executing the plurality of types of image processing using the second area for the stored unit data, and processing by the image processing function for all the unit data is completed. If it is determined that the first area and the second area are opened, the computer is caused to execute an opening function for opening the first area and the second area.
また、請求項10にかかる発明は、分類された独立に処理可能な単位データを順次記憶するための第1の領域を記憶部に確保する第1領域確保機能と、前記単位データに対して実行する複数種類の画像処理に必要な第2の領域を前記単位データ毎に記憶部に順次確保する第2領域確保機能と、前記第1の領域に一の前記単位データを記憶する記憶機能と、前記第1の領域に記憶された一の前記単位データに対して前記第2の領域を用いて前記複数種類の画像処理を順次実行する画像処理機能と、全ての前記単位データに対して前記画像処理機能による処理が終了したと判断した場合には、前記第1の領域および前記第2の領域を開放する開放機能と、を前記コンピュータに実行させる。 According to a tenth aspect of the present invention, there is provided a first area securing function for securing a first area in the storage unit for sequentially storing classified unit data that can be independently processed, and the unit data being executed. A second area securing function for sequentially securing a second area necessary for a plurality of types of image processing in the storage unit for each unit data, and a storage function for storing one unit data in the first area; An image processing function for sequentially executing the plurality of types of image processing using the second area for one unit data stored in the first area, and the image for all the unit data If it is determined that the processing by the processing function has been completed, the computer is caused to execute an opening function for opening the first area and the second area.
本発明によれば、分類された独立に処理可能な単位データに対して実行する複数種類の画像処理の際に、単位データを順次記憶するための第1の領域と、単位データに対して実行する複数種類の画像処理に必要な第2の領域とについての確保および開放の頻度を減らすことにより、プログラムの処理時間を改善することができる、という効果を奏する。 According to the present invention, the first area for sequentially storing the unit data and the execution for the unit data in the case of a plurality of types of image processing executed for the classified unit data that can be processed independently The processing time of the program can be improved by reducing the frequency of securing and releasing the second areas necessary for the plurality of types of image processing.
さらに、分類された独立に処理可能な単位データ(色成分、領域、周波数帯域、有効ビットプレーンなど)によって記憶部の使用量を制御可能なため、効率的に、第1の領域および第2の領域メモリの確保・開放にかかる時間を省略でき、高速に画像処理を実行することができる、という効果を奏する。 Furthermore, since the usage amount of the storage unit can be controlled by the classified unit data (color component, region, frequency band, effective bit plane, etc.) that can be processed independently, the first region and the second region can be efficiently The time required for securing and releasing the area memory can be omitted, and image processing can be executed at high speed.
最初に、本発明の前提となる「階層符号化アルゴリズム」及び「離散ウェーブレット変換に基づく符号化・復号化アルゴリズム」の概要について説明する。なお、「離散ウェーブレット変換に基づく符号化・復号化アルゴリズム」の代表例が「JPEG2000アルゴリズム」である。 First, an outline of the “hierarchical encoding algorithm” and the “encoding / decoding algorithm based on discrete wavelet transform” which are the premise of the present invention will be described. A representative example of “encoding / decoding algorithm based on discrete wavelet transform” is “JPEG2000 algorithm”.
図1は、離散ウェーブレット変換に基づく符号化方式の基本となる階層符号化アルゴリズムを実現する画像処理部100の機能ブロック図である。この画像処理部100は、画像圧縮手段として機能するものであって、色空間変換・逆変換部101、2次元ウェーブレット変換・逆変換部102、量子化・逆量子化部103、エントロピー符号化・復号化部104、タグ処理部105の各機能ブロックにより構成されている。
FIG. 1 is a functional block diagram of an
画像処理部100が従来のJPEGアルゴリズムと比較して最も大きく異なる点の一つは変換方式である。JPEGでは離散コサイン変換(DCT:Discrete Cosine Transform)を用いているのに対し、この階層符号化アルゴリズムでは、2次元ウェーブレット変換・逆変換部102において、離散ウェーブレット変換(DWT:Discrete Wavelet Transform)を用いている。DWTはDCTに比べて、高圧縮領域における画質が良いという長所を有し、この点が、JPEGの後継アルゴリズムであるJPEG2000でDWTが採用された大きな理由の一つとなっている。
One of the biggest differences between the
また、他の大きな相違点は、この階層符号化アルゴリズムでは、システムの最終段に符号形成を行うために、タグ処理部105の機能ブロックが追加されていることである。このタグ処理部105で、画像の圧縮動作時には圧縮データが符号列データとして生成され、伸長動作時には伸長に必要な符号列データの解釈が行われる。そして、符号列データによって、JPEG2000は様々な便利な機能を実現できるようになった。例えば、ブロック・ベースでのDWTにおけるオクターブ分割に対応した任意の階層(デコンポジションレベル)で、静止画像の圧縮伸長動作を自由に停止させることができるようになる(後述する図3参照)。また、一つのファイルから低解像度画像(縮小画像)を取り出したり、画像の一部(タイリング画像)を取り出すことができるようになる。
Another major difference is that in this hierarchical encoding algorithm, a functional block of the
原画像の入出力部分には、色空間変換・逆変換部101が接続される場合が多い。例えば、原色系のR(赤)/G(緑)/B(青)の各コンポーネントからなるRGB表色系や、補色系のY(黄)/M(マゼンタ)/C(シアン)の各コンポーネントからなるYMC表色系から、YUVあるいはYCbCr表色系への変換又は逆変換を行う部分がこれに相当する。また、原画像データがRGBデータなどの場合には、ダイナミックレンジを半分に減じるためのDCレベルシフトも行われる。
In many cases, a color space conversion /
次に、JPEG2000アルゴリズムについて説明する。カラー画像は、一般に、図2に示すように、原画像の各コンポーネント111(ここではRGB原色系)が、矩形をした領域によって分割される(分割数≧1)。この分割された矩形領域は、一般にブロックあるいはタイルと呼ばれているものであるが、JPEG2000では、タイルと呼ぶことが一般的であるため、以下、このような分割された矩形領域をタイルと記述することにする(図2の例では、各コンポーネント111が縦横4×4、合計16個の矩形のタイル112に分割されている)。このような個々のタイル112(図2の例で、R00,R01,…,R15/G00,G01,…,G15/B00,B01,…,B15)が、画像データの圧縮伸長プロセスを実行する際の基本単位となる。従って、画像データの圧縮伸長動作は、コンポーネント毎、また、タイル112毎に、独立に行われる。
Next, the JPEG2000 algorithm will be described. As shown in FIG. 2, in the color image, each component 111 (in this case, the RGB primary color system) of the original image is generally divided by a rectangular area (division number ≧ 1). This divided rectangular area is generally called a block or a tile, but in JPEG2000, it is generally called a tile. Therefore, such a divided rectangular area is hereinafter referred to as a tile. (In the example of FIG. 2, each
画像データの符号化時には、各コンポーネント111の各タイル112のデータが、図1の色空間変換・逆変換部101に入力され、色空間変換を施された後、2次元ウェーブレット変換・逆変換部102で2次元ウェーブレット変換(順変換)が施されて、周波数帯に空間分割される。
At the time of encoding image data, the data of each
図3には、デコンポジションレベル数が3の場合の、各デコンポジションレベルにおけるサブバンドを示している。即ち、原画像のタイル分割によって得られたタイル原画像(0LL)(デコンポジションレベル0)に対して、2次元ウェーブレット変換を施し、デコンポジションレベル1に示すサブバンド(1LL,1HL,1LH,1HH)を分離する。そして引き続き、この階層における低周波成分1LLに対して、2次元ウェーブレット変換を施し、デコンポジションレベル2に示すサブバンド(2LL,2HL,2LH,2HH)を分離する。順次同様に、低周波成分2LLに対しても、2次元ウェーブレット変換を施し、デコンポジションレベル3に示すサブバンド(3LL,3HL,3LH,3HH)を分離する。図3では、各デコンポジションレベルにおいて符号化の対象となるサブバンドを、網掛けで表してある。例えば、デコンポジションレベル数を3としたとき、網掛けで示したサブバンド(3HL,3LH,3HH,2HL,2LH,2HH,1HL,1LH,1HH)が符号化対象となり、3LLサブバンドは符号化されない。
FIG. 3 shows subbands at each decomposition level when the number of decomposition levels is three. That is, the tile original image (0LL) (decomposition level 0) obtained by the tile division of the original image is subjected to two-dimensional wavelet transform, and subbands (1LL, 1HL, 1LH, 1HH shown in the composition level 1). ). Subsequently, the low-frequency component 1LL in this hierarchy is subjected to two-dimensional wavelet transform to separate subbands (2LL, 2HL, 2LH, 2HH) shown in the
次いで、指定した符号化の順番で符号化の対象となるビットが定められ、図1に示す量子化・逆量子化部103で対象ビット周辺のビットからコンテキストが生成される。
Next, the bits to be encoded are determined in the specified encoding order, and the context is generated from the bits around the target bits by the quantization /
この量子化の処理が終わったウェーブレット係数は、個々のサブバンド毎に、プレシンクトと呼ばれる重複しない矩形に分割される。これは、インプリメンテーションでメモリを効率的に使うために導入されたものである。図4に示したように、1つのプレシンクトは、空間的に一致した3つの矩形領域からなっている。より詳細には、サブバンドの矩形領域で、同じデコンポジションレベルのHL,LH,HHサブバンドの空間的に同じ位置にある3つの領域の組が1つのプリシンクトとして扱われる。ただし、LLサブバンドでは、1つの領域が1つのプレシンクトとして扱われる。プレシンクトのサイズをサブバンドと同じサイズにすることも可能である。更に、個々のプレシンクトは、重複しない矩形のコード・ブロックに分けられる。コード・ブロックは、エントロピー・コーディングを行う際の基本単位となる。図4にデコンポジションレベル1におけるプリシンクトと、そのコード・ブロックを例示した。図4中のプレシンクトと記された空間的に同じ位置にある3つの領域の組が、1つのプレシンクトとして扱われる。
The wavelet coefficients that have undergone this quantization process are divided into non-overlapping rectangles called precincts for each subband. This was introduced to use memory efficiently in implementation. As shown in FIG. 4, one precinct is composed of three rectangular regions that are spatially matched. More specifically, a set of three regions at the same spatial position of the HL, LH, and HH subbands having the same decomposition level in the rectangular region of the subband is treated as one precinct. However, in the LL subband, one area is treated as one precinct. It is also possible to make the size of the precinct the same as that of the subband. Furthermore, each precinct is divided into non-overlapping rectangular code blocks. The code block is a basic unit for entropy coding. FIG. 4 shows an example of a precinct and its code block at
すなわち、画像、タイル、サブバンド、プレシンクト、コード・ブロックの間には、
画像≧タイル>サブバンド≧プレシンクト≧コード・ブロック
の大小関係がある。
That is, between images, tiles, subbands, precincts, code blocks,
There is a size relationship of image ≧ tile> subband ≧ precinct ≧ code block.
ウェーブレット変換後の係数値は、そのまま量子化し符号化することも可能であるが、JPEG2000では符号化効率を上げるために、係数値を「ビットプレーン」単位に分解し、画素あるいはコード・ブロック毎に「ビットプレーン」に順位付けを行うことができる。 The coefficient values after the wavelet transform can be quantized and encoded as they are, but in JPEG2000, in order to increase the encoding efficiency, the coefficient values are decomposed into “bit plane” units, and each pixel or code block is divided. Ranking can be performed on “bitplanes”.
ここで、図5はビットプレーンに順位付けする手順の一例を示す説明図である。図5に示すように、この例は、原画像(32×32画素)を16×16画素のタイル4つで分割した場合で、デコンポジションレベル1のプレシンクトとコード・ブロックの大きさは、各々8×8画素と4×4画素としている。プレシンクトとコード・ブロックの番号は、ラスター順に付けられており、この例では、プレシンクトが番号0から3まで、コード・ブロックが番号0から3まで割り当てられている。タイル境界外に対する画素拡張にはミラーリング法を使い、可逆(5,3)フィルタでウェーブレット変換を行い、デコンポジションレベル1のウェーブレット係数値を求めている。
Here, FIG. 5 is an explanatory diagram showing an example of a procedure for ranking the bit planes. As shown in FIG. 5, this example is a case where the original image (32 × 32 pixels) is divided into four 16 × 16 pixel tiles, and the size of the precinct and code block at the
また、タイル0/プレシンクト3/コード・ブロック3について、代表的な「レイヤ」構成の概念の一例を示す説明図も図5に併せて示す。変換後のコード・ブロックは、サブバンド(1LL,1HL,1LH,1HH)に分割され、各サブバンドにはウェーブレット係数値が割り当てられている。
An explanatory diagram showing an example of the concept of a typical “layer” configuration for
レイヤの構造は、ウェーブレット係数値を横方向(ビットプレーン方向)から見ると理解し易い。1つのレイヤは任意の数のビットプレーンから構成される。この例では、レイヤ0,1,2,3は、各々、1,3,1,3のビットプレーンから成っている。そして、LSB(Least Significant Bit:最下位ビット)に近いビットプレーンを含むレイヤ程、先に量子化の対象となり、逆に、MSB(Most Significant Bit:最上位ビット)に近いレイヤは最後まで量子化されずに残ることになる。LSBに近いレイヤから破棄する方法はトランケーションと呼ばれ、量子化率を細かく制御することが可能である。 The layer structure is easy to understand when the wavelet coefficient values are viewed from the horizontal direction (bit plane direction). One layer is composed of an arbitrary number of bit planes. In this example, layers 0, 1, 2, and 3 are made up of bit planes of 1, 3, 1, and 3, respectively. A layer including a bit plane close to LSB (Least Significant Bit) is subject to quantization first. Conversely, a layer close to MSB (Most Significant Bit) is quantized to the end. It will remain without being. A method of discarding from a layer close to the LSB is called truncation, and the quantization rate can be finely controlled.
図1に示すエントロピー符号化・復号化部104では、コンテキストと対象ビットから確率推定によって、各コンポーネント111のタイル112に対する符号化を行う。こうして、原画像の全てのコンポーネント111について、タイル112単位で符号化処理が行われる。
The entropy encoding /
最後に、タグ処理部105は、エントロピー符号化・復号化部104からの全符号化データを1本の符号列データに結合するとともに、それにタグを付加する処理を行う。より詳細には、タグ処理部105は、不要なエントロピー符号を破棄し、必要なエントロピー符号をまとめてパケットを生成し、パケットを所定の順番に並べるとともに必要なタグ及びタグ情報を付加することにより、符号列データ(コードストリーム)を生成する。プレシンクトに含まれる全てのコード・ブロックの符号の一部(例えば最上位から3ビット目までの3枚のビットプレーンの符号)を取り出して集めたものがパケットである。符号が空(から)のパケットも許される。コード・ブロックの符号をまとめてパケットを所定の順序に並べたものは、“bit stream”と呼ばれる。
Finally, the
図6には、この符号列データの1フレーム分の概略構成を示している。この符号列データの先頭と各タイルの符号データ(bit stream)の先頭にはヘッダ(メインヘッダ(Main header)、タイル境界位置情報等であるタイルパートヘッダ(tile part header))と呼ばれるタグ情報が付加され、その後に、各タイルの符号化データが続く。なお、メインヘッダ(Main header)には、符号化パラメータや量子化パラメータが記述されている。そして、符号列データの終端には、再びタグ(end of codestream)が置かれる。 FIG. 6 shows a schematic configuration for one frame of the code string data. Tag information called a header (main header, tile part header which is tile boundary position information, etc.) is provided at the head of the code string data and the head of the code data (bit stream) of each tile. Appended, followed by the encoded data for each tile. In the main header, coding parameters and quantization parameters are described. A tag (end of codestream) is placed again at the end of the code string data.
また、図7は、符号化されたウェーブレット係数値が収容されたパケットをサブバンド毎に表わしたコードストリーム構造を示すものである。図7に示すように、タイルによる分割処理を行っても、あるいはタイルによる分割処理を行わなくても、同様のパケット列構造を持つことになる。 FIG. 7 shows a code stream structure in which packets containing encoded wavelet coefficient values are represented for each subband. As shown in FIG. 7, the same packet string structure is obtained regardless of whether the tile division process is performed or the tile division process is not performed.
一方、符号化データの復号化時には、画像データの符号化時とは逆に、各コンポーネント111の各タイル112の符号列データから画像データを生成する。この場合、タグ処理部105は、外部より入力した符号列データに付加されたタグ情報を解釈し、符号列データを各コンポーネント111の各タイル112の符号列データに分解し、その各コンポーネント111の各タイル112の符号列データ毎に復号化処理(伸長処理)を行う。このとき、符号列データ内のタグ情報に基づく順番で復号化の対象となるビットの位置が定められるとともに、量子化・逆量子化部103で、その対象ビット位置の周辺ビット(既に復号化を終えている)の並びからコンテキストが生成される。エントロピー符号化・復号化部104で、このコンテキストと符号列データから確率推定によって復号化を行い、対象ビットを生成し、それを対象ビットの位置に書き込む。このようにして復号化されたデータは周波数帯域毎に空間分割されているため、これを2次元ウェーブレット変換・逆変換部102で2次元ウェーブレット逆変換を行うことにより、画像データの各コンポーネントの各タイルが復元される。復元されたデータは色空間変換・逆変換部101によって元の表色系の画像データに変換される。
On the other hand, when the encoded data is decoded, the image data is generated from the code string data of each
以上が、「離散ウェーブレット変換に基づく符号化・復号化アルゴリズム」の概要である。 The above is the outline of the “encoding / decoding algorithm based on discrete wavelet transform”.
[第1の実施の形態]
続いて、本発明の第1の実施の形態について詳細に説明する。ここで、図8は本実施の形態の画像処理装置1のハードウェア構成を示すブロック図である。画像処理装置1は、例えばパーソナルコンピュータやワークステーションを主体に構成されている。図8に示すように、このような画像処理装置1は、コンピュータの主要部であって各部を集中的に制御するCPU(Central Processing Unit)2を備えている。このCPU2には、BIOSなどを記憶した読出し専用メモリであるROM(Read Only Memory)3と、各種データを書換え可能に記憶する記憶部であるRAM(Random Access Memory)4とがバス5で接続されている。
[First Embodiment]
Next, the first embodiment of the present invention will be described in detail. Here, FIG. 8 is a block diagram showing a hardware configuration of the
さらにバス5には、各種のプログラム等を格納するHDD(Hard Disk Drive)6と、配布されたプログラムであるコンピュータソフトウェアを読み取るための機構としてCD(Compact Disc)−ROM7を読み取るCD−ROMドライブ8と、ネットワーク9を介して外部の他のコンピュータ等と通信により情報を伝達するための通信制御装置10と、CPU2に対する各種命令や情報入力するためのキーボードやマウスなどの入力装置11と、処理経過や結果等を表示するCRT(Cathode Ray Tube)、LCD(Liquid Crystal Display)などの表示装置12とが、図示しないI/Oを介して接続されている。
Further, the
RAM4は、各種データを書換え可能に記憶する性質を有していることから、CPU2の作業エリアとして機能してバッファ等の役割を果たす。
Since the RAM 4 has the property of storing various data in a rewritable manner, it functions as a work area for the
図8に示すCD−ROM7は、この発明の記憶媒体を実施するものであり、OS(Operating System)や各種のプログラムが記憶されている。CPU2は、CD−ROM7に記憶されているプログラムをCD−ROMドライブ8で読み取り、HDD6にインストールする。
A CD-
なお、記憶媒体としては、CD−ROM7のみならず、DVDなどの各種の光ディスク、各種光磁気ディスク、フレキシブルディスクなどの各種磁気ディスク等、半導体メモリ等の各種方式のメディアを用いることができる。また、通信制御装置10を介してインターネットなどからプログラムをダウンロードし、HDD6にインストールするようにしてもよい。この場合に、送信側のサーバでプログラムを記憶している記憶装置も、この発明の記憶媒体である。なお、プログラムは、所定のOS(Operating System)上で動作するものであってもよいし、その場合に後述の各種処理の一部の実行をOSに肩代わりさせるものであってもよいし、所定のアプリケーションソフトやOSなどを構成する一群のプログラムファイルの一部として含まれているものであってもよい。
As the storage medium, not only the CD-
このシステム全体の動作を制御するCPU2は、このシステムの主記憶として使用されるHDD6上にロードされたプログラムに基づいて各種処理を実行する。
The
次に、画像処理装置1のHDD6にインストールされている各種のプログラムがCPU2に実行させる機能のうち、本実施の形態の画像処理装置1が備える特長的な機能について説明する。
Next, among the functions that the various programs installed in the HDD 6 of the
図9は、画像処理装置1の機能構成を示すブロック図である。図9に示すように、画像処理装置1は、JPEG2000の圧縮・伸長のための複数種類の画像処理を実行する図1で説明した画像処理部100、RAM4のメモリスペースを管理するメモリ管理部31、データ入力部32、データ出力部33、画像処理装置1内の処理シーケンスなどを制御するための制御部34を備える。
FIG. 9 is a block diagram illustrating a functional configuration of the
メモリ管理部31は、画像処理部100の画像の圧縮・伸長処理において必要とされるメモリスペースをRAM4に確保する。
The
データ入力部32は、圧縮すべき画像データ又は伸長すべき符号化データを入力する。
The
データ出力部33は、圧縮された符号化データ又は伸長された画像データを出力する。 The data output unit 33 outputs compressed encoded data or decompressed image data.
制御部34は、画像処理装置1内の処理シーケンスなどを制御する。具体的には、制御部34は、画像処理部100における各種処理工程における処理結果をRAM4に記録する。
The control unit 34 controls a processing sequence in the
次に、制御部34の制御による圧縮処理時の動作について、図10のフローチャートを参照して説明する。 Next, the operation at the time of compression processing under the control of the control unit 34 will be described with reference to the flowchart of FIG.
図10に示すように、制御部34は、メモリ管理部31を制御することにより、分類された独立に処理可能な単位データ(ここでは、タイルデータ)を順次記憶するためのメモリスペース(第1の領域)をRAM4上に確保する(ステップS1:第1領域確保手段)。なお、このメモリスペースのサイズの算出に必要なタイルのサイズ(画素数)、ビット深さ、コンポーネント数などの圧縮条件は、例えば画像処理装置1が構築されるコンピュータ上で動作するアプリケーションプログラムより通知される。例えば、アプリケーションプログラムより通知されたタイルサイズが(Tx × Ty)、ビット深さが8ビット(1byte)、コンポーネント数がCであるコンポーネントの場合、必要なメモリスペース(MSIZE)は、
MSIZE=(Tx × Ty)×2×C
と、計算される。ここで、必要なメモリスペースの計算の際に、ビット深さを“2”としたのは、画像データが1byteの場合、ウェーブレット変換などの計算では、余分に数ビット必要となるからである。
As shown in FIG. 10, the control unit 34 controls the
MSIZE = (Tx × Ty) × 2 × C
And calculated. Here, when calculating the required memory space, the bit depth is set to “2” because, when the image data is 1 byte, the calculation such as wavelet transform requires several extra bits.
続いて、制御部34は、メモリ管理部31を制御することにより、タイルデータに対して実行する複数種類の画像処理に必要なタイル処理用メモリスペース(第2の領域)をRAM4上に確保する(ステップS2:第2領域確保手段)。このメモリスペースのサイズ算出に必要な圧縮条件(コンポーネント、デコンポジションレベル、プレシンクト、レイヤ、コードブロックサイズ等)も、ステップS1と同様にアプリケーションプログラムより通知される。例えば、アプリケーションプログラムより通知された、コンポーネント数がC、デコンポジションレベルがD、プレシンクトサイズが(Px、Py)、レイヤがL、コードブロックサイズが(Cx,Cy)の場合、各デコンポジションレベルごとに、プレシンクトサイズ(PxD、PyD)、コードブロックサイズ(CxD,CyD)が計算される。計算に必要なメモリ量Mは、コード・ブロック単位で処理する場合は、
M=(CxD × CyD)×2×C
と、計算される。また、プレシンクト単位で処理する場合は、計算に必要なメモリ量Mは、
M=(PxD × PyD)×2×C
と、計算される。ここで、必要なメモリ量の計算の際に、ビット深さを“2”としたのは、画像データが1byteの場合、ウェーブレット変換などの計算では、余分に数ビット必要となるからである。
Subsequently, the control unit 34 controls the
M = (CxD × CyD) × 2 × C
And calculated. When processing in units of precincts, the memory amount M required for calculation is
M = (PxD × PyD) × 2 × C
And calculated. Here, when calculating the necessary memory amount, the bit depth is set to “2” because, when the image data is 1 byte, the calculation such as wavelet transform requires several extra bits.
続いて、制御部34は、データ入力部32を制御することにより、例えばHDD6などから1つのタイルのデータを入力させ、入力されたデータをRAM4上にステップS1で割り当てられたメモリスペース(第1の領域)に記憶する(ステップS3:記憶手段)。
Subsequently, the control unit 34 controls the
続くステップS4では、制御部34は、画像処理部100(色空間変換・逆変換部101)を制御することにより、タイルデータに対し色空間変換(ICT)を実行し、生成されたY,Cb,Crの各コンポーネントを、それぞれに割り当てられたメモリスペースに記憶する。具体的には、制御部34は、RAM4からタイルデータを読み出し、RAM4から読み出されたタイルデータについての画像処理部100の色空間変換・逆変換部101における色変換結果ないしDCレベルシフト結果を、RAM4に記録する。この場合、メモリ管理部31は、色成分ごとの記録位置を管理するようにしてもよい。
In subsequent step S4, the control unit 34 performs color space conversion (ICT) on the tile data by controlling the image processing unit 100 (color space conversion / inverse conversion unit 101), and generates the generated Y, Cb. , Cr are stored in the memory space allocated to each component. Specifically, the control unit 34 reads tile data from the RAM 4, and outputs the color conversion result or DC level shift result in the color space conversion /
続くステップS5では、制御部34は、画像処理部100(2次元ウェーブレット変換・逆変換部102)を制御することにより、Y,Cb,Crの各コンポーネントに対して2次元ウェーブレット変換を行い、生成された各サブバンド係数をそれぞれに割り当てられたメモリスペースに記憶する。具体的には、制御部34は、RAM4から色空間変換後のデータを読み出し、RAM4から読み出された色空間変換後のデータについての2次元ウェーブレット変換・逆変換部102におけるウェーブレット変換により生成された各サブバンド係数を、RAM4に記録する。この場合、メモリ管理部31は、各サブバンドの記録位置を管理するようにしてもよい。
In subsequent step S5, the control unit 34 controls the image processing unit 100 (two-dimensional wavelet transform / inverse transform unit 102) to perform two-dimensional wavelet transform on each of the Y, Cb, and Cr components to generate them. Each of the subband coefficients thus stored is stored in a memory space allocated thereto. Specifically, the control unit 34 reads data after color space conversion from the RAM 4, and generates the data after color space conversion read from the RAM 4 by wavelet conversion in the two-dimensional wavelet transform /
続くステップS6では、制御部34は、画像処理部100(量子化・逆量子化部103)を制御することにより、サブバンド毎に線形量子化を行い、量子化後の各サブバンド係数をそれぞれに割り当てられたメモリスペースに記憶する。具体的には、制御部34は、RAM4からウェーブレット変換後のデータを読み出し、RAM4から読み出されたウェーブレット変換後のデータについて量子化・逆量子化部103で線形量子化した量子化後の各サブバンド係数を、RAM4に記録する。
In subsequent step S6, the control unit 34 performs linear quantization for each subband by controlling the image processing unit 100 (quantization / inverse quantization unit 103), and sets each subband coefficient after quantization. Store in the memory space allocated to. Specifically, the control unit 34 reads the data after wavelet transform from the RAM 4, and each quantized and quantized linear quantized data by the quantization /
続くステップS7では、制御部34は、画像処理部100(エントロピー符号化・復号化部104)を制御することにより、量子化後の各サブバンド係数に対してエントロピー符号化を行い、エントロピー符号化した符号化結果をそれぞれに割り当てられたメモリスペースに記憶する。具体的には、制御部34は、RAM4から量子化後の各サブバンド係数を読み出し、RAM4から読み出された量子化後の各サブバンド係数についてエントロピー符号化・復号化部104でエントロピー符号化した符号化結果を、RAM4に記録する。この場合、メモリ管理部31は、各パケットの記録位置を管理するようにしてもよい。
In subsequent step S7, the control unit 34 controls the image processing unit 100 (entropy encoding / decoding unit 104) to perform entropy encoding on each quantized subband coefficient, thereby entropy encoding. The encoded results are stored in the memory space allocated to each. Specifically, the control unit 34 reads each quantized subband coefficient from the RAM 4, and entropy coding /
上述したステップS3〜S7の処理(画像処理手段)は、全てのタイルデータについての圧縮処理が終了するまで(ステップS8のNo)、繰り返される。 The processes in steps S3 to S7 (image processing means) described above are repeated until the compression process for all tile data is completed (No in step S8).
全てのタイルデータについてステップS3〜S7の圧縮処理が終了した場合には(ステップS8のNo)、制御部34は、メモリ管理部31を制御することにより、タイルデータ用にRAM4に割り当てたメモリスペースを開放するとともに(ステップS9:開放手段)、タイル処理用にRAM4に割り当てたメモリスペースを開放する(ステップS10:開放手段)。
When the compression processing in steps S3 to S7 is completed for all tile data (No in step S8), the control unit 34 controls the
次いで、制御部34は、画像処理部100(タグ処理部105)を制御することにより、符号列データ(コードストリーム)を生成する符号形成処理を行い、生成された符号列データ(コードストリーム)をRAM4に記憶する(ステップS11)。 Next, the control unit 34 controls the image processing unit 100 (tag processing unit 105) to perform a code forming process for generating code string data (code stream), and the generated code string data (code stream). It memorize | stores in RAM4 (step S11).
最後に、制御部34は、データ出力部33を制御することにより、生成された符号列データ(コードストリーム)をRAM4から読み出して出力する(ステップS12)。 Finally, the control unit 34 controls the data output unit 33 to read out and output the generated code string data (code stream) from the RAM 4 (step S12).
次に、制御部34の制御による伸長処理時の動作について、図11のフローチャートを参照して説明する。 Next, the operation at the time of decompression processing under the control of the control unit 34 will be described with reference to the flowchart of FIG.
図11に示すように、制御部34は、メモリ管理部31を制御することにより、分類された独立に処理可能な単位データである符号列データ(コードストリーム)の記憶のために、メモリスペースをRAM4上に確保する(ステップS21:第1領域確保手段)。このメモリスペースのサイズは、予め定めておいてもよいし、例えばアプリケーションプログラムから指定するようにしてもよい。
As shown in FIG. 11, the control unit 34 controls the
続いて、制御部34は、データ入力部32を制御することにより、符号列データ(コードストリーム)を入力させ、入力された符号列データ(コードストリーム)をRAM4上にステップS21で割り当てられたメモリスペース(第1の領域)に記憶する(ステップS22:記憶手段)。この時に、制御部34は、画像処理部100(タグ処理部105)を制御することにより、符号列データ(コードストリーム)のヘッダ情報を解析する(ステップS23)。より詳細には、タグ処理部105は、2次元ウェーブレット変換の種類・回数、色空間変換の種類、原画像のコンポーネント数、サイズ、ビット深さ、タイルサイズなどのメモリスペースの割り当てに必要な情報を解析し、解析情報をメモリ管理部31に渡す。
Subsequently, the control unit 34 controls the
続いて、制御部34は、メモリ管理部31を制御することにより、ステップS23で解析された解析情報を元に、符号列データに対して実行する複数種類の画像処理に必要なメモリスペース(第2の領域)をRAM4上に確保する(ステップS24:第2領域確保手段)。
Subsequently, the control unit 34 controls the
続くステップS25では、制御部34は、画像処理部100(エントロピー符号化・復号化部104)を制御することにより、ステップS22で入力された符号列データ(コードストリーム)に対してエントロピー復号化を行い、エントロピー復号化した復号化結果を割り当てられたメモリスペースに記憶する。 In subsequent step S25, the control unit 34 controls the image processing unit 100 (entropy encoding / decoding unit 104) to perform entropy decoding on the code string data (code stream) input in step S22. And the entropy-decoded decoding result is stored in the allocated memory space.
続くステップS26では、制御部34は、画像処理部100(量子化・逆量子化部103)を制御することにより、復号化後の各サブバンド係数に逆量子化を行い、逆量子化後の各サブバンド係数をそれぞれに割り当てられたメモリスペースに記憶する。 In subsequent step S26, the control unit 34 controls the image processing unit 100 (quantization / inverse quantization unit 103) to perform inverse quantization on each subband coefficient after decoding, and after the inverse quantization, Each subband coefficient is stored in a memory space assigned to it.
続くステップS27では、制御部34は、画像処理部100(2次元ウェーブレット変換・逆変換部102)を制御することにより、逆量子化後の各サブバンド係数に対して2次元逆ウェーブレット変換を行い、生成されたY,Cb,Crの各コンポーネントをそれぞれに割り当てられたメモリスペースに記憶する。 In subsequent step S27, the control unit 34 controls the image processing unit 100 (two-dimensional wavelet transform / inverse transform unit 102) to perform two-dimensional inverse wavelet transform on each subband coefficient after inverse quantization. The generated Y, Cb, and Cr components are stored in the memory space allocated to each component.
続くステップS28では、制御部34は、画像処理部100(色空間変換・逆変換部101)を制御することにより、0LLデータに対し逆色空間変換(及び逆DCレベルシフト)を実行し、元の表色系のタイルデータを生成し、割り当てられたメモリスペースに記憶する。 In subsequent step S28, the control unit 34 performs reverse color space conversion (and reverse DC level shift) on the 0LL data by controlling the image processing unit 100 (color space conversion / inverse conversion unit 101). The color system tile data is generated and stored in the allocated memory space.
上述したステップS25〜S28の処理(画像処理手段)は、全てのタイルデータについての伸長処理が終了するまで(ステップS29のNo)、繰り返される。 The processes in steps S25 to S28 (image processing means) described above are repeated until the expansion process for all tile data is completed (No in step S29).
全てのタイルデータについてステップS25〜S28の伸長処理が終了した場合には(ステップS29のNo)、制御部34は、データ出力部33を制御することにより、伸長画像データを出力する(ステップS30)。 When the decompression processing in steps S25 to S28 is completed for all tile data (No in step S29), the control unit 34 controls the data output unit 33 to output decompressed image data (step S30). .
最後に、制御部34は、メモリ管理部31を制御することにより、符号用にRAM4に割り当てたメモリスペースを開放するとともに(ステップS31:開放手段)、タイル処理用にRAM4に割り当てたメモリスペースを開放する(ステップS32:開放手段)。
Finally, the control unit 34 controls the
このように本実施の形態によれば、分類された独立に処理可能な単位データに対して実行する複数種類の画像処理の際に、単位データを順次記憶するための第1の領域と、単位データに対して実行する複数種類の画像処理に必要な第2の領域とについての確保および開放の頻度を減らすことにより、プログラムの処理時間を改善することができる。 As described above, according to the present embodiment, the first area for sequentially storing the unit data and the unit for the plurality of types of image processing to be executed on the classified unit data that can be processed independently The processing time of the program can be improved by reducing the frequency of securing and releasing the second area necessary for a plurality of types of image processing to be performed on the data.
さらに、分類された独立に処理可能な単位データ(例えば、色成分、分割領域、周波数帯域、有効ビットプレーンなど)によって記憶部の使用量を制御可能なため、効率的に、メモリスペース(第1の領域および第2の領域)の確保・開放にかかる時間を省略でき、高速に画像処理を実行することができる。 Furthermore, since the amount of use of the storage unit can be controlled by the classified unit data that can be processed independently (for example, color components, divided regions, frequency bands, effective bit planes, etc.), the memory space (first Time and the second area) can be saved, and image processing can be executed at high speed.
[第2の実施の形態]
次に、本発明の第2の実施の形態を図12および図13に基づいて説明する。なお、前述した第1の実施の形態と同じ部分は同じ符号で示し説明も省略する。
[Second Embodiment]
Next, a second embodiment of the present invention will be described with reference to FIGS. The same parts as those in the first embodiment described above are denoted by the same reference numerals, and description thereof is also omitted.
本実施の形態の制御部34の制御による圧縮処理時の動作について、図12のフローチャートを参照して説明する。 The operation at the time of compression processing by the control of the control unit 34 of the present embodiment will be described with reference to the flowchart of FIG.
図12に示すように、制御部34は、メモリ管理部31を制御することにより、分類された独立に処理可能な単位データ(ここでは、タイルデータ)を順次記憶するためのメモリスペース(第1の領域)をRAM4上に確保する(ステップS41:第1領域確保手段)。なお、このメモリスペースのサイズの算出に必要なタイルのサイズ(画素数)、ビット深さ、コンポーネント数などは、例えば画像処理装置1が構築されるコンピュータ上で動作するアプリケーションプログラムより通知される。
As shown in FIG. 12, the control unit 34 controls the
続いて、制御部34は、メモリ管理部31を制御することにより、タイルデータに対して実行する複数種類の画像処理に必要なタイル処理用メモリスペース(第2の領域)をRAM4上に確保する(ステップS42:第2領域確保手段)。このメモリスペースのサイズ算出に必要な圧縮条件(コンポーネント、デコンポジションレベル、プレシンクト、レイヤ、コードブロックサイズ等)も、ステップS41と同様にアプリケーションプログラムより通知される。
Subsequently, the control unit 34 controls the
ここで、ステップS42におけるメモリスペースの確保処理においては、2つめ以降のタイルデータの場合、すでに確保されているメモリスペースサイズと、処理対象となるデータに必要となるメモリサイズとを比較する。必要となるメモリサイズの方が小さい場合は、そのまま使用し、必要となるメモリサイズの方が大きい場合は、メモリスペースの追加の確保、ないし開放および再確保が行われる。 Here, in the memory space securing process in step S42, in the case of the second and subsequent tile data, the memory space size already secured is compared with the memory size required for the data to be processed. When the required memory size is smaller, the memory size is used as it is, and when the required memory size is larger, additional memory space is reserved, released or re-allocated.
メモリスペースの開放および再確保の際には、当該処理タイルの処理に不十分であるメモリスペースを部分的に開放し、再確保する方法も考えられる。例えば、すでに確保しているメモリスペース確保量(例えば、コンポーネントY、デコンポジションレベル1、プレシンクト0、レイヤ0のメモリスペース確保量)と、処理するタイルの必要なメモリスペース量(例えば、コンポーネントY、デコンポジションレベル1、プレシンクト0、レイヤ0の必要なメモリスペース量)を比較し、不十分な場合は、メモリスペースの再確保、ないしは、不足分の再確保などをすればよい。また、メモリスペースを再利用する場合、前のタイル処理でメモリスペースにデータを書き込んでいるが、必要に応じて初期化をする必要がある。この際の初期化処理には必ず上書きが発生し、すでに記録したデータが利用されることがない場合には初期化を必要としない。なお、上書きが発生することが確実でない場合には、初期化を実施する必要がある。この場合も、ある特定のメモリスペース(例えば、コンポーネントY、デコンポジションレベル1、プレシンクト0、レイヤ0のメモリスペース)のみを初期化するなどすればよい。
In releasing and reallocating the memory space, a method of partially releasing and reallocating the memory space that is insufficient for the processing of the processing tile can be considered. For example, the amount of memory space already secured (for example, the amount of memory space for component Y,
続いて、制御部34は、データ入力部32を制御することにより、例えばHDD6などから1つのタイルのデータを入力させ、入力されたデータをRAM4上にステップS41で割り当てられたメモリスペース(第1の領域)に記憶する(ステップS43:記憶手段)。
Subsequently, the control unit 34 controls the
続くステップS44では、制御部34は、画像処理部100(色空間変換・逆変換部101)を制御することにより、タイルデータに対し色空間変換(ICT)を実行し、生成されたY,Cb,Crの各コンポーネントを、それぞれに割り当てられたメモリスペースに記憶する。具体的には、制御部34は、RAM4からタイルデータを読み出し、RAM4から読み出されたタイルデータについての画像処理部100の色空間変換・逆変換部101における色変換結果ないしDCレベルシフト結果を、RAM4に記録する。この場合、メモリ管理部31は、色成分ごとの記録位置を管理するようにしてもよい。
In subsequent step S44, the control unit 34 performs color space conversion (ICT) on the tile data by controlling the image processing unit 100 (color space conversion / inverse conversion unit 101), and the generated Y, Cb , Cr are stored in the memory space allocated to each component. Specifically, the control unit 34 reads tile data from the RAM 4, and outputs the color conversion result or DC level shift result in the color space conversion /
続くステップS45では、制御部34は、画像処理部100(2次元ウェーブレット変換・逆変換部102)を制御することにより、Y,Cb,Crの各コンポーネントに対して2次元ウェーブレット変換を行い、生成された各サブバンド係数をそれぞれに割り当てられたメモリスペースに記憶する。具体的には、制御部34は、RAM4から色空間変換後のデータを読み出し、RAM4から読み出された色空間変換後のデータについての2次元ウェーブレット変換・逆変換部102におけるウェーブレット変換により生成された各サブバンド係数を、RAM4に記録する。この場合、メモリ管理部31は、各サブバンドの記録位置を管理するようにしてもよい。
In subsequent step S45, the control unit 34 controls the image processing unit 100 (two-dimensional wavelet transform / inverse transform unit 102) to perform a two-dimensional wavelet transform on each of the Y, Cb, and Cr components to generate them. Each of the subband coefficients thus stored is stored in a memory space allocated thereto. Specifically, the control unit 34 reads data after color space conversion from the RAM 4, and generates the data after color space conversion read from the RAM 4 by wavelet conversion in the two-dimensional wavelet transform /
続くステップS46では、制御部34は、画像処理部100(量子化・逆量子化部103)を制御することにより、サブバンド毎に線形量子化を行い、量子化後の各サブバンド係数をそれぞれに割り当てられたメモリスペースに記憶する。具体的には、制御部34は、RAM4からウェーブレット変換後のデータを読み出し、RAM4から読み出されたウェーブレット変換後のデータについて量子化・逆量子化部103で線形量子化した量子化後の各サブバンド係数を、RAM4に記録する。
In subsequent step S46, the control unit 34 performs linear quantization for each subband by controlling the image processing unit 100 (quantization / inverse quantization unit 103), and each subband coefficient after the quantization is obtained. Store in the memory space allocated to. Specifically, the control unit 34 reads the data after wavelet transform from the RAM 4, and each quantized and quantized linear quantized data by the quantization /
続くステップS47では、制御部34は、画像処理部100(エントロピー符号化・復号化部104)を制御することにより、量子化後の各サブバンド係数に対してエントロピー符号化を行い、エントロピー符号化した符号化結果をそれぞれに割り当てられたメモリスペースに記憶する。具体的には、制御部34は、RAM4から量子化後の各サブバンド係数を読み出し、RAM4から読み出された量子化後の各サブバンド係数についてエントロピー符号化・復号化部104でエントロピー符号化した符号化結果を、RAM4に記録する。この場合、メモリ管理部31は、各パケットの記録位置を管理するようにしてもよい。
In subsequent step S47, the control unit 34 controls the image processing unit 100 (entropy encoding / decoding unit 104) to perform entropy encoding on each quantized subband coefficient, thereby entropy encoding. The encoded results are stored in the memory space allocated to each. Specifically, the control unit 34 reads each quantized subband coefficient from the RAM 4, and entropy coding /
上述したステップS42〜S47の処理(画像処理手段)は、全てのタイルデータについての圧縮処理が終了するまで(ステップS48のNo)、繰り返される。 The processing in steps S42 to S47 (image processing means) described above is repeated until the compression processing for all tile data is completed (No in step S48).
全てのタイルデータについてステップS42〜S47の圧縮処理が終了した場合には(ステップS48のNo)、制御部34は、メモリ管理部31を制御することにより、タイルデータ用にRAM4に割り当てたメモリスペースを開放するとともに(ステップS49:開放手段)、タイル処理用にRAM4に割り当てたメモリスペースを開放する(ステップS50:開放手段)。
When the compression processing of steps S42 to S47 is completed for all tile data (No in step S48), the control unit 34 controls the
次いで、制御部34は、画像処理部100(タグ処理部105)を制御することにより、符号列データ(コードストリーム)を生成する符号形成処理を行い、生成された符号列データ(コードストリーム)をRAM4に記憶する(ステップS51)。 Next, the control unit 34 controls the image processing unit 100 (tag processing unit 105) to perform a code forming process for generating code string data (code stream), and the generated code string data (code stream). It memorize | stores in RAM4 (step S51).
最後に、制御部34は、データ出力部33を制御することにより、生成された符号列データ(コードストリーム)をRAM4から読み出して出力する(ステップS52)。 Finally, the control unit 34 controls the data output unit 33 to read out and output the generated code string data (code stream) from the RAM 4 (step S52).
次に、制御部34の制御による伸長処理時の動作について、図13のフローチャートを参照して説明する。 Next, the operation during the decompression process under the control of the control unit 34 will be described with reference to the flowchart of FIG.
図13に示すように、制御部34は、メモリ管理部31を制御することにより、符号列データ(コードストリーム)の記憶のために、メモリスペースをRAM4上に確保する(ステップS61:第1領域確保手段)。このメモリスペースのサイズは、予め定めておいてもよいし、例えばアプリケーションプログラムから指定するようにしてもよい。
As shown in FIG. 13, the control unit 34 controls the
続いて、制御部34は、データ入力部32を制御することにより、符号列データ(コードストリーム)を入力させ、入力された符号列データ(コードストリーム)をRAM4上にステップS21で割り当てられたメモリスペース(第1の領域)に記憶する(ステップS62:記憶手段)。この時に、制御部34は、画像処理部100(タグ処理部105)を制御することにより、符号列データ(コードストリーム)のヘッダ情報を解析する(ステップS63)。より詳細には、タグ処理部105は、2次元ウェーブレット変換の種類・回数、色空間変換の種類、原画像のコンポーネント数、サイズ、ビット深さ、タイルサイズなどのメモリスペースの割り当てに必要な情報を解析し、解析情報をメモリ管理部31に渡す。
Subsequently, the control unit 34 controls the
続いて、制御部34は、メモリ管理部31を制御することにより、ステップS63で解析された解析情報を元に、符号列データに対して実行する複数種類の画像処理に必要なメモリスペース(第2の領域)をRAM4上に確保する(ステップS64:第2領域確保手段)。メモリスペースのサイズ算出に必要な伸長条件(コンポーネント、デコンポジションレベル、プレシンクト、レイヤ、コードブロックサイズ等)は、ステップS63にて求められている。
Subsequently, the control unit 34 controls the
ここで、ステップS64におけるメモリスペースの確保処理においては、2つめ以降の符号列データの場合、すでに確保されているメモリスペースサイズと、処理対象となるデータに必要となるメモリサイズとを比較する。必要となるメモリサイズの方が小さい場合は、そのまま使用し、必要となるメモリサイズの方が大きい場合は、メモリスペースの追加の確保、ないし開放および再確保が行われる。 Here, in the memory space securing process in step S64, in the case of the second and subsequent code string data, the memory space size already secured is compared with the memory size required for the data to be processed. When the required memory size is smaller, the memory size is used as it is, and when the required memory size is larger, additional memory space is reserved, released or re-allocated.
メモリスペースの開放および再確保の際には、当該処理タイルの処理に不十分であるメモリスペースを部分的に開放し、再確保する方法も考えられる。例えば、すでに確保しているメモリスペース確保量(例えば、コンポーネントY、デコンポジションレベル1、プレシンクト0、レイヤ0のメモリスペース確保量)と、処理するタイルの必要なメモリスペース量(例えば、コンポーネントY、デコンポジションレベル1、プレシンクト0、レイヤ0の必要なメモリスペース量)を比較し、不十分な場合は、メモリスペースの再確保、ないしは、不足分の再確保などをすればよい。また、メモリスペースを再利用する場合、前のタイル処理でメモリスペースにデータを書き込んでいるが、必要に応じて初期化をする必要がある。この際の初期化処理には必ず上書きが発生し、すでに記録したデータが利用されることがない場合には初期化を必要としない。なお、上書きが発生することが確実でない場合には、初期化を実施する必要がある。この場合も、ある特定のメモリスペース(例えば、コンポーネントY、デコンポジションレベル1、プレシンクト0、レイヤ0のメモリスペース)のみを初期化するなどすればよい。
In releasing and reallocating the memory space, a method of partially releasing and reallocating the memory space that is insufficient for the processing of the processing tile can be considered. For example, the amount of memory space already secured (for example, the amount of memory space for component Y,
続くステップS65では、制御部34は、画像処理部100(エントロピー符号化・復号化部104)を制御することにより、ステップS62で入力された符号列データ(コードストリーム)に対してエントロピー復号化を行い、エントロピー復号化した復号化結果を割り当てられたメモリスペースに記憶する。 In subsequent step S65, the control unit 34 controls the image processing unit 100 (entropy encoding / decoding unit 104) to perform entropy decoding on the code string data (code stream) input in step S62. And the entropy-decoded decoding result is stored in the allocated memory space.
続くステップS66では、制御部34は、画像処理部100(量子化・逆量子化部103)を制御することにより、復号化後の各サブバンド係数に逆量子化を行い、逆量子化後の各サブバンド係数をそれぞれに割り当てられたメモリスペースに記憶する。 In subsequent step S66, the control unit 34 controls the image processing unit 100 (quantization / inverse quantization unit 103) to perform inverse quantization on each subband coefficient after decoding, and after the inverse quantization, Each subband coefficient is stored in a memory space assigned to it.
続くステップS67では、制御部34は、画像処理部100(2次元ウェーブレット変換・逆変換部102)を制御することにより、逆量子化後の各サブバンド係数に対して2次元逆ウェーブレット変換を行い、生成されたY,Cb,Crの各コンポーネントをそれぞれに割り当てられたメモリスペースに記憶する。 In subsequent step S67, the control unit 34 controls the image processing unit 100 (two-dimensional wavelet transform / inverse transform unit 102) to perform two-dimensional inverse wavelet transform on each subband coefficient after inverse quantization. The generated Y, Cb, and Cr components are stored in the memory space allocated to each component.
続くステップS68では、制御部34は、画像処理部100(色空間変換・逆変換部101)を制御することにより、0LLデータに対し逆色空間変換(及び逆DCレベルシフト)を実行し、元の表色系のタイルデータを生成し、割り当てられたメモリスペースに記憶する。 In subsequent step S68, the control unit 34 performs reverse color space conversion (and reverse DC level shift) on the 0LL data by controlling the image processing unit 100 (color space conversion / inverse conversion unit 101). The color system tile data is generated and stored in the allocated memory space.
上述したステップS64〜S68の処理(画像処理手段)は、全てのタイルデータについての伸長処理が終了するまで(ステップS69のNo)、繰り返される。 The processes (image processing means) in steps S64 to S68 described above are repeated until the expansion process for all tile data is completed (No in step S69).
全てのタイルデータについてステップS64〜S68の伸長処理が終了した場合には(ステップS69のNo)、制御部34は、データ出力部33を制御することにより、伸長画像データを出力する(ステップS70)。 When the decompression processing in steps S64 to S68 is completed for all tile data (No in step S69), the control unit 34 controls the data output unit 33 to output decompressed image data (step S70). .
最後に、制御部34は、メモリ管理部31を制御することにより、符号用にRAM4に割り当てたメモリスペースを開放するとともに(ステップS71:開放手段)、タイル処理用にRAM4に割り当てたメモリスペースを開放する(ステップS72:開放手段)。
Finally, the control unit 34 controls the
このように本実施の形態によれば、分類された独立に処理可能な単位データに対して実行する複数種類の画像処理の際に、単位データを順次記憶するための第1の領域と、単位データに対して実行する複数種類の画像処理に必要な第2の領域とについての確保および開放の頻度を減らすことにより、プログラムの処理時間を改善することができる。 As described above, according to the present embodiment, the first area for sequentially storing the unit data and the unit for the plurality of types of image processing to be executed on the classified unit data that can be processed independently The processing time of the program can be improved by reducing the frequency of securing and releasing the second area necessary for a plurality of types of image processing to be performed on the data.
さらに、分類された独立に処理可能な単位データ(例えば、色成分、分割領域、周波数帯域、有効ビットプレーンなど)によって記憶部の使用量を制御可能なため、効率的に、メモリスペース(第1の領域および第2の領域)の確保・開放にかかる時間を省略でき、高速に画像処理を実行することができる。 Furthermore, since the amount of use of the storage unit can be controlled by the classified unit data that can be processed independently (for example, color components, divided regions, frequency bands, effective bit planes, etc.), the memory space (first Time and the second area) can be saved, and image processing can be executed at high speed.
なお、各実施の形態においては、JPEG2000の基本方式(IS15444−1)により画像データの圧縮又は画像の符号化データの伸長を行うものとしたが、これに限るものではなく、他の符号化方式により圧縮又は伸長を行う画像処理装置についても本発明を同様に適用し得ることは明らかである。 In each embodiment, image data compression or image encoded data decompression is performed according to the JPEG2000 basic method (IS154444-1). However, the present invention is not limited to this, and other encoding methods are used. It is obvious that the present invention can be similarly applied to an image processing apparatus that performs compression or decompression according to the above.
1 画像処理装置
4 記憶部
1 Image processing device 4 Storage unit
Claims (10)
前記単位データに対して実行する複数種類の画像処理に必要な第2の領域を記憶部に確保する第2領域確保手段と、
前記第1の領域に一の前記単位データを記憶する記憶手段と、
前記第1の領域に記憶された一の前記単位データに対して前記第2の領域を用いて前記複数種類の画像処理を順次実行する画像処理手段と、
全ての前記単位データに対して前記画像処理手段による処理が終了したと判断した場合には、前記第1の領域および前記第2の領域を開放する開放手段と、
を備えることを特徴とする画像処理装置。 First area securing means for securing in the storage unit a first area for sequentially storing classified unit data that can be processed independently;
A second area securing means for securing a second area necessary for a plurality of types of image processing to be executed for the unit data in a storage unit;
Storage means for storing one unit data in the first area;
Image processing means for sequentially executing the plurality of types of image processing using the second area for the unit data stored in the first area;
When it is determined that the processing by the image processing unit has been completed for all the unit data, an opening unit that opens the first region and the second region;
An image processing apparatus comprising:
前記単位データに対して実行する複数種類の画像処理に必要な第2の領域を前記単位データ毎に記憶部に順次確保する第2領域確保手段と、
前記第1の領域に一の前記単位データを記憶する記憶手段と、
前記第1の領域に記憶された一の前記単位データに対して前記第2の領域を用いて前記複数種類の画像処理を順次実行する画像処理手段と、
全ての前記単位データに対して前記画像処理手段による処理が終了したと判断した場合には、前記第1の領域および前記第2の領域を開放する開放手段と、
を備えることを特徴とする画像処理装置。 First area securing means for securing in the storage unit a first area for sequentially storing classified unit data that can be processed independently;
Second area securing means for sequentially securing a second area necessary for a plurality of types of image processing to be executed for the unit data in the storage unit for each unit data;
Storage means for storing one unit data in the first area;
Image processing means for sequentially executing the plurality of types of image processing using the second area for the unit data stored in the first area;
When it is determined that the processing by the image processing unit has been completed for all the unit data, an opening unit that opens the first region and the second region;
An image processing apparatus comprising:
ことを特徴とする請求項2記載の画像処理装置。 The second area securing means compares the size of the second area that is already secured with the size of the second area that is necessary for the unit data to be processed, and When the size of the second area is smaller, the already secured size of the second area is used as it is, and when the required size of the second area is larger, the second area is used. Ensuring the size of the second region of sufficient size by opening and re-reserving,
The image processing apparatus according to claim 2.
ことを特徴とする請求項3記載の画像処理装置。 The second area securing means is already secured if the size of the second area required for the unit data to be processed is larger than the size of the second area already secured. Securing the size of the second area necessary for the unit data to be processed after partially releasing the second area.
The image processing apparatus according to claim 3.
ことを特徴とする請求項3または4記載の画像処理装置。 The second area securing means initializes only the part to be opened when partially releasing the second area that has already been secured,
The image processing apparatus according to claim 3, wherein the image processing apparatus is an image processing apparatus.
ことを特徴とする請求項1ないし5のいずれか一記載の画像処理装置。 The unit data is any one of a color component of image data, a divided region, a frequency band, and an effective bit plane.
The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus.
ことを特徴とする請求項1ないし5のいずれか一記載の画像処理装置。 The unit data is code string data according to any of color components, divided regions, frequency bands, and effective bit planes of image data.
The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus.
ことを特徴とする請求項1ないし7のいずれか一記載の画像処理装置。 The plurality of types of image processing for the unit data are compliant with JPEG2000 (IS154444-1) compression or decompression algorithm.
The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus.
前記単位データに対して実行する複数種類の画像処理に必要な第2の領域を記憶部に確保する第2領域確保機能と、
前記第1の領域に一の前記単位データを記憶する記憶機能と、
前記第1の領域に記憶された一の前記単位データに対して前記第2の領域を用いて前記複数種類の画像処理を順次実行する画像処理機能と、
全ての前記単位データに対して前記画像処理機能による処理が終了したと判断した場合には、前記第1の領域および前記第2の領域を開放する開放機能と、
をコンピュータに実行させることを特徴とするプログラム。 A first area securing function for securing a first area in the storage unit for sequentially storing classified unit data that can be processed independently;
A second area securing function for securing a second area necessary for a plurality of types of image processing to be executed for the unit data in a storage unit;
A storage function for storing one unit data in the first area;
An image processing function for sequentially executing the plurality of types of image processing using the second area for one unit data stored in the first area;
When it is determined that the processing by the image processing function has been completed for all the unit data, an opening function for opening the first area and the second area;
A program that causes a computer to execute.
前記単位データに対して実行する複数種類の画像処理に必要な第2の領域を前記単位データ毎に記憶部に順次確保する第2領域確保機能と、
前記第1の領域に一の前記単位データを記憶する記憶機能と、
前記第1の領域に記憶された一の前記単位データに対して前記第2の領域を用いて前記複数種類の画像処理を順次実行する画像処理機能と、
全ての前記単位データに対して前記画像処理機能による処理が終了したと判断した場合には、前記第1の領域および前記第2の領域を開放する開放機能と、
をコンピュータに実行させることを特徴とするプログラム。 A first area securing function for securing a first area in the storage unit for sequentially storing classified unit data that can be processed independently;
A second area securing function that sequentially secures a second area necessary for a plurality of types of image processing to be executed for the unit data in the storage unit for each unit data;
A storage function for storing one unit data in the first area;
An image processing function for sequentially executing the plurality of types of image processing using the second area for the unit data stored in the first area;
When it is determined that the processing by the image processing function has been completed for all the unit data, an opening function for opening the first area and the second area;
A program that causes a computer to execute.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2007111470A JP2008271193A (en) | 2007-04-20 | 2007-04-20 | Image processing apparatus and program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2007111470A JP2008271193A (en) | 2007-04-20 | 2007-04-20 | Image processing apparatus and program |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2008271193A true JP2008271193A (en) | 2008-11-06 |
Family
ID=40050110
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2007111470A Pending JP2008271193A (en) | 2007-04-20 | 2007-04-20 | Image processing apparatus and program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2008271193A (en) |
-
2007
- 2007-04-20 JP JP2007111470A patent/JP2008271193A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4111926B2 (en) | Image processing apparatus, program, storage medium, and image transmission method | |
| JP4293740B2 (en) | Image compression device | |
| JP3922919B2 (en) | Still image expansion apparatus and still image expansion method | |
| JP2004254298A (en) | Image processing apparatus, program, and storage medium | |
| JP3952459B2 (en) | Image processing apparatus, program, storage medium, and image processing method | |
| US20040217887A1 (en) | Image processing apparatus and image processing method, image processing system, image processing program and storage medium | |
| JP4688165B2 (en) | Image processing apparatus and image processing method | |
| JP2004221633A (en) | Image processing apparatus, image processing program, and storage medium | |
| JP4618676B2 (en) | Structured document code transfer method, image processing system, server device, program, and information recording medium | |
| JP2004214828A (en) | Image processing apparatus, image processing method, computer program for image processing, and storage medium storing computer program for image processing | |
| JP2007142614A (en) | Image processing apparatus, image processing method, program, and information recording medium | |
| JP4721262B2 (en) | Image processing apparatus, image processing method, program, and information recording medium | |
| JP2005092007A (en) | Image processing system, image processing method, program, and information recording medium | |
| JP4489474B2 (en) | Image processing apparatus, program, and recording medium | |
| JP2008271193A (en) | Image processing apparatus and program | |
| JP4726040B2 (en) | Encoding processing device, decoding processing device, encoding processing method, decoding processing method, program, and information recording medium | |
| JP4732251B2 (en) | Code conversion apparatus and program | |
| JP2006086579A (en) | Image processing apparatus, program, and storage medium | |
| JP3987425B2 (en) | Image decompression apparatus, program, storage medium, and image decompression method | |
| JP4374063B2 (en) | Image processing apparatus, program, and storage medium | |
| JP4093870B2 (en) | Image processing apparatus, program, and storage medium | |
| JP3961966B2 (en) | Unnecessary part removing apparatus, image processing apparatus, program, storage medium, and unnecessary part removing method | |
| JP4688164B2 (en) | Image processing apparatus, image processing method, program, and information recording medium | |
| JP2005223407A (en) | Image processing apparatus and program | |
| JP4520499B2 (en) | Image processing apparatus, image processing program, and storage medium |