JP2014165868A - Image processing device and control method therefor - Google Patents

Image processing device and control method therefor Download PDF

Info

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
Application number
JP2013037691A
Other languages
Japanese (ja)
Inventor
Hiroki Kishi
裕樹 岸
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2013037691A priority Critical patent/JP2014165868A/en
Publication of JP2014165868A publication Critical patent/JP2014165868A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To generate a natural image with a reduced image quality difference at the boundary of tiles generated by different coding methods, when decoding coded image data of each tile unit in which coded data generated by a plurality of coding methods at least including an irreversible coding method are mixed.SOLUTION: When decoding the coded data of an image having the coded data of a tile based on JPEG 2000, mixed with the coded data of a tile based on JPEG-LS, it is determined for each tile unit which coding method the coded data is based on, so that decoding processing for a type corresponding to the determination result is executed. As a result of the decoding, if the tile of interest is based on JPEG 2000 and the adjacent tile is based on JPEG-LS, image processing using a filter is executed so as not to produce unnaturalness at the tile boundary therebetween.

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 (Patent Documents 1 and 2) has been proposed in which a single image is used as an area for lossless compression and an area for irreversible compression, and code amount control is performed for an image in the area for irreversible compression. ing. In this type of method, the lossy compressed data may be largely deleted in order to realize a target code amount (target code amount) after encoding. As a result, the difference in image quality between the reversible compression area and the irreversible pressure area becomes noticeable, and it becomes dirty when viewed as a whole screen. In order to alleviate this problem, it is conceivable to perform a filtering process called a deblocking filter on the boundary between the lossless compression area and the lossy compression area after decoding the image. A deblocking filter is a filter that reduces block distortion that occurs in a decoded image such as JPEG, and is a type of smoothing filter that is applied to block boundaries (Patent Document 3).

特開2006-148585号公報Japanese Unexamined Patent Publication No. 2006-148585 特許第4693603号公報Japanese Patent No.4693603 特開2010-4555号公報JP 2010-4555

非可逆圧縮の中には、領域と領域における特定の境界の画素を、大きく歪ませてしまうタイプの方式がある。このため、デブロッキングフィルタをかけるにあたっては、フィルタで用いる各画素について、どの程度歪む可能性があるか(復号画素値の信頼度)に応じて、フィルタ係数を決めることが望ましい。しかし、従来のデブロッキングフィルタは、個々の復号画素の信頼度には着目せず、領域がどの程度歪んでいるか(具体的には圧縮条件等)を基にフィルタ係数を決めている。つまり、従来のデブロッキングフィルタを使うと、平滑化は達成できるが、信頼度の低い復号画素値の歪みを拡散させてしまうという問題があった。   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.

実施形態1における符号化側のコンピュータシステムの構成図と機能ブロック図Configuration diagram and functional block diagram of a computer system on the encoding side in the first embodiment サーバ・クライアントの構成図Server / client configuration diagram 第1の実施形態における符号量制御付き画像圧縮処理フローを説明する図The figure explaining the image compression processing flow with code amount control in 1st Embodiment 第1の実施形態における符号量制御処理フローを説明する図The figure explaining the code amount control processing flow in 1st Embodiment 第1の実施形態における可逆領域の再符号化処理フローを説明する図The figure explaining the re-encoding process flow of a reversible area | region in 1st Embodiment. 第1の実施形態における符号列の構成を説明する図The figure explaining the structure of the code sequence in 1st Embodiment 第1の実施形態における符号量制御に入る前の可逆/非可逆圧縮領域の分布を説明する図The figure explaining distribution of the lossless / lossy compression field before going into code amount control in a 1st embodiment. 第1の実施形態における復号側のコンピュータシステムの構成図と機能ブロック図Configuration diagram and functional block diagram of a computer system on the decoding side in the first embodiment 第1の実施形態における復号処理の全体フローを説明する図The figure explaining the whole flow of the decoding process in 1st Embodiment 第1の実施形態におけるデブロッキングフィルタ対象のタイルと参照するタイルの位置関係を説明する図The figure explaining the positional relationship of the tile of the deblocking filter object in 1st Embodiment, and the tile to refer. 第1の実施形態におけるタイルの行を説明する図The figure explaining the row | line | column of the tile in 1st Embodiment 第1の実施形態におけるデブロッキングフィルタの処理フローを説明する図The figure explaining the processing flow of the deblocking filter in 1st Embodiment. 第1の実施形態におけてデブロッキングフィルタ処理で使用する画素を説明する図The figure explaining the pixel used by the deblocking filter process in 1st Embodiment 写真領域以外が可逆タイルと非可逆タイルに分断される状態を説明する図The figure explaining the state where the part other than the photograph area is divided into a reversible tile and a non-reversible tile JPEG2000の歪みの特性を説明する図Diagram explaining distortion characteristics of JPEG2000 JPEG2000の逆DWTを説明する図Illustration explaining reverse DWT of JPEG2000 第2の実施形態におけるデブロッキングフィルタの処理フローを説明する図The figure explaining the processing flow of the deblocking filter in 2nd Embodiment. 第3の実施形態における、隣接するJPEGタイルとJPEG2000タイルと写真領域以外の位置関係を説明する図The figure explaining positional relationship other than the adjacent JPEG tile, JPEG2000 tile, and photograph area | region in 3rd Embodiment. 第3の実施形態におけるデブロッキングフィルタ処理の全体フローを説明する図The figure explaining the whole flow of the deblocking filter process in 3rd Embodiment 第3の実施形態におけるJPEG2000タイルへのデブロッキングフィルタ処理のフローを説明する図The figure explaining the flow of the deblocking filter process to the JPEG2000 tile in 3rd Embodiment デブロッキングフィルタ処理で用いる画素を説明する図The figure explaining the pixel used by a deblocking filter process 第3の実施形態におけるJPEGタイルへのデブロッキングフィルタ処理フローを説明する図The figure explaining the deblocking filter processing flow to the JPEG tile in 3rd Embodiment 第2の実施形態におけるフィルタテーブルの一例を示す図である。It is a figure which shows an example of the filter table in 2nd Embodiment.

以下、添付図面に従って本発明に係る実施形態を詳細に説明する。   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 CPU 101 controls the operation of the entire system and executes a program stored in the primary storage 102. The primary storage 102 is a main memory composed of a RAM, and reads and stores programs stored in the secondary storage 103. The secondary storage 103 corresponds to, for example, a storage medium such as a hard disk. Generally, the capacity of the primary storage is smaller than the capacity of the secondary storage, and program codes and data that cannot be stored in the primary storage are stored in the secondary storage. Further, data that must be stored for a long time is also stored in the secondary storage. In the present embodiment, the program is stored in the secondary storage 103, read into the primary storage 102 when the program is executed, and the CPU 101 executes the execution process. Examples of the input device 104 include a mouse and a keyboard. Used to send an interrupt signal to a program or the like. Examples of the output device 105 include a monitor and a printer. Various other configurations of the apparatus configuration method are conceivable, but the description thereof is omitted because it is not the main point of the present invention. The network I / F 106 is an interface for communicating with the network, and may be wired or wireless.

図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. Reference numerals 201 and 202 in the figure represent clients. A plurality of users, such as the client 201 or the client 202, can communicate with the server 204 via the network 203 regardless of wired or wireless. The clients 201 and 202 are PCs, tablet terminals, portable terminals, printers, and the like, and are devices that have a communication function and can output images. The server 204 has the configuration shown in FIG. 1 and has a large-capacity storage device 205 that stores image files. The large-capacity storage device 205 corresponds to, for example, a hard disk. This hard disk stores a large amount of uncompressed image data including text, line drawings, and natural images. The clients 201 and 202 request image data and the upper limit value of the compressed data size from the server. The upper limit value of the compressed data is a value calculated from the network status, client memory capacity, and the like. The server 204 compresses the image data designated by the clients 201 and 202 so that the file size is equal to or smaller than the designated upper limit value, and returns the compressed data to the clients 201 and 202. The clients 201 and 202 decrypt the received compressed data.

まず、サーバ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 server 204 will be described in more detail. The server 204 divides the image data (file name etc.) specified by the clients 201 and 202 into tiles, selects reversible compression or lossy compression according to the characteristics of each tile, Turn into. In the present embodiment, the tile size is 128 × 128 [pixel]. In addition, a JPEG-LS encoding method that is good at compression of characters and line drawings as lossless compression and a JPEG 2000 encoding method that is good at compression of natural images as lossy compression are used. Therefore, the JPEG-LS method is selected if the tile includes many characters and line drawings, and the JPEG 2000 method is selected if the tile includes many natural images. After encoding all tiles, the code amount of tiles compressed with JPEG2000 (JPEG2000 tiles) is the same as that of tiles compressed with JPEG-LS (JPEG-LS tiles) without making a difference between tiles. Remove the image quality difference within the allowable range. As a result of the deletion, if the code amount is equal to or less than the specified code amount, the data is returned to the client. If it is necessary to delete the JPEG2000 tile data so that the image quality difference from the JPEG-LS tile cannot be kept within the allowable range, the excess code amount and the distribution of the lossless compression area and lossy compression area are used. Change the code amount control method.

また、タイルの符号化する順序は、タイルを単位とするラスタースキャン順、すなわち、左端タイルから右端タイル、右端タイルに到達した場合には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 server 204 will be described in more detail with reference to FIG. This figure shows the procedure of the application program executed by the CPU 201 in the server 204. The following processing is processing when an image request is received from the client 201. The image request from the client includes information for specifying the image (for example, a file name and an index number) and an upper limit value of data.

ステップ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 storage device 205. This image is an uncompressed image. In the present embodiment, it is assumed that the color space is RGB, the bit accuracy of each component is 8 [bit / channel], and the image size is 7040 × 4992 [pixel]. That is, the image before compression is about 100 [MB]. In step S302, the upper limit code amount D_max as a result of compressing the image acquired in step S301 is acquired. This is the upper limit value of the compressed data designated by the client. In this embodiment, it is assumed that 14 [MB] is designated from the memory capacity of the client. In step S303, the image acquired in step S301 is divided into tiles, and the total number of tiles Tsum is calculated. Since the tile size of this embodiment is 128 × 128 [pixel], Tsum = (7040/128) × (4992/128) = 55 × 39 = 2145 tiles. In step S305, the tile number counter T is initialized by substituting zero.

以下、ステップ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 JPEG 2000 encoding method otherwise. Whether or not the tile T includes many characters and line drawings can be estimated from various feature amounts by analyzing the tile T. For example, when the number of colors is small, it is determined as a character or line drawing, and when the number of colors is large, it is determined that there are many natural images. Alternatively, edge detection is performed, and if there are many edges, it is determined that there are many characters and line drawings, and if not, it is determined that there are many natural images. Various other methods are conceivable, but since they are not the main point of this proposal, a detailed description is omitted. In the present embodiment, edge detection is performed within the tile of interest, and if the number of pixels determined to be an edge is greater than a predetermined threshold, JPEG-LS encoding is performed assuming that many characters / line drawings are included, otherwise , JPEG2000 encoding shall be selected.

ステップ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 primary storage device 102, but the storage destination may be the secondary storage device 103. In step S309, the tile number T is incremented by one. In step S310, the tile number T is compared with the tile total number Tsum calculated in step S303. If T and Tsum are the same, it is determined that all the tiles have been encoded, and the process proceeds to step S311. If the two values are different, it is determined that there is a tile that has not been encoded yet, and the process returns to step S304.

ステップ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 areas 801 and 804 are compressed with JPEG 2000, and areas 802 and 803 are compressed with JPEG-LS. In this case, a JPEG2000 code string is generated assuming that no JPEG2000 code is generated for the tiles 802 and 803. The JPEG-LS code string has the same configuration. When the code string is generated in this way, the code string is transmitted to the client 201 or 202.

次に、ステップ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 maximum 2 bit plane (bit 0, 1 plane) that can be deleted is deleted.

ステップ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 bit 0 plane of all tiles that have been lossy encoded is deleted and D_ls + D_c <D_max is satisfied for the first time, the encoded data of the bit 0 plane of all tiles that have been lossy encoded will be deleted. To do. Further, when the bit 0 and bit 1 planes of all tiles subjected to lossy encoding are deleted and D_ls + D_c <D_max is satisfied for the first time, bits 0 and 1 of all tiles subjected to lossy encoding are satisfied. The encoded data of the plane is deleted.

次に、ステップ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 bit 0 to the upper bits are deleted until the upper limit value D_max or less, regardless of the number C of allowable deletion bit planes. .

以上の説明のように、実施形態におけるサーバ204は、可逆符号化(実施形態ではJPEG-LS)されたタイルと非可逆符号化(実施形態ではJPEG2000)されたタイルの符号化データを混在させた符号化画像データを生成することができる。しかも、削除許容範囲を示す削除ビットプレーン数C以下のビットプレーンの符号化データを削除することで、目標符号量(上限符号量D_max)以下の符号化データを生成する。しかし、複数の種類の符号化データが混在する場合、あくまでタイル境界における歪みを低減できるものの、歪みを完全に抑制することを保証するものではないし、画像によっては削除ビットプレーン数が“2”でも、タイル境界に歪みが発生し得る。そこで、本実施形態では、クライアント201(もしくは202)は、上記の符号化データを受信し、復号する場合に、タイルの境界における歪みの発生を更に抑制する復号処理を行なうこととした。   As described above, the server 204 in the embodiment mixes encoded data of tiles that are losslessly encoded (JPEG-LS in the embodiment) and tiles that are lossy encoded (in the embodiment, JPEG2000). Encoded image data can be generated. Moreover, the encoded data of the target code amount (upper limit code amount D_max) or less is generated by deleting the encoded data of the bit plane having the deletion bit plane number C or less indicating the deletion allowable range. However, when a plurality of types of encoded data coexist, distortion at the tile boundary can be reduced, but it is not guaranteed that distortion is completely suppressed, and even if the number of deleted bit planes is “2” depending on the image. Distortion can occur at the tile boundary. Therefore, in the present embodiment, when the client 201 (or 202) receives and decodes the encoded data, the client 201 (or 202) performs a decoding process that further suppresses the occurrence of distortion at the tile boundary.

以下、クライアント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 secondary storage device 103 in the client 201 into the primary storage 102 and executing it by the CPU 101. In the decoding process, the encoded data of each tile is decoded according to the encoding method applied thereto. In the process, image processing is applied to the decoded tile. In this processing, as shown in FIG. 10, the horizontal right direction is defined as the X direction, and the vertical downward direction is defined as the Y direction. In addition, after decoding of the tile of interest T (a, b) in the a-direction in the X direction and the b-th in the Y direction is completed, T (a, b-1) directly above is the reversible tile and the irreversible tile. It is determined which one. If the tile T (a, b-1) is an irreversible tile, the tiles adjacent to the right and down from T (a, b-1), that is, T (a + 1, b-1) , T (a, b) is determined. If any of the tiles is a reversible tile, it is determined that there is a non-photograph area near the boundary between the irreversible tile T (a, b-1) and the right or bottom adjacent tile determined to be reversible. To do. Then, a deblocking filter is applied to the corresponding boundary in order to alleviate the image quality difference occurring outside the same photographic area. Note that the reason for excluding the left direction and the upper direction from the deblocking filter is that, as described at the beginning of this embodiment, the leftmost pixel and the uppermost pixel of the tile to which JPEG2000 is applied are the rightmost pixel and the lowermost pixel. This is because the reliability is higher than that of the pixel. When the number of tiles in the X direction is Num_T_x, it is necessary to buffer Num_T_x + 1 decoded tiles in order to apply a deblocking filter.

図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 server 204 has transmitted encoded data within the requested range as a result of transmitting an image request (including information specifying an image and an upper limit value of the data amount) to the server 204. It is also an application program related to the decoding process executed by the CPU 801. It is also executed when decoding the encoded image data once stored in the secondary storage device.

ステップ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 CPU 801 stores the received code string in the primary storage device 802. In step S902, the header of the code string is analyzed, and information regarding the image and information regarding the encoding are acquired. Specifically, the vertical and horizontal (horizontal and vertical) size of the encoded image, the tile size, the number of tiles in the vertical and horizontal directions, flag information indicating whether each tile was compressed with JPEG2000 / JPEG-LS, JPEG2000 Get information such as / JPEG-LS code string length and the number of deleted bit planes. In step S903, the total number Tsum of tiles is calculated from the vertical and horizontal sizes and tile size information of the encoded image. In step S904, the tile counter T is initialized. Specifically, initialization is performed by substituting zero for the counter T for tile numbers. In step S905, the encoding method of the target tile T is confirmed from the header information obtained in step S902, and in step S906, it is identified whether it is reversible or irreversible. If it is determined that the tile T is encoded by the lossless encoding method as a result of the identification, JPEG-LS decoding is performed in step S907, and the decoding result (tile image) is secured in the primary storage device 102. Stored in the specified buffer. Furthermore, each tile updates an encoding scheme map indicating which encoding scheme is applied. Specifically, a flag “0” indicating that the tile T of interest has been encoded by JPEG-LS is described in the encoding method map. On the other hand, when it is determined that the encoding method of the tile T is JPEG2000, JPEG2000 is decoded in step S908, and the decoding result is stored in the buffer. Further, a flag “1” indicating that the tile of interest has been encoded by JPEG2000 is described in the encoding method map. Since both JPEG-LS and JPEG2000 decoding methods are well-known techniques, a description thereof is omitted here. Next, image processing is performed in step S909. This image processing is targeted for the tile positioned above the tile decoded in step S907 or step S908. Note that if the target tile is a tile that touches the upper side of the image, there is no tile to be processed, and therefore the process of S909 is not performed. As shown in FIG. 10, when the target tile T is the tile T (a, b), the tile subject to image processing is T (a, b-1). In this image processing, the encoding applied to the tile T (a, b-1) to be processed and the adjacent tiles T (a, b) and T (a + 1, b-1), respectively. A deblocking filter is performed based on the method. Details will be described later. In step S910, the tile subjected to the image processing in step S909 is output to the outside. This is because the corresponding tile is unnecessary in the subsequent processing. In step S911, the tile counter T is incremented, and in step S912, the size is compared with Tsum. If T <Tsum, there is an undecoded tile, and the process returns to step S905. If T = Tsum, the process proceeds to step S913.

ステップ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 server 204 of the above embodiment deletes the encoded data of up to two bit planes from the lossy encoded data. This is to suppress the occurrence of distortion at the tile boundary when lossless encoded data and lossy encoded data are mixed. When the number of deleted bit planes is less than 2, that is, when there is no deletion or when the encoded data of the bit 0 plane is deleted, it is assumed that no distortion occurs between the tiles, and this processing ends. However, when the number of deleted bit planes is 2, there is little probability that distortion will occur, but this is not guaranteed. Therefore, when the number of deleted bit planes is 2 or more, the generation of the distortion is suppressed by the decoding process in the processes after step S1203.

ステップ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 secondary storage device 803 shown in FIG. However, this may be implemented by hardware. An outline of the configuration in this case is shown in FIG. In the figure, reference numeral 806 denotes a code string input unit, and reference numeral 807 denotes a code string buffer. These blocks are used in the process of step S901 in FIG. Reference numeral 808 denotes a header analysis unit, which is used in step S902. Reference numeral 809 denotes a JPEG2000 decoding unit, which is used in step S908. Reference numeral 810 denotes a JPEG-LS decoding unit, which is used in step S907. Reference numeral 811 denotes a decoding tile buffer, which is used to store the decoding results of steps S907 and S908. An image processing unit 812 is used in steps S909 and S914. An output unit 813 is used in steps S910 and S915.

以上説明したように本実施形態によれば、非可逆符号化された第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 client 201 transmits the image request information to be transmitted to the server 204 including the maximum number of bit planes C in addition to the information specifying the image and the allowable data amount D_max. The server performs the encoding process based on these pieces of information. Since the encoding process is clear from the first embodiment, the description thereof will be omitted and the client-side decoding process will be described. .

ここで、可逆タイルと非可逆タイルの画質差を、より生じさせる圧縮条件で符号化した場合を考える。例えば、クライアント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 client 201 to the server 204 includes information for setting the maximum number C of deleted bit planes to 4. Then, consider a case where the server 204 returns encoded data in which reversible and lossy tiles are mixed and the 4-bit bit plane is deleted to the client 201. In this case, the difference in image quality between the reversible tile and the irreversible tile becomes larger. For this reason, in the first embodiment, the deblocking filters are applied in the right direction and the lower direction of the target irreversible tile, but deblocking filters in the upper direction and the left direction are also required. However, the reliability is different between the right or lower boundary pixel and the left or upper boundary pixel. For this reason, a deblocking filter is changed according to the boundary of filtering object. In the second embodiment, how to apply such a deblocking filter will be described. Note that the different processing compared to the first embodiment is the image processing in steps 910 and 915 in FIG. Therefore, in the following description, the process will be focused on.

図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 secondary storage device 803 using the number of deleted bit planes read from the file header to be decoded as a key. FIG. 23 is an example of the filter table. As shown in the figure, filter information used for two types of deblocking filter processes A and B is defined according to the number of deleted bitplanes. The deblocking filter process A is a filter process that corrects the pixels at the right end and the lower end in the tile, as in the first embodiment. The deblocking filter process B is a filter process for correcting the leftmost and uppermost pixels in the tile. In the figure, “-” indicates that the corresponding deblocking filter processing is not performed. For example, when the number of deleted bit planes is “2”, the deblocking filter process A is performed using the filter A0, but the deblocking filter process B is not performed. In the case of the embodiment, since it is a 3-tap filter process, three filter coefficients (weighting coefficients) are stored in one filter.

ステップ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 JPEG 2000, there is a characteristic that the reliability of the tile boundary pixel in the right direction and the downward direction in the tile becomes low. JPEG does not have such characteristics, and the reliability of pixels at any boundary does not change. In the third embodiment, attention is paid to this point, and a deblocking filter processing method in the case of using the irreversible method in which the reliability changes depending on the position of the boundary pixel and the irreversible method in which the reliability does not change will be described.

本第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 JPEG 2000 tile.

一方で、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の符号化手段で符号化された第1のタイプのタイルの符号化データと、前記第1の符号化手段とは異なる第2の符号化手段で符号化された第2のタイプのタイルの符号化データとが混在した符号化画像データを復号する画像処理装置であって、
各タイルの符号化データが、いずれの符号化手段による符号化データであるのかを識別する識別手段と、
該識別手段の識別結果に従い、各タイルの符号化データについて該当する種類の復号処理を実行することでタイル画像を生成する復号処理手段と、
前記識別手段による識別結果に基づき、前記復号処理手段による復号処理で得られたタイル画像で構成される画像中の、前記第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に記載の画像処理装置。   The filter processing means executes filter processing using a filter having a plurality of weighting factors based on high reliability of the first encoding means and the second encoding means. The image processing apparatus according to claim 1. 前記第1の符号化手段はJPEG2000の符号化手段であり、前記第2の符号化手段は可逆な符号化手段であることを特徴とする請求項1又は2に記載の画像処理装置。   The image processing apparatus according to claim 1, wherein the first encoding unit is a JPEG2000 encoding unit, and the second encoding unit is a reversible encoding unit. 前記第2の符号化手段は、JPEG-LSの符号化手段であることを特徴とする請求項3に記載の画像処理装置。   The image processing apparatus according to claim 3, wherein the second encoding unit is a JPEG-LS encoding unit. 前記第1のタイプのタイル内の右端画素、下端画素、左端画素、上端画素のうち、右端画素及び下端画素の信頼度は、左端画素及び上端画素の信頼度よりも低いものとし、前記タイル境界が右側または下側に位置する場合のフィルタと、前記タイル境界が左側、上側に位置する場合のフィルタそれぞれのフィルタ係数とを記憶する記憶手段を有することを特徴とする請求項3又は4に記載の画像処理装置。   Among the right end pixel, the lower end pixel, the left end pixel, and the upper end pixel in the first type tile, the reliability of the right end pixel and the lower end pixel is lower than the reliability of the left end pixel and the upper end pixel, and the tile boundary 5. The storage device according to claim 3, further comprising: a storage unit configured to store a filter when the tile boundary is located on the right side or the lower side and a filter coefficient of each filter when the tile boundary is located on the left side or the upper side. Image processing apparatus. 前記第1の符号化手段はJPEG2000の符号化手段であり、前記第2の符号化手段は非可逆なJPEGの符号化手段であることを特徴とする請求項1又は2に記載の画像処理装置。   3. The image processing apparatus according to claim 1, wherein the first encoding unit is a JPEG2000 encoding unit, and the second encoding unit is an irreversible JPEG encoding unit. . 前記第1のタイプのタイルの右側、又は、下側に前記第2のタイプのタイルが隣接する場合、前記フィルタ処理手段は前記第1のタイプのタイル内の前記第2のタイプのタイルと接する側の画素をフィルタ処理すると共に、前記第2のタイプのタイル内の前記第1のタイプのタイルに接する画素についてもフィルタ処理を行なうことを特徴とする請求項6に記載の画像処理装置。   When the second type tile is adjacent to the right side or the lower side of the first type tile, the filtering means touches the second type tile in the first type tile. The image processing apparatus according to claim 6, wherein the pixel on the side is filtered, and the pixel that is in contact with the first type tile in the second type tile is also filtered. 前記フィルタ処理手段が用いるフィルタの複数の係数は、更に前記第1の符号化手段による符号量制御に係る符号化パラメータに基づいて決定されることを特徴とする請求項1乃至7のいずれか1項に記載の画像処理装置。   The plurality of coefficients of the filter used by the filter processing unit are further determined based on an encoding parameter related to code amount control by the first encoding unit. The image processing apparatus according to item. 前記符号化パラメータは、非可逆符号化する際に削除したビットプレーンの数が含まれることを特徴とする請求項8に記載の画像処理装置。   The image processing apparatus according to claim 8, wherein the encoding parameter includes the number of bit planes deleted when performing lossy encoding. 非可逆な第1の符号化手段で符号化された第1のタイプのタイルの符号化データと、前記第1の符号化手段とは異なる第2の符号化手段で符号化された第2のタイプのタイルの符号化データとが混在した符号化画像データを復号する画像処理装置の制御方法であって、
識別手段が、各タイルの符号化データが、いずれの符号化手段による符号化データであるのかを識別する識別工程と、
復号処理手段が、前記識別工程の識別結果に従い、各タイルの符号化データについて該当する種類の復号処理を実行することでタイル画像を生成する復号処理工程と、
検出手段が、前記識別工程による識別結果に基づき、前記復号処理工程による復号処理で得られたタイル画像で構成される画像中の、前記第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:
コンピュータに読み込ませ実行させることで、前記コンピュータに、請求項9に記載の各工程を実行させるためのプログラム。   The program for making the said computer perform each process of Claim 9 by making a computer read and run. 請求項11に記載のプログラムを格納した、コンピュータが読み取り可能な記憶媒体。   A computer-readable storage medium storing the program according to claim 11.
JP2013037691A 2013-02-27 2013-02-27 Image processing device and control method therefor Pending JP2014165868A (en)

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)

* Cited by examiner, † Cited by third party
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

Cited By (2)

* Cited by examiner, † Cited by third party
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