JP2014165868A - Image processing device and control method therefor - Google Patents
Image processing device and control method therefor Download PDFInfo
- Publication number
- JP2014165868A JP2014165868A JP2013037691A JP2013037691A JP2014165868A JP 2014165868 A JP2014165868 A JP 2014165868A JP 2013037691 A JP2013037691 A JP 2013037691A JP 2013037691 A JP2013037691 A JP 2013037691A JP 2014165868 A JP2014165868 A JP 2014165868A
- Authority
- JP
- Japan
- Prior art keywords
- tile
- encoding
- filter
- jpeg
- image
- 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
- 238000000034 method Methods 0.000 title claims abstract description 177
- 238000012545 processing Methods 0.000 title claims abstract description 95
- 230000002427 irreversible effect Effects 0.000 claims abstract description 28
- 230000008569 process Effects 0.000 claims description 107
- 230000002441 reversible effect Effects 0.000 claims description 40
- 238000001914 filtration Methods 0.000 claims description 12
- 238000001514 detection method Methods 0.000 claims description 6
- 238000007906 compression Methods 0.000 description 34
- 230000006835 compression Effects 0.000 description 33
- 238000010586 diagram Methods 0.000 description 10
- 238000012217 deletion Methods 0.000 description 9
- 230000037430 deletion Effects 0.000 description 9
- 238000006243 chemical reaction Methods 0.000 description 6
- 230000008859 change Effects 0.000 description 5
- 238000013139 quantization Methods 0.000 description 5
- 230000003044 adaptive effect Effects 0.000 description 3
- 230000009466 transformation Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 239000003086 colorant Substances 0.000 description 2
- 238000003708 edge detection Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000009499 grossing Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000006866 deterioration Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 230000001771 impaired effect Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Abstract
Description
本発明は、画像データの符号化、復号技術に関するものである。 The present invention relates to image data encoding and decoding techniques.
従来より、画質の劣化を極力抑えつつ符号化後データを規定容量に収めたいという要求が多くある。たとえば、ページプリンタのような画像形成装置では、入力されたページ記述言語を画像データに変換し、その画像データを符号化して所定領域内に一時記憶するために、符号化後データの符号量を制御する必要がある。 Conventionally, there has been a demand for keeping encoded data within a specified capacity while suppressing deterioration of image quality as much as possible. For example, an image forming apparatus such as a page printer converts an input page description language into image data, encodes the image data, and temporarily stores it in a predetermined area. Need to control.
このような要求に対して、1枚の画像を可逆圧縮する領域、非可逆圧縮する領域に使い分け、非可逆圧縮する領域の画像について符号量制御を行う手法(特許文献1、2)が提案されている。この種の方式では、符号化後の目標となる符号量(目標符号量)を実現するために、非可逆圧縮データを大きく削除してしまうことがある。その結果として、可逆圧縮の領域と非可逆圧の領域で画質差が顕著になり、1画面全体として見ると、汚くなってしまう。この問題を緩和させるために、画像の復号後に、可逆圧縮の領域と非可逆圧縮の領域の境界に対して、デブロッキングフィルタと呼ばれるフィルタ処理を行う方法が考えられる。デブロッキングフィルタとは、JPEGなどの復号画像に生じるブロック歪みを低減させるフィルタで、ブロックの境界に適用する平滑化フィルタの一種である(特許文献3)。
In response to such a requirement, a method (
非可逆圧縮の中には、領域と領域における特定の境界の画素を、大きく歪ませてしまうタイプの方式がある。このため、デブロッキングフィルタをかけるにあたっては、フィルタで用いる各画素について、どの程度歪む可能性があるか(復号画素値の信頼度)に応じて、フィルタ係数を決めることが望ましい。しかし、従来のデブロッキングフィルタは、個々の復号画素の信頼度には着目せず、領域がどの程度歪んでいるか(具体的には圧縮条件等)を基にフィルタ係数を決めている。つまり、従来のデブロッキングフィルタを使うと、平滑化は達成できるが、信頼度の低い復号画素値の歪みを拡散させてしまうという問題があった。 In lossy compression, there is a type of method that greatly distorts pixels at a specific boundary between regions. For this reason, when applying a deblocking filter, it is desirable to determine a filter coefficient according to how much each pixel used in the filter may be distorted (reliability of decoded pixel value). However, the conventional deblocking filter does not pay attention to the reliability of each decoded pixel, and determines the filter coefficient based on how much the region is distorted (specifically, compression conditions and the like). That is, when a conventional deblocking filter is used, smoothing can be achieved, but there is a problem that distortion of a decoded pixel value with low reliability is diffused.
この課題を解決するため、例えば本明細書に開示する画像処理装置は以下の構成を有する。すなわち、
非可逆な第1の符号化手段で符号化された第1のタイプのタイルの符号化データと、前記第1の符号化手段とは異なる第2の符号化手段で符号化された第2のタイプのタイルの符号化データとが混在した符号化画像データを復号する画像処理装置であって、
各タイルの符号化データが、いずれの符号化手段による符号化データであるのかを識別する識別手段と、
該識別手段の識別結果に従い、各タイルの符号化データについて該当する種類の復号処理を実行することでタイル画像を生成する復号処理手段と、
前記識別手段による識別結果に基づき、前記復号処理手段による復号処理で得られたタイル画像で構成される画像中の、前記第1のタイプのタイルと前記第2のタイプのタイルとが隣接するタイル境界を検出する検出手段と、
該検出手段が検出した前記タイル境界を接する前記第1のタイプのタイル内の前記タイル境界に接する画素の値を、前記タイル境界を跨ぐサイズを有すると共に前記第1の符号化手段と前記第2の符号化手段の信頼度に応じた特性を有するフィルタを用いて、フィルタ処理するフィルタ処理手段とを有する。
In order to solve this problem, for example, an image processing apparatus disclosed in this specification has the following configuration. That is,
The encoded data of the first type tile encoded by the irreversible first encoding means, and the second encoded by the second encoding means different from the first encoding means An image processing apparatus that decodes encoded image data in which encoded data of a type tile is mixed,
Identifying means for identifying which encoded means the encoded data of each tile is encoded data;
A decoding processing means for generating a tile image by executing a corresponding type of decoding processing on the encoded data of each tile according to the identification result of the identification means;
A tile in which the first type tile and the second type tile are adjacent to each other in an image composed of tile images obtained by the decoding processing by the decoding processing unit based on the identification result by the identification unit. Detection means for detecting the boundary;
A value of a pixel that touches the tile boundary in the first type tile that touches the tile boundary detected by the detection means has a size across the tile boundary, and the first encoding means and the second Filter processing means for performing filter processing using a filter having characteristics according to the reliability of the encoding means.
本明細書によれば、少なくとも非可逆符号化方式を含む複数の符号化方式で生成されたタイル単位の符号化データが混在した符号化画像データを復号した際に、異なる符号化方式のタイルの境界における画質差を小さくし、自然な画像を生成することができる。 According to the present specification, when encoded image data in which encoded data in units of tiles generated by a plurality of encoding methods including at least an irreversible encoding method is decoded, tiles of different encoding methods are decoded. It is possible to reduce a difference in image quality at the boundary and generate a natural image.
以下、添付図面に従って本発明に係る実施形態を詳細に説明する。 Hereinafter, embodiments according to the present invention will be described in detail with reference to the accompanying drawings.
[第1の実施形態]
最初に、本実施形態で用いる符号化方式の概要、並びに、画質上の問題点を簡単に説明する。次いで、画質上の問題を克服するための従来技術(デブロッキングフィルタ)と、その課題,解決方法を説明する。
[First Embodiment]
First, an outline of the encoding method used in the present embodiment and problems with image quality will be briefly described. Next, a conventional technique (deblocking filter) for overcoming the problem of image quality, and its problem and solution will be described.
符号化方式には、文書画像での高圧縮性と符号量制御を実現するため、可逆符号化と符号量制御可能な非可逆符号化を適応的に使い分ける符号化(適応符号化)用いる。本実施形態においては、非可逆符号化(第1の符号化)として、国際標準符号化方式であるJPEG2000(ITU-T T.800 | ISO/IEC 15444-1)を用いる。また、可逆符号化(第2の符号化)として、国際標準符号化方式のJPEG-LS(ITU-T T.87 | ISO/IEC 14495-1)を用いる(第2の符号化)。また、符号量制御は、JPEG2000による符号化データにおけるビットプレーンの符号化データの削除によって実現するものとする。JPEG200では、ウェーブレット変換で得られた各変換係数の同一ビットで構成されるビットプレーン毎の符号化データを生成する。下位ビットほど画質に与える影響は小さいと言える。そこで、最下位ビット(ビット0)から上位に向かう、どのビット位置までのビットプレーンの符号化データを削除するかを決定することで、符号量制御を実現する。 For the encoding method, in order to realize high compressibility and code amount control in a document image, encoding (adaptive encoding) is used that adaptively uses lossless encoding and lossy encoding that can control the amount of code. In the present embodiment, JPEG2000 (ITU-T T.800 | ISO / IEC 15444-1), which is an international standard encoding method, is used as lossy encoding (first encoding). As lossless encoding (second encoding), JPEG-LS (ITU-T T.87 | ISO / IEC 14495-1) of the international standard encoding method is used (second encoding). The code amount control is realized by deleting the encoded data of the bit plane in the encoded data by JPEG2000. In JPEG200, encoded data for each bit plane composed of the same bits of each transform coefficient obtained by wavelet transform is generated. It can be said that the lower bits have less influence on image quality. Therefore, the code amount control is realized by determining to which bit position the encoded data of the bit plane from the least significant bit (bit 0) to the higher order is deleted.
この適応符号化方式では、文書等の画像が入力された後、画像を矩形(タイル)に分割する。その後で、各タイルは写真の特性を持つ領域(写真領域)か、網点や線画,テキスト,グラデーション等の写真以外の特性を持つ領域(写真領域以外)かを判定する。そして、写真領域のタイルには非可逆符号化方式、写真領域以外のタイルには可逆符号化方式を適用する(以下、前者のタイルを非可逆タイル、後者のタイルを可逆タイルと呼ぶ)。このような符号化方式に共通する画質上の問題が1つある。それは図14に示したように、画像中の写真領域と写真領域以外の境界を含むタイルは、写真領域と接しているため、しばしば非可逆符号化が適用される。この結果として、隣接する写真領域以外タイルでは可逆符号化が適用されているにもかかわらず、境界部分では非可逆符号化が適用され、画質差が生じてしまうことがある。特に、高圧縮にする場合には、その問題は顕著に現れる。 In this adaptive encoding method, after an image such as a document is input, the image is divided into rectangles (tiles). After that, each tile determines whether it is an area having the characteristics of a photograph (photo area) or an area having characteristics other than a photograph, such as halftone dots, line drawings, text, and gradation (other than the photograph area). Then, a lossy encoding method is applied to tiles in the photographic region, and a lossless encoding method is applied to tiles other than the photographic region (hereinafter, the former tile is referred to as an irreversible tile and the latter tile is referred to as a lossless tile). There is one problem in image quality common to such encoding methods. As shown in FIG. 14, a tile including a photographic region in the image and a boundary other than the photographic region is in contact with the photographic region, and therefore, lossy encoding is often applied. As a result, in spite of the fact that lossless encoding is applied to tiles other than adjacent photo areas, lossy encoding may be applied to the boundary portion, resulting in a difference in image quality. In particular, when high compression is used, the problem appears remarkably.
これに対して、可逆タイルと非可逆タイルの境界に対してデブロッキングフィルタをかけて、タイル間の画素値変化の連続性を高めることにより、画質差を緩和させる方法が考えられる。しかし、従来のデブロッキングフィルタには、信頼度の低い画素の存在を考慮しておらず、歪みを拡散させてしまうという課題がある。これは、単に、タイルの圧縮条件を基に、フィルタリングの方法を決めていたからである。この信頼度の低い画素に関する具体例として、JPEG2000の復号結果がある。これに関して、図15に示したとおり、タイルの右端の1列の画素(右端画素)と、下端の1行の画素(下端画素)が大きく歪むことがある(信頼度が低い)。この原因は、JPEG2000の復号過程における逆ウェーブレット(DWT)変換にある。これについて、JPEG2000でサポートする5x3変換と呼ばれるDWT変換を例に説明する。 On the other hand, a method of reducing the image quality difference by applying a deblocking filter to the boundary between the reversible tile and the irreversible tile to enhance the continuity of the pixel value change between the tiles can be considered. However, the conventional deblocking filter does not consider the existence of pixels with low reliability, and has a problem of diffusing distortion. This is simply because the filtering method is determined based on the tile compression condition. As a specific example of the pixel with low reliability, there is a JPEG2000 decoding result. In this regard, as shown in FIG. 15, the pixel at the right end of the tile (right end pixel) and the pixel at the bottom row (lower end pixel) may be greatly distorted (reliability is low). This is due to the inverse wavelet (DWT) transformation in the JPEG2000 decoding process. This will be described by taking DWT conversion called 5 × 3 conversion supported by JPEG2000 as an example.
JPEG2000の逆DWTは、エントロピー復号,逆量子化を経て生成されたDWT係数に対して処理を行う。DWT係数は2次元配列に格納されており、逆DWTは横方向,縦方向の順に処理を進め、各方向の処理では、低周波成分と高周波成分を使って逆変換を行う。5x3変換の逆変換は以下となる。
X(2n)=L(n)-Floor((H(n-1)+H(n)+2)/4)
X(2n+1)=H(n)+Floor((X(2n)+X(2n+2))/2)
ただし、X(n)は復号画素、L(n)は低周波成分、H(n)は高周波成分である。また、nは復号画素,低周波成分,高周波成分の位置を示すインデックスであり、Nをタイルの注目方向における画素数とした場合、0≦n<N/2である。なお、タイルサイズは偶数に設定されることが多く、以下の説明でもNは偶数であるとする。図16は、N=8として上記変換式の変換過程を示した図である。同図において、L(0),H(0),...,L(3),H(3)は逆量子化後のDWT係数であり、X(0), ..., X(7)は復号画素である。また、H(-1),X(8)があるが、これらは逆DWTを行うために仮想的に設定される値であり、H(-1)=H(0),X(8)=X(6)とされる。この変換過程において注目すべき点として、X(0),X(2),...など偶数インデックスの復号画素値については、低周波成分と高周波成分の寄与比率は、おおよそL:H=2:1である。一方で、X(1),X(3),...など奇数インデックスの復号画素値については、低周波成分と高周波成分の寄与比率は、おおよそL:H=2:3である。また、通常、符号化においては、低周波成分に比べて、高周波成分の方が視覚的に与える影響が小さいと言われており、より情報を削減する。このため、奇数インデックスの復号画素は、偶数インデックスに比べて歪みやすい。さらに、奇数インデックスに限定してDWT係数を見ると、タイル境界の復号画素(図16であればX(7))と、その画素以外で歪みの現れ方が異なる。すなわち、タイル境界以外の復号画素は、異なる2つの偶数インデックスの復号画素の和から生成される。一方、タイル境界の復号画素は、同一の偶数インデックスの復号画素の和から生成される。このことは、前者については、偶数インデックスの2つの復号画素で誤差(原画像における画素値との差)の正負が逆であれば、誤差量を相殺し合う。しかし、後者についてはそのようなことはなく、誤差量を増幅させる。したがって、奇数インデックスの境界画素は大きく歪む画素が発生しやすい、つまり信頼度が低いということになる。前述のとおり、DWT係数は2次元配列に格納されており、横方向については左端を0としてインデックスを割り振る。一方、縦方向については上端を0として、インデックスを割り振る。このため、タイル内の右端画素と下端画素の信頼度が低くなってしまう。
JPEG2000 inverse DWT performs processing on DWT coefficients generated through entropy decoding and inverse quantization. The DWT coefficients are stored in a two-dimensional array, and the inverse DWT is processed in the order of the horizontal direction and the vertical direction. In the processing in each direction, the inverse conversion is performed using the low frequency component and the high frequency component. The inverse transformation of 5x3 transformation is as follows.
X (2n) = L (n) -Floor ((H (n-1) + H (n) +2) / 4)
X (2n + 1) = H (n) + Floor ((X (2n) + X (2n + 2)) / 2)
However, X (n) is a decoded pixel, L (n) is a low frequency component, and H (n) is a high frequency component. N is an index indicating the position of the decoded pixel, the low frequency component, and the high frequency component. When N is the number of pixels in the target direction of the tile, 0 ≦ n <N / 2. The tile size is often set to an even number, and N is an even number in the following description. FIG. 16 is a diagram showing the conversion process of the above conversion formula when N = 8. In the figure, L (0), H (0), ..., L (3), H (3) are DWT coefficients after inverse quantization, and X (0), ..., X (7 ) Is a decoded pixel. H (-1) and X (8) are values that are virtually set to perform inverse DWT, and H (-1) = H (0), X (8) = X (6). It should be noted that in this conversion process, for even-numbered decoded pixel values such as X (0), X (2), ..., the contribution ratio of the low-frequency component and the high-frequency component is approximately L: H = 2 : 1. On the other hand, for odd-numbered decoded pixel values such as X (1), X (3),..., The contribution ratio between the low-frequency component and the high-frequency component is approximately L: H = 2: 3. In general, it is said that, in encoding, a high-frequency component has a smaller visual impact than a low-frequency component, and information is further reduced. For this reason, a decoded pixel with an odd index is more easily distorted than an even index. Further, when the DWT coefficients are limited to the odd index, the appearance of distortion is different between the decoded pixel at the tile boundary (X (7) in FIG. 16) and other pixels. That is, the decoded pixels other than the tile boundary are generated from the sum of two different even-numbered decoded pixels. On the other hand, the decoded pixels at the tile boundary are generated from the sum of the decoded pixels having the same even index. This means that the error amount is canceled out if the error (difference from the pixel value in the original image) is reversed between the two decoded pixels of even index. However, the latter is not the case, and the error amount is amplified. Therefore, the odd-indexed boundary pixel is likely to generate a highly distorted pixel, that is, the reliability is low. As described above, DWT coefficients are stored in a two-dimensional array, and an index is assigned with the left end set to 0 in the horizontal direction. On the other hand, in the vertical direction, the upper end is set to 0 and an index is assigned. For this reason, the reliability of the rightmost pixel and the lowermost pixel in the tile is lowered.
このように、JPEG2000では、特定の境界の画素の信頼度が低くなってしまうことが多く、従来のようなデブロッキングフィルタを用いては、歪みを拡散させてしまうことになる。そこで、本実施の形態においては、境界画素の信頼度に応じて、デブロッキングフィルタの係数を設定する方法を、解決策として提案する。なお、可逆タイルには歪みは生じないので、デブロッキングフィルタを可逆タイルの境界画素に適用すると、可逆性を損なうことになる。このため、可逆タイルにはデブロッキングフィルタを適用しない。 Thus, in JPEG2000, the reliability of pixels at a specific boundary is often lowered, and distortion is diffused using a conventional deblocking filter. Therefore, in the present embodiment, a method for setting the coefficient of the deblocking filter according to the reliability of the boundary pixel is proposed as a solution. In addition, since distortion does not arise in a reversible tile, if a deblocking filter is applied to the boundary pixel of a reversible tile, reversibility will be impaired. For this reason, a deblocking filter is not applied to a reversible tile.
本実施形態では、非圧縮画像データを保有しているサーバが、クライアントからの要求を受け付け、要求に応じた画像データをクライアントに返送するシステムを想定する。そして、本実施デーでは、そのサーバにおける符号化処理について説明する。クライアントからサーバに対する要求は、クライアントが取得したい画像と、受信できるデータサイズとする。そして、本実施形態では、クライアントが符号化された画像データを受け取った後、復号し、デブロッキングフィルタを行う処理についても説明する。 In this embodiment, a system is assumed in which a server that holds uncompressed image data receives a request from a client and returns image data corresponding to the request to the client. And this implementation data demonstrates the encoding process in the server. The request from the client to the server has an image that the client wants to acquire and a data size that can be received. In this embodiment, a process in which the client receives the encoded image data, decodes it, and performs a deblocking filter will also be described.
図1は、本実施形態におけるシステムを構成するサーバのブロック構成図である。CPU101は、システム全体の動作をコントロールし、一次記憶102に格納されたプログラムの実行などを行う。一次記憶102は、RAMで構成される主メモリであり、二次記憶103に記憶されたプログラムなどを読み込んで格納する。二次記憶103は例えば、ハードディスクなどの記憶媒体がこれに該当する。一般に一次記憶の容量は二次記憶の容量より小さく、一次記憶に格納しきれないプログラムコードやデータなどは二次記憶に格納される。また、長時間記憶しなければならないデータなども二次記憶に格納される。本実施形態では、プログラムを二次記憶103に格納し、プログラム実行時に一次記憶102に読み込んでCPU101が実行処理を行う。入力デバイス104とは、例えば、マウスやキーボードなどがこれに該当する。プログラムなどに割り込み信号を送ったりするために用いる。出力デバイス105とは例えば、モニタやプリンタなどが考えられる。この装置の構成方法は他にも様々な形態が考えられるが、本発明の主眼ではないので説明を省略する。ネットワークI/F106は、ネットワークと通信するためのインタフェースであって、有線、無線を問わない。
FIG. 1 is a block diagram of a server constituting the system according to the present embodiment. The
図2は、本実施形態を実現するシステムの概略の一例を示した図である。図示における符号201,202はクライアントを表している。クライアント201、またはクライアント202のように、複数のユーザが、有線、無線を問わず、ネットワーク203によってサーバ204と通信することが可能である。クライアント201,202は、PCや、タブレット端末、携帯端末、プリンタなどであって、通信機能を有し、画像を出力できる装置である。サーバ204は図1に示す構成を有し、且つ、画像ファイルを蓄積する大容量の記憶装置205を持っている。大容量の記憶装置205はたとえば、ハードディスクなどがこれに該当する。このハードディスクには、テキストや線画、自然画などを含む非圧縮画像データが数多く格納されている。クライアント201、202は画像データとその圧縮データサイズの上限値をサーバに要求する。圧縮データの上限値は、ネットワークの状況やクライアントのメモリ容量などから算出される値である。サーバ204は、クライアント201、202が指定した画像データを指定された上限値以下のファイルサイズになるように圧縮し、その圧縮データをクライアント201、202に返送する。クライアント201、202は、受信した圧縮データを復号する。
FIG. 2 is a diagram illustrating an example of an outline of a system that realizes the present embodiment.
まず、サーバ204の動作をより詳しく述べる。サーバ204は、クライアント201、202が指定した画像データ(ファイル名等を指定するものとする)を、タイルに分割し、各タイルの特徴に応じて、可逆圧縮または非可逆圧縮を選択し、符号化する。本実施形態では、タイルのサイズは128x128[pixel]とする。また、可逆圧縮として文字や線画の圧縮を得意とするJPEG-LS符号化方式を、非可逆圧縮として自然画の圧縮を得意とするJPEG 2000符号化方式を用いる。したがって、タイルが文字や線画を多く含んでいればJPEG-LS方式が選択され、自然画を多く含んでいればJPEG2000方式が選択される。全てのタイルを符号化し終えた後、JPEG2000で圧縮されたタイル(JPEG2000タイル)の符号量を、タイル間で差をつけずに、JPEG-LSで圧縮されたタイル(JPEG-LSタイル)との画質差を許容範囲以内に保ち削除する。削除した結果、指定された符号量以下であれば、そのデータをクライアントに返送する。JPEG-LSタイルとの画質差を許容範囲以内に保つことができないほどJPEG2000タイルのデータを削除する必要がある場合には、超過している符号量と可逆圧縮領域と非可逆圧縮領域の分布から、符号量制御の方法を変える。
First, the operation of the
また、タイルの符号化する順序は、タイルを単位とするラスタースキャン順、すなわち、左端タイルから右端タイル、右端タイルに到達した場合には1つ下方向の左端タイルから右端タイル、…の順に符号化していくものとする。 Also, the order of encoding the tiles is the raster scan order in units of tiles, that is, when the leftmost tile reaches the rightmost tile, and when reaching the rightmost tile, the leftmost tile in the downward direction is followed by the rightmost tile. It will become.
このようなサーバ204の動作について、図3を用いて、さらに詳しく説明する。同図は、サーバ204におけるCPU201が実行するアプリケーションプログラムの手順を示している。なお、以下の処理は、クライアント201から、画像要求を受信した場合の処理である。クライアントからの画像要求には、その画像を特定する情報(例えばファイル名やインデックス番号)と、データの上限値が含まれるものとする。
The operation of the
ステップS301では、クライアント201(又は202)から指示された画像を、記憶装置205から取得する。この画像は、非圧縮状態の画像である。本実施形態では、色空間がRGBであり、各コンポーネントのビット精度が8[bit/channel]、画像サイズが7040x4992[pixel]の画像とする。つまり、圧縮前の画像はおよそ100[MB]である。ステップS302では、ステップS301で取得した画像を圧縮した結果の上限符号量D_maxを取得する。これは、クライアントから指定される圧縮データの上限値である。本実施形態では、クライアントのメモリ容量から14[MB]が指定されたものとする。ステップS303では、ステップS301で取得した画像をタイルに分割し、そのタイル総数Tsumを算出する。本実施形態のタイルサイズは128x128[pixel]であるので、Tsum = (7040/128)x(4992/128) = 55x39 = 2145タイル数となる。ステップS305では、タイル番号用のカウンタTにゼロを代入して初期化する。
In step S301, an image designated by the client 201 (or 202) is acquired from the
以下、ステップS305〜S310で、タイル毎にJPEG-LSとJPEG2000を切り替えて符号化する。ステップS305では、着目タイルTの符号化方式を決定する。符号化方式の決定は、タイルTに文字や線画が多く含まれる場合には、JPEG-LS符号化方式を選択し、そうでない場合には、JPEG 2000符号化方式を選択する。タイルTに文字や線画が多く含まれるか否かについては、タイルTを解析して、様々な特徴量から推定できる。たとえば、色数が少ない場合には、文字や線画と判断し、色数が多い場合には自然画が多いと判断する。あるいは、エッジ検出を行い、エッジが多ければ文字や線画が多いと判断し、そうでなければ自然画が多いと判断する。他にも様々な方法が考えられるが、本提案の主眼ではないため、詳細な説明は割愛する。本実施形態では、着目タイル内でエッジ検出を行ない、エッジと判定された画素数が所定の閾値より多い場合には、文字・線画が多く含まれるとしてJPEG-LS符号化を、そうでなければ、JPEG2000符号化を選択するものとする。
Thereafter, in steps S305 to S310, encoding is performed by switching between JPEG-LS and JPEG2000 for each tile. In step S305, the encoding method of the target tile T is determined. The encoding method is determined by selecting the JPEG-LS encoding method when the tile T includes many characters and line drawings, and selecting the
ステップS306では、ステップS305の決定により、着目タイルTの圧縮方式が可逆圧縮符号化かどうかを判断する。着目タイルTの符号化方式がJPEG-LS符号化方式、つまり可逆圧縮方式であれば、ステップS307へ進む。そうでなければ、ステップS308へ進む。ステップS307では、着目タイルTをJPEG-LS符号化方式で圧縮する。ステップS308ではタイルTをJPEG2000符号化方式で圧縮する。圧縮処理(符号化処理)の結果、生成された着目タイルの符号化データは、一次記憶装置102に格納されるものとするが、格納先は二次記憶装置103でも構わない。ステップS309ではタイル番号Tを1つインクリメントする。ステップS310では、タイル番号TがステップS303で算出したタイル総数Tsumと比較する。TとTsumが同じであれば、すべてのタイルについて一通り符号化し終えたと判断し、ステップS311へ進む。両者の値が異なる場合は、まだ、符号化し終えていないタイルがあると判断し、ステップS304へ処理を戻す。
In step S306, based on the determination in step S305, it is determined whether or not the compression method of the tile of interest T is lossless compression encoding. If the encoding method of the target tile T is the JPEG-LS encoding method, that is, the lossless compression method, the process proceeds to step S307. Otherwise, the process proceeds to step S308. In step S307, the tile of interest T is compressed using the JPEG-LS encoding method. In step S308, the tile T is compressed using the JPEG2000 encoding method. The encoded data of the tile of interest generated as a result of the compression process (encoding process) is stored in the
ステップS311では、これまでに生成された符号量の合計値(ファイルサイズ)が、ステップS302で取得した上限符号量D_max以下になるように符号量制御を行う。そして最後に、ステップS312で符号列の生成を行う。符号列は、図6に示したとおり、ヘッダ、JPEG2000符号列、JPEG-LS符号列から構成される。ヘッダには、画像の縦横サイズ、タイルサイズ、各タイルがJPEG2000/JPEG-LSのいずれで圧縮されたかを示すフラグ情報、JPEG2000/JPEG-LSの各符号列長、並びに、符号化パラメータ(後述するJPEG2000符号化データにおける削除したビットプレーン数など)が記述される。JPEG2000符号列は、JPEG-LSが選択されたタイルについては符号が発生しなかったものとして生成される。例えば、図7において、領域801,804はJPEG2000で圧縮され、領域802と803はJPEG-LSで圧縮されたとする。その場合には、802と803のタイルについてはJPEG2000の符号が発生しなかったものとして、JPEG2000の符号列を生成する。JPEG-LS符号列も同様な構成を取る。このようにして符号列が生成されると、クライアント201もしくは202へ符号列は送信される。
In step S311, the code amount control is performed so that the total value (file size) of the code amounts generated thus far is equal to or less than the upper limit code amount D_max acquired in step S302. Finally, a code string is generated in step S312. As shown in FIG. 6, the code string is composed of a header, a JPEG2000 code string, and a JPEG-LS code string. In the header, the vertical and horizontal sizes of the image, the tile size, flag information indicating whether each tile is compressed by JPEG2000 / JPEG-LS, each JPEG2000 / JPEG-LS code string length, and encoding parameters (described later) The number of deleted bit planes in JPEG2000 encoded data) is described. The JPEG2000 code string is generated as if no code was generated for tiles for which JPEG-LS was selected. For example, in FIG. 7, it is assumed that
次に、ステップS311の符号量制御処理について、図4を用いて説明する。ステップS501では、可逆圧縮データのデータサイズD_lsを取得する。これは、図3のステップS307でJPEG-LS圧縮されたタイルの圧縮データの総和から簡単に算出できる。本実施形態では、D_ls = 1.26[MB]であるとする。ステップS502では、可逆圧縮タイルと非可逆圧縮タイルの画質差があらかじめ決められた許容範囲以内になる、削除可能な最大ビットプレーン枚数Cを取得する。この削除可能な最大ビットプレーン数Cは、非圧縮画像の色空間やビット精度、JPEG2000符号化の圧縮パラメータなどによって決まる値である。それぞれの状態における削除可能な最大ビットプレーン枚数Cは、あるサンプル画像を用いた実験や統計に基づいて、JPEG-LSタイルとJPEG2000タイルの画質差が許容できる範囲になる値を予め決めておく。本実施形態では、削除可能な最大2ビットプレーン(ビット0、1のプレーン)まで削除しても、JPEG-LSタイルとJPEG2000タイルの画質差が許容範囲以内におさまるものとする。
Next, the code amount control process in step S311 will be described with reference to FIG. In step S501, the data size D_ls of the lossless compressed data is acquired. This can be easily calculated from the sum of the compressed data of the tiles JPEG-LS compressed in step S307 of FIG. In the present embodiment, it is assumed that D_ls = 1.26 [MB]. In step S502, the maximum number of bit planes C that can be deleted is acquired so that the difference in image quality between the lossless compression tile and the lossy compression tile is within a predetermined allowable range. The maximum number C of bit planes that can be deleted is a value determined by the color space and bit accuracy of an uncompressed image, the compression parameter of JPEG2000 encoding, and the like. The maximum number of bit planes C that can be deleted in each state is determined in advance based on experiments and statistics using a certain sample image so that the image quality difference between the JPEG-LS tile and the JPEG2000 tile is acceptable. In the present embodiment, it is assumed that the difference in image quality between the JPEG-LS tile and the JPEG2000 tile falls within an allowable range even if the
ステップS503では、ステップS502で取得したビットプレーン枚数Cを、すべてのJPEG2000タイルの符号データから削除したと仮定した場合のJPEG2000符号量D_cを算出する。本実施形態では、D_c = 12.9[MB]であったとする。JPEG2000符号量を正確に算出するためには、JPEG2000のメインヘッダおよびJPEG20000のタイルヘッダ、各パケットの符号量を算出する必要がある。各パケットの符号量は、パケットに含まれるビットプレーン(コーディングパス)のデータと、そこから算出されるパケットヘッダの合計となる。指定のビットプレーン数を削除した結果のJPEG2000符号量の算出方法は周知の方法であるため、ここでの詳しい説明は割愛する。ステップS504では、ステップS501とステップS503から算出された符号量の合計(D_ls+D_c)が、ステップS302で取得した上限符号量D_maxより小さいかどうかを判断する。
D_ls+D_c<D_max
を満たせば、画像全体の符号量が上限符号量D_max 以下になるまで、JPEG2000タイルのビットプレーンを削除しても、JPEG-LSタイルとJPEG2000タイルの画質差が許容できる範囲以内であるといえる。その場合、ステップS507へ進む。
In step S503, the JPEG2000 code amount D_c is calculated when it is assumed that the number C of bit planes acquired in step S502 is deleted from the code data of all JPEG2000 tiles. In this embodiment, it is assumed that D_c = 12.9 [MB]. In order to accurately calculate the JPEG2000 code amount, it is necessary to calculate the JPEG2000 main header, the JPEG 20000 tile header, and the code amount of each packet. The code amount of each packet is the sum of the bit plane (coding path) data included in the packet and the packet header calculated therefrom. Since the calculation method of the JPEG2000 code amount as a result of deleting the designated number of bit planes is a well-known method, a detailed description thereof is omitted here. In step S504, it is determined whether the total code amount (D_ls + D_c) calculated from step S501 and step S503 is smaller than the upper limit code amount D_max acquired in step S302.
D_ls + D_c <D_max
If this is satisfied, it can be said that even if the bit plane of the JPEG2000 tile is deleted until the code amount of the entire image is equal to or less than the upper limit code amount D_max, the difference in image quality between the JPEG-LS tile and the JPEG2000 tile is within an allowable range. In that case, the process proceeds to step S507.
また、 D_ls+D_c≧D_maxであると判断された場合、仮に、画像全体の符号量が上限符号量D_max 以下になるまで、JPEG2000タイルのビットプレーンを削除してしまうと、JPEG-LSタイルとJPEG2000タイルの画質差が許容できる範囲を越えてしまう。つまり、タイル境界の歪みが目立ってしまう。そこで、この場合には、ステップS505へ進む。本実施形態の場合、(D_ls + D_c) = 1.26 + 12.9 = 14.16[MB] > D_max = 14[MB]であるので、ステップS505へ進むことになる。ステップS505では、全てのJPEG-LSタイルをJPEG2000で再符号化しなおす。この再符号化の方法については、後に詳しく述べる。ステップS506では、可逆圧縮データのデータサイズD_lsをゼロにする。 If it is determined that D_ls + D_c ≧ D_max, if the bit plane of the JPEG2000 tile is deleted until the code amount of the entire image is equal to or less than the upper limit code amount D_max, the JPEG-LS tile and the JPEG2000 The difference in image quality of tiles exceeds the allowable range. That is, the tile boundary distortion becomes conspicuous. Therefore, in this case, the process proceeds to step S505. In the case of the present embodiment, (D_ls + D_c) = 1.26 + 12.9 = 14.16 [MB]> D_max = 14 [MB], so the process proceeds to step S505. In step S505, all JPEG-LS tiles are re-encoded with JPEG2000. This re-encoding method will be described in detail later. In step S506, the data size D_ls of the lossless compressed data is set to zero.
ステップS507では、非可逆圧縮領域の上限符号量D_j2kを算出する。これは、上限符号量D_maxから可逆圧縮領域のデータ量D_lsを引き算することで得られる。ステップS508では、JPEG2000の符号量を、ステップS507で算出した符号量D_j2k以下になるように、全てのJPEG2000タイルのデータを一様に削除する。このステップS508の処理を簡単に述べると次の通りである。例えば、ビットプレーンの削除無しで、総符号量がD_max以下の場合には、削除処理は不要である。また、非可逆符号化された全タイルのビット0プレーンを削除して、初めてD_ls+D_c<D_maxを満たす場合には、非可逆符号化された全タイルのビット0のプレーンの符号化データを削除する。そして、また、非可逆符号化された全タイルのビット0、ビット1のプレーンを削除して、初めてD_ls+D_c<D_maxを満たす場合には、非可逆符号化された全タイルのビット0、1のプレーンの符号化データを削除する。
In step S507, the upper limit code amount D_j2k of the lossy compression area is calculated. This is obtained by subtracting the data amount D_ls of the lossless compression area from the upper limit code amount D_max. In step S508, all JPEG2000 tile data are uniformly deleted so that the JPEG2000 code amount is equal to or less than the code amount D_j2k calculated in step S507. The process of step S508 will be briefly described as follows. For example, when the bit plane is not deleted and the total code amount is equal to or less than D_max, the deletion process is not necessary. Also, when the
次に、ステップS505における、JPEG-LSタイル再符号化について図5を用いて説明する。ステップS701では、タイル番号のカウンタTにゼロを代入して初期化する。ステップS702では、タイルTが可逆符号化されているか否か、すなわち、JPEG-LS符号化で圧縮されているかどうかを判断する。JPEG-LS圧縮されていれば、再符号化対象となり、ステップS703へ進む。そうでなければ、再符号化の必要のないタイルと判断し、ステップS705へ進む。ステップS703では、タイルTのJPEG-LS符号データを伸張(復号)する。JPEG-LS符号化は可逆圧縮であるため、伸張されたデータは符号化前の画像データと一致する。ステップS704では、ステップS703で伸張されたタイルTをJPEG2000符号化で圧縮しなおす。ステップS705では、タイル番号Tを一つインクリメントする。ステップS706では、タイル番号TとステップS303で算出したタイル総数Tsumとを比較する。異なる値であれば、まだ、再符号化の必要なタイルがある可能性があるので、処理をステップS702へ戻す。同じであれば、全てのタイルについて、再符号化が終了したものと判断する。 Next, JPEG-LS tile re-encoding in step S505 will be described with reference to FIG. In step S701, the tile number counter T is initialized by substituting zero. In step S702, it is determined whether or not the tile T is losslessly encoded, that is, whether or not it is compressed by JPEG-LS encoding. If it is JPEG-LS compressed, it becomes a re-encoding target, and the process proceeds to step S703. Otherwise, it is determined that the tile does not need re-encoding, and the process proceeds to step S705. In step S703, the JPEG-LS code data of the tile T is expanded (decoded). Since JPEG-LS encoding is lossless compression, the decompressed data matches the image data before encoding. In step S704, the tile T expanded in step S703 is compressed again with JPEG2000 encoding. In step S705, the tile number T is incremented by one. In step S706, the tile number T is compared with the tile total number Tsum calculated in step S303. If it is a different value, there may still be a tile that needs to be re-encoded, and therefore the process returns to step S702. If they are the same, it is determined that re-encoding has been completed for all tiles.
なお、ステップS505を経て、ステップS508に処理が進んだ場合、全タイルが非可逆符号化されたことになり、可逆符号化されたタイルは存在しないことになる。つまり、可逆符号化されたタイルと、非可逆符号化されたタイルの境界における歪みの問題は発生しない。そのため、全タイルが非可逆符号化された場合には、上記の削除許容ビットプレーン数Cに無関係に、上限値D_max以下となるまでビット0から上位ビットまでのビットプレーンの符号化データを削除する。
If the process proceeds to step S508 via step S505, all tiles are lossy-encoded, and there are no losslessly encoded tiles. That is, the problem of distortion at the boundary between the lossless encoded tile and the lossy encoded tile does not occur. For this reason, when all tiles are lossy encoded, the encoded data of bit planes from
以上の説明のように、実施形態におけるサーバ204は、可逆符号化(実施形態ではJPEG-LS)されたタイルと非可逆符号化(実施形態ではJPEG2000)されたタイルの符号化データを混在させた符号化画像データを生成することができる。しかも、削除許容範囲を示す削除ビットプレーン数C以下のビットプレーンの符号化データを削除することで、目標符号量(上限符号量D_max)以下の符号化データを生成する。しかし、複数の種類の符号化データが混在する場合、あくまでタイル境界における歪みを低減できるものの、歪みを完全に抑制することを保証するものではないし、画像によっては削除ビットプレーン数が“2”でも、タイル境界に歪みが発生し得る。そこで、本実施形態では、クライアント201(もしくは202)は、上記の符号化データを受信し、復号する場合に、タイルの境界における歪みの発生を更に抑制する復号処理を行なうこととした。
As described above, the
以下、クライアント201(もしくは202)における復号処理を説明する。この復号処理は、クライアント201における二次記憶装置103に格納されたアプリケーションプログラムが、一次記憶102にロードされ、CPU101が実行することで行われる。そして、復号処理では、各タイルの符号化データを、それに適用された符号化方式に応じて復号していく。その過程で、復号済みのタイルに対して、画像処理を加える。この処理では、図10に示したとおり、水平右方向をX方向、垂直下方向をY方向と定義する。その上で、X方向にa番目、Y方向にb番目の着目タイルT(a,b)の復号が終了した後、真上のT(a,b-1)が可逆タイル,非可逆タイルのいずれであるかを判定する。もし、タイルT(a,b-1)は非可逆タイルであれば、T(a,b-1)から見て右方向,下方向の隣接タイル、つまりT(a+1,b-1),T(a,b)の符号化方式を判定する。もし、いずれかが可逆タイルである場合、非可逆タイルT(a,b-1)と、可逆として判定された右隣又は下隣のタイルとの境界付近には、写真領域以外があると判断する。そして、同一の写真領域以外に生じている画質差を緩和させるため、該当する境界にデブロッキングフィルタをかける。なお、左方向と上方向をデブロッキングフィルタの対象外とする理由は、本実施形態の冒頭で説明したとおり、JPEG2000が適用されたタイルの直の、左端画素や上端画素は、右端画素や下端画素に比べて、信頼度が高いからである。なお、X方向のタイル数をNum_T_xとした場合、デブロッキングフィルタをかけるために、復号済みのタイルをNum_T_x+1個バッファリングしておく必要がある。
Hereinafter, decryption processing in the client 201 (or 202) will be described. This decryption processing is performed by loading an application program stored in the
図8(a)は、本実施形態におけるクライアント201(クライアント202も同様)のブロック構成図である。同図における各処理ブロック801乃至806は図1と概略同様であるので、説明は割愛する。 FIG. 8A is a block diagram of the client 201 (same for the client 202) in this embodiment. Since the processing blocks 801 to 806 in the figure are substantially the same as those in FIG. 1, the description thereof is omitted.
図9は本実施形態におけるクライアント201(又は202)における復号処理のフローチャートである。この処理は、サーバ204に、画像要求(画像を特定する情報と、データ量の上限値を含む)を送信した結果、サーバ204が要求された範囲内の符号化データを送信してきた場合の、CPU801が実行する復号処理に係るアプリケーションプログラムでもある。なお、二次記憶装置に一旦記憶した符号化画像データを復号する場合にも実行する。
FIG. 9 is a flowchart of decryption processing in the client 201 (or 202) in this embodiment. This process is performed when the
ステップS901では、CPU801は、受信した符号列を一次記憶装置802格納する。ステップS902では、符号列のヘッダを解析し、画像に関する情報,符号化に関する情報を取得する。具体的には、符号化された画像の縦横(水平、垂直)方向のサイズ、タイルサイズ、縦横方向のタイル数、各タイルがJPEG2000/JPEG-LSのいずれで圧縮されたかを示すフラグ情報、JPEG2000/JPEG-LSの各符号列長、削除ビットプレーン数などの情報を取得する。ステップS903では、符号化された画像の縦横サイズとタイルサイズの情報から、タイルの総数Tsumを算出する。ステップS904では、タイルカウンタTの初期化を行う。具体的には、タイル番号用のカウンタTにゼロを代入して初期化する。ステップS905では、ステップS902で得たヘッダの情報から、着目タイルTの符号化方式を確認し、ステップS906で可逆,非可逆のいずれであるかを識別する。この識別結果、タイルTが可逆の符号化方式で符号化されていると判定された場合には、ステップS907でJPEG-LSの復号を行い、復号結果(タイル画像)を一次記憶装置102に確保されたバッファへ格納する。さらに、各タイルが、いずれの符号化方式が適用されたかを示す符号化方式マップを更新する。具体的には、符号化方式マップに、注目タイルTはJPEG-LSで符号化されていたことを示すフラグ“0”を記述する。一方で、タイルTの符号化方式がJPEG2000であると判定された場合、ステップS908でJPEG2000の復号を行い、復号結果をバッファへ格納する。さらに、符号化方式マップに、注目タイルはJPEG2000で符号化されていたことを示すフラグ“1”を記述する。JPEG-LS,JPEG2000いずれの復号方法も、公知技術であるので、ここでは説明を割愛する。次に、ステップS909において画像処理を行う。この画像処理は、ステップS907もしくはステップS908で復号されたタイルから見て、上に位置するタイルを対象とする。なお、着目タイルが、画像の上辺に接するタイルである場合、処理対象のタイルは存在しないので、S909の処理は行なわない。また、図10で示したとおり、着目タイルTがタイルT(a,b)としたとき、画像処理対象のタイルはT(a,b-1)である。そして、この画像処理では、その画像処理対象のタイルT(a,b-1)、並びに隣接するタイルT(a,b)、T(a+1,b-1)それぞれに適用された符号化方式に基づいて、デブロッキングフィルタを行う。詳細については後述する。ステップS910では、ステップS909の画像処理の対象となったタイルを外部へ出力する。これは、以降の処理で該当のタイルは不要であるからである。次いで、ステップS911でタイルのカウンタTをインクリメントして、ステップS912でTsumとの大きさを比較する。もし、T<Tsumであれば、未復号のタイルがあるので処理をステップS905へ戻す。もし、T=Tsumであれば、ステップS913へ処理を進める。
In step S901, the
ステップS913の処理に入る時点で、図11に示した最終行のタイルの画像処理が未完了である。そのため、ステップS913以降では、最終行のタイルの画像処理を行う。ステップS913では、タイルカウンタT’の初期化を行う。すなわち、最終行の先頭タイルの番号T'を、T'=Tsum-Num_T_xとして算出する。ここで、Num_T_xは、水平方向に並ぶタイル数である。 At the time of entering the processing of step S913, the image processing of the tiles in the last row shown in FIG. 11 is incomplete. For this reason, in step S913 and subsequent steps, image processing of the tiles in the last row is performed. In step S913, the tile counter T 'is initialized. That is, the number T ′ of the first tile in the last row is calculated as T ′ = Tsum-Num_T_x. Here, Num_T_x is the number of tiles arranged in the horizontal direction.
ステップS914では、タイルT’に対して画像処理を行う。この処理については、ステップS909と同じであり、後程説明をする。ステップS915で画像処理が済んだタイルを外部へ出力し、ステップS916でタイルカウンタT’をインクリメントする。そして、ステップS917でTsumとの大きさを比較する。もし、T’<Tsumであれば、未復号のタイルがあるので処理をステップS914へ戻す。もし、T’<Tsumでなければ、全ての処理を終える。 In step S914, image processing is performed on the tile T '. This process is the same as step S909, and will be described later. The tile that has undergone image processing in step S915 is output to the outside, and the tile counter T 'is incremented in step S916. In step S917, the size is compared with Tsum. If T ′ <Tsum, there is an undecoded tile, and the process returns to step S914. If T ′ <Tsum is not satisfied, all the processes are finished.
次に、ステップS909,S914の画像処理について、図12のフローチャートを用いて説明する。なお、これまでの説明では、タイルTを着目タイルとしたのに対し、図12における画像処理では、タイルTの真上のタイルが画像処理対象となる点に注意されたい。すなわち、画像処理対象では、タイルTの真上のタイルを着目タイルとして説明することに注意されたい。この様にする理由は、着目タイルの右隣のタイル、及び、下隣のタイルの復号処理が終えている必要があるからである。 Next, the image processing in steps S909 and S914 will be described using the flowchart of FIG. In the description so far, the tile T is the target tile, but it should be noted that in the image processing in FIG. 12, the tile immediately above the tile T is an image processing target. That is, in the image processing target, it should be noted that the tile directly above the tile T is described as the target tile. The reason for this is that it is necessary to finish the decoding process for the tile on the right side of the tile of interest and the tile on the lower side.
ステップS1201で、符号化方式マップを参考に、着目タイルは非可逆タイルかどうかを判断する。もし、非可逆タイルではない、すなわち、可逆タイルである場合には、デブロッキングフィルタは不要であるので、処理を終える。もし、着目タイルは非可逆タイルであれば、ステップS1202に処理を進める。 In step S1201, with reference to the encoding method map, it is determined whether the target tile is an irreversible tile. If it is not a non-reversible tile, that is, if it is a reversible tile, the deblocking filter is unnecessary, and the processing is terminated. If the target tile is an irreversible tile, the process proceeds to step S1202.
ステップS1202では、削除ビットプレーン数が“2”以上であるか否かを判定する。可逆符号化タイルと、非可逆符号化タイルが混在する場合、上記実施形態のサーバ204は、非可逆符号化データから最大2つのビットプレーンの符号化データを削除する。これは、可逆符号化データと非可逆符号化データが混在した際のタイルの境界にてひづみの発生を抑制するためである。削除ビットプレーン数が2より少ない場合、すなわち、削除無し、又は、ビット0のプレーンの符号化データを削除した場合、タイル間に歪みが発生しないものとし、本処理を終える。しかし、削除ビットプレーン数が2の場合には、歪みが発生する確立は少ないが、それを保証するものではない。そこで、削除ビットプレーン数が2以上の場合には、ステップS1203以降の処理にて、係る歪みの発生の抑制を復号処理にて行なうものとした。
In step S1202, it is determined whether the number of deleted bit planes is “2” or more. When the lossless encoding tile and the lossy encoding tile coexist, the
ステップS1203では、符号化方式マップを基に着目タイルの右隣のタイルの符号化方式が可逆符号化であるか否かを判定する。右隣のタイルが可逆符号化されていると判定した場合、処理をステップS1204に進める。このステップS1204では、着目タイル内の、右隣のタイルとの境界に位置する画素(実施形態では、1タイルのサイズを128×128画素としているので、垂直方に並ぶ128画素)を補正するための、デブロッキングフィルタを行う。これは、図13に示したとおりで、非可逆タイルの境界画素毎にかけるフィルタである。そして、注目の境界画素に対して、左右1画素ずつ用いて処理する。デブロッキングフィルタとしては、FIRを用いて、フィルタリング対象の画素に対して最も重みづけを行う場合が多い。しかし、本実施形態では、着目境界画素の信頼度は低いので、右隣りの可逆タイルの境界画素と同じ重みづけを行うものとする。非可逆タイルの境界画素(つまり注目画素)をp0、左隣の画素をp1、右隣りの画素(つまり可逆タイルの境界画素)をq0とした場合、p0'=(1/5)*p1+(2/5)*p0+(2/5)*q0の演算を行う。そして、画素値P0を、この算出で得られた画素値P0'で置き換える。なお、p1,q0共にフィルタリング対象の画素の隣接であるが、且つ、q0の重み係数をp1のそれよりも大きな値にしているのでは、p1は非可逆符号化データから生成された値であるのに対し、q0は可逆符号化データから得られた値であって信頼性がP1より高いからである。ステップS1204を終え、ステップS1205に処理が進むと、今度は着目タイルの下隣のタイルの符号化方式が可逆符号化であるか否かを判定する。下隣のタイルが、可逆符号化されていると判定した場合、着目タイル内の、下隣のタイルとの境界に位置する画素(実施形態では、128画素)を補正するための、デブロッキングフィルタを行う。この処理はステップS1204と比べて、デブロッキングフィルタの適用方向が水平か垂直か、用いるタイルが右方向か下方向かの差だけであり、同じ処理を行う。このため、説明を割愛する。ステップS1206を終えると、画像処理を終える。 In step S1203, it is determined based on the encoding method map whether or not the encoding method of the tile on the right of the tile of interest is lossless encoding. If it is determined that the tile on the right is lossless encoded, the process advances to step S1204. In this step S1204, in order to correct the pixel located at the boundary with the tile on the right in the tile of interest (in the embodiment, since the size of one tile is 128 × 128 pixels, 128 pixels arranged in the vertical direction) The deblocking filter is performed. This is a filter applied to each boundary pixel of the irreversible tile as shown in FIG. Then, processing is performed using the left and right pixels for the target boundary pixel. As a deblocking filter, FIR is most often used to weight the pixel to be filtered. However, in this embodiment, since the reliability of the target boundary pixel is low, the same weighting as that of the boundary pixel of the right-side reversible tile is performed. P0 '= (1/5) * p1 + () where the boundary pixel of the non-reversible tile (that is, the pixel of interest) is p0, the left adjacent pixel is p1, and the right adjacent pixel (that is, the boundary pixel of the reversible tile) is q0. 2/5) * p0 + (2/5) * q0 is calculated. Then, the pixel value P0 is replaced with the pixel value P0 ′ obtained by this calculation. Note that p1 and q0 are adjacent to the pixel to be filtered, and if the weighting factor of q0 is set to a value larger than that of p1, p1 is a value generated from lossy encoded data. On the other hand, q0 is a value obtained from lossless encoded data and has higher reliability than P1. When step S1204 is completed and the process proceeds to step S1205, it is determined whether or not the encoding method of the tile next to the tile of interest is lossless encoding. A deblocking filter for correcting a pixel (128 pixels in the embodiment) located at the boundary with the lower adjacent tile in the target tile when it is determined that the lower adjacent tile is losslessly encoded. I do. This process is the same as that in step S1204, except that the application direction of the deblocking filter is horizontal or vertical, and the tile to be used is the right direction or the downward direction. For this reason, explanation is omitted. When step S1206 is finished, the image processing is finished.
本実施形態の復号処理では、図8(a)に示す二次記憶装置803に格納されたプログラムとして、その動作を説明した。しかし、これをハードウェアで実施しても構わない。この場合の構成の概略を図8(b)に示した。同図において、806は符号列入力部、807は符号列バッファであり、これらのブロックは図9におけるステップS901の処理で用いられる。808はヘッダ解析部であり、ステップS902で用いられる。809はJPEG2000復号部であり、ステップS908で用いられる。810はJPEG-LS復号部であり、ステップS907で用いられる。811は復号タイルバッファであり、ステップS907,S908の復号結果を格納するために用いられる。812は画像処理部であり、ステップS909,S914で用いられる。813は出力部であり、ステップS910,S915で用いられる。
In the decoding process of this embodiment, the operation has been described as a program stored in the
以上説明したように本実施形態によれば、非可逆符号化された第1のタイプのタイルに、可逆符号化された第2のタイプのタイルが隣接する場合に、その境界位置における歪みの発生を更に抑制することが可能になる。なお、上記実施形態では、削除ビットプレーン数が2の場合にデブロッキングフィルタ処理を行なったが、削除ビットプレーン数が0、1のいずれでも行なっても構わない。 As described above, according to the present embodiment, when the second type tile that has been losslessly encoded is adjacent to the first type tile that has been lossy encoded, distortion occurs at the boundary position. Can be further suppressed. In the above embodiment, the deblocking filter process is performed when the number of deleted bitplanes is 2. However, the number of deleted bitplanes may be 0 or 1.
[第2の実施形態]
上記第1の実施形態では、可逆符号化されたタイルと非可逆符号化されたタイルが共に1以上の場合の、非可逆符号化データの削除可能な最大ビットプレーン枚数Cが固定値“2”として説明した。しかし、この最大ビットプレーン枚数Cをクライアント201(又は202)が設定できる例を以下に説明する。クライアント201は、サーバ204に送信する画像要求情報に、その画像を特定する情報、許容データ量D_maxに加え、最大ビットプレーン枚数Cを含めて送信する。サーバは、これらの情報に基づき、符号化処理を行なうことになるが、符号化処理は上記第1の実施形態から明らかであるので、その説明については省略し、クライアント側の復号処理を説明する。
[Second Embodiment]
In the first embodiment, when the losslessly encoded tile and the lossy encoded tile are both 1 or more, the maximum number of bit planes C that can be deleted from the lossy encoded data is a fixed value “2”. As explained. However, an example in which the client 201 (or 202) can set the maximum number of bit planes C will be described below. The
ここで、可逆タイルと非可逆タイルの画質差を、より生じさせる圧縮条件で符号化した場合を考える。例えば、クライアント201がサーバ204に送信した要求に、最大削除ビットプレーン枚数Cを4とする情報が含またとする。そして、サーバ204が可逆、非可逆タイルを混在させ、且つ、4ビットのビットプレーンを削除した符号化データをクライアント201に返信した場合を考察する。この場合、可逆タイルと非可逆タイルの画質差はより大きくなる。このため、第1の実施形態では、注目非可逆タイルの右方向と下方向でデブロッキングフィルタをかけていたが、上方向と左方向でのデブロッキングフィルタも必要となる。ただ、右もしくは下方向の境界画素と、左もしくは上方向の境界画素では信頼度が異なる。このため、フィルタリング対象の境界に応じて、デブロッキングフィルタを変える。本第2の実施形態では、そのようなデブロッキングフィルタのかけ方について説明する。なお、第1実施形態と比べて、異なる処理は図9におけるステップ910,915の画像処理である。そこで、以下の説明では、該当処理に注力する。
Here, consider a case where the image quality difference between the reversible tile and the irreversible tile is encoded under a compression condition that causes more. For example, it is assumed that the request transmitted from the
図17において、ステップS1701で注目タイルは非可逆符号化されていたか否かを判断する。可逆符号化されていた場合には、本処理を終える。一方で、着目タイルが非可逆符号化されていたと判断された場合には、ステップS1702に進む。このステップS1702では、復号対象のファイルヘッダから読み出した削除ビットプレーン数をキーにして、二次記憶装置803に予め格納されたフィルタテーブルから、デブロッキングフィルタ処理A,Bで用いるフィルタ情報を読み出す。図23は、そのフィルタテーブルの例である。図示の如く、削除ビットプレーン数に応じて、2種類のデブロッキングフィルタ処理A、Bに用いるフィルタ情報が定義されている。デブロッキングフィルタ処理Aは、第1の実施形態と同様の、タイル内の右端、並びに、下端の画素を補正するフィルタ処理である。デブロッキングフィルタ処理Bは、タイル内の左端、並びに、上端の画素を補正するフィルタ処理である。なお、図示において、“−”は該当するデブロッキングフィルタ処理は行なわないことを表わす。例えば、削除ビットプレーン数が“2”の場合、デブロッキングフィルタ処理AはフィルタA0を用いて行なうが、デブロッキングフィルタ処理Bは行なわないことを示している。また、実施形態の場合、3タップのフィルタ処理であるので、1つのフィルタには、3つのフィルタ係数(重み係数)が格納されている。
In FIG. 17, it is determined in step S1701 whether or not the tile of interest has been irreversibly encoded. If it has been losslessly encoded, this process ends. On the other hand, if it is determined that the tile of interest has been lossy encoded, the process advances to step S1702. In this step S1702, the filter information used in the deblocking filter processes A and B is read from the filter table stored in advance in the
ステップS1703では、着目タイルの右隣のタイルが可逆であったか否かを判定する。右隣のタイルが可逆であった場合、着目タイルの右側に可逆タイルに接していたことになるので、ステップS1704に進み、デブロッキングフィルタ処理Aを実行し、着目タイル内の右端の画素値を補正する。 In step S1703, it is determined whether or not the tile on the right side of the tile of interest has been reversible. If the tile on the right is reversible, it means that the tile on the right side of the target tile is in contact with the reversible tile. Therefore, the process proceeds to step S1704, the deblocking filter processing A is executed, and the pixel value at the right end in the target tile is set. to correct.
ここで、例えば、削除ビットプレーン数が4であり、デブロッキングフィルタ処理Aで用いるフィルタA2に{1/5, 2/5, 2/5}で示される3つのフィルタ係数が格納されていたとする。この場合、着目タイル内の右端画素値p0に対して、次式のフィルタ処理を行ない、補正後の画素p0'を算出することになる。
p0’=(1/5)*p1+(2/5)*p0+(2/5)*q0
ここで、p1,p0,q0は第1の実施形態と同じ意味を持つ。
Here, for example, it is assumed that the number of deleted bit planes is 4, and three filter coefficients indicated by {1/5, 2/5, 2/5} are stored in the filter A2 used in the deblocking filter processing A. . In this case, the corrected pixel p0 ′ is calculated by performing the following filter processing on the rightmost pixel value p0 in the tile of interest.
p0 '= (1/5) * p1 + (2/5) * p0 + (2/5) * q0
Here, p1, p0, and q0 have the same meaning as in the first embodiment.
ステップS1705では、着目タイルの下隣のタイルが可逆であったか否かを判定する。下隣のタイルが可逆であった場合、着目タイルの下側に可逆タイルに接していたことになるので、ステップS1706に進み、デブロッキングフィルタ処理Aを実行し、着目タイル内の下端の画素値を補正する。 In step S1705, it is determined whether or not the tile below the target tile is reversible. If the lower adjacent tile is reversible, it means that the lower tile is in contact with the reversible tile. Therefore, the process proceeds to step S1706, the deblocking filter process A is executed, and the lower end pixel value in the target tile is reached. Correct.
ステップS1707では、着目タイルの左隣のタイルが可逆であったか否かを判定する。左隣のタイルが可逆であった場合、着目タイルの左側に可逆タイルに接していたことになるので、ステップS1708に進み、デブロッキングフィルタ処理Bを実行し、着目タイル内の左端の画素値を補正する。 In step S1707, it is determined whether the tile adjacent to the left of the tile of interest has been reversible. When the tile on the left is reversible, it means that the tile on the left side of the target tile is in contact with the reversible tile. Therefore, the process proceeds to step S1708, the deblocking filter process B is executed, and the pixel value at the left end in the target tile is set. to correct.
ここで、例えば、削除ビットプレーン数が4であり、デブロッキングフィルタ処理Bで用いるフィルタB0に{1/6, 3/6, 2/6}で示される3つのフィルタ係数が格納されていたとする。この場合、着目タイル内の左端画素値p0に対して、次式のフィルタ処理を行ない、補正後の画素p0'を算出することになる。
p0’=(1/6)*p1+(3/6)*p0+(2/6)*q0である。
Here, for example, it is assumed that the number of deleted bit planes is 4, and three filter coefficients indicated by {1/6, 3/6, 2/6} are stored in the filter B0 used in the deblocking filter processing B. . In this case, the corrected pixel p0 ′ is calculated by performing the following filter processing on the left end pixel value p0 in the tile of interest.
p0 '= (1/6) * p1 + (3/6) * p0 + (2/6) * q0.
これまでの説明からわかるように、削除ビット数に対するフィルタAとフィルタBの違いは、後者のが、補正前の値の重み大きく、隣接する可逆符号化タイル内の影響を小さくしている点である。 As can be seen from the above description, the difference between the filter A and the filter B with respect to the number of deleted bits is that the latter has a large weight before the correction and reduces the influence in the adjacent lossless encoding tile. is there.
ステップS1709では、着目タイルの上隣のタイルが可逆であったか否かを判定する。上隣のタイルが可逆であった場合、着目タイルの上側に可逆タイルに接していたことになるので、ステップS1710に進み、デブロッキングフィルタ処理Bを実行し、着目タイル内の上端の画素値を補正する。 In step S1709, it is determined whether or not the adjacent tile above the target tile is reversible. When the upper adjacent tile is reversible, it means that it is in contact with the reversible tile above the target tile, so the process proceeds to step S1710, and the deblocking filter processing B is executed, and the upper end pixel value in the target tile is set. to correct.
以上説明したように、可逆符号化されたタイルデータと、非可逆符号化されたタイルデータが混在した画像を復号する際、データ量制御のために削除したビットプレーン数に応じて適応的にデブロッキングフィルタ処理で用いるフィルタを決定する。この結果、タイル境界での歪み(ノイズ)を抑制させ、高い画質の画像を得ることができる。 As described above, when decoding an image in which lossless encoded tile data and lossy encoded tile data are mixed, adaptive decoding is performed according to the number of bit planes deleted for data amount control. A filter used in the blocking filter process is determined. As a result, distortion (noise) at the tile boundary can be suppressed, and a high-quality image can be obtained.
[第3の実施形態]
本第3の実施形態は、非可逆符号化として、JPEG2000だけでなく、JPEG(ITU-T T.81 | ISO/IEC 10918-1:1994)も用いることを許容する。つまり、タイルをJPEG-LS,JPEG2000,JPEGのいずれかで圧縮するものとする。JPEGを導入する狙いとしては、処理時間の短縮化である。すなわち、JPEG2000は高圧縮性,「符号量制御が容易」というメリットがある反面、符号化処理に時間がかかる。一方で、JPEGは、圧縮性能,符号量制御の面でJPEG2000に劣るものの、符号化処理が簡易である。このため、写真領域の一部のタイルに対してJPEGを適用することで、符号化処理全体の処理時間を短くできる。
[Third embodiment]
The third embodiment allows not only JPEG2000 but also JPEG (ITU-T T.81 | ISO / IEC 10918-1: 1994) to be used as lossy encoding. That is, the tile is compressed with JPEG-LS, JPEG2000, or JPEG. The aim of introducing JPEG is to shorten the processing time. In other words, JPEG2000 has the advantages of high compressibility and “easy control of code amount”, but it takes time for the encoding process. On the other hand, although JPEG is inferior to JPEG2000 in terms of compression performance and code amount control, the encoding process is simple. For this reason, the processing time of the entire encoding process can be shortened by applying JPEG to some tiles in the photographic area.
第1の実施形態で説明したとおり、JPEG2000の復号結果のタイルに着目したとき、そのタイル内の右方向と下方向のタイル境界画素の信頼度が低くなるという特性がある。JPEGについては、そのような特性はなく、いずれの境界の画素も、信頼度は変わらない。本第3の実施形態では、この点に注目し、境界画素の位置によって信頼度が変わる非可逆方式と、信頼度が変わらない非可逆方式を併用する場合のデブロッキングフィルタ処理の方法を示す。
As described in the first embodiment, when attention is paid to the tile of the decoding result of
本第3の実施形態における符号化方式は、JPEGを利用するため、第1実施形態とは異なるが、本実施形態の趣旨は、あくまでデブロッキングフィルタの使い方である。そのため、符号化方式については、説明を簡略にする。 The encoding method in the third embodiment is different from that in the first embodiment because JPEG is used, but the gist of the present embodiment is only how to use the deblocking filter. Therefore, the description of the encoding method is simplified.
符号化において、まず、写真領域のタイルに対し、JPEG2000もしくはJPEGのいずれを適用するかについては、タイル内に所定の大きさ以上のエッジがどの程度分布するかに応じて決める。具体的には、大きなエッジが多く出現していればJPEGで符号化し、そうでなければJPEG2000で符号化する。このようにする理由は、高周波成分が多ければ多い程、JPEG2000の処理時間が増加していくからである。 In encoding, first, whether to apply JPEG2000 or JPEG to tiles in a photographic area is determined according to how many edges of a predetermined size or more are distributed in the tiles. Specifically, if many large edges appear, it is encoded with JPEG, otherwise it is encoded with JPEG2000. The reason for this is that the more high frequency components, the longer the processing time of JPEG2000.
次に、符号量制御に関して、タイルを符号化した後、JPEG-LS圧縮されたタイルのデータの総和(D_ls)、JPEG2000圧縮されたタイルのデータの総和(D_j2k)、JPEG圧縮されたタイルのデータの総和(D_jp)を求める。そして、D_ls、D_j2k、D_jpの和(D_sum)を算出し、画像を圧縮した結果の上限符号量D_maxと比較する。もし、D_sum≦D_maxであれば、符号量制御は不要でそのまま出力する。一方で、D_sum>D_maxの場合、符号量制御が必要となる。まず、JPEG2000タイルを2ビットプレーン削除した場合の符号量(D_j2k_c)、JPEGのタイル(JPEGタイル)を1ビットプレーン削除した場合の符号量(D_jp_c)を求める。これは、可逆タイルと非可逆タイルの画質差が許容範囲内になる、削除可能な最大ビットプレーン枚数である。この削除について、JPEG2000のデータには削除を簡易に行えるデータ構造があるが、JPEGのデータにはそのような構造がない。そのため、JPEGで符号化されたタイル(JPEGタイル)をローカル復号し、再符号化する。具体的には、全JPEGタイルのデータをいったんメモリにコピーする。その上で、各JPEGタイルをハフマン復号して、量子化インデックス(量子化されたDCT係数)を生成する。そして、各量子化インデックスの下位2ビットプレーンを削除し、ハフマン符号化する。この一連の処理により、JPEGデータのビットプレーン削除を行う。そして、D_ls、D_j2k_c、D_jp_cの和(D_sum_c)を算出し、D_sum_cがD_maxより小さければ、JPEG-LSタイルのデータを再符号化せずに、JPEG2000タイルとJPEGタイルで符号量制御を行う。この符号量制御では、最初にJPEG2000タイルを1タイルずつ、ラスタースキャン順に下位1ビットプレーンを削る。もし全てのJPEG2000タイルの下位1ビットプレーンを削っても、JPEG-LS,JPEG,JPEG200のデータ総和がD_maxを超えていたら、JPEGタイルを1タイルずつ、ラスタースキャン順に下位1ビットプレーンを削る。もし全てのJPEGタイルの下位1ビットプレーンを削っても、JPEG-LS,JPEG,JPEG200のデータ総和がD_maxを超えていたら、JPEG2000タイルの下位ビットプレーンから、さらに1ビットプレーン削る。
Next, regarding code amount control, after encoding the tile, the sum of the data of tiles compressed with JPEG-LS (D_ls), the sum of the data of tiles compressed with JPEG2000 (D_j2k), and the data of tiles compressed with JPEG Find the sum of (D_jp). Then, the sum (D_sum) of D_ls, D_j2k, and D_jp is calculated and compared with the upper limit code amount D_max as a result of compressing the image. If D_sum ≦ D_max, the code amount control is unnecessary and is output as it is. On the other hand, when D_sum> D_max, code amount control is required. First, a code amount (D_j2k_c) when a JPEG2000 tile is deleted by a 2-bit plane and a code amount (D_jp_c) when a JPEG tile (JPEG tile) is deleted by a 1-bit plane are obtained. This is the maximum number of bit planes that can be deleted so that the difference in image quality between the reversible tile and the irreversible tile is within an allowable range. Regarding this deletion, JPEG2000 data has a data structure that can be easily deleted, but JPEG data does not have such a structure. Therefore, JPEG-encoded tiles (JPEG tiles) are locally decoded and re-encoded. Specifically, all the JPEG tile data is temporarily copied to the memory. Then, each JPEG tile is Huffman-decoded to generate a quantization index (quantized DCT coefficient). Then, the lower 2-bit plane of each quantization index is deleted and Huffman coding is performed. By this series of processing, bit plane deletion of JPEG data is performed. Then, the sum (D_sum_c) of D_ls, D_j2k_c, and D_jp_c is calculated. If D_sum_c is smaller than D_max, the code amount control is performed on the JPEG2000 tile and the JPEG tile without re-encoding the JPEG-LS tile data. In this code amount control, first, JPEG2000 tiles are tiled one by one, and the lower one bit plane is deleted in raster scan order. If the total data of JPEG-LS, JPEG, and JPEG200 exceeds D_max even if the lower 1 bit plane of all JPEG2000 tiles is deleted, the lower 1 bit plane is deleted in the raster scan order for each JPEG tile. Even if the lower 1 bit plane of all JPEG tiles is deleted, if the data sum of JPEG-LS, JPEG, and JPEG 200 exceeds D_max, 1 bit plane is further deleted from the lower bit plane of the
一方で、D_sum_cがD_maxより大きければ、JPEG-LSタイルをJPEG2000に再符号化して、符号量制御を行う。この処理において、JPEGではなくJPEG2000に再符号化する理由は、JPEGデータの符号量制御における処理の煩雑さを避けるためである。なお、JPEG-LSの再符号化後の、符号量制御については、D_sum_cがD_maxより小さい場合の処理と同様であるので、説明を割愛する。 On the other hand, if D_sum_c is larger than D_max, the JPEG-LS tile is re-encoded to JPEG2000, and the code amount control is performed. In this processing, the reason for re-encoding to JPEG2000 instead of JPEG is to avoid the complexity of the processing in the code amount control of JPEG data. Note that the code amount control after JPEG-LS re-encoding is the same as the process when D_sum_c is smaller than D_max, and thus description thereof is omitted.
次に、復号処理におけるデブロッキングフィルタのかけ方に説明を進める。 Next, a description will be given of how to apply a deblocking filter in the decoding process.
第1の実施形態では、可逆タイルと非可逆タイルが隣接する境界に対してデブロッキングフィルタを行う方法を示した。その方法の狙いは、写真領域以外が可逆タイルと非可逆タイルに分断されてしまうことによる、注目の写真領域以外で生じる画質差の緩和であった。本実施形態では、その狙いを拡張させる。具体的には、非可逆タイルの内部に写真領域以外が存在するかどうかに関わらず、異なる符号化方式のタイルが隣接した場合、発生する歪みが異なるため、2つのタイル間には画質差が生じていると考える。その上で、デブロッキングフィルタをかける。つまり、JPEGタイルとJPEG2000タイルが隣接する場合、それら2つが図18(a)のように写真領域以外を分断する場合もあれば、図18(b),(c),(d)のように、そうでない場合もある。本第3の実施形態では、いずれの場合でも、JPEGタイルとJPEG2000タイルが隣接する境界に対しては、デブロッキングフィルタをかける。以降では、そのようなデブロッキングフィルタのかけ方について説明する。なお、第1実施形態と本実施形態を比べて、異なる処理は図9におけるステップ910,915の画像処理である。そこで、以下の説明では、該当処理に注力する。 In the first embodiment, the method of performing the deblocking filter on the boundary where the reversible tile and the irreversible tile are adjacent to each other has been described. The aim of the method was to alleviate the difference in image quality that occurs outside the photographic area of interest, because the area other than the photographic area is divided into a reversible tile and a non-reversible tile. In this embodiment, the aim is expanded. Specifically, regardless of whether or not there is a non-photograph area inside the irreversible tile, when tiles of different encoding methods are adjacent to each other, the generated distortion differs, so there is a difference in image quality between the two tiles. I think it has occurred. Then, apply a deblocking filter. That is, when the JPEG tile and the JPEG2000 tile are adjacent to each other, there are cases in which these two parts divide other than the photograph area as shown in FIG. 18 (a), or as shown in FIGS. 18 (b), (c), and (d). , Sometimes not. In the third embodiment, in any case, the deblocking filter is applied to the boundary where the JPEG tile and the JPEG2000 tile are adjacent to each other. Hereinafter, how to apply such a deblocking filter will be described. Note that the different processing between the first embodiment and this embodiment is the image processing in steps 910 and 915 in FIG. Therefore, in the following description, the process will be focused on.
図19において、ステップ1901で注目タイルはJPEG2000タイルかどうかを判定する。もしJPEG2000タイルであれば、ステップS1902で注目JPEG2000タイルと隣接タイルのフィルタリングを行う。この処理については、後程詳述する。ステップS1902で注目タイルはJPEG2000タイルでない場合、ステップS1903で注目タイルはJPEGタイルかどうかを判定する。もし、JPEGタイルでない場合、ステップS910,915の画像処理を終える。一方で、注目タイルはJPEGタイルである場合、ステップS1904で注目JPEGタイルと隣接タイルのフィルタリングを行う。この処理については、後程詳述する。ステップS1904の処理を終えると、ステップS910,915の画像処理を終える。 In FIG. 19, it is determined in step 1901 whether the target tile is a JPEG2000 tile. If it is a JPEG2000 tile, the target JPEG2000 tile and adjacent tiles are filtered in step S1902. This process will be described in detail later. If the target tile is not a JPEG2000 tile in step S1902, it is determined in step S1903 whether the target tile is a JPEG tile. If it is not a JPEG tile, the image processing in steps S910 and 915 ends. On the other hand, if the target tile is a JPEG tile, the target JPEG tile and adjacent tiles are filtered in step S1904. This process will be described in detail later. When the process of step S1904 is finished, the image processing of steps S910 and 915 is finished.
次に、図20を用いて、ステップS1902の処理を説明する。ステップS2001で、注目タイルの右に隣接しているタイル(右隣接タイル)はJPEG-LSタイルかどうか判定する。もしJPEG-LSタイルであれば、ステップS2002で第1の実施形態で示したデブロッキングフィルタ処理を行う。以降、このデブロッキングフィルタ処理をフィルタ処理Aという。この処理を終えると、処理をステップS2006に進める。 Next, the process of step S1902 will be described with reference to FIG. In step S2001, it is determined whether the tile adjacent to the right of the tile of interest (the right adjacent tile) is a JPEG-LS tile. If it is a JPEG-LS tile, the deblocking filter processing shown in the first embodiment is performed in step S2002. Hereinafter, this deblocking filter process is referred to as filter process A. When this process ends, the process proceeds to step S2006.
一方、ステップS2002で右隣接タイルがJPEG-LSタイルではないと判断した場合には、ステップS2003に進み、右隣のタイルがJPEGであるか否かを判定する。JPEGである場合、ステップS2004で、注目タイル(JPEG2000で符号化されたタイル)内の、JPEGタイルに接する側に位置する右端の画素について、フィルタリング処理Bを行なう。このフィルタリング処理で用いるフィルタは、p0’=(1/3)*p1+(1/3)*p0+(1/3)*q0である。この式において、注目境界画素の係数が隣接画素の係数と同じにしている理由は、注目タイルはJPEG2000タイルで、注目境界画素の信頼度が低いからである。さらに、ステップS2005において、右隣接タイルは非可逆タイルであるので、右隣接タイル内の左端に位置する境界画素にもデブロッキングフィルタCをかける。フィルタは、q0’=(1/6)*p0+(3/6)*q0+(2/6)*q1である。ここで、画素p0,q0,q1の説明は図21に示したとおりである。フィルタ処理Cにおいて、境界画素に隣接する隣接画素p0,q1で係数に差をつけている理由は、p0の信頼度が低いからである。ステップS2005を終えると、処理をステップS2006に進める。 On the other hand, if it is determined in step S2002 that the right adjacent tile is not a JPEG-LS tile, the process advances to step S2003 to determine whether the right adjacent tile is JPEG. If it is JPEG, filtering processing B is performed on the rightmost pixel located on the side in contact with the JPEG tile in the target tile (tile encoded with JPEG2000) in step S2004. The filter used in this filtering process is p0 ′ = (1/3) * p1 + (1/3) * p0 + (1/3) * q0. The reason why the coefficient of the target boundary pixel in this equation is the same as the coefficient of the adjacent pixel is that the target tile is a JPEG2000 tile and the reliability of the target boundary pixel is low. Further, in step S2005, since the right adjacent tile is an irreversible tile, the deblocking filter C is also applied to the boundary pixel located at the left end in the right adjacent tile. The filter is q0 ′ = (1/6) * p0 + (3/6) * q0 + (2/6) * q1. Here, the description of the pixels p0, q0, and q1 is as shown in FIG. In the filter processing C, the reason why the coefficients are different between the adjacent pixels p0 and q1 adjacent to the boundary pixel is that the reliability of p0 is low. When step S2005 is completed, the process proceeds to step S2006.
ステップS2006においては、上方向の隣接タイル(上隣接タイル)はJPEG-LSタイルであるか判定する。もし、JPEG-LSタイルでなければ、処理をステップS2008へ進める。一方で、JPEG-LSタイルであれば、第2の実施形態におけるフィルタBを行い、処理をステップS2008へ進める。なお、このフィルタについては、以降フィルタDと呼ぶ。ステップS2008では、左方向の隣接タイル(左隣接タイル)はJPEG-LSタイルであるか判定する。もし、JPEG-LSタイルでなければ、処理をステップS2010へ進める。一方で、JPEG-LSタイルであれば、フィルタDを行う。ステップS2010では、下方向の隣接タイル(下隣接タイル)はJPEG-LSタイルであるか判定する。もし、JPEG-LSタイルでなければ、処理をステップS2012へ進める。一方で、JPEG-LSタイルであれば、ステップS2011でフィルタAを行う。ステップS2012では、下隣接タイルはJPEGタイルであるか判定する。もし、JPEGタイルでなければ処理を終える。一方で、JPEGタイルであれば、ステップS2013で注目タイルの境界画素にフィルタBをかけ、ステップS2014で下隣接タイルの境界画素にフィルタCをかける。そして、処理を終える。 In step S2006, it is determined whether the upward adjacent tile (upper adjacent tile) is a JPEG-LS tile. If it is not a JPEG-LS tile, the process proceeds to step S2008. On the other hand, if it is a JPEG-LS tile, the filter B in the second embodiment is performed, and the process proceeds to step S2008. This filter is hereinafter referred to as filter D. In step S2008, it is determined whether the adjacent tile in the left direction (left adjacent tile) is a JPEG-LS tile. If it is not a JPEG-LS tile, the process proceeds to step S2010. On the other hand, if it is a JPEG-LS tile, filter D is performed. In step S2010, it is determined whether the downward adjacent tile (lower adjacent tile) is a JPEG-LS tile. If it is not a JPEG-LS tile, the process proceeds to step S2012. On the other hand, if it is a JPEG-LS tile, filter A is performed in step S2011. In step S2012, it is determined whether the lower adjacent tile is a JPEG tile. If it is not a JPEG tile, the process ends. On the other hand, if it is a JPEG tile, the filter B is applied to the boundary pixel of the target tile in step S2013, and the filter C is applied to the boundary pixel of the lower adjacent tile in step S2014. Then, the process ends.
次に、図22を用いて、ステップS1904の処理を説明する。ステップS2201で、注目タイルの右に隣接しているタイル(右隣接タイル)はJPEG-LSタイルかどうか判定する。もしJPEG-LSタイルであれば、ステップS2202で注目タイルの境界画素に、フィルタリングを行う。このフィルタリングは、p0’=(1/6)*p1+(3/6)*p0+(2/6)*q0である。この式において、境界画素に隣接する隣接画素p1,q0で係数に差をつけている理由は、q0は可逆タイルの画素だからである。なお、このデブロッキングフィルタをフィルタEと呼ぶ。フィルタEを行った後、処理をステップS2206に進める。一方、ステップS2201で右隣接タイルがJPEG-LSではないと判断した場合、ステップS2203にて、右隣のタイルはJPEG2000タイルかどうかを判断する。JPEG2000タイルであると判断した場合、ステップS2204で注目タイルの右端の画素に、フィルタリングを行う。このフィルタリングは、p0’=(1/5)*p1+(3/5)*p0+(2/5)*q0であり、フィルタFと呼ぶ。さらに、ステップS2205において、右隣接タイルは非可逆タイルであるので、右隣接タイル内の左端画素にもデブロッキングフィルタをかける。フィルタの式はq0’=(1/5)*p0+(3/5)*q0+(2/5)*q1であり、フィルタGと呼ぶ。なお、フィルタFとフィルタGは、フィルタリングに使う画素は異なるが、係数は同じである。ステップS2205を終えると、処理をステップS2206に進める。 Next, the process of step S1904 will be described with reference to FIG. In step S2201, it is determined whether the tile adjacent to the right of the tile of interest (right adjacent tile) is a JPEG-LS tile. If it is a JPEG-LS tile, filtering is performed on the boundary pixel of the target tile in step S2202. This filtering is p0 '= (1/6) * p1 + (3/6) * p0 + (2/6) * q0. In this equation, the reason why the coefficients are different between adjacent pixels p1 and q0 adjacent to the boundary pixel is that q0 is a pixel of a reversible tile. This deblocking filter is referred to as filter E. After performing filter E, the process proceeds to step S2206. On the other hand, if it is determined in step S2201 that the right adjacent tile is not JPEG-LS, it is determined in step S2203 whether the right adjacent tile is a JPEG2000 tile. If it is determined that the tile is a JPEG2000 tile, filtering is performed on the rightmost pixel of the tile of interest in step S2204. This filtering is called p0 ′ = (1/5) * p1 + (3/5) * p0 + (2/5) * q0 and is called filter F. In step S2205, since the right adjacent tile is an irreversible tile, a deblocking filter is also applied to the left end pixel in the right adjacent tile. The filter equation is q0 ′ = (1/5) * p0 + (3/5) * q0 + (2/5) * q1 and is called filter G. Note that the filter F and the filter G have the same coefficients, although the pixels used for filtering are different. When step S2205 is completed, the process proceeds to step S2206.
ステップS2206においては、上方向の隣接タイル(上隣接タイル)はJPEG-LSタイルであるか判定する。もし、JPEG-LSタイルでなければ、処理をステップS2208へ進める。一方で、JPEG-LSタイルであれば、フィルタEを行い、処理をステップS2208へ進める。ステップS2208では、左方向の隣接タイル(左隣接タイル)はJPEG-LSタイルであるか判定する。もし、JPEG-LSタイルでなければ、処理をステップS2210へ進める。一方で、JPEG-LSタイルであれば、ステップS2209でフィルタEを行う。ステップS2210では、下方向の隣接タイル(下隣接タイル)はJPEG-LSタイルであるか判定する。もし、JPEG-LSタイルでなければ、処理をステップS2212へ進める。一方で、JPEG-LSタイルであれば、ステップS2211でフィルタEを行う。ステップS2212では、下隣接タイルはJPEGタイルであるか判定する。もし、JPEGタイルでなければ処理を終える。一方で、JPEGタイルであれば、ステップS2213で注目タイルの境界画素にフィルタFをかけ、ステップS2214で下隣接タイルの境界画素にフィルタGをかける。そして、処理を終える。 In step S2206, it is determined whether the upward adjacent tile (upper adjacent tile) is a JPEG-LS tile. If it is not a JPEG-LS tile, the process advances to step S2208. On the other hand, if it is a JPEG-LS tile, filter E is performed and the process proceeds to step S2208. In step S2208, it is determined whether the adjacent tile in the left direction (left adjacent tile) is a JPEG-LS tile. If it is not a JPEG-LS tile, the process advances to step S2210. On the other hand, if it is a JPEG-LS tile, filter E is performed in step S2209. In step S2210, it is determined whether the adjacent tile in the downward direction (lower adjacent tile) is a JPEG-LS tile. If it is not a JPEG-LS tile, the process advances to step S2212. On the other hand, if it is a JPEG-LS tile, filter E is performed in step S2211. In step S2212, it is determined whether the lower adjacent tile is a JPEG tile. If it is not a JPEG tile, the process ends. On the other hand, if it is a JPEG tile, the filter F is applied to the boundary pixel of the target tile in step S2213, and the filter G is applied to the boundary pixel of the lower adjacent tile in step S2214. Then, the process ends.
(その他の実施例)
上記実施形態では、サーバとクライアントが通信を行なう例を説明したが、1つの装置にて符号化と復号の両方を処理する場合であっても構わないので、上記実施形態によって本発明が限定されるものではない。
(Other examples)
In the above-described embodiment, an example in which the server and the client communicate with each other has been described. However, the present invention is limited by the above-described embodiment because a single apparatus may perform both encoding and decoding. It is not something.
また以上の実施形態では、符号化方式として、JPEG2000,JPEG-LS,JPEGを用いる方法を説明したが、これに限られることはない。また、符号化方式の組み合わせについて、2つの場合と3つの場合を示したが、これに限られることはない。 In the above embodiment, a method using JPEG2000, JPEG-LS, or JPEG as an encoding method has been described. However, the present invention is not limited to this. Moreover, although two cases and three cases have been shown for combinations of encoding methods, the present invention is not limited to this.
デブロッキングフィルタのタップ数を3つとして説明したが、これに限られることはない。また、フィルタの係数は適宜実装形態に合わせて変更しても構わない。例えば、タイルに適用する量子化やビットプレーン削除などの、圧縮条件に合わせて変更することも本発明の範疇となる。 Although the number of taps of the deblocking filter has been described as three, the present invention is not limited to this. Further, the filter coefficient may be appropriately changed according to the mounting form. For example, it is also within the scope of the present invention to change according to compression conditions such as quantization applied to tiles and bit plane deletion.
信頼度が低い画素はタイル境界画素として説明したが、タイル境界以外の画素、例えばタイル境界の近傍で信頼度が低下する場合、その画素に対する重みづけを小さくするフィルタリング方法も本発明の範疇である。 A pixel with low reliability has been described as a tile boundary pixel. However, a filtering method that reduces the weighting of a pixel other than the tile boundary, for example, when the reliability decreases in the vicinity of the tile boundary, is also within the scope of the present invention. .
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。 The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, or the like) of the system or apparatus reads the program. It is a process to be executed.
Claims (12)
各タイルの符号化データが、いずれの符号化手段による符号化データであるのかを識別する識別手段と、
該識別手段の識別結果に従い、各タイルの符号化データについて該当する種類の復号処理を実行することでタイル画像を生成する復号処理手段と、
前記識別手段による識別結果に基づき、前記復号処理手段による復号処理で得られたタイル画像で構成される画像中の、前記第1のタイプのタイルと前記第2のタイプのタイルとが隣接するタイル境界を検出する検出手段と、
該検出手段が検出した前記タイル境界を接する前記第1のタイプのタイル内の前記タイル境界に接する画素の値を、前記タイル境界を跨ぐサイズを有すると共に前記第1の符号化手段と前記第2の符号化手段の信頼度に応じた特性を有するフィルタを用いて、フィルタ処理するフィルタ処理手段と、
を有することを特徴とする画像処理装置。 The encoded data of the first type tile encoded by the irreversible first encoding means, and the second encoded by the second encoding means different from the first encoding means An image processing apparatus that decodes encoded image data in which encoded data of a type tile is mixed,
Identifying means for identifying which encoded means the encoded data of each tile is encoded data;
A decoding processing means for generating a tile image by executing a corresponding type of decoding processing on the encoded data of each tile according to the identification result of the identification means;
A tile in which the first type tile and the second type tile are adjacent to each other in an image composed of tile images obtained by the decoding processing by the decoding processing unit based on the identification result by the identification unit. Detection means for detecting the boundary;
A value of a pixel that touches the tile boundary in the first type tile that touches the tile boundary detected by the detection means has a size across the tile boundary, and the first encoding means and the second Filter processing means for performing filter processing using a filter having characteristics according to the reliability of the encoding means;
An image processing apparatus comprising:
識別手段が、各タイルの符号化データが、いずれの符号化手段による符号化データであるのかを識別する識別工程と、
復号処理手段が、前記識別工程の識別結果に従い、各タイルの符号化データについて該当する種類の復号処理を実行することでタイル画像を生成する復号処理工程と、
検出手段が、前記識別工程による識別結果に基づき、前記復号処理工程による復号処理で得られたタイル画像で構成される画像中の、前記第1のタイプのタイルと前記第2のタイプのタイルとが隣接するタイル境界を検出する検出工程と、
フィルタ処理手段が、前記検出工程が検出した前記タイル境界を接する前記第1のタイプのタイル内の前記タイル境界に接する画素の値を、前記タイル境界を跨ぐサイズを有すると共に前記第1の符号化手段と前記第2の符号化手段の信頼度に応じた特性を有するフィルタを用いて、フィルタ処理するフィルタ処理工程と、
を有することを特徴とする画像処理装置の制御方法。 The encoded data of the first type tile encoded by the irreversible first encoding means, and the second encoded by the second encoding means different from the first encoding means A method for controlling an image processing apparatus that decodes encoded image data in which encoded data of a tile of a type is mixed,
An identification step in which the identification means identifies which encoded data of each tile is encoded data;
A decoding processing step in which a decoding processing unit generates a tile image by executing a corresponding type of decoding processing on the encoded data of each tile according to the identification result of the identification step;
Based on the identification result in the identification step, the detection means includes the first type tile and the second type tile in the image composed of tile images obtained by the decoding process in the decoding process step. Detecting a tile boundary adjacent to each other;
The filter processing means has a size of the pixel that touches the tile boundary in the first type of tile that touches the tile boundary detected by the detection step, and has a size across the tile boundary and the first encoding. And a filter processing step of performing a filter process using a filter having characteristics according to the reliability of the means and the second encoding means;
A control method for an image processing apparatus, comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013037691A JP2014165868A (en) | 2013-02-27 | 2013-02-27 | Image processing device and control method therefor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013037691A JP2014165868A (en) | 2013-02-27 | 2013-02-27 | Image processing device and control method therefor |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2014165868A true JP2014165868A (en) | 2014-09-08 |
Family
ID=51616055
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013037691A Pending JP2014165868A (en) | 2013-02-27 | 2013-02-27 | Image processing device and control method therefor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2014165868A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107018416A (en) * | 2016-01-11 | 2017-08-04 | 谷歌公司 | For video and the adaptive chip data size coding of compression of images |
-
2013
- 2013-02-27 JP JP2013037691A patent/JP2014165868A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107018416A (en) * | 2016-01-11 | 2017-08-04 | 谷歌公司 | For video and the adaptive chip data size coding of compression of images |
CN107018416B (en) * | 2016-01-11 | 2020-03-03 | 谷歌有限责任公司 | Adaptive tile data size coding for video and image compression |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8126053B2 (en) | Image encoding/decoding method and apparatus | |
US7352908B2 (en) | Image compression device, image decompression device, image compression/decompression device, program for executing on a computer to perform functions of such devices, and recording medium storing such a program | |
JP4693603B2 (en) | Image encoding apparatus, control method therefor, computer program, and computer-readable storage medium | |
KR100611705B1 (en) | Image encoding device, image encoding method, and image processing device | |
JP2006067117A (en) | Device and method for encoding image, computer program, and computer readable storage medium | |
KR20200090990A (en) | Method and device for lossy compress-encoding data and corresponding method and device for reconstructing data | |
US20080298702A1 (en) | Fixed rate JPEG encoding | |
US20210006765A1 (en) | Method and apparatus for inter-channel prediction and transform for point-cloud attribute coding | |
CN103947206A (en) | Region-based image compression | |
JP4393319B2 (en) | Image encoding apparatus and method, computer program, and computer-readable storage medium | |
JP5413080B2 (en) | Image processing apparatus and image processing method | |
JP2017085319A (en) | Image processing apparatus and control method of the same, computer program, and storage medium | |
CN112868228A (en) | Adaptive DCT sharpener | |
JP2006080794A (en) | Image coding device and method, computer program and computer readable storage medium | |
JP2011193394A (en) | Image processing apparatus, image processing method, and program | |
JP2020102704A (en) | Image encoding device, control method of the same, and program | |
US7373000B2 (en) | Image processing apparatus | |
KR101703330B1 (en) | Method and apparatus for re-encoding an image | |
JP2014165868A (en) | Image processing device and control method therefor | |
US8463057B2 (en) | Image encoding apparatus and control method therefor | |
JP2016092589A (en) | Encoder and control method therefor | |
CN115769575A (en) | Method and apparatus for video encoding | |
JP5267140B2 (en) | Image compression apparatus and image compression method | |
JP2004304238A (en) | Image compressing apparatus and compression coding method | |
JP3952981B2 (en) | Image processing device |